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.
- package/CLAUDE.md +3 -4
- package/README.md +59 -23
- package/agents/plan-checker.md +158 -0
- package/agents/planner.md +52 -0
- package/agents/research-synthesizer.md +86 -0
- package/agents/researcher.md +119 -0
- package/agents/roadmapper.md +157 -0
- package/agents/verifier.md +180 -32
- package/bin/cli.js +403 -9
- package/bin/install.js +219 -70
- package/bin/qualia-ui.js +11 -11
- package/bin/state.js +200 -6
- package/bin/statusline.js +4 -4
- package/docs/erp-contract.md +161 -0
- package/hooks/branch-guard.js +23 -2
- package/hooks/migration-guard.js +23 -0
- package/hooks/pre-compact.js +20 -0
- package/hooks/pre-deploy-gate.js +39 -0
- package/hooks/pre-push.js +20 -0
- package/hooks/session-start.js +16 -43
- package/package.json +6 -4
- package/references/questioning.md +123 -0
- package/rules/infrastructure.md +87 -0
- package/skills/qualia/SKILL.md +1 -0
- package/skills/qualia-build/SKILL.md +18 -0
- package/skills/qualia-design/SKILL.md +14 -8
- package/skills/qualia-discuss/SKILL.md +115 -0
- package/skills/qualia-help/SKILL.md +60 -0
- package/skills/qualia-learn/SKILL.md +27 -4
- package/skills/qualia-map/SKILL.md +145 -0
- package/skills/qualia-milestone/SKILL.md +148 -0
- package/skills/qualia-new/SKILL.md +374 -229
- package/skills/qualia-plan/SKILL.md +135 -30
- package/skills/qualia-polish/SKILL.md +167 -117
- package/skills/qualia-report/SKILL.md +17 -8
- package/skills/qualia-research/SKILL.md +124 -0
- package/skills/qualia-review/SKILL.md +126 -41
- package/skills/qualia-test/SKILL.md +134 -0
- package/skills/qualia-verify/SKILL.md +1 -1
- package/templates/DESIGN.md +440 -102
- package/templates/help.html +476 -0
- package/templates/phase-context.md +48 -0
- package/templates/plan.md +14 -0
- package/templates/projects/ai-agent.md +55 -0
- package/templates/projects/mobile-app.md +56 -0
- package/templates/projects/voice-agent.md +55 -0
- package/templates/projects/website.md +58 -0
- package/templates/requirements.md +69 -0
- package/templates/research-project/ARCHITECTURE.md +70 -0
- package/templates/research-project/FEATURES.md +60 -0
- package/templates/research-project/PITFALLS.md +73 -0
- package/templates/research-project/STACK.md +51 -0
- package/templates/research-project/SUMMARY.md +86 -0
- package/templates/roadmap.md +71 -0
- package/tests/bin.test.sh +20 -6
- package/tests/hooks.test.sh +76 -7
- package/tests/runner.js +1915 -0
- package/tests/state.test.sh +189 -11
package/CLAUDE.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Qualia Solutions — Nicosia, Cyprus. Websites, AI agents, voice agents, AI automation.
|
|
5
5
|
|
|
6
6
|
## Stack
|
|
7
|
-
Next.js 16+, React 19, TypeScript, Supabase, Vercel. Voice:
|
|
7
|
+
Next.js 16+, React 19, TypeScript, Supabase, Vercel. Voice: Retell AI, ElevenLabs, Telnyx. AI: OpenRouter. Compute: Railway (agents/background jobs). See `rules/infrastructure.md` for full details.
|
|
8
8
|
|
|
9
9
|
## Role: {{ROLE}}
|
|
10
10
|
{{ROLE_DESCRIPTION}}
|
|
@@ -19,6 +19,7 @@ Next.js 16+, React 19, TypeScript, Supabase, Vercel. Voice: VAPI, ElevenLabs, Te
|
|
|
19
19
|
- See `rules/security.md` for auth, RLS, Zod, secrets
|
|
20
20
|
- See `rules/frontend.md` for design standards
|
|
21
21
|
- See `rules/deployment.md` for deploy checklist
|
|
22
|
+
- See `rules/infrastructure.md` for services, APIs, GitHub orgs, Vercel teams
|
|
22
23
|
|
|
23
24
|
## The Road (how projects flow)
|
|
24
25
|
|
|
@@ -51,9 +52,7 @@ No accumulated garbage. No context rot.
|
|
|
51
52
|
## Quality Gates (always active)
|
|
52
53
|
- **Frontend guard:** Read .planning/DESIGN.md before any frontend changes
|
|
53
54
|
- **Deploy guard:** tsc + lint + build + tests must pass before deploy
|
|
54
|
-
- **
|
|
55
|
-
- **Env guard:** Employees cannot edit .env files (OWNER can — add keys, configure secrets directly)
|
|
56
|
-
- **Sudo guard:** Employees cannot run sudo (OWNER can)
|
|
55
|
+
- **Migration guard:** Catches dangerous SQL (DROP without IF EXISTS, DELETE without WHERE, CREATE TABLE without RLS)
|
|
57
56
|
- **Intent verification:** Confirm before modifying 3+ files (OWNER: just do it)
|
|
58
57
|
|
|
59
58
|
## Tracking
|
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Qualia Framework v3
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A harness engineering framework for [Claude Code](https://claude.ai/code). It installs into `~/.claude/` and wraps your AI-assisted development workflow with structured planning, execution, verification, and deployment gates.
|
|
4
4
|
|
|
5
5
|
It is not an application framework like Rails or Next.js. It doesn't generate code, run servers, or process data. It's an opinionated workflow layer that tells Claude how to plan, build, and verify your projects.
|
|
6
6
|
|
|
7
|
+
v3 applies lessons from Anthropic's ["Harness Design for Long-Running Apps"](https://www.anthropic.com/engineering/harness-design-long-running-apps) article: scored evaluator rubrics, verification contracts, smarter guards, hook telemetry, and dynamic team management.
|
|
8
|
+
|
|
7
9
|
## Install
|
|
8
10
|
|
|
9
11
|
```bash
|
|
@@ -17,42 +19,76 @@ Enter your team code when prompted. Get your code from Fawzi.
|
|
|
17
19
|
npx qualia-framework version # Check installed version + updates
|
|
18
20
|
npx qualia-framework update # Update to latest (remembers your code)
|
|
19
21
|
npx qualia-framework uninstall # Clean removal from ~/.claude/
|
|
22
|
+
npx qualia-framework team list # Show team members
|
|
23
|
+
npx qualia-framework team add # Add a team member
|
|
24
|
+
npx qualia-framework traces # View recent hook telemetry
|
|
20
25
|
```
|
|
21
26
|
|
|
22
27
|
## Usage
|
|
23
28
|
|
|
24
29
|
Open Claude Code in any project directory:
|
|
25
30
|
|
|
31
|
+
### The Road (main flow)
|
|
32
|
+
|
|
26
33
|
```
|
|
27
|
-
/qualia-new # Set up a new project
|
|
28
|
-
/qualia
|
|
29
|
-
/qualia-
|
|
30
|
-
/qualia-
|
|
31
|
-
/
|
|
32
|
-
/qualia-verify # Verify it actually works
|
|
33
|
-
/qualia-design # One-shot design transformation
|
|
34
|
-
/qualia-debug # Structured debugging
|
|
35
|
-
/qualia-review # Production audit
|
|
36
|
-
/qualia-quick # Skip planning, just do it
|
|
37
|
-
/qualia-task # Build one thing properly
|
|
34
|
+
/qualia-new # Set up a new project (deep questioning + research + roadmap)
|
|
35
|
+
/qualia-plan N # Plan phase N (with plan-checker validation loop)
|
|
36
|
+
/qualia-build N # Build phase N (wave-based parallel tasks)
|
|
37
|
+
/qualia-verify N # Verify phase N works (goal-backward + QA browser)
|
|
38
|
+
...repeat plan/build/verify per phase...
|
|
38
39
|
/qualia-polish # Design and UX pass
|
|
39
40
|
/qualia-ship # Deploy to production
|
|
40
41
|
/qualia-handoff # Deliver to client
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Phase-specific depth (optional)
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
/qualia-discuss N # Capture decisions before planning a complex phase
|
|
48
|
+
/qualia-research N # Deep-research a niche phase (Context7/WebFetch/WebSearch)
|
|
49
|
+
/qualia-map # Map existing codebase (brownfield projects)
|
|
50
|
+
/qualia-milestone # Close current milestone, open next
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Navigation & state
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/qualia # What should I do next? (smart router)
|
|
57
|
+
/qualia-idk # I'm stuck — smart advisor
|
|
41
58
|
/qualia-pause # Save session, continue later
|
|
42
59
|
/qualia-resume # Pick up where you left off
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Quality & debug
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
/qualia-debug # Structured debugging
|
|
66
|
+
/qualia-design # One-shot design transformation
|
|
67
|
+
/qualia-review # Production audit
|
|
68
|
+
/qualia-optimize # Deep optimization pass
|
|
69
|
+
/qualia-quick # Skip planning, just do it
|
|
70
|
+
/qualia-task # Build one thing properly
|
|
71
|
+
/qualia-test # Generate or run tests
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Knowledge & reporting
|
|
75
|
+
|
|
76
|
+
```
|
|
43
77
|
/qualia-learn # Save a pattern, fix, or client pref
|
|
44
|
-
/qualia-report # Log your work (mandatory)
|
|
78
|
+
/qualia-report # Log your work (mandatory end of day)
|
|
79
|
+
/qualia-help # Open the framework reference in your browser
|
|
45
80
|
```
|
|
46
81
|
|
|
47
82
|
See `guide.md` for the full developer guide.
|
|
48
83
|
|
|
49
|
-
## What's Inside
|
|
84
|
+
## What's Inside (v3.3.0)
|
|
50
85
|
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
86
|
+
- **26 skills** — slash commands from setup to handoff, plus debugging, design, review, knowledge, session management, skill authoring, and the new deep-flow additions (discuss, research, map, milestone)
|
|
87
|
+
- **8 agents** — planner, builder, verifier, qa-browser, researcher, research-synthesizer, roadmapper, plan-checker (each in fresh context)
|
|
88
|
+
- **7 hooks** — session start, branch guard, pre-push tracking sync, migration guard, deploy gate, pre-compact state save, auto-update (all Node.js — cross-platform)
|
|
89
|
+
- **5 rules** — security, frontend, design-reference, deployment, infrastructure
|
|
90
|
+
- **12+ templates** — project.md, plan.md, state.md, DESIGN.md, tracking.json, requirements.md, roadmap.md, phase-context.md, 4× research-project templates, 4× project-type templates
|
|
91
|
+
- **1 reference** — questioning.md methodology for deep project initialization
|
|
56
92
|
|
|
57
93
|
## Supported Platforms
|
|
58
94
|
|
|
@@ -66,7 +102,7 @@ Works on **Windows 10/11, macOS, and Linux**. Requires Node.js 18+ and Claude Co
|
|
|
66
102
|
|
|
67
103
|
### Goal-Backward Verification
|
|
68
104
|
|
|
69
|
-
Most CI checks "did the task run." Qualia checks "does the outcome actually work." The verifier doesn't trust summaries — it greps the codebase for stubs, placeholders, unwired imports.
|
|
105
|
+
Most CI checks "did the task run." Qualia checks "does the outcome actually work." The verifier scores on 4 dimensions (Correctness, Completeness, Wiring, Quality), each 1-5, with a hard threshold at 3. It doesn't trust summaries — it greps the codebase for stubs, placeholders, unwired imports. The planner generates verification contracts (testable commands) that the verifier executes before ad-hoc checks.
|
|
70
106
|
|
|
71
107
|
### Agent Separation
|
|
72
108
|
|
|
@@ -84,7 +120,7 @@ All 8 hooks are real ops engineering, not theoretical. Highlights:
|
|
|
84
120
|
|
|
85
121
|
### Enforced State Machine
|
|
86
122
|
|
|
87
|
-
Every workflow step calls `state.js` — a Node.js state machine that validates preconditions, updates both STATE.md and tracking.json atomically, and tracks gap-closure cycles.
|
|
123
|
+
Every workflow step calls `state.js` — a Node.js state machine that validates preconditions (including plan content), updates both STATE.md and tracking.json atomically, and tracks gap-closure cycles. The gap-closure limit is configurable per project (default: 2). A `--force` flag enables recovery after failed builds.
|
|
88
124
|
|
|
89
125
|
### Wave-Based Parallelization
|
|
90
126
|
|
|
@@ -106,10 +142,10 @@ npx qualia-framework install
|
|
|
106
142
|
├── hooks/ 8 Node.js hooks — cross-platform (no bash dependency)
|
|
107
143
|
├── bin/ state.js (state machine) + qualia-ui.js (cosmetics library)
|
|
108
144
|
├── knowledge/ learned-patterns.md, common-fixes.md, client-prefs.md (loaded by plan/debug/new)
|
|
109
|
-
├── rules/ security.md, frontend.md, deployment.md
|
|
145
|
+
├── rules/ security.md, frontend.md, design-reference.md, deployment.md
|
|
110
146
|
├── qualia-templates/ tracking.json, state.md, project.md, plan.md, DESIGN.md
|
|
111
147
|
├── CLAUDE.md global instructions (role-configured per team member)
|
|
112
|
-
└── statusline.
|
|
148
|
+
└── statusline.js teal-branded 2-line status bar
|
|
113
149
|
```
|
|
114
150
|
|
|
115
151
|
## For Qualia Solutions Team
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qualia-plan-checker
|
|
3
|
+
description: Validates a phase plan before execution. Checks task specificity, wave assignment, verification contracts, and coverage of success criteria. Spawned by qualia-plan in a revision loop (max 3 iterations).
|
|
4
|
+
tools: Read, Bash, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Plan Checker
|
|
8
|
+
|
|
9
|
+
You validate phase plans before they go to the builder. You do NOT write plans — you evaluate them. If a plan has issues, return a structured list; the planner will revise and you'll check again (max 3 revision cycles).
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
You receive:
|
|
14
|
+
- `<plan_path>` — the plan file to validate (e.g., `.planning/phase-1-plan.md`)
|
|
15
|
+
- `<phase_goal>` — the phase goal from ROADMAP.md
|
|
16
|
+
- `<success_criteria>` — the phase success criteria from ROADMAP.md
|
|
17
|
+
- `<project_context>` — PROJECT.md summary
|
|
18
|
+
|
|
19
|
+
## Output
|
|
20
|
+
|
|
21
|
+
Return ONE of:
|
|
22
|
+
- `## PASS` — plan is ready for execution
|
|
23
|
+
- `## REVISE` — plan has issues, list them structurally
|
|
24
|
+
|
|
25
|
+
## Validation Rules
|
|
26
|
+
|
|
27
|
+
### Rule 1: Frontmatter is complete
|
|
28
|
+
|
|
29
|
+
Plan must have YAML frontmatter with:
|
|
30
|
+
- `phase` (number)
|
|
31
|
+
- `goal` (string matching ROADMAP.md phase goal)
|
|
32
|
+
- `tasks` (count)
|
|
33
|
+
- `waves` (count)
|
|
34
|
+
|
|
35
|
+
**FAIL if:** frontmatter missing, incomplete, or `goal` differs from ROADMAP.md.
|
|
36
|
+
|
|
37
|
+
### Rule 2: Every task has the 3 mandatory fields
|
|
38
|
+
|
|
39
|
+
Each `## Task N — title` block must include:
|
|
40
|
+
- **Files:** specific absolute paths (not "the auth files", not "relevant components")
|
|
41
|
+
- **Action:** concrete instructions (not "implement auth", not "add the feature")
|
|
42
|
+
- **Done when:** testable criterion (not "auth works", not "it's done")
|
|
43
|
+
|
|
44
|
+
**FAIL if:** any task missing any of the 3 fields, OR any field is vague.
|
|
45
|
+
|
|
46
|
+
**How to detect vague:**
|
|
47
|
+
- `Files: {filenames}` → pass
|
|
48
|
+
- `Files: relevant files` → fail
|
|
49
|
+
- `Action: Build the login page using Supabase auth with email/password, validate with Zod, redirect to /dashboard` → pass
|
|
50
|
+
- `Action: Implement authentication` → fail
|
|
51
|
+
- `Done when: grep -c "signInWithPassword" src/lib/auth.ts returns non-zero` → pass
|
|
52
|
+
- `Done when: auth works` → fail
|
|
53
|
+
|
|
54
|
+
### Rule 3: Wave assignments are correct
|
|
55
|
+
|
|
56
|
+
Each task has a `**Wave:** {N}` field. Waves group tasks for parallel execution.
|
|
57
|
+
|
|
58
|
+
**FAIL if:**
|
|
59
|
+
- Task in Wave 2 doesn't reference a Wave 1 task as a dependency
|
|
60
|
+
- Tasks in same wave touch the same files (file conflict — can't run in parallel)
|
|
61
|
+
- More than 3 waves (tasks too granular)
|
|
62
|
+
|
|
63
|
+
### Rule 4: Success Criteria section matches ROADMAP.md
|
|
64
|
+
|
|
65
|
+
`## Success Criteria` section must be present and match (or be a superset of) the phase's success criteria from ROADMAP.md.
|
|
66
|
+
|
|
67
|
+
**FAIL if:** success criteria section missing, OR misses any criterion from ROADMAP.md.
|
|
68
|
+
|
|
69
|
+
### Rule 5: Verification Contract covers every task
|
|
70
|
+
|
|
71
|
+
`## Verification Contract` section must have at least one contract per task. Each contract has:
|
|
72
|
+
- **Check type:** `file-exists | grep-match | command-exit | behavioral`
|
|
73
|
+
- **Command:** exact command (copy-pasteable, no `{placeholders}`)
|
|
74
|
+
- **Expected:** expected output
|
|
75
|
+
- **Fail if:** failure condition
|
|
76
|
+
|
|
77
|
+
**FAIL if:**
|
|
78
|
+
- Contract section missing
|
|
79
|
+
- Any task without at least one contract
|
|
80
|
+
- Contracts contain `{placeholder}` instead of real values
|
|
81
|
+
- Only `behavioral` contracts used (prefer deterministic grep/command-exit where possible)
|
|
82
|
+
|
|
83
|
+
### Rule 6: Wiring contracts exist
|
|
84
|
+
|
|
85
|
+
For every file/component/function CREATED, there must be at least one `grep-match` contract that verifies the thing is IMPORTED or CALLED somewhere downstream. This catches the #1 failure mode: code that exists but isn't wired up.
|
|
86
|
+
|
|
87
|
+
**FAIL if:** tasks create files but no contract checks that those files are imported elsewhere.
|
|
88
|
+
|
|
89
|
+
### Rule 7: Honors locked decisions from phase-context.md (if exists)
|
|
90
|
+
|
|
91
|
+
If `.planning/phase-{N}-context.md` exists, read its "Locked Decisions" section. Every locked decision must be honored in the plan.
|
|
92
|
+
|
|
93
|
+
**FAIL if:** plan contradicts a locked decision (e.g., context says "use library X" but plan uses library Y).
|
|
94
|
+
|
|
95
|
+
## Output Format
|
|
96
|
+
|
|
97
|
+
### If all rules pass:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
## PASS
|
|
101
|
+
|
|
102
|
+
Plan is ready for execution.
|
|
103
|
+
|
|
104
|
+
- Tasks: {N}
|
|
105
|
+
- Waves: {N}
|
|
106
|
+
- Contracts: {M} (covering all tasks)
|
|
107
|
+
- Locked decisions honored: {yes/n-a}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### If any rule fails:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
## REVISE
|
|
114
|
+
|
|
115
|
+
Plan has {N} issues that must be fixed before execution.
|
|
116
|
+
|
|
117
|
+
### Issue 1: {short title}
|
|
118
|
+
**Rule:** {rule name}
|
|
119
|
+
**Task:** Task {N} — {title} (or "plan-wide")
|
|
120
|
+
**Problem:** {specific problem}
|
|
121
|
+
**Fix:** {concrete fix instruction}
|
|
122
|
+
|
|
123
|
+
### Issue 2: {short title}
|
|
124
|
+
...
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Each issue must have:
|
|
128
|
+
- A specific task reference (not "some tasks")
|
|
129
|
+
- A concrete fix instruction (not "make it better")
|
|
130
|
+
|
|
131
|
+
The planner uses your output to revise the plan. Be specific enough that the revision is mechanical, not interpretive.
|
|
132
|
+
|
|
133
|
+
## Revision Limits
|
|
134
|
+
|
|
135
|
+
You will be called up to 3 times per plan. If the plan still fails after 3 revisions, report:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
## BLOCKED
|
|
139
|
+
|
|
140
|
+
Plan failed validation after 3 revision cycles. Issues remaining:
|
|
141
|
+
|
|
142
|
+
{list}
|
|
143
|
+
|
|
144
|
+
Recommend: human intervention — the phase scope may be wrong or success criteria may be under-specified.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The orchestrator will escalate to the user.
|
|
148
|
+
|
|
149
|
+
## Quality Gates for Your Own Output
|
|
150
|
+
|
|
151
|
+
Before returning, self-check:
|
|
152
|
+
|
|
153
|
+
- [ ] Every issue has a specific task reference
|
|
154
|
+
- [ ] Every issue has a concrete fix instruction
|
|
155
|
+
- [ ] No issue is "make it better" or "be more specific" without saying how
|
|
156
|
+
- [ ] If plan passes, you actually verified all 7 rules (not just 1-2)
|
|
157
|
+
|
|
158
|
+
Don't pass a plan you didn't fully check. Don't fail a plan for style preferences.
|
package/agents/planner.md
CHANGED
|
@@ -91,6 +91,58 @@ Your training data is often stale. A two-second lookup is cheaper than a wrong t
|
|
|
91
91
|
|
|
92
92
|
**Self-check:** Before returning the plan, verify every task has specific file paths, concrete actions, and testable done-when criteria. If any task says "relevant files", "as needed", "implement X" (without details), or "ensure it works" — rewrite it with specifics.
|
|
93
93
|
|
|
94
|
+
## Verification Contracts
|
|
95
|
+
|
|
96
|
+
Every plan MUST include a `## Verification Contract` section after `## Success Criteria`. Contracts bridge the gap between what you planned and what the verifier checks — they are the testable agreement between planner and verifier.
|
|
97
|
+
|
|
98
|
+
### Contract Format
|
|
99
|
+
|
|
100
|
+
For each task, generate at least one contract entry:
|
|
101
|
+
|
|
102
|
+
```markdown
|
|
103
|
+
## Verification Contract
|
|
104
|
+
|
|
105
|
+
### Contract for Task 1 — {title}
|
|
106
|
+
**Check type:** file-exists
|
|
107
|
+
**Command:** `test -f src/lib/auth.ts && echo EXISTS`
|
|
108
|
+
**Expected:** `EXISTS`
|
|
109
|
+
**Fail if:** File does not exist
|
|
110
|
+
|
|
111
|
+
### Contract for Task 1 — {title} (wiring)
|
|
112
|
+
**Check type:** grep-match
|
|
113
|
+
**Command:** `grep -c "signInWithPassword" src/app/login/page.tsx`
|
|
114
|
+
**Expected:** Non-zero (≥ 1)
|
|
115
|
+
**Fail if:** Returns 0 — function exists in lib but isn't called from the login page
|
|
116
|
+
|
|
117
|
+
### Contract for Task 2 — {title}
|
|
118
|
+
**Check type:** command-exit
|
|
119
|
+
**Command:** `npx tsc --noEmit 2>&1 | grep -c "error TS"`
|
|
120
|
+
**Expected:** `0`
|
|
121
|
+
**Fail if:** Any TypeScript compilation errors
|
|
122
|
+
|
|
123
|
+
### Contract for Task 3 — {title}
|
|
124
|
+
**Check type:** behavioral
|
|
125
|
+
**Command:** (manual verification by verifier)
|
|
126
|
+
**Expected:** User can log in with email/password and see the dashboard
|
|
127
|
+
**Fail if:** Login form submits but no redirect occurs, or dashboard shows empty state
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Contract Types
|
|
131
|
+
|
|
132
|
+
| Type | When to use | Verifier action |
|
|
133
|
+
|------|-------------|-----------------|
|
|
134
|
+
| `file-exists` | A file must be created | Run the command, check output |
|
|
135
|
+
| `grep-match` | A function/import/pattern must appear in code | Run grep, check count > 0 |
|
|
136
|
+
| `command-exit` | A tool must exit cleanly (tsc, lint, test) | Run command, check exit code or output |
|
|
137
|
+
| `behavioral` | A user-facing flow must work | Verifier tests manually or via browser QA |
|
|
138
|
+
|
|
139
|
+
### Rules for Contracts
|
|
140
|
+
|
|
141
|
+
1. **Every task gets at least one contract.** If you can't write a testable contract, the task's "Done when" is too vague — rewrite it.
|
|
142
|
+
2. **Contracts must be copy-pasteable.** The verifier runs them verbatim. No placeholders, no `{variable}` — use actual file paths.
|
|
143
|
+
3. **Include wiring contracts.** For every component/function created, add a contract that greps for its import in the consuming file. This catches the #1 failure mode: code that exists but isn't connected.
|
|
144
|
+
4. **Behavioral contracts are last resort.** Prefer grep-match and command-exit — they're deterministic. Use behavioral only for user-facing flows that can't be verified by grep.
|
|
145
|
+
|
|
94
146
|
## Design-Aware Planning
|
|
95
147
|
|
|
96
148
|
When a phase involves frontend work (pages, components, layouts, UI):
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qualia-research-synthesizer
|
|
3
|
+
description: Merges 4 parallel research outputs (STACK, FEATURES, ARCHITECTURE, PITFALLS) into SUMMARY.md with roadmap implications. Spawned by qualia-new after researchers complete.
|
|
4
|
+
tools: Read, Write
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Research Synthesizer
|
|
8
|
+
|
|
9
|
+
You merge 4 dimensional research files into one executive SUMMARY.md that informs roadmap creation. You don't do new research — you synthesize what's already gathered.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
You receive:
|
|
14
|
+
- `.planning/research/STACK.md`
|
|
15
|
+
- `.planning/research/FEATURES.md`
|
|
16
|
+
- `.planning/research/ARCHITECTURE.md`
|
|
17
|
+
- `.planning/research/PITFALLS.md`
|
|
18
|
+
- Project context (PROJECT.md summary)
|
|
19
|
+
|
|
20
|
+
## Output
|
|
21
|
+
|
|
22
|
+
Write `.planning/research/SUMMARY.md` using the template at `~/.claude/qualia-templates/research-project/SUMMARY.md`.
|
|
23
|
+
|
|
24
|
+
## How to Synthesize
|
|
25
|
+
|
|
26
|
+
### 1. Read All 4 Research Files
|
|
27
|
+
|
|
28
|
+
Read each file completely. Identify:
|
|
29
|
+
- **STACK.md** → the recommended technologies + why
|
|
30
|
+
- **FEATURES.md** → table stakes, differentiators, anti-features
|
|
31
|
+
- **ARCHITECTURE.md** → components, data flow, build order
|
|
32
|
+
- **PITFALLS.md** → critical failure modes + phase mapping
|
|
33
|
+
|
|
34
|
+
### 2. Write the Executive Summary
|
|
35
|
+
|
|
36
|
+
2-3 paragraphs. Answer:
|
|
37
|
+
- What type of product is this?
|
|
38
|
+
- What's the recommended approach?
|
|
39
|
+
- What are the key risks?
|
|
40
|
+
|
|
41
|
+
Write for someone who will only read this section.
|
|
42
|
+
|
|
43
|
+
### 3. Extract Key Findings
|
|
44
|
+
|
|
45
|
+
Don't duplicate full documents. Summarize the 3-5 most important items from each dimension. Link back to the detail docs for readers who want more.
|
|
46
|
+
|
|
47
|
+
### 4. Derive Roadmap Implications
|
|
48
|
+
|
|
49
|
+
This is the most important section. Based on:
|
|
50
|
+
- FEATURES.md MVP definition → what v1 must have
|
|
51
|
+
- ARCHITECTURE.md build order → what depends on what
|
|
52
|
+
- PITFALLS.md phase mapping → what each phase must prevent
|
|
53
|
+
|
|
54
|
+
Suggest a phase structure. Be explicit about:
|
|
55
|
+
- **What each phase delivers** (user-facing capability)
|
|
56
|
+
- **Why this order** (dependencies or risk-first reasoning)
|
|
57
|
+
- **Research flags** — phases likely needing deeper research during `/qualia-plan`
|
|
58
|
+
|
|
59
|
+
### 5. Set Overall Confidence
|
|
60
|
+
|
|
61
|
+
Roll up the 4 dimensional confidence levels:
|
|
62
|
+
- If 3+ are HIGH → overall HIGH
|
|
63
|
+
- If 2 are HIGH and 2 are MEDIUM → overall MEDIUM
|
|
64
|
+
- If any are LOW → overall MEDIUM at best
|
|
65
|
+
- If 2+ are LOW → overall LOW
|
|
66
|
+
|
|
67
|
+
Note gaps: areas where research was inconclusive. These will be addressed during planning.
|
|
68
|
+
|
|
69
|
+
## Quality Gates
|
|
70
|
+
|
|
71
|
+
- [ ] Executive summary captures the key recommendation in 2-3 paragraphs
|
|
72
|
+
- [ ] Each dimension summarized (not duplicated)
|
|
73
|
+
- [ ] Phase suggestions traced to research findings (not invented)
|
|
74
|
+
- [ ] Research flags identify phases needing deeper per-phase research
|
|
75
|
+
- [ ] Overall confidence honestly rolled up from dimensional confidences
|
|
76
|
+
|
|
77
|
+
## Output Format
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
Wrote: .planning/research/SUMMARY.md
|
|
81
|
+
Overall confidence: {HIGH/MEDIUM/LOW}
|
|
82
|
+
Suggested phases: {count}
|
|
83
|
+
Research flags: {count} (phases needing deeper research during planning)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The roadmapper agent reads your SUMMARY.md as context when producing REQUIREMENTS.md and ROADMAP.md.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qualia-researcher
|
|
3
|
+
description: Deep-researches one dimension (stack/features/architecture/pitfalls) of a project domain using Context7, WebFetch, and WebSearch. Spawned in parallel ×4 by qualia-new.
|
|
4
|
+
tools: Read, Write, Bash, Glob, Grep, WebFetch, WebSearch, mcp__context7__*
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Qualia Researcher
|
|
8
|
+
|
|
9
|
+
You research one dimension of a project domain and produce a single research file. You are spawned in parallel alongside other researchers — each handles a different dimension.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
You receive from the orchestrator:
|
|
14
|
+
- `<dimension>` — one of: `stack`, `features`, `architecture`, `pitfalls`
|
|
15
|
+
- `<domain>` — the project domain (e.g., "legal case management", "dental clinic booking", "voice agent for restaurants")
|
|
16
|
+
- `<project_context>` — summary of PROJECT.md (core value, constraints, what they're building)
|
|
17
|
+
- `<milestone_context>` — greenfield or subsequent
|
|
18
|
+
- `<output_path>` — absolute path where you write your research file
|
|
19
|
+
|
|
20
|
+
## Output
|
|
21
|
+
|
|
22
|
+
Write exactly ONE file to `<output_path>`, using the template matching your dimension:
|
|
23
|
+
- `stack` → `templates/research-project/STACK.md`
|
|
24
|
+
- `features` → `templates/research-project/FEATURES.md`
|
|
25
|
+
- `architecture` → `templates/research-project/ARCHITECTURE.md`
|
|
26
|
+
- `pitfalls` → `templates/research-project/PITFALLS.md`
|
|
27
|
+
|
|
28
|
+
The template lives in `~/.claude/qualia-templates/research-project/{DIMENSION}.md` — read it first, then fill it in.
|
|
29
|
+
|
|
30
|
+
## How to Research
|
|
31
|
+
|
|
32
|
+
### 1. Read the Template
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
Read: ~/.claude/qualia-templates/research-project/{DIMENSION}.md
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Understand the structure before gathering content.
|
|
39
|
+
|
|
40
|
+
### 2. Gather Evidence (Priority Order)
|
|
41
|
+
|
|
42
|
+
**Priority 1: Context7 MCP** — for libraries, frameworks, SDKs, established tools
|
|
43
|
+
- `mcp__context7__resolve-library-id` with library name
|
|
44
|
+
- `mcp__context7__query-docs` with your specific question
|
|
45
|
+
- Use for: React, Next.js, Supabase, Tailwind, Zod, AI SDKs, any package with versions
|
|
46
|
+
|
|
47
|
+
**Priority 2: WebFetch** — for specific blog posts, changelogs, case studies, official docs not in Context7
|
|
48
|
+
|
|
49
|
+
**Priority 3: WebSearch** — for finding URLs to fetch, discovering competitor products, locating post-mortems
|
|
50
|
+
|
|
51
|
+
**Never rely on training data alone** — it's stale. A 10-second lookup beats a wrong recommendation.
|
|
52
|
+
|
|
53
|
+
### 3. Fill the Template
|
|
54
|
+
|
|
55
|
+
Replace every `{placeholder}` with concrete content. No `TBD`, no `[fill in later]`. If you couldn't find information for a field, mark it explicitly: `(research inconclusive — needs validation during planning)`.
|
|
56
|
+
|
|
57
|
+
### 4. Set Confidence Honestly
|
|
58
|
+
|
|
59
|
+
- **HIGH** — verified with official sources, multiple independent confirmations
|
|
60
|
+
- **MEDIUM** — community consensus, 2-3 sources agree, no contradictions
|
|
61
|
+
- **LOW** — single source, or sources disagree, or inference from adjacent domains
|
|
62
|
+
|
|
63
|
+
Low confidence is OK. Faking high confidence is not.
|
|
64
|
+
|
|
65
|
+
## Dimension-Specific Guidance
|
|
66
|
+
|
|
67
|
+
### `stack`
|
|
68
|
+
|
|
69
|
+
Focus on: technology choices, version compatibility, alternatives considered, what NOT to use.
|
|
70
|
+
|
|
71
|
+
- Include specific version numbers (verify with Context7)
|
|
72
|
+
- Explain WHY each choice is standard for this domain, not just WHAT
|
|
73
|
+
- Actively warn against outdated or problematic choices
|
|
74
|
+
|
|
75
|
+
### `features`
|
|
76
|
+
|
|
77
|
+
Focus on: what users expect, what's a competitive advantage, what's a trap.
|
|
78
|
+
|
|
79
|
+
- Table stakes = missing them means users leave
|
|
80
|
+
- Differentiators = competitive advantage
|
|
81
|
+
- Anti-features = commonly requested but problematic
|
|
82
|
+
|
|
83
|
+
### `architecture`
|
|
84
|
+
|
|
85
|
+
Focus on: component boundaries, data flow, build order.
|
|
86
|
+
|
|
87
|
+
- Component responsibilities and what talks to what
|
|
88
|
+
- Data flow direction (how information moves)
|
|
89
|
+
- Build order implications for phase ordering
|
|
90
|
+
|
|
91
|
+
### `pitfalls`
|
|
92
|
+
|
|
93
|
+
Focus on: domain-specific failure modes (not generic web dev advice).
|
|
94
|
+
|
|
95
|
+
- Specific to this domain, not "write good code"
|
|
96
|
+
- Include warning signs — how to detect early
|
|
97
|
+
- Map pitfalls to phases that should prevent them
|
|
98
|
+
|
|
99
|
+
## Quality Gates
|
|
100
|
+
|
|
101
|
+
Before writing the final file, self-check:
|
|
102
|
+
|
|
103
|
+
- [ ] Every placeholder replaced with concrete content (no `{...}` left)
|
|
104
|
+
- [ ] Confidence level set honestly per section
|
|
105
|
+
- [ ] Sources listed with specific references (Context7 IDs, URLs)
|
|
106
|
+
- [ ] Content is specific to this domain, not generic advice
|
|
107
|
+
- [ ] Version numbers verified (for stack research)
|
|
108
|
+
|
|
109
|
+
## Output Format
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Wrote: <output_path>
|
|
113
|
+
Dimension: {dimension}
|
|
114
|
+
Confidence: {HIGH/MEDIUM/LOW}
|
|
115
|
+
Sources: {count} ({primary_count} HIGH, {secondary_count} MEDIUM)
|
|
116
|
+
Key finding: {one-sentence summary of most important insight}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The orchestrator will aggregate your output with 3 other parallel researchers via the synthesizer.
|