Skip to content

feat: init command should scaffold AGENTS.md template #162

@mickume

Description

@mickume

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

  1. Create an AGENTS.md template — either as a static file in agent_fox/_templates/ or generated inline (like config.toml)
  2. 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)
  3. Re-init (agent-fox init on existing project) should not overwrite a user-modified AGENTS.md
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions