@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,365 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Consolidate two or more related pending ideas into a single AI-synthesised idea. Reads all source ideas in full, generates a coherent body that captures the combined intent, merges discussion/research/notes logs with source attribution, presents the result for user review, and delegates to dgs-tools.cjs for the atomic data operation (file creation, source annotation, source moves, git commit).
|
|
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="load_context" priority="first">
|
|
14
|
+
Load planning-tier context files:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier planning --raw 2>/dev/null)
|
|
18
|
+
```
|
|
19
|
+
</step>
|
|
20
|
+
|
|
21
|
+
<step name="parse_arguments">
|
|
22
|
+
Parse `$ARGUMENTS` for idea IDs and optional flags.
|
|
23
|
+
|
|
24
|
+
- Extract all numeric positional arguments as idea IDs (e.g., `/dgs:consolidate-ideas 1 3 17` -> ids=[1, 3, 17])
|
|
25
|
+
- Check for `--title "..."` flag. If present, extract the title string.
|
|
26
|
+
|
|
27
|
+
If no IDs provided, list pending ideas and prompt for selection:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
PENDING=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs ideas list --state pending --raw)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Parse the JSON `ideas` array.
|
|
34
|
+
|
|
35
|
+
**If empty:**
|
|
36
|
+
```
|
|
37
|
+
No pending ideas to consolidate. Run /dgs:add-idea to capture ideas first.
|
|
38
|
+
```
|
|
39
|
+
Exit workflow.
|
|
40
|
+
|
|
41
|
+
**If fewer than 2 pending ideas:**
|
|
42
|
+
```
|
|
43
|
+
Only 1 pending idea found. Consolidation requires at least 2 ideas.
|
|
44
|
+
```
|
|
45
|
+
Exit workflow.
|
|
46
|
+
|
|
47
|
+
**If ideas exist:** Display them as a numbered list showing ID, title, and tags:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
## Pending Ideas
|
|
51
|
+
|
|
52
|
+
| # | ID | Title | Tags |
|
|
53
|
+
|---|-----|-------|------|
|
|
54
|
+
| 1 | 001 | Add retry logic | api, reliability |
|
|
55
|
+
| 2 | 003 | Handle timeouts | api |
|
|
56
|
+
| 3 | 017 | Circuit breaker | api, reliability |
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Use AskUserQuestion: "Which ideas would you like to consolidate? (enter IDs, comma-separated, e.g. 1,3,17 -- minimum 2)"
|
|
60
|
+
|
|
61
|
+
Parse response into idea IDs. Validate at least 2 IDs were provided.
|
|
62
|
+
</step>
|
|
63
|
+
|
|
64
|
+
<step name="validate_sources">
|
|
65
|
+
Validate all source IDs exist and are in pending state:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
ALL_IDEAS=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs ideas list --all --raw)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Parse JSON result. For each provided ID:
|
|
72
|
+
1. Find the idea in the list by matching `id`
|
|
73
|
+
2. Verify the idea exists. If not found: error "Idea #${id} not found." and exit.
|
|
74
|
+
3. Verify the idea is in `pending` state. If not: error "Idea #${id} is in ${state} state. Only pending ideas can be consolidated." and exit.
|
|
75
|
+
|
|
76
|
+
Store the validated ideas with their full metadata (id, title, tags, state, filename, path).
|
|
77
|
+
</step>
|
|
78
|
+
|
|
79
|
+
<step name="load_source_content">
|
|
80
|
+
Read the full content of each source idea file to extract body, notes, discussion log, and research log.
|
|
81
|
+
|
|
82
|
+
For each validated source idea, use the Read tool to load the file at the `path` from the list result.
|
|
83
|
+
|
|
84
|
+
For each idea, extract:
|
|
85
|
+
- `body` -- the main content between frontmatter and first section heading
|
|
86
|
+
- `notes` -- content under `## Notes` heading (if present)
|
|
87
|
+
- `discussionLog` -- content under `## Discussion Log` heading (if present)
|
|
88
|
+
- `researchLog` -- content under `## Research Log` heading (if present)
|
|
89
|
+
- `tags` -- from frontmatter
|
|
90
|
+
- `title` -- from frontmatter
|
|
91
|
+
- `id` -- from frontmatter
|
|
92
|
+
|
|
93
|
+
Store all extracted content per idea for use in synthesis steps.
|
|
94
|
+
</step>
|
|
95
|
+
|
|
96
|
+
<step name="synthesise_body">
|
|
97
|
+
Generate a coherent AI-synthesised body that captures the combined intent of all source ideas.
|
|
98
|
+
|
|
99
|
+
**This is the core creative step.** Do NOT mechanically concatenate the source idea bodies. Instead, read all source bodies and write a fresh, unified description that:
|
|
100
|
+
- Captures the full scope of work implied by all source ideas combined
|
|
101
|
+
- Identifies the common theme or goal that links the ideas
|
|
102
|
+
- Preserves specific technical details, constraints, and requirements from each source
|
|
103
|
+
- Reads as a single cohesive idea description, not as a merged document
|
|
104
|
+
|
|
105
|
+
After the synthesised body, append a provenance line:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
---
|
|
109
|
+
*Consolidated from ideas: #001 (Add retry logic), #003 (Handle timeouts), #017 (Circuit breaker)*
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The provenance line lists each source idea ID and title for traceability.
|
|
113
|
+
|
|
114
|
+
Store the synthesised body (including provenance line) as `synthesised_body`.
|
|
115
|
+
</step>
|
|
116
|
+
|
|
117
|
+
<step name="generate_title">
|
|
118
|
+
Determine the title for the new consolidated idea.
|
|
119
|
+
|
|
120
|
+
**If `--title` was provided in arguments:** Use that title directly.
|
|
121
|
+
|
|
122
|
+
**If no title provided:** Generate a title from the synthesised body and source ideas.
|
|
123
|
+
The title should:
|
|
124
|
+
- Be concise (under 80 characters)
|
|
125
|
+
- Capture the unified theme of all source ideas
|
|
126
|
+
- Not be a mechanical join of source titles (e.g., NOT "Add retry logic and handle timeouts and circuit breaker")
|
|
127
|
+
- Read as a standalone idea title
|
|
128
|
+
|
|
129
|
+
Store as `consolidated_title`.
|
|
130
|
+
</step>
|
|
131
|
+
|
|
132
|
+
<step name="merge_tags">
|
|
133
|
+
Build the deduplicated union of all source idea tags.
|
|
134
|
+
|
|
135
|
+
Collect all tags from all source ideas into a single set. Remove duplicates. Sort alphabetically.
|
|
136
|
+
|
|
137
|
+
Store as `merged_tags` (comma-separated string for CLI, e.g., "api,reliability,error-handling").
|
|
138
|
+
</step>
|
|
139
|
+
|
|
140
|
+
<step name="merge_discussion_logs">
|
|
141
|
+
Merge discussion logs from all source ideas with source attribution and chronological ordering.
|
|
142
|
+
|
|
143
|
+
For each source idea that has a non-empty discussion log:
|
|
144
|
+
1. Parse the discussion log into individual entries (each entry starts with a `### ` heading)
|
|
145
|
+
2. Prefix each entry heading with `[from #ID]` where ID is the source idea's ID (zero-padded to 3 digits)
|
|
146
|
+
- Example: `### 2026-02-15 --- API timeout patterns` becomes `### [from #003] 2026-02-15 --- API timeout patterns`
|
|
147
|
+
3. Extract the date from each entry heading for chronological sorting
|
|
148
|
+
|
|
149
|
+
Sort all entries from all sources chronologically (oldest first).
|
|
150
|
+
|
|
151
|
+
Concatenate all attributed, sorted entries into a single string.
|
|
152
|
+
|
|
153
|
+
If no source ideas have discussion logs, store an empty string.
|
|
154
|
+
|
|
155
|
+
Store as `merged_discussion`.
|
|
156
|
+
</step>
|
|
157
|
+
|
|
158
|
+
<step name="merge_research_logs">
|
|
159
|
+
Merge research logs from all source ideas with source attribution and chronological ordering.
|
|
160
|
+
|
|
161
|
+
Follow the exact same process as merge_discussion_logs:
|
|
162
|
+
1. Parse each source's research log into individual entries (each starts with `### `)
|
|
163
|
+
2. Prefix each heading with `[from #ID]`
|
|
164
|
+
3. Sort chronologically (oldest first)
|
|
165
|
+
4. Concatenate into a single string
|
|
166
|
+
|
|
167
|
+
If no source ideas have research logs, store an empty string.
|
|
168
|
+
|
|
169
|
+
Store as `merged_research`.
|
|
170
|
+
</step>
|
|
171
|
+
|
|
172
|
+
<step name="merge_notes">
|
|
173
|
+
Merge notes from all source ideas with source attribution.
|
|
174
|
+
|
|
175
|
+
For each source idea that has non-empty notes content:
|
|
176
|
+
1. Prefix the notes block with a source attribution line: `**From #ID --- {title}:**`
|
|
177
|
+
2. Append the notes content
|
|
178
|
+
|
|
179
|
+
Concatenate all attributed note blocks, separated by blank lines.
|
|
180
|
+
|
|
181
|
+
If no source ideas have notes, store an empty string.
|
|
182
|
+
|
|
183
|
+
Store as `merged_notes`.
|
|
184
|
+
|
|
185
|
+
Note: The `merged_notes` content is informational for the review display. The CLI command does not accept a `--notes` parameter -- notes are NOT passed to the CLI. The consolidation note appended to each source idea is handled automatically by `cmdIdeasConsolidate` via `appendConsolidationNote`. The merged notes from sources are included in the synthesised body's provenance section to preserve context, or mentioned in the review for user awareness. If the user wants notes content preserved, they can request it be woven into the synthesised body.
|
|
186
|
+
</step>
|
|
187
|
+
|
|
188
|
+
<step name="present_for_review">
|
|
189
|
+
Present a diff-style comparison of source ideas alongside the synthesised result so the user can make an informed approval decision.
|
|
190
|
+
|
|
191
|
+
Display the preview in this format:
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
## Consolidation Preview: These {N} ideas will become 1 idea
|
|
195
|
+
|
|
196
|
+
### Source Ideas (will be consolidated)
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
For each source idea, display:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
**#{id} --- {title}**
|
|
205
|
+
**Tags:** {tags}
|
|
206
|
+
|
|
207
|
+
{body excerpt -- first 200 characters or full body if shorter}
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
(Repeat for each source idea)
|
|
213
|
+
|
|
214
|
+
Then display the synthesised result:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
### Synthesised Result (new idea)
|
|
218
|
+
|
|
219
|
+
**Title:** {consolidated_title}
|
|
220
|
+
**Tags:** {merged_tags}
|
|
221
|
+
**Sources:** #{id1}, #{id2}, #{id3}
|
|
222
|
+
|
|
223
|
+
{synthesised_body}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
If merged_discussion is non-empty:
|
|
227
|
+
```
|
|
228
|
+
### Discussion Log (merged from sources)
|
|
229
|
+
|
|
230
|
+
{merged_discussion}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
If merged_research is non-empty:
|
|
234
|
+
```
|
|
235
|
+
### Research Log (merged from sources)
|
|
236
|
+
|
|
237
|
+
{merged_research}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
If merged_notes is non-empty:
|
|
241
|
+
```
|
|
242
|
+
### Notes (from sources, for reference)
|
|
243
|
+
|
|
244
|
+
{merged_notes}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Use AskUserQuestion:
|
|
248
|
+
- header: "Review Consolidated Idea"
|
|
249
|
+
- question: "Review the synthesised idea above. Choose an action:\n- **approve** -- create this consolidated idea\n- **edit** -- describe changes you'd like\n- **cancel** -- abort consolidation"
|
|
250
|
+
|
|
251
|
+
**If approve:** Proceed to execute step.
|
|
252
|
+
|
|
253
|
+
**If edit:** The user describes what they want changed. Claude applies the edits to the synthesised body, title, and/or tags as requested. Then re-display the updated preview and ask for approval again. Loop until approved or cancelled.
|
|
254
|
+
|
|
255
|
+
**If cancel:**
|
|
256
|
+
```
|
|
257
|
+
Consolidation cancelled. No changes made.
|
|
258
|
+
```
|
|
259
|
+
Exit workflow.
|
|
260
|
+
</step>
|
|
261
|
+
|
|
262
|
+
<step name="execute_consolidation">
|
|
263
|
+
Call the CLI to perform the atomic consolidation operation.
|
|
264
|
+
|
|
265
|
+
Build the CLI command with all parameters. The discussion and research content may contain special characters, so pass them via files to avoid shell escaping issues.
|
|
266
|
+
|
|
267
|
+
**1. Write temporary content files if needed:**
|
|
268
|
+
|
|
269
|
+
If `merged_discussion` is non-empty, write it to a temporary file. Similarly for `merged_research`.
|
|
270
|
+
|
|
271
|
+
**2. Build and run the CLI command:**
|
|
272
|
+
|
|
273
|
+
The most reliable approach is using a node script that calls the CLI via execFileSync to avoid shell escaping:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
node -e "
|
|
277
|
+
const { execFileSync } = require('child_process');
|
|
278
|
+
const fs = require('fs');
|
|
279
|
+
|
|
280
|
+
// Read content from temp files written by the Write tool
|
|
281
|
+
const body = fs.readFileSync('/tmp/dgs-consolidate-body.tmp', 'utf-8').trim();
|
|
282
|
+
const discussion = fs.readFileSync('/tmp/dgs-consolidate-discussion.tmp', 'utf-8').trim();
|
|
283
|
+
const research = fs.readFileSync('/tmp/dgs-consolidate-research.tmp', 'utf-8').trim();
|
|
284
|
+
|
|
285
|
+
const args = [
|
|
286
|
+
'./.claude/deliver-great-systems/bin/dgs-tools.cjs',
|
|
287
|
+
'ideas', 'consolidate',
|
|
288
|
+
'--ids', '${ids_csv}',
|
|
289
|
+
'--title', body ? '${consolidated_title}' : undefined,
|
|
290
|
+
'--body', body,
|
|
291
|
+
'--tags', '${merged_tags}',
|
|
292
|
+
'--raw'
|
|
293
|
+
].filter(Boolean);
|
|
294
|
+
|
|
295
|
+
if (discussion) args.push('--discussion', discussion);
|
|
296
|
+
if (research) args.push('--research', research);
|
|
297
|
+
|
|
298
|
+
const result = execFileSync('node', args, { encoding: 'utf-8' });
|
|
299
|
+
console.log(result);
|
|
300
|
+
"
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Write multi-line parameters (body, discussion, research) to temporary files using the Write tool before running the node command.
|
|
304
|
+
|
|
305
|
+
**Parse the JSON result.** The CLI returns:
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"id": 5,
|
|
309
|
+
"filename": "005-improve-api-resilience.md",
|
|
310
|
+
"path": ".planning/ideas/pending/005-improve-api-resilience.md",
|
|
311
|
+
"title": "Improve API resilience",
|
|
312
|
+
"consolidated_from": ["001", "003", "017"],
|
|
313
|
+
"moved_files": [
|
|
314
|
+
{ "id": 1, "filename": "001-add-retry-logic.md", "from": "pending", "to": "consolidated" },
|
|
315
|
+
{ "id": 3, "filename": "003-handle-timeouts.md", "from": "pending", "to": "consolidated" },
|
|
316
|
+
{ "id": 17, "filename": "017-circuit-breaker.md", "from": "pending", "to": "consolidated" }
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
If the CLI returns an error, display it and exit.
|
|
322
|
+
</step>
|
|
323
|
+
|
|
324
|
+
<step name="confirm_output">
|
|
325
|
+
Display a summary of the consolidation:
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
## Consolidation Complete
|
|
329
|
+
|
|
330
|
+
**New idea:** #{new_id} --- {title}
|
|
331
|
+
**File:** {path}
|
|
332
|
+
**Sources consolidated:** #{id1}, #{id2}, #{id3} -> moved to consolidated/
|
|
333
|
+
**Tags:** {tags}
|
|
334
|
+
**Git commit:** ideas: consolidate #{id1}, #{id2}, #{id3} -> #{new_id} - {title}
|
|
335
|
+
|
|
336
|
+
The source ideas are now in `consolidated/` state with references back to #{new_id}.
|
|
337
|
+
You can view the new idea with `/dgs:list-ideas` or read it directly.
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
If discussion or research logs were merged, mention it:
|
|
341
|
+
```
|
|
342
|
+
**Merged:** {N} discussion entries, {M} research entries from source ideas
|
|
343
|
+
```
|
|
344
|
+
</step>
|
|
345
|
+
|
|
346
|
+
</process>
|
|
347
|
+
|
|
348
|
+
<success_criteria>
|
|
349
|
+
- [ ] Arguments parsed correctly (idea IDs from positional args, --title flag)
|
|
350
|
+
- [ ] Interactive selection works when no IDs provided
|
|
351
|
+
- [ ] All source IDs validated as existing and in pending state
|
|
352
|
+
- [ ] Full content loaded from each source idea (body, notes, discussion log, research log)
|
|
353
|
+
- [ ] Synthesised body is coherent and captures combined intent (not mechanical concatenation)
|
|
354
|
+
- [ ] Provenance line appended to body listing all source ideas with titles
|
|
355
|
+
- [ ] Title either from --title flag or AI-generated from source content
|
|
356
|
+
- [ ] Tags are deduplicated union of all source tags
|
|
357
|
+
- [ ] Discussion logs merged with [from #ID] attribution, chronologically ordered
|
|
358
|
+
- [ ] Research logs merged with [from #ID] attribution, chronologically ordered
|
|
359
|
+
- [ ] Notes merged with source attribution
|
|
360
|
+
- [ ] User sees synthesised idea for review before commit
|
|
361
|
+
- [ ] User can approve, request edits, or cancel
|
|
362
|
+
- [ ] CLI called with all parameters for atomic operation
|
|
363
|
+
- [ ] Confirmation output shows new idea ID, path, and source disposition
|
|
364
|
+
- [ ] Preview shows source ideas alongside synthesised result for comparison
|
|
365
|
+
</success_criteria>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Generate a milestone build job with interactive approval. Reads the roadmap to determine remaining phases, generates the step sequence, displays it for user review, and writes the job file only after approval.
|
|
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` to extract version and flags.
|
|
25
|
+
|
|
26
|
+
- **Version:** First non-flag argument (e.g., `v6`, `v6.0`). If omitted, auto-detection happens in the preview step.
|
|
27
|
+
- **--no-check flag:** If present, omit audit-milestone and complete-milestone steps from the generated job.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Pseudocode for argument parsing:
|
|
31
|
+
# VERSION = first arg that doesn't start with --
|
|
32
|
+
# CHECK = true (default)
|
|
33
|
+
# If --no-check in args: CHECK = false
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Set `VERSION` (or null for auto-detect) and `CHECK` (true/false).
|
|
37
|
+
</step>
|
|
38
|
+
|
|
39
|
+
<step name="generate_preview">
|
|
40
|
+
Call the milestone-preview subcommand to get the step list without writing any files.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Build command with parsed arguments
|
|
44
|
+
# If VERSION is set and CHECK is true:
|
|
45
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs jobs milestone-preview VERSION
|
|
46
|
+
|
|
47
|
+
# If VERSION is set and CHECK is false:
|
|
48
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs jobs milestone-preview VERSION --no-check
|
|
49
|
+
|
|
50
|
+
# If VERSION is null (auto-detect) and CHECK is true:
|
|
51
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs jobs milestone-preview
|
|
52
|
+
|
|
53
|
+
# If VERSION is null and CHECK is false:
|
|
54
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs jobs milestone-preview --no-check
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Parse the JSON output. The response contains:
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"preview": true,
|
|
61
|
+
"version": "v6.0",
|
|
62
|
+
"check": true,
|
|
63
|
+
"step_count": 12,
|
|
64
|
+
"phase_count": 5,
|
|
65
|
+
"steps_preview": ["/dgs:plan-phase 51 --auto", "/dgs:execute-phase 51 --auto", ...],
|
|
66
|
+
"content": "..."
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Extract: `version`, `step_count`, `phase_count`, `steps_preview`.
|
|
71
|
+
|
|
72
|
+
**If step_count is 0:** Go to `handle_empty`.
|
|
73
|
+
</step>
|
|
74
|
+
|
|
75
|
+
<step name="display_steps">
|
|
76
|
+
Present the step list for user approval. Transform the raw `steps_preview` array for clean display:
|
|
77
|
+
|
|
78
|
+
**Display format rules:**
|
|
79
|
+
1. Strip the `/dgs:` prefix from each command
|
|
80
|
+
2. Strip any `--auto` flags from display
|
|
81
|
+
3. Trim trailing whitespace from each line
|
|
82
|
+
4. Number each step sequentially
|
|
83
|
+
|
|
84
|
+
Present in this format:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
## Milestone Job: {version}
|
|
88
|
+
|
|
89
|
+
{step_count} steps across {phase_count} phases
|
|
90
|
+
|
|
91
|
+
### Steps
|
|
92
|
+
|
|
93
|
+
1. plan-phase 51
|
|
94
|
+
2. execute-phase 51
|
|
95
|
+
3. verify-work 51
|
|
96
|
+
4. plan-phase 52
|
|
97
|
+
5. execute-phase 52
|
|
98
|
+
6. verify-work 52
|
|
99
|
+
...
|
|
100
|
+
N. complete-milestone v6.0
|
|
101
|
+
|
|
102
|
+
Create this job? (yes/no)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Wait for user response.
|
|
106
|
+
</step>
|
|
107
|
+
|
|
108
|
+
<step name="handle_approval">
|
|
109
|
+
Process the user's response to the approval prompt.
|
|
110
|
+
|
|
111
|
+
**If user approves** (responds with "yes", "y", "approve", "approved", or similar affirmative):
|
|
112
|
+
|
|
113
|
+
1. Call the create-milestone subcommand to write the job file:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# With version and check:
|
|
117
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs jobs create-milestone VERSION
|
|
118
|
+
|
|
119
|
+
# With --no-check:
|
|
120
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs jobs create-milestone VERSION --no-check
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
2. Commit the job file:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs(50): create milestone job {version}" --files .planning/jobs/pending/milestone-{version}.md
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
3. Display success and next steps:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Job created: .planning/jobs/pending/milestone-{version}.md
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Next Up
|
|
137
|
+
|
|
138
|
+
**Run the job** -- execute all steps sequentially
|
|
139
|
+
|
|
140
|
+
`/dgs:run-job {version}`
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**If user rejects** (responds with "no", "n", "reject", "cancel", or similar negative):
|
|
146
|
+
|
|
147
|
+
Display:
|
|
148
|
+
```
|
|
149
|
+
Job not created.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Exit cleanly. No error, no file written.
|
|
153
|
+
</step>
|
|
154
|
+
|
|
155
|
+
<step name="handle_empty">
|
|
156
|
+
If `step_count` is 0 (all phases complete and --no-check was passed):
|
|
157
|
+
|
|
158
|
+
Display:
|
|
159
|
+
```
|
|
160
|
+
All phases are complete. Nothing to do.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Exit cleanly. No job file created, no approval prompt shown.
|
|
164
|
+
</step>
|
|
165
|
+
|
|
166
|
+
</process>
|
|
167
|
+
|
|
168
|
+
<success_criteria>
|
|
169
|
+
- [ ] Arguments parsed correctly (version auto-detected if omitted)
|
|
170
|
+
- [ ] Preview generated via `jobs milestone-preview` (no side effects)
|
|
171
|
+
- [ ] Step list displayed with minimal format (no --auto, no /dgs: prefix)
|
|
172
|
+
- [ ] Summary line shows step count and phase count
|
|
173
|
+
- [ ] User approval required before file creation
|
|
174
|
+
- [ ] Approved: job file written via `jobs create-milestone` and committed
|
|
175
|
+
- [ ] Rejected: clean exit with "Job not created"
|
|
176
|
+
- [ ] Empty job: clean exit with "All phases are complete"
|
|
177
|
+
</success_criteria>
|