superspecs 0.1.0 → 0.2.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.
package/HOWITWORKS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # How SuperSpecs Works
2
2
 
3
- An explanation of the mechanics behind the framework — how skills are discovered, how agents load instructions, and how the four-phase lifecycle runs.
3
+ An explanation of the mechanics behind the framework — how skills are discovered, how slash commands are registered, and how the four-phase lifecycle runs.
4
4
 
5
5
  ---
6
6
 
@@ -26,50 +26,71 @@ Each `SKILL.md` starts with a YAML frontmatter block:
26
26
 
27
27
  ```yaml
28
28
  ---
29
- name: TDD Execution
29
+ name: execute-tdd
30
30
  description: Enforce RED → GREEN → REFACTOR with no exceptions
31
- slash_command: /tdd
32
- phase: "2.4"
31
+ slash_command: tdd
32
+ phase: "2.3 — Execute › per task (TDD)"
33
33
  ---
34
34
  ```
35
35
 
36
- The rest of the file is a detailed, imperative instruction set written for the agent to follow when that slash command is invoked.
36
+ - `slash_command` determines the command file name (e.g. `tdd.md` `/superspecs:tdd`)
37
+ - `description` is used in command files and agent skill listings
38
+ - The body is the detailed instruction set the agent follows when invoked
37
39
 
38
40
  ---
39
41
 
40
- ## Skill Discovery — How Agents Find Skills
42
+ ## Two-Layer Installation
41
43
 
42
- Each AI coding tool has a designated directory it scans for skills at startup. `setup.sh` symlinks every `SKILL.md` into each of those directories:
44
+ `setup.sh` runs two separate installation steps for each agent:
45
+
46
+ ### 1. Skills (auto-discovery)
47
+
48
+ Each AI tool has a designated directory it scans for skills. `setup.sh` creates a `<name>/SKILL.md` symlink structure in each of those directories:
43
49
 
44
50
  ```
45
- ~/.claude/skills/execute-tdd.md → .skills/execute-tdd/SKILL.md
46
- ~/.agents/skills/execute-tdd.md → .skills/execute-tdd/SKILL.md
47
- ~/.codex/skills/execute-tdd.md → .skills/execute-tdd/SKILL.md
48
- # ... same for every agent
51
+ ~/.claude/skills/execute-tdd/SKILL.md → .skills/execute-tdd/SKILL.md
52
+ ~/.agents/skills/execute-tdd/SKILL.md → .skills/execute-tdd/SKILL.md
53
+ ~/.config/opencode/skills/execute-tdd/SKILL.md → .skills/execute-tdd/SKILL.md
54
+ # ... same for every agent and every skill
49
55
  ```
50
56
 
51
- When an agent starts, it reads its skills directory and registers each file as an available skill. The agent now knows about `/tdd`, `/spec`, `/ship`, and all the others before any user message is sent.
57
+ When an agent starts, it reads its skills directory and registers each skill as available context. The `description` field tells the agent when to invoke a skill automatically.
58
+
59
+ ### 2. Commands (slash invocation)
60
+
61
+ `setup.sh` also generates **real command files** (not symlinks) in each agent's commands directory. The file name determines the slash command — not the frontmatter:
52
62
 
53
63
  ```
54
- Agent startup
55
-
56
-
57
- Read ~/.claude/skills/*.md
58
-
59
-
60
- Register skill: /discuss, /spec, /pick-spec, /branch,
61
- /subagent, /tdd, /code-review,
62
- /check-tests, /wiki, /ship
63
-
64
-
65
- Agent is ready — all commands available
64
+ ~/.claude/commands/superspecs/ship.md → /superspecs:ship (Claude Code)
65
+ ~/.config/opencode/commands/superspecs-ship.md → /superspecs-ship (OpenCode)
66
66
  ```
67
67
 
68
+ Generated command files contain only a `description` frontmatter field and the skill body. The SKILL.md-specific fields (`slash_command`, `name`, `phase`) are intentionally stripped.
69
+
70
+ ```
71
+ # ~/.claude/commands/superspecs/ship.md (generated)
72
+ ---
73
+ description: Create the PR, write the changelog...
74
+ ---
75
+
76
+ # Skill: ship
77
+ You are shipping the feature...
78
+ ```
79
+
80
+ **Command naming by agent:**
81
+
82
+ | Agent | Format | Example |
83
+ |---|---|---|
84
+ | Claude Code | `/superspecs:<cmd>` (subdir namespace) | `/superspecs:ship` |
85
+ | OpenCode | `/superspecs-<cmd>` (flat prefix) | `/superspecs-ship` |
86
+
87
+ > OpenCode does not support colon namespacing in command names.
88
+
68
89
  ---
69
90
 
70
91
  ## Bootstrap Files
71
92
 
72
- Beyond skills, each agent also gets a **bootstrap file** that is loaded at the start of every session. These prime the agent with the lifecycle summary so it behaves correctly even before a slash command is issued.
93
+ Beyond skills and commands, each agent also gets a **bootstrap file** that is loaded at the start of every session. These prime the agent with the lifecycle summary so it behaves correctly even before a slash command is issued.
73
94
 
74
95
  | File | Agent | Mechanism |
75
96
  |---|---|---|
@@ -86,53 +107,124 @@ Bootstrap files are short — they contain the lifecycle diagram, the slash comm
86
107
 
87
108
  ## The Four-Phase Lifecycle
88
109
 
110
+ ### Phase 0 — Setup
111
+
112
+ **Goal:** Ground every future session with a permanent stack profile.
113
+
114
+ ```
115
+ /superspecs:techstack → wiki/techstack.md (stack + recommended skills)
116
+ ```
117
+
89
118
  ### Phase 1 — Plan
90
119
 
91
120
  **Goal:** Produce a spec that fits a fresh 200k-token context window.
92
121
 
93
122
  ```
94
- /discuss → DISCUSS.md (decisions, constraints, non-goals)
95
- /spec → spec.md (SHALL requirements + GIVEN/WHEN/THEN scenarios)
96
- tasks.md (implementation task list)
97
- status.md (phase tracker)
123
+ /superspecs:discuss → DISCUSS.md (decisions, constraints, non-goals)
124
+ /superspecs:spec → spec.md (SHALL requirements + GIVEN/WHEN/THEN scenarios)
125
+ tasks.md (implementation task list)
126
+ status.md (phase tracker)
127
+ /superspecs:grill → GRILL.md (verdict: READY or NEEDS REVISION)
98
128
  ```
99
129
 
100
130
  The 200k window constraint is deliberate: any executor (subagent, fresh session, different agent) must be able to pick up the spec and work from it without needing prior chat history. If a spec is too large to fit, it is decomposed into smaller specs.
101
131
 
132
+ A spec that hasn't passed `/superspecs:grill` does not proceed to execution.
133
+
102
134
  ### Phase 2 — Execute
103
135
 
104
- **Goal:** Implement the spec in parallel using isolated subagents, with TDD enforced at every step.
136
+ **Goal:** Implement the spec in parallel using isolated subagents, with TDD enforced inside every task.
105
137
 
106
138
  ```
107
- /pick-specValidates spec completeness; creates phases/<slug>-execute/plan.md
108
- /branchgit branch or worktree; one branch per spec
109
- /subagentFresh subagent per task; wave-based dispatch; human checkpoints
110
- /tdd → RED (failing test) GREEN (minimal code) REFACTOR → commit
111
- /code-review → Spec compliance then code quality; Critical findings block progress
139
+ /superspecs:pick-spec Validates spec completeness; creates phases/<slug>-execute/plan.md
140
+ /superspecs:branch git branch or worktree; one branch per spec
141
+ /superspecs:subagent Fresh subagent per task; TDD per task; wave dispatch; human checkpoints
142
+ /superspecs:code-review Spec compliance then code quality; Critical findings block progress
112
143
  ```
113
144
 
114
145
  Each subagent receives: the spec, its task, and nothing else. No shared state. No reliance on context from other agents. This is what makes parallel execution safe.
115
146
 
147
+ **TDD is not a separate step after subagent development.** Every subagent task follows RED → GREEN → REFACTOR before it is considered done. The `/superspecs:tdd` skill defines the cycle; it runs inside every task dispatched by `/superspecs:subagent`.
148
+
149
+ The per-task cycle:
150
+ 1. Write a failing test — confirm it fails for the right reason (RED)
151
+ 2. Write minimum code — confirm it passes (GREEN)
152
+ 3. Refactor — clean up while tests stay green (REFACTOR)
153
+ 4. Run the full suite — no regressions
154
+ 5. Commit
155
+ 6. Code review: spec compliance first, then code quality
156
+
116
157
  ### Phase 3 — Verify
117
158
 
118
159
  **Goal:** Confirm the implementation matches the spec and the knowledge is preserved.
119
160
 
120
161
  ```
121
- /check-tests Full suite run; every spec scenario covered by a test; no skips
122
- /wiki → Distill to superspec/wiki/<domain>/<topic>.md
162
+ /superspecs:check-tests Full suite run; every spec scenario covered by a test; no skips
163
+ /superspecs:wiki Compile feature → superspec/wiki/<domain>/<topic>.md
164
+ ```
165
+
166
+ The wiki implements the **Karpathy LLM Wiki pattern**: raw sources are compiled once into structured, interlinked markdown pages. Future sessions query the compiled wiki — never the raw specs. The agent compiles once; queries are fast and accurate.
167
+
168
+ ```
169
+ superspec/wiki/raw/ ← immutable source material (agent reads, never edits)
170
+ superspec/wiki/ ← compiled knowledge base (agent writes on ingest)
171
+ superspec/wiki/log.md ← append-only activity log (grep-friendly)
172
+ .skills/verify-wiki/ ← schema: how to ingest, link, and format
173
+ ```
174
+
175
+ #### The wiki as an Obsidian vault
176
+
177
+ `superspec/wiki/` is pre-configured as an Obsidian vault. `setup.sh` creates:
178
+
179
+ ```
180
+ superspec/wiki/
181
+ ├── .obsidian/
182
+ │ ├── app.json ← wikilinks on, attachment folder set
183
+ │ ├── core-plugins.json ← graph, backlinks, tag pane, search enabled
184
+ │ └── .gitignore ← workspace + cache excluded from git
185
+ ├── raw/ ← source material (drop articles, PDFs, notes here)
186
+ ├── Home.md ← vault home page (updated by /wiki)
187
+ ├── log.md ← append-only activity log
188
+ ├── _manifest.json ← machine-readable ingestion log
189
+ └── <domain>/
190
+ ├── Home.md ← domain index
191
+ └── <topic>.md ← one page per knowledge unit
123
192
  ```
124
193
 
125
- The wiki is a living knowledge base architecture decisions, patterns, trade-offs, gotchas. It survives after the session ends and informs future planning.
194
+ To open the vault: **Obsidian Open folder as vault select `superspec/wiki/`**
195
+
196
+ The `/superspecs:wiki` skill writes every page with:
197
+ - `[[wikilinks]]` for all internal cross-references
198
+ - YAML frontmatter: `tags`, `created`, `updated`, `spec` (links back to the source spec)
199
+ - Domain `Home.md` index files for each folder
200
+ - Entries in the vault-wide `Home.md` under Recent Updates
201
+ - An entry appended to `log.md`
202
+
203
+ The shared config (`app.json`, `core-plugins.json`) is committed so every team member opens the vault with the same settings. User-specific state (`workspace.json`, `cache`, plugin data) is gitignored.
204
+
205
+ #### Wiki Operations (any time)
206
+
207
+ **`/superspecs:wiki-query`** — Query the compiled wiki for an answer. The agent reads `wiki/` only — not raw specs, not source code. Optionally files the synthesized answer back as a new wiki page.
208
+
209
+ **`/superspecs:wiki-lint`** — Periodic health check. Finds:
210
+ - Orphaned pages (no inbound wikilinks)
211
+ - Broken `[[wikilinks]]` (target page missing)
212
+ - Missing cross-links (page mentions a topic but doesn't link to its page)
213
+ - Contradictions (two pages make conflicting claims)
214
+ - Stale file references (backtick paths that no longer exist)
215
+ - Missing frontmatter fields
216
+
217
+ Produces `superspec/wiki/_lint-report.md`. Offers to auto-fix safe issues; contradictions always require human review.
126
218
 
127
219
  ### Phase 4 — Ship
128
220
 
129
221
  **Goal:** Merge and close the loop.
130
222
 
131
223
  ```
132
- /ship → PR creation; changelog entry; phase directory archived; spec marked complete
224
+ /superspecs:ship → PR creation; changelog entry; phase directory archived; spec marked complete
133
225
  ```
134
226
 
135
- After `/ship`, the cycle resets: `/pick-spec` for the next item.
227
+ After `/superspecs:ship`, the cycle resets: `/superspecs:pick-spec` for the next item.
136
228
 
137
229
  ---
138
230
 
@@ -146,6 +238,7 @@ superspec/
146
238
  │ └── <slug>/
147
239
  │ ├── DISCUSS.md ← pre-planning decisions
148
240
  │ ├── spec.md ← SHALL requirements + scenarios
241
+ │ ├── GRILL.md ← grill verdict + open questions
149
242
  │ ├── tasks.md ← task list for /subagent
150
243
  │ └── status.md ← phase tracker + checklist
151
244
 
@@ -179,30 +272,39 @@ These are enforced by the skills and bootstrap files. Agents are instructed to r
179
272
 
180
273
  | Rule | Enforcement |
181
274
  |---|---|
182
- | No implementation code before a failing test | `/tdd` deletes code written before tests |
183
- | Critical code-review findings block all progress | `/code-review` reports severity; Critical = hard stop |
184
- | Spec must fit a fresh 200k-token context window | `/spec` and `/pick-spec` both check this |
185
- | Every shipped feature → wiki page | `/ship` requires `/wiki` to have run first |
275
+ | No implementation code before a failing test | `/superspecs:tdd` deletes code written before tests |
276
+ | Critical code-review findings block all progress | `/superspecs:code-review` reports severity; Critical = hard stop |
277
+ | Spec must fit a fresh 200k-token context window | `/superspecs:spec` and `/superspecs:pick-spec` both check this |
278
+ | Every shipped feature → wiki page | `/superspecs:ship` requires `/superspecs:wiki` to have run first |
186
279
 
187
280
  ---
188
281
 
189
282
  ## The CLI
190
283
 
191
- `bin/superspecs.js` is a thin Node.js wrapper with a single command:
284
+ `bin/superspecs.js` is a thin Node.js wrapper around `setup.sh`:
285
+
286
+ ```bash
287
+ superspecs install # symlink skills + generate command files into all agent dirs
288
+ superspecs init # init superspec/ directory structure only (no agent symlinking)
289
+ superspecs version # print version
290
+ superspecs help # show help
291
+ ```
192
292
 
193
293
  ```bash
194
- superspecs install # runs setup.sh
294
+ npx superspecs install # run without a global install
195
295
  ```
196
296
 
197
- It exists so the framework can be distributed and installed via npm. All real logic is in `setup.sh` and the `.skills/` Markdown files.
297
+ All real logic lives in `setup.sh` and the `.skills/` Markdown files.
198
298
 
199
299
  ---
200
300
 
201
301
  ## Creating a New Skill
202
302
 
203
- The `skill-creator` meta-skill documents the process. In short:
303
+ The `/superspecs:skill-creator` meta-skill documents the full process. In short:
204
304
 
205
305
  1. Create `.skills/<name>/SKILL.md` with YAML frontmatter (`name`, `description`, `slash_command`, `phase`)
206
306
  2. Write the step-by-step instructions in the body
207
- 3. Run `bash setup.sh` to symlink the new skill into all agent directories
307
+ 3. Run `bash setup.sh` (or `superspecs install`) to:
308
+ - Symlink the skill into all agent skill directories (auto-discovery)
309
+ - Generate a clean command file in each agent's commands directory (slash invocation)
208
310
  4. Open your agent and invoke the new slash command to test it