gswd 0.1.0 → 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/README.md ADDED
@@ -0,0 +1,187 @@
1
+ ```
2
+ ██████╗ ███████╗██╗ ██╗██████╗
3
+ ██╔════╝ ██╔════╝██║ ██║██╔══██╗
4
+ ██║ ███╗███████╗██║ █╗ ██║██║ ██║
5
+ ██║ ██║╚════██║██║███╗██║██║ ██║
6
+ ╚██████╔╝███████║╚███╔███╔╝██████╔╝
7
+ ╚═════╝ ╚══════╝ ╚══╝╚══╝ ╚═════╝
8
+ ```
9
+
10
+ **Clarity is the bottleneck, not compute. GSWD produces bulletproof specs so you can one-shot the build.**
11
+
12
+ [![npm version](https://img.shields.io/npm/v/gswd)](https://www.npmjs.com/package/gswd)
13
+ [![License: MIT](https://img.shields.io/npm/l/gswd)](https://opensource.org/licenses/MIT)
14
+ ![Tests](https://img.shields.io/badge/tests-518%20passing-brightgreen)
15
+
16
+ GSWD is the thinking stage before [GSD](https://www.npmjs.com/package/get-shit-done-cc) builds. The bottleneck in building with AI isn't the AI — it's feeding it a spec that's complete, traceable, and unambiguous. GSWD forces that rigor upfront so you can hand off a GSD contract and build the first time, without guessing.
17
+
18
+ ## Pipeline
19
+
20
+ ```
21
+ IMAGINE -> SPECIFY -> AUDIT -> COMPILE
22
+ | | | |
23
+ Direction Spec+IDs Coverage GSD Contract
24
+ ```
25
+
26
+ 1. **IMAGINE** — turn a fuzzy idea into a validated product direction
27
+ 2. **SPECIFY** — turn that direction into a build-ready, traceable spec
28
+ 3. **AUDIT** — enforce full coverage (no missing journeys, no orphan requirements)
29
+ 4. **COMPILE** — deterministically generate the GSD contract files
30
+
31
+ ## Install
32
+
33
+ ```bash
34
+ npx gswd-install
35
+ ```
36
+
37
+ Copies `/gswd:*` slash commands to `~/.claude/commands/gswd/` for use in Claude Code.
38
+
39
+ ## Quick Start
40
+
41
+ ```
42
+ /gswd:start
43
+ ```
44
+
45
+ That's it. Describe your idea conversationally — GSWD walks you through the full pipeline.
46
+
47
+ **Have an idea file already?**
48
+
49
+ ```
50
+ /gswd:start @idea.md
51
+ ```
52
+
53
+ ## What It Looks Like
54
+
55
+ ```
56
+ $ /gswd:start
57
+
58
+ Describe your product idea (or press Enter to type it out):
59
+ > A task management app for remote teams with async standups
60
+ > and no meeting culture overhead.
61
+
62
+ Got it. Let me confirm before we begin:
63
+
64
+ Product: Async standup and task coordination tool for remote teams
65
+ Angle: No meeting overhead — async-first by design
66
+
67
+ Does this capture your idea? [yes]
68
+
69
+ ┌─────────────────────────────────────────────┐
70
+ │ IMAGINE — Validating direction │
71
+ │ Running research agents... │
72
+ └─────────────────────────────────────────────┘
73
+
74
+ Researching market landscape...
75
+ Analyzing ICP and GTM angles...
76
+ Freezing key decisions...
77
+
78
+ ✓ DECISIONS.md
79
+ ✓ IMAGINE.md ICP.md GTM.md COMPETITION.md
80
+
81
+ ┌─────────────────────────────────────────────┐
82
+ │ SPECIFY — Building execution-grade spec │
83
+ └─────────────────────────────────────────────┘
84
+
85
+ ✓ SPEC.md JOURNEYS.md ARCHITECTURE.md
86
+ ✓ INTEGRATIONS.md NFR.md
87
+
88
+ ┌─────────────────────────────────────────────┐
89
+ │ AUDIT — Checking spec coverage │
90
+ └─────────────────────────────────────────────┘
91
+
92
+ Checking journeys... PASS
93
+ Checking requirements... PASS
94
+ Checking architecture linkage... PASS
95
+
96
+ ✓ AUDIT.md — PASS
97
+
98
+ ┌─────────────────────────────────────────────┐
99
+ │ COMPILE — Generating GSD contract │
100
+ └─────────────────────────────────────────────┘
101
+
102
+ ✓ PROJECT.md REQUIREMENTS.md ROADMAP.md STATE.md
103
+
104
+ Done! Run /gsd:plan-phase 01 to start building.
105
+ ```
106
+
107
+ ## Commands
108
+
109
+ ### Primary Commands
110
+
111
+ | Command | Description |
112
+ |---------|-------------|
113
+ | `/gswd:start` | Full pipeline: intake -> imagine -> specify -> audit -> compile |
114
+ | `/gswd:status` | Show pipeline status and stage progress |
115
+ | `/gswd:settings` | Configure GSWD workflow settings |
116
+ | `/gswd:help` | Show command reference |
117
+
118
+ ### Advanced Commands
119
+
120
+ Run stages individually if you need finer control:
121
+
122
+ | Command | Description |
123
+ |---------|-------------|
124
+ | `/gswd:imagine [@idea.md]` | Validate direction and freeze key decisions |
125
+ | `/gswd:specify` | Build execution-grade spec with traceable IDs |
126
+ | `/gswd:audit-spec` | Audit spec for coverage — produces PASS/FAIL |
127
+ | `/gswd:compile` | Compile spec into GSD contract docs |
128
+
129
+ ## Common Flags
130
+
131
+ | Flag | Available On | Description |
132
+ |------|-------------|-------------|
133
+ | `--auto` | `/gswd:start`, imagine, specify | Auto mode — minimal interruptions |
134
+ | `--resume` | `/gswd:start`, imagine, specify, audit-spec | Resume from last checkpoint |
135
+ | `--skip-research` | `/gswd:start`, imagine | Disable research agents |
136
+ | `--auto-fix` | audit-spec | Auto-fix gaps found during audit |
137
+ | `--phase-style=thin\|thick` | compile | Phase sizing for GSD roadmap |
138
+ | `--policy=<name>` | `/gswd:start` | Auto policy: strict, balanced, aggressive |
139
+
140
+ ## Output Artifacts
141
+
142
+ ### GSWD artifacts (in `.planning/`)
143
+
144
+ - `IMAGINE.md` — product vision and direction
145
+ - `ICP.md` — ideal customer profile
146
+ - `GTM.md` — go-to-market strategy
147
+ - `COMPETITION.md` — competitive landscape
148
+ - `DECISIONS.md` — frozen decisions, success metrics, risks
149
+ - `SPEC.md` — full product specification
150
+ - `JOURNEYS.md` — user journeys with traceable IDs
151
+ - `ARCHITECTURE.md` — system architecture
152
+ - `INTEGRATIONS.md` — external integrations
153
+ - `NFR.md` — non-functional requirements
154
+ - `AUDIT.md` — coverage matrix and PASS/FAIL verdict
155
+
156
+ ### Compiled GSD contract (in `.planning/`)
157
+
158
+ - `PROJECT.md` — project context
159
+ - `REQUIREMENTS.md` — scoped requirements
160
+ - `ROADMAP.md` — phased execution plan
161
+ - `STATE.md` — project memory
162
+
163
+ ## After GSWD
164
+
165
+ Once compile is done, hand off to GSD:
166
+
167
+ ```
168
+ /gsd:plan-phase 01
169
+ ```
170
+
171
+ GSD picks up the compiled contract and builds phase by phase.
172
+
173
+ ## CLI Usage
174
+
175
+ GSWD also ships a CLI for scripting and non-interactive workflows:
176
+
177
+ ```bash
178
+ gswd imagine @idea.md
179
+ gswd specify
180
+ gswd audit
181
+ gswd compile
182
+ gswd status
183
+ ```
184
+
185
+ ## License
186
+
187
+ MIT
package/bin/install.js ADDED
@@ -0,0 +1,116 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+
9
+ // Colors
10
+ const cyan = '\x1b[36m';
11
+ const green = '\x1b[32m';
12
+ const yellow = '\x1b[33m';
13
+ const dim = '\x1b[2m';
14
+ const reset = '\x1b[0m';
15
+
16
+ // Get version from package.json
17
+ const pkg = require('../package.json');
18
+
19
+ const banner = '\n' +
20
+ cyan + ' ██████╗ ███████╗██╗ ██╗██████╗\n' +
21
+ ' ██╔════╝ ██╔════╝██║ ██║██╔══██╗\n' +
22
+ ' ██║ ███╗███████╗██║ █╗ ██║██║ ██║\n' +
23
+ ' ██║ ██║╚════██║██║███╗██║██║ ██║\n' +
24
+ ' ╚██████╔╝███████║╚███╔███╔╝██████╔╝\n' +
25
+ ' ╚═════╝ ╚══════╝ ╚══╝╚══╝ ╚═════╝' + reset + '\n' +
26
+ '\n' +
27
+ ' Get Shit Well Done ' + dim + 'v' + pkg.version + reset + '\n' +
28
+ ' Imagine, specify, audit, and compile — before GSD builds.\n';
29
+
30
+ console.log(banner);
31
+
32
+ // Parse args
33
+ const args = process.argv.slice(2);
34
+ const hasHelp = args.includes('--help') || args.includes('-h');
35
+ const hasUninstall = args.includes('--uninstall') || args.includes('-u');
36
+
37
+ if (hasHelp) {
38
+ console.log(` ${yellow}Usage:${reset} npx gswd-install [options]\n
39
+ ${yellow}Options:${reset}
40
+ ${cyan}-u, --uninstall${reset} Remove GSWD commands from ~/.claude/commands/gswd/
41
+ ${cyan}-h, --help${reset} Show this help message\n
42
+ ${yellow}What it does:${reset}
43
+ Copies GSWD slash command files to ~/.claude/commands/gswd/
44
+ so they are available as /gswd:* commands in Claude Code.\n`);
45
+ process.exit(0);
46
+ }
47
+
48
+ // Resolve paths
49
+ const claudeDir = process.env.CLAUDE_CONFIG_DIR
50
+ ? process.env.CLAUDE_CONFIG_DIR
51
+ : path.join(os.homedir(), '.claude');
52
+ const destDir = path.join(claudeDir, 'commands', 'gswd');
53
+ const srcDir = path.join(__dirname, '..', 'commands', 'gswd');
54
+
55
+ // Uninstall
56
+ if (hasUninstall) {
57
+ if (fs.existsSync(destDir)) {
58
+ fs.rmSync(destDir, { recursive: true });
59
+ console.log(` ${green}✓${reset} Removed ${destDir.replace(os.homedir(), '~')}\n`);
60
+ } else {
61
+ console.log(` ${yellow}⚠${reset} Nothing to remove — ${destDir.replace(os.homedir(), '~')} does not exist.\n`);
62
+ }
63
+ process.exit(0);
64
+ }
65
+
66
+ // Verify source commands exist
67
+ if (!fs.existsSync(srcDir)) {
68
+ console.error(` ${yellow}✗${reset} Source commands not found at ${srcDir}`);
69
+ console.error(` This usually means the package is not installed correctly.\n`);
70
+ process.exit(1);
71
+ }
72
+
73
+ // Create destination directory
74
+ fs.mkdirSync(destDir, { recursive: true });
75
+
76
+ // Copy all .md files
77
+ const files = fs.readdirSync(srcDir).filter(f => f.endsWith('.md'));
78
+ let copied = 0;
79
+
80
+ for (const file of files) {
81
+ const src = path.join(srcDir, file);
82
+ const dest = path.join(destDir, file);
83
+ fs.copyFileSync(src, dest);
84
+ copied++;
85
+ }
86
+
87
+ console.log(` ${green}✓${reset} Installed ${copied} commands to ${destDir.replace(os.homedir(), '~')}\n`);
88
+
89
+ // Show available commands
90
+ console.log(` ${yellow}Available commands:${reset}\n`);
91
+ console.log(` ${cyan}/gswd:start${reset} Start here — idea to GSD contract`);
92
+ console.log(` ${cyan}/gswd:imagine${reset} Validate direction and freeze decisions`);
93
+ console.log(` ${cyan}/gswd:specify${reset} Build execution-grade spec`);
94
+ console.log(` ${cyan}/gswd:audit-spec${reset} Audit spec coverage — PASS/FAIL`);
95
+ console.log(` ${cyan}/gswd:compile${reset} Compile spec into GSD contract docs`);
96
+ console.log(` ${cyan}/gswd:status${reset} Show pipeline status`);
97
+ console.log(` ${cyan}/gswd:settings${reset} Configure GSWD settings`);
98
+ console.log(` ${cyan}/gswd:help${reset} Show command reference`);
99
+ console.log('');
100
+ console.log(` ${green}Done!${reset} Launch Claude Code and run ${cyan}/gswd:start${reset} to get started.\n`);
101
+
102
+ // Non-blocking update check — silently ignored on network failure
103
+ const https = require('https');
104
+ https.get(`https://registry.npmjs.org/${pkg.name}/latest`, (res) => {
105
+ let data = '';
106
+ res.on('data', chunk => data += chunk);
107
+ res.on('end', () => {
108
+ try {
109
+ const latest = JSON.parse(data).version;
110
+ if (latest && latest !== pkg.version) {
111
+ console.log(`\n ${yellow}Update available:${reset} ${pkg.version} \u2192 ${latest}`);
112
+ console.log(` Run ${cyan}npx gswd-install${reset} to update.\n`);
113
+ }
114
+ } catch (_) {}
115
+ });
116
+ }).on('error', () => {});
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: gswd:audit-spec
3
+ description: Audit spec for full coverage — produces PASS/FAIL
4
+ argument-hint: "[--auto-fix] [--resume]"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - Write
9
+ - Task
10
+ ---
11
+ <objective>
12
+ Enforce full coverage across the specification. Produces a coverage matrix and PASS/FAIL verdict.
13
+
14
+ **Creates/updates:**
15
+ - `.planning/AUDIT.md` — coverage matrix, gap analysis, verdict
16
+
17
+ **Checks:**
18
+ - All journeys have linked FRs and NFRs
19
+ - No orphan requirements (FRs/NFRs not linked to any journey)
20
+ - Edge cases, error states, empty states are covered
21
+ - Auth/session and onboarding/activation flows exist
22
+ - ID formats follow conventions (J-*, FR-*, NFR-*, I-*, C-*)
23
+
24
+ **Flags:**
25
+ - `--auto-fix` — automatically attempt to fix gaps found during audit
26
+ - `--resume` — continue from last checkpoint
27
+
28
+ **Hard gate:**
29
+ - `/gswd:compile` cannot run unless audit is PASS.
30
+
31
+ **After this command:** If PASS, run `/gswd:compile`. If FAIL, fix gaps and re-run.
32
+ </objective>
33
+
34
+ <process>
35
+ 1. Verify specify stage is complete by checking `.planning/gswd/STATE.json`.
36
+
37
+ 2. Run the audit workflow:
38
+ ```bash
39
+ node ./bin/gswd-tools.cjs audit $ARGUMENTS
40
+ ```
41
+
42
+ 3. The CLI runs deterministic coverage checks across all spec artifacts.
43
+
44
+ 4. If `--auto-fix` is enabled, the CLI will attempt to fix gaps automatically.
45
+
46
+ 5. Display the coverage matrix and PASS/FAIL verdict.
47
+
48
+ 6. On PASS: show Next Up: `/gswd:compile`
49
+ On FAIL: show gap summary and suggest fixes before re-running `/gswd:audit-spec`
50
+ </process>
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: gswd:compile
3
+ description: Compile spec into GSD contract docs
4
+ argument-hint: "[--phase-style=thin|thick] [--milestone=v1|v2]"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - Write
9
+ ---
10
+ <objective>
11
+ Deterministically generate GSD contract docs from the audited specification.
12
+
13
+ **Creates/updates:**
14
+ - `.planning/PROJECT.md` — project context for GSD
15
+ - `.planning/REQUIREMENTS.md` — scoped requirements with FR/NFR IDs
16
+ - `.planning/ROADMAP.md` — phased execution plan
17
+ - `.planning/STATE.md` — project memory and state
18
+
19
+ **Flags:**
20
+ - `--phase-style=thin|thick` — thin phases (1-2 tasks) or thick phases (3-5 tasks)
21
+ - `--milestone=v1|v2` — which milestone scope to compile
22
+
23
+ **Hard gate:**
24
+ - Audit must be PASS before compile can run
25
+ - Contract validator must pass (Section 9 of spec)
26
+
27
+ **After this command:** Review generated contract, then run `/gsd:plan-phase 01`.
28
+ </objective>
29
+
30
+ <process>
31
+ 1. Verify audit stage is PASS by checking `.planning/gswd/STATE.json`.
32
+
33
+ 2. Run the compile workflow:
34
+ ```bash
35
+ node ./bin/gswd-tools.cjs compile $ARGUMENTS
36
+ ```
37
+
38
+ 3. The CLI deterministically transforms spec artifacts into GSD contract format.
39
+
40
+ 4. Display the generated contract summary with phase count and requirement mapping.
41
+
42
+ 5. Show Next Up: review `.planning/PROJECT.md`, `.planning/REQUIREMENTS.md`, `.planning/ROADMAP.md`, `.planning/STATE.md`, then run `/gsd:plan-phase 01`.
43
+ </process>
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: gswd:help
3
+ description: Show available GSWD commands and usage guide
4
+ ---
5
+ <objective>
6
+ Display the complete GSWD command reference.
7
+
8
+ Output ONLY the reference content below. Do NOT add:
9
+ - Project-specific analysis
10
+ - Git status or file context
11
+ - Next-step suggestions
12
+ - Any commentary beyond the reference
13
+ </objective>
14
+
15
+ <process>
16
+ Output the following command reference exactly:
17
+
18
+ ---
19
+
20
+ # GSWD Command Reference
21
+
22
+ **Get Shit Well Done** — front-end system for imagining and specifying before GSD builds.
23
+
24
+ ## Quick Start
25
+
26
+ ```
27
+ /gswd:start # Start here — describe your idea interactively
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ | Command | Description |
33
+ |---------|-------------|
34
+ | `/gswd:start` | Full pipeline: intake -> imagine -> specify -> audit -> compile |
35
+ | `/gswd:status` | Show pipeline status and stage progress |
36
+ | `/gswd:settings` | Configure GSWD workflow settings |
37
+ | `/gswd:help` | Show this reference |
38
+
39
+ ## Advanced Commands
40
+
41
+ | Command | Description |
42
+ |---------|-------------|
43
+ | `/gswd:imagine [@idea.md]` | Validate direction and freeze key decisions |
44
+ | `/gswd:specify` | Build execution-grade spec with traceable IDs |
45
+ | `/gswd:audit-spec` | Audit spec for coverage — produces PASS/FAIL |
46
+ | `/gswd:compile` | Compile spec into GSD contract docs |
47
+
48
+ ## Common Flags
49
+
50
+ | Flag | Available On | Description |
51
+ |------|-------------|-------------|
52
+ | `--auto` | `/gswd:start`, imagine, specify | Auto mode — minimal interruptions |
53
+ | `--resume` | `/gswd:start`, imagine, specify, audit-spec | Resume from last checkpoint |
54
+ | `--skip-research` | `/gswd:start`, imagine | Disable research agents |
55
+ | `--auto-fix` | audit-spec | Auto-fix gaps found during audit |
56
+ | `--phase-style=thin\|thick` | compile | Phase sizing for GSD roadmap |
57
+ | `--policy=<name>` | `/gswd:start` | Auto policy: strict, balanced, aggressive |
58
+
59
+ ## Pipeline Flow
60
+
61
+ ```
62
+ /gswd:imagine → /gswd:specify → /gswd:audit-spec → /gswd:compile
63
+ ↓ ↓ ↓ ↓
64
+ DECISIONS.md SPEC.md AUDIT.md PROJECT.md
65
+ IMAGINE.md JOURNEYS.md (PASS/FAIL) REQUIREMENTS.md
66
+ ICP.md ARCHITECTURE.md ROADMAP.md
67
+ GTM.md INTEGRATIONS.md STATE.md
68
+ COMPETITION.md NFR.md
69
+ ```
70
+
71
+ ## After GSWD
72
+
73
+ Once compile is done, hand off to GSD:
74
+ ```
75
+ /gsd:plan-phase 01
76
+ ```
77
+
78
+ ---
79
+ </process>
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: gswd:imagine
3
+ description: Validate product direction and freeze key decisions
4
+ argument-hint: "[--auto] [--resume] [--skip-research] [@idea.md]"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - Write
9
+ - AskUserQuestion
10
+ - Task
11
+ ---
12
+ <objective>
13
+ Turn a fuzzy product idea into a validated direction with frozen decisions.
14
+
15
+ **Creates/updates:**
16
+ - `.planning/IMAGINE.md` — product vision and direction
17
+ - `.planning/ICP.md` — ideal customer profile
18
+ - `.planning/GTM.md` — go-to-market strategy
19
+ - `.planning/COMPETITION.md` — competitive landscape
20
+ - `.planning/DECISIONS.md` — frozen decisions, success metrics, risks
21
+
22
+ **Hard gate to complete:**
23
+ - `.planning/DECISIONS.md` must include:
24
+ - **Frozen Decisions** (>= 8)
25
+ - **Success Metrics** (1-3)
26
+ - **Out of Scope**
27
+ - **Risks & Mitigations** (>= 5)
28
+
29
+ **Flags:**
30
+ - `--auto` — apply auto policy for decision-making
31
+ - `--resume` — continue from last checkpoint
32
+ - `--skip-research` — disable research agents (faster, offline-friendly)
33
+
34
+ **After this command:** Run `/gswd:specify` to build the execution-grade spec.
35
+ </objective>
36
+
37
+ <process>
38
+ 1. Ensure GSWD is initialized. If `.planning/gswd/STATE.json` does not exist, run init first.
39
+
40
+ 2. Run the imagine workflow:
41
+ ```bash
42
+ node ./bin/gswd-tools.cjs imagine $ARGUMENTS
43
+ ```
44
+
45
+ 3. The CLI runs the imagine workflow which may spawn research agents (unless `--skip-research`).
46
+
47
+ 4. Interactive prompts will ask the founder to confirm or override key decisions.
48
+
49
+ 5. Display stage banners, checkpoint progress, and decision summaries as emitted.
50
+
51
+ 6. On completion, show Next Up: `/gswd:specify`
52
+ </process>
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: gswd:settings
3
+ description: Configure GSWD workflow settings interactively
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - AskUserQuestion
9
+ ---
10
+ <objective>
11
+ Interactive editor for `.planning/config.json` under the `gswd` key.
12
+
13
+ **Configurable settings:**
14
+ - `mode` — balanced / strict / aggressive
15
+ - `strict_gates` — enforce hard gates (true/false)
16
+ - `max_parallel_agents` — parallel agent limit (1-8)
17
+ - `external_research` — enable research agents (true/false)
18
+ - `integration_budget_usd_month` — monthly integration budget cap
19
+ - `doc_verbosity` — normal / verbose / minimal
20
+ - `phase_style` — thin / thick
21
+ - `auto.policy` — auto mode policy (strict/balanced/aggressive)
22
+
23
+ **Never overwrites** user config keys outside `gswd`.
24
+ </objective>
25
+
26
+ <process>
27
+ 1. Read current config:
28
+ ```bash
29
+ node ./bin/gswd-tools.cjs config read
30
+ ```
31
+
32
+ 2. Present current settings to the user using AskUserQuestion with the current values as defaults.
33
+
34
+ 3. Ask for each setting group:
35
+ - **Mode & Gates**: mode (balanced/strict/aggressive), strict_gates (on/off)
36
+ - **Agents**: max_parallel_agents, external_research (on/off)
37
+ - **Output**: doc_verbosity (normal/verbose/minimal), phase_style (thin/thick)
38
+ - **Auto Policy**: auto policy (strict/balanced/aggressive), budget, defaults
39
+
40
+ 4. Merge updated settings:
41
+ ```bash
42
+ node ./bin/gswd-tools.cjs config merge --overrides '<json>'
43
+ ```
44
+
45
+ 5. Display confirmation with the updated settings.
46
+ </process>
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: gswd:specify
3
+ description: Build execution-grade spec with traceable IDs
4
+ argument-hint: "[--auto] [--resume] [--integration-budget=<usd>]"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - Write
9
+ - AskUserQuestion
10
+ - Task
11
+ ---
12
+ <objective>
13
+ Turn validated direction into a build-ready, traceable specification.
14
+
15
+ **Creates/updates:**
16
+ - `.planning/SPEC.md` — full product specification
17
+ - `.planning/JOURNEYS.md` — user journeys (J-001, J-002, ...)
18
+ - `.planning/ARCHITECTURE.md` — system architecture and components
19
+ - `.planning/INTEGRATIONS.md` — external integrations
20
+ - `.planning/NFR.md` — non-functional requirements
21
+
22
+ **Hard gate to complete:**
23
+ - `J-*`, `FR-*`, `NFR-*` IDs exist and are cross-linked
24
+ - Each journey has: preconditions, steps, success outcome, failure modes (>= 2), acceptance tests (>= 1), linked FR + NFR
25
+
26
+ **Flags:**
27
+ - `--auto` — apply auto policy for decision-making
28
+ - `--resume` — continue from last checkpoint
29
+ - `--integration-budget=<usd>` — monthly integration budget cap
30
+
31
+ **After this command:** Run `/gswd:audit-spec` to validate coverage.
32
+ </objective>
33
+
34
+ <process>
35
+ 1. Verify imagine stage is complete by checking `.planning/gswd/STATE.json`.
36
+
37
+ 2. Run the specify workflow:
38
+ ```bash
39
+ node ./bin/gswd-tools.cjs specify $ARGUMENTS
40
+ ```
41
+
42
+ 3. The CLI builds the spec iteratively, creating journeys and requirements with traceable IDs.
43
+
44
+ 4. Interactive prompts will ask for decisions on architecture, integrations, and priorities.
45
+
46
+ 5. Display progress with ID allocation summaries and cross-link status.
47
+
48
+ 6. On completion, show Next Up: `/gswd:audit-spec`
49
+ </process>
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: gswd:start
3
+ description: Imagine, specify, audit, and compile — from idea to GSD contract
4
+ argument-hint: "[@idea.md]"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - Write
9
+ - AskUserQuestion
10
+ - Task
11
+ ---
12
+
13
+ <objective>
14
+ One command to go from a product idea to a GSD-ready contract.
15
+
16
+ **Pipeline stages (run sequentially):**
17
+ 1. Imagine — validate direction and freeze decisions
18
+ 2. Specify — build execution-grade spec with traceable IDs
19
+ 3. Audit — enforce full coverage (PASS/FAIL)
20
+ 4. Compile — deterministically generate GSD contract docs
21
+
22
+ **Outputs:**
23
+ - Full GSWD bundle (IMAGINE.md, DECISIONS.md, SPEC.md, JOURNEYS.md, etc.)
24
+ - Compiled GSD contract: PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md
25
+
26
+ **Power-user flags (all optional):**
27
+ - `--auto` — apply auto policy for decision-making (minimal interruptions). Requires @idea.md to skip interactive intake.
28
+ - `--policy=<name>` — select named policy: `strict`, `balanced`, `aggressive`
29
+ - `--resume` — continue from last checkpoint in `.planning/gswd/STATE.json`
30
+ - `--skip-research` — disable research agents
31
+
32
+ **Hard gates:**
33
+ - Cannot finish if audit is FAIL
34
+ - In auto mode, cannot finish if policy requires manual approvals and they are not present
35
+ </objective>
36
+
37
+ <process>
38
+
39
+ ## Step 1 — Initialize (silently)
40
+
41
+ Run init via Bash:
42
+
43
+ ```bash
44
+ node ./bin/gswd-tools.cjs init
45
+ ```
46
+
47
+ Check if `.planning/gswd/STATE.json` existed before this call. If STATE.json did not already exist (i.e., this is the first run), show one line: "Initialized GSWD for <project-name>" where project-name is derived from the current directory basename (e.g., `basename $PWD`). If STATE.json already existed, say nothing — initialization is silent.
48
+
49
+ The init call is idempotent and safe to run regardless of existing state.
50
+
51
+ ## Step 2 — Check for existing state
52
+
53
+ Read `.planning/gswd/STATE.json` using the Read tool. Branch on the `stage` field:
54
+
55
+ - If `stage` is not `done` and not `init` (work is in progress): ask the user "Resume from [stage]? [yes / start fresh]"
56
+ - If yes: add `--resume` to the bootstrap call arguments assembled in Step 4
57
+ - If start fresh: proceed without `--resume`
58
+ - If `stage` is `done` (pipeline already completed): ask the user "You already have a completed spec. Start fresh or resume?"
59
+ - If resume: add `--resume` to the bootstrap arguments
60
+ - If fresh: proceed without `--resume`
61
+ - If `stage` is `init` or STATE.json was just created by Step 1: proceed directly to Step 3 (no resume prompt)
62
+
63
+ ## Step 3 — Collect idea
64
+
65
+ **Path A — Idea file provided in $ARGUMENTS**
66
+
67
+ Detect Path A if $ARGUMENTS contains any word starting with `@` OR a path ending in `.md`.
68
+
69
+ 1. Read the idea file content using the Read tool
70
+ 2. Summarize the idea in 2-3 sentences
71
+ 3. Ask: "Did I get that right? [yes / edit]"
72
+ 4. If the user chooses edit: let them revise, then re-summarize and re-confirm
73
+ 5. Once confirmed, proceed to Step 4
74
+
75
+ **Path B — No file provided in $ARGUMENTS**
76
+
77
+ 1. Ask the user (via conversation, not AskUserQuestion tool): "Describe your product idea — include what it does, who it's for, and what makes now the right time to build it."
78
+ - The intake prompt should feel like one natural question, not a form. The hints guide but don't constrain.
79
+ - For partial or vague descriptions: use judgment — either ask a brief follow-up or proceed with what's given.
80
+ 2. After the user responds, summarize their response in 2-3 sentences
81
+ 3. Ask: "Did I get that right? [yes / edit]"
82
+ 4. If the user chooses edit: let them revise, then re-summarize and re-confirm
83
+ 5. Once confirmed, write the confirmed summary to `.planning/gswd/intake.md` using the Write tool so it can be passed to the bootstrap CLI:
84
+
85
+ ```
86
+ # Idea
87
+
88
+ <confirmed summary here>
89
+ ```
90
+
91
+ 6. Proceed to Step 4
92
+
93
+ Note: "Did I get that right?" is the key moment — it is the last manual touchpoint before automated stages run.
94
+
95
+ ## Step 4 — Run the bootstrap pipeline
96
+
97
+ Assemble the CLI command:
98
+
99
+ - Base: `node ./bin/gswd-tools.cjs bootstrap`
100
+ - If Path A: append the original `$ARGUMENTS` (contains the file path and any flags as-is)
101
+ - If Path B: append `@.planning/gswd/intake.md` as the idea file argument, then append any flags from `$ARGUMENTS` that are NOT file paths (e.g., `--skip-research`, `--policy=balanced`)
102
+ - If `--auto` is in `$ARGUMENTS` but no file was provided (Path B): note that `--auto` applies to pipeline stages after intake; proceed with interactive intake first, then pass `--auto` to the bootstrap call along with the intake.md path
103
+ - If `--resume` was added in Step 2: include it in the arguments
104
+
105
+ Run the assembled command via Bash:
106
+
107
+ ```bash
108
+ node ./bin/gswd-tools.cjs bootstrap <assembled arguments>
109
+ ```
110
+
111
+ ## Step 5 — Show pipeline progress
112
+
113
+ Display stage banners, checkpoint boxes, and output as the CLI emits them.
114
+
115
+ ## Step 6 — On completion
116
+
117
+ Show the Next Up block with generated artifacts and suggest running `/gsd:plan-phase 01`.
118
+
119
+ ## Step 7 — On failure
120
+
121
+ If any stage fails (especially audit), display the failure reason and suggest remediation before retrying.
122
+
123
+ </process>
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: gswd:status
3
+ description: Show GSWD pipeline status and stage progress
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ ---
8
+ <objective>
9
+ Display the current GSWD pipeline status.
10
+
11
+ **Shows:**
12
+ - Stage status: IMAGINE / SPECIFY / AUDIT / COMPILE — each with not_started / in_progress / done / pass / fail
13
+ - Last run timestamp
14
+ - Quick links to key docs
15
+ - Current auto mode and policy settings
16
+
17
+ This is a read-only command that never modifies state.
18
+ </objective>
19
+
20
+ <process>
21
+ 1. Run the status command:
22
+ ```bash
23
+ node ./bin/gswd-tools.cjs status
24
+ ```
25
+
26
+ 2. Display the CLI output directly to the user.
27
+
28
+ 3. If `.planning/gswd/STATE.json` does not exist, suggest running `/gswd:start` first.
29
+ </process>
package/lib/bootstrap.ts CHANGED
@@ -17,6 +17,7 @@ import * as fs from 'node:fs';
17
17
  import * as path from 'node:path';
18
18
 
19
19
  import { initState, readState, writeState, writeCheckpoint } from './state.js';
20
+ import type { StageStatus } from './state.js';
20
21
  import { getGswdConfig } from './config.js';
21
22
  import type { GswdConfig } from './config.js';
22
23
  import { renderBanner, renderCheckpoint, renderNextUp } from './render.js';
@@ -287,7 +288,7 @@ export function validateStageArtifacts(
287
288
  */
288
289
  export function shouldSkipStage(
289
290
  stage: BootstrapStage,
290
- state: { stage_status: Record<string, string> },
291
+ state: { stage_status: StageStatus | Record<string, string> },
291
292
  planningDir: string,
292
293
  resume: boolean
293
294
  ): boolean {
package/lib/imagine.ts CHANGED
@@ -301,13 +301,11 @@ export async function runImagine(options: ImagineOptions): Promise<ImagineResult
301
301
  };
302
302
  }
303
303
  // Allocate ID ranges for imagine agents before spawning (FNDN-05)
304
- if (spawnFn) {
305
- try {
306
- allocateIdRange(statePath, 'J', 'journey-mapper', 50);
307
- allocateIdRange(statePath, 'FR', 'market-researcher', 50);
308
- } catch {
309
- // Non-fatal — ID allocation failure should not block imagine
310
- }
304
+ try {
305
+ allocateIdRange(statePath, 'J', 'journey-mapper', 50);
306
+ allocateIdRange(statePath, 'FR', 'market-researcher', 50);
307
+ } catch {
308
+ // Non-fatal — ID allocation failure should not block imagine
311
309
  }
312
310
  agentResults = await orchestrateAgents(
313
311
  IMAGINE_AGENTS,
package/lib/state.ts CHANGED
@@ -207,7 +207,7 @@ export function updateStageStatus(
207
207
  if (!state) {
208
208
  throw new Error(`Cannot read STATE.json at ${statePath}`);
209
209
  }
210
- (state.stage_status as Record<string, string>)[stage] = status;
210
+ (state.stage_status as unknown as Record<string, string>)[stage] = status;
211
211
  writeState(statePath, state);
212
212
  }
213
213
 
package/package.json CHANGED
@@ -1,22 +1,25 @@
1
1
  {
2
2
  "name": "gswd",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "type": "commonjs",
5
5
  "description": "Get Shit Well Done — CLI meta-prompting and spec-generation system",
6
6
  "bin": {
7
7
  "gswd": "./bin/gswd-tools.cjs",
8
- "gswd-tools": "./bin/gswd-tools.cjs"
8
+ "gswd-tools": "./bin/gswd-tools.cjs",
9
+ "gswd-install": "./bin/install.js"
9
10
  },
10
11
  "files": [
11
12
  "bin/",
12
13
  "lib/",
13
14
  "templates/",
14
- "agents/"
15
+ "agents/",
16
+ "commands/"
15
17
  ],
16
18
  "scripts": {
17
19
  "test": "node --import tsx --test tests/*.test.ts",
18
20
  "test:cjs": "node --test tests/*.test.cjs",
19
- "build": "tsc"
21
+ "build": "tsc",
22
+ "prepublishOnly": "npm test && npm run build"
20
23
  },
21
24
  "devDependencies": {
22
25
  "typescript": "^5.7.0",