Deliver canonical AGENTS.md to Claude Code and Codex root instructions - #138
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideExtends the existing root instructions symlink capability to Claude Code and Codex so they both use a canonical AGENTS.md under the dotagents repo, and adds table-driven tests plus documentation to verify native paths, inspection states, and sync behavior across harnesses. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The helper functions
claudeCodeRootInstructionsandcodexRootInstructionspanic on configuration issues even when called from tests; consider returning*RootInstructionsCapabilityand usingt.Fatalfin the tests instead so failures are scoped and reported via the testing framework. - In
TestRootInstructionsNativePaths, the table-driven assertions run directly in the parent test; wrapping each case int.Run(tc.agent, ...)would make failures easier to attribute and keep the pattern consistent with the other table-driven tests you added. - The agent/table definitions for Claude Code and Codex in
TestInspectClaudeAndCodexRootInstructionsandTestApplyAgentRootInstructionSyncClaudeAndCodexare very similar; consider extracting a shared table or small helper to reduce duplication and keep the mapping between agent, dir, and filename centralized.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The helper functions `claudeCodeRootInstructions` and `codexRootInstructions` panic on configuration issues even when called from tests; consider returning `*RootInstructionsCapability` and using `t.Fatalf` in the tests instead so failures are scoped and reported via the testing framework.
- In `TestRootInstructionsNativePaths`, the table-driven assertions run directly in the parent test; wrapping each case in `t.Run(tc.agent, ...)` would make failures easier to attribute and keep the pattern consistent with the other table-driven tests you added.
- The agent/table definitions for Claude Code and Codex in `TestInspectClaudeAndCodexRootInstructions` and `TestApplyAgentRootInstructionSyncClaudeAndCodex` are very similar; consider extracting a shared table or small helper to reduce duplication and keep the mapping between agent, dir, and filename centralized.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends RootInstructionsCapability (today Droid-only) to Claude Code and Codex:
~/.claude/CLAUDE.md-><config-root>/AGENTS.md~/.codex/AGENTS.md-><config-root>/AGENTS.mdSync/inspect/report/doctor paths are generic over the capability, so both harnesses inherit missing/drifted/conflict handling: missing links are created on sync, drifted links re-pointed, non-symlink files reported as conflicts and never touched without confirmation. One canonical AGENTS.md edit now reaches Claude Code, Codex, and Droid.
Tests: table-driven inspect coverage (missing/synced/conflict) for both harnesses, native-path assertions, sync-application test; one existing claude-code report test updated to pre-create the link, matching post-setup reality. README documents the surface.
Summary by Sourcery
Propagate canonical root instructions to Claude Code and Codex through their native instruction paths.
New Features:
~/.agents/AGENTS.mdroot instructions into Claude Code and Codex native instruction paths alongside Droid.Enhancements:
Documentation:
Tests: