Agent Context Generator
What You'll Do
- 🔍 Inventory the repository's structure, capture a
.gitignore-aware tree output, and record automation entry points (preferring just/make tasks when available)
- 🧭 Capture coding conventions, directory ownership, testing expectations, and review workflows so future agents can navigate confidently
- 🧩 Produce an
AGENTS.md file following the opinionated section order below, honoring scope rules for nested directories
- ✅ Embed universal wrap-up tasks: ensure the README is updated after significant code changes and summarize changes per conventional commits while resolving any open questions with the developer
Phase 1 · Understand the Repository
- Check for existing AGENTS.md
- Use
find alternative (glob or repo tree) to discover current files. Determine scope inheritance so you can update or extend instead of duplicating.
- Read Core Docs
- Skim
README.md, CONTRIBUTING.md, and other onboarding docs for project philosophy, setup, and workflows.
- If
docs/ or documentation/ exists, scan for architectural or process references worth surfacing.
- Survey Project Layout
- Note primary directories, languages, build targets, and ownership (e.g., "
src/ui maintained by Frontend team").
- Check for
plans/, docs/, or other knowledge directories. Flag must-read files (ADR indexes, architecture overviews, runbooks) to reference later in AGENTS.md.
- Build a Git-aware Tree
- Use the
tree command with the --gitignore flag (tree ≥ 2.0) so ignored paths stay hidden: tree --gitignore -a -L 3 > tmp/tree.txt.
- If your
tree build lacks --gitignore, run tree -a -L 3 --prune and manually prune any ignored directories noted in .gitignore, or install an updated version via your package manager.
- Capture or trim the output before placing it in AGENTS.md (focus on the top 2–3 levels, and note when you omitted details for brevity).
- Identify Automation Runners
- If
Justfile exists, run just --list (or just --list --unsorted for extra notes).
- If
Makefile exists (and just does not), run make help or inspect phony targets for canonical tasks.
- Record which commands are recommended for linting, testing, building, syncing data, etc. Link the definitive task names you surface in your notes for inclusion later.
- Catalog Tooling & Environment
- List required runtimes, package managers, env vars, secrets handling, and local services.
- Note down any
.env.example, config/, or secrets documentation that agents must review.
- Clarify Testing & Quality Gates
- Identify test suites, coverage expectations, linting, formatting, and CI workflows.
- Resolve Ambiguities Early
- Whenever conventions, ownership, or workflows seem unclear, prompt the developer with focused questions before drafting the guide.
- Ask explicitly whether existing
plans/ or documentation directories are authoritative or stale, and clarify what canon to reference.
Outcome: A structured notes list describing layout, tooling, commands, testing, release process, documentation references, pending questions, and update expectations.
Phase 2 · Plan the AGENTS.md Structure
Follow this opinionated order to keep files consistent and scannable:
- Header — Title + short purpose statement.
- Quick Facts — Table or bullet summary (languages, package manager, key scripts, CI).
- Repository Tour — High-level directory map with responsibilities and ownership hints.
- Tooling & Setup — Required runtimes, package managers, environment variables, secrets.
- Common Tasks — Lint/test/build/deploy commands. Prefer listing
just recipes first, then make targets, then raw commands.
- Testing & Quality — When and how to run tests, linting, formatting, coverage, and CI expectations.
- Workflow Expectations — Branching model, review norms, feature flagging, deployment cadence.
- Documentation Duties — When to update
README.md, architecture diagrams, or other docs.
- Finish the Task — Mandatory wrap-up checklist for every agent task.
For deeper directories (e.g., services/api/), include a "Scope" note at the top clarifying inheritance from parent AGENTS instructions. Always confirm with the developer before drafting new per-directory AGENTS files so you do not duplicate existing guidance or create unnecessary overhead.
Phase 3 · Compose AGENTS.md
Use the template below and adapt each section to the project:
# Project Agent Guide
> Scope: Root project (applies to all subdirectories unless overridden)
## Quick Facts
- **Primary language:**
- **Package manager:**
- **Entrypoints:**
- **CI/CD:**
## Repository Tour
- `path/` — description & owner
## Tooling & Setup
- Install instructions (per OS)
- Required environment variables (with purpose)
- Secrets management notes
## Common Tasks
- `just <task>` — what it does (preferred)
- `make <target>` — what it does
- Raw command fallback when automation missing
## Testing & Quality Gates
- Unit/integration test commands
- Lint/format commands
- Coverage expectations & thresholds
- CI status command or dashboard link
## Workflow Expectations
- Branch naming and review rules
- Feature toggles or release cadence
- Any approval or ticket linkage requirements
## Documentation Duties
- Update `README.md` when features, setup steps, or developer ergonomics change materially
- List other docs to refresh (architecture, ADRs, etc.)
## Finish the Task Checklist
- [ ] Update relevant docs (& `README.md` if significant changes landed)
- [ ] Summarize changes in conventional commit format (e.g., `feat: ...`, `fix: ...`)
Subdirectory Template (Use Only with Developer Approval)
# <Directory Name> Agent Guide
> Scope: ./path/to/directory (inherits root AGENTS.md unless noted)
## Purpose
- What lives here
- Who owns it (team/contact)
## Key Files
- `file_or_folder/` — why it matters
## Common Tasks
- `just <task>` / `make <target>` / command snippets scoped to this directory
## Testing & Quality
- Specific tests, linters, or data fixtures for this directory
## Hand-off Notes
- Docs or runbooks to reference
- Open questions captured during discovery
Only create these per-directory guides after confirming with the developer which areas need dedicated context and what information should be emphasized.
Writing Notes:
- Keep language direct and actionable. Agents should follow commands verbatim.
- Mention the preferred order of operations (e.g., "Always run
just format before opening a PR").
- When referencing scripts, include relative paths so agents can jump quickly (e.g.,
scripts/bootstrap.sh).
- Incorporate a trimmed
tree --gitignore snapshot (or link to the saved artifact) so readers grasp layout quickly.
- In the Repository Tour, highlight where
plans/, docs/, design docs, or ADRs live if present.
- Call out any unanswered questions as action items, and confirm with the developer before creating any per-directory AGENTS overlays.
- If the project mixes languages/platforms, add subsections per component but keep global guidance first.
Phase 4 · Validate & Wrap Up
- Self-review
- Does the file respect AGENTS scope rules? (Mention inheritance or overrides.)
- Are all critical commands documented, especially automation entry points?
- Is the README update expectation explicit?
- Did you obtain developer approval before adding any per-directory AGENTS files, and is that approval reflected in the write-up?
- Does the "Finish the Task" checklist include the conventional commit summary reminder?
- Formatting
- Ensure headings use Title Case, commands are wrapped in backticks, and lists are concise.
- Keep sections under ~8 bullets unless a table is clearer.
- Handoff Summary
- When delivering the AGENTS.md to the user, include:
- A short summary of major sections added/updated.
- Confirmation that README and conventional commit reminders are present.
- Any follow-up suggestions (e.g., missing tests or outdated scripts).
Use this skill whenever a repo lacks AGENTS context or when existing instructions are incomplete or outdated. The goal is to leave future agents with a single, trustworthy map of the project, its tooling, and the expectations for finishing tasks responsibly.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: agent-context-generator3description: Generate project-level AGENTS.md guides that capture conventions, workflows, and required follow-up tasks. Use when a repository needs clear agent onboarding covering structure, tooling, testing, task flow, README expectations, and conventional commit summaries. Use when this capability is needed.4---56# Agent Context Generator78## What You'll Do9- 🔍 Inventory the repository's structure, capture a `.gitignore`-aware `tree` output, and record automation entry points (preferring `just`/`make` tasks when available)10- 🧭 Capture coding conventions, directory ownership, testing expectations, and review workflows so future agents can navigate confidently11- 🧩 Produce an `AGENTS.md` file following the opinionated section order below, honoring scope rules for nested directories12- ✅ Embed universal wrap-up tasks: ensure the README is updated after significant code changes and summarize changes per conventional commits while resolving any open questions with the developer1314---1516## Phase 1 · Understand the Repository171. **Check for existing AGENTS.md**18 - Use `find` alternative (`glob` or repo tree) to discover current files. Determine scope inheritance so you can update or extend instead of duplicating.192. **Read Core Docs**20 - Skim `README.md`, `CONTRIBUTING.md`, and other onboarding docs for project philosophy, setup, and workflows.21 - If `docs/` or `documentation/` exists, scan for architectural or process references worth surfacing.223. **Survey Project Layout**23 - Note primary directories, languages, build targets, and ownership (e.g., "`src/ui` maintained by Frontend team").24 - Check for `plans/`, `docs/`, or other knowledge directories. Flag must-read files (ADR indexes, architecture overviews, runbooks) to reference later in AGENTS.md.254. **Build a Git-aware Tree**26 - Use the `tree` command with the `--gitignore` flag (tree ≥ 2.0) so ignored paths stay hidden: `tree --gitignore -a -L 3 > tmp/tree.txt`.27 - If your `tree` build lacks `--gitignore`, run `tree -a -L 3 --prune` and manually prune any ignored directories noted in `.gitignore`, or install an updated version via your package manager.28 - Capture or trim the output before placing it in AGENTS.md (focus on the top 2–3 levels, and note when you omitted details for brevity).295. **Identify Automation Runners**30 - If `Justfile` exists, run `just --list` (or `just --list --unsorted` for extra notes).31 - If `Makefile` exists (and `just` does not), run `make help` or inspect phony targets for canonical tasks.32 - Record which commands are recommended for linting, testing, building, syncing data, etc. Link the definitive task names you surface in your notes for inclusion later.336. **Catalog Tooling & Environment**34 - List required runtimes, package managers, env vars, secrets handling, and local services.35 - Note down any `.env.example`, `config/`, or secrets documentation that agents must review.367. **Clarify Testing & Quality Gates**37 - Identify test suites, coverage expectations, linting, formatting, and CI workflows.388. **Resolve Ambiguities Early**39 - Whenever conventions, ownership, or workflows seem unclear, prompt the developer with focused questions before drafting the guide.40 - Ask explicitly whether existing `plans/` or documentation directories are authoritative or stale, and clarify what canon to reference.4142> **Outcome:** A structured notes list describing layout, tooling, commands, testing, release process, documentation references, pending questions, and update expectations.4344---4546## Phase 2 · Plan the AGENTS.md Structure47Follow this opinionated order to keep files consistent and scannable:48491. **Header** — Title + short purpose statement.502. **Quick Facts** — Table or bullet summary (languages, package manager, key scripts, CI).513. **Repository Tour** — High-level directory map with responsibilities and ownership hints.524. **Tooling & Setup** — Required runtimes, package managers, environment variables, secrets.535. **Common Tasks** — Lint/test/build/deploy commands. Prefer listing `just` recipes first, then `make` targets, then raw commands.546. **Testing & Quality** — When and how to run tests, linting, formatting, coverage, and CI expectations.557. **Workflow Expectations** — Branching model, review norms, feature flagging, deployment cadence.568. **Documentation Duties** — When to update `README.md`, architecture diagrams, or other docs.579. **Finish the Task** — Mandatory wrap-up checklist for every agent task.5859For deeper directories (e.g., `services/api/`), include a "Scope" note at the top clarifying inheritance from parent AGENTS instructions. Always confirm with the developer before drafting new per-directory AGENTS files so you do not duplicate existing guidance or create unnecessary overhead.6061---6263## Phase 3 · Compose AGENTS.md64Use the template below and adapt each section to the project:6566```markdown67# Project Agent Guide6869> Scope: Root project (applies to all subdirectories unless overridden)7071## Quick Facts72- **Primary language:**73- **Package manager:**74- **Entrypoints:**75- **CI/CD:**7677## Repository Tour78- `path/` — description & owner7980## Tooling & Setup81- Install instructions (per OS)82- Required environment variables (with purpose)83- Secrets management notes8485## Common Tasks86- `just <task>` — what it does (preferred)87- `make <target>` — what it does88- Raw command fallback when automation missing8990## Testing & Quality Gates91- Unit/integration test commands92- Lint/format commands93- Coverage expectations & thresholds94- CI status command or dashboard link9596## Workflow Expectations97- Branch naming and review rules98- Feature toggles or release cadence99- Any approval or ticket linkage requirements100101## Documentation Duties102- Update `README.md` when features, setup steps, or developer ergonomics change materially103- List other docs to refresh (architecture, ADRs, etc.)104105## Finish the Task Checklist106- [ ] Update relevant docs (& `README.md` if significant changes landed)107- [ ] Summarize changes in conventional commit format (e.g., `feat: ...`, `fix: ...`)108```109110### Subdirectory Template (Use Only with Developer Approval)111```markdown112# <Directory Name> Agent Guide113114> Scope: ./path/to/directory (inherits root AGENTS.md unless noted)115116## Purpose117- What lives here118- Who owns it (team/contact)119120## Key Files121- `file_or_folder/` — why it matters122123## Common Tasks124- `just <task>` / `make <target>` / command snippets scoped to this directory125126## Testing & Quality127- Specific tests, linters, or data fixtures for this directory128129## Hand-off Notes130- Docs or runbooks to reference131- Open questions captured during discovery132```133Only create these per-directory guides after confirming with the developer which areas need dedicated context and what information should be emphasized.134135**Writing Notes:**136- Keep language direct and actionable. Agents should follow commands verbatim.137- Mention the preferred order of operations (e.g., "Always run `just format` before opening a PR").138- When referencing scripts, include relative paths so agents can jump quickly (e.g., ``scripts/bootstrap.sh``).139- Incorporate a trimmed `tree --gitignore` snapshot (or link to the saved artifact) so readers grasp layout quickly.140- In the Repository Tour, highlight where `plans/`, `docs/`, design docs, or ADRs live if present.141- Call out any unanswered questions as action items, and confirm with the developer before creating any per-directory AGENTS overlays.142- If the project mixes languages/platforms, add subsections per component but keep global guidance first.143144---145146## Phase 4 · Validate & Wrap Up1471. **Self-review**148 - Does the file respect AGENTS scope rules? (Mention inheritance or overrides.)149 - Are all critical commands documented, especially automation entry points?150 - Is the README update expectation explicit?151 - Did you obtain developer approval before adding any per-directory AGENTS files, and is that approval reflected in the write-up?152 - Does the "Finish the Task" checklist include the conventional commit summary reminder?1532. **Formatting**154 - Ensure headings use Title Case, commands are wrapped in backticks, and lists are concise.155 - Keep sections under ~8 bullets unless a table is clearer.1563. **Handoff Summary**157 - When delivering the AGENTS.md to the user, include:158 - A short summary of major sections added/updated.159 - Confirmation that README and conventional commit reminders are present.160 - Any follow-up suggestions (e.g., missing tests or outdated scripts).161162Use this skill whenever a repo lacks AGENTS context or when existing instructions are incomplete or outdated. The goal is to leave future agents with a single, trustworthy map of the project, its tooling, and the expectations for finishing tasks responsibly.163164---165> Converted and distributed by [TomeVault](https://tomevault.io/claim/tjmaynes) — claim your Tome and manage your conversions.166<!-- tomevault:4.0:skill_md:2026-04-11 -->