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.
Files changed (118) hide show
  1. package/README.md +105 -0
  2. package/VERSION +1 -0
  3. package/bin/install +174 -0
  4. package/bootstrap.sh +95 -0
  5. package/cli/Cargo.lock +270 -0
  6. package/cli/Cargo.toml +24 -0
  7. package/cli/src/cmd/context.rs +59 -0
  8. package/cli/src/cmd/dag.rs +133 -0
  9. package/cli/src/cmd/git.rs +148 -0
  10. package/cli/src/cmd/hook.rs +51 -0
  11. package/cli/src/cmd/index.rs +363 -0
  12. package/cli/src/cmd/manifest.rs +34 -0
  13. package/cli/src/cmd/memory.rs +680 -0
  14. package/cli/src/cmd/migrate.rs +790 -0
  15. package/cli/src/cmd/mod.rs +14 -0
  16. package/cli/src/cmd/progress.rs +107 -0
  17. package/cli/src/cmd/project.rs +1700 -0
  18. package/cli/src/cmd/session.rs +64 -0
  19. package/cli/src/cmd/state.rs +317 -0
  20. package/cli/src/cmd/validate/mod.rs +506 -0
  21. package/cli/src/cmd/validate/prd.rs +472 -0
  22. package/cli/src/cmd/version.rs +89 -0
  23. package/cli/src/helpers.rs +40 -0
  24. package/cli/src/main.rs +75 -0
  25. package/cli/tests/fixtures/plan_empty_pointers.json +60 -0
  26. package/cli/tests/fixtures/plan_missing_pointers.json +59 -0
  27. package/cli/tests/fixtures/plan_too_many_pointers.json +92 -0
  28. package/cli/tests/fixtures/plan_v1_valid.json +64 -0
  29. package/cli/tests/fixtures/prd_bad_flow_bullet.md +37 -0
  30. package/cli/tests/fixtures/prd_bad_flow_prose.md +33 -0
  31. package/cli/tests/fixtures/prd_good_flow.md +41 -0
  32. package/cli/tests/fixtures/prd_xref_dangling.md +38 -0
  33. package/cli/tests/fixtures/prd_xref_valid.md +53 -0
  34. package/cli/tests/fixtures/projects/proj_a/.compass/.state/config.json +12 -0
  35. package/cli/tests/fixtures/projects/proj_b/.compass/.state/config.json +12 -0
  36. package/cli/tests/fixtures/projects/proj_c/.compass/.state/config.json +12 -0
  37. package/cli/tests/fixtures/registry/all_dead.json +18 -0
  38. package/cli/tests/fixtures/registry/corrupt.json +1 -0
  39. package/cli/tests/fixtures/registry/empty.json +1 -0
  40. package/cli/tests/fixtures/registry/last_active_dead.json +24 -0
  41. package/cli/tests/fixtures/registry/multi_alive.json +24 -0
  42. package/cli/tests/fixtures/registry/one_alive.json +12 -0
  43. package/cli/tests/fixtures/v0_project/.compass/.state/config.json +5 -0
  44. package/cli/tests/fixtures/v0_project/.compass/.state/sessions/onboarding-redesign/plan.json +29 -0
  45. package/cli/tests/fixtures/v0_project/.compass/.state/sessions/sample-feature/context.json +11 -0
  46. package/cli/tests/fixtures/v0_project/.compass/.state/sessions/sample-feature/plan.json +49 -0
  47. package/core/colleagues/base-rules.md +112 -0
  48. package/core/colleagues/manifest.json +85 -0
  49. package/core/colleagues/market-analyst.md +50 -0
  50. package/core/colleagues/prioritizer.md +53 -0
  51. package/core/colleagues/researcher.md +54 -0
  52. package/core/colleagues/reviewer.md +55 -0
  53. package/core/colleagues/stakeholder-comm.md +59 -0
  54. package/core/colleagues/story-breaker.md +57 -0
  55. package/core/colleagues/ux-reviewer.md +54 -0
  56. package/core/colleagues/writer.md +55 -0
  57. package/core/commands/compass/brief.md +28 -0
  58. package/core/commands/compass/check.md +27 -0
  59. package/core/commands/compass/epic.md +32 -0
  60. package/core/commands/compass/feedback.md +32 -0
  61. package/core/commands/compass/help.md +24 -0
  62. package/core/commands/compass/ideate.md +32 -0
  63. package/core/commands/compass/init.md +30 -0
  64. package/core/commands/compass/plan.md +27 -0
  65. package/core/commands/compass/prd.md +39 -0
  66. package/core/commands/compass/prioritize.md +36 -0
  67. package/core/commands/compass/prototype.md +28 -0
  68. package/core/commands/compass/release.md +32 -0
  69. package/core/commands/compass/research.md +31 -0
  70. package/core/commands/compass/roadmap.md +32 -0
  71. package/core/commands/compass/run.md +28 -0
  72. package/core/commands/compass/setup.md +32 -0
  73. package/core/commands/compass/sprint.md +32 -0
  74. package/core/commands/compass/status.md +32 -0
  75. package/core/commands/compass/story.md +37 -0
  76. package/core/commands/compass/undo.md +33 -0
  77. package/core/commands/compass/update.md +29 -0
  78. package/core/hooks/context-monitor.sh +5 -0
  79. package/core/hooks/manifest-tracker.sh +62 -0
  80. package/core/hooks/statusline.sh +12 -0
  81. package/core/hooks/update-checker.sh +24 -0
  82. package/core/integrations/confluence.md +267 -0
  83. package/core/integrations/figma.md +277 -0
  84. package/core/integrations/jira.md +436 -0
  85. package/core/integrations/vercel.md +170 -0
  86. package/core/manifest.json +172 -0
  87. package/core/shared/SCHEMAS-v1.md +404 -0
  88. package/core/shared/progress.md +145 -0
  89. package/core/shared/project-scan.md +293 -0
  90. package/core/shared/resolve-project.md +136 -0
  91. package/core/shared/ux-rules.md +52 -0
  92. package/core/shared/version-backup.md +38 -0
  93. package/core/templates/prd-template.md +145 -0
  94. package/core/templates/story-template.md +99 -0
  95. package/core/workflows/brief.md +184 -0
  96. package/core/workflows/check.md +436 -0
  97. package/core/workflows/epic.md +177 -0
  98. package/core/workflows/feedback.md +164 -0
  99. package/core/workflows/help.md +79 -0
  100. package/core/workflows/ideate.md +320 -0
  101. package/core/workflows/init.md +524 -0
  102. package/core/workflows/migrate.md +136 -0
  103. package/core/workflows/plan.md +320 -0
  104. package/core/workflows/prd.md +632 -0
  105. package/core/workflows/prioritize.md +301 -0
  106. package/core/workflows/project.md +177 -0
  107. package/core/workflows/prototype.md +174 -0
  108. package/core/workflows/release.md +179 -0
  109. package/core/workflows/research.md +613 -0
  110. package/core/workflows/roadmap.md +152 -0
  111. package/core/workflows/run.md +367 -0
  112. package/core/workflows/setup.md +294 -0
  113. package/core/workflows/sprint.md +187 -0
  114. package/core/workflows/status.md +185 -0
  115. package/core/workflows/story.md +477 -0
  116. package/core/workflows/undo.md +42 -0
  117. package/core/workflows/update.md +127 -0
  118. package/package.json +37 -0
@@ -0,0 +1,294 @@
1
+ # Workflow: compass:setup
2
+
3
+ You are the integration manager. Mission: detect, configure, and verify tool connections (Jira, Figma, Confluence, Vercel).
4
+
5
+ **Principles:** Detect before asking. Verify immediately after setup. Never break the init flow for a restart. Show clear status for every integration.
6
+
7
+ **Purpose**: View, configure, verify, or reset integrations (Jira, Figma, Confluence, Vercel). Acts as the single entry point for all integration management after init.
8
+
9
+ **Output**:
10
+ - Updates `~/.config/compass/integrations.json` (user-level integration status)
11
+ - No project-level files changed (integrations are user-level)
12
+
13
+ **When to use**:
14
+ - Check which integrations are configured: `/compass:setup` (no args)
15
+ - Set up a specific one: `/compass:setup <name>` (e.g. `jira`, `figma`, `confluence`, `vercel`)
16
+ - Verify all: `/compass:setup verify`
17
+ - Verify one: `/compass:setup verify-<name>`
18
+ - Reset one: `/compass:setup reset <name>`
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
+ > **Setup-specific fallback**: Setup operates on user-level integrations and can run without an active project. If the resolver returns `status=none` (no Compass project found), skip the ambiguous/none prompts from the shared snippet, default `lang = "en"`, and continue. Show tip at end: "Tip: run /compass:init first to set project preferences."
27
+
28
+ **Error handling when a project IS resolved** (reading `$PROJECT_ROOT/.compass/.state/config.json` via `$CONFIG`):
29
+
30
+ 1. **$CONFIG missing / status=none**: default `lang = "en"`, continue as described above.
31
+
32
+ 2. **Config exists but is corrupt JSON** (parse error):
33
+ ```
34
+ [Compass] Warning: $PROJECT_ROOT/.compass/.state/config.json could not be parsed (corrupt JSON).
35
+ Defaulting language to English.
36
+ Tip: run /compass:init to reinitialize your project config.
37
+ ```
38
+ Default `lang = "en"`, continue.
39
+
40
+ 3. **Config valid JSON, but missing `lang` field**:
41
+ ```
42
+ [Compass] Warning: config.json is missing the 'lang' field.
43
+ Defaulting language to English.
44
+ ```
45
+ Default `lang = "en"`, continue.
46
+
47
+ 4. **Config valid, `lang` present**: load `lang`, continue.
48
+
49
+ **Language enforcement**: from this point on, ALL user-facing text MUST use `lang`. JSON keys stay in English.
50
+
51
+ ## Step 1 — Parse arguments
52
+
53
+ The caller passes an argument string. Parse it into an action:
54
+
55
+ | Argument | Action |
56
+ |---|---|
57
+ | (empty / none) | Show status table |
58
+ | `<name>` (jira, figma, confluence, vercel) | Delegate to integration setup |
59
+ | `verify` | Re-verify ALL configured integrations |
60
+ | `verify-<name>` | Re-verify ONE integration |
61
+ | `reset <name>` | Mark one as not-configured |
62
+
63
+ If the argument doesn't match any of the above, show (in `lang`):
64
+
65
+ ```
66
+ Unknown argument: <arg>
67
+
68
+ Usage:
69
+ compass:setup — show integration status
70
+ compass:setup <name> — set up an integration (jira, figma, confluence, vercel)
71
+ compass:setup verify — re-verify all configured integrations
72
+ compass:setup verify-<name> — re-verify one integration
73
+ compass:setup reset <name> — mark one as not-configured
74
+ ```
75
+
76
+ ## Step 2 — Read current status
77
+
78
+ Read `~/.config/compass/integrations.json`.
79
+
80
+ **Error handling — integrations.json:**
81
+
82
+ 1. **File missing**: create it with defaults (see below). No warning needed — first run.
83
+
84
+ 2. **File exists but is corrupt JSON** (parse error):
85
+ - Back up: `integrations.json.backup-<ISO-timestamp>`
86
+ - Create fresh file with defaults
87
+ - Show (in `lang`):
88
+ ```
89
+ [Compass] Warning: integrations.json was corrupt and could not be read.
90
+ A backup was saved to: ~/.config/compass/integrations.json.backup-<timestamp>
91
+ A fresh integrations file has been created.
92
+ Tip: run /compass:init to reconfigure integrations from scratch.
93
+ ```
94
+
95
+ 3. **File exists, valid JSON, but missing required fields** (`version`, `integrations`):
96
+ - Treat as corrupt: back up, create fresh, show same warning as above.
97
+
98
+ 4. **File exists, valid, all fields present**: load and use as-is.
99
+
100
+ **Default integrations.json structure** (used for missing or corrupt files):
101
+
102
+ ```json
103
+ {
104
+ "version": "0.4.0",
105
+ "updated_at": "<now ISO>",
106
+ "integrations": {
107
+ "jira": { "status": "not-configured" },
108
+ "figma": { "status": "not-configured" },
109
+ "confluence": { "status": "not-configured" },
110
+ "vercel": { "status": "not-configured" }
111
+ }
112
+ }
113
+ ```
114
+
115
+ Ensure `~/.config/compass/` exists: `mkdir -p ~/.config/compass`.
116
+
117
+ ## Step 3 — Execute action
118
+
119
+ ### Action: Show status table (no args)
120
+
121
+ Display (in `lang`):
122
+
123
+ ```
124
+ COMPASS — Integration Status
125
+
126
+ | Integration | Status | User | Details |
127
+ |-------------|---------------------|---------------|----------------------------|
128
+ | Jira | <status> | <user or -> | project: <KEY or -> |
129
+ | Figma | <status> | <user or -> | team: <URL or -> |
130
+ | Confluence | <status> | <user or -> | space: <KEY or -> |
131
+ | Vercel | <status> | <mode or -> | channel: <channel or -> |
132
+
133
+ Status legend:
134
+ configured — working and verified
135
+ configured-pending-verify — installed, needs host restart + verify
136
+ skipped — explicitly skipped during init
137
+ not-configured — never set up
138
+ error — last attempt failed (see notes)
139
+
140
+ Commands:
141
+ /compass:setup <name> — set up or reconfigure
142
+ /compass:setup verify — re-verify all
143
+ /compass:setup verify-<name> — re-verify one
144
+ /compass:setup reset <name> — clear config (keeps MCP)
145
+ ```
146
+
147
+ Format `status` with indicators:
148
+ - `configured` → prefix with checkmark
149
+ - `configured-pending-verify` → prefix with hourglass
150
+ - `skipped` → prefix with dash
151
+ - `not-configured` → prefix with dash
152
+ - `error` → prefix with warning sign, append `notes` if present
153
+
154
+ ### Action: Delegate to integration setup
155
+
156
+ Read and follow `~/.compass/core/integrations/<name>.md` in `setup` mode.
157
+
158
+ Pass the current `lang` and `HOST` detection to the integration workflow.
159
+
160
+ ### Action: Verify all
161
+
162
+ For each integration where `status` is `configured` or `configured-pending-verify`:
163
+ 1. Read and follow the corresponding `~/.compass/core/integrations/<name>.md` in `verify` mode.
164
+ 2. Collect results.
165
+
166
+ After all verifications, show a summary table:
167
+
168
+ ```
169
+ COMPASS — Verification Results
170
+
171
+ | Integration | Before | After | Details |
172
+ |-------------|---------------------|---------------------|----------------|
173
+ | Jira | configured | configured | verified OK |
174
+ | Confluence | pending-verify | configured | now verified |
175
+ | Figma | configured | error | 401 bad token |
176
+ | Vercel | skipped | (skipped) | — |
177
+ ```
178
+
179
+ ### Action: Verify one
180
+
181
+ Read and follow `~/.compass/core/integrations/<name>.md` in `verify` mode.
182
+
183
+ ### Action: Reset one
184
+
185
+ 1. Ask the PO to confirm using AskUserQuestion format (in `lang`):
186
+
187
+ ```json
188
+ {
189
+ "header": "Reset <Name> Integration",
190
+ "questions": [
191
+ {
192
+ "id": "confirm_reset",
193
+ "question": "This clears Compass's memory of the <Name> integration but does NOT remove the MCP server from your host config. Do you want to continue?",
194
+ "options": ["Yes, reset it", "Cancel"],
195
+ "multiSelect": false
196
+ }
197
+ ]
198
+ }
199
+ ```
200
+
201
+ Vietnamese example (when `lang = "vi"`):
202
+ ```json
203
+ {
204
+ "header": "Đặt lại tích hợp <Name>",
205
+ "questions": [
206
+ {
207
+ "id": "confirm_reset",
208
+ "question": "Thao tác này sẽ xóa thông tin tích hợp <Name> khỏi Compass nhưng KHÔNG xóa cấu hình MCP server. Bạn có muốn tiếp tục không?",
209
+ "options": ["Có, đặt lại", "Hủy"],
210
+ "multiSelect": false
211
+ }
212
+ ]
213
+ }
214
+ ```
215
+
216
+ 2. If the PO selects "Yes" / "Có, đặt lại", overwrite the integration entry:
217
+ ```json
218
+ { "status": "not-configured" }
219
+ ```
220
+
221
+ 3. Atomically write to `~/.config/compass/integrations.json` (read, modify, write to tmp, mv).
222
+
223
+ 4. Confirm (in `lang`):
224
+ ```
225
+ <Name> integration reset to not-configured.
226
+ MCP config at <path> is unchanged — remove manually if needed.
227
+
228
+ To set up again: /compass:setup <name>
229
+ ```
230
+
231
+ 5. If the PO selects "Cancel" / "Hủy":
232
+ ```
233
+ Reset cancelled. No changes made.
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Interactive question format (AskUserQuestion)
239
+
240
+ All questions to the PO during setup or integration flows MUST use this JSON structure:
241
+
242
+ ```json
243
+ {
244
+ "header": "<Section or action title>",
245
+ "questions": [
246
+ {
247
+ "id": "<unique_snake_case_id>",
248
+ "question": "<Question text in lang>",
249
+ "options": ["<option1>", "<option2>"],
250
+ "multiSelect": false
251
+ }
252
+ ]
253
+ }
254
+ ```
255
+
256
+ - `header`: Describe the current step or context (shown as a heading).
257
+ - `questions`: Array of question objects. One object per question.
258
+ - `id`: Unique identifier for the answer; use snake_case. Used to reference the PO's reply.
259
+ - `question`: Full question text, always in `lang`.
260
+ - `options`: Predefined choices. MUST have ≥2 options — never use empty array. Provide concrete suggestions; the built-in "Type your own answer" handles custom input.
261
+ - `multiSelect`: `true` if the PO may choose more than one option; `false` otherwise.
262
+
263
+ **Vietnamese example** (general integration selection):
264
+ ```json
265
+ {
266
+ "header": "Cài đặt tích hợp Compass",
267
+ "questions": [
268
+ {
269
+ "id": "select_integration",
270
+ "question": "Bạn muốn thiết lập tích hợp nào?",
271
+ "options": ["Jira", "Figma", "Confluence", "Vercel", "Bỏ qua"],
272
+ "multiSelect": false
273
+ }
274
+ ]
275
+ }
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Save session
281
+
282
+ Create session record at `$PROJECT_ROOT/.compass/.state/sessions/<ISO-timestamp>-setup/` (skip if `status=none` — no project resolved):
283
+ - `transcript.md` — actions taken and results
284
+
285
+ Never include raw tokens in the transcript.
286
+
287
+ ## Edge cases
288
+
289
+ - **No config.json (never ran init)**: setup still works — integrations are user-level. Show a note: "Tip: run /compass:init first to set project preferences."
290
+ - **integrations.json is corrupted**: back up to `integrations.json.backup-<timestamp>`, create a fresh one, warn the PO. (See Step 2 error handling.)
291
+ - **PO runs verify on a not-configured integration**: tell them "This integration hasn't been set up yet. Run /compass:setup <name> to configure it."
292
+ - **PO runs reset on something already not-configured**: silently succeed, no error.
293
+ - **Multiple hosts**: setup delegates to the integration workflow which handles host detection. Compass doesn't need to handle it here.
294
+ - **$PROJECT_ROOT/.compass/.state/sessions/ doesn't exist**: create it (`mkdir -p`).
@@ -0,0 +1,187 @@
1
+ # Workflow: compass:sprint
2
+
3
+ You are the sprint planner. Mission: select stories for the next sprint based on priority, capacity, and dependencies.
4
+
5
+ **Principles:** Capacity is king — never overcommit. Dependencies first. Balance quick wins with strategic items. Show the trade-offs clearly. A sprint plan is a commitment, not a wish list.
6
+
7
+ **Purpose**: Select the right stories for the next sprint from a prioritized backlog, fit them within team capacity, surface dependencies and blockers, and produce a sprint plan ready for kick-off.
8
+
9
+ **Output**: `research/SPRINT-{N}-{slug}-{date}.md` (Silver Tiger) or `.compass/Research/SPRINT-{N}-{slug}-{date}.md` (standalone)
10
+
11
+ **When to use**:
12
+ - Sprint planning meeting is coming up
13
+ - You want to pre-select and argue for a story set before the team session
14
+ - You need to show what gets cut and why when capacity is tight
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-select stories by priority, use default 2-week sprint, one review step.
37
+ - `standard`: ask sprint goal, duration, capacity, then auto-select and let PO adjust.
38
+ - `detailed`: walk through each candidate story with PO before selecting.
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="story"
46
+
47
+ The module handles scanning for existing stories and backlog scores. Use backlog scores (from `/compass:prioritize` output) to determine story order.
48
+
49
+ ---
50
+
51
+ ## Step 1 — Scan stories and backlog
52
+
53
+ 1. Glob `epics/*/user-stories/*.md` (Silver Tiger) or `.compass/Stories/*.md` (standalone).
54
+ 2. For each story file, read frontmatter: `status`, `estimate`, `priority`, `epic`, dependencies.
55
+ 3. Filter to `status: pending` or `status: in-progress` stories only.
56
+ 4. Check for a recent backlog score file (`research/BACKLOG-*.md`) — if found, read it and use RICE or MoSCoW scores to pre-rank candidates.
57
+ 5. Show the count: "Found X candidate stories across Y epics."
58
+
59
+ ---
60
+
61
+ ## Step 2 — Ask sprint parameters
62
+
63
+ Use AskUserQuestion for sprint duration:
64
+
65
+ ```json
66
+ {"questions": [{"question": "How long is this sprint?\n(Tiếng Việt: Sprint này kéo dài bao lâu?)", "header": "Sprint duration", "multiSelect": false, "options": [{"label": "1 week", "description": "7 calendar days / 7 ngày lịch"}, {"label": "2 weeks (standard)", "description": "14 calendar days — most common / 14 ngày lịch — phổ biến nhất"}, {"label": "3 weeks", "description": "21 calendar days / 21 ngày lịch"}, {"label": "Custom — I'll specify", "description": "Tell me the exact start and end dates / Tôi sẽ chỉ định ngày bắt đầu và kết thúc"}]}]}
67
+ ```
68
+
69
+ Use AskUserQuestion for team capacity:
70
+
71
+ ```json
72
+ {"questions": [{"question": "What is the team's capacity for this sprint?\n(Tiếng Việt: Năng lực của nhóm trong sprint này là bao nhiêu?)", "header": "Team capacity", "multiSelect": false, "options": [{"label": "Story points — I'll give you the total", "description": "e.g. 40 points for a team of 3 / ví dụ 40 điểm cho nhóm 3 người"}, {"label": "Days — I'll give you available person-days", "description": "e.g. 18 person-days / ví dụ 18 ngày-người"}, {"label": "Stories — I'll give you a max count", "description": "e.g. max 6 stories this sprint / ví dụ tối đa 6 stories sprint này"}, {"label": "Use last sprint's velocity", "description": "Repeat the same capacity as last sprint / Lặp lại năng lực sprint trước"}]}]}
73
+ ```
74
+
75
+ Use AskUserQuestion for sprint goal:
76
+
77
+ ```json
78
+ {"questions": [{"question": "What is the sprint goal?\n(Tiếng Việt: Mục tiêu sprint là gì?)", "header": "Sprint goal", "multiSelect": false, "options": [{"label": "Ship a specific feature end-to-end", "description": "Focus the sprint on completing one feature / Tập trung sprint vào hoàn thành một tính năng"}, {"label": "Reduce technical debt and bugs", "description": "Hardening sprint — fix before building / Sprint ổn định — sửa trước khi xây"}, {"label": "Close out an epic", "description": "Finish remaining stories in an epic / Hoàn thành các story còn lại của một epic"}, {"label": "Mixed — I'll describe the goal", "description": "Custom sprint goal / Mục tiêu sprint tùy chỉnh"}]}]}
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Step 3 — Auto-select stories
84
+
85
+ **Selection algorithm**:
86
+ 1. Start with stories that have unresolved blockers cleared first (dependencies already done).
87
+ 2. Pick P0 → P1 → P2 stories in order.
88
+ 3. Stop when total estimate reaches capacity threshold (95% capacity max — leave buffer).
89
+ 4. Flag stories that are too large (XL) and recommend splitting before including.
90
+
91
+ **Display the sprint board**:
92
+
93
+ ```
94
+ Sprint <N> — <start date> to <end date>
95
+ Goal: <sprint goal>
96
+ Capacity: <X> points / <Y> days
97
+
98
+ SELECTED (<total points> / <capacity>):
99
+ ✓ <PREFIX>-STORY-001 <title> [S] 2 pts — Priority: P0
100
+ ✓ <PREFIX>-STORY-002 <title> [M] 4 pts — Priority: P0
101
+ ✓ <PREFIX>-STORY-005 <title> [M] 4 pts — Priority: P1
102
+ ✓ <PREFIX>-STORY-007 <title> [S] 2 pts — Priority: P1
103
+ ...
104
+ Total: XX pts / <capacity> pts
105
+
106
+ NOT SELECTED (cut for capacity or dependency):
107
+ ✗ <PREFIX>-STORY-008 <title> [L] 8 pts — Cut: over capacity
108
+ ✗ <PREFIX>-STORY-003 <title> [M] 4 pts — Cut: blocked by STORY-002
109
+ ...
110
+
111
+ BLOCKERS / RISKS:
112
+ ⚠ STORY-006 depends on STORY-004 (in-progress) — not yet done
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Step 4 — PO adjustment
118
+
119
+ Use AskUserQuestion to let PO adjust the selection:
120
+
121
+ ```json
122
+ {"questions": [{"question": "Sprint board looks good?\n(Tiếng Việt: Bảng sprint trông ổn không?)", "header": "Adjust sprint", "multiSelect": false, "options": [{"label": "Looks good — save the sprint plan", "description": "Write the file / Lưu kế hoạch sprint"}, {"label": "Swap a story out", "description": "Remove one and add another / Thay một story"}, {"label": "Add a story (I'll accept the overcommit risk)", "description": "Force-add a story beyond capacity / Thêm story dù vượt năng lực"}, {"label": "Remove a story", "description": "Take one off the board / Bỏ một story khỏi danh sách"}]}]}
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Step 5 — Write sprint plan file
128
+
129
+ ```markdown
130
+ ---
131
+ title: Sprint <N> Plan
132
+ sprint: <N>
133
+ start: <YYYY-MM-DD>
134
+ end: <YYYY-MM-DD>
135
+ goal: <sprint goal>
136
+ capacity: <X> points
137
+ committed: <Y> points
138
+ team: <from config>
139
+ created: <YYYY-MM-DD>
140
+ po: <from config>
141
+ ---
142
+
143
+ # Sprint <N>: <slug>
144
+
145
+ ## Goal
146
+ <Sprint goal statement>
147
+
148
+ ## Sprint Board
149
+
150
+ ### Selected (<Y>/<X> pts)
151
+ | Story | Title | Size | Pts | Epic | Priority |
152
+ |-------|-------|------|-----|------|----------|
153
+ | ... | ... | S | 2 | EPIC-01 | P0 |
154
+
155
+ ### Not Selected
156
+ | Story | Title | Reason |
157
+ |-------|-------|--------|
158
+ | ... | ... | Over capacity / Blocked by ... |
159
+
160
+ ## Blockers & Dependencies
161
+ - <List any known blockers entering the sprint>
162
+
163
+ ## Notes
164
+ <Any team notes, leave days, or known risks>
165
+ ```
166
+
167
+ Save path:
168
+ - Silver Tiger: `research/SPRINT-{N}-{slug}-{date}.md`
169
+ - Standalone: `.compass/Research/SPRINT-{N}-{slug}-{date}.md`
170
+
171
+ ```bash
172
+ compass-cli index add "<output-file-path>" "research" 2>/dev/null || true
173
+ ```
174
+
175
+ ## Save session
176
+
177
+ `$PROJECT_ROOT/.compass/.state/sessions/<timestamp>-sprint-<N>/transcript.md`
178
+
179
+ ## Edge cases
180
+
181
+ - **No backlog score file found**: rank by priority from frontmatter only; note in plan that scoring was not available.
182
+ - **All stories are XL**: stop and recommend splitting each with `/compass:story` before planning.
183
+ - **Capacity is zero or not provided**: refuse to generate a plan — ask again with a concrete number.
184
+ - **Stories have no estimates**: use T-shirt size heuristic (XS=1, S=2, M=4, L=8, XL=13) and mark as "estimated, not confirmed".
185
+ - **Sprint number conflict** (file already exists for SPRINT-N): increment to SPRINT-N+1, warn the user.
186
+ - **PO force-adds stories beyond capacity**: include them but add a prominent `⚠️ OVERCOMMIT: +X pts over capacity` warning in the file header.
187
+ - **Dependencies are circular**: flag immediately, do not include either story until the cycle is resolved.
@@ -0,0 +1,185 @@
1
+ # Workflow: compass:status
2
+
3
+ You are the project dashboard. Mission: show a complete overview of all documents, epics, stories, and their statuses.
4
+
5
+ **Principles:** One glance — everything visible. Color-code by status. Show progress percentages. Highlight blockers. No file is saved — display only. Fast: under 10 seconds.
6
+
7
+ **Purpose**: Instant project health check — count and status of every artifact type, progress bars, blockers, and recent activity. Like `git status` for your product workspace.
8
+
9
+ **Output**: Printed to terminal only. No file created.
10
+
11
+ **When to use**:
12
+ - Morning standup — quick pulse check
13
+ - Before a planning session — see what's done vs in-flight
14
+ - After a series of commands — verify everything landed correctly
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`, `mode`, `prefix`, `project_name` (or derive from folder name)
28
+
29
+ **Error handling**:
30
+ - If `config.json` missing → print: "No Compass project found in this directory. Run `/compass:init` to set one up." Stop.
31
+ - If corrupt → print: "Config file appears corrupt. Run `/compass:init` to repair it." Stop.
32
+ - If valid but `mode` missing → default to standalone, continue.
33
+
34
+ **Language enforcement**: ALL output in `lang`. No file created — language applies to terminal output only.
35
+
36
+ ---
37
+
38
+ ## Step 1 — Load index
39
+
40
+ Run:
41
+ ```bash
42
+ compass-cli index list 2>/dev/null
43
+ ```
44
+
45
+ If the index is empty or the command fails → fall back to direct glob scanning (Steps 2–3).
46
+
47
+ ---
48
+
49
+ ## Step 2 — Count all document types
50
+
51
+ Scan and count by type. For each file, read its frontmatter `status` field.
52
+
53
+ **PRDs** — glob `prd/*.md` (Silver Tiger) or `.compass/PRDs/*.md` (standalone):
54
+ - Count by status: `draft`, `review`, `approved`, `archived`
55
+
56
+ **Epics** — glob `epics/{prefix}-EPIC-*/epic.md` (Silver Tiger):
57
+ - Count by status: `planned`, `active`, `completed`, `on-hold`
58
+
59
+ **Stories** — glob `epics/*/user-stories/*.md` (Silver Tiger) or `.compass/Stories/*.md` (standalone):
60
+ - Count by status: `pending`, `in-progress`, `done`, `blocked`
61
+
62
+ **Research** — glob `research/*.md` or `.compass/Research/*.md`:
63
+ - Count all files (no status breakdown needed)
64
+
65
+ **Ideas** — glob `research/IDEA-*.md` or `.compass/Ideas/*.md`:
66
+ - Count all files
67
+
68
+ **Backlog** — glob `research/BACKLOG-*.md` or `.compass/Backlog/*.md`:
69
+ - Count all files
70
+
71
+ **Technical** — glob `research/TECH-*.md` or any file with `type: technical` in frontmatter:
72
+ - Count all files
73
+
74
+ **Release notes** — glob `release-notes/*.md`:
75
+ - Find the most recent file (by date in filename)
76
+
77
+ ---
78
+
79
+ ## Step 3 — Detect blockers and recent activity
80
+
81
+ **Blockers**: scan stories with `status: blocked` — read their `depends-on` frontmatter field. Build a list: `STORY-XXX depends on STORY-YYY (status: in-progress/pending)`.
82
+
83
+ **Recent activity**: find the 5 most recently modified artifact files. Extract: filename, type, status, modification date. Sort by recency.
84
+
85
+ **Progress calculation**:
86
+ - Stories progress = `done / (done + in-progress + pending + blocked)` × 100%
87
+ - Epic progress = `completed / total epics` × 100%
88
+
89
+ **Progress bar**: build a 10-block bar.
90
+ ```
91
+ ████████░░ 80% → 8 filled blocks
92
+ ████░░░░░░ 40% → 4 filled blocks
93
+ ░░░░░░░░░░ 0% → 0 filled blocks
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Step 4 — Display dashboard
99
+
100
+ Print the dashboard. Adapt language to `lang`. Example (en):
101
+
102
+ ```
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ COMPASS — Project Status
105
+ Project: <name> | Mode: <mode> | Prefix: <PREFIX>
106
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
+
108
+ Documents:
109
+ PRDs: <N> (<X> draft, <Y> review, <Z> approved)
110
+ Epics: <N> (<X> active, <Y> planned, <Z> completed)
111
+ Stories: <N> (<X> done, <Y> in-progress, <Z> pending, <W> blocked)
112
+ Research: <N>
113
+ Ideas: <N>
114
+ Backlog: <N>
115
+ Technical: <N>
116
+ Release notes: <N> (latest: v<version> on <date>)
117
+
118
+ Progress:
119
+ Stories: <bar> <X>% done (<done> / <total>)
120
+ Epics: <bar> <X>% closed (<closed> / <total>)
121
+
122
+ Blockers:
123
+ <emoji> <PREFIX>-STORY-<N> — <title>
124
+ depends on <PREFIX>-STORY-<M> (status: <status>)
125
+ <none if no blockers>
126
+
127
+ Recent activity:
128
+ <date>: <type> <filename> (<status>)
129
+ <date>: <type> <filename> (<status>)
130
+ ... (up to 5 entries)
131
+
132
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
+ Next suggested actions:
134
+ <If 0 epics> /compass:epic — create your first epic
135
+ <If 0 stories> /compass:story — write stories for an epic
136
+ <If stories done> /compass:release — generate release notes
137
+ <If blockers> Resolve blockers before sprint planning
138
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
139
+ ```
140
+
141
+ Vietnamese version (used when `lang=vi`):
142
+
143
+ ```
144
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
+ COMPASS — Trạng thái Dự án
146
+ Dự án: <name> | Chế độ: <mode> | Prefix: <PREFIX>
147
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
148
+
149
+ Tài liệu:
150
+ PRDs: <N> (<X> nháp, <Y> đang review, <Z> đã duyệt)
151
+ Epics: <N> (<X> đang chạy, <Y> đã lên kế hoạch, <Z> hoàn thành)
152
+ Stories: <N> (<X> xong, <Y> đang làm, <Z> chờ, <W> bị chặn)
153
+ Nghiên cứu: <N>
154
+ Ý tưởng: <N>
155
+ Backlog: <N>
156
+ Kỹ thuật: <N>
157
+ Release notes: <N> (mới nhất: v<version> ngày <date>)
158
+
159
+ Tiến độ:
160
+ Stories: <bar> <X>% hoàn thành (<done> / <total>)
161
+ Epics: <bar> <X>% đóng (<closed> / <total>)
162
+
163
+ Vấn đề chặn:
164
+ <PREFIX>-STORY-<N> — <title>
165
+ phụ thuộc vào <PREFIX>-STORY-<M> (trạng thái: <status>)
166
+
167
+ Hoạt động gần đây:
168
+ <date>: <type> <filename> (<status>)
169
+ ...
170
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
171
+ ```
172
+
173
+ **Do not use AskUserQuestion** — this is a display-only command. Print and stop.
174
+
175
+ ---
176
+
177
+ ## Edge cases
178
+
179
+ - **Project is brand new (0 files)**: print a welcome message instead of an empty dashboard — "No documents yet. Start with `/compass:prd` or `/compass:brief` to create your first artifact."
180
+ - **Index is stale** (index exists but files were added manually): fall back to glob scan, add a note: "(Index may be stale — run `compass-cli index rebuild` to refresh)"
181
+ - **Status frontmatter missing from a file**: count it as "unknown" in its category.
182
+ - **Standalone mode with no `compass/` folder**: print: "No compass/ folder found. Run `/compass:init` to initialize a standalone project."
183
+ - **Very large project (>100 stories)**: cap recent activity to 5 entries; show totals only for counts above 50 (e.g. "Stories: 120 (45 done, 62 in-progress, 13 pending)").
184
+ - **All stories are done and no blockers**: celebrate — print a "All clear" banner: "All stories complete — ready for `/compass:release`."
185
+ - **$ARGUMENTS provided** (e.g. `/compass:status epic-03`): filter the dashboard to show only artifacts related to that epic or keyword.