gsdd-cli 0.3.1 → 0.16.1

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 (43) hide show
  1. package/README.md +44 -29
  2. package/agents/DISTILLATION.md +15 -13
  3. package/agents/planner.md +2 -0
  4. package/bin/adapters/agents.mjs +1 -0
  5. package/bin/adapters/claude.mjs +12 -3
  6. package/bin/adapters/codex.mjs +4 -0
  7. package/bin/adapters/opencode.mjs +13 -4
  8. package/bin/gsdd.mjs +20 -5
  9. package/bin/lib/cli-utils.mjs +1 -1
  10. package/bin/lib/file-ops.mjs +161 -0
  11. package/bin/lib/health-truth.mjs +188 -0
  12. package/bin/lib/health.mjs +65 -12
  13. package/bin/lib/init-flow.mjs +50 -3
  14. package/bin/lib/init-prompts.mjs +22 -83
  15. package/bin/lib/init-runtime.mjs +9 -7
  16. package/bin/lib/init.mjs +5 -1
  17. package/bin/lib/models.mjs +19 -4
  18. package/bin/lib/phase.mjs +100 -14
  19. package/bin/lib/plan-constants.mjs +30 -0
  20. package/bin/lib/provenance.mjs +146 -0
  21. package/bin/lib/templates.mjs +17 -0
  22. package/distilled/DESIGN.md +345 -47
  23. package/distilled/EVIDENCE-INDEX.md +297 -0
  24. package/distilled/README.md +44 -20
  25. package/distilled/SKILL.md +89 -85
  26. package/distilled/templates/agents.block.md +13 -84
  27. package/distilled/templates/agents.md +0 -7
  28. package/distilled/templates/delegates/plan-checker.md +6 -3
  29. package/distilled/workflows/audit-milestone.md +6 -6
  30. package/distilled/workflows/complete-milestone.md +297 -0
  31. package/distilled/workflows/execute.md +188 -19
  32. package/distilled/workflows/map-codebase.md +5 -3
  33. package/distilled/workflows/new-milestone.md +249 -0
  34. package/distilled/workflows/new-project.md +5 -6
  35. package/distilled/workflows/pause.md +40 -6
  36. package/distilled/workflows/plan-milestone-gaps.md +183 -0
  37. package/distilled/workflows/plan.md +75 -11
  38. package/distilled/workflows/progress.md +42 -19
  39. package/distilled/workflows/quick.md +14 -10
  40. package/distilled/workflows/resume.md +121 -11
  41. package/distilled/workflows/verify-work.md +260 -0
  42. package/distilled/workflows/verify.md +124 -33
  43. package/package.json +7 -5
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
1
  <div align="center">
2
2
 
3
- # GSD Distilled
3
+ # Northline
4
4
 
5
- **A portable, spec-driven development kernel for AI coding agents.**
5
+ **A repo-native workflow kernel for long-horizon AI software delivery.**
6
6
 
7
- Extracted from [Get Shit Done](https://github.com/gsd-build/get-shit-done). Same long-horizon delivery spine fewer moving parts.
7
+ Northline gives long-horizon AI-assisted software work one repo-native planning, execution, verification, and handoff spine so progress survives runtime switching and session loss. The package and CLI remain `gsdd-cli` / `gsdd`.
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/gsdd-cli?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/gsdd-cli)
10
10
  [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
11
- [![Tests](https://img.shields.io/badge/assertions-862_passing-brightgreen?style=for-the-badge)](tests/)
12
11
 
13
12
  ```bash
14
13
  npx gsdd-cli init
15
14
  ```
16
15
 
17
- **Works with Claude Code, OpenCode, Codex CLI, Cursor, Copilot, and Gemini CLI.**
16
+ **Directly validated today:** Claude Code, Codex CLI, and OpenCode.
17
+ **Qualified support:** Cursor, Copilot, and Gemini CLI use the same portable skill surfaces, but this launch does not present them as parity-validated runtimes.
18
18
 
19
19
  </div>
20
20
 
@@ -22,7 +22,11 @@ npx gsdd-cli init
22
22
 
23
23
  ## What This Is
24
24
 
25
- GSDD is a distilled fork of GSD. It preserves the high-leverage parts of long-horizon AI-assisted development:
25
+ Northline gives serious AI-assisted software work one repo-native planning, execution, verification, and handoff spine so progress survives long horizons, runtime switching, and session loss without turning into a dashboard or orchestration control plane.
26
+
27
+ The current package and CLI stay `gsdd-cli` and `gsdd`. Northline is the public product brand layered on top of that stable install surface.
28
+
29
+ It preserves the high-leverage parts of long-horizon AI-assisted development:
26
30
 
27
31
  - **Persistent artifacts** — SPEC.md, ROADMAP.md, and config.json as the durable workspace
28
32
  - **Codebase mapping** — 4 parallel mappers produce STACK, ARCHITECTURE, CONVENTIONS, CONCERNS
@@ -32,9 +36,9 @@ GSDD is a distilled fork of GSD. It preserves the high-leverage parts of long-ho
32
36
  - **Milestone audit** — cross-phase integration, requirements coverage, E2E flows
33
37
  - **Session management** — pause work with checkpoint, resume with context restoration and routing
34
38
 
35
- What it strips: GSD's broader operator surface (32 workflows, 11 agents, discovery modes, sprint ceremony, a settings flow, and additional operator ergonomics). GSDD has 10 workflows and 10 roles.
39
+ What it strips: GSD's broader operator surface (32 workflows, 11 agents, discovery modes, sprint ceremony, a settings flow, and additional operator ergonomics). Northline keeps 14 workflows and 10 roles.
36
40
 
37
- **Target user:** Developer or small team that wants a spec-driven long-horizon kernel, not full operator comfort.
41
+ **Target user:** Developer or small team that wants a repo-native, spec-driven workflow kernel with durable proof and handoff, not a dashboard or orchestration control plane.
38
42
 
39
43
  ---
40
44
 
@@ -60,6 +64,11 @@ In a terminal, `gsdd init` now opens a guided install wizard:
60
64
 
61
65
  Portable `.agents/skills/gsdd-*` skills are always generated. The wizard controls extra native adapters and optional governance, not the portable baseline.
62
66
 
67
+ ### Launch Proof Status
68
+
69
+ - **Directly validated in this repo:** Claude Code, Codex CLI, and OpenCode have recorded `plan -> execute -> verify` evidence for the core lifecycle.
70
+ - **Qualified support:** Cursor, Copilot, and Gemini CLI use the shared `.agents/skills/` surface plus optional governance, but this launch does not describe them as equally proven native runtimes.
71
+
63
72
  ### Quickstart (after init)
64
73
 
65
74
  Your tool determines how you invoke workflows:
@@ -86,14 +95,14 @@ npx gsdd-cli init --tools cursor # Backward-compatible AGENTS.md governance
86
95
  npx gsdd-cli init --tools all # All of the above
87
96
  ```
88
97
 
89
- | Platform | Tier | What's generated |
90
- |----------|------|-----------------|
91
- | **All** (default) | Open standard | `.agents/skills/gsdd-*/SKILL.md` — portable workflow entrypoints (always generated) |
92
- | **Claude Code** | Native | `.claude/skills/`, `.claude/commands/`, `.claude/agents/` — slash commands work immediately |
93
- | **OpenCode** | Native | `.opencode/commands/`, `.opencode/agents/` — slash commands work immediately |
94
- | **Codex CLI** | Native | `.codex/agents/gsdd-plan-checker.toml` — skill reference `$gsdd-plan` works immediately |
95
- | **Cursor / Copilot / Gemini** | Skills-native runtime + optional governance | Native slash-command discovery from `.agents/skills/`; optional root `AGENTS.md` block adds behavioral governance |
96
- | **Other AI tools** | Open standard fallback | Open `.agents/skills/gsdd-*/SKILL.md` directly |
98
+ | Platform | Public claim | What's generated |
99
+ |----------|--------------|-----------------|
100
+ | **All** (default) | Shared portable surface | `.agents/skills/gsdd-*/SKILL.md` — portable workflow entrypoints (always generated) |
101
+ | **Claude Code** | Directly validated | `.claude/skills/`, `.claude/commands/`, `.claude/agents/` — native workflow surfaces |
102
+ | **OpenCode** | Directly validated | `.opencode/commands/`, `.opencode/agents/` — native workflow surfaces |
103
+ | **Codex CLI** | Directly validated | Portable skill entry plus `.codex/agents/gsdd-plan-checker.toml` |
104
+ | **Cursor / Copilot / Gemini** | Qualified support | Skills-native discovery from `.agents/skills/`; optional root `AGENTS.md` block adds behavioral governance |
105
+ | **Other AI tools** | Fallback only | Open `.agents/skills/gsdd-*/SKILL.md` directly |
97
106
 
98
107
  ### Updating
99
108
 
@@ -225,7 +234,7 @@ Use for: bug fixes, small features, config changes, one-off tasks.
225
234
 
226
235
  ## Workflows
227
236
 
228
- GSDD has 10 workflows, run via generated skills or adapters:
237
+ GSDD has 14 workflows, run via generated skills or adapters:
229
238
 
230
239
  | Workflow | What it does |
231
240
  |----------|--------------|
@@ -234,7 +243,11 @@ GSDD has 10 workflows, run via generated skills or adapters:
234
243
  | `gsdd-plan` | Research + plan + check for a phase |
235
244
  | `gsdd-execute` | Execute phase plan: implement tasks, verify changes |
236
245
  | `gsdd-verify` | Verify completed phase: 3-level checks, anti-pattern scan |
246
+ | `gsdd-verify-work` | Conversational UAT testing: validate user-facing behavior with structured gap tracking |
237
247
  | `gsdd-audit-milestone` | Audit milestone: cross-phase integration, requirements coverage, E2E flows |
248
+ | `gsdd-complete-milestone` | Archive shipped milestone, evolve spec, collapse roadmap |
249
+ | `gsdd-new-milestone` | Start next milestone: gather goals, define requirements, create roadmap phases |
250
+ | `gsdd-plan-milestone-gaps` | Create gap-closure phases from audit results |
238
251
  | `gsdd-quick` | Quick task: plan and execute sub-hour work outside the phase cycle |
239
252
  | `gsdd-pause` | Pause work: save session context to checkpoint for seamless resumption |
240
253
  | `gsdd-resume` | Resume work: restore context from artifacts and route to next action |
@@ -257,7 +270,9 @@ Workflows are agent skills or commands, not plain shell utilities. How you invok
257
270
  | `gsdd init [--tools <platform>]` | Set up `.planning/`, generate adapters |
258
271
  | `gsdd update [--tools <platform>] [--templates]` | Regenerate adapters; `--templates` refreshes `.planning/templates/` and role contracts |
259
272
  | `gsdd health [--json]` | Check workspace integrity (healthy/degraded/broken) |
273
+ | `gsdd file-op <copy\|delete\|regex-sub>` | Run deterministic workspace-confined file copy, delete, and regex substitution |
260
274
  | `gsdd find-phase [N]` | Show phase info as JSON (for agent consumption) |
275
+ | `gsdd phase-status <N> <status>` | Update a single ROADMAP phase status through the status-aware helper |
261
276
  | `gsdd verify <N>` | Run artifact checks for phase N |
262
277
  | `gsdd scaffold phase <N> [name]` | Create a new phase plan file |
263
278
  | `gsdd models [show\|profile\|set\|...]` | Inspect and manage model profile propagation |
@@ -294,13 +309,13 @@ GSDD consolidates GSD's agent surface into 10 roles with durable contracts:
294
309
 
295
310
  GSDD generates vendor-specific files from vendor-agnostic markdown — it does not convert from one vendor format to another. This means every adapter gets first-class output shaped to its platform's native capabilities.
296
311
 
297
- | Adapter | Kind | Strategy |
298
- |---------|------|----------|
299
- | **Claude Code** | `native_capable` adapter + skills-native runtime | Skill-primary plan surface (stays in main context to spawn checker subagent), thin command alias, native `gsdd-plan-checker` agent |
300
- | **OpenCode** | `native_capable` adapter + skills-native runtime | Specialized `/gsdd-plan` command (`subtask: false`), hidden `gsdd-plan-checker` subagent (`mode: subagent`) |
301
- | **Codex CLI** | `native_capable` adapter + skills-native runtime | Portable skill as entry surface, `.codex/agents/gsdd-plan-checker.toml` (read-only, high reasoning effort) |
302
- | **Cursor / Copilot / Gemini** | skills-native runtime + `governance_only` adapter | Runtime discovers `.agents/skills/` natively; optional root `AGENTS.md` block adds behavioral governance only |
303
- | **agents** (`--tools agents`) | `governance_only` adapter | Root `AGENTS.md` block for tools that benefit from governance or need open-standard fallback guidance |
312
+ | Adapter | Evidence posture | Strategy |
313
+ |---------|------------------|----------|
314
+ | **Claude Code** | Directly validated | Skill-primary plan surface, thin command alias, native `gsdd-plan-checker` agent |
315
+ | **OpenCode** | Directly validated | Specialized `/gsdd-plan` command (`subtask: false`), hidden `gsdd-plan-checker` subagent (`mode: subagent`) |
316
+ | **Codex CLI** | Directly validated | Portable skill as entry surface, `.codex/agents/gsdd-plan-checker.toml` (read-only, high reasoning effort) |
317
+ | **Cursor / Copilot / Gemini** | Qualified support | Runtime discovers `.agents/skills/` natively; optional root `AGENTS.md` block adds behavioral governance only |
318
+ | **agents** (`--tools agents`) | Governance-only helper | Root `AGENTS.md` block for tools that benefit from governance or need open-standard fallback guidance |
304
319
 
305
320
  All adapters render the plan-checker from a single source (`distilled/templates/delegates/plan-checker.md`). Each adapter shapes the output to its platform's native mechanics, and the portable skill remains the shared workflow source.
306
321
 
@@ -428,7 +443,7 @@ For detailed troubleshooting and recovery procedures, see the [User Guide](docs/
428
443
 
429
444
  ## Design Decisions
430
445
 
431
- GSDD makes 36 documented design decisions relative to GSD, each with evidence from source files and external research. See [`distilled/DESIGN.md`](distilled/DESIGN.md) for the full rationale.
446
+ GSDD makes 39 documented design decisions relative to GSD, each with evidence from source files and external research. See [`distilled/DESIGN.md`](distilled/DESIGN.md) for the full rationale.
432
447
 
433
448
  Key choices:
434
449
  - **4-file codebase standard** — drop state that rots (STRUCTURE, INTEGRATIONS, TESTING), keep rules that don't
@@ -446,7 +461,7 @@ Key choices:
446
461
 
447
462
  ## Testing
448
463
 
449
- GSDD has 862 structural assertions across 9 test files — 41 named suites that guard properties PRs repeatedly fixed manually. These are not unit tests for application code; they are invariant checks on the specification itself.
464
+ GSDD has 1228 structural assertions across 10 test files — named suites that guard properties PRs repeatedly fixed manually. These are not unit tests for application code; they are invariant checks on the specification itself.
450
465
 
451
466
  ### Invariant Suites (I-series)
452
467
 
@@ -458,7 +473,7 @@ Structural contracts that prevent drift between roles, delegates, workflows, and
458
473
  | **I2** | Role section structure — 10 roles have role def, scope, output format, success criteria |
459
474
  | **I3** | Delegate thinness — no leaked role-contract sections in delegates |
460
475
  | **I3-gate** | New-project approval gates — required human checkpoints present |
461
- | **I4** | Workflow references — 10 workflows, all delegate/role refs resolve |
476
+ | **I4** | Workflow references — 14 workflows, all delegate/role refs resolve |
462
477
  | **I5** | Session management — no vendor APIs, no STATE.md, checkpoint contract |
463
478
  | **I5b** | Session workflow scope boundaries |
464
479
  | **I6** | Artifact schema definitions |
@@ -518,7 +533,7 @@ Golden-path eval tests that verify artifact-chain contracts across end-to-end wo
518
533
  | Health | Pre-init guard, all check categories, verdict logic, JSON/human output |
519
534
 
520
535
  ```bash
521
- npm run test:gsdd
536
+ npm test
522
537
  ```
523
538
 
524
539
  ---
@@ -529,7 +544,7 @@ GSDD is a distilled fork of [Get Shit Done](https://github.com/gsd-build/get-shi
529
544
 
530
545
  **What GSDD preserves** (~76% of core method): the long-horizon delivery spine — persistent artifacts, codebase mapping, scoped planning, execution, verification, and milestone auditing.
531
546
 
532
- **What GSDD does not cover** (~44% of full upstream surface): GSD currently exposes 32 workflow files and 11 agent files including discovery modes, a settings flow, extra operator ergonomics, and broader session-management/control-plane surface area. GSDD intentionally does not recreate this full surface.
547
+ **What GSDD does not cover** (~44% of full upstream surface): GSD currently exposes 32 workflow files and 11 agent files including discovery modes, a settings flow, extra operator ergonomics, and broader session-management surface area. GSDD intentionally does not recreate this full surface.
533
548
 
534
549
  **The trade-off:** Fewer moving parts for the human operator. Cleaner role contracts and a simpler artifact model. But reduced operator comfort and limited control-plane features (no telemetry, no artifact linting). Health diagnostics are available via `gsdd health`.
535
550
 
@@ -356,21 +356,23 @@ Do not add speculative content. Every entry must reference actual source files a
356
356
 
357
357
  Cross-source best practices applied to GSDD role contracts, audited against 6 external resources. These principles govern how role contracts should be written and revised. Ranked by impact.
358
358
 
359
+ > **Source note:** "Anthropic CE" in this section refers to Anthropic's "Building effective agents" (Dec 2024) for orchestration and sub-agent patterns, and LangChain's "Context Engineering for Agents" (2025) for Write/Select/Compress/Isolate context management patterns. They are cited separately where attribution is precise.
360
+
359
361
  ### Architecture-Level (highest leverage)
360
362
 
361
363
  | Principle | What It Means | Source | GSDD Implementation |
362
364
  |-----------|--------------|--------|---------------------|
363
- | **Context isolation** | Research and heavy reads go in subagents; only compressed summaries enter the main context | Anthropic CE: "sub-agents perform deep technical work, returning condensed summaries" | Approach explorer research subagents return ~1000-token summaries; plan-checker runs in fresh context |
364
- | **JIT context loading** | Never say "read everything." Specify what to extract from each file | Anthropic CE: "maintain lightweight identifiers and use these references to dynamically load data into context at runtime" | `<input_contract>` with extraction guidance: "From SPEC.md read ONLY locked decisions" |
365
- | **Intermediate persistence** | For long interactions, write confirmed state to disk incrementally | Anthropic CE: "Agent regularly writes notes persisted to memory outside of the context window" | Approach explorer writes decisions to disk as they're confirmed during conversation |
366
- | **Progressive disclosure** | Don't front-load all context; let agents discover incrementally | Anthropic CE: "agents can assemble understanding layer by layer" | Gray areas presented individually; research loaded per area on demand |
365
+ | **Context isolation** | Research and heavy reads go in subagents; only compressed summaries enter the main context | Anthropic "Building effective agents" (Dec 2024): orchestrator-worker pattern — sub-agents do deep technical work and return condensed summaries | Approach explorer research subagents return ~1000-token summaries; plan-checker runs in fresh context |
366
+ | **JIT context loading** | Never say "read everything." Specify what to extract from each file | LangChain "Context Engineering for Agents" (2025): Select step of Write/Select/Compress/Isolate load only the specific content needed, not full files | `<input_contract>` with extraction guidance: "From SPEC.md read ONLY locked decisions" |
367
+ | **Intermediate persistence** | For long interactions, write confirmed state to disk incrementally | Anthropic BEA: agent memory outside context window. LangChain CE: Write pattern confirmed state persisted to disk | Approach explorer writes decisions to disk as they're confirmed during conversation |
368
+ | **Progressive disclosure** | Don't front-load all context; let agents discover incrementally | LangChain CE: Compress/Isolate patterns — agents assemble understanding incrementally rather than loading everything upfront | Gray areas presented individually; research loaded per area on demand |
367
369
 
368
370
  ### Prompt Structure (medium leverage)
369
371
 
370
372
  | Principle | What It Means | Source | GSDD Implementation |
371
373
  |-----------|--------------|--------|---------------------|
372
374
  | **XML semantic structure** | Use XML tags to separate role, instructions, examples, inputs, outputs, anti-patterns | Anthropic Claude: "XML tags help Claude parse complex prompts unambiguously" | All roles use `<role>`, most use `<quality_guarantees>`, `<anti_patterns>`. Approach-explorer adds `<algorithm>`, `<examples>`, `<scope_guardrail>` |
373
- | **Anti-patterns early** | Place "don't do this" instructions near the top, after role definition | Anthropic CE: critical information at the beginning gets more attention. NeoLab: early placement for high attention weight | `<anti_patterns>` placed immediately after `<role>` in all roles that have them |
375
+ | **Anti-patterns early** | Place "don't do this" instructions near the top, after role definition | Anthropic Claude prompting docs: critical information at the beginning receives more attention (primacy effect in long-context prompts) | `<anti_patterns>` placed immediately after `<role>` in all roles that have them |
374
376
  | **Few-shot examples** | Show the pattern of interaction, not just output format | Anthropic Claude: "3-5 examples for best results." Examples in `<example>` tags | Approach-explorer: 3 examples. Other roles use inline format examples within algorithm sections |
375
377
  | **Self-check before output** | Run an explicit checklist before producing the final artifact | OpenAI: "verification loops." Anthropic Claude: "Ask Claude to self-check" | Approach-explorer step 7; planner `<plan_self_check>`; executor completion verification |
376
378
  | **Scope boundaries with heuristics** | Don't just list in/out of scope — give the agent a judgment rule | Novel, validated in approach-explorer | "Does this clarify implementation within the phase, or does it add a capability that could be its own phase?" |
@@ -379,7 +381,7 @@ Cross-source best practices applied to GSDD role contracts, audited against 6 ex
379
381
 
380
382
  | Principle | What It Means | Source | GSDD Implementation |
381
383
  |-----------|--------------|--------|---------------------|
382
- | **Authority language: intentional leverage** | Anthropic Claude 4.6 warns "CRITICAL:" can overtrigger on newer models. NeoLab persuasion research found imperative language doubled compliance (33%→72%). GSDD decision: **keep CRITICAL: for mandatory initial-read** — this is a genuine compliance-critical instruction where skipping it causes cascading failures. Use normal language for non-critical instructions. | Anthropic Claude 4.6 vs. NeoLab persuasion research (direct conflict). GSDD sides with NeoLab for this specific use case | `CRITICAL: Mandatory initial read` kept in all 7 roles. `NEVER` kept for security (mapper secret protection). Normal language used for algorithm steps, scope guidance, and quality rules |
384
+ | **Authority language: intentional leverage** | Anthropic Claude warns "CRITICAL:" can overtrigger on newer models. GSDD decision: **keep CRITICAL: for mandatory initial-read** — a genuine compliance-critical instruction where skipping causes cascading failures. Emphasis markers work when rare and specific (signal-to-noise principle: one CRITICAL: in a role contract is a load-bearing gate; ten would be noise). Use normal language for algorithm steps, scope guidance, and quality rules. | Anthropic Claude prompting docs (overtriggering caution) + technical writing signal-to-noise principle. GSDD applies the caution selectively: only compliance-critical context gates use CRITICAL: | `CRITICAL: Mandatory initial read` kept in all 7 roles. `NEVER` kept for security (mapper secret protection). Normal language used for algorithm steps, scope guidance, and quality rules |
383
385
  | **Tell what to do, not just what not to do** | Anti-patterns alone are insufficient; pair with positive instructions | Anthropic Claude: "Tell Claude what to do instead of what not to do" | Every role has both `<anti_patterns>` AND positive algorithm/process sections |
384
386
  | **Context for instructions** | Explain WHY a rule exists so the agent can generalize | Anthropic Claude: "Providing context or motivation behind your instructions helps Claude better understand your goals" | Research quality rules explain WHY: "Training data is a hypothesis. Verify before asserting." |
385
387
 
@@ -394,17 +396,17 @@ These patterns emerged from GSDD's specific needs and were validated through imp
394
396
  | **5-dimension assumption surfacing** | Forces transparency about inferences vs. confirmed facts, with confidence levels | Approach-explorer step 6 |
395
397
  | **Agent's Discretion delegation** | User can explicitly say "you decide" — reduces fatigue on low-stakes choices | Approach-explorer step 4, planner `<approach_decisions>` |
396
398
  | **Domain classification table** | SEE/CALL/RUN/READ/ORGANIZED determines gray area focus per phase type | Approach-explorer step 2 |
397
- | **Degrees of freedom mapping** | Taste=high freedom, technical=low freedom (research-constrained). Maps to NeoLab's concept | Approach-explorer classification system |
399
+ | **Degrees of freedom mapping** | Taste=high freedom, technical=low freedom (research-constrained). GSDD-originated: applies statistical degrees-of-freedom concept to prompt design scope | Approach-explorer classification system |
398
400
 
399
401
  ### Source Ranking
400
402
 
401
403
  Sources are ranked by soundness for agent prompt design. Higher-ranked sources take precedence when sources disagree.
402
404
 
403
- 1. **Anthropic — Effective Context Engineering for AI Agents** — Architecture-level patterns with real production evidence (Claude Code, Pokémon). Most authoritative for context window management, sub-agent design, and information flow.
404
- 2. **AnthropicClaude Prompting Best Practices (Claude 4.6)** — Model-specific, up-to-date. Critical for behavioral warnings (overtriggering, subagent overuse). Supersedes general guidance for Claude-targeted agents.
405
- 3. **OpenAIPrompt Guidance (GPT-5.4)** — Deepest general-purpose reference. Novel concepts: completeness contracts, verification loops, tool persistence rules, empty result recovery. Model-specific but patterns transfer.
406
- 4. **NeoLab Context Engineering Kit** — Good synthesis. "Degrees of Freedom" concept is useful. Persuasion research contradicts Anthropic on authority language (trust Anthropic for Claude).
407
- 5. **OpenAI Cookbook — Meta-Prompting** — Narrow scope: LLM-as-judge evaluation, iterative prompt refinement. Useful technique, not a framework.
405
+ 1. **Anthropic — "Building effective agents" (Dec 2024)** — Agent architecture patterns with production evidence (Claude Code). Most authoritative for orchestrator-worker design, sub-agent fresh context, and task decomposition.
406
+ 2. **LangChain"Context Engineering for Agents" (2025)** — Write/Select/Compress/Isolate framework. Most authoritative for context window management, JIT loading, and information flow patterns.
407
+ 3. **AnthropicClaude Prompting Best Practices (Claude 4.6)** — Model-specific, up-to-date. Critical for behavioral warnings (overtriggering, subagent overuse). Supersedes general guidance for Claude-targeted agents.
408
+ 4. **OpenAI Prompt Guidance (GPT-5.4)** — Deepest general-purpose reference. Novel concepts: completeness contracts, verification loops, tool persistence rules, empty result recovery. Model-specific but patterns transfer.
409
+ 5. **OpenAI Cookbook — Meta-Prompting** — Narrow scope: LLM-as-judge evaluation, iterative prompt refinement. Useful technique, not a framework. See also: Suzgun & Kalai "Meta-Prompting" (2024, arXiv 2401.12954).
408
410
  6. **JBurlison/MetaPrompts** — Structural skeleton (agent/skill/prompt/instruction hierarchy). Minimal actual guidance on prompt quality.
409
411
 
410
412
  ### Key Discrepancy Resolution
@@ -413,7 +415,7 @@ When sources conflict, these resolutions apply:
413
415
 
414
416
  | Conflict | Resolution | Why |
415
417
  |----------|------------|-----|
416
- | Authority language ("YOU MUST" vs. normal) | Keep CRITICAL: for mandatory initial-read (compliance-critical). Use normal language elsewhere | NeoLab's doubled-compliance research applies to instructions where skipping causes cascading failures. Anthropic's overtriggering concern applies to general guidance, not load-bearing context gates |
418
+ | Authority language ("YOU MUST" vs. normal) | Keep CRITICAL: for mandatory initial-read (compliance-critical). Use normal language elsewhere | Emphasis markers work when rare and specific (signal-to-noise). Anthropic's overtriggering concern applies to general guidance; a single CRITICAL: for a mandatory context gate is a load-bearing instruction, not noise |
417
419
  | Example count (2 vs. 3-5) | Target 3+ for conversational agents; inline format examples are sufficient for structured output agents | Anthropic's 3-5 recommendation is general; interactive roles benefit more than output-only roles |
418
420
  | Subagent return size (200 vs. 1000-2000 tokens) | Use 300-500 tokens | Anthropic's 1000-2000 is upper bound; 200 was too tight for structured approach summaries with trade-offs |
419
421
  | "Don't invent alternatives" vs. "try fallback strategies" | Keep "don't invent" for approach research; use fallbacks for information retrieval | These solve different problems: manufacturing fake options is worse than acknowledging one viable path |
package/agents/planner.md CHANGED
@@ -238,6 +238,8 @@ Before returning, self-check against the checker dimensions:
238
238
  5. scope sanity
239
239
  6. must-have quality
240
240
  7. context compliance
241
+ 8. goal achievement
242
+ 9. approach alignment (when APPROACH.md exists)
241
243
 
242
244
  Task completeness rules:
243
245
  - every task has files, action, verify, and done
@@ -6,6 +6,7 @@ function createRootAgentsAdapter({ cwd, renderAgentsBoundedBlock, renderAgentsFi
6
6
  id: 'agents',
7
7
  name,
8
8
  kind: 'governance_only',
9
+ subagentFiles: [],
9
10
  detect() {
10
11
  return false;
11
12
  },
@@ -1,5 +1,10 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
+ import {
4
+ PLAN_CHECK_DIMENSIONS,
5
+ MAX_CHECKER_CYCLES,
6
+ CHECKER_STATUSES,
7
+ } from '../lib/plan-constants.mjs';
3
8
 
4
9
  const CLAUDE_MODEL_PROFILES = {
5
10
  quality: 'opus',
@@ -75,7 +80,7 @@ Execution flow:
75
80
  "summary": "One sentence overall assessment",
76
81
  "issues": [
77
82
  {
78
- "dimension": "requirement_coverage | task_completeness | dependency_correctness | key_link_completeness | scope_sanity | must_have_quality | context_compliance | goal_achievement | approach_alignment",
83
+ "dimension": "${PLAN_CHECK_DIMENSIONS.join(' | ')}",
79
84
  "severity": "blocker | warning",
80
85
  "description": "What is wrong",
81
86
  "plan": "01-PLAN",
@@ -84,10 +89,10 @@ Execution flow:
84
89
  }
85
90
  ]
86
91
  }
87
- Status must be either "passed" or "issues_found".
92
+ Status must be either "${CHECKER_STATUSES[0]}" or "${CHECKER_STATUSES[1]}".
88
93
  9. If the checker returns \`passed\`, finish and summarize.
89
94
  10. If the checker returns \`issues_found\`, revise the existing plan files only where needed, then run the checker again.
90
- 11. Maximum 3 checker cycles total. If blockers remain after cycle 3, stop and escalate to the user instead of pretending the plan is ready.
95
+ 11. Maximum ${MAX_CHECKER_CYCLES} checker cycles total. If blockers remain after cycle ${MAX_CHECKER_CYCLES}, stop and escalate to the user instead of pretending the plan is ready.
91
96
 
92
97
  Return a concise orchestration summary:
93
98
  - target phase
@@ -125,6 +130,10 @@ function createClaudeAdapter({ cwd, workflows, renderSkillContent, getDelegateCo
125
130
  id: 'claude',
126
131
  name: 'claude',
127
132
  kind: 'native_capable',
133
+ subagentFiles: [
134
+ '.claude/agents/gsdd-plan-checker.md',
135
+ '.claude/agents/gsdd-approach-explorer.md',
136
+ ],
128
137
  detect() {
129
138
  return existsSync(join(cwd, 'CLAUDE.md')) || existsSync(join(cwd, '.claude'));
130
139
  },
@@ -44,6 +44,10 @@ function createCodexAdapter({
44
44
  id: 'codex',
45
45
  name: 'codex',
46
46
  kind: 'native_capable',
47
+ subagentFiles: [
48
+ '.codex/agents/gsdd-plan-checker.toml',
49
+ '.codex/agents/gsdd-approach-explorer.toml',
50
+ ],
47
51
  detect() {
48
52
  return existsSync(join(cwd, '.codex'));
49
53
  },
@@ -1,6 +1,11 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
2
2
  import os from 'os';
3
3
  import { join } from 'path';
4
+ import {
5
+ PLAN_CHECK_DIMENSIONS,
6
+ MAX_CHECKER_CYCLES,
7
+ CHECKER_STATUSES,
8
+ } from '../lib/plan-constants.mjs';
4
9
 
5
10
  function expandHome(filePath) {
6
11
  if (!filePath) return filePath;
@@ -115,7 +120,7 @@ function renderOpenCodeApproachExplorer(delegateContent, modelId = null) {
115
120
  const modelLine = modelId ? `model: ${modelId}\n` : '';
116
121
  return `---
117
122
  description: Explores implementation approaches for a phase and aligns with the user through structured questioning before planning begins.
118
- mode: agent
123
+ mode: subagent
119
124
  ${modelLine}tools:
120
125
  bash: false
121
126
  ---
@@ -183,7 +188,7 @@ Execution flow:
183
188
  "summary": "One sentence overall assessment",
184
189
  "issues": [
185
190
  {
186
- "dimension": "requirement_coverage | task_completeness | dependency_correctness | key_link_completeness | scope_sanity | must_have_quality | context_compliance | goal_achievement | approach_alignment",
191
+ "dimension": "${PLAN_CHECK_DIMENSIONS.join(' | ')}",
187
192
  "severity": "blocker | warning",
188
193
  "description": "What is wrong",
189
194
  "plan": "01-PLAN",
@@ -192,10 +197,10 @@ Execution flow:
192
197
  }
193
198
  ]
194
199
  }
195
- Status must be either "passed" or "issues_found".
200
+ Status must be either "${CHECKER_STATUSES[0]}" or "${CHECKER_STATUSES[1]}".
196
201
  9. If the checker returns \`passed\`, finish and summarize.
197
202
  10. If the checker returns \`issues_found\`, revise the existing plan files only where needed, then run the checker again.
198
- 11. Maximum 3 checker cycles total. If blockers remain after cycle 3, stop and escalate to the user instead of pretending the plan is ready.
203
+ 11. Maximum ${MAX_CHECKER_CYCLES} checker cycles total. If blockers remain after cycle ${MAX_CHECKER_CYCLES}, stop and escalate to the user instead of pretending the plan is ready.
199
204
 
200
205
  Return a concise orchestration summary:
201
206
  - target phase
@@ -223,6 +228,10 @@ function createOpenCodeAdapter({
223
228
  id: 'opencode',
224
229
  name: 'opencode',
225
230
  kind: 'native_capable',
231
+ subagentFiles: [
232
+ '.opencode/agents/gsdd-plan-checker.md',
233
+ '.opencode/agents/gsdd-approach-explorer.md',
234
+ ],
226
235
  detect() {
227
236
  return existsSync(join(cwd, '.opencode'));
228
237
  },
package/bin/gsdd.mjs CHANGED
@@ -16,7 +16,8 @@ import {
16
16
  } from './lib/rendering.mjs';
17
17
  import { loadProjectModelConfig, getRuntimeModelOverride, resolveRuntimeAgentModel, cmdModels } from './lib/models.mjs';
18
18
  import { createCmdInit, createCmdUpdate, cmdHelp } from './lib/init.mjs';
19
- import { cmdFindPhase, cmdVerify, cmdScaffold } from './lib/phase.mjs';
19
+ import { cmdFindPhase, cmdVerify, cmdScaffold, cmdPhaseStatus } from './lib/phase.mjs';
20
+ import { cmdFileOp } from './lib/file-ops.mjs';
20
21
  import { createCmdHealth } from './lib/health.mjs';
21
22
 
22
23
  const __filename = fileURLToPath(import.meta.url);
@@ -45,14 +46,18 @@ const WORKFLOWS = [
45
46
  defineWorkflow({ name: 'gsdd-plan', workflow: 'plan.md', description: 'Plan a phase - research check, backward planning, task creation' }),
46
47
  defineWorkflow({ name: 'gsdd-execute', workflow: 'execute.md', description: 'Execute a phase plan - implement tasks, verify changes, follow repo git conventions' }),
47
48
  defineWorkflow({ name: 'gsdd-verify', workflow: 'verify.md', description: 'Verify a completed phase - 3-level checks, anti-pattern scan' }),
49
+ defineWorkflow({ name: 'gsdd-verify-work', workflow: 'verify-work.md', description: 'Conversational UAT testing - validate user-facing behavior with structured gap tracking' }),
48
50
  defineWorkflow({ name: 'gsdd-audit-milestone', workflow: 'audit-milestone.md', description: 'Audit a completed milestone - cross-phase integration, requirements coverage, E2E flows' }),
51
+ defineWorkflow({ name: 'gsdd-complete-milestone', workflow: 'complete-milestone.md', description: 'Complete milestone - archive, evolve spec, collapse roadmap' }),
52
+ defineWorkflow({ name: 'gsdd-new-milestone', workflow: 'new-milestone.md', description: 'New milestone - gather goals, define requirements, create roadmap phases' }),
53
+ defineWorkflow({ name: 'gsdd-plan-milestone-gaps', workflow: 'plan-milestone-gaps.md', description: 'Plan gap closure phases from audit results' }),
49
54
  defineWorkflow({ name: 'gsdd-quick', workflow: 'quick.md', description: 'Quick task - plan and execute a sub-hour task outside the phase cycle' }),
50
55
  defineWorkflow({ name: 'gsdd-pause', workflow: 'pause.md', description: 'Pause work - save session context for seamless resumption' }),
51
56
  defineWorkflow({ name: 'gsdd-resume', workflow: 'resume.md', description: 'Resume work - restore context and route to next action' }),
52
57
  defineWorkflow({ name: 'gsdd-progress', workflow: 'progress.md', description: 'Check progress - show project status and route to next action', mutatesArtifacts: false }),
53
58
  ];
54
59
 
55
- const FRAMEWORK_VERSION = 'v1.2';
60
+ const FRAMEWORK_VERSION = 'v1.3';
56
61
 
57
62
  function createCliContext(cwd = process.cwd()) {
58
63
  return {
@@ -89,24 +94,34 @@ const COMMANDS = {
89
94
  update: cmdUpdate,
90
95
  models: cmdModels,
91
96
  health: cmdHealth,
97
+ 'file-op': cmdFileOp,
92
98
  'find-phase': cmdFindPhase,
99
+ 'phase-status': cmdPhaseStatus,
93
100
  verify: cmdVerify,
94
101
  scaffold: cmdScaffold,
95
102
  help: cmdHelp,
96
103
  };
97
104
 
98
- async function runCli(cliCommand = command, cliArgs = args) {
105
+ async function runCli(cliCommand = command, ...cliArgs) {
106
+ const normalizedArgs = cliArgs.length === 0
107
+ ? args
108
+ : cliArgs.length === 1 && Array.isArray(cliArgs[0])
109
+ ? cliArgs[0]
110
+ : cliArgs;
111
+
112
+ process.exitCode = 0;
113
+
99
114
  if (!cliCommand || !COMMANDS[cliCommand]) {
100
115
  cmdHelp();
101
116
  if (cliCommand) process.exitCode = 1;
102
117
  return;
103
118
  }
104
119
 
105
- await COMMANDS[cliCommand](...cliArgs);
120
+ await COMMANDS[cliCommand](...normalizedArgs);
106
121
  }
107
122
 
108
123
  if (IS_MAIN) {
109
124
  await runCli();
110
125
  }
111
126
 
112
- export { cmdHelp, cmdInit, cmdUpdate, cmdModels, cmdHealth, cmdFindPhase, cmdVerify, cmdScaffold, runCli, FRAMEWORK_VERSION, createCliContext };
127
+ export { cmdHelp, cmdInit, cmdUpdate, cmdModels, cmdHealth, cmdFileOp, cmdFindPhase, cmdPhaseStatus, cmdVerify, cmdScaffold, runCli, FRAMEWORK_VERSION, createCliContext };
@@ -15,7 +15,7 @@ export function parseFlagValue(flagArgs, flagName) {
15
15
  export function parseToolsFlag(flagArgs) {
16
16
  const { value } = parseFlagValue(flagArgs, '--tools');
17
17
  if (!value) return [];
18
- if (value === 'all') return ['claude', 'opencode', 'codex', 'agents'];
18
+ if (value === 'all') return ['claude', 'opencode', 'codex', 'agents', 'cursor', 'copilot', 'gemini'];
19
19
  return value.split(',').map((v) => v.trim()).filter(Boolean);
20
20
  }
21
21
 
@@ -0,0 +1,161 @@
1
+ import { cpSync, existsSync, mkdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from 'fs';
2
+ import { dirname, isAbsolute, relative, resolve } from 'path';
3
+ import { output, parseFlagValue } from './cli-utils.mjs';
4
+
5
+ class FileOpError extends Error {}
6
+
7
+ function fail(message) {
8
+ console.error(message);
9
+ throw new FileOpError(message);
10
+ }
11
+
12
+ function resolveWorkspacePath(cwd, target) {
13
+ const workspaceRoot = resolve(cwd);
14
+ const resolved = resolve(workspaceRoot, target);
15
+ const rel = relative(workspaceRoot, resolved);
16
+
17
+ if (rel === '' || (!rel.startsWith('..') && !isAbsolute(rel))) {
18
+ return resolved;
19
+ }
20
+
21
+ fail(`Path must stay inside the workspace: ${target}`);
22
+ }
23
+
24
+ function getMissingBehavior(args) {
25
+ const parsed = parseFlagValue(args, '--missing');
26
+ if (!parsed.present) return 'error';
27
+ if (parsed.invalid) fail('Usage: --missing <error|ok>');
28
+ if (!['error', 'ok'].includes(parsed.value)) fail('Usage: --missing <error|ok>');
29
+ return parsed.value;
30
+ }
31
+
32
+ function cmdCopy(cwd, args) {
33
+ const [sourceArg, destinationArg, ...flags] = args;
34
+ if (!sourceArg || !destinationArg) {
35
+ fail('Usage: gsdd file-op copy <source> <destination> [--missing <error|ok>]');
36
+ }
37
+
38
+ const missingBehavior = getMissingBehavior(flags);
39
+ const source = resolveWorkspacePath(cwd, sourceArg);
40
+ const destination = resolveWorkspacePath(cwd, destinationArg);
41
+
42
+ if (!existsSync(source)) {
43
+ if (missingBehavior === 'ok') {
44
+ output({ operation: 'copy', source: sourceArg, destination: destinationArg, changed: false, reason: 'missing_source' });
45
+ return;
46
+ }
47
+ fail(`Source file does not exist: ${sourceArg}`);
48
+ }
49
+
50
+ if (statSync(source).isDirectory()) {
51
+ fail(`Copy only supports files in this phase: ${sourceArg}`);
52
+ }
53
+
54
+ mkdirSync(dirname(destination), { recursive: true });
55
+ cpSync(source, destination, { force: true });
56
+ output({ operation: 'copy', source: sourceArg, destination: destinationArg, changed: true });
57
+ }
58
+
59
+ function cmdDelete(cwd, args) {
60
+ const [targetArg, ...flags] = args;
61
+ if (!targetArg) {
62
+ fail('Usage: gsdd file-op delete <target> [--missing <error|ok>]');
63
+ }
64
+
65
+ const missingBehavior = getMissingBehavior(flags);
66
+ const target = resolveWorkspacePath(cwd, targetArg);
67
+
68
+ if (!existsSync(target)) {
69
+ if (missingBehavior === 'ok') {
70
+ output({ operation: 'delete', target: targetArg, changed: false, reason: 'missing_target' });
71
+ return;
72
+ }
73
+ fail(`Target file does not exist: ${targetArg}`);
74
+ }
75
+
76
+ if (statSync(target).isDirectory()) {
77
+ fail(`Delete only supports files in this phase: ${targetArg}`);
78
+ }
79
+
80
+ unlinkSync(target);
81
+ output({ operation: 'delete', target: targetArg, changed: true });
82
+ }
83
+
84
+ function cmdRegexSub(cwd, args) {
85
+ const [targetArg, pattern, replacement, ...flags] = args;
86
+ if (!targetArg || pattern === undefined || replacement === undefined) {
87
+ fail('Usage: gsdd file-op regex-sub <target> <pattern> <replacement> [--flags <flags>] [--missing <error|ok>]');
88
+ }
89
+
90
+ const regexFlags = parseFlagValue(flags, '--flags');
91
+ if (regexFlags.present && regexFlags.invalid) {
92
+ fail('Usage: --flags <regex-flags>');
93
+ }
94
+
95
+ const missingBehavior = getMissingBehavior(flags);
96
+ const target = resolveWorkspacePath(cwd, targetArg);
97
+
98
+ if (!existsSync(target)) {
99
+ if (missingBehavior === 'ok') {
100
+ output({ operation: 'regex-sub', target: targetArg, changed: false, reason: 'missing_target' });
101
+ return;
102
+ }
103
+ fail(`Target file does not exist: ${targetArg}`);
104
+ }
105
+
106
+ if (statSync(target).isDirectory()) {
107
+ fail(`regex-sub only supports files in this phase: ${targetArg}`);
108
+ }
109
+
110
+ let regex;
111
+ try {
112
+ regex = new RegExp(pattern, regexFlags.value || 'g');
113
+ } catch (error) {
114
+ fail(`Invalid regex pattern: ${error.message}`);
115
+ }
116
+
117
+ const source = readFileSync(target, 'utf-8');
118
+ let replacementCount = 0;
119
+ if (regex.global) {
120
+ const matches = source.match(regex);
121
+ replacementCount = matches ? matches.length : 0;
122
+ } else {
123
+ replacementCount = regex.test(source) ? 1 : 0;
124
+ }
125
+
126
+ if (replacementCount === 0) {
127
+ fail(`Pattern did not match any text in ${targetArg}`);
128
+ }
129
+
130
+ const updated = source.replace(regex, replacement);
131
+ const changed = updated !== source;
132
+ writeFileSync(target, updated);
133
+ output({ operation: 'regex-sub', target: targetArg, changed, replacements: replacementCount });
134
+ }
135
+
136
+ export function cmdFileOp(...args) {
137
+ const cwd = process.cwd();
138
+ const [operation, ...rest] = args;
139
+
140
+ try {
141
+ switch (operation) {
142
+ case 'copy':
143
+ cmdCopy(cwd, rest);
144
+ return;
145
+ case 'delete':
146
+ cmdDelete(cwd, rest);
147
+ return;
148
+ case 'regex-sub':
149
+ cmdRegexSub(cwd, rest);
150
+ return;
151
+ default:
152
+ fail('Usage: gsdd file-op <copy|delete|regex-sub> ...');
153
+ }
154
+ } catch (error) {
155
+ if (error instanceof FileOpError) {
156
+ process.exitCode = 1;
157
+ return;
158
+ }
159
+ throw error;
160
+ }
161
+ }