@ktpartners/dgs-platform 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +38 -0
- package/README.md +851 -0
- package/agents/dgs-codebase-cross-analyzer.md +183 -0
- package/agents/dgs-codebase-mapper.md +782 -0
- package/agents/dgs-codebase-synthesizer.md +156 -0
- package/agents/dgs-debugger.md +1256 -0
- package/agents/dgs-executor.md +550 -0
- package/agents/dgs-integration-checker.md +481 -0
- package/agents/dgs-nyquist-auditor.md +178 -0
- package/agents/dgs-phase-researcher.md +563 -0
- package/agents/dgs-phase-verifier.md +450 -0
- package/agents/dgs-plan-checker.md +708 -0
- package/agents/dgs-planner.md +1324 -0
- package/agents/dgs-project-researcher.md +631 -0
- package/agents/dgs-research-synthesizer.md +249 -0
- package/agents/dgs-roadmapper.md +652 -0
- package/agents/dgs-verifier.md +607 -0
- package/bin/install.js +2073 -0
- package/commands/dgs/add-doc.md +45 -0
- package/commands/dgs/add-idea.md +38 -0
- package/commands/dgs/add-phase.md +43 -0
- package/commands/dgs/add-repo.md +54 -0
- package/commands/dgs/add-tests.md +41 -0
- package/commands/dgs/add-todo.md +47 -0
- package/commands/dgs/approve-spec.md +38 -0
- package/commands/dgs/audit-milestone.md +36 -0
- package/commands/dgs/audit-phase.md +37 -0
- package/commands/dgs/cancel-job.md +23 -0
- package/commands/dgs/capture-principle.md +143 -0
- package/commands/dgs/check-todos.md +45 -0
- package/commands/dgs/cleanup.md +18 -0
- package/commands/dgs/complete-milestone.md +136 -0
- package/commands/dgs/complete-project.md +70 -0
- package/commands/dgs/consolidate-ideas.md +50 -0
- package/commands/dgs/create-milestone-job.md +37 -0
- package/commands/dgs/debug.md +164 -0
- package/commands/dgs/develop-idea.md +53 -0
- package/commands/dgs/discuss-idea.md +41 -0
- package/commands/dgs/discuss-phase.md +83 -0
- package/commands/dgs/execute-phase.md +41 -0
- package/commands/dgs/fast.md +38 -0
- package/commands/dgs/find-related-ideas.md +43 -0
- package/commands/dgs/health.md +28 -0
- package/commands/dgs/help.md +22 -0
- package/commands/dgs/import-spec.md +36 -0
- package/commands/dgs/init-product.md +28 -0
- package/commands/dgs/insert-phase.md +32 -0
- package/commands/dgs/join-discord.md +18 -0
- package/commands/dgs/list-docs.md +40 -0
- package/commands/dgs/list-ideas.md +42 -0
- package/commands/dgs/list-jobs.md +22 -0
- package/commands/dgs/list-phase-assumptions.md +46 -0
- package/commands/dgs/list-projects.md +57 -0
- package/commands/dgs/list-specs.md +40 -0
- package/commands/dgs/map-codebase.md +92 -0
- package/commands/dgs/new-milestone.md +44 -0
- package/commands/dgs/new-project.md +42 -0
- package/commands/dgs/node-repair.md +26 -0
- package/commands/dgs/overlap-check.md +20 -0
- package/commands/dgs/pause-work.md +38 -0
- package/commands/dgs/plan-milestone-gaps.md +34 -0
- package/commands/dgs/plan-phase.md +44 -0
- package/commands/dgs/progress.md +24 -0
- package/commands/dgs/quick.md +41 -0
- package/commands/dgs/reactivate-project.md +70 -0
- package/commands/dgs/reapply-patches.md +110 -0
- package/commands/dgs/refine-spec.md +38 -0
- package/commands/dgs/reject-idea.md +43 -0
- package/commands/dgs/remove-doc.md +44 -0
- package/commands/dgs/remove-phase.md +31 -0
- package/commands/dgs/remove-repo.md +69 -0
- package/commands/dgs/research-idea.md +43 -0
- package/commands/dgs/research-phase.md +189 -0
- package/commands/dgs/restore-idea.md +45 -0
- package/commands/dgs/resume-work.md +40 -0
- package/commands/dgs/rollback-job.md +24 -0
- package/commands/dgs/run-job.md +35 -0
- package/commands/dgs/search.md +40 -0
- package/commands/dgs/set-profile.md +34 -0
- package/commands/dgs/settings.md +38 -0
- package/commands/dgs/switch-project.md +58 -0
- package/commands/dgs/undo-consolidation.md +42 -0
- package/commands/dgs/update-idea.md +44 -0
- package/commands/dgs/update.md +37 -0
- package/commands/dgs/validate-phase.md +35 -0
- package/commands/dgs/verify-work.md +39 -0
- package/commands/dgs/write-spec.md +49 -0
- package/deliver-great-systems/.planning/phases/09-backend-wiring-and-error-handling/09-01-SUMMARY.md +84 -0
- package/deliver-great-systems/.planning/phases/09-backend-wiring-and-error-handling/09-02-SUMMARY.md +86 -0
- package/deliver-great-systems/.planning/phases/10-v1-to-v2-migration-flow/10-01-SUMMARY.md +85 -0
- package/deliver-great-systems/bin/dgs-tools.cjs +1444 -0
- package/deliver-great-systems/bin/lib/auto-test.cjs +1365 -0
- package/deliver-great-systems/bin/lib/commands.cjs +570 -0
- package/deliver-great-systems/bin/lib/config.cjs +417 -0
- package/deliver-great-systems/bin/lib/conflict-agent.cjs +1063 -0
- package/deliver-great-systems/bin/lib/conflict-agent.test.cjs +554 -0
- package/deliver-great-systems/bin/lib/context.cjs +929 -0
- package/deliver-great-systems/bin/lib/context.test.cjs +693 -0
- package/deliver-great-systems/bin/lib/core.cjs +744 -0
- package/deliver-great-systems/bin/lib/core.test.cjs +822 -0
- package/deliver-great-systems/bin/lib/docs.cjs +919 -0
- package/deliver-great-systems/bin/lib/docs.test.cjs +211 -0
- package/deliver-great-systems/bin/lib/execution.cjs +705 -0
- package/deliver-great-systems/bin/lib/execution.test.cjs +1472 -0
- package/deliver-great-systems/bin/lib/frontmatter.cjs +324 -0
- package/deliver-great-systems/bin/lib/ideas.cjs +1406 -0
- package/deliver-great-systems/bin/lib/ideas.test.cjs +1417 -0
- package/deliver-great-systems/bin/lib/identity.cjs +125 -0
- package/deliver-great-systems/bin/lib/init.cjs +1114 -0
- package/deliver-great-systems/bin/lib/init.test.cjs +1271 -0
- package/deliver-great-systems/bin/lib/jobs.cjs +2015 -0
- package/deliver-great-systems/bin/lib/jobs.test.cjs +2619 -0
- package/deliver-great-systems/bin/lib/merge-conflicts.cjs +654 -0
- package/deliver-great-systems/bin/lib/merge-conflicts.test.cjs +370 -0
- package/deliver-great-systems/bin/lib/migration.cjs +352 -0
- package/deliver-great-systems/bin/lib/migration.test.cjs +582 -0
- package/deliver-great-systems/bin/lib/milestone.cjs +243 -0
- package/deliver-great-systems/bin/lib/overlap.cjs +437 -0
- package/deliver-great-systems/bin/lib/overlap.test.cjs +747 -0
- package/deliver-great-systems/bin/lib/path-audit.test.cjs +384 -0
- package/deliver-great-systems/bin/lib/paths.cjs +144 -0
- package/deliver-great-systems/bin/lib/paths.test.cjs +486 -0
- package/deliver-great-systems/bin/lib/phase.cjs +910 -0
- package/deliver-great-systems/bin/lib/projects.cjs +691 -0
- package/deliver-great-systems/bin/lib/projects.test.cjs +871 -0
- package/deliver-great-systems/bin/lib/repos.cjs +1432 -0
- package/deliver-great-systems/bin/lib/repos.test.cjs +1882 -0
- package/deliver-great-systems/bin/lib/roadmap.cjs +305 -0
- package/deliver-great-systems/bin/lib/search.cjs +570 -0
- package/deliver-great-systems/bin/lib/specs.cjs +1303 -0
- package/deliver-great-systems/bin/lib/state.cjs +893 -0
- package/deliver-great-systems/bin/lib/template.cjs +228 -0
- package/deliver-great-systems/bin/lib/test-helpers.cjs +291 -0
- package/deliver-great-systems/bin/lib/verify.cjs +796 -0
- package/deliver-great-systems/references/checkpoints.md +776 -0
- package/deliver-great-systems/references/conflict-resolution.md +66 -0
- package/deliver-great-systems/references/context-tiers.md +166 -0
- package/deliver-great-systems/references/continuation-format.md +249 -0
- package/deliver-great-systems/references/decimal-phase-calculation.md +67 -0
- package/deliver-great-systems/references/git-integration.md +250 -0
- package/deliver-great-systems/references/git-planning-commit.md +40 -0
- package/deliver-great-systems/references/model-profile-resolution.md +36 -0
- package/deliver-great-systems/references/model-profiles.md +95 -0
- package/deliver-great-systems/references/phase-argument-parsing.md +61 -0
- package/deliver-great-systems/references/planning-config.md +224 -0
- package/deliver-great-systems/references/questioning.md +162 -0
- package/deliver-great-systems/references/spec-review-loop.md +177 -0
- package/deliver-great-systems/references/tdd.md +265 -0
- package/deliver-great-systems/references/ui-brand.md +160 -0
- package/deliver-great-systems/references/verification-patterns.md +612 -0
- package/deliver-great-systems/templates/DEBUG.md +166 -0
- package/deliver-great-systems/templates/UAT.md +251 -0
- package/deliver-great-systems/templates/VALIDATION.md +95 -0
- package/deliver-great-systems/templates/claude-md.md +74 -0
- package/deliver-great-systems/templates/codebase/architecture.md +257 -0
- package/deliver-great-systems/templates/codebase/concerns.md +312 -0
- package/deliver-great-systems/templates/codebase/conventions.md +309 -0
- package/deliver-great-systems/templates/codebase/integrations.md +282 -0
- package/deliver-great-systems/templates/codebase/stack.md +188 -0
- package/deliver-great-systems/templates/codebase/structure.md +287 -0
- package/deliver-great-systems/templates/codebase/testing.md +482 -0
- package/deliver-great-systems/templates/config.json +38 -0
- package/deliver-great-systems/templates/context.md +354 -0
- package/deliver-great-systems/templates/continue-here.md +80 -0
- package/deliver-great-systems/templates/debug-subagent-prompt.md +93 -0
- package/deliver-great-systems/templates/discovery.md +148 -0
- package/deliver-great-systems/templates/milestone-archive.md +125 -0
- package/deliver-great-systems/templates/milestone.md +117 -0
- package/deliver-great-systems/templates/phase-prompt.md +615 -0
- package/deliver-great-systems/templates/planner-subagent-prompt.md +119 -0
- package/deliver-great-systems/templates/project.md +186 -0
- package/deliver-great-systems/templates/requirements.md +233 -0
- package/deliver-great-systems/templates/research-project/ARCHITECTURE.md +206 -0
- package/deliver-great-systems/templates/research-project/FEATURES.md +149 -0
- package/deliver-great-systems/templates/research-project/PITFALLS.md +202 -0
- package/deliver-great-systems/templates/research-project/STACK.md +122 -0
- package/deliver-great-systems/templates/research-project/SUMMARY.md +172 -0
- package/deliver-great-systems/templates/research.md +554 -0
- package/deliver-great-systems/templates/retrospective.md +54 -0
- package/deliver-great-systems/templates/roadmap.md +204 -0
- package/deliver-great-systems/templates/state.md +178 -0
- package/deliver-great-systems/templates/summary-complex.md +59 -0
- package/deliver-great-systems/templates/summary-minimal.md +41 -0
- package/deliver-great-systems/templates/summary-standard.md +48 -0
- package/deliver-great-systems/templates/summary.md +253 -0
- package/deliver-great-systems/templates/user-setup.md +313 -0
- package/deliver-great-systems/templates/verification-report.md +324 -0
- package/deliver-great-systems/workflows/add-doc.md +151 -0
- package/deliver-great-systems/workflows/add-idea.md +96 -0
- package/deliver-great-systems/workflows/add-phase.md +120 -0
- package/deliver-great-systems/workflows/add-tests.md +359 -0
- package/deliver-great-systems/workflows/add-todo.md +162 -0
- package/deliver-great-systems/workflows/approve-spec.md +194 -0
- package/deliver-great-systems/workflows/audit-milestone.md +364 -0
- package/deliver-great-systems/workflows/audit-phase.md +462 -0
- package/deliver-great-systems/workflows/cancel-job.md +108 -0
- package/deliver-great-systems/workflows/check-todos.md +181 -0
- package/deliver-great-systems/workflows/cleanup.md +247 -0
- package/deliver-great-systems/workflows/codereview.md +526 -0
- package/deliver-great-systems/workflows/complete-milestone.md +1298 -0
- package/deliver-great-systems/workflows/consolidate-ideas.md +365 -0
- package/deliver-great-systems/workflows/create-milestone-job.md +177 -0
- package/deliver-great-systems/workflows/develop-idea.md +544 -0
- package/deliver-great-systems/workflows/diagnose-issues.md +231 -0
- package/deliver-great-systems/workflows/discovery-phase.md +301 -0
- package/deliver-great-systems/workflows/discuss-idea.md +263 -0
- package/deliver-great-systems/workflows/discuss-phase.md +733 -0
- package/deliver-great-systems/workflows/execute-phase.md +571 -0
- package/deliver-great-systems/workflows/execute-plan.md +592 -0
- package/deliver-great-systems/workflows/find-related-ideas.md +271 -0
- package/deliver-great-systems/workflows/health.md +173 -0
- package/deliver-great-systems/workflows/help.md +997 -0
- package/deliver-great-systems/workflows/import-spec.md +381 -0
- package/deliver-great-systems/workflows/init-product.md +767 -0
- package/deliver-great-systems/workflows/insert-phase.md +138 -0
- package/deliver-great-systems/workflows/list-docs.md +119 -0
- package/deliver-great-systems/workflows/list-ideas.md +154 -0
- package/deliver-great-systems/workflows/list-jobs.md +89 -0
- package/deliver-great-systems/workflows/list-phase-assumptions.md +192 -0
- package/deliver-great-systems/workflows/list-specs.md +101 -0
- package/deliver-great-systems/workflows/map-codebase.md +621 -0
- package/deliver-great-systems/workflows/new-milestone.md +591 -0
- package/deliver-great-systems/workflows/new-project.md +1113 -0
- package/deliver-great-systems/workflows/node-repair.md +94 -0
- package/deliver-great-systems/workflows/overlap-check.md +86 -0
- package/deliver-great-systems/workflows/pause-work.md +134 -0
- package/deliver-great-systems/workflows/plan-milestone-gaps.md +306 -0
- package/deliver-great-systems/workflows/plan-phase.md +698 -0
- package/deliver-great-systems/workflows/progress.md +386 -0
- package/deliver-great-systems/workflows/quick.md +845 -0
- package/deliver-great-systems/workflows/refine-spec.md +275 -0
- package/deliver-great-systems/workflows/reject-idea.md +109 -0
- package/deliver-great-systems/workflows/remove-doc.md +117 -0
- package/deliver-great-systems/workflows/remove-phase.md +163 -0
- package/deliver-great-systems/workflows/research-idea.md +325 -0
- package/deliver-great-systems/workflows/research-phase.md +81 -0
- package/deliver-great-systems/workflows/restore-idea.md +101 -0
- package/deliver-great-systems/workflows/resume-project.md +311 -0
- package/deliver-great-systems/workflows/rollback-job.md +130 -0
- package/deliver-great-systems/workflows/run-job.md +498 -0
- package/deliver-great-systems/workflows/search.md +130 -0
- package/deliver-great-systems/workflows/set-profile.md +83 -0
- package/deliver-great-systems/workflows/settings.md +470 -0
- package/deliver-great-systems/workflows/transition.md +563 -0
- package/deliver-great-systems/workflows/undo-consolidation.md +155 -0
- package/deliver-great-systems/workflows/update-idea.md +157 -0
- package/deliver-great-systems/workflows/update.md +242 -0
- package/deliver-great-systems/workflows/validate-phase.md +177 -0
- package/deliver-great-systems/workflows/verify-phase.md +253 -0
- package/deliver-great-systems/workflows/verify-work.md +671 -0
- package/deliver-great-systems/workflows/write-spec.md +450 -0
- package/hooks/dist/dgs-check-update.js +62 -0
- package/hooks/dist/dgs-context-monitor.js +141 -0
- package/hooks/dist/dgs-statusline.js +115 -0
- package/package.json +60 -0
- package/scripts/build-hooks.js +43 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Structured conversational workflow for iteratively refining a spec through dialogue. Loads the spec, presents a summary, then conducts a multi-turn editing session where Claude acts as a collaborative thinking partner -- proposing changes, pushing back on conflicts, and referencing codebase context. All changes are accumulated in working memory and written atomically at the end of the session.
|
|
3
|
+
|
|
4
|
+
Supports section targeting with `--section` to focus on a single section, version increment on save (+0.1), and warns when refining a final-status spec (which moves it back to draft). Appends a "Refined" entry to the Refinement Log and commits the result.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<context_tier>planning</context_tier>
|
|
8
|
+
|
|
9
|
+
<required_reading>
|
|
10
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
11
|
+
</required_reading>
|
|
12
|
+
|
|
13
|
+
<process>
|
|
14
|
+
|
|
15
|
+
<step name="initialize" priority="first">
|
|
16
|
+
Load planning context:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
INIT=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs init milestone-op)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Extract: `project_root`, `config_path` as needed by the workflow.
|
|
23
|
+
|
|
24
|
+
Load planning-tier context files (spec scope added after slug is parsed):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier planning --raw 2>/dev/null)
|
|
28
|
+
```
|
|
29
|
+
</step>
|
|
30
|
+
|
|
31
|
+
<step name="parse_arguments">
|
|
32
|
+
Extract the spec slug and optional flags from `$ARGUMENTS`.
|
|
33
|
+
|
|
34
|
+
**Spec slug extraction:**
|
|
35
|
+
- The first positional argument is the spec slug (required).
|
|
36
|
+
- If no argument is provided, display an error and stop:
|
|
37
|
+
```
|
|
38
|
+
Usage: /dgs:refine-spec <spec-slug> [--section <N>]
|
|
39
|
+
```
|
|
40
|
+
- Store the value as `SPEC_SLUG`.
|
|
41
|
+
|
|
42
|
+
**Section flag extraction:**
|
|
43
|
+
- Scan `$ARGUMENTS` for `--section` followed by a value.
|
|
44
|
+
- If `--section` is present with a value (number or name): store as `SECTION_TARGET`.
|
|
45
|
+
- If `--section` is present with no value: display an error and stop:
|
|
46
|
+
```
|
|
47
|
+
Usage: --section requires a section number or name.
|
|
48
|
+
```
|
|
49
|
+
- If `--section` is absent: `SECTION_TARGET` is null (refine entire spec).
|
|
50
|
+
</step>
|
|
51
|
+
|
|
52
|
+
<step name="load_spec">
|
|
53
|
+
Find the spec and load its full content.
|
|
54
|
+
|
|
55
|
+
1. Run the validate command to locate the spec and get its identity:
|
|
56
|
+
```bash
|
|
57
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs specs validate --id "$SPEC_SLUG"
|
|
58
|
+
```
|
|
59
|
+
2. Parse the JSON output to extract: `id`, `path`, and frontmatter fields.
|
|
60
|
+
3. Read the spec file directly using the Read tool to get the full content.
|
|
61
|
+
4. Parse the content:
|
|
62
|
+
- **Status** (after normalization): `draft` or `final`
|
|
63
|
+
- **Version** (default `0.1` if not present)
|
|
64
|
+
- **approved_date** (if present)
|
|
65
|
+
- **Title**
|
|
66
|
+
- **Body** (everything after frontmatter)
|
|
67
|
+
5. Build a section index from `## ` headings in the body:
|
|
68
|
+
```
|
|
69
|
+
[{ number: 1, name: "Problem", startLine: N, endLine: M }, ...]
|
|
70
|
+
```
|
|
71
|
+
Each section runs from its `## ` heading (inclusive) to the line before the next `## ` heading (exclusive) or end of body.
|
|
72
|
+
</step>
|
|
73
|
+
|
|
74
|
+
<step name="final_status_warning" condition="status === final">
|
|
75
|
+
If the spec's status is `final`:
|
|
76
|
+
|
|
77
|
+
1. Display a warning:
|
|
78
|
+
```
|
|
79
|
+
This spec is approved (v{version}, approved {approved_date}). Refinement will move it back to draft.
|
|
80
|
+
```
|
|
81
|
+
2. Use AskUserQuestion: "Proceed with refinement? (yes/no)"
|
|
82
|
+
3. If the user declines (answers "no", "n", or "cancel"):
|
|
83
|
+
- Display: "Refinement cancelled."
|
|
84
|
+
- Stop execution.
|
|
85
|
+
4. If the user confirms (answers "yes", "y", or any affirmative):
|
|
86
|
+
- Set `WAS_FINAL = true` for use in the atomic save step.
|
|
87
|
+
|
|
88
|
+
If the spec's status is `draft`: proceed without warning.
|
|
89
|
+
</step>
|
|
90
|
+
|
|
91
|
+
<step name="load_context">
|
|
92
|
+
Read all codebase analysis documents:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ls ${project_root}/codebase/*.md 2>/dev/null
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For each `.md` file found, read it using the Read tool. If the codebase directory does not exist or contains no `.md` files, proceed without codebase context.
|
|
99
|
+
|
|
100
|
+
Also load product docs:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
ls ${project_root}/docs/product/*.md 2>/dev/null
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Read each markdown file found. If the directory does not exist, proceed without it.
|
|
107
|
+
|
|
108
|
+
Context is used to inform the conversation -- for example, when discussing implementation notes, Claude can reference real architecture and stack choices.
|
|
109
|
+
|
|
110
|
+
**Load spec supporting documents:**
|
|
111
|
+
|
|
112
|
+
1. Derive the spec's docs directory path:
|
|
113
|
+
```bash
|
|
114
|
+
SPEC_DOCS_DIR="$(dirname "${SPEC_FILE_PATH}")/docs"
|
|
115
|
+
```
|
|
116
|
+
Or derive from spec slug: `${project_root}/specs/${SPEC_SLUG}/docs`
|
|
117
|
+
|
|
118
|
+
2. If the docs/ directory exists, read all files following the docs/ loading pattern:
|
|
119
|
+
- **Text files** (.md, .txt, .json, .yaml, .yml): Read with Read tool
|
|
120
|
+
- **Image files** (.png, .jpg, .jpeg, .gif, .svg, .webp): Read with Read tool (multimodal). Cap at 5 images.
|
|
121
|
+
- **PDF files** (.pdf): Prefer .txt sidecar, fallback to 5 pages of PDF via Read tool
|
|
122
|
+
- **Other files**: skip silently
|
|
123
|
+
- If docs/ does not exist: silent skip
|
|
124
|
+
- If any file is unreadable: skip silently
|
|
125
|
+
|
|
126
|
+
3. Load source idea docs:
|
|
127
|
+
Read the spec's frontmatter to find `source_ideas` (array of idea filenames). For each source idea:
|
|
128
|
+
a. Derive the idea docs path (same pattern as write-spec: strip prefix/suffix for slug, check `${project_root}/ideas/pending/{slug}/docs/` or done/rejected paths)
|
|
129
|
+
b. If docs/ directory exists, read all files using the same pattern above
|
|
130
|
+
c. Idea docs are loaded first (source material), then spec docs (refinements). If too many, cap spec docs.
|
|
131
|
+
|
|
132
|
+
Total file cap: read up to 10 text docs + 5 images across all docs/ directories. If more exist, prioritize spec docs over idea docs (idea docs are source material already incorporated; spec docs are newer refinements).
|
|
133
|
+
</step>
|
|
134
|
+
|
|
135
|
+
<step name="present_summary">
|
|
136
|
+
Display a summary header for the spec:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
## Refining: {title}
|
|
140
|
+
|
|
141
|
+
Status: {status} | Version: {version} | Sections: {count}
|
|
142
|
+
{If open questions section exists: "Open questions: present"}
|
|
143
|
+
{If milestones linked: "Milestones: {list}"}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**If `--section` is set (section-targeted mode):**
|
|
147
|
+
|
|
148
|
+
1. Validate the section target exists:
|
|
149
|
+
- If `SECTION_TARGET` is a number: look up by 1-based index in the section index.
|
|
150
|
+
- If `SECTION_TARGET` is a name: match by case-insensitive substring against heading text.
|
|
151
|
+
2. If not found:
|
|
152
|
+
- Display: "Section not found. Available sections:" followed by a numbered list of all sections.
|
|
153
|
+
- Stop execution.
|
|
154
|
+
3. If the name matches multiple sections: use the first match and inform the user which section was selected.
|
|
155
|
+
4. Display only the targeted section content.
|
|
156
|
+
5. Tell the user: "Focusing on section {N}: {name}"
|
|
157
|
+
6. Ask using AskUserQuestion: "What would you like to change in this section?"
|
|
158
|
+
|
|
159
|
+
**If no `--section` (full-spec mode):**
|
|
160
|
+
|
|
161
|
+
1. Display a numbered section list.
|
|
162
|
+
2. Ask using AskUserQuestion: "What would you like to refine? (describe changes, or enter a section number to focus)"
|
|
163
|
+
</step>
|
|
164
|
+
|
|
165
|
+
<step name="conversational_refinement">
|
|
166
|
+
Enter an interactive dialogue using AskUserQuestion for each turn of conversation.
|
|
167
|
+
|
|
168
|
+
**Tone: Collaborative thinking partner -- like a cofounder reviewing a spec.**
|
|
169
|
+
|
|
170
|
+
- Propose specific textual changes with reasoning (e.g., "I'd rephrase this requirement to..." with an explanation of why).
|
|
171
|
+
- Push back when proposed changes conflict with existing requirements or when removing something that seems important.
|
|
172
|
+
- Reference codebase context (from load_context step) when discussing implementation notes or technical decisions.
|
|
173
|
+
- Ask clarifying questions when the user's request is ambiguous.
|
|
174
|
+
- Adapt depth to change scope: quick fix = 1-2 exchanges, major restructuring = many exchanges.
|
|
175
|
+
|
|
176
|
+
**Accumulation rule:** Claude tracks all agreed changes in working memory. Does NOT write to disk during the conversation. The spec file on disk remains unchanged until the atomic save step.
|
|
177
|
+
|
|
178
|
+
**Multiple rounds expected.** Continue the conversation until the user indicates they are done.
|
|
179
|
+
|
|
180
|
+
**Exit signal detection:**
|
|
181
|
+
- User says "done", "save", "that's all", "looks good", "ship it", or similar affirmative completion phrases: proceed to generate_summary step.
|
|
182
|
+
- User says "cancel" or "abort": discard all changes, display "Refinement cancelled. No changes saved." and stop execution.
|
|
183
|
+
- "Cancel" means discard; "done" means save. These are distinct exit signals.
|
|
184
|
+
</step>
|
|
185
|
+
|
|
186
|
+
<step name="generate_summary">
|
|
187
|
+
Generate a brief (1-2 sentence) summary of what changed during the session.
|
|
188
|
+
|
|
189
|
+
This summary becomes the `summary` parameter for `add-log-entry` and appears in the commit message.
|
|
190
|
+
|
|
191
|
+
**Examples:**
|
|
192
|
+
- "Clarified P0 requirements for error handling, added caching non-goal, expanded implementation notes"
|
|
193
|
+
- "Tightened success metrics with quantitative thresholds, removed duplicate user story"
|
|
194
|
+
- "Refined section 5: Requirements -- narrowed P0 scope to three core features"
|
|
195
|
+
|
|
196
|
+
If a section was targeted via `--section`, note which section in the summary (e.g., "Refined section 5: Requirements -- ...").
|
|
197
|
+
</step>
|
|
198
|
+
|
|
199
|
+
<step name="atomic_save">
|
|
200
|
+
All writes happen here, atomically at the end of the session. No file changes occur before this step.
|
|
201
|
+
|
|
202
|
+
1. **Re-read the current spec file from disk** using the Read tool. This ensures we have the latest content, including any frontmatter that may have been modified by other processes.
|
|
203
|
+
|
|
204
|
+
2. **Detect the format** from the content:
|
|
205
|
+
- YAML frontmatter: file starts with `---`
|
|
206
|
+
- Bold-key format: file starts with `**id:**` or similar bold-key lines
|
|
207
|
+
- Use the detected format for write-back.
|
|
208
|
+
|
|
209
|
+
3. **Parse the frontmatter** from the re-read content.
|
|
210
|
+
|
|
211
|
+
4. **Compute the new version:**
|
|
212
|
+
- Read the current version from frontmatter (default `0.1` if not present).
|
|
213
|
+
- Strip any `v` prefix if present (e.g., `v0.1` -> `0.1`).
|
|
214
|
+
- Treat an integer without decimal as `N.0` (e.g., `1` -> `1.0`).
|
|
215
|
+
- Compute: `(parseFloat(currentVersion) + 0.1).toFixed(1)`.
|
|
216
|
+
- Store as `NEW_VERSION`.
|
|
217
|
+
|
|
218
|
+
5. **Update frontmatter fields:**
|
|
219
|
+
- `version` = `NEW_VERSION`
|
|
220
|
+
- `status` = `draft` (only if `WAS_FINAL` is true; otherwise leave unchanged)
|
|
221
|
+
- `updated` = today's date in `YYYY-MM-DD` format
|
|
222
|
+
- Preserve all other frontmatter fields unchanged (id, title, author, approved_date, milestones, etc.)
|
|
223
|
+
- Note: `approved_date` is NOT cleared -- per Phase 92 decision, it records when the spec was last approved.
|
|
224
|
+
|
|
225
|
+
6. **Replace the body with the refined version:**
|
|
226
|
+
- If `--section` was used: splice the modified section back into the full body at the correct position. All other sections remain exactly as-is. Match section boundaries from the section index built in load_spec.
|
|
227
|
+
- If no `--section`: replace the entire body with the accumulated changes.
|
|
228
|
+
|
|
229
|
+
7. **Reconstruct the complete file** using the detected format:
|
|
230
|
+
- YAML format: `---\n{yaml frontmatter}\n---\n\n{body}`
|
|
231
|
+
- Bold-key format: `{bold-key lines}\n\n{body}`
|
|
232
|
+
|
|
233
|
+
8. **Write the file** using the Write tool.
|
|
234
|
+
|
|
235
|
+
9. **Append the Refinement Log entry:**
|
|
236
|
+
```bash
|
|
237
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs specs add-log-entry --id "$SPEC_SLUG" --date "$(date +%Y-%m-%d)" --version "$NEW_VERSION" --action Refined --summary "$SUMMARY"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
10. **Commit the changes:**
|
|
241
|
+
```bash
|
|
242
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "refine(spec): $SPEC_SLUG v$NEW_VERSION -- $SUMMARY" --files "$SPEC_FILE_PATH"
|
|
243
|
+
```
|
|
244
|
+
</step>
|
|
245
|
+
|
|
246
|
+
<step name="confirmation">
|
|
247
|
+
Display the refinement confirmation:
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
Spec refined: {title} (v{new-version})
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
If the spec was moved from final back to draft (i.e., `WAS_FINAL` was true):
|
|
254
|
+
```
|
|
255
|
+
Note: Moved from final back to draft.
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Suggest next steps:
|
|
259
|
+
```
|
|
260
|
+
Run /dgs:approve-spec {spec-slug} when you're ready to approve the updated spec.
|
|
261
|
+
```
|
|
262
|
+
</step>
|
|
263
|
+
|
|
264
|
+
</process>
|
|
265
|
+
|
|
266
|
+
<success_criteria>
|
|
267
|
+
- [ ] Spec body updated with agreed changes
|
|
268
|
+
- [ ] Version incremented (minor +0.1)
|
|
269
|
+
- [ ] Refinement Log entry with "Refined" action appended
|
|
270
|
+
- [ ] Section targeting works (--section by number or name)
|
|
271
|
+
- [ ] Final-status specs show demotion warning before proceeding
|
|
272
|
+
- [ ] Cancelled sessions make no file changes
|
|
273
|
+
- [ ] All changes written atomically at save step
|
|
274
|
+
- [ ] Changes committed to git
|
|
275
|
+
</success_criteria>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Reject a pending idea by moving it from pending/ to rejected/ state. Confirmation is always required (no --force bypass). An optional rejection reason is prompted and appended to the idea file body for audit history.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<context_tier>lite</context_tier>
|
|
6
|
+
|
|
7
|
+
<required_reading>
|
|
8
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
9
|
+
</required_reading>
|
|
10
|
+
|
|
11
|
+
<process>
|
|
12
|
+
|
|
13
|
+
<step name="load_context" priority="first">
|
|
14
|
+
Load project context via tier system:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier lite --raw 2>/dev/null)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use `TIER_FILES` JSON `files` array for project context (PROJECT.md, STATE.md, config.json).
|
|
21
|
+
</step>
|
|
22
|
+
|
|
23
|
+
<step name="parse_arguments">
|
|
24
|
+
Extract idea ID from arguments (first positional arg).
|
|
25
|
+
|
|
26
|
+
If no ID provided, list pending ideas and prompt user to select one:
|
|
27
|
+
```bash
|
|
28
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs ideas list --state pending
|
|
29
|
+
```
|
|
30
|
+
Parse JSON result and display pending ideas. Use AskUserQuestion to let user pick an idea by ID.
|
|
31
|
+
</step>
|
|
32
|
+
|
|
33
|
+
<step name="find_and_display_idea">
|
|
34
|
+
Find the idea by ID among pending ideas:
|
|
35
|
+
```bash
|
|
36
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs ideas list --state pending
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Parse the JSON result and locate the idea matching the provided ID.
|
|
40
|
+
|
|
41
|
+
Read the idea file to get its title and first few lines of content:
|
|
42
|
+
```bash
|
|
43
|
+
cat ${path}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Display the idea title and a preview of its content so the user knows what they are rejecting.
|
|
47
|
+
|
|
48
|
+
If idea not found in pending, error:
|
|
49
|
+
```
|
|
50
|
+
Idea #${id} not found in pending ideas. Only pending ideas can be rejected.
|
|
51
|
+
```
|
|
52
|
+
Stop execution.
|
|
53
|
+
</step>
|
|
54
|
+
|
|
55
|
+
<step name="confirm">
|
|
56
|
+
Confirmation is always required. There is no --force flag to skip this step.
|
|
57
|
+
|
|
58
|
+
Use AskUserQuestion:
|
|
59
|
+
- header: "Reject Idea #${id}?"
|
|
60
|
+
- question: "Are you sure you want to reject '${title}'?"
|
|
61
|
+
- options: "Yes, reject it", "No, cancel"
|
|
62
|
+
|
|
63
|
+
If user selects "No, cancel":
|
|
64
|
+
Output: `Cancelled.`
|
|
65
|
+
Stop execution.
|
|
66
|
+
</step>
|
|
67
|
+
|
|
68
|
+
<step name="ask_reason">
|
|
69
|
+
Prompt for an optional rejection reason.
|
|
70
|
+
|
|
71
|
+
Use AskUserQuestion:
|
|
72
|
+
- header: "Rejection Reason"
|
|
73
|
+
- question: "Why are you rejecting this idea? (optional, press Enter to skip)"
|
|
74
|
+
|
|
75
|
+
Allow empty/skip response. If the user provides a reason, it will be appended to the idea file body by the ideas module.
|
|
76
|
+
</step>
|
|
77
|
+
|
|
78
|
+
<step name="execute_rejection">
|
|
79
|
+
Execute the rejection via dgs-tools:
|
|
80
|
+
```bash
|
|
81
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs ideas reject --id "${id}" --reason "${reason}"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If no reason was provided, omit the `--reason` flag:
|
|
85
|
+
```bash
|
|
86
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs ideas reject --id "${id}"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The ideas.cjs module handles:
|
|
90
|
+
- Appending rejection reason to the idea file body (if provided)
|
|
91
|
+
- Moving the file from pending/ to rejected/ via git mv
|
|
92
|
+
- Creating an auto-commit for the state transition
|
|
93
|
+
</step>
|
|
94
|
+
|
|
95
|
+
<step name="confirm_output">
|
|
96
|
+
Output: `Idea #${id} rejected.`
|
|
97
|
+
|
|
98
|
+
If a reason was provided, also show: `Reason: ${reason}`
|
|
99
|
+
</step>
|
|
100
|
+
|
|
101
|
+
</process>
|
|
102
|
+
|
|
103
|
+
<success_criteria>
|
|
104
|
+
- [ ] Confirmation required before rejection (no --force bypass)
|
|
105
|
+
- [ ] Rejection reason prompted (optional, can be skipped)
|
|
106
|
+
- [ ] File moved from pending/ to rejected/ via git mv
|
|
107
|
+
- [ ] Reason appended to file body if provided
|
|
108
|
+
- [ ] Git commit created automatically for the state transition
|
|
109
|
+
</success_criteria>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Remove a document from its scope or move it between scopes. Removal requires mandatory confirmation (no --force bypass) and cleans up all sidecars (.extracted.txt, .summary.txt) plus updates INDEX.md. Move mode relocates a document with its sidecars between scopes via --move flag.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<context_tier>lite</context_tier>
|
|
6
|
+
|
|
7
|
+
<required_reading>
|
|
8
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
9
|
+
</required_reading>
|
|
10
|
+
|
|
11
|
+
<process>
|
|
12
|
+
|
|
13
|
+
<step name="load_context" priority="first">
|
|
14
|
+
Load project context via tier system:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier lite --raw 2>/dev/null)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use `TIER_FILES` JSON `files` array for project context (PROJECT.md, STATE.md, config.json).
|
|
21
|
+
</step>
|
|
22
|
+
|
|
23
|
+
<step name="parse_arguments">
|
|
24
|
+
Parse `$ARGUMENTS` for required and optional flags:
|
|
25
|
+
|
|
26
|
+
**Required:**
|
|
27
|
+
- `slug`: first positional argument (the document slug, e.g., `q4-budget.pdf`)
|
|
28
|
+
- `--scope <product|idea|spec>`: the scope containing the document
|
|
29
|
+
- `--scope-id <id>`: (optional for product scope, required for idea/spec)
|
|
30
|
+
|
|
31
|
+
**Optional move flags:**
|
|
32
|
+
- `--move`: flag indicating move mode instead of remove
|
|
33
|
+
- `--to-scope <product|idea|spec>`: target scope for move
|
|
34
|
+
- `--to-id <id>`: target scope ID for move (required for idea/spec targets)
|
|
35
|
+
|
|
36
|
+
Determine mode:
|
|
37
|
+
- If `--move` flag detected: set `mode = move`
|
|
38
|
+
- Validate `--to-scope` is provided (error if missing: "Move requires --to-scope flag.")
|
|
39
|
+
- Validate `--to-id` is provided if to-scope is idea or spec (error if missing)
|
|
40
|
+
- Otherwise: set `mode = remove`
|
|
41
|
+
|
|
42
|
+
If slug or --scope not provided, output usage hint and stop:
|
|
43
|
+
```
|
|
44
|
+
Usage: /dgs:remove-doc <slug> --scope <product|idea|spec> [--scope-id <id>]
|
|
45
|
+
/dgs:remove-doc <slug> --scope <scope> --move --to-scope <scope> --to-id <id>
|
|
46
|
+
```
|
|
47
|
+
</step>
|
|
48
|
+
|
|
49
|
+
<step name="find_document">
|
|
50
|
+
Verify the document exists in the specified scope:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs docs check-duplicate --scope "$scope" --scope-id "$scope_id" --slug "$slug"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Parse JSON result. If the document is not found (`exists: false`):
|
|
57
|
+
- Output: "Document '{slug}' not found in {scope}." and stop
|
|
58
|
+
|
|
59
|
+
If found, note the document details for confirmation display.
|
|
60
|
+
</step>
|
|
61
|
+
|
|
62
|
+
<step name="confirm" condition="mode = remove">
|
|
63
|
+
Mandatory confirmation before removal. There is no --force flag to skip this step.
|
|
64
|
+
|
|
65
|
+
Use AskUserQuestion:
|
|
66
|
+
- question: "Remove '{slug}' from {scope}? This will delete the file and all sidecars (.extracted.txt, .summary.txt). (yes/no)"
|
|
67
|
+
|
|
68
|
+
If user says no or cancels:
|
|
69
|
+
- Output: "Cancelled." and stop
|
|
70
|
+
</step>
|
|
71
|
+
|
|
72
|
+
<step name="execute_remove" condition="mode = remove">
|
|
73
|
+
Remove the document and all sidecars via dgs-tools:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs docs remove --scope "$scope" --scope-id "$scope_id" --slug "$slug"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Parse the result for `files_removed` (list of removed files) and `index_updated` (path to updated INDEX.md).
|
|
80
|
+
|
|
81
|
+
Then git commit:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: remove ${slug} from ${scope}" --files <removed files and updated INDEX.md>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Output: "Document '{slug}' removed from {scope}."
|
|
88
|
+
</step>
|
|
89
|
+
|
|
90
|
+
<step name="execute_move" condition="mode = move">
|
|
91
|
+
Move the document and all sidecars between scopes via dgs-tools:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs docs move --slug "$slug" --from-scope "$scope" --from-id "$scope_id" --to-scope "$to_scope" --to-id "$to_id"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Parse the result for `files_moved` (list of moved files) and `indexes_updated` (source and target INDEX.md paths).
|
|
98
|
+
|
|
99
|
+
Then git commit:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: move ${slug} from ${scope} to ${to_scope}" --files <moved files and updated INDEX.md files>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Output: "Document '{slug}' moved from {scope} to {to_scope}/{to_id}."
|
|
106
|
+
</step>
|
|
107
|
+
|
|
108
|
+
</process>
|
|
109
|
+
|
|
110
|
+
<success_criteria>
|
|
111
|
+
- [ ] Arguments parsed correctly with mode detection (remove vs move)
|
|
112
|
+
- [ ] Document existence verified before action
|
|
113
|
+
- [ ] Confirmation required for removal (no --force bypass)
|
|
114
|
+
- [ ] Removal deletes document + all sidecars + updates INDEX.md
|
|
115
|
+
- [ ] Move relocates document + sidecars between scopes + updates both INDEX.md files
|
|
116
|
+
- [ ] Git commit created for all affected files
|
|
117
|
+
</success_criteria>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Remove an unstarted future phase from the project roadmap, delete its directory, renumber all subsequent phases to maintain a clean linear sequence, and commit the change. The git commit serves as the historical record of removal.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<context_tier>planning</context_tier>
|
|
6
|
+
|
|
7
|
+
<required_reading>
|
|
8
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
9
|
+
</required_reading>
|
|
10
|
+
|
|
11
|
+
<process>
|
|
12
|
+
|
|
13
|
+
<step name="parse_arguments">
|
|
14
|
+
Parse the command arguments:
|
|
15
|
+
- Argument is the phase number to remove (integer or decimal)
|
|
16
|
+
- Example: `/dgs:remove-phase 17` → phase = 17
|
|
17
|
+
- Example: `/dgs:remove-phase 16.1` → phase = 16.1
|
|
18
|
+
|
|
19
|
+
If no argument provided:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
ERROR: Phase number required
|
|
23
|
+
Usage: /dgs:remove-phase <phase-number>
|
|
24
|
+
Example: /dgs:remove-phase 17
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Exit.
|
|
28
|
+
</step>
|
|
29
|
+
|
|
30
|
+
<step name="init_context">
|
|
31
|
+
Load phase operation context:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
INIT=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" init phase-op "${target}")
|
|
35
|
+
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Load planning-tier context files:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier planning --raw 2>/dev/null)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Extract: `phase_found`, `phase_dir`, `phase_number`, `commit_docs`, `roadmap_exists`.
|
|
45
|
+
|
|
46
|
+
Also read STATE.md and ROADMAP.md content for parsing current position.
|
|
47
|
+
</step>
|
|
48
|
+
|
|
49
|
+
<step name="validate_future_phase">
|
|
50
|
+
Verify the phase is a future phase (not started):
|
|
51
|
+
|
|
52
|
+
1. Compare target phase to current phase from STATE.md
|
|
53
|
+
2. Target must be > current phase number
|
|
54
|
+
|
|
55
|
+
If target <= current phase:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
ERROR: Cannot remove Phase {target}
|
|
59
|
+
|
|
60
|
+
Only future phases can be removed:
|
|
61
|
+
- Current phase: {current}
|
|
62
|
+
- Phase {target} is current or completed
|
|
63
|
+
|
|
64
|
+
To abandon current work, use /dgs:pause-work instead.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Exit.
|
|
68
|
+
</step>
|
|
69
|
+
|
|
70
|
+
<step name="confirm_removal">
|
|
71
|
+
Present removal summary and confirm:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Removing Phase {target}: {Name}
|
|
75
|
+
|
|
76
|
+
This will:
|
|
77
|
+
- Delete: ${project_root}/phases/{target}-{slug}/
|
|
78
|
+
- Renumber all subsequent phases
|
|
79
|
+
- Update: ROADMAP.md, STATE.md
|
|
80
|
+
|
|
81
|
+
Proceed? (y/n)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Wait for confirmation.
|
|
85
|
+
</step>
|
|
86
|
+
|
|
87
|
+
<step name="execute_removal">
|
|
88
|
+
**Delegate the entire removal operation to dgs-tools:**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
RESULT=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" phase remove "${target}")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If the phase has executed plans (SUMMARY.md files), dgs-tools will error. Use `--force` only if the user confirms:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
RESULT=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" phase remove "${target}" --force)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The CLI handles:
|
|
101
|
+
- Deleting the phase directory
|
|
102
|
+
- Renumbering all subsequent directories (in reverse order to avoid conflicts)
|
|
103
|
+
- Renaming all files inside renumbered directories (PLAN.md, SUMMARY.md, etc.)
|
|
104
|
+
- Updating ROADMAP.md (removing section, renumbering all phase references, updating dependencies)
|
|
105
|
+
- Updating STATE.md (decrementing phase count)
|
|
106
|
+
|
|
107
|
+
Extract from result: `removed`, `directory_deleted`, `renamed_directories`, `renamed_files`, `roadmap_updated`, `state_updated`.
|
|
108
|
+
</step>
|
|
109
|
+
|
|
110
|
+
<step name="commit">
|
|
111
|
+
Stage and commit the removal:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "chore: remove phase {target} ({original-phase-name})" --files ${project_root}/
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The commit message preserves the historical record of what was removed.
|
|
118
|
+
</step>
|
|
119
|
+
|
|
120
|
+
<step name="completion">
|
|
121
|
+
Present completion summary:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Phase {target} ({original-name}) removed.
|
|
125
|
+
|
|
126
|
+
Changes:
|
|
127
|
+
- Deleted: ${project_root}/phases/{target}-{slug}/
|
|
128
|
+
- Renumbered: {N} directories and {M} files
|
|
129
|
+
- Updated: ROADMAP.md, STATE.md
|
|
130
|
+
- Committed: chore: remove phase {target} ({original-name})
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## What's Next
|
|
135
|
+
|
|
136
|
+
Would you like to:
|
|
137
|
+
- `/dgs:progress` — see updated roadmap status
|
|
138
|
+
- Continue with current phase
|
|
139
|
+
- Review roadmap
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
```
|
|
143
|
+
</step>
|
|
144
|
+
|
|
145
|
+
</process>
|
|
146
|
+
|
|
147
|
+
<anti_patterns>
|
|
148
|
+
|
|
149
|
+
- Don't remove completed phases (have SUMMARY.md files) without --force
|
|
150
|
+
- Don't remove current or past phases
|
|
151
|
+
- Don't manually renumber — use `dgs-tools phase remove` which handles all renumbering
|
|
152
|
+
- Don't add "removed phase" notes to STATE.md — git commit is the record
|
|
153
|
+
- Don't modify completed phase directories
|
|
154
|
+
</anti_patterns>
|
|
155
|
+
|
|
156
|
+
<success_criteria>
|
|
157
|
+
Phase removal is complete when:
|
|
158
|
+
|
|
159
|
+
- [ ] Target phase validated as future/unstarted
|
|
160
|
+
- [ ] `dgs-tools phase remove` executed successfully
|
|
161
|
+
- [ ] Changes committed with descriptive message
|
|
162
|
+
- [ ] User informed of changes
|
|
163
|
+
</success_criteria>
|