AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
69/100
Scores the file, not the repository.Length
1,619 words
15 headings · 5 code blocksRepository
51
— · pushed 14 days agoLast changed
3 days ago
First indexed 3 days ago.1# Copilot Agents Dojo — Contributor Guide23Authoritative reference for humans (and AI assistants) **modifying** the dojo itself. If you're just *using* the dojo in your own repo, start with [`README.md`](README.md). If you're inside an agent session running on the dojo, the runtime prompt is [`.github/copilot-instructions.md`](.github/copilot-instructions.md).45This file is load-bearing. Reviewers may reject PRs that violate the rules below.67---89## Project Structure1011File counts shift constantly — don't treat the tree below as exhaustive. The canonical source is the filesystem.1213```14copilot-agents-dojo/15├── AGENTS.md # this file — contributor reference16├── README.md # user-facing onboarding17├── SOUL.md # agent identity charter (who / how / limits)18├── skills.md # GENERATED — skills index grouped by tier19├── spec/20│ └── copilot-skills-spec.md # the HARDLINE skill spec (v1)21├── template/22│ └── SKILL.md # canonical starter for new skills23├── skills/ # core + practical skills (always discoverable)24│ ├── plan-before-code/SKILL.md # tier: core25│ ├── code-review/SKILL.md # tier: practical26│ └── …27├── optional-skills/ # heavy / niche skills (installed explicitly)28├── scripts/29│ ├── init.sh # scaffold tasks/{todo,lessons}.md30│ ├── verify.sh # the lint/test/invariant gate31│ ├── run-checks.ps1 # Windows parity for verify.sh32│ ├── regen-skills-index.sh # rebuilds skills.md from frontmatter33│ ├── lesson-updater.sh # cache-aware skill amendments34│ └── curator.sh # skill lifecycle (pin/archive/restore)35├── tasks/36│ ├── todo.md # current plan (rollup of tasks/board/)37│ ├── lessons.md # postmortem log38│ └── board/ # durable per-task markdown files39├── agents/ # persona briefs (architect, TPM, etc.)40├── mcp/41│ ├── registry.yaml # MCP server catalog42│ ├── servers/ # per-server JSON manifests43│ └── scripts/ # mcp-subprocess wrappers44├── cli/45│ └── dojo_cli/ # optional Python CLI (marketplace + scanner)46├── .github/47│ ├── copilot-instructions.md # runtime prompt for sessions in this repo48│ ├── known-pitfalls.md # imperative DO NOT register49│ └── workflows/dojo-enforce.yml # PR enforcement50└── .dojo/ # per-clone state (telemetry, profiles); gitignored51 └── skill-usage.json # curator telemetry sidecar52```5354---5556## Adding a Skill57581. Copy `template/SKILL.md` to `skills/<name>/SKILL.md` (or `optional-skills/<name>/` for heavyweight skills).592. Fill in **all required frontmatter** — see [`spec/copilot-skills-spec.md`](spec/copilot-skills-spec.md) §1.603. Write the body in the **required section order** — spec §2.614. Reference real Copilot tools in backticks (`view`, `edit`, `grep`, `glob`, `powershell`, `web_fetch`, `task`). NOT bare shell utilities — spec §3.625. If the skill needs deterministic logic, add `scripts/` (ship `.sh` + `.ps1` for cross-platform) and `tests/`.636. Run `scripts/verify.sh` locally. It must pass.647. Open the PR. Reviewer checks against `.github/known-pitfalls.md` + the spec.6566The full reviewer checklist lives in `.github/known-pitfalls.md`.6768---6970## Adding a CLI Command7172The optional Python CLI lives in `cli/dojo_cli/`. Commands are centralized in `cli/dojo_cli/registry.py` (see Phase 5 of the roadmap) — adding a command is one entry in `COMMAND_REGISTRY`. `app.py`, `--help`, `marketplace.py`, and shell completion all derive from it.7374Until that registry exists, follow the per-file pattern in `app.py` but keep new commands tiny and dependency-free — the CLI is a convenience, never a hard dependency.7576---7778## Testing7980**Always use `scripts/verify.sh`** (or `scripts/run-checks.ps1` on Windows). The wrapper enforces hermetic env parity with CI:8182| | Without wrapper | With wrapper |83|---|---|---|84| Credentials | Whatever is in your env | All `*_TOKEN` / `*_API_KEY` unset |85| Timezone | Local | UTC |86| Locale | Local | C.UTF-8 |87| `DOJO_ROOT` | Inherited | Temp dir per skill test |8889Direct `pytest` calls on a developer machine diverge from CI in ways that have caused "works locally, fails in CI" incidents in other projects.9091```bash92scripts/verify.sh # full gate93scripts/verify.sh tests # only the pytest suite94scripts/verify.sh spec # only the spec/frontmatter invariants95scripts/verify.sh --check # CI mode: fail on any drift96```9798### Test Discipline — No Change-Detector Tests99100A test that snapshots current data (skill count, list contents, version literal) fails every time the data legitimately changes. Write **invariants** instead. Concrete examples in [`.github/known-pitfalls.md`](.github/known-pitfalls.md#do-not-write-change-detector-tests).101102---103104## Supply Chain Policy105106Adopted after the litellm and Shai-Hulud incidents to limit attack surface on PR builds.107108| Source | Treatment | Example |109|---|---|---|110| GitHub Actions | Commit SHA + version comment | `uses: actions/checkout@<sha> # v4` |111| PyPI (CLI deps) | `>=floor,<next_major` | `httpx>=0.28.1,<1` |112| npm (any tooling) | `>=floor,<next_major`, lockfile committed | — |113| Shell binaries | Document expected version in `Prerequisites` | — |114115`.github/workflows/dojo-enforce.yml` greps for unpinned `uses:` lines and fails the build. Bare `>=X.Y.Z` without a ceiling is rejected at review.116117---118119## Task Plan Policy120121`tasks/todo.md` in this repository is a **canonical scaffold template**, not a working plan for the dojo's own development. Downstream consumers (anyone who runs `bash scripts/init.sh` against their own project) fill it in for their actual work; the version that ships in this repo must stay in its scaffold form.122123Rules:124125- **PRs to this repo MUST NOT replace `tasks/todo.md` with a real plan.** Branch protection enforces this via the `Plan sanity` required check, which runs `scripts/verify.sh plan` in canonical-repo mode.126- **Working plans for dojo PRs live elsewhere:** the agent's session folder (`~/.copilot/session-state/<session-id>/plan.md`), a scratch branch outside the canonical scaffold, or PR descriptions/issues. Not in `tasks/todo.md`.127- **`tasks/lessons.md` IS expected to evolve** in this repo — it's the dojo's own learning log. The plan check only asserts presence, not content.128129`scripts/verify.sh` detects canonical-repo mode by the presence of `spec/copilot-skills-spec.md`, `skills/`, and `scripts/init.sh` together. In any other repo (a downstream consumer's clone), the same script inverts the assertion: the scaffold template warns, a real plan passes.130131---132133## Cache-Aware Mutations134135Copilot caches the prompt — including the skills it loads at session start. Anything that mutates a skill, the `skills.md` index, or `.github/copilot-instructions.md` mid-session invalidates that cache and dramatically increases cost.136137**Rule:** skill amendments default to **deferred** invalidation. The change is written to disk now; it takes effect on the next Copilot session.138139`scripts/lesson-updater.sh` honors this by default. Pass `--now` only when correctness requires immediate effect — the script prints a warning about the cache-invalidation cost when you do.140141This mirrors the equivalent policy in `hermes-agent` (`/skills install --now` is the canonical pattern there).142143---144145## Curator (Skill Lifecycle)146147Agent-created skills (those with `created_by: agent` in frontmatter) flow through a **state machine** managed by `scripts/curator.sh`:148149```150active ──(no use for STALE_DAYS, default 30)──▶ stale151stale ──(no use for ARCHIVE_DAYS, default 90)─▶ archived → skills/.archive/<name>/152```153154State is stored per-entry in `.dojo/skill-usage.json`. Any `record`/`view` resets state to `active`.155156**Three-layer provenance guard.** A skill is exempt from every auto-transition if any of these is true:1571581. Frontmatter `created_by: human` (legacy guard).1592. Folder name appears in `.dojo/bundled-manifest.txt` — regenerated by `scripts/regen-skills-index.sh` from `skills/` + `optional-skills/`. This is the source of truth for "ships with the dojo."1603. `pinned: true` in the usage sidecar.161162Invariants (all enforced by `scripts/curator.sh`):163164- The curator NEVER deletes — max destructive action is archive to `skills/.archive/`.165- Every mutating run takes a tarball backup to `.dojo/curator-backups/<UTC>/skills.tgz` first (keeps last 5; tunable via `DOJO_CURATOR_BACKUP_KEEP`). `rollback` is reversible — it backs up the *current* state before restoring.166- Every transition run writes a per-run report to `.dojo/logs/curator/<UTC>-transition/REPORT.md` + `run.json` (keeps last 20).167168**Verbs:** `status`, `record`, `pin`, `unpin`, `archive`, `restore`, `transition` (alias: `prune`), `backup`, `rollback`, `report`. Full lifecycle docs live in `skills/self-improvement/SKILL.md`.169170**Idle-based trigger** (the hermes pattern). Don't run the curator on every prompt — let it fire only when the agent is quiet for a while:171172```bash173bash scripts/curator-tick.sh # gated: 168h interval, 2h idle defaults174bash scripts/curator-tick.sh --force --dry-run # preview without gates175pwsh scripts/curator-tick.ps1 # Windows wrapper176```177178Wire it into one of: shell rc (`zsh-defer`/PowerShell `$PROFILE`), a `pre-commit` hook, `cron`/`launchd`, or Windows Task Scheduler. Per-environment overrides go in `.dojo/curator.env` (sourced if present): `DOJO_CURATOR_STALE_DAYS`, `DOJO_CURATOR_ARCHIVE_DAYS`, `DOJO_CURATOR_INTERVAL_HOURS`, `DOJO_CURATOR_MIN_IDLE_HOURS`, `DOJO_CURATOR_BACKUP_KEEP`, `DOJO_CURATOR_REPORT_KEEP`.179180**Prerequisite:** `jq` must be on `PATH`.181- macOS: `brew install jq`182- Linux (apt): `sudo apt install jq`183- Windows: `winget install jqlang.jq` (or `scoop install jq`)184185The Windows wrappers (`scripts/curator.ps1`, `scripts/curator-tick.ps1`) add the WinGet shim directory to `PATH` automatically; for direct `bash` use on Windows, ensure `jq` resolves in git-bash.186187---188189## Delegation & Durability190191The dojo distinguishes three execution scopes. **Pick the right one.**192193| Scope | Tool | Durable across turn? | Use when |194|---|---|---|---|195| Sub-agent | `task` (Copilot's built-in) | **No** — cancelled if parent interrupted | Focused research / parallel reads inside this turn |196| Durable board | `scripts/board.sh` + `tasks/board/` | Yes, survives session | Work assigned to another agent or resumed later |197| Scheduled | GitHub Actions workflow | Yes, survives everything | Recurring or time-based work |198199Default sub-agent limits: `max_spawn_depth: 2`, `max_concurrent_children: 3`. Don't exceed without justification. See `skills/subagent-strategy/SKILL.md` and `skills/durable-work/SKILL.md`.200201---202203## Profile / Multi-Instance Support204205The dojo can live anywhere — not just at the repo root. All scripts and the CLI resolve paths from `${DOJO_ROOT:-$PWD}`. Use the env var when running multiple dojo instances side-by-side (e.g., one per monorepo subproject):206207```bash208DOJO_ROOT=apps/backend scripts/verify.sh209DOJO_ROOT=apps/frontend scripts/verify.sh210```211212The CLI accepts `--profile <name>` as syntactic sugar for `DOJO_ROOT=~/.dojo/profiles/<name>`.213214### Rules for profile-safe code2152161. NEVER hardcode `.github/`, `tasks/`, `skills/` in scripts. Use `${DOJO_ROOT:-$PWD}/…`.2172. Tests must isolate to a temp `DOJO_ROOT`.2183. User-facing messages reference `${DOJO_ROOT}/…` so the output is correct for the active profile.219220---221222## Known Pitfalls223224The complete imperative `DO NOT` register lives in [`.github/known-pitfalls.md`](.github/known-pitfalls.md). Skim it before any non-trivial PR.225226When you discover a new pitfall:2272281. Add an entry there.2292. Add a regression check in `scripts/verify.sh` if it's machine-checkable.2303. Reference it from the relevant `SKILL.md`'s `Pitfalls` section.231232---233234## Related Files235236- [`README.md`](README.md) — user-facing onboarding237- [`spec/copilot-skills-spec.md`](spec/copilot-skills-spec.md) — the HARDLINE skill spec238- [`template/SKILL.md`](template/SKILL.md) — starter for new skills239- [`.github/copilot-instructions.md`](.github/copilot-instructions.md) — runtime prompt240- [`.github/known-pitfalls.md`](.github/known-pitfalls.md) — DO NOT register241- [`CONTRIBUTING.md`](CONTRIBUTING.md) — PR mechanics (branch naming, signoff, etc.)242
Also in andreaswasita/copilot-agents-dojo
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| andreaswasita/copilot-agents-dojo.github/copilot-instructions.md · 51 | Copilot instructions | testlint-formattypessecurity+4 | 85/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
