Skip to content

docs: expand AGENTS.md with git workflow, boundaries and code style examples - #5526

Draft
jamescrosswell wants to merge 2 commits into
mainfrom
docs/agents-md-improvements
Draft

docs: expand AGENTS.md with git workflow, boundaries and code style examples#5526
jamescrosswell wants to merge 2 commits into
mainfrom
docs/agents-md-improvements

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

#skip-changelog

Audits AGENTS.md against the six areas that GitHub's analysis of agent instruction files found separate the ones that work from the ones that don't — commands, testing, project structure, code style, git workflow, boundaries — and fills the gaps. The file was already strong on commands, testing and structure; this covers the other three.

Git Workflow (new)

The biggest gap. The old Changelog section said entries are "generated automatically from Commit message conventions" and linked out, but never stated the format — so an agent reading only this file couldn't write a compliant one. It was also slightly wrong: squash-merge means the PR title becomes the commit message and therefore the changelog line, not the individual commits. The new section says that explicitly and adds the prefix → CHANGELOG section table taken from .github/release.yml, including the ! → Breaking Changes case.

Also documents the git add -A submodule hazard (staging stale working copies under modules/ silently reverts a recorded pointer inside an unrelated commit) and the auto-close keyword requirement for issue links.

Boundaries (new)

The never-edit rules all existed already, but were scattered across four sections, so absorbing them required reading the whole file. Now one table — *.slnf, CHANGELOG.md, the Cocoa bindings, modules/**, *.verified.* — each with what to do instead. Adds never-commit-secrets and an ask-first tier for breaking public API, new dependencies, and CI workflow changes.

Code Style

Was three paragraphs of prose about comments and nothing else. Now names .editorconfig as authoritative and dotnet format as the enforcer, and demonstrates the no-comments rule with ❌/✅ snippets. The ✅ example is a real comment from src/Sentry/Internal/DebugStackTrace.cs rather than an invented one.

Before you're done

CONTRIBUTING.md tells humans to run ./build.sh before pushing; AGENTS.md never said what "finished" means. Adds the build/test/format gate, plus a git status note — the API approval tests call Verify's AutoVerify (test/Sentry.Testing/ApiExtensions.cs), so a local run silently rewrites *.verified.txt and still reports green.

Notes for review

  • CLAUDE.md and .github/copilot-instructions.md are symlinks to AGENTS.md, so this one file covers all three agent vendors — no drift to keep in sync.
  • I dropped a claim while drafting: "samples use placeholder DSNs" isn't true (samples/ has a real DSN for a Sentry demo project), so the secrets rule is worded without it.
  • The article is really about Copilot custom agent files (.github/agents/*.agent.md), so its YAML frontmatter / persona / "create six named agents" advice is deliberately not applied here. Only the six-areas finding transfers to a repo-root AGENTS.md.

jamescrosswell and others added 2 commits September 1, 2026 11:07
…xamples

Fills the gaps against the six areas that matter for agent instruction files:
commands, testing, project structure, code style, git workflow and boundaries.

- Git Workflow: the PR title is the changelog line, so document the
  conventional-commit format and the prefix -> CHANGELOG section mapping from
  .github/release.yml. The previous wording pointed at "commit message
  conventions" without ever stating the format.
- Boundaries: collect the five never-edit paths (generated, vendored or
  CI-guarded) into one table with what to do instead; add never-commit-secrets
  and an ask-first tier.
- Code Style: name .editorconfig as authoritative, dotnet format as the
  enforcer, and show the no-comments rule as good/bad snippets.
- Before you're done: the build/test/format gate, plus a note that the API
  approval tests self-rewrite their snapshots on a local run.
- Promote Code Intelligence to a top-level heading; it was nested under
  Commit Attribution.

CLAUDE.md and .github/copilot-instructions.md are symlinks to AGENTS.md and
pick these up unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant