@smartmemory/compose 0.1.0
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 +21 -0
- package/README.md +1014 -0
- package/bin/compose.js +1515 -0
- package/dist/assets/_baseUniq-CQwX6VLz.js +1 -0
- package/dist/assets/arc-SxJ2J1sh.js +1 -0
- package/dist/assets/architectureDiagram-Q4EWVU46-BykunY1F.js +36 -0
- package/dist/assets/blockDiagram-DXYQGD6D-ohAKBOUw.js +132 -0
- package/dist/assets/c4Diagram-AHTNJAMY-DBDC3ENB.js +10 -0
- package/dist/assets/channel-DGElom1e.js +1 -0
- package/dist/assets/chunk-4BX2VUAB-Cv93Z7uM.js +1 -0
- package/dist/assets/chunk-4TB4RGXK-DE0WBDkj.js +206 -0
- package/dist/assets/chunk-55IACEB6-CE1EXenG.js +1 -0
- package/dist/assets/chunk-EDXVE4YY-DA7Ana6H.js +1 -0
- package/dist/assets/chunk-FMBD7UC4-CTDIPA3p.js +15 -0
- package/dist/assets/chunk-OYMX7WX6-uGBaPaTX.js +231 -0
- package/dist/assets/chunk-QZHKN3VN-CYlnXuUO.js +1 -0
- package/dist/assets/chunk-YZCP3GAM-ojGkzcZK.js +1 -0
- package/dist/assets/classDiagram-6PBFFD2Q-KqWP9wWZ.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-KqWP9wWZ.js +1 -0
- package/dist/assets/clone-DUJKJXd7.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-Bktn9hL-.js +1 -0
- package/dist/assets/dagre-KV5264BT-DFaSzuRF.js +4 -0
- package/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/assets/diagram-5BDNPKRD-DnfmDzEm.js +10 -0
- package/dist/assets/diagram-G4DWMVQ6-Bm8W9YnG.js +24 -0
- package/dist/assets/diagram-MMDJMWI5-B5-TSKvp.js +43 -0
- package/dist/assets/diagram-TYMM5635-ls4rqlky.js +24 -0
- package/dist/assets/erDiagram-SMLLAGMA-giG6WO-r.js +85 -0
- package/dist/assets/flowDiagram-DWJPFMVM-XvlUuz-7.js +162 -0
- package/dist/assets/ganttDiagram-T4ZO3ILL-hLBV57oV.js +292 -0
- package/dist/assets/gitGraphDiagram-UUTBAWPF-BHu3s_Gn.js +106 -0
- package/dist/assets/graph-D0Cfv00Y.js +1 -0
- package/dist/assets/index-CUd6pFGF.css +1 -0
- package/dist/assets/index-DReRlzZI.js +1144 -0
- package/dist/assets/infoDiagram-42DDH7IO-DbqRsOo3.js +2 -0
- package/dist/assets/init-Gi6I4Gst.js +1 -0
- package/dist/assets/ishikawaDiagram-UXIWVN3A-DnCdx7zb.js +70 -0
- package/dist/assets/journeyDiagram-VCZTEJTY-CfD7eNcP.js +139 -0
- package/dist/assets/kanban-definition-6JOO6SKY-BYaO9-mK.js +89 -0
- package/dist/assets/katex-DkKDou_j.js +257 -0
- package/dist/assets/layout-Bj72wOEB.js +1 -0
- package/dist/assets/linear-BRFo114D.js +1 -0
- package/dist/assets/min-GCHnKlJS.js +1 -0
- package/dist/assets/mindmap-definition-QFDTVHPH-n0PMebY4.js +96 -0
- package/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/assets/pieDiagram-DEJITSTG-pN4CljHF.js +30 -0
- package/dist/assets/quadrantDiagram-34T5L4WZ-DNoAy8-D.js +7 -0
- package/dist/assets/requirementDiagram-MS252O5E-BhtY05PT.js +84 -0
- package/dist/assets/sankeyDiagram-XADWPNL6-B6AD-16A.js +10 -0
- package/dist/assets/sequenceDiagram-FGHM5R23-DShHM-uk.js +157 -0
- package/dist/assets/stateDiagram-FHFEXIEX-DMxn7HTo.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-o6PnCs4e.js +1 -0
- package/dist/assets/timeline-definition-GMOUNBTQ-Cdu6uq52.js +120 -0
- package/dist/assets/vennDiagram-DHZGUBPP-CpK29iRe.js +34 -0
- package/dist/assets/wardley-RL74JXVD-BQgSkdcO.js +162 -0
- package/dist/assets/wardleyDiagram-NUSXRM2D-DJHYev6O.js +20 -0
- package/dist/assets/xychartDiagram-5P7HB3ND-1d75pbaO.js +7 -0
- package/dist/index.html +30 -0
- package/lib/agent-chains.js +65 -0
- package/lib/agent-string.js +86 -0
- package/lib/budget-ledger.js +86 -0
- package/lib/build-all.js +162 -0
- package/lib/build-dag.js +120 -0
- package/lib/build-stream-writer.js +190 -0
- package/lib/build.js +2997 -0
- package/lib/capability-checker.js +53 -0
- package/lib/cert-inject.js +38 -0
- package/lib/cli-progress.js +483 -0
- package/lib/constants.js +69 -0
- package/lib/cross-layer-audit.js +84 -0
- package/lib/debug-discipline.js +173 -0
- package/lib/feature-json.js +106 -0
- package/lib/gate-prompt.js +291 -0
- package/lib/gate-tiers.js +194 -0
- package/lib/health-history.js +119 -0
- package/lib/health-score.js +227 -0
- package/lib/ideabox.js +570 -0
- package/lib/import.js +244 -0
- package/lib/migrate-roadmap.js +94 -0
- package/lib/model-pricing.js +67 -0
- package/lib/new.js +413 -0
- package/lib/pipeline-cli.js +489 -0
- package/lib/plan-parser.js +103 -0
- package/lib/qa-scoping.js +474 -0
- package/lib/questionnaire.js +200 -0
- package/lib/resolve-port.js +7 -0
- package/lib/result-normalizer.js +349 -0
- package/lib/review-lenses.js +166 -0
- package/lib/roadmap-gen.js +210 -0
- package/lib/roadmap-parser.js +176 -0
- package/lib/server-probe.js +23 -0
- package/lib/staleness.js +87 -0
- package/lib/step-prompt.js +260 -0
- package/lib/step-validator.js +49 -0
- package/lib/stratum-mcp-client.js +365 -0
- package/lib/team-flag.js +46 -0
- package/lib/test-bootstrap.js +401 -0
- package/lib/triage.js +274 -0
- package/lib/vision-writer.js +391 -0
- package/package.json +111 -0
- package/pipelines/bug-fix.stratum.yaml +230 -0
- package/pipelines/build.stratum.yaml +498 -0
- package/pipelines/content.stratum.yaml +112 -0
- package/pipelines/coverage-sweep.stratum.yaml +52 -0
- package/pipelines/refactor.stratum.yaml +169 -0
- package/pipelines/research.stratum.yaml +88 -0
- package/pipelines/review-fix.stratum.yaml +109 -0
- package/presets/team-feature.stratum.yaml +105 -0
- package/presets/team-research.stratum.yaml +108 -0
- package/presets/team-review.stratum.yaml +106 -0
- package/scripts/agent-activity-hook.sh +31 -0
- package/scripts/agent-error-hook.sh +28 -0
- package/scripts/analyze-orphans.mjs +50 -0
- package/scripts/find-orphans.mjs +26 -0
- package/scripts/fix-phases.mjs +49 -0
- package/scripts/generate-stratum-spec.mjs +137 -0
- package/scripts/import-roadmap.mjs +116 -0
- package/scripts/phase-audit.mjs +33 -0
- package/scripts/run-pipeline.mjs +314 -0
- package/scripts/session-end-hook.sh +18 -0
- package/scripts/session-start-hook.sh +38 -0
- package/scripts/vision-hook.sh +104 -0
- package/scripts/vision-track.mjs +554 -0
- package/scripts/wire-all-orphans.mjs +108 -0
- package/scripts/wire-orphans.mjs +164 -0
- package/server/activity-routes.js +123 -0
- package/server/agent-health.js +197 -0
- package/server/agent-hooks.js +102 -0
- package/server/agent-mcp.js +10 -0
- package/server/agent-registry.js +95 -0
- package/server/agent-server.js +290 -0
- package/server/agent-spawn.js +251 -0
- package/server/agent-templates.js +77 -0
- package/server/artifact-manager.js +247 -0
- package/server/artifact-templates/architecture.md +28 -0
- package/server/artifact-templates/blueprint.md +21 -0
- package/server/artifact-templates/design.md +36 -0
- package/server/artifact-templates/plan.md +25 -0
- package/server/artifact-templates/prd.md +43 -0
- package/server/artifact-templates/report.md +40 -0
- package/server/block-tracker.js +90 -0
- package/server/build-stream-bridge.js +502 -0
- package/server/coalescing-buffer.js +46 -0
- package/server/compose-mcp-tools.js +479 -0
- package/server/compose-mcp.js +324 -0
- package/server/connectors/agent-connector.js +78 -0
- package/server/connectors/claude-sdk-connector.js +198 -0
- package/server/connectors/codex-connector.js +240 -0
- package/server/connectors/connector-discovery.js +18 -0
- package/server/connectors/connector-runtime.js +13 -0
- package/server/connectors/opencode-connector.js +200 -0
- package/server/design-routes.js +540 -0
- package/server/design-session.js +161 -0
- package/server/feature-scan.js +593 -0
- package/server/file-watcher.js +284 -0
- package/server/find-root.js +29 -0
- package/server/graph-export.js +343 -0
- package/server/ideabox-cache.js +77 -0
- package/server/ideabox-routes.js +294 -0
- package/server/index.js +156 -0
- package/server/model-tiers.js +49 -0
- package/server/pipeline-routes.js +288 -0
- package/server/policy-evaluator.js +36 -0
- package/server/project-root.js +122 -0
- package/server/security.js +23 -0
- package/server/session-manager.js +403 -0
- package/server/session-routes.js +190 -0
- package/server/session-store.js +107 -0
- package/server/settings-routes.js +35 -0
- package/server/settings-store.js +234 -0
- package/server/stratum-api.js +102 -0
- package/server/stratum-client.js +192 -0
- package/server/stratum-sync.js +193 -0
- package/server/summarizer.js +139 -0
- package/server/supervisor.js +196 -0
- package/server/vision-routes.js +668 -0
- package/server/vision-server.js +393 -0
- package/server/vision-store.js +360 -0
- package/server/vision-utils.js +179 -0
- package/server/worktree-gc.js +137 -0
- package/templates/ROADMAP.md +46 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# metadata:
|
|
2
|
+
# id: refactor
|
|
3
|
+
# label: "Refactor"
|
|
4
|
+
# description: "Safe refactoring — snapshot tests, plan changes, execute, verify behavior preserved"
|
|
5
|
+
# category: maintenance
|
|
6
|
+
# steps: 7
|
|
7
|
+
# estimated_minutes: 45
|
|
8
|
+
|
|
9
|
+
version: "0.1"
|
|
10
|
+
|
|
11
|
+
# refactor pipeline
|
|
12
|
+
#
|
|
13
|
+
# Seven-step flow for safe refactoring:
|
|
14
|
+
# 1. snapshot — capture current test results as baseline
|
|
15
|
+
# 2. analyze — identify code smells, duplication, and improvement targets
|
|
16
|
+
# 3. plan — write a step-by-step refactoring plan
|
|
17
|
+
# 4. execute — apply refactoring changes incrementally
|
|
18
|
+
# 5. test — run full test suite, compare against snapshot
|
|
19
|
+
# 6. review — codex reviews refactored code for correctness
|
|
20
|
+
# 7. ship — commit and report
|
|
21
|
+
#
|
|
22
|
+
# Inputs:
|
|
23
|
+
# task — what to refactor (module, pattern, or scope description)
|
|
24
|
+
#
|
|
25
|
+
# Usage:
|
|
26
|
+
# stratum_plan <this yaml> "refactor" {"task": "..."}
|
|
27
|
+
|
|
28
|
+
contracts:
|
|
29
|
+
RefactorResult:
|
|
30
|
+
phase: {type: string}
|
|
31
|
+
summary: {type: string}
|
|
32
|
+
outcome: {type: string, values: [complete, failed]}
|
|
33
|
+
|
|
34
|
+
TestResult:
|
|
35
|
+
passing: {type: boolean}
|
|
36
|
+
summary: {type: string}
|
|
37
|
+
failures: {type: array}
|
|
38
|
+
|
|
39
|
+
ReviewResult:
|
|
40
|
+
clean: {type: boolean}
|
|
41
|
+
summary: {type: string}
|
|
42
|
+
findings: {type: array}
|
|
43
|
+
|
|
44
|
+
functions:
|
|
45
|
+
snapshot:
|
|
46
|
+
mode: compute
|
|
47
|
+
intent: >
|
|
48
|
+
Run the full test suite and capture results as a baseline snapshot.
|
|
49
|
+
Record pass/fail counts and test names. Return a summary of the
|
|
50
|
+
current test state before any changes.
|
|
51
|
+
input:
|
|
52
|
+
task: {type: string}
|
|
53
|
+
output: RefactorResult
|
|
54
|
+
retries: 1
|
|
55
|
+
|
|
56
|
+
analyze:
|
|
57
|
+
mode: compute
|
|
58
|
+
intent: >
|
|
59
|
+
Analyze the target code for refactoring opportunities. Identify code
|
|
60
|
+
smells, duplication, coupling issues, and improvement targets.
|
|
61
|
+
Return a structured summary of findings.
|
|
62
|
+
input:
|
|
63
|
+
task: {type: string}
|
|
64
|
+
output: RefactorResult
|
|
65
|
+
retries: 1
|
|
66
|
+
|
|
67
|
+
plan:
|
|
68
|
+
mode: compute
|
|
69
|
+
intent: >
|
|
70
|
+
Write a step-by-step refactoring plan. Each step should be a safe,
|
|
71
|
+
incremental change that preserves behavior. Include file paths and
|
|
72
|
+
expected changes.
|
|
73
|
+
input:
|
|
74
|
+
task: {type: string}
|
|
75
|
+
output: RefactorResult
|
|
76
|
+
retries: 1
|
|
77
|
+
|
|
78
|
+
execute:
|
|
79
|
+
mode: compute
|
|
80
|
+
intent: >
|
|
81
|
+
Apply the refactoring changes incrementally following the plan.
|
|
82
|
+
Make each change as small as possible. Return a summary of all
|
|
83
|
+
modifications made.
|
|
84
|
+
input:
|
|
85
|
+
task: {type: string}
|
|
86
|
+
output: RefactorResult
|
|
87
|
+
retries: 3
|
|
88
|
+
|
|
89
|
+
test:
|
|
90
|
+
mode: compute
|
|
91
|
+
intent: >
|
|
92
|
+
Run the full test suite. Compare results against the baseline snapshot.
|
|
93
|
+
Return structured JSON: { "passing": boolean, "summary": string, "failures": string[] }.
|
|
94
|
+
All tests that passed before must still pass.
|
|
95
|
+
input:
|
|
96
|
+
task: {type: string}
|
|
97
|
+
output: TestResult
|
|
98
|
+
ensure:
|
|
99
|
+
- "result.passing == true"
|
|
100
|
+
retries: 5
|
|
101
|
+
|
|
102
|
+
review:
|
|
103
|
+
mode: compute
|
|
104
|
+
intent: >
|
|
105
|
+
Review the refactored code for correctness and quality. Verify that
|
|
106
|
+
behavior is preserved and the code is cleaner than before.
|
|
107
|
+
Return { "clean": boolean, "summary": string, "findings": string[] }.
|
|
108
|
+
input:
|
|
109
|
+
task: {type: string}
|
|
110
|
+
output: ReviewResult
|
|
111
|
+
ensure:
|
|
112
|
+
- "result.clean == true"
|
|
113
|
+
retries: 3
|
|
114
|
+
|
|
115
|
+
ship:
|
|
116
|
+
mode: compute
|
|
117
|
+
intent: >
|
|
118
|
+
Commit all changes with a descriptive message. Return a summary.
|
|
119
|
+
input:
|
|
120
|
+
task: {type: string}
|
|
121
|
+
output: RefactorResult
|
|
122
|
+
retries: 1
|
|
123
|
+
|
|
124
|
+
flows:
|
|
125
|
+
refactor:
|
|
126
|
+
input:
|
|
127
|
+
task: {type: string}
|
|
128
|
+
output: RefactorResult
|
|
129
|
+
steps:
|
|
130
|
+
- id: snapshot
|
|
131
|
+
function: snapshot
|
|
132
|
+
inputs:
|
|
133
|
+
task: "$.input.task"
|
|
134
|
+
|
|
135
|
+
- id: analyze
|
|
136
|
+
function: analyze
|
|
137
|
+
inputs:
|
|
138
|
+
task: "$.input.task"
|
|
139
|
+
depends_on: [snapshot]
|
|
140
|
+
|
|
141
|
+
- id: plan
|
|
142
|
+
function: plan
|
|
143
|
+
inputs:
|
|
144
|
+
task: "$.input.task"
|
|
145
|
+
depends_on: [analyze]
|
|
146
|
+
|
|
147
|
+
- id: execute
|
|
148
|
+
function: execute
|
|
149
|
+
inputs:
|
|
150
|
+
task: "$.input.task"
|
|
151
|
+
depends_on: [plan]
|
|
152
|
+
|
|
153
|
+
- id: test
|
|
154
|
+
function: test
|
|
155
|
+
inputs:
|
|
156
|
+
task: "$.input.task"
|
|
157
|
+
depends_on: [execute]
|
|
158
|
+
|
|
159
|
+
- id: review
|
|
160
|
+
function: review
|
|
161
|
+
inputs:
|
|
162
|
+
task: "$.input.task"
|
|
163
|
+
depends_on: [test]
|
|
164
|
+
|
|
165
|
+
- id: ship
|
|
166
|
+
function: ship
|
|
167
|
+
inputs:
|
|
168
|
+
task: "$.input.task"
|
|
169
|
+
depends_on: [review]
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# metadata:
|
|
2
|
+
# id: research
|
|
3
|
+
# label: "Research"
|
|
4
|
+
# description: "Explore a topic — gather sources, analyze findings, produce a summary report"
|
|
5
|
+
# category: exploration
|
|
6
|
+
# steps: 3
|
|
7
|
+
# estimated_minutes: 15
|
|
8
|
+
|
|
9
|
+
version: "0.1"
|
|
10
|
+
|
|
11
|
+
# research pipeline
|
|
12
|
+
#
|
|
13
|
+
# Three-step flow for exploratory research:
|
|
14
|
+
# 1. gather — collect sources, read code, search docs
|
|
15
|
+
# 2. analyze — synthesize findings, identify patterns and gaps
|
|
16
|
+
# 3. report — produce a structured summary with recommendations
|
|
17
|
+
#
|
|
18
|
+
# Inputs:
|
|
19
|
+
# task — research question or topic to explore
|
|
20
|
+
#
|
|
21
|
+
# Usage:
|
|
22
|
+
# stratum_plan <this yaml> "research" {"task": "..."}
|
|
23
|
+
|
|
24
|
+
contracts:
|
|
25
|
+
ResearchResult:
|
|
26
|
+
phase: {type: string}
|
|
27
|
+
artifact: {type: string}
|
|
28
|
+
summary: {type: string}
|
|
29
|
+
outcome: {type: string, values: [complete, failed]}
|
|
30
|
+
|
|
31
|
+
functions:
|
|
32
|
+
gather:
|
|
33
|
+
mode: compute
|
|
34
|
+
intent: >
|
|
35
|
+
Collect sources relevant to the research topic. Search the codebase,
|
|
36
|
+
read documentation, and gather external references. Return a summary
|
|
37
|
+
of sources found and key data points.
|
|
38
|
+
input:
|
|
39
|
+
task: {type: string}
|
|
40
|
+
output: ResearchResult
|
|
41
|
+
retries: 1
|
|
42
|
+
|
|
43
|
+
analyze:
|
|
44
|
+
mode: compute
|
|
45
|
+
intent: >
|
|
46
|
+
Synthesize the gathered information. Identify patterns, contradictions,
|
|
47
|
+
gaps, and insights. Organize findings into themes. Return a structured
|
|
48
|
+
analysis summary.
|
|
49
|
+
input:
|
|
50
|
+
task: {type: string}
|
|
51
|
+
output: ResearchResult
|
|
52
|
+
retries: 1
|
|
53
|
+
|
|
54
|
+
report:
|
|
55
|
+
mode: compute
|
|
56
|
+
intent: >
|
|
57
|
+
Produce a structured research report with findings, analysis, and
|
|
58
|
+
actionable recommendations. Write to an appropriate file path.
|
|
59
|
+
Return the artifact path and summary.
|
|
60
|
+
input:
|
|
61
|
+
task: {type: string}
|
|
62
|
+
output: ResearchResult
|
|
63
|
+
ensure:
|
|
64
|
+
- "result.outcome == 'complete'"
|
|
65
|
+
retries: 1
|
|
66
|
+
|
|
67
|
+
flows:
|
|
68
|
+
research:
|
|
69
|
+
input:
|
|
70
|
+
task: {type: string}
|
|
71
|
+
output: ResearchResult
|
|
72
|
+
steps:
|
|
73
|
+
- id: gather
|
|
74
|
+
function: gather
|
|
75
|
+
inputs:
|
|
76
|
+
task: "$.input.task"
|
|
77
|
+
|
|
78
|
+
- id: analyze
|
|
79
|
+
function: analyze
|
|
80
|
+
inputs:
|
|
81
|
+
task: "$.input.task"
|
|
82
|
+
depends_on: [gather]
|
|
83
|
+
|
|
84
|
+
- id: report
|
|
85
|
+
function: report
|
|
86
|
+
inputs:
|
|
87
|
+
task: "$.input.task"
|
|
88
|
+
depends_on: [analyze]
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# metadata:
|
|
2
|
+
# id: review-fix
|
|
3
|
+
# label: "Review & Fix"
|
|
4
|
+
# description: "Iterative review-fix loop — Codex reviews, Claude fixes until clean"
|
|
5
|
+
# category: quality
|
|
6
|
+
# steps: 2
|
|
7
|
+
# estimated_minutes: 15
|
|
8
|
+
|
|
9
|
+
version: "0.1"
|
|
10
|
+
|
|
11
|
+
# review-fix pipeline
|
|
12
|
+
#
|
|
13
|
+
# Runs a task to completion via a two-phase loop:
|
|
14
|
+
# 1. execute — claude_run produces the initial implementation
|
|
15
|
+
# 2. review — codex_run reviews against the blueprint; on failure,
|
|
16
|
+
# claude_run fixes findings before codex re-reviews
|
|
17
|
+
#
|
|
18
|
+
# The fix_and_review step is a single unit so findings always feed back
|
|
19
|
+
# into a fix pass before re-review runs. retries: 10 is the iteration cap.
|
|
20
|
+
#
|
|
21
|
+
# Inputs:
|
|
22
|
+
# task — what to implement (full task description with file paths, etc.)
|
|
23
|
+
# blueprint — the feature blueprint to review against (file content or path)
|
|
24
|
+
#
|
|
25
|
+
# Usage:
|
|
26
|
+
# stratum_plan <this yaml> "review_fix" {"task": "...", "blueprint": "..."}
|
|
27
|
+
|
|
28
|
+
contracts:
|
|
29
|
+
ExecuteResult:
|
|
30
|
+
summary: {type: string}
|
|
31
|
+
findings: {type: array}
|
|
32
|
+
|
|
33
|
+
ReviewResult:
|
|
34
|
+
clean: {type: boolean}
|
|
35
|
+
summary: {type: string}
|
|
36
|
+
findings: {type: array}
|
|
37
|
+
|
|
38
|
+
functions:
|
|
39
|
+
execute_task:
|
|
40
|
+
mode: compute
|
|
41
|
+
intent: >
|
|
42
|
+
Call the agent_run MCP tool with type "claude" and the given task prompt.
|
|
43
|
+
Implement the task fully — write all required files and make all required changes.
|
|
44
|
+
Return a summary of what was done and an empty findings array.
|
|
45
|
+
Do not review — only implement.
|
|
46
|
+
input:
|
|
47
|
+
task: {type: string}
|
|
48
|
+
output: ExecuteResult
|
|
49
|
+
retries: 1
|
|
50
|
+
|
|
51
|
+
fix_and_review:
|
|
52
|
+
mode: compute
|
|
53
|
+
intent: >
|
|
54
|
+
Implement one full fix-then-review cycle using the agent_run MCP tool.
|
|
55
|
+
|
|
56
|
+
Step A — Fix (skip on first attempt if no prior findings):
|
|
57
|
+
If this is a retry (previous ensure failed with findings), call agent_run
|
|
58
|
+
with type "claude". Pass the original task plus the previous findings.
|
|
59
|
+
Instruct Claude to fix every finding before proceeding.
|
|
60
|
+
|
|
61
|
+
Step B — Review:
|
|
62
|
+
Call agent_run with type "codex" and the following JSON Schema for structured output:
|
|
63
|
+
{
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": ["clean", "summary", "findings"],
|
|
66
|
+
"properties": {
|
|
67
|
+
"clean": { "type": "boolean" },
|
|
68
|
+
"summary": { "type": "string" },
|
|
69
|
+
"findings": { "type": "array", "items": { "type": "string" } }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
The review prompt must include:
|
|
73
|
+
- the task description
|
|
74
|
+
- the execute_summary (what was implemented)
|
|
75
|
+
- the blueprint content
|
|
76
|
+
- instruction: "List actionable findings with confidence >= 80.
|
|
77
|
+
Set clean=true only if no actionable findings remain."
|
|
78
|
+
Pass the schema to agent_run so it returns structured JSON.
|
|
79
|
+
|
|
80
|
+
Return the parsed codex ReviewResult directly.
|
|
81
|
+
Never re-review without fixing first on a retry.
|
|
82
|
+
input:
|
|
83
|
+
task: {type: string}
|
|
84
|
+
execute_summary: {type: string}
|
|
85
|
+
blueprint: {type: string}
|
|
86
|
+
output: ReviewResult
|
|
87
|
+
ensure:
|
|
88
|
+
- "result.clean == true"
|
|
89
|
+
retries: 10
|
|
90
|
+
|
|
91
|
+
flows:
|
|
92
|
+
review_fix:
|
|
93
|
+
input:
|
|
94
|
+
task: {type: string}
|
|
95
|
+
blueprint: {type: string}
|
|
96
|
+
output: ReviewResult
|
|
97
|
+
steps:
|
|
98
|
+
- id: execute
|
|
99
|
+
function: execute_task
|
|
100
|
+
inputs:
|
|
101
|
+
task: "$.input.task"
|
|
102
|
+
|
|
103
|
+
- id: review
|
|
104
|
+
function: fix_and_review
|
|
105
|
+
inputs:
|
|
106
|
+
task: "$.input.task"
|
|
107
|
+
execute_summary: "$.steps.execute.output.summary"
|
|
108
|
+
blueprint: "$.input.blueprint"
|
|
109
|
+
depends_on: [execute]
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# TEAM PRESET: feature
|
|
2
|
+
#
|
|
3
|
+
# Purpose: Multi-agent parallel feature implementation
|
|
4
|
+
# Pattern: Decompose → parallel implement with files_owned → verify
|
|
5
|
+
# Capability: Orchestrator decomposes, implementers have full access
|
|
6
|
+
# Isolation: worktree (each task in its own worktree)
|
|
7
|
+
# Merge: sequential_apply (patches applied in topo order)
|
|
8
|
+
#
|
|
9
|
+
# Use with: compose build <feature-code> --team feature
|
|
10
|
+
# Customize: Copy to your project's pipelines/ as team-feature.stratum.yaml and edit.
|
|
11
|
+
|
|
12
|
+
version: "0.3"
|
|
13
|
+
|
|
14
|
+
contracts:
|
|
15
|
+
TaskGraph:
|
|
16
|
+
tasks:
|
|
17
|
+
type: array
|
|
18
|
+
values: [{type: object}]
|
|
19
|
+
VerifyResult:
|
|
20
|
+
tests_pass: {type: string}
|
|
21
|
+
summary: {type: string}
|
|
22
|
+
|
|
23
|
+
workflow:
|
|
24
|
+
name: team-feature
|
|
25
|
+
description: "Multi-agent parallel feature implementation"
|
|
26
|
+
input:
|
|
27
|
+
featureCode:
|
|
28
|
+
type: string
|
|
29
|
+
required: true
|
|
30
|
+
description:
|
|
31
|
+
type: string
|
|
32
|
+
required: true
|
|
33
|
+
|
|
34
|
+
flows:
|
|
35
|
+
team-feature:
|
|
36
|
+
input:
|
|
37
|
+
featureCode: {type: string}
|
|
38
|
+
description: {type: string}
|
|
39
|
+
output: VerifyResult
|
|
40
|
+
steps:
|
|
41
|
+
- id: decompose
|
|
42
|
+
type: decompose
|
|
43
|
+
agent: "claude:orchestrator"
|
|
44
|
+
intent: >
|
|
45
|
+
Read the feature description and any existing plan/blueprint docs.
|
|
46
|
+
Break down this feature into parallel implementation tasks.
|
|
47
|
+
Each task must have:
|
|
48
|
+
- id: unique short identifier
|
|
49
|
+
- description: what to implement
|
|
50
|
+
- files_owned: list of files this task may create or modify
|
|
51
|
+
- files_read: list of files this task may read but NOT modify
|
|
52
|
+
- depends_on: list of task ids that must complete first (empty if independent)
|
|
53
|
+
|
|
54
|
+
Rules:
|
|
55
|
+
- No two tasks may share files_owned (each file has exactly one owner)
|
|
56
|
+
- Minimize dependencies — prefer independent parallel tasks
|
|
57
|
+
- Each task should be completable in one focused session
|
|
58
|
+
- Target 2-4 tasks for a typical feature
|
|
59
|
+
inputs:
|
|
60
|
+
featureCode: "$.input.featureCode"
|
|
61
|
+
description: "$.input.description"
|
|
62
|
+
output_contract: TaskGraph
|
|
63
|
+
ensure:
|
|
64
|
+
- "len(result.tasks) >= 1"
|
|
65
|
+
- "len(result.tasks) <= 6"
|
|
66
|
+
- "no_file_conflicts(result.tasks)"
|
|
67
|
+
retries: 2
|
|
68
|
+
|
|
69
|
+
- id: execute
|
|
70
|
+
type: parallel_dispatch
|
|
71
|
+
source: "$.steps.decompose.output.tasks"
|
|
72
|
+
agent: "claude:implementer"
|
|
73
|
+
max_concurrent: 3
|
|
74
|
+
isolation: worktree
|
|
75
|
+
require: all
|
|
76
|
+
merge: sequential_apply
|
|
77
|
+
intent_template: >
|
|
78
|
+
Implement this task using TDD. Write the test first, watch it fail,
|
|
79
|
+
implement, watch it pass.
|
|
80
|
+
|
|
81
|
+
Task: {task.description}
|
|
82
|
+
You own these files (may create/modify): {task.files_owned}
|
|
83
|
+
You may read (but NOT modify): {task.files_read}
|
|
84
|
+
|
|
85
|
+
Feature: {task.id}
|
|
86
|
+
depends_on: [decompose]
|
|
87
|
+
|
|
88
|
+
- id: verify
|
|
89
|
+
agent: "claude:orchestrator"
|
|
90
|
+
depends_on: [execute]
|
|
91
|
+
intent: >
|
|
92
|
+
All implementation tasks are complete and merged. Run the test suite
|
|
93
|
+
to verify everything works together. Check that:
|
|
94
|
+
1. All tests pass
|
|
95
|
+
2. No merge conflicts remain
|
|
96
|
+
3. The feature matches the original task description
|
|
97
|
+
|
|
98
|
+
Report tests_pass as "true" or "false" with details.
|
|
99
|
+
inputs:
|
|
100
|
+
featureCode: "$.input.featureCode"
|
|
101
|
+
output_contract: VerifyResult
|
|
102
|
+
ensure:
|
|
103
|
+
- "result.tests_pass == 'true'"
|
|
104
|
+
- "result.summary != ''"
|
|
105
|
+
retries: 2
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# TEAM PRESET: research
|
|
2
|
+
#
|
|
3
|
+
# Purpose: Parallel exploration for cold-start discovery
|
|
4
|
+
# Pattern: Triage → parallel_dispatch explorers → synthesize findings
|
|
5
|
+
# Capability: codebase/docs use read-only-reviewer, web uses read-only-researcher
|
|
6
|
+
# Isolation: none (read-only exploration)
|
|
7
|
+
# Merge: Sequential synthesis step
|
|
8
|
+
#
|
|
9
|
+
# Use with: compose build <feature-code> --team research
|
|
10
|
+
# Customize: Copy to your project's pipelines/ as team-research.stratum.yaml and edit.
|
|
11
|
+
|
|
12
|
+
version: "0.3"
|
|
13
|
+
|
|
14
|
+
contracts:
|
|
15
|
+
ResearchTaskList:
|
|
16
|
+
tasks:
|
|
17
|
+
type: array
|
|
18
|
+
values: [{type: object}]
|
|
19
|
+
topic: {type: string}
|
|
20
|
+
ExplorerFindings:
|
|
21
|
+
sources: {type: string}
|
|
22
|
+
patterns: {type: string}
|
|
23
|
+
open_questions: {type: string}
|
|
24
|
+
ResearchResult:
|
|
25
|
+
synthesis: {type: string}
|
|
26
|
+
recommendations: {type: string}
|
|
27
|
+
summary: {type: string}
|
|
28
|
+
|
|
29
|
+
workflow:
|
|
30
|
+
name: team-research
|
|
31
|
+
description: "Parallel multi-source research and synthesis"
|
|
32
|
+
input:
|
|
33
|
+
featureCode:
|
|
34
|
+
type: string
|
|
35
|
+
required: true
|
|
36
|
+
description:
|
|
37
|
+
type: string
|
|
38
|
+
required: true
|
|
39
|
+
|
|
40
|
+
flows:
|
|
41
|
+
team-research:
|
|
42
|
+
input:
|
|
43
|
+
featureCode: {type: string}
|
|
44
|
+
description: {type: string}
|
|
45
|
+
output: ResearchResult
|
|
46
|
+
steps:
|
|
47
|
+
- id: plan
|
|
48
|
+
agent: "claude:orchestrator"
|
|
49
|
+
intent: >
|
|
50
|
+
Plan the research for this feature. Read the feature description
|
|
51
|
+
and any existing docs. Produce a task list with 3 research tasks:
|
|
52
|
+
|
|
53
|
+
1. id: "codebase", agent: "claude:read-only-reviewer"
|
|
54
|
+
- Explore the local codebase for relevant patterns, files, conventions
|
|
55
|
+
2. id: "web", agent: "claude:read-only-researcher"
|
|
56
|
+
- Search the web for best practices, library docs, similar implementations
|
|
57
|
+
3. id: "docs", agent: "claude:read-only-reviewer"
|
|
58
|
+
- Read local docs, READMEs, specs, ADRs for relevant context
|
|
59
|
+
|
|
60
|
+
Each task must have: id, description, agent.
|
|
61
|
+
Also output the research topic derived from the feature description.
|
|
62
|
+
inputs:
|
|
63
|
+
featureCode: "$.input.featureCode"
|
|
64
|
+
description: "$.input.description"
|
|
65
|
+
output_contract: ResearchTaskList
|
|
66
|
+
ensure:
|
|
67
|
+
- "len(result.tasks) == 3"
|
|
68
|
+
retries: 2
|
|
69
|
+
|
|
70
|
+
- id: explore
|
|
71
|
+
type: parallel_dispatch
|
|
72
|
+
source: "$.steps.plan.output.tasks"
|
|
73
|
+
agent: "claude:read-only-reviewer"
|
|
74
|
+
max_concurrent: 3
|
|
75
|
+
isolation: none
|
|
76
|
+
require: all
|
|
77
|
+
intent_template: >
|
|
78
|
+
Research this topic: {task.description}
|
|
79
|
+
|
|
80
|
+
Find relevant sources, patterns, and open questions.
|
|
81
|
+
List sources with file:line references (for code) or URLs (for web).
|
|
82
|
+
Note patterns that could inform the implementation.
|
|
83
|
+
List open questions that need answers before implementation.
|
|
84
|
+
output_fields:
|
|
85
|
+
sources: {type: string}
|
|
86
|
+
patterns: {type: string}
|
|
87
|
+
open_questions: {type: string}
|
|
88
|
+
ensure:
|
|
89
|
+
- "result.sources is not None"
|
|
90
|
+
depends_on: [plan]
|
|
91
|
+
|
|
92
|
+
- id: synthesize
|
|
93
|
+
agent: "claude:orchestrator"
|
|
94
|
+
depends_on: [explore]
|
|
95
|
+
intent: >
|
|
96
|
+
Synthesize findings from all research explorers. Cross-reference
|
|
97
|
+
sources. Identify consensus patterns and contradictions. Produce
|
|
98
|
+
actionable recommendations for the feature implementation.
|
|
99
|
+
Write a one-sentence summary.
|
|
100
|
+
inputs:
|
|
101
|
+
research_results: "$.steps.explore.output"
|
|
102
|
+
topic: "$.steps.plan.output.topic"
|
|
103
|
+
output_contract: ResearchResult
|
|
104
|
+
ensure:
|
|
105
|
+
- "result.synthesis != ''"
|
|
106
|
+
- "result.recommendations != ''"
|
|
107
|
+
- "result.summary != ''"
|
|
108
|
+
retries: 2
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# TEAM PRESET: review
|
|
2
|
+
#
|
|
3
|
+
# Purpose: Parallel multi-lens review after implementation
|
|
4
|
+
# Pattern: Triage → parallel_dispatch reviewers → merge findings → gate
|
|
5
|
+
# Capability: Agents use read-only-reviewer profile (Read/Grep/Glob/Agent only)
|
|
6
|
+
# Isolation: none (reviewers read shared state, don't modify)
|
|
7
|
+
# Merge: Deduplication step consolidates findings
|
|
8
|
+
#
|
|
9
|
+
# Use with: compose build <feature-code> --team review
|
|
10
|
+
# Customize: Copy to your project's pipelines/ as team-review.stratum.yaml and edit.
|
|
11
|
+
|
|
12
|
+
version: "0.3"
|
|
13
|
+
|
|
14
|
+
contracts:
|
|
15
|
+
TriageResult:
|
|
16
|
+
tasks:
|
|
17
|
+
type: array
|
|
18
|
+
values: [{type: object}]
|
|
19
|
+
diff: {type: string}
|
|
20
|
+
MergedReviewResult:
|
|
21
|
+
findings: {type: string}
|
|
22
|
+
has_critical: {type: string}
|
|
23
|
+
summary: {type: string}
|
|
24
|
+
|
|
25
|
+
workflow:
|
|
26
|
+
name: team-review
|
|
27
|
+
description: "Parallel multi-lens code review"
|
|
28
|
+
input:
|
|
29
|
+
featureCode:
|
|
30
|
+
type: string
|
|
31
|
+
required: true
|
|
32
|
+
description:
|
|
33
|
+
type: string
|
|
34
|
+
required: true
|
|
35
|
+
|
|
36
|
+
flows:
|
|
37
|
+
team-review:
|
|
38
|
+
input:
|
|
39
|
+
featureCode: {type: string}
|
|
40
|
+
description: {type: string}
|
|
41
|
+
output: MergedReviewResult
|
|
42
|
+
steps:
|
|
43
|
+
- id: triage
|
|
44
|
+
agent: "claude:orchestrator"
|
|
45
|
+
intent: >
|
|
46
|
+
Gather the git diff for this feature and decide which review lenses
|
|
47
|
+
to activate. Read the changed files. Produce a task list with one
|
|
48
|
+
entry per lens. Each task must have:
|
|
49
|
+
- id: lens name (e.g. "security", "performance", "architecture")
|
|
50
|
+
- lens_name: same as id
|
|
51
|
+
- lens_focus: one-sentence description of what to look for
|
|
52
|
+
- confidence_gate: minimum confidence (1-10) to report a finding
|
|
53
|
+
- exclusions: what NOT to flag
|
|
54
|
+
|
|
55
|
+
Always include: security, performance, architecture.
|
|
56
|
+
Include the full git diff in your output.
|
|
57
|
+
inputs:
|
|
58
|
+
featureCode: "$.input.featureCode"
|
|
59
|
+
description: "$.input.description"
|
|
60
|
+
output_contract: TriageResult
|
|
61
|
+
ensure:
|
|
62
|
+
- "len(result.tasks) >= 3"
|
|
63
|
+
retries: 2
|
|
64
|
+
|
|
65
|
+
- id: review_lenses
|
|
66
|
+
type: parallel_dispatch
|
|
67
|
+
source: "$.steps.triage.output.tasks"
|
|
68
|
+
agent: "claude:read-only-reviewer"
|
|
69
|
+
max_concurrent: 4
|
|
70
|
+
isolation: none
|
|
71
|
+
require: all
|
|
72
|
+
intent_template: >
|
|
73
|
+
You are reviewing a code diff as the {lens_name} reviewer.
|
|
74
|
+
|
|
75
|
+
Focus: {lens_focus}
|
|
76
|
+
Confidence gate: only report findings with confidence >= {confidence_gate}/10.
|
|
77
|
+
Exclusions: do NOT flag {exclusions}.
|
|
78
|
+
|
|
79
|
+
Return JSON: { "clean": boolean, "findings": LensFinding[] }
|
|
80
|
+
where each finding has: lens, file, line, severity (must-fix|should-fix|nit),
|
|
81
|
+
finding (description), confidence (1-10).
|
|
82
|
+
|
|
83
|
+
If no issues found, return { "clean": true, "findings": [] }.
|
|
84
|
+
output_fields:
|
|
85
|
+
clean: {type: string}
|
|
86
|
+
findings: {type: string}
|
|
87
|
+
ensure:
|
|
88
|
+
- "result.findings is not None"
|
|
89
|
+
depends_on: [triage]
|
|
90
|
+
|
|
91
|
+
- id: merge
|
|
92
|
+
agent: "claude:orchestrator"
|
|
93
|
+
depends_on: [review_lenses]
|
|
94
|
+
intent: >
|
|
95
|
+
Consolidate findings from all review lenses. Deduplicate findings
|
|
96
|
+
that appear in multiple passes (same file:line, same issue). Rank
|
|
97
|
+
by severity (must-fix first, then should-fix, then nit).
|
|
98
|
+
Set has_critical to "true" if any finding has severity "must-fix",
|
|
99
|
+
"false" otherwise. Write a one-sentence summary.
|
|
100
|
+
inputs:
|
|
101
|
+
review_results: "$.steps.review_lenses.output"
|
|
102
|
+
output_contract: MergedReviewResult
|
|
103
|
+
ensure:
|
|
104
|
+
- "result.has_critical == 'false'"
|
|
105
|
+
- "result.summary != ''"
|
|
106
|
+
retries: 2
|