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