qualia-framework 3.6.0 → 4.0.3

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 (56) hide show
  1. package/CLAUDE.md +23 -11
  2. package/README.md +96 -51
  3. package/agents/builder.md +25 -14
  4. package/agents/plan-checker.md +29 -16
  5. package/agents/planner.md +33 -24
  6. package/agents/research-synthesizer.md +25 -12
  7. package/agents/roadmapper.md +89 -84
  8. package/agents/verifier.md +11 -2
  9. package/bin/cli.js +18 -13
  10. package/bin/install.js +34 -45
  11. package/bin/qualia-ui.js +267 -1
  12. package/bin/state.js +164 -12
  13. package/bin/statusline.js +4 -1
  14. package/docs/erp-contract.md +12 -0
  15. package/guide.md +85 -22
  16. package/hooks/migration-guard.js +23 -9
  17. package/hooks/pre-compact.js +39 -11
  18. package/hooks/pre-deploy-gate.js +3 -4
  19. package/hooks/pre-push.js +6 -3
  20. package/hooks/session-start.js +8 -8
  21. package/package.json +1 -1
  22. package/rules/frontend.md +5 -13
  23. package/skills/qualia/SKILL.md +8 -1
  24. package/skills/qualia-build/SKILL.md +49 -4
  25. package/skills/qualia-debug/SKILL.md +6 -0
  26. package/skills/qualia-design/SKILL.md +9 -1
  27. package/skills/qualia-discuss/SKILL.md +6 -0
  28. package/skills/qualia-handoff/SKILL.md +92 -12
  29. package/skills/qualia-help/SKILL.md +18 -4
  30. package/skills/qualia-idk/SKILL.md +166 -0
  31. package/skills/qualia-learn/SKILL.md +6 -0
  32. package/skills/qualia-map/SKILL.md +7 -0
  33. package/skills/qualia-milestone/SKILL.md +128 -79
  34. package/skills/qualia-new/SKILL.md +163 -230
  35. package/skills/qualia-optimize/SKILL.md +8 -0
  36. package/skills/qualia-pause/SKILL.md +5 -0
  37. package/skills/qualia-plan/SKILL.md +25 -10
  38. package/skills/qualia-polish/SKILL.md +8 -0
  39. package/skills/qualia-quick/SKILL.md +7 -0
  40. package/skills/qualia-report/SKILL.md +17 -0
  41. package/skills/qualia-research/SKILL.md +7 -0
  42. package/skills/qualia-resume/SKILL.md +3 -0
  43. package/skills/qualia-review/SKILL.md +7 -0
  44. package/skills/qualia-ship/SKILL.md +5 -0
  45. package/skills/qualia-skill-new/SKILL.md +6 -0
  46. package/skills/qualia-task/SKILL.md +8 -1
  47. package/skills/qualia-test/SKILL.md +7 -0
  48. package/skills/qualia-verify/SKILL.md +65 -3
  49. package/templates/help.html +4 -4
  50. package/templates/journey.md +113 -0
  51. package/templates/plan.md +56 -11
  52. package/templates/requirements.md +82 -22
  53. package/templates/roadmap.md +41 -14
  54. package/templates/tracking.json +2 -0
  55. package/tests/hooks.test.sh +5 -5
  56. package/tests/runner.js +381 -7
@@ -3,29 +3,85 @@
3
3
  **Defined:** {date}
4
4
  **Core Value:** {from PROJECT.md — the one thing that must work}
5
5
 
6
- ## v1 Requirements
6
+ Requirements are grouped by the milestone that delivers them. Each requirement
7
+ has a stable REQ-ID and is atomic, testable, and user-centric.
7
8
 
8
- Initial release scope. Each maps to one roadmap phase.
9
+ ---
10
+
11
+ ## Milestone 1 · {Name}
9
12
 
10
- ### {Category 1}
13
+ Short description of what this milestone delivers for the user.
14
+
15
+ ### {Category}
11
16
 
12
17
  - [ ] **{CAT}-01**: {user-centric, testable, atomic capability}
13
18
  - [ ] **{CAT}-02**: {capability}
14
- - [ ] **{CAT}-03**: {capability}
15
19
 
16
- ### {Category 2}
20
+ ### {Category}
17
21
 
18
22
  - [ ] **{CAT}-01**: {capability}
19
- - [ ] **{CAT}-02**: {capability}
20
23
 
21
- ## v2 Requirements
24
+ ---
25
+
26
+ ## Milestone 2 · {Name}
27
+
28
+ ### {Category}
29
+
30
+ - [ ] **{CAT}-03**: {capability}
31
+ - [ ] **{CAT}-04**: {capability}
32
+
33
+ ---
22
34
 
23
- Acknowledged but deferred to a future release. Not in current roadmap.
35
+ ## Milestone 3 · {Name}
24
36
 
25
37
  ### {Category}
26
38
 
27
- - **{CAT}-01**: {capability}
28
- - **{CAT}-02**: {capability}
39
+ - [ ] **{CAT}-05**: {capability}
40
+
41
+ ---
42
+
43
+ ## Handoff
44
+
45
+ Fixed scope for every project. Do not reassign these elsewhere.
46
+
47
+ ### Polish
48
+
49
+ - [ ] **HAND-01**: Every user-facing page has all interactive states (hover, focus, loading, error, empty)
50
+ - [ ] **HAND-02**: Responsive verified at 375 / 768 / 1440 / 1920px
51
+ - [ ] **HAND-03**: WCAG AA contrast + keyboard navigation verified
52
+
53
+ ### Content + SEO
54
+
55
+ - [ ] **HAND-04**: Real copy replaces all placeholder text
56
+ - [ ] **HAND-05**: Meta tags, OG images, sitemap.xml, robots.txt present
57
+ - [ ] **HAND-06**: Analytics wired (Plausible / PostHog / GA)
58
+
59
+ ### Final QA
60
+
61
+ - [ ] **HAND-07**: Full-flow test of every primary user journey
62
+ - [ ] **HAND-08**: Cross-browser verified (Chrome + Safari + Firefox)
63
+ - [ ] **HAND-09**: `/qualia-review` scored diagnostics reviewed, blockers resolved
64
+
65
+ ### Handoff
66
+
67
+ - [ ] **HAND-10**: Production URL verified (HTTP 200, auth flow works, latency < 500ms)
68
+ - [ ] **HAND-11**: README updated with architecture, setup, API documentation
69
+ - [ ] **HAND-12**: Credentials document delivered to client (deploy tokens, admin accounts, third-party keys)
70
+ - [ ] **HAND-13**: Recorded walkthrough (Loom or equivalent) delivered
71
+ - [ ] **HAND-14**: `.planning/archive/` contains every milestone's verification reports
72
+ - [ ] **HAND-15**: Final `/qualia-report` submitted, `lifetime.milestones_completed` incremented
73
+
74
+ ---
75
+
76
+ ## Post-Handoff (v2)
77
+
78
+ Features acknowledged but deferred past initial handoff. Not in current journey.
79
+
80
+ ### {Category}
81
+
82
+ - **{CAT}-XX**: {capability}
83
+
84
+ ---
29
85
 
30
86
  ## Out of Scope
31
87
 
@@ -35,35 +91,39 @@ Explicit exclusions with reasoning. Prevents scope creep.
35
91
  |---------|--------|
36
92
  | {feature} | {why excluded} |
37
93
 
94
+ ---
95
+
38
96
  ## Traceability
39
97
 
40
- Which phases cover which requirements. Populated during roadmap creation.
98
+ Populated during roadmap creation. Every v1 requirement maps to exactly one milestone + phase.
41
99
 
42
- | Requirement | Phase | Status |
43
- |-------------|-------|--------|
44
- | {CAT}-01 | Phase {N} | Pending |
100
+ | Requirement | Milestone | Phase | Status |
101
+ |-------------|-----------|-------|--------|
102
+ | {CAT}-01 | M1: {name} | Phase {N} | Pending |
45
103
 
46
104
  **Coverage:**
47
- - v1 requirements: {X} total
48
- - Mapped to phases: {Y}
105
+ - v1 requirements (all feature milestones + Handoff): {X} total
106
+ - Mapped to milestones + phases: {Y}
49
107
  - Unmapped: {Z}
50
108
 
51
109
  ---
52
110
 
53
111
  ## Requirement Quality Rules
54
112
 
55
- 1. **ID format:** `{CATEGORY}-{NUMBER}` — `AUTH-01`, `CONT-02`, `SOCIAL-03`
113
+ 1. **ID format:** `{CATEGORY}-{NUMBER}` — stable across the project's life
56
114
  2. **User-centric:** "User can X" — not "System does Y"
57
- 3. **Atomic:** One capability per requirement — not "User can login and manage profile"
58
- 4. **Testable:** "User can reset password via email link" — not "handle password reset"
59
- 5. **Independent:** Minimal dependencies on other requirements
115
+ 3. **Atomic:** one capability per requirement
116
+ 4. **Testable:** the observable behavior is nameable
117
+ 5. **Independent:** minimal dependencies on other requirements
118
+ 6. **Assigned to exactly one milestone:** no duplicates, no gaps
60
119
 
61
120
  ## Status Values
62
121
 
63
122
  - **Pending** — not started
64
- - **In Progress** — phase is active
65
- - **Complete** — requirement verified
123
+ - **In Progress** — milestone is active, phase in progress
124
+ - **Complete** — verified as passing
66
125
  - **Blocked** — waiting on external factor
67
126
 
68
127
  ---
128
+
69
129
  *Last updated: {date}*
@@ -1,8 +1,22 @@
1
- # Roadmap: {Project Name}
1
+ # Roadmap · Milestone {N} · {Milestone Name}
2
2
 
3
+ **Project:** {Project Name}
4
+ **Milestone:** {N} of {Total} ({"CURRENT" / shipped})
3
5
  **Created:** {date}
4
- **Total phases:** {N}
5
- **v1 requirements:** {X} covered
6
+ **Phases:** {P}
7
+ **Requirements covered:** {REQ-IDs from this milestone's REQUIREMENTS.md section}
8
+
9
+ See `JOURNEY.md` for the full project arc. This file is ONLY the current milestone's phases.
10
+
11
+ ## Exit Criteria
12
+
13
+ What "shipped" means for this milestone:
14
+
15
+ - {observable outcome 1}
16
+ - {observable outcome 2}
17
+ - {observable outcome 3}
18
+
19
+ ---
6
20
 
7
21
  ## Phases
8
22
 
@@ -25,9 +39,8 @@
25
39
  **Success criteria** (observable user behaviors):
26
40
  1. {user can do X}
27
41
  2. {user can do Y}
28
- 3. {user can do Z}
29
42
 
30
- **Depends on:** none (or: Phase {N})
43
+ **Depends on:** none
31
44
 
32
45
  ---
33
46
 
@@ -46,26 +59,40 @@
46
59
 
47
60
  ---
48
61
 
49
- {... continue for all phases ...}
62
+ ### Phase 3: {Name}
63
+
64
+ **Goal:** {goal}
65
+
66
+ **Requirements covered:**
67
+ - {REQ-ID}: {description}
68
+
69
+ **Success criteria:**
70
+ 1. {criterion}
71
+
72
+ **Depends on:** Phase 2
73
+
74
+ ---
50
75
 
51
76
  ## Coverage Verification
52
77
 
53
- All v1 requirements must map to exactly one phase. Unmapped requirements = roadmap gap.
78
+ Every requirement in this milestone must map to exactly one phase.
54
79
 
55
80
  | Requirement | Phase | Covered? |
56
81
  |-------------|-------|----------|
57
82
  | {REQ-ID} | Phase {N} | ✓ |
58
83
 
59
- **Coverage:** {X}/{Y} v1 requirements mapped ({100% expected})
60
-
61
84
  ---
62
85
 
63
- ## Rules
86
+ ## When This Milestone Closes
64
87
 
65
- 1. **Feature phases only.** No "review" / "deploy" / "handoff" phases — those are driven by `/qualia-polish` `/qualia-ship` `/qualia-handoff` after all feature phases verify.
66
- 2. **Each requirement maps to exactly one phase.** If a requirement spans phases, it's too big — split it.
67
- 3. **Phases are independently verifiable.** A phase completes when its success criteria are observable in a running app.
68
- 4. **Order by dependency, not priority.** Phase 2 should depend on Phase 1's outputs.
88
+ Triggered by `/qualia-milestone` after `/qualia-verify` passes on the last phase:
89
+
90
+ 1. All phase artifacts are archived to `.planning/archive/milestone-{N}-{slug}/`
91
+ 2. `tracking.json` `milestones[]` gets a summary entry (num, name, phases_completed, shipped_url, closed_at)
92
+ 3. REQUIREMENTS.md marks this milestone's requirements as **Complete**
93
+ 4. Next milestone from JOURNEY.md opens — roadmapper regenerates this ROADMAP.md for Milestone {N+1}
94
+ 5. `state.js init --force --milestone_name "{N+1 name}"` resets current-phase fields, preserves lifetime + milestones[] history
69
95
 
70
96
  ---
97
+
71
98
  *Last updated: {date}*
@@ -7,6 +7,8 @@
7
7
  "project_id": "",
8
8
  "git_remote": "",
9
9
  "milestone": 1,
10
+ "milestone_name": "",
11
+ "milestones": [],
10
12
  "phase": 0,
11
13
  "phase_name": "",
12
14
  "total_phases": 0,
@@ -218,25 +218,25 @@ export default function P(){return null}
218
218
  EOF
219
219
  OUT=$(cd "$TMP" && $NODE "$HOOKS_DIR/pre-deploy-gate.js" 2>&1)
220
220
  RC=$?
221
- if [ "$RC" -eq 1 ] \
221
+ if [ "$RC" -eq 2 ] \
222
222
  && echo "$OUT" | grep -q "BLOCKED" \
223
223
  && echo "$OUT" | grep -q "service_role"; then
224
- echo " ✓ service_role leak in app/ → blocked with diagnostic"
224
+ echo " ✓ service_role leak in app/ → blocked with diagnostic (exit 2)"
225
225
  PASS=$((PASS + 1))
226
226
  else
227
- echo " ✗ service_role leak in app/ → blocked (exit=$RC)"
227
+ echo " ✗ service_role leak in app/ → blocked (exit=$RC, expected 2)"
228
228
  FAIL=$((FAIL + 1))
229
229
  fi
230
230
  rm -rf "$TMP"
231
231
 
232
- # service_role leak in components/ → BLOCKED
232
+ # service_role leak in components/ → BLOCKED (exit 2 per PreToolUse contract)
233
233
  TMP=$(mktemp -d)
234
234
  mkdir -p "$TMP/components"
235
235
  cat > "$TMP/components/Widget.tsx" <<'EOF'
236
236
  const key = "service_role_literal_leak";
237
237
  EOF
238
238
  (cd "$TMP" && $NODE "$HOOKS_DIR/pre-deploy-gate.js" >/dev/null 2>&1)
239
- assert_exit "service_role in components/ → blocked" 1 $?
239
+ assert_exit "service_role in components/ → blocked (exit 2)" 2 $?
240
240
  rm -rf "$TMP"
241
241
 
242
242
  # service_role in a *.server.ts file → allowed (skip convention)