@complexthings/superpowers-agent 8.4.1 → 9.0.0

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.
Files changed (46) hide show
  1. package/.agents/skills/caveman/SKILL.md +49 -0
  2. package/.agents/skills/diagnose/SKILL.md +117 -0
  3. package/.agents/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  4. package/.agents/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  5. package/.agents/skills/grill-with-docs/CONTEXT-FORMAT.md +63 -0
  6. package/.agents/skills/grill-with-docs/SKILL.md +90 -0
  7. package/.agents/skills/handoff/SKILL.md +15 -0
  8. package/.agents/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  9. package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  10. package/.agents/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
  11. package/.agents/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  12. package/.agents/skills/improve-codebase-architecture/SKILL.md +81 -0
  13. package/.agents/skills/karpathy-guidelines/SKILL.md +75 -0
  14. package/.agents/skills/prototype/LOGIC.md +79 -0
  15. package/.agents/skills/prototype/SKILL.md +30 -0
  16. package/.agents/skills/prototype/UI.md +112 -0
  17. package/.agents/skills/review/SKILL.md +78 -0
  18. package/.agents/skills/setup-matt-pocock-skills/SKILL.md +125 -0
  19. package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  20. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +22 -0
  21. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +23 -0
  22. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
  23. package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  24. package/.agents/skills/tdd/SKILL.md +109 -0
  25. package/.agents/skills/tdd/deep-modules.md +33 -0
  26. package/.agents/skills/tdd/interface-design.md +31 -0
  27. package/.agents/skills/tdd/mocking.md +59 -0
  28. package/.agents/skills/tdd/refactoring.md +10 -0
  29. package/.agents/skills/tdd/tests.md +61 -0
  30. package/.agents/skills/to-issues/SKILL.md +83 -0
  31. package/.agents/skills/to-prd/SKILL.md +76 -0
  32. package/.agents/skills/triage/AGENT-BRIEF.md +168 -0
  33. package/.agents/skills/triage/OUT-OF-SCOPE.md +101 -0
  34. package/.agents/skills/triage/SKILL.md +103 -0
  35. package/.agents/skills/ubiquitous-language/SKILL.md +93 -0
  36. package/.agents/skills/zoom-out/SKILL.md +7 -0
  37. package/.agents/superpowers-agent +120 -140
  38. package/.github/copilot-instructions.md +3 -0
  39. package/.github/workflows/main.yaml +1 -1
  40. package/AGENTS.md +97 -0
  41. package/README.md +32 -94
  42. package/package.json +2 -4
  43. package/skills/meta/create-agents-md/SKILL.md +182 -0
  44. package/skills/meta/create-agents-md/skill.json +9 -0
  45. package/skills/meta/writing-prompts/SKILL.md +64 -287
  46. package/skills/meta/writing-prompts/references/platforms.md +114 -0
@@ -0,0 +1,3 @@
1
+ <!-- SUPERPOWERS_-_INSTRUCTIONS_START -->
2
+ ${content}
3
+ <!-- SUPERPOWERS_-_INSTRUCTIONS_END -->
@@ -30,4 +30,4 @@ jobs:
30
30
  - name: Publish to npm
31
31
  env:
32
32
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33
- run: npm publish --access public
33
+ run: npm publish --access public
package/AGENTS.md CHANGED
@@ -58,3 +58,100 @@ Skills encode proven techniques that prevent mistakes. Not using them means repe
58
58
 
59
59
  <!-- SUPERPOWERS_SKILLS_END -->
60
60
 
61
+ ## What This Project Is
62
+
63
+ **Superpowers Agent** is a CLI (`superpowers-agent`, alias `superpowers`) that manages reusable markdown-based "skills" for AI coding assistants. It delivers skills to Claude, GitHub Copilot, Cursor, Gemini, OpenCode, and Codex. Skills live in `skills/` (this repo) and `.agents/skills/`, and bootstrap symlinks them into each assistant's config directory. Published to npm as `@complexthings/superpowers-agent`.
64
+
65
+ ## Build & Development
66
+
67
+ The CLI source lives in `.agents/` and is built with **Bun** (`packageManager: bun@1.3.8`). Run scripts from the `.agents/` directory:
68
+
69
+ ```bash
70
+ cd .agents
71
+ bun run build # Build minified ESM bundle → .agents/superpowers-agent
72
+ bun run watch # Build in watch mode
73
+ bun run dev # Run CLI from source (bun src/cli.js)
74
+ bun run dev:link # Symlink the `superpowers-agent` bin to the dev source
75
+ bun run production:link # Symlink the bin to the built bundle
76
+ ```
77
+
78
+ The build (`.agents/build.js`) uses the `Bun.build` API, so it must run under **bun**, not node. Output is `.agents/superpowers-agent` — a polyglot shebang script that execs `bun` if present, otherwise `node`.
79
+
80
+ The CLI has **no runtime dependencies** (pure Node.js/Bun built-ins). The only dev dependency is `husky`. Node engines: `^20 || ^22 || ^24`.
81
+
82
+ ## Testing
83
+
84
+ There is **no automated test runner** and no `test` script. Verification is manual: run the CLI commands directly, or drive the saved prompt scenarios in `.agents/prompts/`. State this plainly rather than inventing a test command.
85
+
86
+ ## Architecture
87
+
88
+ ### Source (`.agents/src/`)
89
+
90
+ | Layer | Files | Responsibility |
91
+ |-------|-------|---------------|
92
+ | CLI entry | `cli.js` | Command dispatch table |
93
+ | Commands | `commands/bootstrap.js`, `update.js`, `simple-commands.js` | Command implementations |
94
+ | Core | `core/config.js`, `paths.js`, `platform-detection.js`, `git.js` | Config, path resolution, platform detection, git helpers |
95
+ | Skills | `skills/finder.js`, `locator.js`, `installer.js`, `executor.js`, `parser.js` | Skill discovery, install, execution pipeline |
96
+ | Agents | `agents/installer.js`, `agents/platforms.js` | Install agent definitions (`.github/agents/*.agent.md`, `.opencode/agents/*.md`) into platform dirs |
97
+ | Integrations | `integrations/claude.js`, `codex.js`, `copilot.js`, `cursor.js`, `gemini.js`, `opencode.js` | Per-platform symlink/config setup |
98
+ | Utils | `utils/symlinks.js`, `frontmatter.js`, `output.js`, `file-ops.js` | Shared helpers |
99
+
100
+ ### Skill Discovery Priority (highest → lowest)
101
+
102
+ 1. `.agents/skills/` — project-level
103
+ 2. `~/.agents/skills/` — personal cross-project
104
+ 3. `~/.agents/superpowers/skills/` — bundled community skills
105
+
106
+ ### CLI Commands
107
+
108
+ From `.agents/src/cli.js` dispatch table:
109
+
110
+ - **Core:** `bootstrap [--no-update] [--force]`, `version`, `check-updates`, `update [--no-reinstall]`
111
+ - **Config:** `config-get`, `config-set <key> <value>`
112
+ - **Skills:** `setup-skills`, `find-skills [pattern]`, `use-skill <name>`, `execute <name>`, `dir <name>`, `path <name>`, `get-helpers <skill> <search-term>`
113
+ - **Install/manage skills:** `add <url-or-path|@alias> [path]`, `add-repository <git-url> [--as=@alias]`, `list-repositories`, `pull <url-or-path|@alias>`, `rm <url-or-path|@alias>`
114
+ - **Integrations:** `install-cursor-hooks`, `install-aliases`
115
+
116
+ ### Key Flows
117
+
118
+ - **`bootstrap`** → detects installed AI platforms → symlinks skills into each platform's skills dir → writes platform config files
119
+ - **`find-skills [pattern]`** → searches all three skill tiers → returns name/path/description
120
+ - **`execute <skill-name>`** → locates skill → outputs SKILL.md content for the agent to follow
121
+ - **`add <url-or-path|@alias>`** → clones a git repo or copies a local path → installs skills into `~/.agents/superpowers/skills/`
122
+ - **`update`** → checks the npm registry for a newer version → reports if an update is available
123
+
124
+ ### Skill Structure
125
+
126
+ Each skill is a directory with a `SKILL.md` file:
127
+
128
+ ```
129
+ skills/
130
+ └── <category>/
131
+ └── <skill-name>/
132
+ ├── SKILL.md # Frontmatter (name, description) + instructions
133
+ ├── scripts/ # Optional support scripts
134
+ └── resources/ # Optional templates/data
135
+ ```
136
+
137
+ `SKILL.md` frontmatter fields: `name`, `description`, and optional `metadata` (e.g. `version`). The set of bundled skills and their lockfile state are tracked in `skill.json` and `skills-lock.json` at the repo root.
138
+
139
+ ## Versioning & Publishing
140
+
141
+ The `.husky/pre-commit` hook keeps the root `package.json` and `.agents/package.json` versions in sync: on commit it picks the higher of the two, writes both, refreshes lockfiles, rebuilds the bundle (`cd .agents && bun install && bun run build`), and stages the affected files. Don't hand-edit one version without the other.
142
+
143
+ The package is published to npm as `@complexthings/superpowers-agent` (registry auth via the `COMPLEX_THINGS_NPM_TOKEN` in `.npmrc`). The current version is whatever `package.json` reports — do not hardcode it elsewhere.
144
+
145
+ ## Agent skills
146
+
147
+ ### Issue tracker
148
+
149
+ Issues and PRDs are tracked as GitHub issues on `complexthings/superpowers`, managed via the `gh` CLI. See `docs/agents/issue-tracker.md`.
150
+
151
+ ### Triage labels
152
+
153
+ The five canonical triage roles use their default label strings (`needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`). See `docs/agents/triage-labels.md`.
154
+
155
+ ### Domain docs
156
+
157
+ Single-context layout — one `CONTEXT.md` + `docs/adr/` at the repo root (created lazily). See `docs/agents/domain.md`.
package/README.md CHANGED
@@ -2,10 +2,19 @@
2
2
 
3
3
  A comprehensive skills library of proven techniques, patterns, and workflows for AI coding assistants.
4
4
 
5
- **This is a fork and extension of Jesse Vincent's incredible [Superpowers for Claude Code](https://github.com/obra/superpowers).** Jesse's groundbreaking work and [his amazing blog post](https://blog.fsck.com/2025/10/09/superpowers/) introduced the concept of systematic, reusable skills for AI agents. This fork extends that vision to support agent-agnostic workflows across GitHub Copilot, Cursor, Gemini, and other AI coding assistants.
5
+ **This is a fork and extension of Jesse Vincent's incredible [Superpowers for Claude Code](https://github.com/obra/superpowers).** Jesse's groundbreaking work and [his amazing blog post](https://blog.fsck.com/2025/10/09/superpowers/) introduced the concept of systematic, reusable skills for AI agents. This fork extends that vision to support agent-agnostic workflows across GitHub Copilot, Claude Code, and OpenCode.
6
6
 
7
7
  ## What's New
8
8
 
9
+ **v9.0.0 (May 28, 2026):**
10
+
11
+ - **Claude persona installation** — `.claude/agents/<name>.md` personas now install into `~/.claude/agents/` via `add`/`pull` (previously silently skipped)
12
+ - ⚠️ **No more `postinstall`** — the npm `postinstall` script was removed for supply-chain hardening. Fresh installs now require a **one-time manual** `superpowers-agent bootstrap`; `superpowers-agent update` self-runs bootstrap thereafter
13
+ - ⚠️ **Removed Cursor, Codex & Gemini support** — supported platforms are now **GitHub Copilot, Claude Code, and OpenCode** only. Integration modules, detection, the `install-cursor-hooks` command, and `GEMINI.md` generation were removed
14
+ - ⚠️ **Skills live only in `~/.agents/skills`** — per-platform skill symlinking has been removed. A one-time `skill.json`-gated cleaner runs during `bootstrap` to scrub deprecated symlink directories (including legacy Cursor/Codex/Gemini) without touching agent personas
15
+ - **Fixed `copilot-instructions.md`** — `setup-skills` now correctly creates and idempotently updates `.github/copilot-instructions.md`
16
+ - **`bun test` harness** — added a Bun test runner, smoke test, and `test` script following the `.agents/tests/<feature>.test.js` convention
17
+
9
18
  **v8.4.0 (April 6, 2026):**
10
19
 
11
20
  - **`superpowers-agent rm` command** — new CLI command for removing installed skills and agents from your system
@@ -77,7 +86,7 @@ A comprehensive skills library of proven techniques, patterns, and workflows for
77
86
  - **Utility Commands** - `find-skills` to discover available skills, `execute` to load them
78
87
 
79
88
  Plus:
80
- - **Universal Prompts** - Work across Claude, GitHub Copilot, Cursor, Gemini, and other AI assistants
89
+ - **Universal Skills** - Work across GitHub Copilot, Claude Code, and OpenCode
81
90
  - **Automatic Integration** - Skills activate automatically when relevant
82
91
  - **Consistent Workflows** - Systematic approaches to common engineering tasks
83
92
 
@@ -85,13 +94,15 @@ Plus:
85
94
 
86
95
  ## Quick Install (Recommended)
87
96
 
88
- Install Superpowers globally with one command:
97
+ Install Superpowers globally and run the required one-time bootstrap step:
89
98
 
90
99
  ```bash
91
100
  npm install -g @complexthings/superpowers-agent
92
101
  superpowers-agent bootstrap
93
102
  ```
94
103
 
104
+ > **Note:** `superpowers-agent bootstrap` is a **required** one-time step after every fresh install. It is no longer run automatically by npm's `postinstall` hook — you must run it manually. Subsequent `superpowers-agent update` calls will run bootstrap for you automatically.
105
+
95
106
  ## Migration to Superpower Agent `^8.0.0`
96
107
 
97
108
  ```bash
@@ -273,90 +284,28 @@ superpowers-agent add https://github.com/example/agents-repo.git
273
284
  superpowers-agent pull @my-agents
274
285
  ```
275
286
 
276
- ### Skill Symlinks for IDE Integration
277
-
278
- Superpowers automatically creates symlinks to make skills available to all major AI coding assistants in their native skill directories.
279
-
280
- **How it works:**
281
-
282
- When you run `superpowers-agent bootstrap` or `superpowers-agent setup-skills`:
283
-
284
- 1. **Global symlinks** (via `bootstrap`) sync skills to user-level directories:
285
- - `~/.claude/skills/superpowers` -> `~/.agents/superpowers/skills/`
286
- - `~/.copilot/skills/superpowers` -> `~/.agents/superpowers/skills/`
287
- - `~/.config/opencode/skill/superpowers` -> `~/.agents/superpowers/skills/`
288
- - `~/.cursor/skills/superpowers` -> `~/.agents/superpowers/skills/`
289
- - `~/.gemini/skills/superpowers` -> `~/.agents/superpowers/skills/`
290
- - `~/.codex/skills/superpowers` -> `~/.agents/superpowers/skills/`
291
-
292
- 2. **Project symlinks** (via `setup-skills`) sync project skills to agent directories:
293
- - `.claude/skills` -> `.agents/skills`
294
- - `.github/skills` -> `.agents/skills`
295
- - `.opencode/skill` -> `.agents/skills`
296
- - `.cursor/skills` -> `.agents/skills`
297
- - `.gemini/skills` -> `.agents/skills`
298
- - `.codex/skills` -> `.agents/skills`
287
+ ### Skill Storage
299
288
 
300
- 3. **Personal skills** (installed via `superpowers-agent add`) are symlinked individually to all platforms.
289
+ As of v9.0.0, Superpowers no longer creates per-platform skill symlinks. Skills live in just two canonical locations and the supported agents discover them there directly:
301
290
 
302
- **Behavior:**
303
- - Symlinks are only created if the parent directory exists
304
- - Use `--force` flag to create parent directories: `superpowers-agent bootstrap --force`
305
- - Use `--force-<agent>` flags to re-install only specific agent integrations (e.g. `--force-copilot`, `--force-cursor`, `--force-claude`)
306
- - Symlinks are tracked in `~/.agents/config.json` for management
291
+ - **Global skills** — bundled Superpowers skills in `~/.agents/superpowers/skills/` and personal skills in `~/.agents/skills/`
292
+ - **Project skills** `.agents/skills/` inside a project (created/managed by `setup-skills`)
307
293
 
308
- **Windows Notes:**
294
+ **Stale symlink cleanup:**
309
295
 
310
- On Windows, symlinks require either:
311
- - Developer Mode enabled (Settings > Update & Security > For developers)
312
- - Running as administrator
313
-
314
- If symlink creation fails on Windows, you'll see a warning with instructions.
315
-
316
- **Configuration:**
317
- ```json
318
- // ~/.agents/config.json
319
- {
320
- "symlinks": {
321
- "claude": {
322
- "superpowers": "~/.claude/skills/superpowers",
323
- "skills": ["~/.claude/skills/my-skill"]
324
- },
325
- "copilot": {
326
- "superpowers": "~/.copilot/skills/superpowers",
327
- "skills": []
328
- },
329
- "opencode": {
330
- "superpowers": "~/.config/opencode/skill/superpowers",
331
- "skills": []
332
- },
333
- "cursor": {
334
- "superpowers": "~/.cursor/skills/superpowers",
335
- "skills": []
336
- },
337
- "gemini": {
338
- "superpowers": "~/.gemini/skills/superpowers",
339
- "skills": []
340
- },
341
- "codex": {
342
- "superpowers": "~/.codex/skills/superpowers",
343
- "skills": []
344
- }
345
- }
346
- }
347
- ```
296
+ A one-time, `skill.json`-gated cleaner runs during `superpowers-agent bootstrap`. It scrubs deprecated per-platform skill symlink directories left behind by older versions — including legacy Cursor, Codex, and Gemini directories — without touching agent personas in `~/.claude/agents/` or the supported platforms.
348
297
 
349
- ## Slash Commands & Skill Priority
298
+ ## Skill Priority
350
299
 
351
- Superpowers delivers skills as symlinks into each agent's native skill directory. Each agent discovers and loads skills using its native skill tool no separate prompt/command files are installed.
300
+ Each supported agent discovers and loads skills using its native skill tool. No separate prompt/command files are installed.
352
301
 
353
302
  **Skill priority pipeline (first match wins):**
354
- 1. `./skills/` or `.agents/skills/` inside the workspace (project-specific overrides)
303
+ 1. `.agents/skills/` inside the workspace (project-specific overrides)
355
304
  2. `.claude/skills/` inside the repo if present (repo-wide Claude overrides)
356
305
  3. Personal skills in `~/.agents/skills/` (user-level customizations)
357
306
  4. Bundled Superpowers skills in `~/.agents/superpowers/skills/` (system defaults)
358
307
 
359
- When any agent invokes a skill — no matter which tool it originates from — the CLI enforces the ordering above. Add a `brainstorming` skill under `./skills/` and every tool immediately picks it up without modifying any prompt files.
308
+ When any agent invokes a skill — no matter which supported tool it originates from — the CLI enforces the ordering above. Add a `brainstorming` skill under `.agents/skills/` and every supported tool immediately picks it up.
360
309
 
361
310
  ### OpenCode
362
311
 
@@ -364,22 +313,11 @@ Skills are available via OpenCode's native `skill` tool. The `.opencode/plugins/
364
313
 
365
314
  ### GitHub Copilot
366
315
 
367
- Skills are available via the native skill tool.
368
-
369
- ### Cursor
370
-
371
- Skills are available via the native skill tool.
372
- ### Gemini
373
-
374
- Skills are available via the native skill tool.
316
+ Skills are available via the native skill tool.
375
317
 
376
318
  ### Claude Code
377
319
 
378
- Skills are available via the native skill tool.
379
-
380
- ### Codex
381
-
382
- Skills are available via the native skill tool.
320
+ Skills are available via the native skill tool. Claude agent personas defined in `.claude/agents/<name>.md` are installed into `~/.claude/agents/` via `add`/`pull`.
383
321
 
384
322
  ## What's Inside
385
323
 
@@ -450,7 +388,7 @@ The `tests/` directory contains agent-agnostic test scripts for validating skill
450
388
  ./tests/skill-triggering/run-all.sh
451
389
 
452
390
  # Configure for your agent
453
- export AGENT_CLI="opencode" # or "claude", "cursor", etc.
391
+ export AGENT_CLI="opencode" # or "claude", "copilot", etc.
454
392
  ./tests/skill-triggering/run-test.sh prompts/test-name.txt
455
393
  ```
456
394
 
@@ -609,7 +547,7 @@ superpowers-agent add @baici
609
547
  1. **Bootstrap Process** - Installs agent integrations and syncs skill symlinks globally
610
548
  2. **Skill Discovery** - Finds skills across system, personal, and project locations
611
549
  3. **Priority Resolution** - Project skills override personal skills override system skills
612
- 4. **Universal Integration** - Works with OpenCode, GitHub Copilot, Cursor, Gemini, and other AI assistants
550
+ 4. **Universal Integration** - Works with GitHub Copilot, Claude Code, and OpenCode
613
551
 
614
552
  **For OpenCode:**
615
553
  1. **Plugin System** - The `.opencode/plugins/superpowers-agent.js` plugin injects bootstrap context dynamically at session start
@@ -667,11 +605,11 @@ Use `--force-<agent>` flags to target individual agents without running the full
667
605
  # Re-install only GitHub Copilot integration
668
606
  superpowers-agent bootstrap --force-copilot
669
607
 
670
- # Re-install Copilot and Gemini together
671
- superpowers-agent bootstrap --force-copilot --force-gemini
608
+ # Re-install Copilot and Claude together
609
+ superpowers-agent bootstrap --force-copilot --force-claude
672
610
  ```
673
611
 
674
- Supported flags: `--force-copilot`, `--force-cursor`, `--force-codex`, `--force-gemini`, `--force-claude`, `--force-opencode`
612
+ Supported flags: `--force-copilot`, `--force-claude`, `--force-opencode`
675
613
 
676
614
  > When `--force-<agent>` flags are used, universal alias installation and `AGENTS.md` platform generation are skipped. Skill symlink sync still runs. If the agent's directory does not exist (e.g. `~/.copilot`), it will be created automatically.
677
615
 
@@ -725,7 +663,7 @@ This project builds on [Jesse Vincent's Superpowers for Claude Code](https://git
725
663
  - OpenCode plugin architecture pattern
726
664
  - Test infrastructure for skill validation
727
665
 
728
- This fork extends that vision to support agent-agnostic workflows across multiple AI coding assistants including GitHub Copilot, Cursor, Gemini, OpenCode, and Codex.
666
+ This fork extends that vision to support agent-agnostic workflows across GitHub Copilot, Claude Code, and OpenCode.
729
667
 
730
668
  ## License
731
669
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complexthings/superpowers-agent",
3
- "version": "8.4.1",
3
+ "version": "9.0.0",
4
4
  "description": "Superpowers agent CLI — skills system for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,9 +25,7 @@
25
25
  "engines": {
26
26
  "node": "^20 || ^22 || ^24"
27
27
  },
28
- "scripts": {
29
- "postinstall": "node .agents/superpowers-agent bootstrap --no-update 2>/dev/null || true"
30
- },
28
+ "scripts": {},
31
29
  "author": {
32
30
  "name": "Greg Harvell",
33
31
  "email": "greg.harvell@complexthings.com",
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: create-agents-md
3
+ description: Analyzes a codebase and creates or improves an AGENTS.md file at the repo root — the open-standard instruction file that AI coding agents (Claude Code, Codex, Cursor, Copilot, Gemini CLI, Aider, and others) read for build/test commands, code style, and conventions. Use whenever the user asks to create, generate, write, update, or improve an AGENTS.md, onboard agents to a repo, document build/test/lint commands for AI tools, or consolidate scattered agent instruction files (CLAUDE.md, .cursorrules, .cursor/rules, .github/copilot-instructions.md) into one. Use even if the user only says "make an agents file" or "document this repo for AI agents".
4
+ metadata:
5
+ version: 1.0.0
6
+ ---
7
+
8
+ # Create AGENTS.md
9
+
10
+ ## Overview
11
+
12
+ `AGENTS.md` is an open, cross-tool standard (https://agents.md/): a "README for agents" placed at the repo root that gives AI coding agents the build steps, test commands, and conventions they need to work in a repository. 20+ tools read it, including Claude Code, OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI, Aider, Jules, and Zed.
13
+
14
+ This skill produces that file by **reading the actual repository** and writing down what is true of it — never boilerplate, never invented conventions.
15
+
16
+ **Core principle: facts only.** Every command, style rule, and convention in the output must come from a file you actually read. If you can't verify it, don't write it. A short AGENTS.md that is 100% accurate beats a long one padded with plausible guesses — agents will run the commands you list, and a wrong command wastes their time.
17
+
18
+ ## When NOT to use this skill
19
+
20
+ - The user wants a human-facing project README → that's `README.md`, not AGENTS.md.
21
+ - The user wants to set up the superpowers skills system → use `setup-skills`.
22
+ - The user wants to audit/improve a subagent prompt file → use `enhance-agent-prompts`.
23
+
24
+ ## Workflow
25
+
26
+ Copy this checklist and track progress as you go:
27
+
28
+ ```
29
+ AGENTS.md Progress:
30
+ - [ ] Step 1: Detect ecosystem and locate inputs
31
+ - [ ] Step 2: Read existing instruction files (don't replace blindly)
32
+ - [ ] Step 3: Extract verifiable commands (build, lint, test, single test)
33
+ - [ ] Step 4: Infer code style and conventions from real source
34
+ - [ ] Step 5: Decide scope — single file vs. nested (monorepo)
35
+ - [ ] Step 6: Write or improve AGENTS.md
36
+ - [ ] Step 7: Self-review against the accuracy checklist
37
+ ```
38
+
39
+ Use `leveraging-cli-tools` throughout — prefer `rg`, `fd`, `bat`, `jq`, and `ast-grep` over slower alternatives. The detection commands below assume them.
40
+
41
+ ### Step 1: Detect ecosystem and locate inputs
42
+
43
+ Identify the stack before reading anything in depth. This tells you which config files matter.
44
+
45
+ ```bash
46
+ # Manifests and lockfiles reveal the package manager and language
47
+ fd -H -d 2 '^(package\.json|pnpm-lock\.yaml|yarn\.lock|package-lock\.json|bun\.lockb|Cargo\.toml|go\.mod|pyproject\.toml|requirements\.txt|Gemfile|composer\.json|pom\.xml|build\.gradle)$'
48
+ ```
49
+
50
+ The lockfile is the source of truth for the package manager: `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `bun.lockb` → bun, otherwise `package-lock.json` → npm. Use the right one in every command you document — telling an agent to run `npm test` in a pnpm repo is a factual error.
51
+
52
+ ### Step 2: Read existing instruction files
53
+
54
+ Read each of these if present. The goal is to **improve, not overwrite** — preserve still-accurate content and fold in scattered rules.
55
+
56
+ ```bash
57
+ fd -H -d 3 '^(AGENTS\.md|CLAUDE\.md|GEMINI\.md|\.cursorrules|copilot-instructions\.md)$'
58
+ fd -H -t f . .cursor/rules 2>/dev/null # Cursor rules live here as .mdc files
59
+ ```
60
+
61
+ - **Existing `AGENTS.md`** — treat as the base. Keep what's correct, fix what's stale, fill gaps.
62
+ - **`.cursor/rules/*.mdc`, `.cursorrules`, `.github/copilot-instructions.md`, `CLAUDE.md`, `GEMINI.md`** — extract real rules (style, conventions, do/don'ts) and incorporate them verbatim or tightly summarized. Note their source so the user can later consolidate (see [Consolidating instruction files](#consolidating-instruction-files)).
63
+
64
+ ### Step 3: Extract verifiable commands
65
+
66
+ These are the highest-value content — agents run them directly. Pull them from config, don't guess.
67
+
68
+ ```bash
69
+ # Node: the scripts block IS the command list
70
+ jq '.scripts' package.json 2>/dev/null
71
+
72
+ # Other ecosystems: read the real task definitions
73
+ bat Makefile justfile Taskfile.yml 2>/dev/null
74
+ rg -n '\[tool\.(poetry|hatch|pdm)\.|^\[project\.scripts\]' pyproject.toml 2>/dev/null
75
+ ```
76
+
77
+ Capture: **build**, **lint**, **lint:fix/format**, **typecheck**, **test**, and crucially **how to run a single test in isolation** (e.g. `vitest run path/to/file.test.ts -t "name"`, `pytest path::test_name`, `go test ./pkg -run TestName`). Single-test invocation is the one agents most often get wrong, so derive it from the actual test runner rather than assuming.
78
+
79
+ If a command isn't defined anywhere, say how the tool is normally invoked for that runner — but only if the runner is actually present in the manifest.
80
+
81
+ ### Step 4: Infer code style and conventions
82
+
83
+ Read formatter/linter config first (these are authoritative), then confirm against a representative sample of real source files.
84
+
85
+ ```bash
86
+ fd -H -d 2 '^(\.eslintrc.*|eslint\.config\.*|\.prettierrc.*|prettier\.config\.*|biome\.json|\.editorconfig|ruff\.toml|\.rubocop\.yml|rustfmt\.toml|tsconfig\.json)$'
87
+ ```
88
+
89
+ Confirm by reading several source files in the primary language — don't document a rule the config implies but the code contradicts. Cover what an agent needs to match the house style:
90
+
91
+ - **Imports** — ordering, named vs. default, file extensions, path aliases.
92
+ - **Formatting** — quotes, semicolons, indentation, line length (usually settled by the formatter config — cite it).
93
+ - **Types** — strictness, annotation expectations, `any` policy.
94
+ - **Naming** — files, functions, variables, constants, components, CSS classes.
95
+ - **Error handling** — the pattern actually used (Result types, exceptions, error-wrapping helpers) and anything the codebase clearly avoids.
96
+
97
+ For naming/error patterns, prefer `ast-grep` or `rg` over eyeballing one file, so the convention you state reflects the codebase, not a single example.
98
+
99
+ ### Step 5: Decide scope — single file vs. nested
100
+
101
+ AGENTS.md supports **nested files**: an agent reads the nearest one in the directory tree, so the closest file wins. For a monorepo, a per-package AGENTS.md often beats one bloated root file.
102
+
103
+ - **Single package** → one root `AGENTS.md`.
104
+ - **Monorepo** (workspaces in `package.json`, `pnpm-workspace.yaml`, Nx/Turbo/Lerna, multiple manifests) → write a root file with shared/global instructions, and offer to add per-package files where commands or conventions genuinely differ. Don't duplicate identical content into every package.
105
+
106
+ ### Step 6: Write or improve AGENTS.md
107
+
108
+ Write to `AGENTS.md` at the repo root (or the relevant package root for nested files). It's plain Markdown with no required schema — use clear headings. Default to the structure below, dropping any section you have no real content for.
109
+
110
+ Keep it precise and scannable, written for an agent audience, with no prose padding. **~150 lines is a ceiling, not a goal** — let the real content set the length. A small library might warrant only 30–40 lines; a large monorepo more. If you find yourself adding material to fill space, stop: a short, fully accurate file is the win, and padding directly violates the facts-only principle.
111
+
112
+ ```markdown
113
+ # AGENTS.md
114
+
115
+ Short orienting line: what this project is and the primary language/framework.
116
+
117
+ ## Setup
118
+ - Install: `<exact command for this repo's package manager>`
119
+ - Env/prereqs: `<only if real — node version from .nvmrc/engines, services, etc.>`
120
+
121
+ ## Commands
122
+ - Build: `<cmd>`
123
+ - Dev: `<cmd>`
124
+ - Lint: `<cmd>` | Fix: `<cmd>` | Typecheck: `<cmd>`
125
+ - Test (all): `<cmd>`
126
+ - Test (single): `<exact single-test invocation>`
127
+
128
+ ## Code style
129
+ - Imports: `<order, named/default, extensions, aliases>`
130
+ - Formatting: `<quotes, semicolons, indent, width — cite the formatter>`
131
+ - Types: `<strictness, annotation rules, any policy>`
132
+
133
+ ## Naming conventions
134
+ - Files / functions / variables / constants / components / CSS — only the rules that hold
135
+
136
+ ## Error handling
137
+ - The pattern this codebase uses; what to avoid
138
+
139
+ ## <Project-specific rules pulled from Cursor/Copilot/CLAUDE files>
140
+ - Folded-in rules, kept verbatim or tightly summarized
141
+
142
+ ## PR / commit guidelines
143
+ - Only if the repo evidences a convention (commitlint, CONTRIBUTING.md, PR template, git log pattern)
144
+ ```
145
+
146
+ Adapt headings to the project. Sourced rules from `.cursor/rules`, Copilot, etc. should be merged into the relevant section above rather than ghettoized — but keep a short note of provenance if it helps the user consolidate later.
147
+
148
+ ### Step 7: Self-review against the accuracy checklist
149
+
150
+ Before declaring done, re-read the file and verify every line:
151
+
152
+ ```
153
+ - [ ] Every command was copied from a real script/task/config — not assumed
154
+ - [ ] The package manager matches the lockfile in every command
155
+ - [ ] A single-test invocation is present and correct for the actual runner
156
+ - [ ] Every style/naming/error rule traces to config or observed source
157
+ - [ ] Rules from Cursor/Copilot/CLAUDE files are incorporated, not lost
158
+ - [ ] No invented conventions, no aspirational rules, no generic filler
159
+ - [ ] An existing AGENTS.md was improved, not blindly replaced
160
+ - [ ] Length is set by real content, not a quota (≤ ~150 lines); agent-audience tone; scannable
161
+ ```
162
+
163
+ If anything fails, fix it before finishing.
164
+
165
+ ## Consolidating instruction files
166
+
167
+ A common (community, not part of the official spec) convention is to make AGENTS.md the single source of truth and symlink tool-specific files to it, so every tool reads the same content:
168
+
169
+ ```bash
170
+ ln -sf AGENTS.md CLAUDE.md
171
+ ln -sf AGENTS.md GEMINI.md
172
+ ln -sf AGENTS.md .github/copilot-instructions.md
173
+ ```
174
+
175
+ Only do this if the user asks. Flag it as optional and confirm first — it's a destructive change to existing files, and some teams deliberately keep tool-specific instructions separate.
176
+
177
+ ## Edge cases
178
+
179
+ - **Empty or near-empty repo** — document only the scaffolding that exists (e.g. the manifest and its scripts). Don't pad.
180
+ - **Polyglot repo** — lead with the primary language; give each significant language its own command block.
181
+ - **Conflicting rules across instruction files** — prefer what the code and config actually do; note the conflict for the user rather than silently picking one.
182
+ - **No build/test tooling at all** — keep the file minimal and say so plainly, rather than inventing commands.
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "name": "superpowers:meta/create-agents-md",
4
+ "title": "create-agents-md",
5
+ "aliases": [
6
+ "create-agents-md",
7
+ "meta/create-agents-md"
8
+ ]
9
+ }