qualia-framework 3.2.0 → 3.3.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 (58) hide show
  1. package/CLAUDE.md +3 -4
  2. package/README.md +59 -23
  3. package/agents/plan-checker.md +158 -0
  4. package/agents/planner.md +52 -0
  5. package/agents/research-synthesizer.md +86 -0
  6. package/agents/researcher.md +119 -0
  7. package/agents/roadmapper.md +157 -0
  8. package/agents/verifier.md +180 -32
  9. package/bin/cli.js +403 -9
  10. package/bin/install.js +219 -70
  11. package/bin/qualia-ui.js +11 -11
  12. package/bin/state.js +200 -6
  13. package/bin/statusline.js +4 -4
  14. package/docs/erp-contract.md +161 -0
  15. package/hooks/branch-guard.js +23 -2
  16. package/hooks/migration-guard.js +23 -0
  17. package/hooks/pre-compact.js +20 -0
  18. package/hooks/pre-deploy-gate.js +39 -0
  19. package/hooks/pre-push.js +20 -0
  20. package/hooks/session-start.js +16 -43
  21. package/package.json +6 -4
  22. package/references/questioning.md +123 -0
  23. package/rules/infrastructure.md +87 -0
  24. package/skills/qualia/SKILL.md +1 -0
  25. package/skills/qualia-build/SKILL.md +18 -0
  26. package/skills/qualia-design/SKILL.md +14 -8
  27. package/skills/qualia-discuss/SKILL.md +115 -0
  28. package/skills/qualia-help/SKILL.md +60 -0
  29. package/skills/qualia-learn/SKILL.md +27 -4
  30. package/skills/qualia-map/SKILL.md +145 -0
  31. package/skills/qualia-milestone/SKILL.md +148 -0
  32. package/skills/qualia-new/SKILL.md +374 -229
  33. package/skills/qualia-plan/SKILL.md +135 -30
  34. package/skills/qualia-polish/SKILL.md +167 -117
  35. package/skills/qualia-report/SKILL.md +17 -8
  36. package/skills/qualia-research/SKILL.md +124 -0
  37. package/skills/qualia-review/SKILL.md +126 -41
  38. package/skills/qualia-test/SKILL.md +134 -0
  39. package/skills/qualia-verify/SKILL.md +1 -1
  40. package/templates/DESIGN.md +440 -102
  41. package/templates/help.html +476 -0
  42. package/templates/phase-context.md +48 -0
  43. package/templates/plan.md +14 -0
  44. package/templates/projects/ai-agent.md +55 -0
  45. package/templates/projects/mobile-app.md +56 -0
  46. package/templates/projects/voice-agent.md +55 -0
  47. package/templates/projects/website.md +58 -0
  48. package/templates/requirements.md +69 -0
  49. package/templates/research-project/ARCHITECTURE.md +70 -0
  50. package/templates/research-project/FEATURES.md +60 -0
  51. package/templates/research-project/PITFALLS.md +73 -0
  52. package/templates/research-project/STACK.md +51 -0
  53. package/templates/research-project/SUMMARY.md +86 -0
  54. package/templates/roadmap.md +71 -0
  55. package/tests/bin.test.sh +20 -6
  56. package/tests/hooks.test.sh +76 -7
  57. package/tests/runner.js +1915 -0
  58. package/tests/state.test.sh +189 -11
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: qualia-map
3
+ description: "Map an existing codebase to infer architecture, stack, conventions, and what's already built. For brownfield projects — run BEFORE /qualia-new so Validated requirements get inferred from existing code."
4
+ ---
5
+
6
+ # /qualia-map — Codebase Mapping (Brownfield)
7
+
8
+ Scans an existing repo and produces `.planning/codebase/` — architecture, stack, conventions, concerns. Used by `/qualia-new` to infer what's already built and seed Validated requirements.
9
+
10
+ ## When to Use
11
+
12
+ - Taking over an existing client project
13
+ - Adding features to a repo you didn't build
14
+ - Before `/qualia-new` on any directory that already has code
15
+
16
+ ## Usage
17
+
18
+ `/qualia-map` — scan the current working directory
19
+
20
+ ## Process
21
+
22
+ ### 1. Check for Existing Code
23
+
24
+ ```bash
25
+ ls -la 2>/dev/null
26
+ test -f package.json && echo "HAS_PACKAGE"
27
+ test -d .git && echo "HAS_GIT"
28
+ test -d .planning/codebase && echo "ALREADY_MAPPED"
29
+ ```
30
+
31
+ If `ALREADY_MAPPED`, ask:
32
+ - header: "Re-map?"
33
+ - question: "Codebase already mapped. Re-scan?"
34
+ - options:
35
+ - "Re-scan" — overwrite existing map
36
+ - "Skip" — use existing map
37
+
38
+ ### 2. Banner
39
+
40
+ ```bash
41
+ node ~/.claude/bin/qualia-ui.js banner map
42
+ ```
43
+
44
+ ### 3. Spawn Parallel Mapper Agents
45
+
46
+ Map 4 dimensions in parallel for speed. Each writes one file in `.planning/codebase/`:
47
+
48
+ ```
49
+ Agent 1: Architecture scanner
50
+ Task(prompt="
51
+ Scan the current codebase and produce .planning/codebase/architecture.md.
52
+ Identify: entry points, folder structure, module boundaries, data flow.
53
+ Focus on WHAT the codebase does, not HOW to fix it.
54
+ ", subagent_type="general-purpose", description="Architecture scan")
55
+
56
+ Agent 2: Stack detector
57
+ Task(prompt="
58
+ Detect the tech stack. Read package.json, requirements.txt, Gemfile, etc.
59
+ Produce .planning/codebase/stack.md listing: runtime, framework, key libraries,
60
+ database, hosting, CI. Include version numbers.
61
+ ", subagent_type="general-purpose", description="Stack detection")
62
+
63
+ Agent 3: Conventions analyzer
64
+ Task(prompt="
65
+ Analyze code style and conventions. Sample 10-15 files across the codebase.
66
+ Produce .planning/codebase/conventions.md listing: naming, component patterns,
67
+ file organization, import style, test style, commit message format.
68
+ ", subagent_type="general-purpose", description="Conventions analysis")
69
+
70
+ Agent 4: Concerns scanner
71
+ Task(prompt="
72
+ Scan for code quality concerns — NOT to fix, just to document.
73
+ Look for: TODO/FIXME, deprecated APIs, outdated dependencies, missing tests,
74
+ security smells (hardcoded secrets, no input validation).
75
+ Produce .planning/codebase/concerns.md.
76
+ ", subagent_type="general-purpose", description="Concerns scan")
77
+ ```
78
+
79
+ ### 4. Wait for All 4
80
+
81
+ After all 4 agents complete, read the 4 output files.
82
+
83
+ ### 5. Synthesize
84
+
85
+ Create `.planning/codebase/README.md` — one-page summary linking to the 4 dimension files.
86
+
87
+ ```markdown
88
+ # Codebase Map
89
+
90
+ **Scanned:** {date}
91
+ **Repo:** {name}
92
+ **LOC:** {lines of code from wc -l}
93
+
94
+ ## At a Glance
95
+
96
+ - **Stack:** {from stack.md — one line}
97
+ - **Architecture:** {from architecture.md — one sentence}
98
+ - **Conventions:** {from conventions.md — one sentence}
99
+ - **Concerns:** {count of concerns found}
100
+
101
+ ## Validated Capabilities (Inferred)
102
+
103
+ Based on existing code, this project already does:
104
+ - {capability 1} (evidence: {file path})
105
+ - {capability 2} (evidence: {file path})
106
+ - {capability 3} (evidence: {file path})
107
+
108
+ These become **Validated requirements** in PROJECT.md when `/qualia-new` runs.
109
+
110
+ ## Dimension Details
111
+
112
+ - [Architecture](./architecture.md)
113
+ - [Stack](./stack.md)
114
+ - [Conventions](./conventions.md)
115
+ - [Concerns](./concerns.md)
116
+ ```
117
+
118
+ ### 6. Commit
119
+
120
+ ```bash
121
+ git add .planning/codebase/
122
+ git commit -m "docs: map existing codebase"
123
+ ```
124
+
125
+ ### 7. Route
126
+
127
+ ```bash
128
+ node ~/.claude/bin/qualia-ui.js end "CODEBASE MAPPED" "/qualia-new"
129
+ ```
130
+
131
+ ## What `/qualia-new` Does With This
132
+
133
+ When `/qualia-new` runs AFTER `/qualia-map`, it:
134
+ 1. Reads `.planning/codebase/README.md`
135
+ 2. Extracts Validated capabilities
136
+ 3. Pre-populates PROJECT.md with Validated requirements section
137
+ 4. Skips questions about things already built
138
+ 5. Focuses questioning on NEW capabilities being added
139
+
140
+ ## Rules
141
+
142
+ 1. **Non-destructive.** This skill only READS code, never modifies it.
143
+ 2. **Four parallel agents.** Don't sequential-scan — parallel is ~4x faster.
144
+ 3. **Dimension files are structured.** The orchestrator downstream (`/qualia-new`) reads them programmatically.
145
+ 4. **Concerns ≠ fixes.** This skill documents concerns. It does NOT fix them. Use `/qualia-optimize` for that.
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: qualia-milestone
3
+ description: "Close out a completed milestone and prep the next one. Archives the current milestone's artifacts, updates REQUIREMENTS.md to mark v1 requirements Complete, and creates the next milestone roadmap."
4
+ ---
5
+
6
+ # /qualia-milestone — Milestone Closeout
7
+
8
+ Use when all feature phases in the current milestone are verified. Archives artifacts, marks requirements Complete, opens a new milestone for the next release.
9
+
10
+ ## When to Use
11
+
12
+ - After `/qualia-verify N` passes on the LAST phase of a milestone
13
+ - Before starting a v1.5 / v2.0 cycle
14
+ - NOT for individual phase completions — use `/qualia-verify N` for that
15
+
16
+ ## Usage
17
+
18
+ `/qualia-milestone` — close the current milestone, open the next
19
+
20
+ ## Process
21
+
22
+ ### 1. Validate Readiness
23
+
24
+ ```bash
25
+ node ~/.claude/bin/state.js check 2>/dev/null
26
+ ```
27
+
28
+ Check:
29
+ - All phases in STATE.md are `status: verified`
30
+ - `verification: pass` for every phase
31
+ - No open blockers
32
+
33
+ If not ready:
34
+ ```bash
35
+ node ~/.claude/bin/qualia-ui.js fail "Milestone not ready — {reason}"
36
+ ```
37
+ Exit.
38
+
39
+ ### 2. Banner
40
+
41
+ ```bash
42
+ node ~/.claude/bin/qualia-ui.js banner milestone
43
+ ```
44
+
45
+ ### 3. Confirm Closeout
46
+
47
+ Show:
48
+ - Milestone name (e.g., "v1 — Launch")
49
+ - Phases completed
50
+ - Requirements delivered
51
+
52
+ - header: "Close milestone?"
53
+ - question: "Close {milestone name} and move to the next milestone?"
54
+ - options:
55
+ - "Close it" — Archive and open next
56
+ - "Not yet" — I want to add more first
57
+
58
+ ### 4. Archive Current Milestone
59
+
60
+ ```bash
61
+ mkdir -p .planning/archive
62
+ cp .planning/ROADMAP.md .planning/archive/{milestone_slug}-ROADMAP.md
63
+ cp .planning/STATE.md .planning/archive/{milestone_slug}-STATE.md
64
+ cp -r .planning/phases .planning/archive/{milestone_slug}-phases
65
+ ```
66
+
67
+ ### 5. Update REQUIREMENTS.md
68
+
69
+ Open `.planning/REQUIREMENTS.md` and:
70
+ - Mark every v1 requirement as Complete in the traceability table
71
+ - Move the `## v1 Requirements` section content to `## Completed (v1)` at the top (for historical reference)
72
+ - Elevate `## v2 Requirements` → `## v1 Requirements` (next milestone's scope)
73
+
74
+ ### 6. Ask About Next Milestone
75
+
76
+ - header: "Next milestone"
77
+ - question: "What's the next milestone called?"
78
+ - options (dynamic):
79
+ - "v1.5 — {suggested name based on v2 requirements}"
80
+ - "v2.0 — {bigger rewrite}"
81
+ - "Custom name" — let me type it
82
+
83
+ ### 7. Create New Roadmap
84
+
85
+ Spawn the roadmapper to create a new ROADMAP.md for the next milestone:
86
+
87
+ ```
88
+ Agent(prompt="
89
+ Read your role: @~/.claude/agents/qualia-roadmapper.md
90
+
91
+ <task>
92
+ Create a new ROADMAP.md for the next milestone.
93
+
94
+ Milestone name: {milestone name}
95
+ Milestone number: {M+1}
96
+
97
+ The new v1 requirements (just promoted from old v2) are in .planning/REQUIREMENTS.md.
98
+ The previous milestone's archive is at .planning/archive/.
99
+
100
+ Build phases for the new milestone scope. Do NOT plan for already-completed requirements.
101
+ ", subagent_type="qualia-roadmapper", description="Create next milestone roadmap")
102
+ ```
103
+
104
+ ### 8. Reset STATE.md via state.js
105
+
106
+ ```bash
107
+ node ~/.claude/bin/state.js init \
108
+ --project "{project name}" \
109
+ --client "{client}" \
110
+ --type "{type}" \
111
+ --phases '{JSON from new roadmap}' \
112
+ --total_phases {new N}
113
+ ```
114
+
115
+ ### 9. Commit
116
+
117
+ ```bash
118
+ git add .planning/
119
+ git commit -m "feat({milestone_slug}): close milestone, open {next milestone}"
120
+ ```
121
+
122
+ ### 10. Route
123
+
124
+ ```bash
125
+ node ~/.claude/bin/qualia-ui.js end "MILESTONE {closed} CLOSED" "/qualia-plan 1"
126
+ ```
127
+
128
+ ## What Stays, What Changes
129
+
130
+ **Stays:**
131
+ - `.planning/PROJECT.md` — the project doesn't change
132
+ - `.planning/archive/` — historical milestones preserved
133
+ - Git history — every commit preserved
134
+
135
+ **Changes:**
136
+ - `.planning/REQUIREMENTS.md` — Completed section grows, v1 scope shifts
137
+ - `.planning/ROADMAP.md` — new phases for the new milestone
138
+ - `.planning/STATE.md` — reset to Phase 1 of new milestone
139
+
140
+ **Discarded (but archived):**
141
+ - `.planning/phases/` — the old phase folders move to archive
142
+
143
+ ## Rules
144
+
145
+ 1. **Don't close early.** All phases must be `verified` with `pass`. No partial milestones.
146
+ 2. **Archive, don't delete.** Old phase work stays accessible via `.planning/archive/`.
147
+ 3. **New milestone = new phase numbering.** The next phase is Phase 1 of the new milestone, not Phase {N+1} of the old.
148
+ 4. **ERP sync aware.** The ERP reads ROADMAP.md — after milestone close, push to GitHub so the ERP picks up the new phase structure.