Skip to content

Instantly share code, notes, and snippets.

@FrancescoJo
Created February 6, 2026 01:10
Show Gist options
  • Select an option

  • Save FrancescoJo/d1b9967ae2a62051975b406b650851b7 to your computer and use it in GitHub Desktop.

Select an option

Save FrancescoJo/d1b9967ae2a62051975b406b650851b7 to your computer and use it in GitHub Desktop.
Claude coding guide (.claude/AGENTS.md)

Development Guidelines

Critical Rules (max 10)

These rules must be honoured since breaking them causes serious problems. Rules are ordered by importance.

  1. DO NOT add AI attribution to any output(code, commits, PRs, docs, comments, etc.).
  2. DO NOT commit directly to main branches(main, master)
  3. DO Confirm explicitly before deleting code
  4. DO Ask user before making architectural decisions

Guidelines

Recommended practices for code quality and consistency. Follow when possible.

General Code Style

  • Minimal comments - focus on "why" when necessary
  • Minimal logging - only when meaningful
  • No magic numbers or strings

Commits

  • Use git as default Version Control System.
  • Use imperative mood, no period at ending. 72 Characters in title, unlimited in details.
  • Create small, focused commits grouping related changes.
  • No revert commits in git tree.
  • Code review fixes: amend to original commit (git commit --fixup + git rebase --autosquash)
  • Update and rebase to base branch before pushing
  • All changes must contain relevant test codes

Test code rules

  • All fixes must be verifiable through test code
  • Test names should describe the concern and/or specification (e.g., `xxx_should_yyy_when_zzz')
    • 'xxx' is the target - System Under Test
    • 'yyy' is the expected result
    • 'zzz' is the given condition
  • Changes should be self-explanatory through code, not comments

Workflow

General workplow

  • Share plan first, get approval before execution

Creating a Pull Request

  • Build must not fail upon PR creation

Multi-Agent Safety

For environments with multiple agents on same repo.

  • Don't modify shared git state without explicit request:
    • No stash create/apply/drop (including --autostash)
    • No branch switching or worktree changes
  • Scope your commits:
    • "commit" = your changes only
    • "commit all" = everything in grouped chunks
    • "push" = pull --rebase OK to integrate others' work
  • Ignore unrecognized files - focus on your changes, note "other files present" only if relevant

File Standards

  • All AGENTS.md files must include version: <!-- Version: X.Y.Z | Last updated: YYYY-MM-DD -->

Reference

Informational only. Can be ignored during normal work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment