@ancleto/spec 0.1.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/README.md +46 -0
  2. package/agents/coder.md +149 -0
  3. package/agents/context-resolver.md +102 -0
  4. package/agents/documenter.md +157 -0
  5. package/agents/memory-keeper.md +142 -0
  6. package/agents/orchestrator.md +423 -0
  7. package/agents/reviewer.md +205 -0
  8. package/agents/spec-writer.md +105 -0
  9. package/agents/technical-discovery.md +134 -0
  10. package/agents/technical-seed-writer.md +56 -0
  11. package/agents/tester.md +179 -0
  12. package/commands/opsx-apply.md +161 -0
  13. package/commands/opsx-archive.md +172 -0
  14. package/commands/opsx-bulk-archive.md +255 -0
  15. package/commands/opsx-continue.md +135 -0
  16. package/commands/opsx-explore.md +181 -0
  17. package/commands/opsx-ff.md +164 -0
  18. package/commands/opsx-new.md +151 -0
  19. package/commands/opsx-onboard.md +567 -0
  20. package/commands/opsx-propose.md +174 -0
  21. package/commands/opsx-recall.md +57 -0
  22. package/commands/opsx-sync.md +144 -0
  23. package/commands/opsx-verify.md +176 -0
  24. package/package.json +41 -0
  25. package/skills/ancleto-commit/SKILL.md +118 -0
  26. package/skills/ancleto-pr/SKILL.md +164 -0
  27. package/skills/ancleto-technical-discovery/SKILL.md +74 -0
  28. package/skills/ancleto-technical-discovery/references/archetypes/api-layered.md +8 -0
  29. package/skills/ancleto-technical-discovery/references/archetypes/monorepo.md +8 -0
  30. package/skills/ancleto-technical-discovery/references/archetypes/ops-tooling.md +7 -0
  31. package/skills/ancleto-technical-discovery/references/archetypes/service-legacy.md +7 -0
  32. package/skills/ancleto-technical-discovery/references/archetypes/spa.md +7 -0
  33. package/skills/ancleto-technical-discovery/references/discovery-config.md +24 -0
  34. package/skills/ancleto-technical-discovery/references/generation-pipeline.md +56 -0
  35. package/skills/ancleto-technical-discovery/references/node-frontmatter.md +30 -0
  36. package/skills/ancleto-technical-discovery/references/output-contract.md +36 -0
  37. package/skills/ancleto-technical-discovery/references/templates/dossier.md +38 -0
  38. package/skills/ancleto-technical-discovery/references/templates/inventory.md +22 -0
  39. package/skills/ancleto-technical-discovery/references/templates/setup.md +27 -0
  40. package/skills/ancleto-technical-discovery/references/validation-checklist.md +12 -0
  41. package/skills/ancleto-upgrade/SKILL.md +449 -0
  42. package/skills/ancleto-upgrade/references/templates.md +320 -0
  43. package/src/cli/index.js +119 -0
  44. package/templates/AGENTS.md +36 -0
  45. package/templates/CONTRIBUTING.md +25 -0
  46. package/templates/PRODUCT.md +180 -0
@@ -0,0 +1,567 @@
1
+ ---
2
+ description: Guided onboarding - walk through a complete OpenSpec workflow cycle with narration
3
+ ---
4
+
5
+ Guide the user through their first complete OpenSpec workflow cycle. This is a teaching experience—you'll do real work in their codebase while explaining each step.
6
+
7
+ ---
8
+
9
+ ## Preflight
10
+
11
+ Before starting, check if the OpenSpec CLI is installed:
12
+
13
+ ```bash
14
+ # Unix/macOS
15
+ openspec --version 2>&1 || echo "CLI_NOT_INSTALLED"
16
+ # Windows (PowerShell)
17
+ # if (Get-Command openspec -ErrorAction SilentlyContinue) { openspec --version } else { echo "CLI_NOT_INSTALLED" }
18
+ ```
19
+
20
+ **If CLI not installed:**
21
+
22
+ > OpenSpec CLI is not installed. Install it first, then come back to `/opsx-onboard`.
23
+
24
+ Stop here if not installed.
25
+
26
+ ---
27
+
28
+ ## Phase 1: Welcome
29
+
30
+ Display:
31
+
32
+ ```
33
+ ## Welcome to OpenSpec!
34
+
35
+ I'll walk you through a complete change cycle—from idea to implementation—using a real task in your codebase. Along the way, you'll learn the workflow by doing it.
36
+
37
+ **What we'll do:**
38
+ 1. Pick a small, real task in your codebase
39
+ 2. Explore the problem briefly
40
+ 3. Create a change (the container for our work)
41
+ 4. Build the artifacts: proposal → specs → design → tasks
42
+ 5. Implement the tasks
43
+ 6. Archive the completed change
44
+
45
+ **Time:** ~15-20 minutes
46
+
47
+ Let's start by finding something to work on.
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Phase 2: Task Selection
53
+
54
+ ### Codebase Analysis
55
+
56
+ Scan the codebase for small improvement opportunities. Look for:
57
+
58
+ 1. **TODO/FIXME comments** - Search for `TODO`, `FIXME`, `HACK`, `XXX` in code files
59
+ 2. **Missing error handling** - `catch` blocks that swallow errors, risky operations without try-catch
60
+ 3. **Functions without tests** - Cross-reference `src/` with test directories
61
+ 4. **Type issues** - `any` types in TypeScript files (`: any`, `as any`)
62
+ 5. **Debug artifacts** - `console.log`, `console.debug`, `debugger` statements in non-debug code
63
+ 6. **Missing validation** - User input handlers without validation
64
+
65
+ Also check recent git activity:
66
+
67
+ ```bash
68
+ # Unix/macOS
69
+ git log --oneline -10 2>/dev/null || echo "No git history"
70
+ # Windows (PowerShell)
71
+ # git log --oneline -10 2>$null; if ($LASTEXITCODE -ne 0) { echo "No git history" }
72
+ ```
73
+
74
+ ### Present Suggestions
75
+
76
+ From your analysis, present 3-4 specific suggestions:
77
+
78
+ ```
79
+ ## Task Suggestions
80
+
81
+ Based on scanning your codebase, here are some good starter tasks:
82
+
83
+ **1. [Most promising task]**
84
+ Location: `src/path/to/file.ts:42`
85
+ Scope: ~1-2 files, ~20-30 lines
86
+ Why it's good: [brief reason]
87
+
88
+ **2. [Second task]**
89
+ Location: `src/another/file.ts`
90
+ Scope: ~1 file, ~15 lines
91
+ Why it's good: [brief reason]
92
+
93
+ **3. [Third task]**
94
+ Location: [location]
95
+ Scope: [estimate]
96
+ Why it's good: [brief reason]
97
+
98
+ **4. Something else?**
99
+ Tell me what you'd like to work on.
100
+
101
+ Which task interests you? (Pick a number or describe your own)
102
+ ```
103
+
104
+ **If nothing found:** Fall back to asking what the user wants to build:
105
+
106
+ > I didn't find obvious quick wins in your codebase. What's something small you've been meaning to add or fix?
107
+
108
+ ### Scope Guardrail
109
+
110
+ If the user picks or describes something too large (major feature, multi-day work):
111
+
112
+ ```
113
+ That's a valuable task, but it's probably larger than ideal for your first OpenSpec run-through.
114
+
115
+ For learning the workflow, smaller is better—it lets you see the full cycle without getting stuck in implementation details.
116
+
117
+ **Options:**
118
+ 1. **Slice it smaller** - What's the smallest useful piece of [their task]? Maybe just [specific slice]?
119
+ 2. **Pick something else** - One of the other suggestions, or a different small task?
120
+ 3. **Do it anyway** - If you really want to tackle this, we can. Just know it'll take longer.
121
+
122
+ What would you prefer?
123
+ ```
124
+
125
+ Let the user override if they insist—this is a soft guardrail.
126
+
127
+ ---
128
+
129
+ ## Phase 3: Explore Demo
130
+
131
+ Once a task is selected, briefly demonstrate explore mode:
132
+
133
+ ```
134
+ Before we create a change, let me quickly show you **explore mode**—it's how you think through problems before committing to a direction.
135
+ ```
136
+
137
+ Spend 1-2 minutes investigating the relevant code:
138
+
139
+ - Read the file(s) involved
140
+ - Draw a quick ASCII diagram if it helps
141
+ - Note any considerations
142
+
143
+ ```
144
+ ## Quick Exploration
145
+
146
+ [Your brief analysis—what you found, any considerations]
147
+
148
+ ┌─────────────────────────────────────────┐
149
+ │ [Optional: ASCII diagram if helpful] │
150
+ └─────────────────────────────────────────┘
151
+
152
+ Explore mode (`/opsx-explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem.
153
+
154
+ Now let's create a change to hold our work.
155
+ ```
156
+
157
+ **PAUSE** - Wait for user acknowledgment before proceeding.
158
+
159
+ ---
160
+
161
+ ## Phase 4: Create the Change
162
+
163
+ **EXPLAIN:**
164
+
165
+ ```
166
+ ## Creating a Change
167
+
168
+ A "change" in OpenSpec is a container for all the thinking and planning around a piece of work. It lives in `openspec/changes/<name>/` and holds your artifacts—proposal, specs, design, tasks.
169
+
170
+ Let me create one for our task.
171
+ ```
172
+
173
+ **DO:** Create the change with a derived kebab-case name:
174
+
175
+ ```bash
176
+ openspec new change "<derived-name>"
177
+ ```
178
+
179
+ **SHOW:**
180
+
181
+ ```
182
+ Created: `openspec/changes/<name>/`
183
+
184
+ The folder structure:
185
+ ```
186
+
187
+ openspec/changes/<name>/
188
+ ├── proposal.md ← Why we're doing this (empty, we'll fill it)
189
+ ├── design.md ← How we'll build it (empty)
190
+ ├── specs/ ← Detailed requirements (empty)
191
+ └── tasks.md ← Implementation checklist (empty)
192
+
193
+ ```
194
+
195
+ Now let's fill in the first artifact—the proposal.
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Phase 5: Proposal
201
+
202
+ **EXPLAIN:**
203
+
204
+ ```
205
+ ## The Proposal
206
+
207
+ The proposal captures **why** we're making this change and **what** it involves at a high level. It's the "elevator pitch" for the work.
208
+
209
+ I'll draft one based on our task.
210
+ ```
211
+
212
+ **DO:** Draft the proposal content (don't save yet):
213
+
214
+ ```
215
+ Here's a draft proposal:
216
+
217
+ ---
218
+
219
+ ## Why
220
+
221
+ [1-2 sentences explaining the problem/opportunity]
222
+
223
+ ## What Changes
224
+
225
+ [Bullet points of what will be different]
226
+
227
+ ## Capabilities
228
+
229
+ ### New Capabilities
230
+ - `<capability-name>`: [brief description]
231
+
232
+ ### Modified Capabilities
233
+ <!-- If modifying existing behavior -->
234
+
235
+ ## Impact
236
+
237
+ - `src/path/to/file.ts`: [what changes]
238
+ - [other files if applicable]
239
+
240
+ ---
241
+
242
+ Does this capture the intent? I can adjust before we save it.
243
+ ```
244
+
245
+ **PAUSE** - Wait for user approval/feedback.
246
+
247
+ After approval, save the proposal:
248
+
249
+ ```bash
250
+ openspec instructions proposal --change "<name>" --json
251
+ ```
252
+
253
+ Then write the content to `openspec/changes/<name>/proposal.md`.
254
+
255
+ ```
256
+ Proposal saved. This is your "why" document—you can always come back and refine it as understanding evolves.
257
+
258
+ Next up: specs.
259
+ ```
260
+
261
+ ---
262
+
263
+ ## Phase 6: Specs
264
+
265
+ **EXPLAIN:**
266
+
267
+ ```
268
+ ## Specs
269
+
270
+ Specs define **what** we're building in precise, testable terms. They use a requirement/scenario format that makes expected behavior crystal clear.
271
+
272
+ For a small task like this, we might only need one spec file.
273
+ ```
274
+
275
+ **DO:** Create the spec file:
276
+
277
+ ```bash
278
+ # Unix/macOS
279
+ mkdir -p openspec/changes/<name>/specs/<capability-name>
280
+ # Windows (PowerShell)
281
+ # New-Item -ItemType Directory -Force -Path "openspec/changes/<name>/specs/<capability-name>"
282
+ ```
283
+
284
+ Draft the spec content:
285
+
286
+ ```
287
+ Here's the spec:
288
+
289
+ ---
290
+
291
+ ## ADDED Requirements
292
+
293
+ ### Requirement: <Name>
294
+
295
+ <Description of what the system should do>
296
+
297
+ #### Scenario: <Scenario name>
298
+
299
+ - **WHEN** <trigger condition>
300
+ - **THEN** <expected outcome>
301
+ - **AND** <additional outcome if needed>
302
+
303
+ ---
304
+
305
+ This format—WHEN/THEN/AND—makes requirements testable. You can literally read them as test cases.
306
+ ```
307
+
308
+ Save to `openspec/changes/<name>/specs/<capability>/spec.md`.
309
+
310
+ ---
311
+
312
+ ## Phase 7: Design
313
+
314
+ **EXPLAIN:**
315
+
316
+ ```
317
+ ## Design
318
+
319
+ The design captures **how** we'll build it—technical decisions, tradeoffs, approach.
320
+
321
+ For small changes, this might be brief. That's fine—not every change needs deep design discussion.
322
+ ```
323
+
324
+ **DO:** Draft design.md:
325
+
326
+ ```
327
+ Here's the design:
328
+
329
+ ---
330
+
331
+ ## Context
332
+
333
+ [Brief context about the current state]
334
+
335
+ ## Goals / Non-Goals
336
+
337
+ **Goals:**
338
+ - [What we're trying to achieve]
339
+
340
+ **Non-Goals:**
341
+ - [What's explicitly out of scope]
342
+
343
+ ## Decisions
344
+
345
+ ### Decision 1: [Key decision]
346
+
347
+ [Explanation of approach and rationale]
348
+
349
+ ---
350
+
351
+ For a small task, this captures the key decisions without over-engineering.
352
+ ```
353
+
354
+ Save to `openspec/changes/<name>/design.md`.
355
+
356
+ ---
357
+
358
+ ## Phase 8: Tasks
359
+
360
+ **EXPLAIN:**
361
+
362
+ ```
363
+ ## Tasks
364
+
365
+ Finally, we break the work into implementation tasks—checkboxes that drive the apply phase.
366
+
367
+ These should be small, clear, and in logical order.
368
+ ```
369
+
370
+ **DO:** Generate tasks based on specs and design:
371
+
372
+ ```
373
+ Here are the implementation tasks:
374
+
375
+ ---
376
+
377
+ ## 1. [Category or file]
378
+
379
+ - [ ] 1.1 [Specific task]
380
+ - [ ] 1.2 [Specific task]
381
+
382
+ ## 2. Verify
383
+
384
+ - [ ] 2.1 [Verification step]
385
+
386
+ ---
387
+
388
+ Each checkbox becomes a unit of work in the apply phase. Ready to implement?
389
+ ```
390
+
391
+ **PAUSE** - Wait for user to confirm they're ready to implement.
392
+
393
+ Save to `openspec/changes/<name>/tasks.md`.
394
+
395
+ ---
396
+
397
+ ## Phase 9: Apply (Implementation)
398
+
399
+ **EXPLAIN:**
400
+
401
+ ```
402
+ ## Implementation
403
+
404
+ Now we implement each task, checking them off as we go. I'll announce each one and occasionally note how the specs/design informed the approach.
405
+ ```
406
+
407
+ **DO:** For each task:
408
+
409
+ 1. Announce: "Working on task N: [description]"
410
+ 2. Implement the change in the codebase
411
+ 3. Reference specs/design naturally: "The spec says X, so I'm doing Y"
412
+ 4. Mark complete in tasks.md: `- [ ]` → `- [x]`
413
+ 5. Brief status: "✓ Task N complete"
414
+
415
+ Keep narration light—don't over-explain every line of code.
416
+
417
+ After all tasks:
418
+
419
+ ```
420
+ ## Implementation Complete
421
+
422
+ All tasks done:
423
+ - [x] Task 1
424
+ - [x] Task 2
425
+ - [x] ...
426
+
427
+ The change is implemented! One more step—let's archive it.
428
+ ```
429
+
430
+ ---
431
+
432
+ ## Phase 10: Archive
433
+
434
+ **EXPLAIN:**
435
+
436
+ ```
437
+ ## Archiving
438
+
439
+ When a change is complete, we archive it. This moves it from `openspec/changes/` to `openspec/changes/archive/YYYY-MM-DD-<name>/`.
440
+
441
+ Archived changes become your project's decision history—you can always find them later to understand why something was built a certain way.
442
+ ```
443
+
444
+ **DO:**
445
+
446
+ ```bash
447
+ openspec archive "<name>"
448
+ ```
449
+
450
+ **SHOW:**
451
+
452
+ ```
453
+ Archived to: `openspec/changes/archive/YYYY-MM-DD-<name>/`
454
+
455
+ The change is now part of your project's history. The code is in your codebase, the decision record is preserved.
456
+ ```
457
+
458
+ ---
459
+
460
+ ## Phase 11: Recap & Next Steps
461
+
462
+ ```
463
+ ## Congratulations!
464
+
465
+ You just completed a full OpenSpec cycle:
466
+
467
+ 1. **Explore** - Thought through the problem
468
+ 2. **New** - Created a change container
469
+ 3. **Proposal** - Captured WHY
470
+ 4. **Specs** - Defined WHAT in detail
471
+ 5. **Design** - Decided HOW
472
+ 6. **Tasks** - Broke it into steps
473
+ 7. **Apply** - Implemented the work
474
+ 8. **Archive** - Preserved the record
475
+
476
+ This same rhythm works for any size change—a small fix or a major feature.
477
+
478
+ ---
479
+
480
+ ## Command Reference
481
+
482
+ **Core workflow:**
483
+
484
+ | Command | What it does |
485
+ |---------|--------------|
486
+ | `/opsx-propose` | Create a change and generate all artifacts |
487
+ | `/opsx-explore` | Think through problems before/during work |
488
+ | `/opsx-apply` | Implement tasks from a change |
489
+ | `/opsx-archive` | Archive a completed change |
490
+
491
+ **Additional commands:**
492
+
493
+ | Command | What it does |
494
+ |---------|--------------|
495
+ | `/opsx-new` | Start a new change, step through artifacts one at a time |
496
+ | `/opsx-continue` | Continue working on an existing change |
497
+ | `/opsx-ff` | Fast-forward: create all artifacts at once |
498
+ | `/opsx-verify` | Verify implementation matches artifacts |
499
+
500
+ ---
501
+
502
+ ## What's Next?
503
+
504
+ Try `/opsx-propose` on something you actually want to build. You've got the rhythm now!
505
+ ```
506
+
507
+ ---
508
+
509
+ ## Graceful Exit Handling
510
+
511
+ ### User wants to stop mid-way
512
+
513
+ If the user says they need to stop, want to pause, or seem disengaged:
514
+
515
+ ```
516
+ No problem! Your change is saved at `openspec/changes/<name>/`.
517
+
518
+ To pick up where we left off later:
519
+ - `/opsx-continue <name>` - Resume artifact creation
520
+ - `/opsx-apply <name>` - Jump to implementation (if tasks exist)
521
+
522
+ The work won't be lost. Come back whenever you're ready.
523
+ ```
524
+
525
+ Exit gracefully without pressure.
526
+
527
+ ### User just wants command reference
528
+
529
+ If the user says they just want to see the commands or skip the tutorial:
530
+
531
+ ```
532
+ ## OpenSpec Quick Reference
533
+
534
+ **Core workflow:**
535
+
536
+ | Command | What it does |
537
+ |---------|--------------|
538
+ | `/opsx-propose <name>` | Create a change and generate all artifacts |
539
+ | `/opsx-explore` | Think through problems (no code changes) |
540
+ | `/opsx-apply <name>` | Implement tasks |
541
+ | `/opsx-archive <name>` | Archive when done |
542
+
543
+ **Additional commands:**
544
+
545
+ | Command | What it does |
546
+ |---------|--------------|
547
+ | `/opsx-new <name>` | Start a new change, step by step |
548
+ | `/opsx-continue <name>` | Continue an existing change |
549
+ | `/opsx-ff <name>` | Fast-forward: all artifacts at once |
550
+ | `/opsx-verify <name>` | Verify implementation |
551
+
552
+ Try `/opsx-propose` to start your first change.
553
+ ```
554
+
555
+ Exit gracefully.
556
+
557
+ ---
558
+
559
+ ## Guardrails
560
+
561
+ - **Follow the EXPLAIN → DO → SHOW → PAUSE pattern** at key transitions (after explore, after proposal draft, after tasks, after archive)
562
+ - **Keep narration light** during implementation—teach without lecturing
563
+ - **Don't skip phases** even if the change is small—the goal is teaching the workflow
564
+ - **Pause for acknowledgment** at marked points, but don't over-pause
565
+ - **Handle exits gracefully**—never pressure the user to continue
566
+ - **Use real codebase tasks**—don't simulate or use fake examples
567
+ - **Adjust scope gently**—guide toward smaller tasks but respect user choice