compass-st 1.1.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/README.md +105 -0
- package/VERSION +1 -0
- package/bin/install +174 -0
- package/bootstrap.sh +95 -0
- package/cli/Cargo.lock +270 -0
- package/cli/Cargo.toml +24 -0
- package/cli/src/cmd/context.rs +59 -0
- package/cli/src/cmd/dag.rs +133 -0
- package/cli/src/cmd/git.rs +148 -0
- package/cli/src/cmd/hook.rs +51 -0
- package/cli/src/cmd/index.rs +363 -0
- package/cli/src/cmd/manifest.rs +34 -0
- package/cli/src/cmd/memory.rs +680 -0
- package/cli/src/cmd/migrate.rs +790 -0
- package/cli/src/cmd/mod.rs +14 -0
- package/cli/src/cmd/progress.rs +107 -0
- package/cli/src/cmd/project.rs +1700 -0
- package/cli/src/cmd/session.rs +64 -0
- package/cli/src/cmd/state.rs +317 -0
- package/cli/src/cmd/validate/mod.rs +506 -0
- package/cli/src/cmd/validate/prd.rs +472 -0
- package/cli/src/cmd/version.rs +89 -0
- package/cli/src/helpers.rs +40 -0
- package/cli/src/main.rs +75 -0
- package/cli/tests/fixtures/plan_empty_pointers.json +60 -0
- package/cli/tests/fixtures/plan_missing_pointers.json +59 -0
- package/cli/tests/fixtures/plan_too_many_pointers.json +92 -0
- package/cli/tests/fixtures/plan_v1_valid.json +64 -0
- package/cli/tests/fixtures/prd_bad_flow_bullet.md +37 -0
- package/cli/tests/fixtures/prd_bad_flow_prose.md +33 -0
- package/cli/tests/fixtures/prd_good_flow.md +41 -0
- package/cli/tests/fixtures/prd_xref_dangling.md +38 -0
- package/cli/tests/fixtures/prd_xref_valid.md +53 -0
- package/cli/tests/fixtures/projects/proj_a/.compass/.state/config.json +12 -0
- package/cli/tests/fixtures/projects/proj_b/.compass/.state/config.json +12 -0
- package/cli/tests/fixtures/projects/proj_c/.compass/.state/config.json +12 -0
- package/cli/tests/fixtures/registry/all_dead.json +18 -0
- package/cli/tests/fixtures/registry/corrupt.json +1 -0
- package/cli/tests/fixtures/registry/empty.json +1 -0
- package/cli/tests/fixtures/registry/last_active_dead.json +24 -0
- package/cli/tests/fixtures/registry/multi_alive.json +24 -0
- package/cli/tests/fixtures/registry/one_alive.json +12 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/config.json +5 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/sessions/onboarding-redesign/plan.json +29 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/sessions/sample-feature/context.json +11 -0
- package/cli/tests/fixtures/v0_project/.compass/.state/sessions/sample-feature/plan.json +49 -0
- package/core/colleagues/base-rules.md +112 -0
- package/core/colleagues/manifest.json +85 -0
- package/core/colleagues/market-analyst.md +50 -0
- package/core/colleagues/prioritizer.md +53 -0
- package/core/colleagues/researcher.md +54 -0
- package/core/colleagues/reviewer.md +55 -0
- package/core/colleagues/stakeholder-comm.md +59 -0
- package/core/colleagues/story-breaker.md +57 -0
- package/core/colleagues/ux-reviewer.md +54 -0
- package/core/colleagues/writer.md +55 -0
- package/core/commands/compass/brief.md +28 -0
- package/core/commands/compass/check.md +27 -0
- package/core/commands/compass/epic.md +32 -0
- package/core/commands/compass/feedback.md +32 -0
- package/core/commands/compass/help.md +24 -0
- package/core/commands/compass/ideate.md +32 -0
- package/core/commands/compass/init.md +30 -0
- package/core/commands/compass/plan.md +27 -0
- package/core/commands/compass/prd.md +39 -0
- package/core/commands/compass/prioritize.md +36 -0
- package/core/commands/compass/prototype.md +28 -0
- package/core/commands/compass/release.md +32 -0
- package/core/commands/compass/research.md +31 -0
- package/core/commands/compass/roadmap.md +32 -0
- package/core/commands/compass/run.md +28 -0
- package/core/commands/compass/setup.md +32 -0
- package/core/commands/compass/sprint.md +32 -0
- package/core/commands/compass/status.md +32 -0
- package/core/commands/compass/story.md +37 -0
- package/core/commands/compass/undo.md +33 -0
- package/core/commands/compass/update.md +29 -0
- package/core/hooks/context-monitor.sh +5 -0
- package/core/hooks/manifest-tracker.sh +62 -0
- package/core/hooks/statusline.sh +12 -0
- package/core/hooks/update-checker.sh +24 -0
- package/core/integrations/confluence.md +267 -0
- package/core/integrations/figma.md +277 -0
- package/core/integrations/jira.md +436 -0
- package/core/integrations/vercel.md +170 -0
- package/core/manifest.json +172 -0
- package/core/shared/SCHEMAS-v1.md +404 -0
- package/core/shared/progress.md +145 -0
- package/core/shared/project-scan.md +293 -0
- package/core/shared/resolve-project.md +136 -0
- package/core/shared/ux-rules.md +52 -0
- package/core/shared/version-backup.md +38 -0
- package/core/templates/prd-template.md +145 -0
- package/core/templates/story-template.md +99 -0
- package/core/workflows/brief.md +184 -0
- package/core/workflows/check.md +436 -0
- package/core/workflows/epic.md +177 -0
- package/core/workflows/feedback.md +164 -0
- package/core/workflows/help.md +79 -0
- package/core/workflows/ideate.md +320 -0
- package/core/workflows/init.md +524 -0
- package/core/workflows/migrate.md +136 -0
- package/core/workflows/plan.md +320 -0
- package/core/workflows/prd.md +632 -0
- package/core/workflows/prioritize.md +301 -0
- package/core/workflows/project.md +177 -0
- package/core/workflows/prototype.md +174 -0
- package/core/workflows/release.md +179 -0
- package/core/workflows/research.md +613 -0
- package/core/workflows/roadmap.md +152 -0
- package/core/workflows/run.md +367 -0
- package/core/workflows/setup.md +294 -0
- package/core/workflows/sprint.md +187 -0
- package/core/workflows/status.md +185 -0
- package/core/workflows/story.md +477 -0
- package/core/workflows/undo.md +42 -0
- package/core/workflows/update.md +127 -0
- package/package.json +37 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Workflow: compass:roadmap
|
|
2
|
+
|
|
3
|
+
You are the roadmap strategist. Mission: create a product roadmap from epics, priorities, and timeline constraints.
|
|
4
|
+
|
|
5
|
+
**Principles:** Visual first — include mermaid gantt. Tie every item to an epic or PRD. Show dependencies between roadmap items. Quarterly view. Never show a roadmap without a priority rationale.
|
|
6
|
+
|
|
7
|
+
**Purpose**: Generate a quarterly product roadmap that is visual, dependency-aware, and directly linked to existing epics and PRDs in the project.
|
|
8
|
+
|
|
9
|
+
**Output**: `research/ROADMAP-{PREFIX}-{slug}-{date}.md` (Silver Tiger) or `.compass/Research/ROADMAP-{slug}-{date}.md` (standalone)
|
|
10
|
+
|
|
11
|
+
**When to use**:
|
|
12
|
+
- Preparing for a quarterly planning session
|
|
13
|
+
- Leadership needs a visual timeline of what ships when
|
|
14
|
+
- You want to show dependencies between epics before sprint planning
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Apply the UX rules from `core/shared/ux-rules.md`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Step 0 — Resolve active project
|
|
23
|
+
|
|
24
|
+
Apply the shared snippet from `core/shared/resolve-project.md`. It sets up `$PROJECT_ROOT`, `$CONFIG`, and `$PROJECT_NAME` for downstream steps and prints the "Using: <name>" banner.
|
|
25
|
+
|
|
26
|
+
From `$CONFIG`, extract the required fields:
|
|
27
|
+
- `lang`, `spec_lang`, `mode`, `prefix`, `output_paths`, `naming`
|
|
28
|
+
|
|
29
|
+
**Error handling**:
|
|
30
|
+
- If `config.json` missing or corrupt → tell user to run `/compass:init`. Stop.
|
|
31
|
+
- If valid but missing required fields → list them, ask to run `/compass:init`. Stop.
|
|
32
|
+
|
|
33
|
+
**Language enforcement**: ALL chat text in `lang`. Artifact in `spec_lang`.
|
|
34
|
+
|
|
35
|
+
Extract `interaction_level` from config (default: "standard"):
|
|
36
|
+
- `quick`: auto-build roadmap from scanned epics + default Q1-Q4 timeline, one review step.
|
|
37
|
+
- `standard`: ask timeline, capacity, must-haves vs nice-to-haves, then generate.
|
|
38
|
+
- `detailed`: go item by item — confirm placement, dependencies, and resourcing for each epic.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Step 0b — Project awareness check
|
|
43
|
+
|
|
44
|
+
Apply the shared project-scan module from `core/shared/project-scan.md`.
|
|
45
|
+
Pass: keywords=$ARGUMENTS, type="research"
|
|
46
|
+
|
|
47
|
+
The module handles scanning for existing epics, PRDs, and prior roadmaps. If a prior roadmap exists → ask whether to update it or create a new version.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Step 1 — Scan existing artifacts
|
|
52
|
+
|
|
53
|
+
1. Glob `epics/{prefix}-EPIC-*/epic.md` — read title, priority, status, and stories count from each.
|
|
54
|
+
2. Glob `prd/*.md` (Silver Tiger) or `.compass/PRDs/*.md` (standalone) — read titles and priorities.
|
|
55
|
+
3. Check for previous roadmap files in `research/ROADMAP-*.md`.
|
|
56
|
+
4. Build an internal list: `[{epic_id, title, priority, status, story_count, dependencies}]`.
|
|
57
|
+
|
|
58
|
+
Show a summary of what was found before asking questions.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Step 2 — Ask PO about timeline and constraints
|
|
63
|
+
|
|
64
|
+
Use AskUserQuestion for timeline:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{"questions": [{"question": "What is the planning horizon for this roadmap?\n(Tiếng Việt: Khoảng thời gian lập kế hoạch cho roadmap này là gì?)", "header": "Planning horizon", "multiSelect": false, "options": [{"label": "Q1–Q2 (6 months)", "description": "Near-term planning, 2 quarters / Kế hoạch ngắn hạn, 2 quý"}, {"label": "Q1–Q4 (full year)", "description": "Annual roadmap, all 4 quarters / Roadmap năm, tất cả 4 quý"}, {"label": "Next 3 months only", "description": "Rolling 90-day view / Tầm nhìn 90 ngày liên tục"}, {"label": "Custom — I'll specify dates", "description": "Tell me the exact start and end date / Tôi sẽ chỉ định ngày bắt đầu và kết thúc"}]}]}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Use AskUserQuestion for capacity constraints:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{"questions": [{"question": "Any capacity or resource constraints to account for?\n(Tiếng Việt: Có ràng buộc năng lực hoặc nguồn lực nào cần tính đến không?)", "header": "Capacity constraints", "multiSelect": true, "options": [{"label": "Limited dev team (1–3 engineers)", "description": "Small team — fewer parallel tracks / Nhóm nhỏ, ít luồng song song"}, {"label": "Shared resources with another team", "description": "Some epics depend on shared infra or platform team / Một số epic phụ thuộc vào nhóm chia sẻ"}, {"label": "Hard launch deadline", "description": "Specific date we must hit — I'll tell you which epic / Ngày ra mắt cứng — tôi sẽ nói epic nào"}, {"label": "No major constraints", "description": "Plan freely based on priority / Lập kế hoạch tự do theo ưu tiên"}]}]}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Use AskUserQuestion for must-haves vs nice-to-haves:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{"questions": [{"question": "Which epics are must-haves for the next release?\n(Tiếng Việt: Epic nào là bắt buộc cho lần phát hành tiếp theo?)", "header": "Must-have epics", "multiSelect": false, "options": [{"label": "All P0 epics are must-haves", "description": "Use priority from epic.md / Dùng mức độ ưu tiên từ epic.md"}, {"label": "I'll specify which epics are locked", "description": "Tell me which ones cannot slip / Tôi sẽ chỉ định epic nào không thể trễ"}, {"label": "Everything is flexible", "description": "Optimize purely by priority and capacity / Tối ưu hoàn toàn theo ưu tiên và năng lực"}]}]}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Step 3 — Generate roadmap
|
|
85
|
+
|
|
86
|
+
Place epics across quarters based on priority (P0 first), dependencies (blockers earlier), and capacity.
|
|
87
|
+
|
|
88
|
+
**Dependency detection**: if epic B's `epic.md` mentions epic A's ID in Notes or Requirements → B depends on A → A must ship in an earlier or same quarter.
|
|
89
|
+
|
|
90
|
+
### Mermaid Gantt chart
|
|
91
|
+
|
|
92
|
+
Derive dates from the timeline chosen in Step 2. Use actual epic IDs and titles from the scan. The structure below is illustrative — replace with real data.
|
|
93
|
+
|
|
94
|
+
```mermaid
|
|
95
|
+
gantt
|
|
96
|
+
title Product Roadmap <YEAR>
|
|
97
|
+
dateFormat YYYY-MM-DD
|
|
98
|
+
section Q1
|
|
99
|
+
<PREFIX>-EPIC-01 <Title> :active, epic01, <start>, <end>
|
|
100
|
+
<PREFIX>-EPIC-02 <Title> :epic02, after epic01, <duration>
|
|
101
|
+
section Q2
|
|
102
|
+
<PREFIX>-EPIC-03 <Title> :epic03, <start>, <end>
|
|
103
|
+
section Q3
|
|
104
|
+
<PREFIX>-EPIC-04 <Title> :epic04, <start>, <end>
|
|
105
|
+
section Q4
|
|
106
|
+
<PREFIX>-EPIC-05 <Title> :epic05, after epic04, <duration>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Quarterly breakdown table
|
|
110
|
+
|
|
111
|
+
| Quarter | Epic | Priority | Status | Dependencies | Notes |
|
|
112
|
+
|---------|------|----------|--------|-------------|-------|
|
|
113
|
+
| Q1 | EPIC-01 — Title | P0 | active | — | Must-have for launch |
|
|
114
|
+
| Q1 | EPIC-02 — Title | P1 | planned | EPIC-01 | Starts after EPIC-01 ships |
|
|
115
|
+
| Q2 | EPIC-03 — Title | P1 | planned | — | |
|
|
116
|
+
|
|
117
|
+
### Resource allocation notes
|
|
118
|
+
|
|
119
|
+
- **Q1**: <N> epics, ~<X> story points estimated, <Y> engineers needed
|
|
120
|
+
- **Q2**: ...
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Step 4 — Review and save
|
|
125
|
+
|
|
126
|
+
Use AskUserQuestion:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{"questions": [{"question": "Roadmap looks good?\n(Tiếng Việt: Roadmap trông ổn không?)", "header": "Review roadmap", "multiSelect": false, "options": [{"label": "Save the roadmap", "description": "Write file now / Lưu ngay"}, {"label": "Move an epic to a different quarter", "description": "I'll tell you which one / Tôi sẽ chỉ định cái nào"}, {"label": "Add a new item not in epics", "description": "Ad-hoc item to include / Hạng mục bổ sung không có trong epics"}]}]}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Save path:
|
|
133
|
+
- Silver Tiger: `research/ROADMAP-{PREFIX}-{slug}-{date}.md`
|
|
134
|
+
- Standalone: `.compass/Research/ROADMAP-{slug}-{date}.md`
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
compass-cli index add "<output-file-path>" "research" 2>/dev/null || true
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Save session
|
|
141
|
+
|
|
142
|
+
`$PROJECT_ROOT/.compass/.state/sessions/<timestamp>-roadmap-<slug>/transcript.md`
|
|
143
|
+
|
|
144
|
+
## Edge cases
|
|
145
|
+
|
|
146
|
+
- **No epics exist yet**: build a skeleton roadmap from PRDs instead; note that epics need to be created via `/compass:epic`.
|
|
147
|
+
- **All epics are P0**: ask the PO to force-rank them — "if you could only ship two P0 epics this quarter, which two?"
|
|
148
|
+
- **Circular dependency detected** (A depends on B, B depends on A): flag immediately via AskUserQuestion, do not generate the gantt until resolved.
|
|
149
|
+
- **Hard launch deadline conflicts with P0 epic capacity**: surface the conflict explicitly in the roadmap under "Risks", do not silently squeeze the timeline.
|
|
150
|
+
- **More than 10 epics**: split into two gantt charts (H1 and H2) to avoid unreadable output.
|
|
151
|
+
- **`spec_lang` is bilingual**: generate both `ROADMAP-...-en.md` and `ROADMAP-...-vi.md`.
|
|
152
|
+
- **No PRD linked to an epic**: note that epic as "scope TBD" in the quarterly table — do not invent scope.
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
# Workflow: compass:run
|
|
2
|
+
|
|
3
|
+
You are the orchestrator. Mission: execute the plan wave-by-wave with parallel Colleagues, track progress, handle failures.
|
|
4
|
+
|
|
5
|
+
**Principles:** Orchestrator does NOT write documents — only dispatch, monitor, report. Each Colleague runs in fresh context. Never stop after one Colleague — always continue to the next. Escalate failures, don't hide them.
|
|
6
|
+
|
|
7
|
+
**Purpose**: Execute the collab plan wave-by-wave. Each Colleague runs in a fresh context window with only its briefing. Track status, handle escalation, run post-wave consistency checks.
|
|
8
|
+
|
|
9
|
+
**Input**: Latest `plan.json` from session
|
|
10
|
+
**Output**: Documents generated by each Colleague
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Apply the UX rules from `core/shared/ux-rules.md`.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Step 0 — Resolve active project
|
|
19
|
+
|
|
20
|
+
Apply the shared snippet from `core/shared/resolve-project.md`. It sets up `$PROJECT_ROOT`, `$CONFIG`, and `$PROJECT_NAME` for downstream steps and prints the "Using: <name>" banner.
|
|
21
|
+
|
|
22
|
+
From `$CONFIG`, extract `lang`, `spec_lang`, `naming`, and `model_routing`.
|
|
23
|
+
If config missing → prompt user to run `/compass:init` first.
|
|
24
|
+
|
|
25
|
+
All user-facing messages in `lang`. All generated document content in `spec_lang`.
|
|
26
|
+
|
|
27
|
+
Vietnamese example — if `lang: "vi"`: _"Đang tải kế hoạch cộng tác..."_
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 1: Load plan
|
|
32
|
+
|
|
33
|
+
- Scan session directory for `plan.json` (newest by mtime wins if multiple exist)
|
|
34
|
+
- Run `compass-cli validate plan <path-to-plan.json>` before any other check. If exit non-zero → halt here, surface the validator's violations, and tell the user to re-run `/compass:plan`. Do NOT attempt to auto-fix a malformed plan in this workflow.
|
|
35
|
+
- Validate plan (in-workflow sanity pass, in addition to the CLI validator):
|
|
36
|
+
- `plan_version` is exactly `"1.0"`
|
|
37
|
+
- `memory_ref` is present (canonical: `.compass/.state/project-memory.json`)
|
|
38
|
+
- Every task has a non-empty `context_pointers` array (1..30 entries)
|
|
39
|
+
- All `colleague` values exist in `~/.compass/colleagues/manifest.json`
|
|
40
|
+
- Each wave has at least one task
|
|
41
|
+
- Dependencies reference valid task IDs from earlier waves
|
|
42
|
+
- If no `plan.json` found → tell user to run `/compass:plan` first, stop here
|
|
43
|
+
- If validation fails → show which entries are invalid, ask user to fix or skip
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Step 2: Confirm execution
|
|
48
|
+
|
|
49
|
+
Show the plan summary and ask user to confirm before running.
|
|
50
|
+
|
|
51
|
+
Display format:
|
|
52
|
+
```
|
|
53
|
+
Ready to execute: <plan name>
|
|
54
|
+
Colleagues : <N>
|
|
55
|
+
Waves : <N>
|
|
56
|
+
Budget : <total> tokens
|
|
57
|
+
|
|
58
|
+
Wave 1 (parallel):
|
|
59
|
+
[C-01] Research Aggregator [medium]
|
|
60
|
+
[C-02] Market Analyst [medium]
|
|
61
|
+
Wave 2:
|
|
62
|
+
[C-03] Product Writer [high] ← depends on C-01, C-02
|
|
63
|
+
Wave 3:
|
|
64
|
+
[C-04] Story Breaker [medium] ← depends on C-03
|
|
65
|
+
...
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Vietnamese example: _"Bạn có muốn bắt đầu chạy kế hoạch này không?"_
|
|
69
|
+
|
|
70
|
+
**AskUserQuestion**:
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"questions": [{
|
|
74
|
+
"question": "Xác nhận chạy kế hoạch?",
|
|
75
|
+
"header": "Sẵn sàng thực thi",
|
|
76
|
+
"multiSelect": false,
|
|
77
|
+
"options": [
|
|
78
|
+
{"label": "Proceed", "description": "Start executing all waves now"},
|
|
79
|
+
{"label": "Edit plan", "description": "Go back and adjust before running"},
|
|
80
|
+
{"label": "Cancel", "description": "Stop — do not run"}
|
|
81
|
+
]
|
|
82
|
+
}]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If user picks **Cancel** → exit cleanly.
|
|
87
|
+
If user picks **Edit plan** → instruct them to re-run `/compass:plan`.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Step 3: Execute wave-by-wave
|
|
92
|
+
|
|
93
|
+
### Initialization (Wave 1 only)
|
|
94
|
+
|
|
95
|
+
Before the first wave begins, initialize `collab-memory.json` in the session directory:
|
|
96
|
+
```json
|
|
97
|
+
{ "decisions": [], "artifacts": [], "conflicts": [] }
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Then load cross-session memory from the v1.0 project-memory store:
|
|
101
|
+
|
|
102
|
+
1. Call `compass-cli memory get "$PROJECT_ROOT"` to fetch `$PROJECT_ROOT/.compass/.state/project-memory.json` (resolved via the plan's `memory_ref`). If the CLI returns a "not found" signal → call `compass-cli memory init "$PROJECT_ROOT"` first, then `get` again. This guarantees every run starts with a schema-v1.0-conformant memory file.
|
|
103
|
+
2. From the returned JSON, extract the **top-level aggregates digest**:
|
|
104
|
+
- `decisions` — durable architectural / product decisions from prior sessions
|
|
105
|
+
- `discovered_conventions` — conventions learned across past work
|
|
106
|
+
- `resolved_ambiguities` — previously-answered clarification questions
|
|
107
|
+
- `glossary` — project-specific term definitions
|
|
108
|
+
This digest MUST be included verbatim in every Colleague briefing emitted in Step 3 (see the worker prompt template). Do NOT dump the full `sessions[]` FIFO array into briefings — pass only the aggregates digest, to keep Colleague context tight.
|
|
109
|
+
3. Also keep the legacy `$PROJECT_ROOT/.compass/.state/colleague-memory.json` read as a fallback for pre-v1.0 projects: if `compass-cli memory get` reports the store was just initialized (no prior data) AND `colleague-memory.json` exists, prepend its `decisions` into the aggregates digest so Colleagues still see historical context during the migration window.
|
|
110
|
+
4. Store the digest in memory (one canonical copy for this run) — every Colleague briefing in every wave reads from this same digest object.
|
|
111
|
+
|
|
112
|
+
### For each wave
|
|
113
|
+
|
|
114
|
+
**Emit delegation plan** — apply Pattern 2 from `core/shared/progress.md` before spawning. Wave transitions follow Step C format from that module. The v1.0 memory/context-scope concerns below wrap this existing progress-pattern emission — they do NOT replace it.
|
|
115
|
+
|
|
116
|
+
1. **Pre-spawn context resolution (per task, v1.0):** for each task in the wave:
|
|
117
|
+
- Resolve `task.context_pointers` against the project root (handle both exact paths and globs).
|
|
118
|
+
- For any pointer that matches **zero** files on disk at this moment → halt dispatch for that task and escalate to the user via AskUserQuestion (see "Missing context_pointer escalation" below). Do NOT silently skip the task, do NOT widen scope to compensate, do NOT drop the pointer.
|
|
119
|
+
- Pointers that were produced by an earlier wave in this same run will now exist — that is expected. Only pointers that resolve to zero matches *at the moment the wave starts* are errors.
|
|
120
|
+
2. Print wave plan with all colleagues marked `🔄` and their 3-6 word job description (existing progress pattern).
|
|
121
|
+
3. Spawn each Colleague in the wave as a subagent (Task tool) with a fresh context window. The briefing MUST contain ONLY:
|
|
122
|
+
- that task's `briefing_notes` + structured `briefing` fields (constraints, stakeholders, deadline)
|
|
123
|
+
- the files resolved from that task's `context_pointers`
|
|
124
|
+
- the top-level aggregates digest from `project-memory.json` (loaded in Initialization)
|
|
125
|
+
- the shared base rules
|
|
126
|
+
Do NOT pass files from other tasks, other sessions, or unrelated areas of the repo — strict scope is a v1.0 guarantee.
|
|
127
|
+
4. Waves with multiple Colleagues run in **parallel** — all Colleagues in the wave start at the same time.
|
|
128
|
+
5. As each Colleague finishes, emit `✓ <colleague name> (<elapsed>s)` live to main chat (existing progress pattern) — do NOT wait for wave end to report.
|
|
129
|
+
6. When all Colleagues in the current wave finish, emit wave-transition separator (`─── Wave N complete (total, artifacts) ───`) (existing progress pattern).
|
|
130
|
+
7. Run post-wave consistency check (Step 5).
|
|
131
|
+
8. Update session-local `collab-memory.json` with outputs and decisions (unchanged legacy behavior).
|
|
132
|
+
9. **Persist wave outputs to `project-memory.json` (v1.0):** call
|
|
133
|
+
```bash
|
|
134
|
+
compass-cli memory update "$PROJECT_ROOT" --session "<session_id>" --from-wave <wave_id> --inputs <path-to-collab-memory.json-or-wave-outputs>
|
|
135
|
+
```
|
|
136
|
+
so that new decisions, discovered conventions, resolved ambiguities, and glossary additions from this wave are merged into the project-memory store. The CLI handles schema-v1.0 shape + FIFO rotation internally; this workflow only needs to invoke it after each wave completes.
|
|
137
|
+
10. Proceed to next wave.
|
|
138
|
+
|
|
139
|
+
### Colleague worker prompt template
|
|
140
|
+
|
|
141
|
+
Each Colleague subagent receives ONLY this briefing — no other context. The `Context files` list MUST be exactly the files resolved from that task's `context_pointers` (nothing more, nothing less). The `Project Memory Digest` block MUST be the top-level aggregates loaded from `project-memory.json` in Initialization — NOT the full FIFO `sessions[]` array.
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
You are a Compass Colleague — <colleague.name>.
|
|
145
|
+
|
|
146
|
+
## Your Assignment
|
|
147
|
+
Task : <name>
|
|
148
|
+
ID : <task_id>
|
|
149
|
+
Role : <colleague>
|
|
150
|
+
Workspace: <workspace_dir>
|
|
151
|
+
|
|
152
|
+
## Briefing Notes
|
|
153
|
+
<task.briefing_notes>
|
|
154
|
+
|
|
155
|
+
## Context Files (authoritative scope — read these first, nothing outside this list)
|
|
156
|
+
<files resolved from task.context_pointers>
|
|
157
|
+
|
|
158
|
+
## Structured Briefing
|
|
159
|
+
Constraints:
|
|
160
|
+
<task.briefing.constraints>
|
|
161
|
+
|
|
162
|
+
Stakeholders:
|
|
163
|
+
<task.briefing.stakeholders>
|
|
164
|
+
|
|
165
|
+
Deadline:
|
|
166
|
+
<task.briefing.deadline>
|
|
167
|
+
|
|
168
|
+
## Project Memory Digest (from project-memory.json — top-level aggregates)
|
|
169
|
+
Decisions:
|
|
170
|
+
<project-memory.decisions>
|
|
171
|
+
|
|
172
|
+
Discovered Conventions:
|
|
173
|
+
<project-memory.discovered_conventions>
|
|
174
|
+
|
|
175
|
+
Resolved Ambiguities:
|
|
176
|
+
<project-memory.resolved_ambiguities>
|
|
177
|
+
|
|
178
|
+
Glossary:
|
|
179
|
+
<project-memory.glossary>
|
|
180
|
+
|
|
181
|
+
## Shared Memory (this session only)
|
|
182
|
+
<collab-memory.json contents>
|
|
183
|
+
|
|
184
|
+
## Output
|
|
185
|
+
Write to : <output_pattern resolved with slug>
|
|
186
|
+
Follow template: <template path>
|
|
187
|
+
Language : <spec_lang>
|
|
188
|
+
|
|
189
|
+
## Acceptance Criteria
|
|
190
|
+
<acceptance.criteria>
|
|
191
|
+
|
|
192
|
+
## Rules
|
|
193
|
+
<base-rules.md contents>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Scope guarantee:** the orchestrator passes ONLY `context_pointers`-resolved files + `briefing_notes` + the project-memory digest. If the Colleague needs additional files to complete the task, it MUST surface that gap back to the orchestrator rather than reading outside scope — `/compass:plan` is the place to widen `context_pointers`, not the Colleague.
|
|
197
|
+
|
|
198
|
+
### Status tracking
|
|
199
|
+
|
|
200
|
+
Each Colleague moves through these states:
|
|
201
|
+
`pending → running → completed → failed → blocked → skipped`
|
|
202
|
+
|
|
203
|
+
Live status display after each wave completes:
|
|
204
|
+
```
|
|
205
|
+
Wave 1:
|
|
206
|
+
✅ C-01 — Research Aggregator [completed]
|
|
207
|
+
✅ C-02 — Market Analyst [completed]
|
|
208
|
+
Wave 2:
|
|
209
|
+
🔄 C-03 — Product Writer [running...]
|
|
210
|
+
Wave 3:
|
|
211
|
+
⬜ C-04 — Story Breaker [pending]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Persist status to `run-status.json` in session directory after every state change.
|
|
215
|
+
|
|
216
|
+
### Shared memory updates
|
|
217
|
+
|
|
218
|
+
After each Colleague completes:
|
|
219
|
+
1. Read its output files
|
|
220
|
+
2. Extract any decisions, artifact paths, or constraints noted
|
|
221
|
+
3. Append to `collab-memory.json`
|
|
222
|
+
4. Next wave's Colleagues receive the updated shared memory in their briefing
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Step 4: Escalation ladder
|
|
227
|
+
|
|
228
|
+
When a Colleague fails or times out, escalate in order:
|
|
229
|
+
|
|
230
|
+
1. **Retry** — same prompt, fresh attempt (1×)
|
|
231
|
+
2. **Retry enriched** — add error details + related reference docs to context (1×)
|
|
232
|
+
3. **Model escalation** — switch to a more capable model per `model_routing.escalation` in config (1×)
|
|
233
|
+
4. **PO intervention** — Colleague still unresolved; ask user via AskUserQuestion:
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"questions": [{
|
|
238
|
+
"question": "C-03 Product Writer gặp lỗi sau 3 lần thử. Bạn muốn làm gì?",
|
|
239
|
+
"header": "Escalation — C-03",
|
|
240
|
+
"multiSelect": false,
|
|
241
|
+
"options": [
|
|
242
|
+
{"label": "Provide guidance", "description": "Give me context and I'll retry with it"},
|
|
243
|
+
{"label": "Skip", "description": "Continue without this Colleague's output"},
|
|
244
|
+
{"label": "Stop", "description": "Halt the entire run now"},
|
|
245
|
+
{"label": "Mark as done", "description": "I'll fix the output manually — mark completed"}
|
|
246
|
+
]
|
|
247
|
+
}]
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
- **Provide guidance** → collect user's note, retry with enriched context
|
|
252
|
+
- **Skip** → set status to `skipped`, continue run; note dependency impact
|
|
253
|
+
- **Stop** → save all current status, print partial report, exit
|
|
254
|
+
- **Mark as done** → set status to `completed`, move to next wave
|
|
255
|
+
|
|
256
|
+
### Missing context_pointer escalation (v1.0)
|
|
257
|
+
|
|
258
|
+
If, during "Pre-spawn context resolution" (Step 3.1), a task's `context_pointers` entry resolves to **zero matches** on disk at the moment the wave starts, the orchestrator MUST NOT:
|
|
259
|
+
|
|
260
|
+
- silently drop the pointer,
|
|
261
|
+
- replace it with a different file,
|
|
262
|
+
- widen the Colleague's scope to "whatever is nearby",
|
|
263
|
+
- or mark the task as skipped on its own authority.
|
|
264
|
+
|
|
265
|
+
Instead, halt dispatch for that task and ask the user via AskUserQuestion:
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"questions": [{
|
|
270
|
+
"question": "Task <task_id> references '<pointer>' but no file matches. How do you want to proceed?",
|
|
271
|
+
"header": "Missing context — <task_id>",
|
|
272
|
+
"multiSelect": false,
|
|
273
|
+
"options": [
|
|
274
|
+
{"label": "Skip this task", "description": "Mark <task_id> as skipped and continue the run; downstream tasks depending on its output will be flagged."},
|
|
275
|
+
{"label": "Abort the run", "description": "Stop now; fix the plan in /compass:plan (adjust context_pointers) and re-run."},
|
|
276
|
+
{"label": "Provide an alternative path", "description": "Give me a real file path or glob to substitute in for this one missing pointer, just for this run."}
|
|
277
|
+
]
|
|
278
|
+
}]
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
- **Skip this task** → set its status to `skipped`, record the missing pointer in `collab-memory.json` under `conflicts`, continue the run. Downstream tasks whose `depends_on` includes this task MUST be flagged (and may themselves escalate as `blocked`).
|
|
283
|
+
- **Abort the run** → persist `run-status.json`, print a partial report noting the missing pointer, exit cleanly.
|
|
284
|
+
- **Provide an alternative path** → accept the user-supplied path/glob, substitute it ONLY for this task in this run (do NOT rewrite `plan.json`), and continue. Note the substitution in `collab-memory.json` so the final report can show it.
|
|
285
|
+
|
|
286
|
+
This escalation applies on a **per-pointer** basis — if only 1 of 5 pointers is missing, the other 4 still resolve normally and the user's choice applies only to the missing one.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Step 5: Post-wave consistency check
|
|
291
|
+
|
|
292
|
+
After every wave completes, verify before starting the next wave:
|
|
293
|
+
|
|
294
|
+
- All expected output files exist at the declared paths
|
|
295
|
+
- Cross-references are valid (e.g., if Writer finished, Stories must reference the PRD slug)
|
|
296
|
+
- No conflicting decisions in `collab-memory.json` (same key set to different values)
|
|
297
|
+
- File naming follows `config.naming` patterns
|
|
298
|
+
- No Colleague left in `running` state (detect hangs)
|
|
299
|
+
|
|
300
|
+
If a conflict is found in shared memory → flag to user with AskUserQuestion before continuing.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Step 5.5: Persist cross-session memory
|
|
305
|
+
|
|
306
|
+
After all waves complete (before printing the final report), persist durable decisions:
|
|
307
|
+
|
|
308
|
+
1. Read the session's `collab-memory.json` (final state after all Colleagues ran)
|
|
309
|
+
2. Read `$PROJECT_ROOT/.compass/.state/colleague-memory.json` if it exists; otherwise start with the empty structure below
|
|
310
|
+
3. Identify NEW decisions from the session: entries in `collab-memory.json` whose `persistence` field is `"persistent"` AND whose `key` does not already exist in `$PROJECT_ROOT/.compass/.state/colleague-memory.json`
|
|
311
|
+
4. Append only those new entries to the persistent file's `decisions` array — never overwrite or remove existing entries
|
|
312
|
+
5. Write the updated persistent file back to `$PROJECT_ROOT/.compass/.state/colleague-memory.json`
|
|
313
|
+
|
|
314
|
+
Persistent file format:
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"version": "0.4.0",
|
|
318
|
+
"decisions": [
|
|
319
|
+
{
|
|
320
|
+
"key": "auth_approach",
|
|
321
|
+
"value": "OAuth2 + PKCE",
|
|
322
|
+
"decided_by": "C-01 (Research Aggregator)",
|
|
323
|
+
"session": "<session-id>",
|
|
324
|
+
"reason": "User feedback strongly prefers SSO",
|
|
325
|
+
"timestamp": "<ISO-8601>"
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
"conventions": {}
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
- The `session` field is the plan name or a `<task>-<date>` slug derived from the plan
|
|
333
|
+
- The `timestamp` is the UTC time the decision was appended
|
|
334
|
+
- If `$PROJECT_ROOT/.compass/.state/` directory does not exist, create it before writing
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Step 6: Final report
|
|
339
|
+
|
|
340
|
+
After all waves complete, print the final summary:
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
Done!
|
|
344
|
+
Colleagues : <N>/<N> completed
|
|
345
|
+
Files created:
|
|
346
|
+
- <path-1>
|
|
347
|
+
- <path-2>
|
|
348
|
+
Shared memory: <N> decisions recorded (<M> saved to cross-session memory)
|
|
349
|
+
Budget used : <X>k / <Y>k tokens
|
|
350
|
+
|
|
351
|
+
Next: /compass:check
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Vietnamese example: _"Hoàn tất! Tất cả các Đồng nghiệp đã chạy xong. Dùng /compass:check để xem lại kết quả."_
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Edge cases
|
|
359
|
+
|
|
360
|
+
| Situation | Behavior |
|
|
361
|
+
|---|---|
|
|
362
|
+
| Colleague timeout | Treat as failure → trigger escalation ladder |
|
|
363
|
+
| Shared memory conflict | Flag to PO before next wave starts |
|
|
364
|
+
| All Colleagues in a wave fail | Print clean status report, halt run |
|
|
365
|
+
| PO cancels mid-run | Save `run-status.json` with partial progress; can resume later |
|
|
366
|
+
| Dependency's output missing | Blocked Colleague → set status `blocked`, escalate to PO |
|
|
367
|
+
| Plan has only 1 wave with 1 Colleague | Run normally — no parallel needed, still do consistency check |
|