@studiomopoke/agentic-bootstrap 1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 StudioMopoke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,557 @@
1
+ # Agentic Bootstrap
2
+
3
+ A global [Claude Code](https://docs.anthropic.com/en/docs/claude-code) skill that generates a complete AI-assisted development workflow for any project. Run `/bootstrap` once to configure task management, planning infrastructure, and five slash commands that drive a repeatable plan-build-test-ship cycle.
4
+
5
+ ## Overview
6
+
7
+ `/bootstrap` interviews you about your project — task management provider, git conventions, codebase structure, planning preferences — then generates a set of project-specific slash commands and configuration that turn Claude Code into a context-aware development agent.
8
+
9
+ **Generated artifacts:**
10
+
11
+ | Artifact | Path | Purpose |
12
+ |----------|------|---------|
13
+ | `/feature` command | `.claude/commands/feature.md` | Specify **what** to build — feature spec, design, scope |
14
+ | `/discuss` command | `.claude/commands/discuss.md` | Plan **when/how** to execute — sprints, scheduling, backlog |
15
+ | `/start` command | `.claude/commands/start.md` | Begin work on a task |
16
+ | `/resume` command | `.claude/commands/resume.md` | Continue after context loss |
17
+ | `/review` command | `.claude/commands/review.md` | Pre-PR self-review |
18
+ | Workflow config | `CLAUDE.md` (appended section) | Zone definitions, conventions, provider config |
19
+ | Permissions | `.claude/settings.json` | Safe defaults for agentic operation |
20
+ | Planning scaffold | `planning/` (optional) | Sprint directories, task specs, TDD specs |
21
+ | Git hygiene | `.gitignore`, `.gitattributes` | Stack-appropriate defaults |
22
+
23
+ ## Architecture
24
+
25
+ The system has three layers. Each builds on the one below.
26
+
27
+ ```mermaid
28
+ flowchart TD
29
+ subgraph bootstrap ["Layer 1 — Bootstrap (one-time setup)"]
30
+ B["/bootstrap\nInterviews you about the project\nGenerates everything below"]
31
+ end
32
+
33
+ subgraph commands ["Layer 2 — Commands (daily development)"]
34
+ direction LR
35
+ CC["/feature"]
36
+ D["/discuss"]
37
+ E["/start"]
38
+ F["/resume"]
39
+ G["/review"]
40
+ end
41
+
42
+ subgraph infra ["Layer 3 — Infrastructure (durable state)"]
43
+ direction LR
44
+ H["Task Provider"]
45
+ I["Planning Docs"]
46
+ J["Zone Agents"]
47
+ K["Git + Branch"]
48
+ end
49
+
50
+ bootstrap --> commands
51
+ commands --> infra
52
+
53
+ style bootstrap fill:#2d3748,color:#e2e8f0,stroke:#4a5568
54
+ style commands fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
55
+ style infra fill:#276749,color:#e2e8f0,stroke:#2f855a
56
+ style B fill:#2d3748,color:#e2e8f0,stroke:#4a5568
57
+ style CC fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
58
+ style D fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
59
+ style E fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
60
+ style F fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
61
+ style G fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
62
+ style H fill:#276749,color:#e2e8f0,stroke:#2f855a
63
+ style I fill:#276749,color:#e2e8f0,stroke:#2f855a
64
+ style J fill:#276749,color:#e2e8f0,stroke:#2f855a
65
+ style K fill:#276749,color:#e2e8f0,stroke:#2f855a
66
+ ```
67
+
68
+ **Layer 1 — Bootstrap** configures the project once. **Layer 2 — Commands** orchestrate daily development. **Layer 3 — Infrastructure** provides the durable state (issues, planning docs, git history) that commands read and write.
69
+
70
+ ## Bootstrap Phases
71
+
72
+ When you run `/bootstrap`, it walks through seven phases to tailor the workflow to your project.
73
+
74
+ ```mermaid
75
+ flowchart TD
76
+ P1["Phase 1: Task Management Discovery\nJira / Linear / GitHub Issues / Asana / None"]
77
+ P2["Phase 2: Git Conventions Discovery\nBranch format, commit format, base branch"]
78
+ P3["Phase 3: Codebase Analysis\nDetect stack, map directories,\ndiscover dependencies, check existing config"]
79
+ P4["Phase 4: Agent Zone Definition\nDefine exploration zones\nmapped to codebase areas"]
80
+ P5["Phase 5: Planning Structure\nFull sprints / Task-level / None\nScaffold directories, TDD config"]
81
+ P6["Phase 6: Generate Commands\nWrite commands, update CLAUDE.md,\nconfigure permissions, git hygiene"]
82
+ P7["Phase 7: Verify and Report\nList created files,\nsuggest /feature or /start"]
83
+
84
+ P1 --> P2 --> P3 --> P4 --> P5 --> P6 --> P7
85
+
86
+ style P1 fill:#2d3748,color:#e2e8f0
87
+ style P2 fill:#2d3748,color:#e2e8f0
88
+ style P3 fill:#2d3748,color:#e2e8f0
89
+ style P4 fill:#2d3748,color:#e2e8f0
90
+ style P5 fill:#2d3748,color:#e2e8f0
91
+ style P6 fill:#2d3748,color:#e2e8f0
92
+ style P7 fill:#2d3748,color:#e2e8f0
93
+ ```
94
+
95
+ ### Phase details
96
+
97
+ | Phase | What it does | Key decisions |
98
+ |-------|-------------|---------------|
99
+ | **1. Task Management Discovery** | Discovers your issue tracker and how to connect to it | Provider choice, connection details (instance URL, project key, repo, etc.), MCP vs CLI fallback |
100
+ | **2. Git Conventions Discovery** | Captures branching and commit standards | Branch prefix format, commit message format, base branch detection, AI marker preference |
101
+ | **3. Codebase Analysis** | Explores the repo to understand its structure | Stack detection, key directories, external services/APIs, sibling repos, checks for existing CLAUDE.md and commands |
102
+ | **4. Agent Zone Definition** | Defines parallel exploration agents mapped to codebase areas | Zone names, paths, triggers, integration boundaries (see [Agent Zones](#agent-zones)) |
103
+ | **5. Planning Structure** | Chooses planning depth and scaffolds directories | Full sprints vs task-level vs none, TDD integration, sprint naming (see [Planning & TDD](#planning--tdd-flow)) |
104
+ | **6. Generate Commands** | Writes all artifacts to the project | Slash commands, CLAUDE.md config, permissions, `.gitignore`/`.gitattributes`/LFS |
105
+ | **7. Verify and Report** | Confirms setup and suggests first task | Lists created files, summarizes commands, proposes `/feature` or `/start {TASK_ID}` |
106
+
107
+ Re-running `/bootstrap` is safe — it detects existing artifacts and replaces the workflow config section in CLAUDE.md rather than duplicating it.
108
+
109
+ ## Task Lifecycle
110
+
111
+ The five generated commands form a lifecycle. Features flow from specification through planning and implementation to review.
112
+
113
+ ```mermaid
114
+ flowchart LR
115
+ feature["/feature\nWhat to build\nSpec, design, scope"]
116
+ discuss["/discuss\nWhen & how to execute\nSprints, scheduling, backlog"]
117
+ start["/start #N\nFetch task context\nCreate branch\nLoad planning docs\nSpawn zone agents"]
118
+ implement["Implement\nWrite code\nBuild/test loop\nCommit progress"]
119
+ resume["/resume\nDetect branch\nRe-fetch context\nCheck progress\nSpawn zone agents"]
120
+ review["/review\nGather requirements\nDiff against AC\nStructured report"]
121
+ pr["Create PR\nMerge\nClose issue"]
122
+
123
+ feature -- "spec, design,\ntask breakdown" --> discuss
124
+ feature -- "creates issues" --> start
125
+ discuss -- "creates issues\n& task specs" --> start
126
+ start --> implement
127
+ implement -- "context lost?\nnew session?" --> resume
128
+ resume --> implement
129
+ implement -- "feature complete" --> review
130
+ review -- "blocking issues" --> implement
131
+ review -- "clean" --> pr
132
+ pr -. "next task" .-> start
133
+
134
+ style feature fill:#744210,color:#e2e8f0,stroke:#975a16
135
+ style discuss fill:#553c9a,color:#e2e8f0,stroke:#6b46c1
136
+ style start fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
137
+ style implement fill:#276749,color:#e2e8f0,stroke:#2f855a
138
+ style resume fill:#2c5282,color:#e2e8f0,stroke:#2b6cb0
139
+ style review fill:#9c4221,color:#e2e8f0,stroke:#c05621
140
+ style pr fill:#276749,color:#e2e8f0,stroke:#2f855a
141
+ ```
142
+
143
+ ### What each command does
144
+
145
+ **`/feature`** — Specify **what** to build. Runs an interactive discovery process grounded in codebase exploration:
146
+ 1. Spawns zone agents to understand what exists — relevant systems, patterns, dependencies, reference implementations
147
+ 2. Walks through structured Q&A: problem/purpose, scope/MVP, behaviour/AC, dependencies, technical approach, testing strategy, risks
148
+ 3. Keeps iterating until requirements and dependencies are fully fleshed out — summarizes after each section, asks what's missing
149
+ 4. Produces three documents in `planning/features/{name}/`: `spec.md` (what and why), `technical-design.md` (how), `scope.md` (phases, task breakdown, testing)
150
+ 5. Offers to create issues from the task breakdown and suggests `/discuss` for sprint planning or `/start` to begin
151
+
152
+ **`/feature review {name}`** — Reviews an existing feature spec for completeness and staleness:
153
+ 1. Loads all feature docs and spawns agents to check the current codebase state against the design
154
+ 2. Evaluates completeness: are AC testable? Are dependencies identified? Is the MVP separable? Are risks mitigated?
155
+ 3. Checks for staleness: code that's moved, new patterns introduced, tasks already partially implemented
156
+ 4. Reports gaps and offers to update the docs interactively
157
+
158
+ **`/start #N`** — Begin work on a task.
159
+ 1. Parses the task identifier (accepts `next` to auto-select the lowest unstarted issue)
160
+ 2. Fetches task context from the configured provider (title, description, AC, labels, links)
161
+ 3. Guards against duplicate work (checks for existing branches and planning docs)
162
+ 4. Creates a feature branch using the configured naming convention
163
+ 5. Loads planning docs — surfaces the task spec, AC, and TDD specs if they exist
164
+ 6. Spawns zone exploration agents in parallel (background)
165
+ 7. Transitions the task to in-progress
166
+ 8. Reports a setup summary and waits for agent findings before starting work
167
+
168
+ **`/resume`** — Continue after a session break. All durable state lives in git, the issue tracker, and planning docs — not in the conversation. `/resume` reconstructs context from these sources:
169
+ 1. Detects the current branch and extracts the task ID
170
+ 2. Re-fetches task context from the provider
171
+ 3. Checks progress: commits on branch, changed files, completed AC items, planning doc status
172
+ 4. Re-spawns zone agents for fresh codebase context
173
+ 5. Reports what's done and what to work on next
174
+ 6. Continues work with workflow reminders (commit format, task updates, agent follow-up)
175
+
176
+ **`/review`** — Pre-PR self-review against requirements.
177
+ 1. Gathers requirements from all sources (issue tracker + planning docs + task specs)
178
+ 2. Collects the full diff (`base..HEAD`) plus any uncommitted changes
179
+ 3. Spawns deep review agents per affected zone
180
+ 4. Evaluates: completeness (AC checklist), correctness, security, performance, error handling, tests, style and consistency, dependency/integration boundaries
181
+ 5. Reports findings grouped by severity (blocking / warning / nit) with file and line references
182
+ 6. Offers next steps — fix issues, create PR, or update planning docs
183
+
184
+ **`/discuss`** — Plan **when** and **how** to execute. Takes feature specs and turns them into actionable sprint plans:
185
+ - **Full planning**: Plan sprints from feature specs and roadmap — break work into numbered tasks with requirements, AC, file lists, dependencies, and TDD specs. Creates sprint directories. Manages backlog (parking, prioritizing, pulling deferred items).
186
+ - **Task-level**: Discuss a specific task's implementation approach, update the per-task planning doc with decisions.
187
+ - **None**: Freeform discussion about execution, scheduling, or priorities. Optionally capture notes.
188
+
189
+ ## Context Hydration
190
+
191
+ Every command automatically assembles context from multiple sources. The human never re-explains what they're working on — the branch name encodes the task ID, and the task ID links to everything else.
192
+
193
+ ```mermaid
194
+ flowchart TD
195
+ branch["Git Branch\nfeature/{TASK_ID}-name"]
196
+ taskid["Task ID\nextracted from branch"]
197
+
198
+ subgraph sources ["Context Sources"]
199
+ provider["Task Provider\nTitle, description, AC,\nlabels, links, comments"]
200
+ planning["Planning Docs\nSprint overview, task spec,\nTDD spec, COMPLETED.md"]
201
+ codebase["Codebase\nZone agents explore\nrelevant directories"]
202
+ git["Git History\nCommits on branch,\nchanged files, diff"]
203
+ end
204
+
205
+ subgraph hydrated ["Hydrated Context"]
206
+ what["What to build\nRequirements + AC"]
207
+ where["Where to build it\nFile paths + patterns"]
208
+ how["How to build it\nExisting patterns + tests"]
209
+ progress["What's done\nCommits + planning status"]
210
+ end
211
+
212
+ branch --> taskid
213
+ taskid --> provider
214
+ taskid --> planning
215
+ taskid --> codebase
216
+ taskid --> git
217
+
218
+ provider --> what
219
+ planning --> what
220
+ planning --> where
221
+ codebase --> how
222
+ codebase --> where
223
+ git --> progress
224
+ planning --> progress
225
+
226
+ style branch fill:#2d3748,color:#e2e8f0
227
+ style taskid fill:#2d3748,color:#e2e8f0
228
+ style sources fill:#1a202c,color:#e2e8f0,stroke:#4a5568
229
+ style hydrated fill:#1a202c,color:#e2e8f0,stroke:#4a5568
230
+ ```
231
+
232
+ This means **sessions are disposable**. You can close Claude Code, come back days later, run `/resume`, and pick up exactly where you left off. All state lives in durable stores, not the conversation.
233
+
234
+ ## Agent Zones
235
+
236
+ During bootstrap, you define **zones** — areas of your codebase that map to distinct concerns. Aim for 3-6 zones for most projects, or 1-2 for small single-directory projects. Each command spawns zone-specific exploration agents in parallel, keeping the main context window lean while grounding decisions in real code.
237
+
238
+ ```mermaid
239
+ flowchart TD
240
+ command["/feature, /start, /resume, or /review"]
241
+ task["Task: Implement payment webhook handler"]
242
+
243
+ command --> task
244
+ task --> dispatch{"Which zones\nare relevant?"}
245
+
246
+ dispatch --> z1["Zone: API Surface\npaths: src/api/, src/routes/\n'API changes, endpoints, middleware'"]
247
+ dispatch --> z2["Zone: Core Logic\npaths: src/services/, src/models/\n'Business logic, data models'"]
248
+ dispatch --> z3["Zone: Infrastructure\npaths: src/config/, src/db/\n'Database, queues, external services'"]
249
+ dispatch --> z4["Zone: Tests\npaths: tests/\n'Test patterns, fixtures, coverage'"]
250
+
251
+ z1 --> findings["Agent Findings\nExisting patterns to follow\nRelated code to understand\nContracts and interfaces"]
252
+ z2 --> findings
253
+ z3 --> findings
254
+ z4 --> findings
255
+
256
+ findings --> impl["Implementation\nwith full codebase context"]
257
+
258
+ style command fill:#2c5282,color:#e2e8f0
259
+ style task fill:#2d3748,color:#e2e8f0
260
+ style dispatch fill:#2d3748,color:#e2e8f0
261
+ style z1 fill:#553c9a,color:#e2e8f0
262
+ style z2 fill:#553c9a,color:#e2e8f0
263
+ style z3 fill:#553c9a,color:#e2e8f0
264
+ style z4 fill:#553c9a,color:#e2e8f0
265
+ style findings fill:#276749,color:#e2e8f0
266
+ style impl fill:#276749,color:#e2e8f0
267
+ ```
268
+
269
+ ### How zones are defined
270
+
271
+ Each zone captures:
272
+
273
+ | Field | Purpose | Example |
274
+ |-------|---------|---------|
275
+ | **Name** | Short label | "API Surface" |
276
+ | **Paths** | Directories to explore | `src/api/`, `src/routes/`, `src/middleware/` |
277
+ | **Description** | What this zone covers | "REST endpoints, request validation, auth middleware" |
278
+ | **Triggers** | Task types that activate this zone | "API changes, new endpoints, auth work" |
279
+ | **Dependencies** | External services or sibling repos this zone touches | "Calls payments API via `src/clients/payments.ts`" |
280
+
281
+ Zones are stored in the `## Workflow Configuration` section of CLAUDE.md so all commands can reference them.
282
+
283
+ ### Why zones matter
284
+
285
+ - **Parallel exploration.** Agents run concurrently, so a 6-zone project gets explored in the time it takes to explore one zone.
286
+ - **Focused context.** Each agent only reads its own zone's code, avoiding context window bloat from loading the entire codebase.
287
+ - **Selective activation.** Not every task needs every zone. A CSS-only change won't spawn the database agent.
288
+ - **Review depth.** `/review` spawns *deep* review agents per zone — each one checks how the diff interacts with surrounding code, not just the diff in isolation.
289
+
290
+ ## Planning & TDD Flow
291
+
292
+ Bootstrap offers three planning modes. The mode determines how much structure `/discuss` creates and how much context `/start` and `/review` can draw from.
293
+
294
+ ### Planning modes
295
+
296
+ | Mode | Best for | What gets created |
297
+ |------|----------|-------------------|
298
+ | **Full project planning** | Greenfield projects, phased roadmaps | Sprint directories, task specs with AC, TDD specs, backlog management |
299
+ | **Task-level only** | Established codebases with external task management | Per-task planning doc with context, approach, and notes |
300
+ | **None** | Well-defined external specs, quick fixes | No local planning docs — relies entirely on the task management system |
301
+
302
+ ### Full planning structure
303
+
304
+ When full planning is enabled, `/discuss` creates a structured sprint directory:
305
+
306
+ ```
307
+ planning/
308
+ ├── {NN}_{topic}.md # Project-level docs (architecture, features, etc.)
309
+ ├── backlog/
310
+ │ ├── README.md # Guidelines for parking/pulling deferred work
311
+ │ └── {deferred-feature}.md # Parked items from sprint discussions
312
+ ├── features/
313
+ │ └── {feature-name}/
314
+ │ ├── spec.md # Feature spec: problem, AC, user stories
315
+ │ ├── technical-design.md # Architecture, dependencies, key changes
316
+ │ └── scope.md # Phases, task breakdown, testing strategy
317
+ └── sprints/
318
+ └── sprint-{N}-{name}/
319
+ ├── 00_sprint_overview.md # Goal, task table, dependencies, success criteria
320
+ ├── {NN}_{task}.md # Task spec: requirements, AC, files, API surface
321
+ ├── COMPLETED.md # Tracks merged work
322
+ └── tdd/
323
+ ├── README.md # TDD overview for the sprint
324
+ └── phase-{NN}-{name}.md # Test categories, fixtures, coverage goals
325
+ ```
326
+
327
+ ### The planning-to-code pipeline
328
+
329
+ This is how planning artifacts drive implementation through the full lifecycle, using GitHub Issues as an example provider:
330
+
331
+ ```mermaid
332
+ flowchart TD
333
+ subgraph feature_phase ["What to Build — /feature"]
334
+ feature_cmd["/feature 'payment processing'"]
335
+ explore["Explore Codebase\nZone agents identify\nexisting systems & patterns"]
336
+ qa["Iterative Q&A\nProblem, scope, behaviour,\ndependencies, risks"]
337
+ feature_spec["spec.md\nProblem, AC, user stories"]
338
+ tech_design["technical-design.md\nArchitecture, dependencies,\nkey changes, interfaces"]
339
+ scope_doc["scope.md\nPhases, task breakdown,\ntesting strategy"]
340
+ end
341
+
342
+ subgraph plan ["When & How to Execute — /discuss"]
343
+ discuss_cmd["/discuss 'next sprint'"]
344
+ sprint["Sprint Overview\n00_sprint_overview.md\nGoal, task table, dependencies"]
345
+ specs["Task Specs\n01_task.md, 02_task.md, ...\nRequirements, AC, files to create"]
346
+ tdd["TDD Specs\ntdd/phase-*.md\nTest categories, fixtures, coverage"]
347
+ issues["GitHub Issues\nOne per task, with AC\nLinked to sprint"]
348
+ end
349
+
350
+ subgraph exec ["Execution Phase — /start, /resume"]
351
+ start_cmd["/start #42"]
352
+ fetch["Fetch Context\nGH Issue → title, AC, labels\nTask spec → requirements, files\nTDD spec → tests to write"]
353
+ branch["Create Branch\nfeature/42-payment-webhook"]
354
+ implement["Implement\nTDD: write tests first\nthen write code to pass them"]
355
+ commit["Commit\n#42 Add payment webhook handler"]
356
+ end
357
+
358
+ subgraph review_phase ["Review Phase — /review"]
359
+ review_cmd["/review"]
360
+ gather["Gather Requirements\nGH Issue AC + task spec AC\n+ TDD coverage goals"]
361
+ check["Check Against AC\n✓ Webhook endpoint created\n✓ Signature validation\n✗ Retry logic — MISSING"]
362
+ report["Structured Report\nBlocking / Warning / Nit\nWith file:line references"]
363
+ end
364
+
365
+ feature_cmd --> explore
366
+ explore --> qa
367
+ qa --> feature_spec
368
+ qa --> tech_design
369
+ qa --> scope_doc
370
+
371
+ scope_doc -- "task breakdown\nfeeds sprint" --> discuss_cmd
372
+ tech_design -. "design context" .-> specs
373
+ feature_spec -. "AC" .-> specs
374
+
375
+ discuss_cmd --> sprint
376
+ sprint --> specs
377
+ specs --> tdd
378
+ specs --> issues
379
+
380
+ issues --> start_cmd
381
+ start_cmd --> fetch
382
+ fetch --> branch
383
+ branch --> implement
384
+ tdd -. "tests to write\nfirst" .-> implement
385
+ implement --> commit
386
+
387
+ commit --> review_cmd
388
+ review_cmd --> gather
389
+ specs -. "requirements" .-> gather
390
+ issues -. "AC" .-> gather
391
+ tdd -. "coverage goals" .-> gather
392
+ gather --> check
393
+ check --> report
394
+
395
+ report -- "blocking issues\nfound" --> implement
396
+ report -- "clean" --> merge["Merge PR\nCloses #42"]
397
+ merge -. "update" .-> completed["COMPLETED.md\nTracks merged work"]
398
+
399
+ style feature_phase fill:#1a202c,color:#e2e8f0,stroke:#975a16
400
+ style feature_cmd fill:#744210,color:#e2e8f0
401
+ style explore fill:#744210,color:#e2e8f0
402
+ style qa fill:#744210,color:#e2e8f0
403
+ style feature_spec fill:#744210,color:#e2e8f0
404
+ style tech_design fill:#744210,color:#e2e8f0
405
+ style scope_doc fill:#744210,color:#e2e8f0
406
+ style plan fill:#1a202c,color:#e2e8f0,stroke:#553c9a
407
+ style exec fill:#1a202c,color:#e2e8f0,stroke:#2c5282
408
+ style review_phase fill:#1a202c,color:#e2e8f0,stroke:#9c4221
409
+ style discuss_cmd fill:#553c9a,color:#e2e8f0
410
+ style sprint fill:#553c9a,color:#e2e8f0
411
+ style specs fill:#553c9a,color:#e2e8f0
412
+ style tdd fill:#553c9a,color:#e2e8f0
413
+ style issues fill:#553c9a,color:#e2e8f0
414
+ style start_cmd fill:#2c5282,color:#e2e8f0
415
+ style fetch fill:#2c5282,color:#e2e8f0
416
+ style branch fill:#2c5282,color:#e2e8f0
417
+ style implement fill:#276749,color:#e2e8f0
418
+ style commit fill:#276749,color:#e2e8f0
419
+ style review_cmd fill:#9c4221,color:#e2e8f0
420
+ style gather fill:#9c4221,color:#e2e8f0
421
+ style check fill:#9c4221,color:#e2e8f0
422
+ style report fill:#9c4221,color:#e2e8f0
423
+ style merge fill:#276749,color:#e2e8f0
424
+ style completed fill:#276749,color:#e2e8f0
425
+ ```
426
+
427
+ ### How TDD integrates
428
+
429
+ When TDD is enabled, the flow is:
430
+
431
+ 1. **`/discuss`** creates TDD specs alongside task specs — test categories, naming conventions, fixtures, and coverage goals are defined before any code is written.
432
+ 2. **`/start`** surfaces the TDD spec as part of the task context. The agent knows which tests to write first.
433
+ 3. **Implementation** follows red-green-refactor: write failing tests from the TDD spec, then write code to pass them.
434
+ 4. **`/review`** checks that TDD coverage goals are met — not just "do tests exist" but "do the tests match what the spec called for."
435
+
436
+ ### Task spec format
437
+
438
+ Each task spec is a machine-readable contract that commands consume:
439
+
440
+ ```markdown
441
+ # 03: Implement Payment Webhook Handler
442
+
443
+ **Issue:** #42
444
+ **Complexity:** M
445
+ **Dependencies:** 01 (API framework), 02 (signature validation)
446
+
447
+ ## Requirements
448
+ Receive and process payment provider webhooks...
449
+
450
+ ## Acceptance Criteria
451
+ - [ ] POST /webhooks/payments endpoint exists
452
+ - [ ] Request signature validated against provider secret
453
+ - [ ] Idempotency key prevents duplicate processing
454
+ - [ ] Failed webhooks return 500 and are retried
455
+
456
+ ## Files to Create/Modify
457
+ - `src/api/webhooks/payments.ts` — endpoint handler
458
+ - `src/services/payment-processor.ts` — processing logic
459
+ - `tests/api/webhooks/payments.test.ts` — endpoint tests
460
+
461
+ ## API Surface
462
+ interface PaymentWebhookHandler {
463
+ handle(request: WebhookRequest): Promise<WebhookResponse>
464
+ }
465
+ ```
466
+
467
+ `/start` reads this to know what to build. `/review` reads it to check completeness. `/resume` reads it to know what's left.
468
+
469
+ ## Supported Providers
470
+
471
+ | Provider | Connection | Task ID Pattern | Integration |
472
+ |----------|-----------|----------------|-------------|
473
+ | **GitHub Issues** | Repository (auto-detected from remote) | `#123` | `gh` CLI |
474
+ | **Jira** | Instance URL + Cloud ID + project key | `PROJ-123` | Atlassian MCP tools or CLI |
475
+ | **Linear** | Team identifier | `ENG-123` | Linear MCP or CLI |
476
+ | **Asana** | Workspace GID + project GID | `1234567890123` | Asana MCP or CLI |
477
+ | **None** | — | Free-form | Manual task descriptions |
478
+
479
+ MCP tools are preferred when available. Commands fall back to CLI tools or manual workflows when they're not.
480
+
481
+ ## Installation
482
+
483
+ ### Via npm (recommended)
484
+
485
+ ```bash
486
+ npx @studiomopoke/agentic-bootstrap install
487
+ ```
488
+
489
+ This copies the `/bootstrap` command into your Claude Code commands directory (`~/.claude/commands/`).
490
+
491
+ ```bash
492
+ # Update to latest version
493
+ npx @studiomopoke/agentic-bootstrap@latest update
494
+
495
+ # Uninstall
496
+ npx @studiomopoke/agentic-bootstrap uninstall
497
+ ```
498
+
499
+ ### Manual
500
+
501
+ Download `bootstrap.md` and place it in your user-level commands directory:
502
+
503
+ ```bash
504
+ mkdir -p ~/.claude/commands
505
+ curl -o ~/.claude/commands/bootstrap.md \
506
+ https://raw.githubusercontent.com/StudioMopoke/agentic-bootstrap/main/bootstrap.md
507
+ ```
508
+
509
+ ### Verify
510
+
511
+ Open Claude Code in any project and run `/bootstrap`.
512
+
513
+ ## Usage
514
+
515
+ ```bash
516
+ # First time — set up the workflow
517
+ cd your-project
518
+ claude
519
+ > /bootstrap
520
+
521
+ # Spec out a new feature
522
+ > /feature payment processing
523
+
524
+ # Review an existing feature spec
525
+ > /feature review payment-processing
526
+
527
+ # Plan a sprint from feature specs
528
+ > /discuss next sprint
529
+
530
+ # Start a task
531
+ > /start #42
532
+ > /start next # auto-selects lowest unstarted issue
533
+
534
+ # Resume after a break
535
+ > /resume
536
+
537
+ # Self-review before PR
538
+ > /review
539
+ ```
540
+
541
+ Re-running `/bootstrap` is safe — it detects existing artifacts and updates rather than duplicates.
542
+
543
+ ## Design Principles
544
+
545
+ **Sessions are disposable.** All state lives in durable stores (git, issue tracker, planning docs), never in the conversation. `/resume` reconstructs full context from these sources.
546
+
547
+ **Context is assembled, not maintained.** Each command fetches exactly what it needs from the task provider, planning docs, and codebase. Nothing goes stale because nothing is cached in-memory across sessions.
548
+
549
+ **Agents explore in parallel.** Zone agents run concurrently in the background, keeping the main context window focused on the task at hand. A 6-zone project gets explored in the wall-clock time of one zone.
550
+
551
+ **Planning artifacts are machine-readable contracts.** Sprint overviews, task specs, and TDD specs aren't just documentation — they're structured inputs that commands consume to know what to build, what to test, and when the work is done.
552
+
553
+ **Permissions default to safe.** Bootstrap configures allow-lists for non-destructive operations (read, edit, build, test) and asks before enabling anything destructive (push, reset, delete, dependency installation).
554
+
555
+ ## License
556
+
557
+ MIT — see [LICENSE](LICENSE).
package/bin/cli.js ADDED
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const os = require("os");
6
+
7
+ const COMMAND_NAME = "bootstrap.md";
8
+ const COMMANDS_DIR = path.join(os.homedir(), ".claude", "commands");
9
+ const TARGET = path.join(COMMANDS_DIR, COMMAND_NAME);
10
+ const SOURCE = path.join(__dirname, "..", COMMAND_NAME);
11
+
12
+ const pkg = require("../package.json");
13
+
14
+ const command = process.argv[2];
15
+
16
+ function ensureDir(dir) {
17
+ if (!fs.existsSync(dir)) {
18
+ fs.mkdirSync(dir, { recursive: true });
19
+ }
20
+ }
21
+
22
+ function install() {
23
+ ensureDir(COMMANDS_DIR);
24
+
25
+ if (fs.existsSync(TARGET)) {
26
+ const existing = fs.readFileSync(TARGET, "utf8");
27
+ const incoming = fs.readFileSync(SOURCE, "utf8");
28
+
29
+ if (existing === incoming) {
30
+ console.log("bootstrap.md is already up to date.");
31
+ return;
32
+ }
33
+
34
+ console.log("Existing bootstrap.md found — replacing with v" + pkg.version);
35
+ }
36
+
37
+ fs.copyFileSync(SOURCE, TARGET);
38
+ console.log("Installed bootstrap.md to " + TARGET);
39
+ console.log("");
40
+ console.log("Run /bootstrap in any project to set up the agentic workflow.");
41
+ }
42
+
43
+ function uninstall() {
44
+ if (!fs.existsSync(TARGET)) {
45
+ console.log("bootstrap.md not found — nothing to remove.");
46
+ return;
47
+ }
48
+
49
+ fs.unlinkSync(TARGET);
50
+ console.log("Removed " + TARGET);
51
+ }
52
+
53
+ function showHelp() {
54
+ console.log("@studiomopoke/agentic-bootstrap v" + pkg.version);
55
+ console.log("");
56
+ console.log("Usage:");
57
+ console.log(" agentic-bootstrap install Install /bootstrap command for Claude Code");
58
+ console.log(" agentic-bootstrap update Update to the latest version");
59
+ console.log(" agentic-bootstrap uninstall Remove the /bootstrap command");
60
+ console.log(" agentic-bootstrap --version Show version");
61
+ console.log(" agentic-bootstrap --help Show this help");
62
+ }
63
+
64
+ switch (command) {
65
+ case "install":
66
+ install();
67
+ break;
68
+ case "update":
69
+ install();
70
+ break;
71
+ case "uninstall":
72
+ case "remove":
73
+ uninstall();
74
+ break;
75
+ case "--version":
76
+ case "-v":
77
+ console.log(pkg.version);
78
+ break;
79
+ case "--help":
80
+ case "-h":
81
+ case undefined:
82
+ showHelp();
83
+ break;
84
+ default:
85
+ console.error("Unknown command: " + command);
86
+ console.error('Run "agentic-bootstrap --help" for usage.');
87
+ process.exit(1);
88
+ }