2.5 KiB
2.5 KiB
Agent Configuration Specification v1.0
Defines what "well-configured" means for AI agent development across all coding projects.
CLAUDE.md — Required Sections
Tier 1 (Required — blocks audit pass)
- Conditional Documentation Loading — Table linking to
~/.mosaic/guides/ - Quality Gates — Bash commands that must pass before commit (build, test, lint, typecheck)
- Build/Test/Lint commands — How to build, test, and lint the project
Tier 2 (Recommended — logged as warning)
- Technology Stack table
- Repository Structure tree
- Commit format reference
- Secrets management note
- Multi-agent coordination note
- Campsite Rule — "Touching it makes it yours" policy for code violations
Tier 3 (Optional — nice to have)
- Code Review section (Codex commands)
- Issue Tracking workflow
- Session Protocol (start/end)
AGENTS.md — Required Sections
Tier 1 (Required)
- Codebase Patterns — At least one entry or placeholder with instructive comments
- Common Gotchas — At least one entry or placeholder with instructive comments
- Quality Gates — Duplicated for quick agent reference
Tier 2 (Recommended)
- Key Files table
- Testing Approaches section
Monorepo Sub-AGENTS.md
Required in any directory under apps/, packages/, services/, or plugins/
that contains its own package.json or pyproject.toml.
Minimum content:
- Purpose (one line)
- Patterns (at least placeholder)
- Gotchas (at least placeholder)
Detection Markers
The agent-lint.sh tool checks for these markers:
| Check | Pass Criteria |
|---|---|
| CLAUDE.md exists | File present at project root |
| AGENTS.md exists | File present at project root |
| Conditional context/loading | CLAUDE.md contains ~/.mosaic/guides or Conditional + Loading/Context |
| Quality gates | CLAUDE.md contains Quality Gates or quality commands (test, lint, typecheck) |
| Monorepo sub-agents | Each app/package dir with own manifest has AGENTS.md |
Fragment Sources
Shared sections are maintained in ~/.mosaic/templates/agent/fragments/:
| Fragment | Injects Section |
|---|---|
conditional-loading.md |
Conditional Documentation Loading table |
commit-format.md |
Commit format convention |
secrets.md |
Secrets management note |
multi-agent.md |
Multi-agent coordination protocol |
code-review.md |
Code review commands |
campsite-rule.md |
Campsite Rule — fix violations you touch |