@ktpartners/dgs-platform 2.9.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 (93) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +26 -1
  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 +2 -2
  80. package/deliver-great-systems/workflows/init-product.md +2 -18
  81. package/deliver-great-systems/workflows/new-milestone.md +30 -24
  82. package/deliver-great-systems/workflows/progress-all.md +133 -0
  83. package/deliver-great-systems/workflows/quick-abandon.md +89 -0
  84. package/deliver-great-systems/workflows/quick-complete.md +68 -0
  85. package/deliver-great-systems/workflows/quick.md +152 -23
  86. package/deliver-great-systems/workflows/refine-spec.md +1 -1
  87. package/deliver-great-systems/workflows/research-idea.md +8 -8
  88. package/deliver-great-systems/workflows/resume-project.md +2 -2
  89. package/deliver-great-systems/workflows/run-job.md +8 -8
  90. package/deliver-great-systems/workflows/validate-phase.md +39 -1
  91. package/deliver-great-systems/workflows/verify-work.md +14 -0
  92. package/deliver-great-systems/workflows/write-spec.md +2 -2
  93. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,88 @@ 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
+
11
93
  ## [2.9.0] - 2026-03-25
12
94
 
13
95
  ### 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
 
@@ -351,6 +354,28 @@ This is why "vertical slices" (Plan 01: User feature end-to-end) parallelize bet
351
354
 
352
355
  ---
353
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
+
354
379
  ### 7. Verify Work
355
380
 
356
381
  ```
@@ -649,7 +674,7 @@ See the [User Guide](docs/USER-GUIDE.md#context-tiers) for the complete command-
649
674
  | `/dgs:set-profile <profile>` | Switch model profile (quality/balanced/budget) |
650
675
  | `/dgs:add-todo [desc]` | Capture idea for later |
651
676
  | `/dgs:check-todos [area]` | List pending todos, optionally filtered by area |
652
- | `/dgs:cleanup` | Archive accumulated phase directories |
677
+ | `/dgs:cleanup` | Archive completed quick task directories |
653
678
  | `/dgs:debug [desc]` | Systematic debugging with persistent state |
654
679
  | `/dgs:fast <desc> [--dry-run]` | Trivial edit with single atomic commit — no subagents |
655
680
  | `/dgs:quick [--fast\|--full]` | Execute ad-hoc task with DGS guarantees (`--fast` skips subagents; `--full` adds plan-checking and verification) |
@@ -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>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dgs:map-codebase
3
- description: Analyze registered repos with parallel mapper agents to produce per-repo .planning/codebase/<repo>/ documents and cross-repo analysis
3
+ description: Analyze registered repos with parallel mapper agents to produce per-repo codebase/<repo>/ documents and cross-repo analysis
4
4
  argument-hint: "[<repo-name>]"
5
5
  allowed-tools:
6
6
  - Read
@@ -18,9 +18,9 @@ Supports two modes:
18
18
  - **Refresh mode** (default, no flags): Clears all existing codebase maps and remaps everything from scratch.
19
19
  - **Update mode** (`<repo-name>` or `--only <repo-name>`): Re-maps only the specified repo and regenerates unified files from all repos.
20
20
 
21
- Reads REPOS.md to discover registered repos, then spawns 4 mapper agents per repo (or just the targeted repo in update mode). Each agent explores the repo's actual path and writes documents directly to `.planning/codebase/<repo-name>/`. The orchestrator only receives confirmations.
21
+ Reads REPOS.md to discover registered repos, then spawns 4 mapper agents per repo (or just the targeted repo in update mode). Each agent explores the repo's actual path and writes documents directly to `codebase/<repo-name>/`. The orchestrator only receives confirmations.
22
22
 
23
- Output: .planning/codebase/<repo-name>/ folders, each with 7 structured documents about that repo's codebase state, plus 7 unified top-level files synthesized from per-repo content, plus CROSS-REPO.md with cross-repo comparison tables (when 2+ repos).
23
+ Output: codebase/<repo-name>/ folders, each with 7 structured documents about that repo's codebase state, plus 7 unified top-level files synthesized from per-repo content, plus CROSS-REPO.md with cross-repo comparison tables (when 2+ repos).
24
24
  </objective>
25
25
 
26
26
  <execution_context>
@@ -31,7 +31,7 @@ Output: .planning/codebase/<repo-name>/ folders, each with 7 structured document
31
31
  **Reads REPOS.md** to discover registered repos and their paths.
32
32
 
33
33
  **Load project state if exists:**
34
- Check for .planning/STATE.md - loads context if project already initialized
34
+ Check for ${state_path} - loads context if project already initialized
35
35
 
36
36
  **This command can run:**
37
37
  - Before /dgs:new-project (brownfield codebases) - creates codebase maps first
@@ -60,7 +60,7 @@ Check for .planning/STATE.md - loads context if project already initialized
60
60
  3. Mode-aware cleanup:
61
61
  - Refresh: Delete all existing codebase docs and per-repo subdirectories
62
62
  - Update: Delete only the targeted repo's subdirectory (other repos untouched)
63
- 4. Create .planning/codebase/<repo-name>/ directories (all repos or just targeted repo)
63
+ 4. Create codebase/<repo-name>/ directories (all repos or just targeted repo)
64
64
  5. Spawn 4 parallel dgs-codebase-mapper agents per repo (all run in parallel):
65
65
  - Agent 1: tech focus -> writes STACK.md, INTEGRATIONS.md
66
66
  - Agent 2: arch focus -> writes ARCHITECTURE.md, STRUCTURE.md
@@ -78,7 +78,7 @@ Check for .planning/STATE.md - loads context if project already initialized
78
78
  </process>
79
79
 
80
80
  <success_criteria>
81
- - [ ] .planning/codebase/<repo-name>/ directories created for each registered repo (or targeted repo in update mode)
81
+ - [ ] codebase/<repo-name>/ directories created for each registered repo (or targeted repo in update mode)
82
82
  - [ ] All 7 codebase documents written per repo by mapper agents
83
83
  - [ ] Documents follow template structure
84
84
  - [ ] Parallel agents completed without errors
@@ -15,11 +15,11 @@ Start a new milestone: questioning → research (optional) → requirements →
15
15
  Brownfield equivalent of new-project. Project exists, PROJECT.md has history. Gathers "what's next", updates PROJECT.md, then runs requirements → roadmap cycle.
16
16
 
17
17
  **Creates/Updates:**
18
- - `.planning/PROJECT.md` — updated with new milestone goals
19
- - `.planning/research/` — domain research (optional, NEW features only)
20
- - `.planning/REQUIREMENTS.md` — scoped requirements for this milestone
21
- - `.planning/ROADMAP.md` — phase structure (continues numbering)
22
- - `.planning/STATE.md` — reset for new milestone
18
+ - `${project_path}` — updated with new milestone goals
19
+ - `${project_root}/research/` — domain research (optional, NEW features only)
20
+ - `${project_root}/REQUIREMENTS.md` — scoped requirements for this milestone
21
+ - `${roadmap_path}` — phase structure (continues numbering)
22
+ - `${state_path}` — reset for new milestone
23
23
 
24
24
  **After:** `/dgs:plan-phase [N]` to start execution.
25
25
  </objective>
@@ -18,12 +18,12 @@ allowed-tools:
18
18
  Initialize a new project through unified flow: questioning → research (optional) → requirements → roadmap.
19
19
 
20
20
  **Creates:**
21
- - `.planning/PROJECT.md` — project context
22
- - `.planning/config.json` — workflow preferences
23
- - `.planning/research/` — domain research (optional)
24
- - `.planning/REQUIREMENTS.md` — scoped requirements
25
- - `.planning/ROADMAP.md` — phase structure
26
- - `.planning/STATE.md` — project memory
21
+ - `${project_path}` — project context
22
+ - `config.json` — workflow preferences
23
+ - `${project_root}/research/` — domain research (optional)
24
+ - `${project_root}/REQUIREMENTS.md` — scoped requirements
25
+ - `${roadmap_path}` — phase structure
26
+ - `${state_path}` — project memory
27
27
 
28
28
  **After this command:** Run `/dgs:plan-phase 1` to start execution.
29
29
  </objective>
@@ -23,7 +23,7 @@ One command creates all fix phases — no manual `/dgs:add-phase` per gap.
23
23
 
24
24
  <context>
25
25
  **Audit results:**
26
- Glob: .planning/v*-MILESTONE-AUDIT.md (use most recent)
26
+ Glob: ${project_root}/v*-MILESTONE-AUDIT.md (use most recent)
27
27
 
28
28
  Original intent and current planning state are loaded on demand inside the workflow.
29
29
  </context>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dgs:progress
3
- description: Check project progress, show context, and route to next action (execute or plan)
3
+ description: Check project progress, show context, and route to next action (execute or plan). Use --all for product-wide dashboard across all projects
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
@@ -16,9 +16,9 @@ Provides situational awareness before continuing work.
16
16
 
17
17
  <execution_context>
18
18
  @~/.claude/deliver-great-systems/workflows/progress.md
19
+ @~/.claude/deliver-great-systems/workflows/progress-all.md
19
20
  </execution_context>
20
21
 
21
22
  <process>
22
- Execute the progress workflow from @~/.claude/deliver-great-systems/workflows/progress.md end-to-end.
23
- Preserve all routing logic (Routes A through F) and edge case handling.
23
+ Parse $ARGUMENTS. If it contains the `--all` flag, execute the product-level dashboard workflow from @~/.claude/deliver-great-systems/workflows/progress-all.md end-to-end. Otherwise, execute the single-project progress workflow from @~/.claude/deliver-great-systems/workflows/progress.md end-to-end, preserving all routing logic (Routes A through F) and edge case handling.
24
24
  </process>
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: dgs:quick-abandon
3
+ description: "Alias for /dgs:abandon-quick"
4
+ allowed-tools: []
5
+ ---
6
+ This command has been renamed. Use `/dgs:abandon-quick` instead.
7
+
8
+ Run `/dgs:abandon-quick $ARGUMENTS` to continue.