Goal
Create or improve repo-local agent context so future agents can work from the repository's real commands, docs, issue tracker rules, domain language, ADRs, validation commands, and skill routing without overwriting existing instructions.
When to use
- A repository lacks
AGENTS.mdor agent-facing docs. - The user wants Codex, Claude Code, Cursor, or another agent to follow local workflow rules.
- A repo needs issue tracker notes, triage labels, domain docs, ADR locations, or validation commands documented.
- A downstream repo needs predictable first-run agent setup before using workflow skills.
When not to use
- The user only wants a one-time handoff; use
handoff. - The user wants a repo health report without changing context files; use
repo-health-audit. - The repository already has clear agent instructions and the user did not ask for edits.
- The user wants to publish a skill catalog; use
skill-repo-curator.
Inputs to inspect
- Existing
AGENTS.md,CLAUDE.md,.codex/,.cursor/,CONTEXT.md,CONTEXT-MAP.md, and docs files. README.md, package files, validation scripts, CI workflows, issue templates, labels, and.github/.docs/adr/, architecture docs, domain docs, and existingdocs/agents/.- Maintainer-provided issue tracker, triage labels, validation commands, runtime conventions, and domain-specific workflow notes.
git status --shortbefore editing.
Workflow
- Inspect current agent instructions and docs before proposing edits.
- Infer what is safe from repo files: package manager, validation scripts, ADR location, CI commands, issue templates, and existing domain docs.
- Ask for maintainer input only when the repo cannot answer a hard setup decision: issue tracker, live label names, domain glossary location, validation command, or agent runtime convention.
- Create or update
docs/agents/issue-tracker.md,docs/agents/triage-labels.md,docs/agents/domain-docs.md,docs/agents/validation.md, anddocs/agents/skill-routing.md. - Add or update an
## Agent skillsblock in the primary agent instruction file, usuallyAGENTS.md. - Preserve existing user instructions and never overwrite unrelated sections.
- Validate links, formatting, and available repo checks.
Setup docs
Use these conventions when writing downstream setup docs:
- Hard dependencies, such as issue tracker mutation rules, must point to
docs/agents/issue-tracker.mdanddocs/agents/triage-labels.md. - Validation commands belong in
docs/agents/validation.md. - Skill routing and local skill preferences belong in
docs/agents/skill-routing.md. - Soft dependencies, such as domain language and ADRs, should point to
docs/agents/domain-docs.mdwithout blocking normal work when the docs are missing.
Ask vs infer
- Infer package manager, validation scripts, ADR location, issue templates, CI commands, and existing docs from files.
- Ask for the canonical issue tracker when none is obvious.
- Ask before inventing labels, project board states, assignment rules, or live mutation policy.
- Ask for domain glossary ownership if multiple docs could be the source of truth.
- Ask before replacing existing agent instructions; otherwise append or update bounded sections only.
Safety rules
- Do not overwrite existing instructions blindly.
- Do not include credentials, internal hostnames, private repo paths, or customer details.
- Do not assert commands work unless verified.
- Do not create tool-specific files such as
CLAUDE.mdor.cursor/rulesunless the repo already uses them or the user asks for that runtime. - Do not mutate live issue trackers, labels, projects, or repository settings.
Assets
Use only when creating new files:
assets/agents-block.mdfor anAGENTS.mdskill block.assets/issue-tracker.mdfor tracker notes.assets/triage-labels.mdfor label conventions.assets/domain-docs.mdfor domain documentation mapping.assets/domain-language.mdfor glossary structure.assets/validation.mdfor validation commands.assets/skill-routing.mdfor skill selection guidance.
References
Read only when needed:
assets/agents-block.mdassets/domain-docs.mdassets/domain-language.mdassets/issue-tracker.mdassets/skill-routing.mdassets/triage-labels.mdassets/validation.md
Scripts
No bundled scripts.
Output format
Return:
- Files inspected
- Context added or proposed
- Existing instructions preserved
- Validation result
- Follow-up decisions needed
Failure modes
- If the issue tracker is unknown, stop before writing tracker-specific instructions.
- If existing instructions conflict, surface the conflict instead of overwriting.
- If validation cannot run, explain what tool or command is missing.
- If the repo has no domain glossary, create a placeholder or document the selected source of truth without inventing domain vocabulary.
Completion criteria
- Future agents can find repo rules, validation commands, issue tracker guidance, and domain docs.
- Existing instructions remain intact unless intentionally changed.
- Sensitive details are excluded.
- Hard workflow dependencies point to
docs/agents/setup docs.