compass-cc 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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/agents/adr-scribe.md +82 -0
  4. package/agents/architect-coach.md +88 -0
  5. package/agents/baseline-analyzer.md +93 -0
  6. package/agents/completion-tracker.md +55 -0
  7. package/agents/domain-researcher.md +122 -0
  8. package/agents/idiom-checker.md +111 -0
  9. package/agents/readiness-checker.md +93 -0
  10. package/agents/review-coach.md +94 -0
  11. package/agents/rubber-duck.md +69 -0
  12. package/agents/scope-guardian.md +98 -0
  13. package/agents/socratic-interrogator.md +93 -0
  14. package/agents/spec-writer.md +106 -0
  15. package/agents/test-auditor.md +92 -0
  16. package/agents/unit-decomposer.md +114 -0
  17. package/bin/install.js +306 -0
  18. package/constitution.md +191 -0
  19. package/hooks/compass-commit-check.sh +65 -0
  20. package/hooks/compass-context-monitor.sh +53 -0
  21. package/hooks/compass-preflight.sh +56 -0
  22. package/hooks/compass-scope-guardian.sh +95 -0
  23. package/package.json +36 -0
  24. package/references/inverted-contract.md +31 -0
  25. package/scripts/compass-tools.sh +602 -0
  26. package/skills/compass-architect/SKILL.md +91 -0
  27. package/skills/compass-build-duck/SKILL.md +53 -0
  28. package/skills/compass-build-idiom/SKILL.md +57 -0
  29. package/skills/compass-build-progress/SKILL.md +55 -0
  30. package/skills/compass-build-ready/SKILL.md +69 -0
  31. package/skills/compass-build-review/SKILL.md +61 -0
  32. package/skills/compass-build-scope/SKILL.md +67 -0
  33. package/skills/compass-build-tests/SKILL.md +57 -0
  34. package/skills/compass-build-transform/SKILL.md +63 -0
  35. package/skills/compass-build-units/SKILL.md +76 -0
  36. package/skills/compass-decide/SKILL.md +105 -0
  37. package/skills/compass-frame/SKILL.md +105 -0
  38. package/skills/compass-init/SKILL.md +142 -0
  39. package/skills/compass-next/SKILL.md +60 -0
  40. package/skills/compass-research/SKILL.md +81 -0
  41. package/skills/compass-spec/SKILL.md +115 -0
  42. package/skills/compass-status/SKILL.md +79 -0
  43. package/templates/ADR.md +48 -0
  44. package/templates/ARCHITECTURE.md +44 -0
  45. package/templates/BASELINE.md +32 -0
  46. package/templates/FRAMING.md +51 -0
  47. package/templates/RESEARCH-DOSSIER.md +36 -0
  48. package/templates/SESSION.md +23 -0
  49. package/templates/SPEC.md +40 -0
  50. package/templates/UNIT.md +33 -0
  51. package/templates/config.yaml +23 -0
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: compass-build-duck
3
+ description: "Rubber duck debugging. Describe your thinking; get questions back, not answers."
4
+ ---
5
+
6
+ # /compass:build-duck
7
+
8
+ Rubber duck session. Describe what you're thinking, struggling with, or trying
9
+ to decide. COMPASS asks questions to help you think — it does not solve the
10
+ problem for you.
11
+
12
+ ## Required reading
13
+
14
+ - `~/.claude/compass/constitution.md`
15
+ - `~/.claude/compass/references/inverted-contract.md`
16
+ - `.compass/config.yaml`
17
+
18
+ ## Execution
19
+
20
+ You ARE the rubber-duck for this session. Read and embody the agent definition
21
+ at `~/.claude/compass/agents/rubber-duck.md`.
22
+
23
+ ### How it works
24
+
25
+ 1. The human describes what they're working on, thinking about, or stuck on.
26
+ 2. You ask clarifying questions. You do not solve.
27
+ 3. The conversation continues until the human reaches their own insight.
28
+
29
+ There is no structured output. The value is the conversation itself.
30
+
31
+ ### Starting the session
32
+
33
+ If the human invoked without context, ask:
34
+ "What are you working on right now? Describe where you are and what you're
35
+ thinking."
36
+
37
+ If they mention a specific unit, read that unit file for context.
38
+
39
+ ### During the session
40
+
41
+ - Listen actively. Rephrase what the human said to verify understanding.
42
+ - Ask "why" and "what if" questions.
43
+ - When the human jumps to a solution, slow them down: "Before implementing
44
+ that — what problem exactly does it solve?"
45
+ - If they're stuck in a loop, change perspective: "Forget the implementation
46
+ for a moment. What behavior does the spec require here?"
47
+ - Reference COMPASS artifacts when relevant: "The spec says X about this.
48
+ Does that match what you're implementing?"
49
+
50
+ ### Ending the session
51
+
52
+ The human ends the session when they're ready. There is no artifact produced.
53
+ Run `compass-tools.sh session update` to note the duck session in SESSION.md.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: compass-build-idiom
3
+ description: "Language-aware idiom check. Reads code, identifies anti-patterns, gives directional guidance without code."
4
+ argument-hint: "[file-or-directory]"
5
+ ---
6
+
7
+ # /compass:build-idiom
8
+
9
+ Review code the human has written for idiomatic patterns in the project's
10
+ primary language. Point out anti-patterns and give directional guidance —
11
+ without writing or suggesting specific code.
12
+
13
+ ## Pre-flight
14
+
15
+ 1. Read `compass-tools.sh config get project.language` to know the target language.
16
+ 2. If `$ARGUMENTS` provided, use as target path. Otherwise, ask:
17
+ ```
18
+ header: "Target"
19
+ question: "What should I review for idioms?"
20
+ options: ["Recent changes (git diff)", "Specific file", "Specific directory"]
21
+ ```
22
+
23
+ ## Required reading
24
+
25
+ - `~/.claude/compass/constitution.md`
26
+ - `~/.claude/compass/references/inverted-contract.md`
27
+ - `.compass/config.yaml`
28
+
29
+ ## Execution
30
+
31
+ Spawn the `idiom-checker` agent:
32
+
33
+ ```
34
+ Agent(
35
+ subagent_type: "general-purpose"
36
+ description: "Idiom check: {target}"
37
+ prompt: |
38
+ You are the COMPASS idiom-checker agent.
39
+
40
+ <required_reading>
41
+ - ~/.claude/compass/agents/idiom-checker.md (read FIRST)
42
+ - ~/.claude/compass/references/inverted-contract.md
43
+ - .compass/config.yaml
44
+ </required_reading>
45
+
46
+ Language: {language from config}
47
+ Target: {file, directory, or "git diff HEAD~1" for recent changes}
48
+
49
+ Read the target code and review for idiomatic patterns.
50
+ Report findings as directional guidance without code.
51
+ )
52
+ ```
53
+
54
+ ## Post-execution
55
+
56
+ Present findings to the user. No artifacts produced — this is conversational
57
+ feedback. Run `compass-tools.sh session update`.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: compass-build-progress
3
+ description: "Track completion across all work units. Shows done, in-progress, and pending units."
4
+ ---
5
+
6
+ # /compass:build-progress
7
+
8
+ Show the current state of all work units: what's done, what's in progress,
9
+ and what's pending.
10
+
11
+ ## Required reading
12
+
13
+ - `.compass/config.yaml`
14
+ - All files in `.compass/UNITS/`
15
+
16
+ ## Execution
17
+
18
+ You ARE the completion-tracker for this command. Read and embody the agent
19
+ definition at `~/.claude/compass/agents/completion-tracker.md`.
20
+
21
+ ### Process
22
+
23
+ 1. Run `compass-tools.sh progress` to get structured progress data.
24
+ 2. Read all unit files from `.compass/UNITS/` for details.
25
+ 3. Present a visual summary:
26
+
27
+ ```
28
+ ## Work Unit Progress
29
+
30
+ ### Done (N/M)
31
+ - [x] unit-001: {title}
32
+ - [x] unit-003: {title}
33
+
34
+ ### In Progress (N/M)
35
+ - [~] unit-002: {title} — {any notes from unit file}
36
+
37
+ ### Pending (N/M)
38
+ - [ ] unit-004: {title} — depends on: unit-002
39
+ - [ ] unit-005: {title} — depends on: unit-003, unit-004
40
+ - [ ] unit-006: {title} — no dependencies (can start anytime)
41
+
42
+ ### Blocked
43
+ - [!] unit-007: {title} — blocked by: {open question or missing dependency}
44
+
45
+ ### Summary
46
+ {N} of {M} units complete ({percentage}%)
47
+ Next available units (no unmet dependencies): unit-006
48
+ ```
49
+
50
+ 4. If the human asks about a specific unit, show its full details including
51
+ acceptance criteria status.
52
+
53
+ ## No artifacts produced
54
+
55
+ This is a read-only status view. Run `compass-tools.sh session update` after.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: compass-build-ready
3
+ description: "Check readiness before implementing a work unit. Verify dependencies, prerequisites, and context."
4
+ argument-hint: "<unit-number>"
5
+ ---
6
+
7
+ # /compass:build-ready
8
+
9
+ Verify that everything is in place before the human starts implementing a work unit.
10
+
11
+ ## Pre-flight
12
+
13
+ 1. If no `$ARGUMENTS` (unit number) provided, list available units from
14
+ `.compass/UNITS/` and ask:
15
+ ```
16
+ header: "Unit"
17
+ question: "Which unit are you about to implement?"
18
+ options: [list pending/in-progress units with titles]
19
+ ```
20
+
21
+ ## Required reading
22
+
23
+ - `~/.claude/compass/constitution.md`
24
+ - `~/.claude/compass/references/inverted-contract.md`
25
+ - `.compass/UNITS/unit-{NNN}-*.md` (the target unit)
26
+ - All dependency units referenced by the target unit
27
+ - `.compass/SPEC.md` — sections referenced by the unit
28
+ - ADRs referenced by the unit
29
+
30
+ ## Execution
31
+
32
+ Spawn the `readiness-checker` agent:
33
+
34
+ ```
35
+ Agent(
36
+ subagent_type: "general-purpose"
37
+ description: "Readiness check for unit {NNN}"
38
+ prompt: |
39
+ You are the COMPASS readiness-checker agent.
40
+
41
+ <required_reading>
42
+ - ~/.claude/compass/agents/readiness-checker.md (read FIRST)
43
+ - ~/.claude/compass/references/inverted-contract.md
44
+ - .compass/UNITS/unit-{NNN}-*.md (target unit)
45
+ - Dependency unit files referenced in the target unit
46
+ - .compass/SPEC.md sections referenced by the unit
47
+ - ADRs referenced by the unit
48
+ </required_reading>
49
+
50
+ Check readiness for unit {NNN}. Verify:
51
+ 1. All dependency units are marked "done"
52
+ 2. Required source files/modules exist (if unit depends on prior work)
53
+ 3. Tests for dependency units pass (run test commands if available)
54
+ 4. No open questions remain unresolved in the unit file
55
+ 5. Referenced ADRs are in "Accepted" status
56
+
57
+ Report: ready/not-ready with specific blockers if any.
58
+ )
59
+ ```
60
+
61
+ ## Post-execution
62
+
63
+ Present the readiness report. If ready, suggest the human begin implementing.
64
+ If not, list specific blockers and how to resolve them.
65
+
66
+ Update the unit status to `in-progress` via `compass-tools.sh unit update-status {NNN} in-progress`
67
+ if the human confirms they're starting.
68
+
69
+ Run `compass-tools.sh session update` to record progress.
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: compass-build-review
3
+ description: "Architectural code review. Check alignment with ADRs, module boundaries, and abstraction fitness."
4
+ argument-hint: "[file-or-directory]"
5
+ ---
6
+
7
+ # /compass:build-review
8
+
9
+ Architectural code review. Checks that implementation aligns with ADRs, respects
10
+ module boundaries defined in ARCHITECTURE.md, and that abstractions fit the design.
11
+
12
+ This is NOT a style review or line-by-line nit-pick. It focuses on structural and
13
+ architectural concerns.
14
+
15
+ ## Pre-flight
16
+
17
+ 1. If `$ARGUMENTS` provided, use as target. Otherwise, ask:
18
+ ```
19
+ header: "Target"
20
+ question: "What should I review?"
21
+ options: ["Recent changes (git diff)", "Specific file", "Specific directory", "Entire project"]
22
+ ```
23
+
24
+ ## Required reading
25
+
26
+ - `~/.claude/compass/constitution.md`
27
+ - `~/.claude/compass/references/inverted-contract.md`
28
+ - `.compass/ARCHITECTURE.md` — the reference for boundaries and structure
29
+ - All ADRs — the reference for decisions
30
+ - `.compass/SPEC.md` — behavioral expectations
31
+
32
+ ## Execution
33
+
34
+ Spawn the `review-coach` agent:
35
+
36
+ ```
37
+ Agent(
38
+ subagent_type: "general-purpose"
39
+ description: "Architectural review: {target}"
40
+ prompt: |
41
+ You are the COMPASS review-coach agent.
42
+
43
+ <required_reading>
44
+ - ~/.claude/compass/agents/review-coach.md (read FIRST)
45
+ - ~/.claude/compass/references/inverted-contract.md
46
+ - .compass/ARCHITECTURE.md
47
+ - All ADRs in configured ADR directory
48
+ - .compass/SPEC.md
49
+ </required_reading>
50
+
51
+ Target: {file, directory, or "git diff" for recent changes}
52
+
53
+ Review the code for architectural alignment. Report concerns
54
+ without suggesting code changes.
55
+ )
56
+ ```
57
+
58
+ ## Post-execution
59
+
60
+ Present findings. No artifacts produced — conversational feedback.
61
+ Run `compass-tools.sh session update`.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: compass-build-scope
3
+ description: "Manual scope guardian invocation. Analyze recent changes for drift against spec, ADRs, and framing."
4
+ argument-hint: "[git-ref]"
5
+ ---
6
+
7
+ # /compass:build-scope
8
+
9
+ Manually invoke the scope guardian to analyze recent changes for drift against
10
+ the project's specification, ADRs, and framing.
11
+
12
+ Use this when you want a full drift analysis — not just the brief advisory
13
+ from the automatic hook.
14
+
15
+ ## Pre-flight
16
+
17
+ 1. Run `compass-tools.sh preflight build-scope` to verify:
18
+ - `.compass/SPEC.md` (or configured path) exists
19
+ - At least one ADR exists
20
+ 2. If `$ARGUMENTS` provided, use as git ref (e.g., `HEAD~3`, a branch name, a commit hash).
21
+ Otherwise, analyze uncommitted changes (`git diff`).
22
+
23
+ ## Required reading
24
+
25
+ - `~/.claude/compass/constitution.md`
26
+ - `~/.claude/compass/references/inverted-contract.md`
27
+ - `.compass/config.yaml`
28
+
29
+ ## Execution
30
+
31
+ 1. Run `compass-tools.sh drift --json` to get structured diff data.
32
+ If a git ref was provided, run `git diff {ref} -- . ':!.compass/'` first and
33
+ pipe to a temp file, then `compass-tools.sh drift <tempfile> --json`.
34
+
35
+ 2. Spawn the `scope-guardian` agent:
36
+
37
+ ```
38
+ Agent(
39
+ subagent_type: "general-purpose"
40
+ description: "Scope guardian: drift analysis"
41
+ prompt: |
42
+ You are the COMPASS scope-guardian agent.
43
+
44
+ <required_reading>
45
+ - ~/.claude/compass/agents/scope-guardian.md (read FIRST)
46
+ - ~/.claude/compass/references/inverted-contract.md
47
+ - .compass/FRAMING.md
48
+ - .compass/SPEC.md (or configured path)
49
+ - All ADRs in configured ADR directory
50
+ </required_reading>
51
+
52
+ Drift analysis data:
53
+ {paste drift JSON output here}
54
+
55
+ For each changed file listed in the drift data, read the file and compare
56
+ its content against:
57
+ 1. SPEC.md — is the behavior specified?
58
+ 2. ADRs — does it contradict any active decision?
59
+ 3. FRAMING.md — does it violate scope or non-goals?
60
+
61
+ Produce the FULL scope guardian report (not the brief hook version).
62
+ )
63
+ ```
64
+
65
+ ## Post-execution
66
+
67
+ Present the full drift report to the user. Run `compass-tools.sh session update`.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: compass-build-tests
3
+ description: "Test audit. Reads tests written by the human and identifies coverage gaps."
4
+ argument-hint: "[file-or-directory]"
5
+ ---
6
+
7
+ # /compass:build-tests
8
+
9
+ Review tests the human has written. Identify coverage gaps by asking about
10
+ untested scenarios. Does not write tests.
11
+
12
+ ## Pre-flight
13
+
14
+ 1. If `$ARGUMENTS` provided, use as target. Otherwise, ask:
15
+ ```
16
+ header: "Target"
17
+ question: "Which tests should I audit?"
18
+ options: ["All tests", "Tests for a specific unit", "Specific test file"]
19
+ ```
20
+ 2. If "Tests for a specific unit" selected, list units and let user pick.
21
+
22
+ ## Required reading
23
+
24
+ - `~/.claude/compass/constitution.md`
25
+ - `~/.claude/compass/references/inverted-contract.md`
26
+ - `.compass/SPEC.md` — acceptance criteria are the benchmark
27
+ - The target unit file (if unit-specific audit)
28
+
29
+ ## Execution
30
+
31
+ Spawn the `test-auditor` agent:
32
+
33
+ ```
34
+ Agent(
35
+ subagent_type: "general-purpose"
36
+ description: "Test audit: {target}"
37
+ prompt: |
38
+ You are the COMPASS test-auditor agent.
39
+
40
+ <required_reading>
41
+ - ~/.claude/compass/agents/test-auditor.md (read FIRST)
42
+ - ~/.claude/compass/references/inverted-contract.md
43
+ - .compass/SPEC.md (acceptance criteria are your benchmark)
44
+ - .compass/UNITS/unit-{NNN}-*.md (if unit-specific)
45
+ </required_reading>
46
+
47
+ Target: {test file, directory, or unit reference}
48
+
49
+ Read the tests and compare against the spec's acceptance criteria.
50
+ Report coverage gaps as questions, not as test implementations.
51
+ )
52
+ ```
53
+
54
+ ## Post-execution
55
+
56
+ Present the audit findings. No artifacts produced — conversational feedback.
57
+ Run `compass-tools.sh session update`.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: compass-build-transform
3
+ description: "Mechanical text transformations. Executes repetitive, non-creative edits described as unambiguous rules."
4
+ argument-hint: "<description-of-transformation>"
5
+ ---
6
+
7
+ # /compass:build-transform
8
+
9
+ Execute mechanical text transformations — repetitive, non-creative edits that
10
+ the human describes as an unambiguous rule.
11
+
12
+ This is the ONLY COMPASS command that modifies project source files.
13
+
14
+ ## Required reading
15
+
16
+ - `~/.claude/compass/constitution.md` (Article 1.3 — mechanical editing exception)
17
+ - `~/.claude/compass/references/inverted-contract.md`
18
+
19
+ ## Gate: Is this mechanical?
20
+
21
+ Before executing ANY transformation, evaluate against the constitution's
22
+ mechanical editing criteria:
23
+
24
+ 1. **Repetitive?** The same operation applied across multiple locations.
25
+ 2. **Non-creative?** No design, architectural, or logical judgment involved.
26
+ 3. **Mechanically describable?** The human can express it as an unambiguous rule.
27
+
28
+ If ALL three are true → proceed.
29
+ If ANY is false → refuse and explain why:
30
+ "This transformation requires judgment about {design/architecture/logic},
31
+ which makes it production code under the COMPASS constitution. You'll need
32
+ to implement this yourself."
33
+
34
+ ### Examples of ALLOWED transformations
35
+
36
+ - "Replace all single quotes with double quotes in src/config.rs"
37
+ - "Add trailing commas to every line in this enum block"
38
+ - "Convert this pasted list into enum variants following the existing pattern"
39
+ - "Rename `old_name` to `new_name` in all files under src/"
40
+ - "Reorder imports alphabetically in this file"
41
+ - "Convert tabs to spaces in these files"
42
+ - "Add `#[derive(Debug)]` to every struct in this module"
43
+
44
+ ### Examples of REFUSED transformations
45
+
46
+ - "Implement error handling for this function" (requires logic judgment)
47
+ - "Refactor this into smaller functions" (requires design judgment)
48
+ - "Add validation to these inputs" (requires deciding what to validate)
49
+ - "Convert this to use async" (requires architectural judgment)
50
+ - "Fix the bug in this function" (requires understanding and solving)
51
+
52
+ ## Execution
53
+
54
+ 1. Confirm the transformation with the user: "I understand you want to {X}
55
+ across {Y}. Is that correct?"
56
+ 2. Show a preview of what will change (first 3-5 instances).
57
+ 3. Ask for confirmation before applying.
58
+ 4. Apply the transformation using Edit/Write tools.
59
+ 5. Show summary: N files modified, M changes made.
60
+
61
+ ## Post-execution
62
+
63
+ Run `compass-tools.sh session update` to note the transformation in SESSION.md.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: compass-build-units
3
+ description: "Decompose the specification into implementable work units with acceptance criteria and dependencies."
4
+ ---
5
+
6
+ # /compass:build-units
7
+
8
+ Decompose SPEC.md into implementable work units. Each unit is a discrete piece of
9
+ work with clear acceptance criteria, dependencies, and scope.
10
+
11
+ ## Pre-flight
12
+
13
+ 1. Run `compass-tools.sh preflight build-units` to verify:
14
+ - `.compass/SPEC.md` (or configured spec path) exists
15
+ - `.compass/ARCHITECTURE.md` exists
16
+ - If prerequisites missing, inform the user which phases to complete first.
17
+ 2. Check if `.compass/UNITS/` already has unit files.
18
+ - If yes: inform the user. Ask if they want to regenerate, add more, or revise.
19
+
20
+ ## Required reading
21
+
22
+ Load before proceeding:
23
+
24
+ - `~/.claude/compass/constitution.md`
25
+ - `~/.claude/compass/references/inverted-contract.md`
26
+ - `.compass/config.yaml`
27
+ - `.compass/FRAMING.md`
28
+ - `.compass/ARCHITECTURE.md`
29
+ - `.compass/SPEC.md` (full spec — this is the input)
30
+ - All ADRs in the configured ADR directory
31
+
32
+ ## Execution
33
+
34
+ Spawn the `unit-decomposer` agent:
35
+
36
+ ```
37
+ Agent(
38
+ subagent_type: "general-purpose"
39
+ description: "Decompose spec into work units"
40
+ prompt: |
41
+ You are the COMPASS unit-decomposer agent.
42
+
43
+ <required_reading>
44
+ - ~/.claude/compass/agents/unit-decomposer.md (read FIRST)
45
+ - ~/.claude/compass/references/inverted-contract.md
46
+ - .compass/FRAMING.md
47
+ - .compass/ARCHITECTURE.md
48
+ - .compass/SPEC.md (or configured path)
49
+ - All ADRs in configured ADR directory
50
+ </required_reading>
51
+
52
+ Decompose the specification into implementable work units.
53
+ Write each unit to .compass/UNITS/unit-{NNN}-{slug}.md using the template
54
+ at ~/.claude/compass/templates/UNIT.md.
55
+
56
+ After writing all units, produce a summary: total units, dependency graph
57
+ (which units must be completed before others), and suggested implementation
58
+ order.
59
+ )
60
+ ```
61
+
62
+ ## Post-execution
63
+
64
+ 1. Read the produced units and present a summary to the user:
65
+ - Total number of units
66
+ - Dependency graph (textual)
67
+ - Suggested implementation order
68
+ 2. Ask the user to review. They may:
69
+ - Merge units that are too granular
70
+ - Split units that are too large
71
+ - Adjust dependencies
72
+ - Add units that were missed
73
+ 3. Run `compass-tools.sh session update` to record progress.
74
+ 4. Suggest: "Work units defined. Use `/compass:build-ready` to check readiness
75
+ before starting a unit, or `/compass:build-progress` to see the full board."
76
+ 5. Suggest `/clear` before starting implementation.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: compass-decide
3
+ description: "Formalize architectural decisions as ADRs in MADR format. Human decides; COMPASS structures."
4
+ argument-hint: "[decision-title]"
5
+ ---
6
+
7
+ # /compass:decide
8
+
9
+ Formalize an architectural decision as an ADR (Architectural Decision Record) in
10
+ MADR format.
11
+
12
+ This command can be invoked multiple times — once per decision. Each invocation
13
+ produces one ADR file.
14
+
15
+ ## Pre-flight
16
+
17
+ 1. Run `compass-tools.sh preflight decide` to verify:
18
+ - `.compass/FRAMING.md` exists
19
+ - `.compass/ARCHITECTURE.md` exists (warn if missing but don't block — some
20
+ decisions may precede full architecture)
21
+ 2. Read `compass-tools.sh config get paths.adr` to resolve ADR output directory.
22
+ 3. List existing ADRs in the output directory to show context.
23
+
24
+ ## Required reading
25
+
26
+ Load before proceeding:
27
+
28
+ - `~/.claude/compass/constitution.md`
29
+ - `~/.claude/compass/references/inverted-contract.md`
30
+ - `.compass/config.yaml`
31
+ - `.compass/FRAMING.md`
32
+ - `.compass/ARCHITECTURE.md` (if exists)
33
+ - Existing ADRs in the configured ADR directory (scan titles to avoid duplication)
34
+
35
+ ## Execution
36
+
37
+ You ARE the adr-scribe for this phase. Read and embody the agent definition at
38
+ `~/.claude/compass/agents/adr-scribe.md`.
39
+
40
+ ### Interaction flow
41
+
42
+ 1. **Identify the decision**: If `$ARGUMENTS` contains a decision title, start with
43
+ that. Otherwise, ask:
44
+
45
+ If ARCHITECTURE.md exists and mentions unformalized decisions:
46
+ ```
47
+ header: "Decision"
48
+ question: "Which decision should we formalize?"
49
+ options: [list decisions noted in ARCHITECTURE.md that don't have ADRs yet]
50
+ ```
51
+
52
+ Otherwise, ask via free text: "What decision do you want to formalize?"
53
+
54
+ 2. **Understand the context**: Ask about the context that led to this decision:
55
+ - "What problem or need does this decision address?"
56
+ - "What constraints shape this decision?" (connect to FRAMING.md if relevant)
57
+
58
+ 3. **Explore alternatives**: Use AskUserQuestion to surface what was considered:
59
+ ```
60
+ header: "Alternatives"
61
+ question: "What alternatives did you consider?"
62
+ options: [if research dossiers mention alternatives for this topic, list them]
63
+ ```
64
+ For each alternative the human mentions, ask:
65
+ - "Why was this rejected?"
66
+ - "What would have to change for this to become viable?"
67
+
68
+ 4. **Clarify the decision**: Confirm the actual decision clearly:
69
+ - "So the decision is: [restate]. Is that accurate?"
70
+ - "Is this decision reversible? What would trigger reconsideration?"
71
+
72
+ 5. **Identify consequences**: Ask about impact:
73
+ - "What does this decision enable?"
74
+ - "What does it prevent or make harder?"
75
+ - "Which components or modules are affected?"
76
+
77
+ 6. **Link to artifacts**: Connect to existing COMPASS artifacts:
78
+ - Which FRAMING.md constraints does this address?
79
+ - Which research dossiers informed this?
80
+ - Which parts of ARCHITECTURE.md does this affect?
81
+
82
+ ## Producing the ADR
83
+
84
+ 1. Get the next ADR number: run `compass-tools.sh adr next-number`.
85
+ 2. Write the ADR using the template at `~/.claude/compass/templates/ADR.md`.
86
+ 3. Place it in the configured ADR directory (from `config.yaml`).
87
+ 4. Present the ADR to the user for review before finalizing.
88
+
89
+ The ADR filename format: `ADR-{NNN}-{kebab-case-title}.md`
90
+
91
+ ## Closing
92
+
93
+ 1. Run `compass-tools.sh session update` to record progress.
94
+ 2. Show the ADR summary.
95
+ 3. Ask:
96
+ ```
97
+ header: "Next"
98
+ question: "What next?"
99
+ options: [
100
+ "Formalize another decision",
101
+ "Review existing ADRs",
102
+ "Move to specification — /compass:spec (suggest /clear first)",
103
+ "Check status — /compass:status"
104
+ ]
105
+ ```