arggon-harness 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 (170) hide show
  1. package/README.md +229 -0
  2. package/config/default-opencode.json +21 -0
  3. package/dist/init.d.ts +3 -0
  4. package/dist/init.d.ts.map +1 -0
  5. package/dist/init.js +406 -0
  6. package/dist/init.js.map +1 -0
  7. package/dist/plugin/engine/artifact-graph.d.ts +38 -0
  8. package/dist/plugin/engine/artifact-graph.d.ts.map +1 -0
  9. package/dist/plugin/engine/artifact-graph.js +137 -0
  10. package/dist/plugin/engine/artifact-graph.js.map +1 -0
  11. package/dist/plugin/engine/config.d.ts +21 -0
  12. package/dist/plugin/engine/config.d.ts.map +1 -0
  13. package/dist/plugin/engine/config.js +146 -0
  14. package/dist/plugin/engine/config.js.map +1 -0
  15. package/dist/plugin/engine/delta-apply.d.ts +23 -0
  16. package/dist/plugin/engine/delta-apply.d.ts.map +1 -0
  17. package/dist/plugin/engine/delta-apply.js +153 -0
  18. package/dist/plugin/engine/delta-apply.js.map +1 -0
  19. package/dist/plugin/engine/git.d.ts +32 -0
  20. package/dist/plugin/engine/git.d.ts.map +1 -0
  21. package/dist/plugin/engine/git.js +61 -0
  22. package/dist/plugin/engine/git.js.map +1 -0
  23. package/dist/plugin/engine/integrity.d.ts +45 -0
  24. package/dist/plugin/engine/integrity.d.ts.map +1 -0
  25. package/dist/plugin/engine/integrity.js +98 -0
  26. package/dist/plugin/engine/integrity.js.map +1 -0
  27. package/dist/plugin/engine/registry.d.ts +39 -0
  28. package/dist/plugin/engine/registry.d.ts.map +1 -0
  29. package/dist/plugin/engine/registry.js +191 -0
  30. package/dist/plugin/engine/registry.js.map +1 -0
  31. package/dist/plugin/engine/state.d.ts +31 -0
  32. package/dist/plugin/engine/state.d.ts.map +1 -0
  33. package/dist/plugin/engine/state.js +116 -0
  34. package/dist/plugin/engine/state.js.map +1 -0
  35. package/dist/plugin/engine/task-tracker.d.ts +66 -0
  36. package/dist/plugin/engine/task-tracker.d.ts.map +1 -0
  37. package/dist/plugin/engine/task-tracker.js +124 -0
  38. package/dist/plugin/engine/task-tracker.js.map +1 -0
  39. package/dist/plugin/engine/types.d.ts +349 -0
  40. package/dist/plugin/engine/types.d.ts.map +1 -0
  41. package/dist/plugin/engine/types.js +3 -0
  42. package/dist/plugin/engine/types.js.map +1 -0
  43. package/dist/plugin/engine/validator.d.ts +52 -0
  44. package/dist/plugin/engine/validator.d.ts.map +1 -0
  45. package/dist/plugin/engine/validator.js +457 -0
  46. package/dist/plugin/engine/validator.js.map +1 -0
  47. package/dist/plugin/engine/verifier.d.ts +61 -0
  48. package/dist/plugin/engine/verifier.d.ts.map +1 -0
  49. package/dist/plugin/engine/verifier.js +441 -0
  50. package/dist/plugin/engine/verifier.js.map +1 -0
  51. package/dist/plugin/hooks/context-injection.d.ts +11 -0
  52. package/dist/plugin/hooks/context-injection.d.ts.map +1 -0
  53. package/dist/plugin/hooks/context-injection.js +88 -0
  54. package/dist/plugin/hooks/context-injection.js.map +1 -0
  55. package/dist/plugin/hooks/event-handlers.d.ts +9 -0
  56. package/dist/plugin/hooks/event-handlers.d.ts.map +1 -0
  57. package/dist/plugin/hooks/event-handlers.js +10 -0
  58. package/dist/plugin/hooks/event-handlers.js.map +1 -0
  59. package/dist/plugin/hooks/workflow-gate.d.ts +24 -0
  60. package/dist/plugin/hooks/workflow-gate.d.ts.map +1 -0
  61. package/dist/plugin/hooks/workflow-gate.js +78 -0
  62. package/dist/plugin/hooks/workflow-gate.js.map +1 -0
  63. package/dist/plugin/index.d.ts +423 -0
  64. package/dist/plugin/index.d.ts.map +1 -0
  65. package/dist/plugin/index.js +253 -0
  66. package/dist/plugin/index.js.map +1 -0
  67. package/dist/plugin/tools/spec-artifact-instr.d.ts +7 -0
  68. package/dist/plugin/tools/spec-artifact-instr.d.ts.map +1 -0
  69. package/dist/plugin/tools/spec-artifact-instr.js +73 -0
  70. package/dist/plugin/tools/spec-artifact-instr.js.map +1 -0
  71. package/dist/plugin/tools/spec-change-archive.d.ts +6 -0
  72. package/dist/plugin/tools/spec-change-archive.d.ts.map +1 -0
  73. package/dist/plugin/tools/spec-change-archive.js +62 -0
  74. package/dist/plugin/tools/spec-change-archive.js.map +1 -0
  75. package/dist/plugin/tools/spec-change-list.d.ts +3 -0
  76. package/dist/plugin/tools/spec-change-list.d.ts.map +1 -0
  77. package/dist/plugin/tools/spec-change-list.js +38 -0
  78. package/dist/plugin/tools/spec-change-list.js.map +1 -0
  79. package/dist/plugin/tools/spec-change-new.d.ts +7 -0
  80. package/dist/plugin/tools/spec-change-new.d.ts.map +1 -0
  81. package/dist/plugin/tools/spec-change-new.js +47 -0
  82. package/dist/plugin/tools/spec-change-new.js.map +1 -0
  83. package/dist/plugin/tools/spec-change-status.d.ts +6 -0
  84. package/dist/plugin/tools/spec-change-status.d.ts.map +1 -0
  85. package/dist/plugin/tools/spec-change-status.js +43 -0
  86. package/dist/plugin/tools/spec-change-status.js.map +1 -0
  87. package/dist/plugin/tools/spec-design-critique.d.ts +20 -0
  88. package/dist/plugin/tools/spec-design-critique.d.ts.map +1 -0
  89. package/dist/plugin/tools/spec-design-critique.js +412 -0
  90. package/dist/plugin/tools/spec-design-critique.js.map +1 -0
  91. package/dist/plugin/tools/spec-design-hifi.d.ts +119 -0
  92. package/dist/plugin/tools/spec-design-hifi.d.ts.map +1 -0
  93. package/dist/plugin/tools/spec-design-hifi.js +653 -0
  94. package/dist/plugin/tools/spec-design-hifi.js.map +1 -0
  95. package/dist/plugin/tools/spec-design-wireframe.d.ts +91 -0
  96. package/dist/plugin/tools/spec-design-wireframe.d.ts.map +1 -0
  97. package/dist/plugin/tools/spec-design-wireframe.js +357 -0
  98. package/dist/plugin/tools/spec-design-wireframe.js.map +1 -0
  99. package/dist/plugin/tools/spec-init.d.ts +9 -0
  100. package/dist/plugin/tools/spec-init.d.ts.map +1 -0
  101. package/dist/plugin/tools/spec-init.js +58 -0
  102. package/dist/plugin/tools/spec-init.js.map +1 -0
  103. package/dist/plugin/tools/spec-integrity-check.d.ts +6 -0
  104. package/dist/plugin/tools/spec-integrity-check.d.ts.map +1 -0
  105. package/dist/plugin/tools/spec-integrity-check.js +19 -0
  106. package/dist/plugin/tools/spec-integrity-check.js.map +1 -0
  107. package/dist/plugin/tools/spec-registry-update.d.ts +3 -0
  108. package/dist/plugin/tools/spec-registry-update.d.ts.map +1 -0
  109. package/dist/plugin/tools/spec-registry-update.js +34 -0
  110. package/dist/plugin/tools/spec-registry-update.js.map +1 -0
  111. package/dist/plugin/tools/spec-schema-list.d.ts +3 -0
  112. package/dist/plugin/tools/spec-schema-list.d.ts.map +1 -0
  113. package/dist/plugin/tools/spec-schema-list.js +28 -0
  114. package/dist/plugin/tools/spec-schema-list.js.map +1 -0
  115. package/dist/plugin/tools/spec-specs-apply.d.ts +7 -0
  116. package/dist/plugin/tools/spec-specs-apply.d.ts.map +1 -0
  117. package/dist/plugin/tools/spec-specs-apply.js +49 -0
  118. package/dist/plugin/tools/spec-specs-apply.js.map +1 -0
  119. package/dist/plugin/tools/spec-task-progress.d.ts +8 -0
  120. package/dist/plugin/tools/spec-task-progress.d.ts.map +1 -0
  121. package/dist/plugin/tools/spec-task-progress.js +96 -0
  122. package/dist/plugin/tools/spec-task-progress.js.map +1 -0
  123. package/dist/plugin/tools/spec-validate.d.ts +21 -0
  124. package/dist/plugin/tools/spec-validate.d.ts.map +1 -0
  125. package/dist/plugin/tools/spec-validate.js +182 -0
  126. package/dist/plugin/tools/spec-validate.js.map +1 -0
  127. package/dist/plugin/tools/spec-verify.d.ts +7 -0
  128. package/dist/plugin/tools/spec-verify.d.ts.map +1 -0
  129. package/dist/plugin/tools/spec-verify.js +50 -0
  130. package/dist/plugin/tools/spec-verify.js.map +1 -0
  131. package/dist/plugin/tools/util.d.ts +25 -0
  132. package/dist/plugin/tools/util.d.ts.map +1 -0
  133. package/dist/plugin/tools/util.js +33 -0
  134. package/dist/plugin/tools/util.js.map +1 -0
  135. package/package.json +61 -0
  136. package/src/agents/orchestrator.md +158 -0
  137. package/src/agents/spec-apply.md +114 -0
  138. package/src/agents/spec-archive.md +103 -0
  139. package/src/agents/spec-propose.md +120 -0
  140. package/src/agents/spec-verify.md +103 -0
  141. package/src/commands/spec-init.md +6 -0
  142. package/src/commands/spec-onboard.md +6 -0
  143. package/src/commands/spec-status.md +6 -0
  144. package/src/commands/spec-sync.md +6 -0
  145. package/src/schemas/hybrid.yaml +144 -0
  146. package/src/schemas/spec-driven.yaml +155 -0
  147. package/src/schemas/tdd.yaml +203 -0
  148. package/src/skills/playwright-cli/SKILL.md +388 -0
  149. package/src/skills/playwright-cli/references/element-attributes.md +23 -0
  150. package/src/skills/playwright-cli/references/playwright-tests.md +39 -0
  151. package/src/skills/playwright-cli/references/request-mocking.md +87 -0
  152. package/src/skills/playwright-cli/references/running-code.md +241 -0
  153. package/src/skills/playwright-cli/references/session-management.md +225 -0
  154. package/src/skills/playwright-cli/references/spec-driven-testing.md +305 -0
  155. package/src/skills/playwright-cli/references/storage-state.md +275 -0
  156. package/src/skills/playwright-cli/references/test-generation.md +134 -0
  157. package/src/skills/playwright-cli/references/tracing.md +139 -0
  158. package/src/skills/playwright-cli/references/video-recording.md +143 -0
  159. package/src/skills/spec-init/SKILL.md +61 -0
  160. package/src/skills/spec-onboard/SKILL.md +178 -0
  161. package/src/skills/spec-status/SKILL.md +72 -0
  162. package/src/skills/spec-sync/SKILL.md +63 -0
  163. package/src/templates/config.yaml +14 -0
  164. package/src/templates/design-hifi.yaml +580 -0
  165. package/src/templates/design-tech.yaml +42 -0
  166. package/src/templates/design-wireframe.yaml +114 -0
  167. package/src/templates/proposal.yaml +43 -0
  168. package/src/templates/registry.yaml +3 -0
  169. package/src/templates/spec.yaml +56 -0
  170. package/src/templates/tasks.yaml +58 -0
@@ -0,0 +1,139 @@
1
+ # Tracing
2
+
3
+ Capture detailed execution traces for debugging and analysis. Traces include DOM snapshots, screenshots, network activity, and console logs.
4
+
5
+ ## Basic Usage
6
+
7
+ ```bash
8
+ # Start trace recording
9
+ playwright-cli tracing-start
10
+
11
+ # Perform actions
12
+ playwright-cli open https://example.com
13
+ playwright-cli click e1
14
+ playwright-cli fill e2 "test"
15
+
16
+ # Stop trace recording
17
+ playwright-cli tracing-stop
18
+ ```
19
+
20
+ ## Trace Output Files
21
+
22
+ When you start tracing, Playwright creates a `traces/` directory with several files:
23
+
24
+ ### `trace-{timestamp}.trace`
25
+
26
+ **Action log** - The main trace file containing:
27
+ - Every action performed (clicks, fills, navigations)
28
+ - DOM snapshots before and after each action
29
+ - Screenshots at each step
30
+ - Timing information
31
+ - Console messages
32
+ - Source locations
33
+
34
+ ### `trace-{timestamp}.network`
35
+
36
+ **Network log** - Complete network activity:
37
+ - All HTTP requests and responses
38
+ - Request headers and bodies
39
+ - Response headers and bodies
40
+ - Timing (DNS, connect, TLS, TTFB, download)
41
+ - Resource sizes
42
+ - Failed requests and errors
43
+
44
+ ### `resources/`
45
+
46
+ **Resources directory** - Cached resources:
47
+ - Images, fonts, stylesheets, scripts
48
+ - Response bodies for replay
49
+ - Assets needed to reconstruct page state
50
+
51
+ ## What Traces Capture
52
+
53
+ | Category | Details |
54
+ |----------|---------|
55
+ | **Actions** | Clicks, fills, hovers, keyboard input, navigations |
56
+ | **DOM** | Full DOM snapshot before/after each action |
57
+ | **Screenshots** | Visual state at each step |
58
+ | **Network** | All requests, responses, headers, bodies, timing |
59
+ | **Console** | All console.log, warn, error messages |
60
+ | **Timing** | Precise timing for each operation |
61
+
62
+ ## Use Cases
63
+
64
+ ### Debugging Failed Actions
65
+
66
+ ```bash
67
+ playwright-cli tracing-start
68
+ playwright-cli open https://app.example.com
69
+
70
+ # This click fails - why?
71
+ playwright-cli click e5
72
+
73
+ playwright-cli tracing-stop
74
+ # Open trace to see DOM state when click was attempted
75
+ ```
76
+
77
+ ### Analyzing Performance
78
+
79
+ ```bash
80
+ playwright-cli tracing-start
81
+ playwright-cli open https://slow-site.com
82
+ playwright-cli tracing-stop
83
+
84
+ # View network waterfall to identify slow resources
85
+ ```
86
+
87
+ ### Capturing Evidence
88
+
89
+ ```bash
90
+ # Record a complete user flow for documentation
91
+ playwright-cli tracing-start
92
+
93
+ playwright-cli open https://app.example.com/checkout
94
+ playwright-cli fill e1 "4111111111111111"
95
+ playwright-cli fill e2 "12/25"
96
+ playwright-cli fill e3 "123"
97
+ playwright-cli click e4
98
+
99
+ playwright-cli tracing-stop
100
+ # Trace shows exact sequence of events
101
+ ```
102
+
103
+ ## Trace vs Video vs Screenshot
104
+
105
+ | Feature | Trace | Video | Screenshot |
106
+ |---------|-------|-------|------------|
107
+ | **Format** | .trace file | .webm video | .png/.jpeg image |
108
+ | **DOM inspection** | Yes | No | No |
109
+ | **Network details** | Yes | No | No |
110
+ | **Step-by-step replay** | Yes | Continuous | Single frame |
111
+ | **File size** | Medium | Large | Small |
112
+ | **Best for** | Debugging | Demos | Quick capture |
113
+
114
+ ## Best Practices
115
+
116
+ ### 1. Start Tracing Before the Problem
117
+
118
+ ```bash
119
+ # Trace the entire flow, not just the failing step
120
+ playwright-cli tracing-start
121
+ playwright-cli open https://example.com
122
+ # ... all steps leading to the issue ...
123
+ playwright-cli tracing-stop
124
+ ```
125
+
126
+ ### 2. Clean Up Old Traces
127
+
128
+ Traces can consume significant disk space:
129
+
130
+ ```bash
131
+ # Remove traces older than 7 days
132
+ find .playwright-cli/traces -mtime +7 -delete
133
+ ```
134
+
135
+ ## Limitations
136
+
137
+ - Traces add overhead to automation
138
+ - Large traces can consume significant disk space
139
+ - Some dynamic content may not replay perfectly
@@ -0,0 +1,143 @@
1
+ # Video Recording
2
+
3
+ Capture browser automation sessions as video for debugging, documentation, or verification. Produces WebM (VP8/VP9 codec).
4
+
5
+ ## Basic Recording
6
+
7
+ ```bash
8
+ # Open browser first
9
+ playwright-cli open
10
+
11
+ # Start recording
12
+ playwright-cli video-start demo.webm
13
+
14
+ # Add a chapter marker for section transitions
15
+ playwright-cli video-chapter "Getting Started" --description="Opening the homepage" --duration=2000
16
+
17
+ # Navigate and perform actions
18
+ playwright-cli goto https://example.com
19
+ playwright-cli snapshot
20
+ playwright-cli click e1
21
+
22
+ # Add another chapter
23
+ playwright-cli video-chapter "Filling Form" --description="Entering test data" --duration=2000
24
+ playwright-cli fill e2 "test input"
25
+
26
+ # Stop and save
27
+ playwright-cli video-stop
28
+ ```
29
+
30
+ ## Best Practices
31
+
32
+ ### 1. Use Descriptive Filenames
33
+
34
+ ```bash
35
+ # Include context in filename
36
+ playwright-cli video-start recordings/login-flow-2024-01-15.webm
37
+ playwright-cli video-start recordings/checkout-test-run-42.webm
38
+ ```
39
+
40
+ ### 2. Record entire hero scripts.
41
+
42
+ When recording a video for the user or as a proof of work, it is best to create a code snippet and execute it with run-code.
43
+ It allows pulling appropriate pauses between the actions and annotating the video. There are new Playwright APIs for that.
44
+
45
+ 1) Perform scenario using CLI and take note of all locators and actions. You'll need those locators to request their bounding boxes for highlight.
46
+ 2) Create a file with the intended script for video (below). Use pressSequentially w/ delay for nice typing, make reasonable pauses.
47
+ 3) Use playwright-cli run-code --filename your-script.js
48
+
49
+ **Important**: Overlays are `pointer-events: none` — they do not interfere with page interactions. You can safely keep sticky overlays visible while clicking, filling, or performing any actions on the page.
50
+
51
+ ```js
52
+ async page => {
53
+ await page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });
54
+ await page.goto('https://demo.playwright.dev/todomvc');
55
+
56
+ // Show a chapter card — blurs the page and shows a dialog.
57
+ // Blocks until duration expires, then auto-removes.
58
+ // Use this for simple use cases, but always feel free to hand-craft your own beautiful
59
+ // overlay via await page.screencast.showOverlay().
60
+ await page.screencast.showChapter('Adding Todo Items', {
61
+ description: 'We will add several items to the todo list.',
62
+ duration: 2000,
63
+ });
64
+
65
+ // Perform action
66
+ await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Walk the dog', { delay: 60 });
67
+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
68
+ await page.waitForTimeout(1000);
69
+
70
+ // Show next chapter
71
+ await page.screencast.showChapter('Verifying Results', {
72
+ description: 'Checking the item appeared in the list.',
73
+ duration: 2000,
74
+ });
75
+
76
+ // Add a sticky annotation that stays while you perform actions.
77
+ // Overlays are pointer-events: none, so they won't block clicks.
78
+ const annotation = await page.screencast.showOverlay(`
79
+ <div style="position: absolute; top: 8px; right: 8px;
80
+ padding: 6px 12px; background: rgba(0,0,0,0.7);
81
+ border-radius: 8px; font-size: 13px; color: white;">
82
+ ✓ Item added successfully
83
+ </div>
84
+ `);
85
+
86
+ // Perform more actions while the annotation is visible
87
+ await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Buy groceries', { delay: 60 });
88
+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
89
+ await page.waitForTimeout(1500);
90
+
91
+ // Remove the annotation when done
92
+ await annotation.dispose();
93
+
94
+ // You can also highlight relevant locators and provide contextual annotations.
95
+ const bounds = await page.getByText('Walk the dog').boundingBox();
96
+ await page.screencast.showOverlay(`
97
+ <div style="position: absolute;
98
+ top: ${bounds.y}px;
99
+ left: ${bounds.x}px;
100
+ width: ${bounds.width}px;
101
+ height: ${bounds.height}px;
102
+ border: 1px solid red;">
103
+ </div>
104
+ <div style="position: absolute;
105
+ top: ${bounds.y + bounds.height + 5}px;
106
+ left: ${bounds.x + bounds.width / 2}px;
107
+ transform: translateX(-50%);
108
+ padding: 6px;
109
+ background: #808080;
110
+ border-radius: 10px;
111
+ font-size: 14px;
112
+ color: white;">Check it out, it is right above this text
113
+ </div>
114
+ `, { duration: 2000 });
115
+
116
+ await page.screencast.stop();
117
+ }
118
+ ```
119
+
120
+ Embrace creativity, overlays are powerful.
121
+
122
+ ### Overlay API Summary
123
+
124
+ | Method | Use Case |
125
+ |--------|----------|
126
+ | `page.screencast.showChapter(title, { description?, duration?, styleSheet? })` | Full-screen chapter card with blurred backdrop — ideal for section transitions |
127
+ | `page.screencast.showOverlay(html, { duration? })` | Custom HTML overlay — use for callouts, labels, highlights |
128
+ | `disposable.dispose()` | Remove a sticky overlay added without duration |
129
+ | `page.screencast.hideOverlays()` / `page.screencast.showOverlays()` | Temporarily hide/show all overlays |
130
+
131
+ ## Tracing vs Video
132
+
133
+ | Feature | Video | Tracing |
134
+ |---------|-------|---------|
135
+ | Output | WebM file | Trace file (viewable in Trace Viewer) |
136
+ | Shows | Visual recording | DOM snapshots, network, console, actions |
137
+ | Use case | Demos, documentation | Debugging, analysis |
138
+ | Size | Larger | Smaller |
139
+
140
+ ## Limitations
141
+
142
+ - Recording adds slight overhead to automation
143
+ - Large recordings can consume significant disk space
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: spec-init
3
+ description: Initialize the spec/ directory structure for a new project. Use when the user says "spec-init", "initialize spec", "set up spec workflow", or wants to bootstrap the spec-native workflow on a new project.
4
+ ---
5
+
6
+ # Spec Init
7
+
8
+ Initialize the spec/ directory structure and generate project config from codebase context.
9
+
10
+ ## When to Use
11
+
12
+ - User says "spec-init", "initialize spec", "set up spec"
13
+ - User is adopting the spec-native workflow on a new project
14
+ - User wants to create the spec/ directory structure
15
+
16
+ ## Workflow
17
+
18
+ 1. **Check for existing spec/config.yaml**
19
+ - If `spec/config.yaml` exists, ask the user: "spec/config.yaml already exists. Overwrite?"
20
+ - If the user declines, abort without creating or modifying any files.
21
+ - If the user confirms, proceed with `force: true` when calling the tool.
22
+ - If `spec/config.yaml` does not exist, proceed without prompting.
23
+
24
+ 2. **Gather codebase context via @explore agent**
25
+ - Delegate to the @explore agent with this task:
26
+ "Analyze this codebase and produce a markdown summary covering:
27
+ (a) Project purpose — what the project does in 1-2 sentences
28
+ (b) Technology stack — languages, frameworks, key dependencies
29
+ (c) Architecture overview — high-level structure, key modules, patterns
30
+ (d) Domain description — business domain, key entities, workflows
31
+ Keep the summary under 50KB."
32
+ - The explore agent returns the context as markdown.
33
+
34
+ 3. **Synthesize context**
35
+ - Review the explore agent output.
36
+ - Ensure it covers all four sections (purpose, stack, architecture, domain).
37
+ - If any section is missing, ask the user to provide it.
38
+ - Ensure the total context is under 50KB.
39
+
40
+ 4. **Call spec_init tool**
41
+ - Call `spec_init` with:
42
+ - `context`: the synthesized markdown
43
+ - `schema`: "spec-driven" (or user-specified schema)
44
+ - `rules`: optional, from user input or defaults
45
+ - `force`: true only if user confirmed overwrite in step 1
46
+ - The tool creates spec/, spec/changes/, spec/main/, spec/archive/ and writes config.yaml and registry.yaml.
47
+
48
+ 5. **Report results**
49
+ - Show the user what was created:
50
+ - spec/ directory structure
51
+ - spec/config.yaml with project context
52
+ - spec/registry.yaml with empty changes list
53
+ - Suggest next step: "Run /spec-propose to create your first change."
54
+
55
+ ## Guardrails
56
+
57
+ - This skill ONLY initializes files under spec/. It MUST NOT create or modify files under .opencode/ (commands, skills, plugins).
58
+ - Always confirm with the user before overwriting an existing spec/config.yaml.
59
+ - Context must be under 50KB — if the explore agent returns more, summarize it.
60
+ - If the explore agent fails or returns low-quality context, ask the user to provide context manually.
61
+ - Do not skip the overwrite check — it protects existing project configuration.
@@ -0,0 +1,178 @@
1
+ ---
2
+ name: spec-onboard
3
+ description: Guided onboarding tutorial through a complete spec-native workflow cycle. Use when the user is new to spec-native and wants to learn the workflow by doing a real example.
4
+ ---
5
+
6
+ # Spec Onboard
7
+
8
+ Guided onboarding through a complete spec-native workflow.
9
+
10
+ ## When to Use
11
+
12
+ - User is new to spec-native
13
+ - User says "onboard", "tutorial", "show me how"
14
+ - User wants to learn by doing
15
+
16
+ ## Duration
17
+
18
+ ~15-20 minutes
19
+
20
+ ## Workflow
21
+
22
+ ### Phase 1: Welcome (1 min)
23
+
24
+ Explain the journey:
25
+ 1. Pick a small task from the codebase
26
+ 2. Explore the problem
27
+ 3. Create a spec change
28
+ 4. Build artifacts (proposal, specs, design, tasks)
29
+ 5. Implement the tasks
30
+ 6. Verify and archive
31
+
32
+ ### Phase 2: Task Selection (2 min)
33
+
34
+ Scan codebase for small improvements:
35
+ - TODO/FIXME comments
36
+ - Missing error handling
37
+ - Functions without tests
38
+ - Type issues (any types)
39
+ - Debug artifacts (console.log, debugger)
40
+
41
+ Present 3-4 suggestions with:
42
+ - Location
43
+ - Scope
44
+ - Rationale
45
+
46
+ Let user choose (or suggest the smallest).
47
+
48
+ ### Phase 3: Explore Demo (2 min)
49
+
50
+ Briefly demonstrate explore mode:
51
+ - Read relevant files
52
+ - Show spec/config.yaml as project configuration reference
53
+ - Draw ASCII diagram of current state
54
+ - Note considerations
55
+ - Explain: "This is explore mode — thinking before doing"
56
+
57
+ ### Phase 4: Create Change (1 min)
58
+
59
+ - Call `spec_change_new` with chosen task
60
+ - Show the folder structure created
61
+ - Explain: "A change is a self-contained unit of work"
62
+
63
+ ### Phase 5: Proposal (2 min)
64
+
65
+ - Call `spec_artifact_instr` for proposal
66
+ - Draft proposal together:
67
+ - Why: Explain the problem
68
+ - What: List capabilities
69
+ - Impact: Files affected
70
+ - Explain each section
71
+ - Save to proposal.yaml
72
+ - Pause for user approval
73
+
74
+ ### Phase 6: Specs (2 min)
75
+
76
+ - Call `spec_artifact_instr` for specs
77
+ - Explain requirement/scenario format
78
+ - Draft spec with one requirement:
79
+ - Description with SHALL/MUST
80
+ - Scenario with given/when/then
81
+ - Verify block with assertion
82
+ - Save to specs/<capability>.yaml
83
+ - Explain: "Specs are behavior contracts"
84
+
85
+ ### Phase 7: Design (1 min)
86
+
87
+ - Call `spec_artifact_instr` for design
88
+ - Explain: "Design captures HOW, not WHAT"
89
+ - Draft design.md:
90
+ - Context
91
+ - Goals/Non-goals
92
+ - One decision
93
+ - Save to design.yaml
94
+ - Note: "For simple changes, you can skip design"
95
+
96
+ ### Phase 8: Tasks (2 min)
97
+
98
+ - Call `spec_artifact_instr` for tasks
99
+ - Explain task breakdown
100
+ - Generate 2-3 tasks:
101
+ - Each with ID, description, depends_on
102
+ - Acceptance criteria
103
+ - Estimated time
104
+ - Save to tasks.yaml
105
+ - Explain: "Tasks are your implementation checklist"
106
+
107
+ ### Phase 9: Apply (3 min)
108
+
109
+ - Call `spec_task_progress`
110
+ - Implement first task with narration:
111
+ - "The spec says X, so I'm doing Y"
112
+ - Show the code changes
113
+ - Mark task complete
114
+ - Explain: "Apply implements tasks in order"
115
+
116
+ ### Phase 10: Verify (1 min)
117
+
118
+ - Call `spec_verify`
119
+ - Show verification report
120
+ - Explain each dimension
121
+ - Note: "Verification catches issues before archive"
122
+
123
+ ### Phase 11: Archive (1 min)
124
+
125
+ - Call `spec_specs_apply` to sync specs
126
+ - Call `spec_change_archive` to archive
127
+ - Explain: "Archive preserves the decision history"
128
+
129
+ ### Phase 12: Recap (1 min)
130
+
131
+ Summarize the cycle:
132
+ ```
133
+ propose -> apply -> verify -> archive
134
+ ^ |
135
+ +-------------------------+
136
+ ```
137
+
138
+ Show command reference:
139
+ ```
140
+ /spec-propose Create a new change
141
+ /spec-explore Think through a problem
142
+ /spec-apply Implement tasks
143
+ /spec-sync Sync specs to main
144
+ /spec-archive Archive completed change
145
+ /spec-verify Verify implementation
146
+ /spec-status Check progress
147
+ ```
148
+
149
+ Suggest: "Try /spec-propose on your real work now!"
150
+
151
+ ## Teaching Pattern
152
+
153
+ Follow EXPLAIN -> DO -> SHOW -> PAUSE at key transitions.
154
+
155
+ ## Scope Guardrail
156
+
157
+ If user picks something too large:
158
+ - Gently suggest slicing smaller
159
+ - "That's a great project! For onboarding, let's pick something we can finish in 15 minutes."
160
+ - Soft guardrail — user can override
161
+
162
+ ## Graceful Exits
163
+
164
+ If user wants to stop:
165
+ - "Your change is saved. Use /spec-apply to resume later."
166
+
167
+ If user just wants commands:
168
+ - Show command reference table
169
+ - Exit gracefully
170
+
171
+ ## Guardrails
172
+
173
+ - Follow EXPLAIN -> DO -> SHOW -> PAUSE
174
+ - Keep narration light during implementation
175
+ - Don't skip phases (teaching the workflow is the goal)
176
+ - Use real codebase tasks, not fake examples
177
+ - Handle exits gracefully
178
+ - Never pressure to continue
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: spec-status
3
+ description: Show the status of spec changes including artifact completion, task progress, and verification state. Use when the user wants to check on the progress of a change or see all active changes.
4
+ ---
5
+
6
+ # Spec Status
7
+
8
+ Show the status of spec changes.
9
+
10
+ ## When to Use
11
+
12
+ - User wants to check progress
13
+ - User says "status", "progress", "where am I"
14
+ - User wants to see all active changes
15
+
16
+ ## Workflow
17
+
18
+ ### Single Change
19
+
20
+ 1. **Get change name**
21
+ - If user specified, use it
22
+ - If only one active, use it
23
+ - Otherwise, list and ask
24
+
25
+ 2. **Get status**
26
+ - Call `spec_change_status`
27
+ - Show:
28
+ - Change name and schema
29
+ - Artifact completion (checkmark/cross for each)
30
+ - Next artifacts to create
31
+ - Overall completion status
32
+
33
+ 3. **Get task progress**
34
+ - Call `spec_task_progress`
35
+ - Show:
36
+ - Total tasks
37
+ - Completed tasks
38
+ - Pending tasks
39
+ - Percentage complete
40
+
41
+ 4. **Check integrity**
42
+ - Call `spec_integrity_check`
43
+ - Show: valid/invalid, mismatches
44
+
45
+ 5. **Show summary**
46
+ - Overall status: "Ready for apply" / "In progress" / "Ready for archive"
47
+ - Next suggested action
48
+
49
+ ### All Changes
50
+
51
+ 1. **List all changes**
52
+ - Call `spec_change_list`
53
+ - Show table:
54
+ ```
55
+ | Name | Schema | Progress | Status |
56
+ |---------------|-------------|----------|--------|
57
+ | add-user-auth | spec-driven | 75% | active |
58
+ | fix-payment | tdd | 100% | active |
59
+ ```
60
+
61
+ 2. **Highlight next actions**
62
+ - For each change, suggest next step:
63
+ - "Run /spec-apply" if artifacts complete
64
+ - "Run /spec-archive" if tasks complete
65
+ - "Run /spec-verify" before archive
66
+
67
+ ## Guardrails
68
+
69
+ - Keep output concise
70
+ - Use tables for multiple changes
71
+ - Highlight next actions
72
+ - Don't overwhelm with details
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: spec-sync
3
+ description: Sync delta specs from a change to main specs without archiving. Use when the user wants to update the main specifications with changes from a spec change, but keep the change active for further work.
4
+ ---
5
+
6
+ # Spec Sync
7
+
8
+ Sync delta specs from a change to main specs.
9
+
10
+ ## When to Use
11
+
12
+ - User wants to update main specs
13
+ - User says "sync", "merge specs", "update specs"
14
+ - User wants to apply deltas without archiving
15
+
16
+ ## Workflow
17
+
18
+ 1. **Select change**
19
+ - If user specified, use it
20
+ - Otherwise, call `spec_change_list` and ask
21
+
22
+ 2. **Check for delta specs**
23
+ - Read the change's specs/ directory
24
+ - List delta spec files
25
+ - If no deltas, inform user and stop
26
+
27
+ 3. **Preview changes**
28
+ - Call `spec_specs_apply` with `dryRun: true`
29
+ - Show what will be applied:
30
+ - Capabilities affected
31
+ - Operations (add/modify/remove/rename)
32
+ - Requirements impacted
33
+
34
+ 4. **Confirm with user**
35
+ - Show preview
36
+ - Ask: "Apply these changes to main specs?"
37
+ - If no, stop
38
+
39
+ 5. **Apply deltas**
40
+ - Call `spec_specs_apply` with `dryRun: false`
41
+ - This merges deltas into spec/main/*.yaml
42
+
43
+ 6. **Show summary**
44
+ - List capabilities updated
45
+ - Show operation counts (added, modified, removed, renamed)
46
+ - Note: Change remains active (not archived)
47
+ - Suggest: "Run /spec-archive when fully done"
48
+
49
+ ## Sync Behavior
50
+
51
+ - **add**: Add requirement to main (error if exists)
52
+ - **modify**: Replace requirement in main (must include full content)
53
+ - **remove**: Remove requirement from main
54
+ - **rename**: Rename requirement ID
55
+
56
+ ## Guardrails
57
+
58
+ - Always preview before applying
59
+ - Confirm with user before applying
60
+ - Don't archive the change (that's /spec-archive)
61
+ - Preserve existing content not mentioned in deltas
62
+ - Operation should be idempotent
63
+ - Read spec/config.yaml for project context before syncing
@@ -0,0 +1,14 @@
1
+ schema: <schema-name>
2
+
3
+ context: |
4
+ <project-context-markdown>
5
+
6
+ rules:
7
+ proposal:
8
+ - <proposal-rule>
9
+ specs:
10
+ - <specs-rule>
11
+ design:
12
+ - <design-rule>
13
+ tasks:
14
+ - <tasks-rule>