Skip to content

Extract project conventions into AGENTS.md; slim CLAUDE.md#2703

Merged
tatiana merged 3 commits into
mainfrom
claude-md-extract-agents-md
May 27, 2026
Merged

Extract project conventions into AGENTS.md; slim CLAUDE.md#2703
tatiana merged 3 commits into
mainfrom
claude-md-extract-agents-md

Conversation

@tatiana
Copy link
Copy Markdown
Collaborator

@tatiana tatiana commented May 19, 2026

Summary

Make the project's agent guidance reusable across AI coding tools:

  • Move every agent-neutral section of CLAUDE.md (commands, architecture, coding standards, commit-message format, documentation style, etc.) into a new top-level AGENTS.md. The content is byte-identical apart from the introductory paragraph, which is rewritten in agent-neutral language and names CLAUDE.md as the canonical place for Claude-only overrides.
  • Slim CLAUDE.md to a small pointer that defers to AGENTS.md. The pointer remains the file Claude Code reads on session start, but it no longer duplicates project conventions. Claude-specific instructions can accumulate there in the future without diverging from the shared baseline.
  • Document the AI-agent attribution convention (originally PR Document the AI agent attribution convention #2718, since folded into this branch): give the assisting agent visible credit via a trailing 🤖 Generated with … marker, never via a Co-Authored-By trailer (that surfaces in the GitHub contributor graph and git shortlog, which should stay human-only).
  • Add AGENTS.md to the Check-changed-files allowlist in .github/workflows/test.yml so docs-only edits to AGENTS.md don't trigger the full unit/integration matrix, mirroring how CLAUDE.md is already handled.

This unlocks other agents — Cursor, Codex, Copilot, etc. — using the same conventions Claude already does, without us maintaining parallel copies.

Review feedback addressed

  • Copilot: add AGENTS.md to the Check-changed-files allowlist in .github/workflows/test.yml (mirrors the existing CLAUDE.md line).
  • Copilot: change British "behaviour" to American "behavior" in the AGENTS.md intro paragraph for consistency with the rest of the document.

Rebased onto main

The original revision was stacked on claude-md-require-precommit (PR #2702). #2702 has since squash-merged to main (commit ea04d0da), so this branch has been rebased onto the current main. The redundant pre-squash commits were dropped during rebase (693c3d9c identified as "patch contents already upstream"; f8a6bf03 skipped manually).

The companion attribution-convention PR #2718 has also been folded into this branch since it built on top of claude-md-extract-agents-md.

Test plan

  • pre-commit run --files CLAUDE.md AGENTS.md .github/workflows/test.yml — all applicable hooks pass locally.
  • CI run on this PR — pre-commit.ci passes; the full unit/integration matrix runs (because this PR touches .github/workflows/test.yml, which is not — and should not be — on the allowlist). Future docs-only AGENTS.md PRs will skip the matrix.

🤖 Generated with Claude Code (https://claude.com/claude-code)

Copilot AI review requested due to automatic review settings May 19, 2026 11:26
@tatiana tatiana requested review from a team, corsettigyg, dwreeves and jbandoro as code owners May 19, 2026 11:26
@tatiana tatiana requested review from pankajastro and pankajkoti May 19, 2026 11:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the repository’s AI-agent guidance so that project conventions live in a tool-agnostic document (AGENTS.md), while CLAUDE.md becomes a small Claude Code entrypoint that defers to the shared conventions.

Changes:

  • Add AGENTS.md containing the previously shared, agent-neutral guidance (commands, architecture, coding standards, docs style, etc.).
  • Replace the bulk of CLAUDE.md with a short pointer to AGENTS.md, reserving CLAUDE.md for future Claude-specific overrides.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
CLAUDE.md Slimmed to a Claude Code-specific pointer to the shared conventions in AGENTS.md.
AGENTS.md New shared conventions document intended to be reused across multiple AI coding agents/tools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md
@tatiana tatiana force-pushed the claude-md-extract-agents-md branch from 9f26fb3 to e83e9d0 Compare May 19, 2026 11:35
@tatiana tatiana changed the base branch from main to claude-md-require-precommit May 19, 2026 11:35
Base automatically changed from claude-md-require-precommit to main May 19, 2026 11:48
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.04%. Comparing base (5b8ade7) to head (a77495e).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2703   +/-   ##
=======================================
  Coverage   98.04%   98.04%           
=======================================
  Files         105      105           
  Lines        7867     7867           
=======================================
  Hits         7713     7713           
  Misses        154      154           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure of the impacts, but let's try and see.

Comment thread AGENTS.md
tatiana added a commit that referenced this pull request May 22, 2026
Add a short "AI agent attribution" subsection to `AGENTS.md`: when a
commit or PR is drafted with an AI coding agent, give the agent credit
via a `🤖 Generated with …` marker line rather than a `Co-Authored-By`
trailer, so the GitHub contributor graph stays human-only.

Stacked on #2703 (which introduces `AGENTS.md`); GitHub will
auto-retarget to `main` once #2703 merges.

🤖 Generated with Claude Code (https://claude.com/claude-code)
Copilot AI review requested due to automatic review settings May 22, 2026 11:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread AGENTS.md
Comment thread AGENTS.md Outdated
tatiana and others added 3 commits May 27, 2026 15:46
Move all agent-neutral project guidance (commands, architecture,
coding standards, commit-message format, documentation style, etc.)
out of CLAUDE.md and into a new AGENTS.md so that other AI coding
agents -- Cursor, Codex, Copilot, and so on -- read the same single
source of truth.

CLAUDE.md becomes a thin pointer that defers to AGENTS.md and is
reserved for Claude Code-specific instructions. There are currently
none, so the file is intentionally short; future Claude-only
overrides should accumulate there rather than diverging from the
shared baseline.

The content moved is byte-identical to what CLAUDE.md previously
contained, with one exception: the introductory paragraph in
AGENTS.md is rewritten in agent-neutral language to make the
intended audience explicit and to point at CLAUDE.md as the
canonical place for Claude-only overrides.

This PR is stacked on top of #2702 (claude-md-require-precommit) so
the pre-commit rule it adds is already present in AGENTS.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a short "AI agent attribution" subsection to `AGENTS.md`: when a
commit or PR is drafted with an AI coding agent, give the agent credit
via a `🤖 Generated with …` marker line rather than a `Co-Authored-By`
trailer, so the GitHub contributor graph stays human-only.

Stacked on #2703 (which introduces `AGENTS.md`); GitHub will
auto-retarget to `main` once #2703 merges.

🤖 Generated with Claude Code (https://claude.com/claude-code)
- Add ``AGENTS.md`` to the ``Check-changed-files`` allowlist in
  ``.github/workflows/test.yml`` so docs-only ``AGENTS.md`` edits do
  not trigger the full unit/integration test matrix. Mirrors how
  ``CLAUDE.md`` is already handled on the same allowlist.
- Change British "behaviour" to American "behavior" in the
  ``AGENTS.md`` intro paragraph for consistency with the rest of
  the document, which uses American spelling throughout (e.g.,
  "Test Behavior").

🤖 Generated with Claude Code (https://claude.com/claude-code)
@tatiana tatiana force-pushed the claude-md-extract-agents-md branch from a77495e to 6aa1380 Compare May 27, 2026 14:53
@tatiana
Copy link
Copy Markdown
Collaborator Author

tatiana commented May 27, 2026

Status update on this PR:

  • Rebased onto current main to clear the merge conflict caused by #2702 (which this branch was stacked on) squash-merging as ea04d0da. The two redundant pre-squash commits were dropped during rebase; a77495eb ("Document the AI agent attribution convention") was preserved as it had not yet landed elsewhere.
  • Addressed both Copilot review items:
    • Added AGENTS.md to the Check-changed-files allowlist in .github/workflows/test.yml (discussion). Mirrors how CLAUDE.md is already handled. Note: the full unit/integration matrix still runs on this PR because the PR touches .github/workflows/test.yml itself, which is not (and should not be) on the allowlist. The allowlist change takes effect for future docs-only AGENTS.md edits.
    • Changed British "behaviour" → American "behavior" in the AGENTS.md intro paragraph for consistency with the rest of the document (discussion).
  • pre-commit.ci is now passing (was previously failing on "error during mergeable check", caused by the merge conflict).

@pankajkoti — the previous approval was on the pre-rebase commit hash and has been invalidated by the force-push. Could you take another look?

@tatiana tatiana merged commit 8172d38 into main May 27, 2026
123 of 125 checks passed
@tatiana tatiana deleted the claude-md-extract-agents-md branch May 27, 2026 15:31
@tatiana tatiana added this to the Cosmos 1.15.0 milestone May 28, 2026
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.

4 participants