Summary
The init command should copy an AGENTS.md template to the project root if the file does not already exist. This gives coding agents (Claude Code, Cursor, Codex, etc.) project-specific instructions from day one.
Context
AGENTS.md is already referenced in the codebase:
agent_fox/fix/analyzer.py:44 — _CONVENTION_FILES = ("CLAUDE.md", "AGENTS.md", "README.md") — the analyzer loads conventions from one of these files
- Skills
af-spec and af-fix mention AGENTS.md in their documentation
But init never creates it. Users have to know about the convention and write the file manually.
Requirements
- Create an
AGENTS.md template — either as a static file in agent_fox/_templates/ or generated inline (like config.toml)
- During
agent-fox init, write the template to {project_root}/AGENTS.md only if the file does not already exist (idempotent, same pattern as .claude/settings.local.json)
- Re-init (
agent-fox init on existing project) should not overwrite a user-modified AGENTS.md
- Template content should include agent-fox-specific instructions: spec-driven workflow, branch conventions (
develop/feature/*), make check before committing, and pointers to .specs/ and docs/
Implementation Notes
init is defined in agent_fox/cli/init.py:92-184
- The command has no template-copy mechanism today — everything is generated inline or via Pydantic introspection. A simple
Path.write_text() with an existence check is sufficient.
- Consider using
importlib.resources or Path(__file__) to locate the template if stored as a static file
Open Questions
- Should the template be minimal (section headers only, user fills in) or pre-populated with agent-fox conventions?
- Should it be git-tracked by default, or added to
.gitignore? (Recommendation: git-tracked, since it's project-specific configuration for agents)
Summary
The
initcommand should copy anAGENTS.mdtemplate to the project root if the file does not already exist. This gives coding agents (Claude Code, Cursor, Codex, etc.) project-specific instructions from day one.Context
AGENTS.mdis already referenced in the codebase:agent_fox/fix/analyzer.py:44—_CONVENTION_FILES = ("CLAUDE.md", "AGENTS.md", "README.md")— the analyzer loads conventions from one of these filesaf-specandaf-fixmentionAGENTS.mdin their documentationBut
initnever creates it. Users have to know about the convention and write the file manually.Requirements
AGENTS.mdtemplate — either as a static file inagent_fox/_templates/or generated inline (likeconfig.toml)agent-fox init, write the template to{project_root}/AGENTS.mdonly if the file does not already exist (idempotent, same pattern as.claude/settings.local.json)agent-fox initon existing project) should not overwrite a user-modifiedAGENTS.mddevelop/feature/*),make checkbefore committing, and pointers to.specs/anddocs/Implementation Notes
initis defined inagent_fox/cli/init.py:92-184Path.write_text()with an existence check is sufficient.importlib.resourcesorPath(__file__)to locate the template if stored as a static fileOpen Questions
.gitignore? (Recommendation: git-tracked, since it's project-specific configuration for agents)