skilldrop-cli 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -151,6 +151,8 @@ Designing the agentic systems themselves — the loops, orchestrations, and budg
151
151
  | [`agent-budget`](skills/agent-budget/SKILL.md) | The spend spec for an agentic workflow: cheapest-adequate **tier per stage** (light/standard/heavy — heavy verification is never downgraded to save money), three numbers per stage (expected, hard cap, on-cap action — "warn and continue" banned), a run-level cap *below* the sum of stage caps, a **degradation ladder where verification is last and never cut**, and **cost-per-outcome** as the governing metric with a comparison line against the manual alternative — so "$900/week" becomes answerable. Estimates tagged `[assumption]` until calibrated on real runs. |
152
152
  | [`agent-threat-model`](skills/agent-threat-model/SKILL.md) | Security review of an agent's **capability surface** against the lethal trifecta — private data, untrusted content, an exfiltration vector. Inventories data reach *transitively* (the filesystem tool reaches every secret in `.env`), applies a writer-authorization test that classifies almost every content source untrusted, and sweeps egress past the obvious network tool (rendered markdown images, CI logs, error text, DNS). Scores **paths, not tools** — `fetch` is fine alone and lethal beside a secrets file — then names the architectural fix that breaks a leg, with a verification step. Structurally refuses the two answers teams reach for first: a system prompt telling the model to ignore injected instructions is not a control, and an injection classifier is defense in depth, never a broken leg. |
153
153
 
154
+ | [`agents-md-generator`](skills/agents-md-generator/SKILL.md) | Generate or audit the `AGENTS.md` that Claude Code, Codex, Cursor, Copilot, Kiro and Antigravity all read before your prompt. Built around one rule: **every command traces to evidence in the repo** — a CI step, a Makefile target, a `package.json` script — or it appears as `[missing: no test command in CI or manifests]` rather than a guess, because an invented command is a fault the agent will trust over the filesystem. Convention lines must pass a **counterfactual test** (without this line, would a competent agent do the wrong thing?); virtue instructions — "clean", "best practice", "thorough" — are *stripped, not softened*, since they spend context and change no behaviour. Names forbidden actions explicitly, the section most files omit. Hard ~150-line cap when generating, a warning when auditing, because an existing file may be long for good reason. Audit mode emits a diff, never a silent rewrite. Satellites (`CLAUDE.md`, `.github/copilot-instructions.md`) are opt-in and **delta-only** — a satellite that repeats `AGENTS.md` is guaranteed drift. |
155
+
154
156
  ### AI adoption & observability
155
157
 
156
158
  | Skill | What it does |
@@ -293,13 +295,14 @@ Four targets, each projecting only as much as the tool's format demands:
293
295
  | `--ide copilot` | `.github/agents/<name>.agent.md` | a rename |
294
296
  | `--ide kiro` | `.kiro/agents/<name>.json` | generated JSON; tool names mapped to Kiro's built-ins |
295
297
  | `--ide codex` | `~/.codex/agents/<name>.toml` (`--project` for repo) | generated TOML |
298
+ | `--ide antigravity` | `~/.gemini/config/agents/<name>.md` (`--project` → `.agents/agents/`) | frontmatter rewritten, `subagent: true` added |
296
299
  | `--dest <dir>` | `<dir>/<name>.md` | none |
297
300
 
298
301
  The Kiro emitter maps `Read`/`Grep`/`Glob`/`Bash` to `read`/`grep`/`glob`/`shell` against [Kiro's built-in tool reference](https://kiro.dev/docs/cli/reference/built-in-tools/), and **names any tool it can't map instead of dropping it silently** — a mistranslated permission is worse than a missing one. It omits `allowedTools` so you're prompted per tool call.
299
302
 
300
303
  Each generated target omits the permission field it cannot map safely rather than guessing one: Kiro's `allowedTools` and Codex's `sandbox_mode` are both left unset, so an agent inherits the session's permissions and is prompted per call. A widened permission nobody asked for is worse than an extra prompt.
301
304
 
302
- Only **Antigravity** still refuses — its subagents exist solely inside a plugin bundle, which is a container rather than a file drop. Design is worked out in [RFC-0013](docs/rfcs/0013-antigravity-plugin-bundle.md), unimplemented pending demand. [`agents/README.md`](agents/README.md) has the manual route.
305
+ **Every surveyed tool now installs.** Only Cursor is absent, because it has no agent file format at all — use a custom mode ([`agents/README.md`](agents/README.md) has the steps).
303
306
 
304
307
  ### Third-party catalogs — publish your own skills through the same CLI
305
308
 
package/agents/README.md CHANGED
@@ -4,7 +4,17 @@ Portable **reviewer agents** — opinionated personas you delegate code and test
4
4
 
5
5
  The frontmatter makes the file a drop-in **Claude Code subagent**. The body is plain enough to paste into any other tool's agent / mode / system-prompt slot.
6
6
 
7
- Nothing auto-discovers *this* folder at the repo root, so it is the **canonical source of truth** and the table below says where to copy each file. That framing used to be simpler: as of the [July 2026 survey](../docs/designs/ide-primitive-coverage.md), **five tools have a native subagent format** — Claude Code, Kiro, Codex, Copilot, and Antigravity, which registers subagents from a directory literally named `agents/` inside a plugin bundle. The CLI does not install agents into any of them yet ([RFC-0010](../docs/rfcs/0010-install-target-table.md) has to settle the projection model first), so copying by hand remains the route.
7
+ Nothing auto-discovers *this* folder at the repo root, so it is the **canonical source of truth**. As of the [July 2026 survey](../docs/designs/ide-primitive-coverage.md), **five tools have a native subagent format** — Claude Code, Kiro, Codex, Copilot, and Antigravity, which registers subagents from a directory literally named `agents/` inside a plugin bundle.
8
+
9
+ **The CLI installs into four of them** ([RFC-0012](../docs/rfcs/0012-subagent-installation.md)):
10
+
11
+ ```bash
12
+ npx skilldrop-cli agents # list
13
+ npx skilldrop-cli install --agent devils-advocate # ~/.claude/agents/
14
+ npx skilldrop-cli install --agent devils-advocate --ide kiro # .kiro/agents/*.json
15
+ ```
16
+
17
+ **Five of the five tools with a native format now install by command** — Claude Code, Kiro, Codex, Copilot, and Antigravity. Only Cursor needs hand-work, because it has no agent file format at all. Each section below gives the command where one exists, and the manual route either way.
8
18
 
9
19
  ## The agents
10
20
 
@@ -48,28 +58,36 @@ Standalone TOML in `~/.codex/agents/` or `.codex/agents/` (`--project`). Codex r
48
58
 
49
59
  ### Kiro (native custom agents)
50
60
 
51
- Kiro reads JSON agent definitions from `.kiro/agents/` (local) or `~/.kiro/agents/` (global). The filename minus `.json` becomes the agent's name.
61
+ ```bash
62
+ npx skilldrop-cli install --agent devils-advocate --ide kiro # .kiro/agents/<name>.json
63
+ ```
52
64
 
53
- Its `prompt` field accepts a **`file://` URI**, so the definition can point at the markdown instead of duplicating it — the cleanest projection of any tool surveyed:
65
+ Kiro reads JSON agent definitions from `.kiro/agents/` (local) or `~/.kiro/agents/` (global). The emitter maps Claude Code tool names to [Kiro's built-ins](https://kiro.dev/docs/cli/reference/built-in-tools/) — `Read`/`Grep`/`Glob`/`Bash` → `read`/`grep`/`glob`/`shell` — and **names any tool it cannot map** rather than dropping it silently.
54
66
 
55
- ```json
56
- {
57
- "name": "devils-advocate",
58
- "description": "<paste the description from the agent's frontmatter>",
59
- "prompt": "file://./agents/devils-advocate.md",
60
- "tools": ["read", "grep", "execute"]
61
- }
62
- ```
67
+ Two choices worth knowing if you hand-write one instead:
68
+
69
+ - **The prompt is inlined, not a `file://` reference.** Kiro's docs show a relative `file://` path but do not say whether it resolves against the workspace root or the JSON file, and a wrong path fails *silently* — the agent loads with no instructions.
70
+ - **`allowedTools` is omitted**, so you are prompted per tool call. That is the right default for a reviewer, and it avoids [kirodotdev/Kiro#6714](https://github.com/kirodotdev/Kiro/issues/6714), where the field does not load as configured.
63
71
 
64
72
  **Don't use a steering file for this.** Earlier advice here said to drop the agent at `.kiro/steering/<agent>.md`; a steering file with no inclusion mode is loaded into *every* session, which is a permanent context cost for a persona you want on demand. Same reason the CLI stopped writing steering shims for skills.
65
73
 
66
74
  ### GitHub Copilot (native custom agents)
67
75
 
68
- Copilot reads `.github/agents/<name>.agent.md` (repo) or `~/.copilot/agents/` (personal). The filename minus `.agent.md` is the invocation name — `copilot --agent devils-advocate`. Copy the file in and rename it; the frontmatter needs `name` and `description`, and takes an optional `tools` list.
76
+ ```bash
77
+ npx skilldrop-cli install --agent devils-advocate --ide copilot # .github/agents/<name>.agent.md
78
+ ```
79
+
80
+ Copilot reads `.github/agents/<name>.agent.md` (repo) or `~/.copilot/agents/` (personal). The filename minus `.agent.md` is the invocation name — `copilot --agent devils-advocate`. The install is a pure rename; nothing in the file changes.
69
81
 
70
82
  ### Antigravity CLI (plugin subagents)
71
83
 
72
- Antigravity registers subagent templates from an `agents/` directory **inside a plugin bundle** at `~/.gemini/antigravity-cli/plugins/<plugin>/agents/`. There is no project-root `agents/` convention, so this is a copy into a bundle you own, not a drop-in.
84
+ ```bash
85
+ npx skilldrop-cli install --agent devils-advocate --ide antigravity # ~/.gemini/config/agents/
86
+ ```
87
+
88
+ Antigravity discovers subagents at `~/.gemini/config/agents/<name>.md` (global) or `.agents/agents/<name>.md` (workspace, `--project`) — markdown with YAML frontmatter, same shape as these files. A plugin bundle is a *third* option, not a requirement; [RFC-0013](../docs/rfcs/0013-antigravity-plugin-bundle.md) records why an earlier draft wrongly thought it was the only one.
89
+
90
+ The emitter adds **`subagent: true`** — without it the agent exists but `invoke_subagent` cannot reach it — and maps `Read`/`Grep`/`Bash` to `view_file`/`grep_search`/`run_command`. Antigravity has no glob-style tool, so `Glob` is named and dropped rather than bent into `list_dir`.
73
91
 
74
92
  ### Continue, Cline, Aider, and other tools
75
93
 
package/bin/skilldrop.js CHANGED
@@ -54,8 +54,9 @@ Options:
54
54
  --ide kiro ./.kiro/agents generated JSON, tools mapped
55
55
  --ide copilot ./.github/agents <name>.agent.md
56
56
  --ide codex ~/.codex/agents generated TOML (--project for repo)
57
+ --ide antigravity ~/.gemini/config/agents markdown, subagent: true
57
58
  --dest <dir> any directory copied as-is
58
- Antigravity needs a plugin bundle (RFC-0013) — see agents/README.md.
59
+ Cursor has no agent format — use a custom mode (agents/README.md).
59
60
  --with-related also install each skill's related companions (one level)
60
61
  --with-hooks also wire any hooks a skill declares (RFC-0006) — git pre-commit
61
62
  reminders and Claude Code session-start context; degrades where the
@@ -202,6 +203,26 @@ function kiroAgentJSON(meta, body) {
202
203
  return { json: JSON.stringify(agent, null, 2) + "\n", unmapped: [...new Set(unmapped)] };
203
204
  }
204
205
 
206
+ /* Antigravity agent markdown (RFC-0013). Only mappings confirmed in Antigravity's own
207
+ subagents doc are listed. There is no glob-style tool in its file tooling
208
+ (view_file / list_dir / grep_search / write_to_file), so Glob is dropped and named
209
+ rather than bent into list_dir — a different operation. */
210
+ const ANTIGRAVITY_TOOLS = { Read: "view_file", Grep: "grep_search", Bash: "run_command" };
211
+ const ANTIGRAVITY_MODELS = new Set(["inherit", "flash", "pro"]);
212
+
213
+ function antigravityAgentMD(meta, body) {
214
+ const declared = meta.tools ? meta.tools.split(",").map((s) => s.trim()).filter(Boolean) : [];
215
+ const tools = [], unmapped = [];
216
+ for (const d of declared) (ANTIGRAVITY_TOOLS[d] ? tools : unmapped).push(ANTIGRAVITY_TOOLS[d] || d);
217
+ // YAML double-quoted scalars are a superset of JSON strings, so JSON.stringify is a
218
+ // correct quoter here — descriptions contain em-dashes and embedded quotes.
219
+ const lines = [`name: ${JSON.stringify(meta.name)}`, `description: ${JSON.stringify(meta.description)}`];
220
+ if (tools.length) lines.push(`tools: [${tools.join(", ")}]`);
221
+ lines.push("subagent: true"); // required, or invoke_subagent cannot reach it
222
+ if (ANTIGRAVITY_MODELS.has(meta.model)) lines.push(`model: ${meta.model}`);
223
+ return { md: `---\n${lines.join("\n")}\n---\n\n${body}\n`, unmapped: [...new Set(unmapped)] };
224
+ }
225
+
205
226
  /* Codex agent TOML. Schema confirmed at learn.chatgpt.com/docs/agent-configuration/subagents:
206
227
  name, description and developer_instructions are required; unknown fields are rejected.
207
228
  sandbox_mode is deliberately NOT emitted — Codex has no `tools` field, permissions come
@@ -219,7 +240,6 @@ function codexAgentTOML(meta, body) {
219
240
  /* Only plain-copy targets ship in RFC-0012. Everything else needs a projection the
220
241
  install-target model (RFC-0010) has not settled — so say so instead of guessing a path. */
221
242
  const AGENT_MANUAL = {
222
- antigravity: "an agents/ directory inside a plugin bundle you own — see RFC-0013",
223
243
  cursor: "a custom mode — Cursor has no agent file format",
224
244
  };
225
245
  function agentTarget(flags) {
@@ -236,6 +256,10 @@ function agentTarget(flags) {
236
256
  return flags.project
237
257
  ? { dest: path.resolve(".codex", "agents"), ide }
238
258
  : { dest: path.join(os.homedir(), ".codex", "agents"), ide };
259
+ if (ide === "antigravity")
260
+ return flags.project
261
+ ? { dest: path.resolve(".agents", "agents"), ide }
262
+ : { dest: path.join(os.homedir(), ".gemini", "config", "agents"), ide };
239
263
  const hint = AGENT_MANUAL[ide];
240
264
  die(`--agent has no target for '${ide}'${hint ? ` — it needs ${hint}` : ""}.\n` +
241
265
  ` Copy it by hand (see agents/README.md), or use --dest <dir>. Tracked in RFC-0012.`);
@@ -254,6 +278,15 @@ function writeAgent(cat, a, dest, ide) {
254
278
  ? ` ${a}: no Kiro equivalent for ${unmapped.join(", ")} — dropped from tools, add by hand if needed`
255
279
  : null };
256
280
  }
281
+ if (ide === "antigravity") {
282
+ const raw = fs.readFileSync(src, "utf8");
283
+ const body = raw.split("---").slice(2).join("---").trim();
284
+ const { md, unmapped } = antigravityAgentMD(agentMeta(cat, a), body);
285
+ fs.writeFileSync(path.join(dest, `${a}.md`), md);
286
+ return { file: `${a}.md`, warn: unmapped.length
287
+ ? ` ${a}: no Antigravity equivalent for ${unmapped.join(", ")} — dropped from tools, add by hand if needed`
288
+ : null };
289
+ }
257
290
  if (ide === "codex") {
258
291
  const raw = fs.readFileSync(src, "utf8");
259
292
  const body = raw.split("---").slice(2).join("---").trim();
@@ -585,6 +618,7 @@ function installAgents(args) {
585
618
  if (ide === "kiro") console.log("Kiro grants `tools` but not auto-approval — you are prompted per call by design.");
586
619
  if (ide === "copilot") console.log("Invoke with: copilot --agent <name>");
587
620
  if (ide === "codex") console.log("sandbox_mode is left unset, so each agent inherits the parent session's permissions.");
621
+ if (ide === "antigravity") console.log("Emitted with `subagent: true` so invoke_subagent can reach them.");
588
622
  if (cat.source !== BUNDLED)
589
623
  console.log(`\nWARNING: third-party catalog '${cat.source}'. An agent is a system prompt your tool will adopt — read it before first use. Install copied files only; nothing was executed.`);
590
624
  }
@@ -146,6 +146,7 @@
146
146
  "agent-loop-design": { "tier": "standard", "rationale": "Design synthesis against a fixed state-machine pattern and exit-criteria catalog. The gate-placement judgment is bounded by the blast-radius rule; escalate via ambiguous-input when the task itself is contested." },
147
147
  "subagent-design": { "tier": "standard", "rationale": "Design synthesis against a fixed topology catalog and role-card template. The fan-out-or-refuse judgment is bounded by the three-reasons rule; escalate via ambiguous-input on genuinely novel workflow shapes." },
148
148
  "agent-budget": { "tier": "standard", "rationale": "Quantitative spec synthesis against a fixed tier vocabulary and degradation ladder. Cap-setting judgment is bounded by the 3-5x rule; escalate via ambiguous-input when the workflow itself is undefined." },
149
+ "agents-md-generator": { "tier": "standard", "rationale": "Repo inspection plus synthesis against a fixed section order and line budget — the same shape as reverse-architecture. The judgment is the counterfactual test on each convention line, which is bounded; escalate via large-input on monorepos." },
149
150
  "agent-threat-model": { "tier": "heavy", "rationale": "Adversarial reasoning over a capability graph — the judgment is which mitigations are architectural versus theatrical, and that call is exactly where a weaker model produces a confident wrong answer. Never downgraded." }
150
151
  }
151
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilldrop-cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Portable AI-agent skills for the deliverables knowledge workers ship \u2014 diagrams, ADRs, PRDs, runbooks, decks, reviews \u2014 installable into Claude Code, Cursor, Kiro, and any IDE that takes custom instructions. One command per skill or per role-based pack.",
5
5
  "bin": {
6
6
  "skilldrop": "bin/skilldrop.js"
package/packs.json CHANGED
@@ -14,6 +14,7 @@
14
14
  "tech-comparison-matrix",
15
15
  "threat-model",
16
16
  "agent-threat-model",
17
+ "agents-md-generator",
17
18
  "api-contract-draft",
18
19
  "data-contract",
19
20
  "db-schema-design",
@@ -41,8 +42,9 @@
41
42
  ]
42
43
  },
43
44
  "dev-team": {
44
- "description": "Build-and-ship loop: story implementation with adversarial review, test plans, triage, migrations, release notes, and code-quality gates.",
45
+ "description": "Build-and-ship loop: story implementation with adversarial review, test plans, triage, migrations, release notes, agent-policy files, and code-quality gates.",
45
46
  "skills": [
47
+ "agents-md-generator",
46
48
  "user-story-splitter",
47
49
  "feature-implement-loop",
48
50
  "devils-advocate",
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: agents-md-generator
3
+ description: Generate or audit a repository's AGENTS.md — the agent-policy file Claude Code, Codex, Cursor, Copilot, Kiro and Antigravity read — with every command traced to real evidence in the repo, generic virtue instructions stripped, and forbidden actions named. Use when a repo has no AGENTS.md, when an existing one is stale or ignored, when onboarding a codebase to agentic coding, or when an agent keeps running commands that don't exist.
4
+ ---
5
+
6
+ # agents-md-generator
7
+
8
+ Produces the file agents read *before* the user's prompt. An `AGENTS.md` is not documentation — it is the context an agent spends on every turn, so a line that changes no decision is a line stolen from the task.
9
+
10
+ The failure that makes these files worse than useless is an **invented command**. `npm test` in a repo with no test script sends every agent down a path that fails, and the agent trusts the file over the filesystem. So the rule this skill is built around: **every command traces to evidence in the repo, or it does not appear.**
11
+
12
+ Two modes, chosen by what's already there:
13
+ - **Generate** — no `AGENTS.md` exists. Produce one under the line cap.
14
+ - **Audit** — one exists. Score it, name what can't be verified, emit a diff. Never silently rewrite a hand-tuned file.
15
+
16
+ ## How to respond
17
+
18
+ 1. **Inventory the real command surface before writing anything.** Read, in this order: `package.json` (`scripts`), `Makefile`, `pyproject.toml` / `setup.cfg`, `Cargo.toml`, `go.mod`, `composer.json`, `.github/workflows/*.yml`, `justfile`, `Taskfile.yml`, and any `CONTRIBUTING.md`. CI workflows are the highest-value source: they contain the commands that actually have to pass.
19
+
20
+ For each command record its **provenance** — the file and key it came from. Provenance is what makes audit mode possible later.
21
+
22
+ 2. **Apply the evidence rule without exception.** A command appears only if it traces to a file in the repo. Never infer from ecosystem convention: a Python repo does not necessarily run `pytest`, and a repo with `jest` in `devDependencies` may still have no test script.
23
+
24
+ When a section needs a command that doesn't exist, write the marker, not a guess: ✅ *"Test: `[missing: no test script in package.json or CI]`"* — ❌ *"Test: `npm test`"*. The marker is useful; the guess is a trap.
25
+
26
+ 3. **Derive file placement from the actual tree**, not from what the framework usually does. Name the directories that exist and what belongs in each. Two or three rows beat a full tree dump.
27
+
28
+ 4. **Extract only conventions an agent would otherwise get wrong.** The test is counterfactual: *would a competent agent, without this line, do the wrong thing?* Naming rules that are enforced somewhere, invariants that look arbitrary but aren't, a generated file that must never be hand-edited. If the answer is no, cut the line.
29
+
30
+ Generic virtue instructions — "write clean code", "be thorough", "follow best practices", "use good naming" — are **stripped, not softened.** They consume context and change no behaviour.
31
+
32
+ 5. **Name forbidden actions explicitly.** This is the section most files omit and the one that prevents the most damage: paths that must not be touched, commands that must never run unattended, files that are generated, secrets that must never be committed. Concrete and few.
33
+
34
+ 6. **Assemble under ~150 lines.** In generate mode this is a **hard cap** — go over and cut, lowest value first (background prose, then examples, then convention lines that failed the counterfactual test). In audit mode it is a **warning**: report the overage and name the sections you would cut, because an existing file may be long for good reason.
35
+
36
+ 7. **Satellites only on request, and only as a delta.** If asked to wire a specific tool, emit a satellite (`CLAUDE.md`, `.github/copilot-instructions.md`, `GEMINI.md`) that contains **only what is specific to that tool**, plus one line pointing at `AGENTS.md` for everything shared. **Refuse to copy shared content into a satellite** — four copies of a command list is four chances to be wrong, and the drift is invisible. See [`reference.md`](reference.md) for the per-tool shapes.
37
+
38
+ 8. **Emit.** Generate mode: the file, plus a provenance table showing where each command came from and what was marked `[missing]`. Audit mode: verdict, the unverifiable lines quoted, the virtue instructions to cut, the line-count position, and a concrete diff.
39
+
40
+ **Non-interactive runs:** unstated conventions are simply omitted — an `AGENTS.md` is allowed to be short. If the repo cannot be read at all, emit `BLOCKED: need repo access — every command must trace to a file`. Never produce an `AGENTS.md` from a description of a repo; the whole artifact is a claim about what is in the tree.
41
+
42
+ ## Useful references in this skill
43
+
44
+ - [`reference.md`](reference.md) — where each tool looks, the evidence-source table, the satellite shapes, and the strip-list of virtue phrasings
45
+ - [`templates/agents-md.md`](templates/agents-md.md) — the output skeleton with the section order and the line budget per section
46
+
47
+ ## Quality bar
48
+
49
+ - **Zero unverified commands.** Every one traces to a file and key, or carries a `[missing: …]` marker. This is the bar; a file that fails it is worse than no file.
50
+ - **A newcomer agent could build and test from this file alone** — or can see plainly that the repo has no such command.
51
+ - **Forbidden actions are named**, not implied.
52
+ - **Every convention line passes the counterfactual test.** If an agent would do the right thing without it, it is padding.
53
+ - **≤150 lines generated.** Over the cap means something was kept that should have been cut.
54
+ - **No virtue instructions survive.** Search the output for "clean", "best practice", "thorough", "appropriate", "as needed" — each hit is a line that changes nothing.
55
+ - **It does not restate the README.** Different reader, different job: the README sells and explains, `AGENTS.md` constrains.
56
+
57
+ ## When to use this skill
58
+
59
+ - ✅ A repo is adopting agentic coding and has no `AGENTS.md`
60
+ - ✅ An existing `AGENTS.md` is stale, ignored, or full of advice rather than facts
61
+ - ✅ Agents keep running commands that don't exist in the repo
62
+ - ✅ Onboarding a legacy codebase where the real commands live only in CI
63
+ - ✅ After `reverse-architecture` — its extraction is good input for the conventions section
64
+
65
+ ## When NOT to use this skill
66
+
67
+ - ❌ Writing human contributor docs — that's `CONTRIBUTING.md`, a different reader
68
+ - ❌ Explaining what the project *is* — that's the README
69
+ - ❌ Operating a running service — that's `runbook-generator`
70
+ - ❌ Reviewing an existing document's prose quality — that's `doc-critique`, which takes documents; this one takes a repository
71
+
72
+ ## Anti-patterns to avoid
73
+
74
+ - ❌ **Inventing a command that "should" exist.** The single most damaging thing this artifact can do. A `[missing]` marker is a finding; a guess is a fault the agent will trust.
75
+ - ❌ **Virtue instructions.** "Write clean, maintainable code" is context spent on nothing. Agents already try.
76
+ - ❌ **Dumping the file tree.** Placement rules earn their space; a directory listing does not — the agent can run `ls`.
77
+ - ❌ **Restating the README.** If it's already there, link it.
78
+ - ❌ **A satellite that duplicates `AGENTS.md`.** Guaranteed drift, invisible until an agent acts on the stale copy.
79
+ - ❌ **Silently rewriting a hand-tuned file.** Audit mode emits a diff and lets a human choose; the file may encode decisions the repo can't show you.
80
+ - ❌ **Writing to the cap.** 150 lines is a ceiling, not a target. Most repos need far less.
@@ -0,0 +1,15 @@
1
+ [
2
+ { "query": "Write an AGENTS.md for this repo", "should_trigger": true },
3
+ { "query": "Our AGENTS.md is stale — review it", "should_trigger": true },
4
+ { "query": "The agent keeps running commands that don't exist in our project", "should_trigger": true },
5
+ { "query": "Set this codebase up for agentic coding", "should_trigger": true },
6
+ { "query": "Create a CLAUDE.md for this project", "should_trigger": true },
7
+ { "query": "What should go in an agent instructions file?", "should_trigger": true },
8
+
9
+ { "query": "Write a CONTRIBUTING.md for this repo", "should_trigger": false },
10
+ { "query": "Document what this service does for new hires", "should_trigger": false },
11
+ { "query": "Reverse-engineer the architecture of this codebase", "should_trigger": false },
12
+ { "query": "Write a runbook for this service", "should_trigger": false },
13
+ { "query": "Review this design doc for gaps", "should_trigger": false },
14
+ { "query": "Design a supervised agent loop", "should_trigger": false }
15
+ ]
@@ -0,0 +1,50 @@
1
+ {
2
+ "skill_name": "agents-md-generator",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "Write an AGENTS.md for this repo. It's a Python service: pyproject.toml declares pytest and ruff in dev dependencies, there's a Makefile with `run` and `migrate` targets, and .github/workflows/ci.yml runs `ruff check .` then `pytest -q`. No test script anywhere else. Migrations are in alembic/versions/.",
7
+ "assertions": [
8
+ "Commands are traced to their source — CI for ruff/pytest, Makefile for run/migrate — not inferred from the dependency list",
9
+ "The test command is `pytest -q` as CI runs it, not a guessed `pytest` or `make test` that does not exist",
10
+ "No command appears that cannot be traced to pyproject.toml, the Makefile, or the workflow",
11
+ "Alembic migrations produce a convention or forbidden-action line (append-only / never edit a committed migration)",
12
+ "A `Do not` section exists with concrete entries, not implied caution",
13
+ "Output is at or under ~150 lines",
14
+ "No virtue instructions appear — no 'clean', 'best practice', 'thorough', 'maintainable'",
15
+ "Conventions included would each change agent behaviour if removed"
16
+ ]
17
+ },
18
+ {
19
+ "id": 2,
20
+ "prompt": "Here's our AGENTS.md — audit it. It says: 'Run `npm test` to test. Write clean, maintainable code and follow best practices. Be thorough in reviews.' Our package.json has scripts for build and lint only, no test.",
21
+ "assertions": [
22
+ "Audit mode is used — a verdict and diff, not a silent rewrite",
23
+ "`npm test` is flagged as unverifiable: package.json has no test script",
24
+ "The three virtue instructions are named for removal, with the reason that they change no behaviour",
25
+ "What the file is missing is stated — real commands (build, lint), file placement, forbidden actions",
26
+ "The line-count position is reported rather than the file being failed for length",
27
+ "A concrete replacement or diff is offered, not just criticism"
28
+ ]
29
+ },
30
+ {
31
+ "id": 3,
32
+ "prompt": "Also wire it up for Claude Code and Copilot.",
33
+ "assertions": [
34
+ "Satellites are emitted as deltas only — each points at AGENTS.md for shared content",
35
+ "No satellite repeats the command table, file placement, or conventions",
36
+ "CLAUDE.md carries only Claude-Code-specific content; .github/copilot-instructions.md only Copilot-specific content",
37
+ "If there is no genuinely tool-specific content, that is said rather than a file padded to justify itself"
38
+ ]
39
+ },
40
+ {
41
+ "id": 4,
42
+ "prompt": "[Non-interactive run — no repo access] Generate an AGENTS.md for a typical Node microservice.",
43
+ "assertions": [
44
+ "No AGENTS.md is produced — the output is BLOCKED: need repo access",
45
+ "No commands are invented from ecosystem convention",
46
+ "The reason given is that every command must trace to a file in the tree"
47
+ ]
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "agents-md-generator",
3
+ "version": "0.1.0",
4
+ "description": "Generate or audit a repository's AGENTS.md — the agent-policy file Claude Code, Codex, Cursor, Copilot, Kiro and Antigravity read — with every command traced to real evidence in the repo, generic virtue instructions stripped, and forbidden actions named. Use when a repo has no AGENTS.md, when an existing one is stale or ignored, when onboarding a codebase to agentic coding, or when an agent keeps running commands that don't exist.",
5
+ "entrypoint": "SKILL.md",
6
+ "deps": { "npm": [], "pip": [] },
7
+ "env": { "required": [], "optional": [] },
8
+ "related": ["doc-critique", "reverse-architecture", "runbook-generator"],
9
+ "tags": ["agents-md", "agent-policy", "repo-onboarding", "context-engineering", "agentic", "conventions"],
10
+ "model": { "tier": "standard", "rationale": "Repo inspection plus synthesis against a fixed section order and line budget — the same shape as reverse-architecture. The judgment is the counterfactual test on each convention line, which is bounded; escalate via large-input on monorepos." }
11
+ }
@@ -0,0 +1,89 @@
1
+ # agents-md-generator — reference
2
+
3
+ ## Who reads what
4
+
5
+ Confirmed in the July 2026 survey ([`docs/designs/ide-primitive-coverage.md`](../../docs/designs/ide-primitive-coverage.md)). A root `AGENTS.md` is the broadest single file; satellites are a reach fix for specific tools, not the norm.
6
+
7
+ | Tool | Reads |
8
+ |---|---|
9
+ | Codex | root `AGENTS.md` |
10
+ | GitHub Copilot | root `AGENTS.md`, `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md`, and also root `CLAUDE.md` / `GEMINI.md` |
11
+ | Claude Code | `CLAUDE.md` (auto-loaded) |
12
+ | Cursor | root `AGENTS.md`, plus `.cursor/rules/*.mdc` for rules |
13
+ | Kiro | root `AGENTS.md`, plus `.kiro/steering/` for always-on context |
14
+ | Antigravity | root `AGENTS.md` |
15
+
16
+ **Precedence matters more than reach.** Several of these load on every turn regardless of relevance. A file that is always in context should carry only what earns its place there — the same reason an always-included steering file is a poor home for a persona.
17
+
18
+ ## Evidence sources, in priority order
19
+
20
+ Every command must trace to one of these. Record the file and key as provenance.
21
+
22
+ | Source | What it proves |
23
+ |---|---|
24
+ | `.github/workflows/*.yml` (and other CI) | **Strongest.** These commands must pass or the build fails |
25
+ | `Makefile` / `justfile` / `Taskfile.yml` | Named entry points the team actually uses |
26
+ | `package.json` `scripts` | Node entry points; check the script body, not just the key |
27
+ | `pyproject.toml` / `setup.cfg` / `tox.ini` | Python entry points and runners |
28
+ | `Cargo.toml`, `go.mod`, `composer.json`, `Gemfile` | Ecosystem defaults *only if* the file confirms them |
29
+ | `CONTRIBUTING.md`, `README.md` | Human-facing; **verify against the above before trusting** — docs go stale faster than CI |
30
+ | Dev container / Dockerfile | Setup steps and version pins |
31
+
32
+ **A dependency is not a command.** `jest` in `devDependencies` does not mean `npm test` exists. Check for the script.
33
+
34
+ ## What earns a line — the counterfactual test
35
+
36
+ Ask: *without this line, would a competent agent do the wrong thing?*
37
+
38
+ | ✅ Earns its place | ❌ Cut |
39
+ |---|---|
40
+ | "Generated — never hand-edit `src/api/types.ts`; run `make codegen`" | "Keep the codebase clean and well organised" |
41
+ | "Migrations are append-only; never edit a committed migration" | "Follow database best practices" |
42
+ | "Tests live beside the source as `*_test.go`, not in `tests/`" | "Write comprehensive tests" |
43
+ | "`main` is protected; open a PR" | "Follow good git hygiene" |
44
+ | "Do not run `terraform apply` — plan only, a human applies" | "Be careful with infrastructure" |
45
+
46
+ ## Strip list
47
+
48
+ Search generated output for these; each hit is a line that changes no behaviour:
49
+
50
+ `clean` · `best practice` · `thorough` · `appropriate` · `as needed` · `where possible` · `make sure to` · `try to` · `robust` · `maintainable` · `readable` · `well-structured` · `properly` · `high-quality` · `idiomatic` (unless a specific idiom is named)
51
+
52
+ ## Satellite shapes — delta only
53
+
54
+ A satellite carries what is specific to its tool **and nothing else**. Every shared fact stays in `AGENTS.md` and is pointed at.
55
+
56
+ **`CLAUDE.md`** — Claude Code auto-loads it:
57
+
58
+ ```markdown
59
+ # CLAUDE.md
60
+
61
+ The substantive guidance lives in [AGENTS.md](AGENTS.md). Read it first.
62
+
63
+ This file exists because Claude Code auto-loads `CLAUDE.md`. Everything below is
64
+ Claude-Code-specific and does not belong in the cross-IDE file.
65
+
66
+ ## <tool-specific section>
67
+ …e.g. `${CLAUDE_SKILL_DIR}` semantics, `.claude/settings.json`, subagent delegation…
68
+ ```
69
+
70
+ **`.github/copilot-instructions.md`** — same shape, Copilot-specific content only (custom agents in `.github/agents/`, `.github/hooks/*.json`).
71
+
72
+ **`GEMINI.md`** — same shape, for Gemini/Antigravity specifics.
73
+
74
+ **Refuse** to emit a satellite containing the command table, file placement, or conventions that already live in `AGENTS.md`. If a tool needs those, it reads `AGENTS.md` — and if it genuinely cannot, say so plainly rather than duplicating.
75
+
76
+ ## Line budget
77
+
78
+ 150 lines total. A workable split:
79
+
80
+ | Section | Lines |
81
+ |---|---|
82
+ | Repo in one paragraph | 3–5 |
83
+ | Commands (with provenance verified) | 15–30 |
84
+ | File placement | 10–20 |
85
+ | Conventions that pass the counterfactual test | 20–40 |
86
+ | Forbidden actions | 5–15 |
87
+ | Pointers to deeper docs | 3–5 |
88
+
89
+ Over budget: cut background prose first, then examples, then convention lines that only *probably* pass the test.
@@ -0,0 +1,48 @@
1
+ # AGENTS.md — {project name}
2
+
3
+ > {One line: what an agent needs to know it is working on.}
4
+
5
+ ## Repo in one paragraph
6
+
7
+ {What this is, what it produces, and the one structural fact an agent must hold. 3–5 lines.}
8
+
9
+ ## Commands
10
+
11
+ <!-- Every row traces to a file. No row may be inferred from ecosystem convention. -->
12
+
13
+ | Task | Command | Source |
14
+ |---|---|---|
15
+ | Install | `{cmd}` | `{file}` → `{key}` |
16
+ | Build | `{cmd}` | `{file}` → `{key}` |
17
+ | Test | `{cmd}` *or* `[missing: no test command in CI or manifests]` | `{file}` → `{key}` |
18
+ | Lint | `{cmd}` | `{file}` → `{key}` |
19
+ | Run locally | `{cmd}` | `{file}` → `{key}` |
20
+
21
+ {Drop the Source column from the final file if it crowds the budget — but only after every row has been verified with it present.}
22
+
23
+ ## File placement
24
+
25
+ | Kind | Where |
26
+ |---|---|
27
+ | {thing} | `{path}` |
28
+
29
+ ## Conventions
30
+
31
+ <!-- Each line must pass: without it, would a competent agent do the wrong thing? -->
32
+
33
+ - **{Rule stated as a rule.}** {One clause of why, only if the why changes how it is applied.}
34
+
35
+ ## Do not
36
+
37
+ - {Path, command, or action that must never happen unattended — concrete.}
38
+ - {Generated artifacts that must not be hand-edited, and the command that regenerates them.}
39
+
40
+ ## Pointers
41
+
42
+ - {Deeper doc}: `{path}`
43
+ - {Architecture / design}: `{path}`
44
+
45
+ <!--
46
+ Line budget: 150. Provenance for every command was verified at generation time.
47
+ Commands marked [missing] are findings, not omissions — the repo has no such command.
48
+ -->