@ktpartners/dgs-platform 2.8.0 → 3.0.4

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 (94) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +41 -13
  3. package/agents/dgs-plan-checker.md +29 -3
  4. package/agents/dgs-planner.md +10 -0
  5. package/commands/dgs/abandon-quick.md +28 -0
  6. package/commands/dgs/add-tests.md +2 -2
  7. package/commands/dgs/audit-milestone.md +2 -2
  8. package/commands/dgs/capture-principle.md +11 -11
  9. package/commands/dgs/cleanup.md +2 -2
  10. package/commands/dgs/complete-milestone.md +11 -11
  11. package/commands/dgs/complete-quick.md +28 -0
  12. package/commands/dgs/create-milestone-job.md +2 -2
  13. package/commands/dgs/debug.md +3 -3
  14. package/commands/dgs/develop-idea.md +1 -1
  15. package/commands/dgs/fast.md +3 -1
  16. package/commands/dgs/health.md +1 -1
  17. package/commands/dgs/map-codebase.md +6 -6
  18. package/commands/dgs/new-milestone.md +5 -5
  19. package/commands/dgs/new-project.md +6 -6
  20. package/commands/dgs/plan-milestone-gaps.md +1 -1
  21. package/commands/dgs/progress.md +3 -3
  22. package/commands/dgs/quick-abandon.md +8 -0
  23. package/commands/dgs/quick-complete.md +8 -0
  24. package/commands/dgs/quick.md +10 -3
  25. package/commands/dgs/research-idea.md +2 -2
  26. package/commands/dgs/research-phase.md +3 -3
  27. package/commands/dgs/switch-project.md +1 -1
  28. package/commands/dgs/write-spec.md +3 -3
  29. package/deliver-great-systems/bin/dgs-tools.cjs +284 -30
  30. package/deliver-great-systems/bin/lib/commands.cjs +316 -31
  31. package/deliver-great-systems/bin/lib/commands.test.cjs +336 -0
  32. package/deliver-great-systems/bin/lib/config.cjs +39 -6
  33. package/deliver-great-systems/bin/lib/context.cjs +120 -0
  34. package/deliver-great-systems/bin/lib/core.cjs +28 -11
  35. package/deliver-great-systems/bin/lib/execution.cjs +49 -17
  36. package/deliver-great-systems/bin/lib/flat-migration.test.cjs +396 -0
  37. package/deliver-great-systems/bin/lib/ideas.cjs +206 -91
  38. package/deliver-great-systems/bin/lib/ideas.test.cjs +244 -1
  39. package/deliver-great-systems/bin/lib/init.cjs +306 -39
  40. package/deliver-great-systems/bin/lib/init.test.cjs +416 -6
  41. package/deliver-great-systems/bin/lib/jobs.cjs +124 -21
  42. package/deliver-great-systems/bin/lib/jobs.test.cjs +193 -74
  43. package/deliver-great-systems/bin/lib/migration.cjs +409 -1
  44. package/deliver-great-systems/bin/lib/migration.test.cjs +158 -1
  45. package/deliver-great-systems/bin/lib/milestone.cjs +54 -29
  46. package/deliver-great-systems/bin/lib/phase.cjs +128 -2
  47. package/deliver-great-systems/bin/lib/phase.test.cjs +420 -0
  48. package/deliver-great-systems/bin/lib/projects.cjs +28 -8
  49. package/deliver-great-systems/bin/lib/projects.test.cjs +86 -0
  50. package/deliver-great-systems/bin/lib/quick.cjs +584 -0
  51. package/deliver-great-systems/bin/lib/quick.test.cjs +596 -0
  52. package/deliver-great-systems/bin/lib/repos.cjs +25 -1
  53. package/deliver-great-systems/bin/lib/roadmap.cjs +34 -13
  54. package/deliver-great-systems/bin/lib/specs.cjs +3 -81
  55. package/deliver-great-systems/bin/lib/state-transition-gate.test.cjs +160 -0
  56. package/deliver-great-systems/bin/lib/state.cjs +142 -54
  57. package/deliver-great-systems/bin/lib/sync.cjs +75 -0
  58. package/deliver-great-systems/bin/lib/verify.cjs +80 -1
  59. package/deliver-great-systems/bin/lib/worktrees.cjs +764 -0
  60. package/deliver-great-systems/bin/lib/worktrees.test.cjs +887 -0
  61. package/deliver-great-systems/templates/claude-md.md +16 -0
  62. package/deliver-great-systems/workflows/abandon-quick.md +89 -0
  63. package/deliver-great-systems/workflows/add-idea.md +3 -3
  64. package/deliver-great-systems/workflows/add-tests.md +14 -0
  65. package/deliver-great-systems/workflows/add-todo.md +1 -0
  66. package/deliver-great-systems/workflows/approve-spec.md +25 -4
  67. package/deliver-great-systems/workflows/audit-phase.md +15 -5
  68. package/deliver-great-systems/workflows/cancel-job.md +1 -1
  69. package/deliver-great-systems/workflows/check-todos.md +2 -3
  70. package/deliver-great-systems/workflows/complete-milestone.md +197 -22
  71. package/deliver-great-systems/workflows/complete-quick.md +68 -0
  72. package/deliver-great-systems/workflows/consolidate-ideas.md +1 -1
  73. package/deliver-great-systems/workflows/create-milestone-job.md +4 -4
  74. package/deliver-great-systems/workflows/develop-idea.md +11 -11
  75. package/deliver-great-systems/workflows/diagnose-issues.md +14 -0
  76. package/deliver-great-systems/workflows/discuss-idea.md +1 -1
  77. package/deliver-great-systems/workflows/execute-phase.md +121 -32
  78. package/deliver-great-systems/workflows/execute-plan.md +12 -21
  79. package/deliver-great-systems/workflows/help.md +33 -29
  80. package/deliver-great-systems/workflows/init-product.md +2 -18
  81. package/deliver-great-systems/workflows/new-milestone.md +40 -24
  82. package/deliver-great-systems/workflows/new-project.md +22 -680
  83. package/deliver-great-systems/workflows/progress-all.md +133 -0
  84. package/deliver-great-systems/workflows/quick-abandon.md +89 -0
  85. package/deliver-great-systems/workflows/quick-complete.md +68 -0
  86. package/deliver-great-systems/workflows/quick.md +152 -23
  87. package/deliver-great-systems/workflows/refine-spec.md +1 -1
  88. package/deliver-great-systems/workflows/research-idea.md +8 -8
  89. package/deliver-great-systems/workflows/resume-project.md +2 -2
  90. package/deliver-great-systems/workflows/run-job.md +8 -8
  91. package/deliver-great-systems/workflows/validate-phase.md +39 -1
  92. package/deliver-great-systems/workflows/verify-work.md +14 -0
  93. package/deliver-great-systems/workflows/write-spec.md +2 -2
  94. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,102 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [3.0.4] - 2026-04-07
12
+
13
+ ### Added
14
+ - **Frontmatter status model (v20.0)** — Ideas, todos, and jobs now carry a `status` field in YAML frontmatter with validated constants (`IDEA_STATUSES`, `TODO_STATUSES`, `JOB_STATUSES`), round-trip integrity, and `set-status` CLI commands
15
+ - **Flat-first scanning** — `findIdeaFile`, `findJobFile`, and list commands scan flat directories first using frontmatter status for filtering, with legacy subdirectory fallback and stderr migration warnings
16
+ - **Flat status migration** — `dgs-tools migrate --layout flat` with `--dry-run` (default) and `--apply` modes; auto-detects legacy layout on CLI startup; flattens ideas/todos/jobs/research docs; validates file counts; produces atomic git commit; sets `flat_status_migration_done` config flag
17
+ - **GATE test** — Grep-based test that fails if `git mv`, `renameSync`, or `unlinkSync` patterns appear in state transition code paths, permanently enforcing the no-file-move invariant
18
+
19
+ ### Changed
20
+ - **State transitions rewritten** — All 9 directory-move operations (reject, restore, consolidate, undo-consolidate, complete-todo, cancel-job, move-job, specs-finalize) replaced with frontmatter `status` edits; files stay in flat directories
21
+ - **New items created flat** — `cmdIdeasCreate`, `cmdCreateTodo`, and job creation write directly to `ideas/`, `todos/`, `jobs/` with `status` field in frontmatter
22
+ - **Specs decoupled from ideas** — `cmdSpecsFinalize` calls `setIdeaStatus()` instead of 40+ lines of `git mv` logic; research doc moves removed
23
+ - **13 workflow files updated** — write-spec, approve-spec, research-idea, develop-idea, discuss-idea, add-idea, consolidate-ideas, refine-spec, check-todos, create-milestone-job, cancel-job, help, resume-project all reference flat directories and frontmatter status
24
+ - **approve-spec simplified** — Reads `source_ideas` from spec frontmatter and calls `ideas set-status done` for each source idea during approval; single atomic commit
25
+
26
+ ## [3.0.3] - 2026-04-06
27
+
28
+ ### Fixed
29
+ - **v2 multi-project path resolution (7 bugs)** — `cmdMilestoneComplete`, `requirementsMarkCompleteInternal`, `getMilestonePhaseFilter`, `buildStateFrontmatter`, `cmdProgressRender`, `cmdHistoryDigest`, and `updateRepoStatus` now resolve ROADMAP.md, REQUIREMENTS.md, STATE.md, and phases/ from the project root instead of the planning root; backward-compatible for single-project setups
30
+ - **Milestone jobs no longer auto-run `complete-milestone`** — `generateMilestoneSteps` now ends with `audit-milestone` as the final step; `complete-milestone` requires manual intervention (branch review, tag push, conflict resolution) and must be run after the job completes
31
+ - **Ideas CLI error message** — `dgs-tools ideas` now lists available subcommands when an unknown one is used, matching all other dispatchers
32
+ - **Duplicate `getMilestonePhaseFilter` in state.cjs** — removed duplicate function definition; now imports the canonical version from core.cjs
33
+
34
+ ## [3.0.2] - 2026-04-05
35
+
36
+ ### Added
37
+ - **`phase finalize` CLI** — new `dgs-tools phase finalize <phase>` wraps `phase complete` + atomic commit of ROADMAP.md, STATE.md, REQUIREMENTS.md, and VERIFICATION.md in a single call; eliminates the skip-prone 2-step pattern in `execute-phase` workflow
38
+ - **`plan finalize` CLI** — new `dgs-tools plan finalize <phase> <plan>` wraps state/roadmap/requirements updates + atomic commit of PLAN.md, SUMMARY.md, and tracking files in a single call; eliminates the 4-step pattern in `execute-plan` workflow
39
+ - **W009 health check** — `/dgs:health` now detects uncommitted tracking files (ROADMAP.md, STATE.md, REQUIREMENTS.md, VERIFICATION.md) in completed phases and flags them
40
+ - **phase.test.cjs** — new test suite (13 tests) covering finalize CLI atomic-commit behavior, commit message format, and graceful handling of missing files
41
+
42
+ ### Changed
43
+ - **execute-phase workflow** — `update_roadmap` step collapsed from `phase complete` + separate commit into a single `phase finalize --push` call
44
+ - **execute-plan workflow** — `update_state`/`update_roadmap`/`update_requirements`/`git_commit_metadata` 4-step chain collapsed into a single `finalize_plan` step
45
+
46
+ ## [3.0.1] - 2026-04-05
47
+
48
+ ### Added
49
+
50
+ - **Product-level quick archival** — `state archive-quick-tasks` now dual-scans product + project STATE.md; new `listProjectsReadonly` helper in `bin/lib/projects.cjs` enumerates projects without mutation.
51
+ - **`--repo-cwd` flag on `dgs-tools commit`** — allows commits to target a specific repo cwd, enabling context-aware commit routing.
52
+ - **`--all` flag on `/dgs:progress`** — new cross-project product dashboard; adds `cmdInitProgressAll` returning product-wide JSON and `workflows/progress-all.md` workflow.
53
+
54
+ ### Changed
55
+
56
+ - **Product-level routing for quick artifacts** — quick tasks and STATE tracking at product scope now route to the planning root rather than project subdirectories.
57
+ - **`/dgs:fast` is now context-aware** — commits land in the active milestone worktree when milestone-context is active, otherwise on `base_branch` in the main checkout.
58
+ - **Commands inherit session model** — reverted `model:` frontmatter from 55 command files so commands use the session's active model instead of pinning.
59
+
60
+ ### Fixed
61
+
62
+ - **Slug trailing hyphens** — sanitizers in `quick.cjs`, `worktrees.cjs`, and `init.cjs` now strip trailing hyphens after length-capping.
63
+
64
+ ## [3.0.0] - 2026-03-31
65
+
66
+ ### Changed
67
+ - **BREAKING: Git Worktrees replace branch-based isolation (v19.0)** — code repos now use worktrees for milestone and quick task isolation instead of git branches; `branching_strategy` config removed; `execute-phase` creates worktrees on demand; `complete-milestone` uses rebase-before-merge completion flow
68
+ - **Quick workflows worktree-aware** — `/dgs:quick` detects worktree vs branch context; new `/dgs:quick-complete` (rebase-merge-cleanup) and `/dgs:quick-abandon` (discard worktree) commands
69
+ - **Code context resolution** — new `resolveCodeContext()` replaces direct repo path lookups; all code-aware workflows wired through unified resolution
70
+ - **Phase archival mandatory** — `complete-milestone` always archives phase directories (no interactive prompt); phases are in git history so no data loss
71
+
72
+ ### Added
73
+ - **Worktree lifecycle module** (`worktrees.cjs`) — create, list, remove, clean operations with full test coverage
74
+ - **REPOS.md setup column** — optional `setup` column for per-repo setup scripts; scripts receive worktree path as `$2`
75
+ - **Branching config migration** — automatic migration from legacy `branching_strategy` config with detection and cleanup
76
+ - **Worktree health checks** — `checkWorktreeHealth()` validates worktree state before operations
77
+ - **Rebase-and-merge completion** — `rebaseAndMerge()` for clean worktree integration back to base branch
78
+ - **Planning repo completion** — `markMilestoneComplete()` handles planning repo state during milestone completion
79
+ - **Entry point wiring check** — planner agent now traces backwards from new features to existing navigation flows; plan-checker validates wiring tasks exist (Dimension 8)
80
+ - **getMilestoneInfo project-scoped resolution** — tries project-scoped ROADMAP.md first, falls back to planning root; adds bullet-list format regex matching
81
+
82
+ ### Fixed
83
+ - **getMilestoneInfo returning defaults** — was reading ROADMAP.md from planning root instead of project-scoped path, silently returning `v1.0`/`milestone` in v2 layouts
84
+ - **Phase add milestone summary range** — adding a phase now correctly updates the milestone summary range in ROADMAP.md
85
+
86
+ ### Documentation
87
+ - **GIT-WORKFLOW.md** — comprehensive guide for worktree-based development workflow
88
+ - **USER-GUIDE.md** — quick workflows section, worktree troubleshooting, complete-milestone updates
89
+ - **README.md** — updated for worktree features and mandatory phase archival
90
+ - **Pluggable Checker Skills spec** (v1.4) — standard checker contract, four hook points, fix cycle, two-location discovery, findings persistence, sequential-by-priority execution
91
+ - **Test-gate specs rewritten** — all four testing specs (test-gate, package-scan, security-scan, scenario-test) redesigned for pluggable test type architecture with convention-based discovery from `.claude/skills/dgs-tests/`
92
+
93
+ ## [2.9.0] - 2026-03-25
94
+
95
+ ### Changed
96
+ - **new-project/new-milestone split** — `/dgs:new-project` now only handles questioning and PROJECT.md creation; all milestone-scoped work (research, requirements, roadmap, STATE.md) moves to `/dgs:new-milestone`, which now handles both first and subsequent milestones
97
+ - **Codereview gate moved to orchestrator** — code review execution moved from `dgs-executor` (which lacks Task tool) to `execute-phase` orchestrator where Task spawning is available; skips in non-interactive/job mode with log message
98
+ - **Map-codebase staleness gate** — in `--auto` mode (job runs), checks git history since last map; skips if no changes, narrows to single repo if only one changed; `--force` flag bypasses
99
+
100
+ ### Added
101
+ - **Job file commit+push on status changes** — `run-job` now commits and pushes the job file after every step status update (in-progress, completed, failed, move operations), making job progress visible on remote in real time
102
+ - **First-milestone guards in new-milestone** — handles missing MILESTONES.md/STATE.md gracefully with v1.0 default, phase-1 numbering, greenfield research framing, and STATE.md creation
103
+
104
+ ### Fixed
105
+ - **Codereview silent failure in job mode** — codereview was silently skipped in job mode because the executor agent lacked Task/Agent tools needed to spawn the 9 review subagents
106
+
11
107
  ## [2.8.0] - 2026-03-25
12
108
 
13
109
  ### Changed
package/README.md CHANGED
@@ -42,6 +42,9 @@ DGS extends GSD with:
42
42
  - **Product-level management** — multiple projects and repositories under one planning structure
43
43
  - **Ideas and specs pipeline** — capture ideas, develop them into formal PRDs, run cross-LLM review with OpenAI and Gemini before committing to a project
44
44
  - **Multi-repo orchestration** — plans reference repos by name, execution resolves paths at runtime, branches stay scoped per project
45
+ - **Git worktree isolation** — milestone work runs in dedicated worktrees, keeping the main checkout clean. Three work modes: fast (direct to main), quick (ephemeral worktree), milestone (dedicated worktree). Zero branch management overhead.
46
+
47
+ > **v19.0:** Worktree-based isolation replaces the old `branching_strategy` config. Existing configs are migrated automatically — no action needed.
45
48
 
46
49
  The complexity stays in the system, not in your workflow. Behind the scenes: context engineering, XML prompt formatting, subagent orchestration, state management. What you see: a few commands that produce consistent, verified results.
47
50
 
@@ -194,7 +197,7 @@ If you prefer not to use that flag, add this to your project's `.claude/settings
194
197
 
195
198
  DGS operates at the **product** level. A product contains one or more **projects**, each with its own milestones and phases. Ideas and specs live at the product level and feed into project or milestone creation.
196
199
 
197
- > **Already have code?** Run `/dgs:map-codebase` first. It spawns parallel agents per registered repo to analyze stack, architecture, structure, conventions, testing, integrations, and concerns. Per-repo maps are synthesized into unified top-level files. Then `/dgs:new-project` knows your codebasequestions focus on what you're adding, and planning automatically loads your patterns. Update a single repo after changes with `/dgs:map-codebase <repo-name>`.
200
+ > **Already have code?** Run `/dgs:map-codebase` first. It spawns parallel agents per registered repo to analyze stack, architecture, structure, conventions, testing, integrations, and concerns. Per-repo maps are synthesized into unified top-level files. Then `/dgs:new-project` captures your project identity goals, constraints, and scope. `/dgs:new-milestone` takes it from there with research, requirements, and roadmap. Update a single repo after changes with `/dgs:map-codebase <repo-name>`.
198
201
 
199
202
  ### 1. Set Up Product
200
203
 
@@ -236,18 +239,21 @@ If you have OpenAI or Gemini API keys configured, the spec goes through a **cros
236
239
 
237
240
  ```
238
241
  /dgs:new-project
242
+ /dgs:new-milestone
239
243
  ```
240
244
 
241
- One command, one flow. The system:
245
+ Two commands, one setup. First, `/dgs:new-project` asks questions until it understands your idea completely — goals, constraints, tech preferences, edge cases — then creates `PROJECT.md`.
242
246
 
243
- 1. **Questions** Asks until it understands your idea completely (goals, constraints, tech preferences, edge cases)
244
- 2. **Research** — Spawns parallel agents to investigate the domain (optional but recommended)
245
- 3. **Requirements** — Extracts what's v1, v2, and out of scope
246
- 4. **Roadmap** — Creates phases mapped to requirements
247
+ Then `/dgs:new-milestone` takes over:
248
+
249
+ 1. **Research** — Spawns parallel agents to investigate the domain (optional but recommended)
250
+ 2. **Requirements** — Extracts what's v1, v2, and out of scope
251
+ 3. **Roadmap** — Creates phases mapped to requirements
247
252
 
248
253
  You approve the roadmap. Now you're ready to build.
249
254
 
250
- **Creates:** `PROJECT.md`, `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, `.planning/research/`
255
+ **`new-project` creates:** `PROJECT.md`
256
+ **`new-milestone` creates:** `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, `research/`
251
257
 
252
258
  ---
253
259
 
@@ -348,6 +354,28 @@ This is why "vertical slices" (Plan 01: User feature end-to-end) parallelize bet
348
354
 
349
355
  ---
350
356
 
357
+ ### Working with Worktrees
358
+
359
+ Code repos are isolated using git worktrees. Each milestone gets its own directory — the main checkout stays clean for quick fixes.
360
+
361
+ ```
362
+ # During milestone work, your repo layout looks like:
363
+ ~/dev/myapp/ # main checkout (on main, always clean)
364
+ ~/dev/myapp--gsd-v19/ # milestone worktree (dedicated branch)
365
+ ```
366
+
367
+ **Three work modes:**
368
+
369
+ | Mode | Command | Branch Management |
370
+ |------|---------|-------------------|
371
+ | Fast | `dgs:fast` | Direct to main — no worktree, no branch |
372
+ | Quick | `dgs:quick` | Ephemeral worktree — auto-cleanup on complete |
373
+ | Milestone | `execute-phase` | Dedicated worktree — persists across phases |
374
+
375
+ When a milestone or quick fix finishes, DGS rebases onto main and cleans up automatically. See [How Git is Used](docs/GIT-WORKFLOW.md) for the full model.
376
+
377
+ ---
378
+
351
379
  ### 7. Verify Work
352
380
 
353
381
  ```
@@ -393,7 +421,7 @@ When all phases are done, `/dgs:complete-milestone` archives the milestone and t
393
421
 
394
422
  **Automated alternative:** Instead of running each phase command manually, use `/dgs:create-milestone-job` to generate a build job and `/dgs:run-job` to execute the entire milestone pipeline automatically with subagent isolation per step. See the [User Guide](docs/USER-GUIDE.md#milestone-jobs) for details.
395
423
 
396
- Then `/dgs:new-milestone` starts the next version same flow as `new-project` but for your existing codebase. You describe what you want to build next, the system researches the domain, you scope requirements, and it creates a fresh roadmap. Each milestone is a clean cycle: define → build → ship.
424
+ Then `/dgs:new-milestone` starts the next cycle. This is the same command used after `new-project` it handles research, requirements, and roadmap for each version. You describe what you want to build next, it researches the domain, you scope requirements, and it creates a fresh roadmap. Each milestone is a clean cycle: define → build → ship.
397
425
 
398
426
  ---
399
427
 
@@ -460,7 +488,7 @@ DGS handles it for you:
460
488
  | `REQUIREMENTS.md` | Scoped v1/v2 requirements with phase traceability |
461
489
  | `ROADMAP.md` | Where you're going, what's done |
462
490
  | `STATE.md` | Decisions, blockers, position — memory across sessions |
463
- | `docs/product/` | Product-level documents (architecture, summary) — loaded as context by write-spec, plan-phase, new-project, new-milestone |
491
+ | `docs/product/` | Product-level documents (architecture, summary) — loaded as context by write-spec, plan-phase, new-milestone |
464
492
  | `codebase/` | Per-repo maps + unified synthesis from `/dgs:map-codebase` |
465
493
  | `research/` | Ecosystem knowledge (stack, features, architecture, pitfalls) |
466
494
  | `PLAN.md` | Atomic task with XML structure, verification steps |
@@ -554,7 +582,7 @@ See the [User Guide](docs/USER-GUIDE.md#context-tiers) for the complete command-
554
582
 
555
583
  | Command | What it does |
556
584
  |---------|--------------|
557
- | `/dgs:new-project [--auto]` | Full initialization: questionsresearch → requirements → roadmap |
585
+ | `/dgs:new-project [--auto]` | Project identity: questioningPROJECT.md |
558
586
  | `/dgs:discuss-phase [N] [--auto]` | Capture implementation decisions before planning |
559
587
  | `/dgs:plan-phase [N] [--auto]` | Research + plan + verify for a phase |
560
588
  | `/dgs:execute-phase <N>` | Execute all plans in parallel waves, verify when complete |
@@ -562,7 +590,7 @@ See the [User Guide](docs/USER-GUIDE.md#context-tiers) for the complete command-
562
590
  | `/dgs:audit-phase <phase> [--rerun-failed]` | Automated phase verification: test execution + structural inspection |
563
591
  | `/dgs:audit-milestone` | Verify milestone achieved its definition of done |
564
592
  | `/dgs:complete-milestone` | Archive milestone, tag release |
565
- | `/dgs:new-milestone [name]` | Start next version: questions → research → requirements → roadmap |
593
+ | `/dgs:new-milestone [name]` | Start milestone: research → requirements → roadmap (first or subsequent) |
566
594
 
567
595
  ### Navigation
568
596
 
@@ -646,7 +674,7 @@ See the [User Guide](docs/USER-GUIDE.md#context-tiers) for the complete command-
646
674
  | `/dgs:set-profile <profile>` | Switch model profile (quality/balanced/budget) |
647
675
  | `/dgs:add-todo [desc]` | Capture idea for later |
648
676
  | `/dgs:check-todos [area]` | List pending todos, optionally filtered by area |
649
- | `/dgs:cleanup` | Archive accumulated phase directories |
677
+ | `/dgs:cleanup` | Archive completed quick task directories |
650
678
  | `/dgs:debug [desc]` | Systematic debugging with persistent state |
651
679
  | `/dgs:fast <desc> [--dry-run]` | Trivial edit with single atomic commit — no subagents |
652
680
  | `/dgs:quick [--fast\|--full]` | Execute ad-hoc task with DGS guarantees (`--fast` skips subagents; `--full` adds plan-checking and verification) |
@@ -665,7 +693,7 @@ See the [User Guide](docs/USER-GUIDE.md#context-tiers) for the complete command-
665
693
 
666
694
  ## Configuration
667
695
 
668
- DGS stores product-level settings in `.planning/config.json`. This file is shared across all projects in the product. Configure during `/dgs:init-product` or `/dgs:new-project`, and update later with `/dgs:settings`. For the full config schema, workflow toggles, git branching options, and per-agent model breakdown, see the [User Guide](docs/USER-GUIDE.md#configuration-reference).
696
+ DGS stores product-level settings in `.planning/config.json`. This file is shared across all projects in the product. Configure during `/dgs:init-product`, and update later with `/dgs:settings`. For the full config schema, workflow toggles, git branching options, and per-agent model breakdown, see the [User Guide](docs/USER-GUIDE.md#configuration-reference).
669
697
 
670
698
  ### Core Settings
671
699
 
@@ -314,7 +314,33 @@ issue:
314
314
  fix_hint: "Remove search task - belongs in future phase per user decision"
315
315
  ```
316
316
 
317
- ## Dimension 8: Nyquist Compliance
317
+ ## Dimension 8: Entry Point Wiring
318
+
319
+ **Question:** Do new pages, endpoints, or components have tasks that wire them into existing user flows?
320
+
321
+ **Process:**
322
+ 1. Identify tasks that create new pages, routes, endpoints, or UI components
323
+ 2. For each, check whether another task updates existing navigation, redirects, links, or routes to reach the new feature
324
+ 3. If a new feature has no wiring task, flag it — the feature will be unreachable from existing flows
325
+
326
+ **Red flags:**
327
+ - New page created but no existing navigation/redirect updated to link to it
328
+ - New endpoint added but no existing client code updated to call it
329
+ - New component built but no existing page renders it
330
+
331
+ **Example issue:**
332
+ ```yaml
333
+ issue:
334
+ dimension: entry_point_wiring
335
+ severity: warning
336
+ description: "Task 2 creates onboarding page at /tenants/[id]/onboarding but no task updates the tenant creation flow to redirect there"
337
+ plan: "02"
338
+ task: 2
339
+ new_feature: "/tenants/[id]/onboarding"
340
+ fix_hint: "Add a task to update the existing tenant creation modal to redirect to the onboarding page after save"
341
+ ```
342
+
343
+ ## Dimension 9: Nyquist Compliance
318
344
 
319
345
  Skip if: `workflow.nyquist_validation` is explicitly set to `false` in config.json (absent key = enabled), phase has no RESEARCH.md, or RESEARCH.md has no "Validation Architecture" section. Output: "Dimension 8: SKIPPED (nyquist_validation disabled or not applicable)"
320
346
 
@@ -356,10 +382,10 @@ For each `<automated>MISSING</automated>` reference:
356
382
  - Wave 0 plan must execute before dependent task
357
383
  - Missing match → **BLOCKING FAIL**
358
384
 
359
- ### Dimension 8 Output
385
+ ### Dimension 9 Output
360
386
 
361
387
  ```
362
- ## Dimension 8: Nyquist Compliance
388
+ ## Dimension 9: Nyquist Compliance
363
389
 
364
390
  | Task | Plan | Wave | Automated Command | Status |
365
391
  |------|------|------|-------------------|--------|
@@ -1111,6 +1111,16 @@ For each task:
1111
1111
  Apply TDD detection heuristic. Apply user setup detection.
1112
1112
  </step>
1113
1113
 
1114
+ <step name="wiring_check">
1115
+ **Last-mile wiring check.** For each new page, endpoint, component, or feature created by a task:
1116
+
1117
+ 1. **Entry point analysis:** How does the user reach this today? Search (grep/glob) for existing navigation, redirects, links, or routes that currently handle the flow being extended. If nothing leads to the new feature, add a wiring task (e.g., update an existing modal redirect, add a nav link, wire a route).
1118
+
1119
+ 2. **Upstream flow scouting:** Include files that currently handle the flow being extended in the plan's `<context>` block — not just files being created. For UI features: identify existing pages, modals, or components that precede the new feature in the user journey.
1120
+
1121
+ New features built without wiring into existing flows are unreachable. This check prevents "works in isolation, not connected" gaps.
1122
+ </step>
1123
+
1114
1124
  <step name="build_dependency_graph">
1115
1125
  Map dependencies explicitly before grouping into plans. Record needs/creates/has_checkpoint for each task.
1116
1126
 
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: dgs:abandon-quick
3
+ description: Abandon active quick task — remove worktree without merging
4
+ argument-hint: ""
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - AskUserQuestion
9
+ ---
10
+ <objective>
11
+ Abandon the active product-level quick task.
12
+
13
+ Remove the worktree directory and branch without merging any changes to main. All committed and uncommitted work in the worktree is discarded.
14
+
15
+ Requires confirmation before proceeding. This action cannot be undone.
16
+ </objective>
17
+
18
+ <execution_context>
19
+ @~/.claude/deliver-great-systems/workflows/abandon-quick.md
20
+ </execution_context>
21
+
22
+ <context>
23
+ $ARGUMENTS
24
+ </context>
25
+
26
+ <process>
27
+ Execute the abandon-quick workflow from @~/.claude/deliver-great-systems/workflows/abandon-quick.md end-to-end.
28
+ </process>
@@ -31,8 +31,8 @@ Output: Test files committed with message `test(phase-{N}): add unit and E2E tes
31
31
  <context>
32
32
  Phase: $ARGUMENTS
33
33
 
34
- @.planning/STATE.md
35
- @.planning/ROADMAP.md
34
+ @${state_path}
35
+ @${roadmap_path}
36
36
  </context>
37
37
 
38
38
  <process>
@@ -26,8 +26,8 @@ Version: $ARGUMENTS (optional — defaults to current milestone)
26
26
  Core planning files are resolved in-workflow (`init milestone-op`) and loaded only as needed.
27
27
 
28
28
  **Completed Work:**
29
- Glob: .planning/phases/*/*-SUMMARY.md
30
- Glob: .planning/phases/*/*-VERIFICATION.md
29
+ Glob: ${project_root}/phases/*/*-SUMMARY.md
30
+ Glob: ${project_root}/phases/*/*-VERIFICATION.md
31
31
  </context>
32
32
 
33
33
  <process>
@@ -11,7 +11,7 @@ allowed-tools:
11
11
  ---
12
12
 
13
13
  <objective>
14
- Extract a design principle from the current conversation context (e.g., a debugging session, root cause analysis, or architectural discussion) and save it to `.planning/docs/product/DESIGN-PRINCIPLES.md`.
14
+ Extract a design principle from the current conversation context (e.g., a debugging session, root cause analysis, or architectural discussion) and save it to `docs/product/DESIGN-PRINCIPLES.md` in the planning repo.
15
15
 
16
16
  Principles are product-level artifacts — actionable rules distilled from hard-won lessons. They are loaded automatically by any workflow that reads product docs (Planning, Execution, and Verification tiers), preventing the same mistakes from recurring.
17
17
  </objective>
@@ -19,27 +19,27 @@ Principles are product-level artifacts — actionable rules distilled from hard-
19
19
  <context>
20
20
  Arguments: $ARGUMENTS (optional seed text for the principle)
21
21
 
22
- State is resolved in-process via `state load` and git repo root detection.
22
+ State is resolved via `init milestone-op` which provides planning-repo-relative paths.
23
23
  </context>
24
24
 
25
25
  <process>
26
26
 
27
27
  ## 1. Resolve Target Path
28
28
 
29
- Determine where `DESIGN-PRINCIPLES.md` lives:
29
+ Resolve the planning repo root and product docs path:
30
30
 
31
31
  ```bash
32
- REPO_ROOT=$(git rev-parse --show-toplevel)
32
+ INIT=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs init milestone-op)
33
33
  ```
34
34
 
35
- The target is always at `${REPO_ROOT}/.planning/docs/product/DESIGN-PRINCIPLES.md`.
35
+ Extract `commit_docs` and `project_root` from the init JSON.
36
36
 
37
- Load state for commit_docs setting:
37
+ Resolve the product docs directory:
38
38
  ```bash
39
- INIT=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs state load)
39
+ DOCS_DIR=$(node -e "const d = require('$HOME/.claude/deliver-great-systems/bin/lib/docs.cjs'); process.stdout.write(d.resolveDocsDir(process.cwd(), 'product'))")
40
40
  ```
41
41
 
42
- Extract `commit_docs` from the init JSON.
42
+ The target is always at `${DOCS_DIR}/DESIGN-PRINCIPLES.md`.
43
43
 
44
44
  ## 2. Extract Principle from Context
45
45
 
@@ -71,7 +71,7 @@ If the user provides edits, incorporate them and re-present. If the user rejects
71
71
 
72
72
  ## 4. Read Existing DESIGN-PRINCIPLES.md
73
73
 
74
- Read `.planning/docs/product/DESIGN-PRINCIPLES.md` at the resolved path.
74
+ Read `${DOCS_DIR}/DESIGN-PRINCIPLES.md`.
75
75
 
76
76
  If the file does **not** exist, create it with this template:
77
77
 
@@ -90,7 +90,7 @@ Actionable design rules distilled from project experience. Loaded automatically
90
90
 
91
91
  Also ensure the directory exists:
92
92
  ```bash
93
- mkdir -p "${REPO_ROOT}/.planning/docs/product"
93
+ mkdir -p "${DOCS_DIR}"
94
94
  ```
95
95
 
96
96
  If the file exists, read and parse existing principles (look for `### ` headings under `## Principles`).
@@ -124,7 +124,7 @@ Use today's date for the `Added` field.
124
124
 
125
125
  If `commit_docs` is true:
126
126
  ```bash
127
- node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: capture design principle - {title}" --push --files .planning/docs/product/DESIGN-PRINCIPLES.md
127
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: capture design principle - {title}" --push --files docs/product/DESIGN-PRINCIPLES.md
128
128
  ```
129
129
 
130
130
  If `commit_docs` is false, just save the file without committing.
@@ -3,9 +3,9 @@ name: dgs:cleanup
3
3
  description: Archive milestone phase directories and clean up completed quick task directories
4
4
  ---
5
5
  <objective>
6
- Archive phase directories from completed milestones into `.planning/milestones/v{X.Y}-phases/`, and remove planning directories for completed quick/fast tasks from `.planning/quick/`.
6
+ Archive phase directories from completed milestones into `${project_root}/milestones/v{X.Y}-phases/`, and remove planning directories for completed quick/fast tasks from `${project_root}/quick/`.
7
7
 
8
- Use when `.planning/phases/` has accumulated directories from past milestones, or `.planning/quick/` has many completed task directories.
8
+ Use when `${project_root}/phases/` has accumulated directories from past milestones, or `${project_root}/quick/` has many completed task directories.
9
9
  </objective>
10
10
 
11
11
  <execution_context>
@@ -25,10 +25,10 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
25
25
 
26
26
  <context>
27
27
  **Project files:**
28
- - `.planning/ROADMAP.md`
29
- - `.planning/REQUIREMENTS.md`
30
- - `.planning/STATE.md`
31
- - `.planning/PROJECT.md`
28
+ - `${roadmap_path}`
29
+ - `${project_root}/REQUIREMENTS.md`
30
+ - `${state_path}`
31
+ - `${project_path}`
32
32
 
33
33
  **User input:**
34
34
 
@@ -41,7 +41,7 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
41
41
 
42
42
  0. **Check for audit:**
43
43
 
44
- - Look for `.planning/v{{version}}-MILESTONE-AUDIT.md`
44
+ - Look for `${project_root}/v{{version}}-MILESTONE-AUDIT.md`
45
45
  - If missing or stale: recommend `/dgs:audit-milestone` first
46
46
  - If audit status is `gaps_found`: recommend `/dgs:plan-milestone-gaps` first
47
47
  - If audit status is `passed`: proceed to step 1
@@ -82,17 +82,17 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
82
82
 
83
83
  4. **Archive milestone:**
84
84
 
85
- - Create `.planning/milestones/v{{version}}-ROADMAP.md`
85
+ - Create `${project_root}/milestones/v{{version}}-ROADMAP.md`
86
86
  - Extract full phase details from ROADMAP.md
87
87
  - Fill milestone-archive.md template
88
88
  - Update ROADMAP.md to one-line summary with link
89
89
 
90
90
  5. **Archive requirements:**
91
91
 
92
- - Create `.planning/milestones/v{{version}}-REQUIREMENTS.md`
92
+ - Create `${project_root}/milestones/v{{version}}-REQUIREMENTS.md`
93
93
  - Mark all v1 requirements as complete (checkboxes checked)
94
94
  - Note requirement outcomes (validated, adjusted, dropped)
95
- - Delete `.planning/REQUIREMENTS.md` (fresh one created for next milestone)
95
+ - Delete `${project_root}/REQUIREMENTS.md` (fresh one created for next milestone)
96
96
 
97
97
  6. **Update PROJECT.md:**
98
98
 
@@ -114,9 +114,9 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
114
114
 
115
115
  <success_criteria>
116
116
 
117
- - Milestone archived to `.planning/milestones/v{{version}}-ROADMAP.md`
118
- - Requirements archived to `.planning/milestones/v{{version}}-REQUIREMENTS.md`
119
- - `.planning/REQUIREMENTS.md` deleted (fresh for next milestone)
117
+ - Milestone archived to `${project_root}/milestones/v{{version}}-ROADMAP.md`
118
+ - Requirements archived to `${project_root}/milestones/v{{version}}-REQUIREMENTS.md`
119
+ - `${project_root}/REQUIREMENTS.md` deleted (fresh for next milestone)
120
120
  - ROADMAP.md collapsed to one-line entry
121
121
  - PROJECT.md updated with current state
122
122
  - Git tag v{{version}} created
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: dgs:complete-quick
3
+ description: Complete active quick task — rebase, merge to main, push, clean up worktree
4
+ argument-hint: ""
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - AskUserQuestion
9
+ ---
10
+ <objective>
11
+ Complete the active product-level quick task.
12
+
13
+ Rebase the quick branch onto the latest base_branch, fast-forward merge to main, push to remote, and remove the worktree directory and branch.
14
+
15
+ Only valid for product-level quicks. Milestone-context quicks merge with the milestone via /dgs:complete-milestone.
16
+ </objective>
17
+
18
+ <execution_context>
19
+ @~/.claude/deliver-great-systems/workflows/complete-quick.md
20
+ </execution_context>
21
+
22
+ <context>
23
+ $ARGUMENTS
24
+ </context>
25
+
26
+ <process>
27
+ Execute the complete-quick workflow from @~/.claude/deliver-great-systems/workflows/complete-quick.md end-to-end.
28
+ </process>
@@ -14,7 +14,7 @@ Generate a milestone build job that plans and executes all remaining phases, wit
14
14
 
15
15
  Purpose: Reads the roadmap, determines which phases still need work, generates the step sequence, shows it for approval, and writes the job file on confirmation.
16
16
 
17
- Output: Job file at `.planning/jobs/pending/milestone-{version}.md` ready for `/dgs:run-job`.
17
+ Output: Job file at `jobs/pending/milestone-{version}.md` ready for `/dgs:run-job`.
18
18
  </objective>
19
19
 
20
20
  <execution_context>
@@ -26,7 +26,7 @@ Arguments: $ARGUMENTS
26
26
 
27
27
  Flags:
28
28
  - `version` (optional): Milestone version (e.g., `v6`). Auto-detects from ROADMAP.md if omitted.
29
- - `--no-check`: Skip audit-milestone and complete-milestone steps in the generated job.
29
+ - `--no-check`: Skip the audit-milestone step in the generated job.
30
30
 
31
31
  State is resolved in-workflow via `dgs-tools.cjs jobs milestone-preview` and `jobs create-milestone`.
32
32
  </context>
@@ -22,7 +22,7 @@ User's issue: $ARGUMENTS
22
22
 
23
23
  Check for active sessions:
24
24
  ```bash
25
- ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
25
+ ls ${project_root}/debug/*.md 2>/dev/null | grep -v resolved | head -5
26
26
  ```
27
27
  </context>
28
28
 
@@ -85,7 +85,7 @@ goal: find_and_fix
85
85
  </mode>
86
86
 
87
87
  <debug_file>
88
- Create: .planning/debug/{slug}.md
88
+ Create: ${project_root}/debug/{slug}.md
89
89
  </debug_file>
90
90
  ```
91
91
 
@@ -130,7 +130,7 @@ Continue debugging {slug}. Evidence is in the debug file.
130
130
 
131
131
  <prior_state>
132
132
  <files_to_read>
133
- - .planning/debug/{slug}.md (Debug session state)
133
+ - ${project_root}/debug/{slug}.md (Debug session state)
134
134
  </files_to_read>
135
135
  </prior_state>
136
136
 
@@ -26,7 +26,7 @@ If discussion concludes that the idea is not viable, research is skipped entirel
26
26
 
27
27
  When re-running on an idea with prior history, the user is offered a choice: re-do both, just discuss, or just research.
28
28
 
29
- The output is a Discussion Log entry in the idea file, a research document at `.planning/docs/ideas/pending/{slug}-research.md`, and a Research Log entry in the idea file -- all committed at appropriate stages.
29
+ The output is a Discussion Log entry in the idea file, a research document at `${project_root}/docs/ideas/pending/{slug}-research.md`, and a Research Log entry in the idea file -- all committed at appropriate stages.
30
30
  </objective>
31
31
 
32
32
  <execution_context>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: dgs:fast
3
3
  description: Make a trivial edit with a single atomic commit — no subagents, no ceremony
4
- argument-hint: "<description> [--dry-run]"
4
+ argument-hint: "<description> [--dry-run] [--main]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -20,6 +20,8 @@ Make a trivial edit and commit it atomically. Fast mode is the lightest DGS comm
20
20
  - Warns if scope exceeds 3 files or 30 lines (suggests /dgs:quick instead)
21
21
 
22
22
  **`--dry-run` flag:** Shows proposed changes as a diff, then asks "Apply these changes?" before committing.
23
+
24
+ **`--main` flag:** Forces product-level mode even when a milestone is active. Commits to `base_branch` in the main checkout instead of the milestone worktree.
23
25
  </objective>
24
26
 
25
27
  <execution_context>
@@ -9,7 +9,7 @@ allowed-tools:
9
9
  - AskUserQuestion
10
10
  ---
11
11
  <objective>
12
- Validate `.planning/` directory integrity and jobs directory structure. Reports actionable issues for both planning health and job management health.
12
+ Validate planning directory integrity and jobs directory structure. Reports actionable issues for both planning health and job management health.
13
13
  </objective>
14
14
 
15
15
  <execution_context>