qualia-framework 2.0.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.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: qualia-handoff
3
+ description: "Client delivery — credentials, handover doc, final update. Use after shipping."
4
+ ---
5
+
6
+ # /qualia-handoff — Client Delivery
7
+
8
+ Prepare and deliver the finished project to the client.
9
+
10
+ ## Process
11
+
12
+ ```
13
+ ◆ QUALIA ► HANDOFF
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ```
16
+
17
+ ### 1. Generate Handover Doc
18
+
19
+ Create `.planning/HANDOFF.md`:
20
+
21
+ ```markdown
22
+ # {Project Name} — Handover
23
+
24
+ ## What Was Built
25
+ {3-5 bullet summary of delivered features}
26
+
27
+ ## Access
28
+ - **URL:** {production URL}
29
+ - **Admin login:** {credentials or where to find them}
30
+ - **Supabase:** {project ref}
31
+ - **GitHub:** {repo URL}
32
+ - **Vercel:** {project URL}
33
+
34
+ ## How to Use
35
+ {Brief walkthrough of the main user flows}
36
+
37
+ ## Known Limitations
38
+ {Anything not in scope or deferred}
39
+
40
+ ## Maintenance
41
+ - Hosting: Vercel (auto-deploys from main branch)
42
+ - Database: Supabase ({region})
43
+ - Domain: {domain provider if applicable}
44
+
45
+ ## Support
46
+ Contact: Fawzi Goussous — fawzi@qualiasolutions.net
47
+ ```
48
+
49
+ ### 2. Commit
50
+
51
+ ```bash
52
+ git add .planning/HANDOFF.md
53
+ git commit -m "docs: client handoff document"
54
+ git push
55
+ ```
56
+
57
+ ### 3. Update State
58
+
59
+ Update STATE.md: "handed off"
60
+ Update tracking.json: status → "handed_off"
61
+
62
+ ```
63
+ ◆ QUALIA ► DELIVERED ✓
64
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
+ {Project Name} handed off to {client}.
66
+ Don't forget: /qualia-report
67
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
68
+ ```
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: qualia-new
3
+ description: "Set up a new project from scratch — questioning, scaffold, roadmap. Use when starting any new client project."
4
+ ---
5
+
6
+ # /qualia-new — New Project
7
+
8
+ Set up a project from zero. Creates repo, infrastructure, and planning files.
9
+
10
+ ## Process
11
+
12
+ ### 1. Question
13
+
14
+ ```
15
+ ◆ QUALIA ► NEW PROJECT
16
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
17
+ ```
18
+
19
+ Ask: **"What are you building?"**
20
+
21
+ Listen. Then follow threads:
22
+ - What problem does this solve?
23
+ - Who uses it?
24
+ - What does it look like?
25
+ - What's already decided (design, features, tech)?
26
+ - What's NOT in scope?
27
+
28
+ Keep asking until you could write a clear PROJECT.md. Then ask: "Ready to create the project?"
29
+
30
+ ### 2. Detect Project Type
31
+
32
+ From the answers, classify:
33
+ - **website** — landing page, SaaS, dashboard, marketing site
34
+ - **ai-agent** — chatbot, AI assistant, agent
35
+ - **voice-agent** — phone agent, VAPI, Retell, call bot
36
+ - **mobile-app** — iOS, Android, React Native, Expo
37
+
38
+ If unclear, ask.
39
+
40
+ ### 3. Stack Confirmation
41
+
42
+ Default: **Next.js + React + TypeScript + Supabase + Vercel** (the Qualia stack).
43
+
44
+ If requirements suggest a different stack, ask before proceeding.
45
+
46
+ ### 4. Scaffold
47
+
48
+ ```bash
49
+ # Create project directory if not already in one
50
+ mkdir -p .planning
51
+
52
+ # Initialize git if needed
53
+ git init 2>/dev/null
54
+
55
+ # Create Next.js project (if website/ai-agent)
56
+ npx create-next-app@latest . --typescript --tailwind --eslint --app --src-dir=false --import-alias="@/*" --no-git
57
+
58
+ # Or Expo project (if mobile-app)
59
+ # npx create-expo-app . --template blank-typescript
60
+ ```
61
+
62
+ Create GitHub repo:
63
+ ```bash
64
+ gh repo create {project-name} --private --source=. --push
65
+ ```
66
+
67
+ Link Vercel:
68
+ ```bash
69
+ vercel link
70
+ ```
71
+
72
+ Create Supabase project (via MCP or manual).
73
+ Configure auth URLs: Vercel domain, `/**` wildcard, `http://localhost:3000`.
74
+
75
+ ### 5. Create Planning Files
76
+
77
+ **`.planning/PROJECT.md`:**
78
+ ```markdown
79
+ # {Project Name}
80
+
81
+ ## Client
82
+ {client name}
83
+
84
+ ## What We're Building
85
+ {clear description from questioning}
86
+
87
+ ## Requirements
88
+ - [ ] {requirement 1}
89
+ - [ ] {requirement 2}
90
+ - [ ] {requirement 3}
91
+
92
+ ## Out of Scope
93
+ - {exclusion 1}
94
+ - {exclusion 2}
95
+
96
+ ## Stack
97
+ {confirmed stack}
98
+
99
+ ## Decisions
100
+ | Decision | Why |
101
+ |----------|-----|
102
+ | {decision from questioning} | {rationale} |
103
+ ```
104
+
105
+ **`.planning/STATE.md`** — use template from `templates/state.md`
106
+
107
+ **`.planning/tracking.json`** — use template from `templates/tracking.json`, fill in project/client/assigned_to
108
+
109
+ ### 6. Create Roadmap
110
+
111
+ Based on project type and requirements, create phases in STATE.md:
112
+
113
+ **Typical website:**
114
+ 1. Foundation — Auth, database schema, base layout
115
+ 2. Core — Main features
116
+ 3. Content — Pages, copy, media
117
+ 4. Polish — Design, animations, responsive
118
+
119
+ **Typical AI agent:**
120
+ 1. Foundation — Auth, database, API routes
121
+ 2. Agent — AI logic, prompts, tool calling
122
+ 3. Interface — Chat UI, streaming, history
123
+ 4. Polish — Error handling, rate limiting, monitoring
124
+
125
+ **Typical voice agent:**
126
+ 1. Foundation — Webhook handler, Supabase, auth
127
+ 2. Voice — VAPI/Retell config, call flow, prompts
128
+ 3. Integration — CRM sync, logging, analytics
129
+ 4. Polish — Latency optimization, error handling
130
+
131
+ Present the roadmap. Get approval. Adjust if needed.
132
+
133
+ ### 7. Commit & Output
134
+
135
+ ```bash
136
+ git add .planning/
137
+ git commit -m "init: project setup with planning files"
138
+ git push -u origin main
139
+ ```
140
+
141
+ ```
142
+ ◆ QUALIA ► PROJECT READY
143
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
144
+
145
+ {Project Name}
146
+ Type {type}
147
+ Phases {N}
148
+ Client {client}
149
+
150
+ → Run: /qualia-plan 1
151
+ ```
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: qualia-plan
3
+ description: "Plan the current phase — spawns planner agent in fresh context. Use when ready to plan a phase."
4
+ ---
5
+
6
+ # /qualia-plan — Plan a Phase
7
+
8
+ Spawn a planner agent to break the current phase into executable tasks.
9
+
10
+ ## Usage
11
+ `/qualia-plan` — plan the next unplanned phase
12
+ `/qualia-plan {N}` — plan specific phase
13
+ `/qualia-plan {N} --gaps` — plan fixes for verification failures
14
+
15
+ ## Process
16
+
17
+ ### 1. Determine Phase
18
+
19
+ ```bash
20
+ cat .planning/STATE.md 2>/dev/null
21
+ ```
22
+
23
+ If no phase number given, use the current phase from STATE.md.
24
+
25
+ ### 2. Spawn Planner (Fresh Context)
26
+
27
+ ```
28
+ ◆ QUALIA ► PLANNING Phase {N}
29
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
+ Spawning planner...
31
+ ```
32
+
33
+ Spawn a subagent with `agents/planner.md` instructions:
34
+
35
+ ```
36
+ Agent(prompt="
37
+ Read your role: @agents/planner.md
38
+
39
+ Project context:
40
+ @.planning/PROJECT.md
41
+
42
+ Current state:
43
+ @.planning/STATE.md
44
+
45
+ Phase {N} goal: {goal from STATE.md roadmap}
46
+ Phase {N} success criteria: {criteria from STATE.md}
47
+
48
+ {If --gaps: Also read @.planning/phase-{N}-verification.md for failures to fix}
49
+
50
+ Create the plan file at .planning/phase-{N}-plan.md
51
+ ", subagent_type="general-purpose", description="Plan phase {N}")
52
+ ```
53
+
54
+ ### 3. Review Plan
55
+
56
+ Read the generated plan. Present to employee:
57
+
58
+ ```
59
+ ◆ Phase {N} Plan
60
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
+
62
+ Tasks: {count}
63
+ Waves: {count}
64
+
65
+ Wave 1 (parallel):
66
+ Task 1: {title}
67
+ Task 2: {title}
68
+
69
+ Wave 2 (after Wave 1):
70
+ Task 3: {title}
71
+
72
+ Approve? (yes / adjust)
73
+ ```
74
+
75
+ If "adjust" — get feedback, re-spawn planner with revision context.
76
+
77
+ ### 4. Update State
78
+
79
+ Update STATE.md: status → "planned"
80
+ Update tracking.json: status → "planned"
81
+
82
+ ```
83
+ → Run: /qualia-build {N}
84
+ ```
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: qualia-polish
3
+ description: "Design and UX pass — critique, polish, harden. Run after all phases are verified."
4
+ ---
5
+
6
+ # /qualia-polish — Design Pass
7
+
8
+ Run after all feature phases are verified. Makes it look production-ready.
9
+
10
+ ## Process
11
+
12
+ ```
13
+ ◆ QUALIA ► POLISHING
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ```
16
+
17
+ ### 1. Critique
18
+ Review the entire UI. Check:
19
+ - Visual hierarchy and information architecture
20
+ - Color consistency, contrast, readability
21
+ - Spacing and alignment
22
+ - Component consistency across pages
23
+
24
+ ### 2. Polish
25
+ Fix what critique found:
26
+ - Alignment and spacing issues
27
+ - Font consistency
28
+ - Color palette adherence (Qualia teal brand)
29
+ - Transition and hover state consistency
30
+
31
+ ### 3. Harden
32
+ Edge cases and robustness:
33
+ - Empty states (no data, loading, error)
34
+ - Text overflow, long content
35
+ - Mobile responsive (check all breakpoints)
36
+ - Error messages (user-friendly, not technical)
37
+
38
+ ### 4. Qualia Frontend Rules
39
+ - Distinctive fonts (not Inter/Arial)
40
+ - Cohesive color palette with sharp accents
41
+ - CSS transitions, staggered animations
42
+ - Full-width layouts, no hardcoded max-width caps
43
+ - No card grids, no generic heroes, no blue-purple gradients
44
+
45
+ ### 5. Commit & Update
46
+
47
+ ```bash
48
+ git add {changed files}
49
+ git commit -m "polish: design and UX pass"
50
+ ```
51
+
52
+ Update STATE.md: "polish complete"
53
+ Update tracking.json: status → "polished"
54
+
55
+ ```
56
+ → Run: /qualia-ship
57
+ ```
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: qualia-quick
3
+ description: "Fast path for small tasks — bug fixes, tweaks, hot fixes. Skips full phase planning."
4
+ ---
5
+
6
+ # /qualia-quick — Quick Task
7
+
8
+ For tasks under 30 minutes that don't need full phase planning. Bug fixes, small features, tweaks.
9
+
10
+ ## Process
11
+
12
+ 1. **Understand:** Ask what needs to be done (or read the instruction)
13
+ 2. **Build:** Do it directly — read before write, MVP only
14
+ 3. **Verify:** Run `npx tsc --noEmit`, test locally
15
+ 4. **Commit:** Atomic commit with clear message
16
+ 5. **Update:** Update tracking.json notes field
17
+
18
+ ```bash
19
+ git add {specific files}
20
+ git commit -m "fix: {description}"
21
+ ```
22
+
23
+ No plan file. No subagents. Just build and ship.
24
+
25
+ Update STATE.md last activity. Update tracking.json notes.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: qualia-report
3
+ description: "Generate session report as DOCX and auto-upload to ERP. Mandatory before clock-out."
4
+ ---
5
+
6
+ # /qualia-report — Session Report
7
+
8
+ Generate a concise DOCX report of what was done. Auto-uploads to the ERP.
9
+
10
+ ## Process
11
+
12
+ ### 1. Gather Data
13
+
14
+ ```bash
15
+ echo "---COMMITS---"
16
+ SINCE="8 hours ago"
17
+ git log --oneline --since="$SINCE" 2>/dev/null | head -20
18
+ echo "---STATS---"
19
+ echo "COUNT:$(git log --oneline --since="$SINCE" 2>/dev/null | wc -l)"
20
+ echo "---PROJECT---"
21
+ echo "DIR:$(basename $(pwd))"
22
+ echo "BRANCH:$(git branch --show-current 2>/dev/null)"
23
+ echo "---STATE---"
24
+ head -20 .planning/STATE.md 2>/dev/null || echo "no-state"
25
+ ```
26
+
27
+ ### 2. Synthesize
28
+
29
+ Build a concise summary:
30
+ - **What was done:** 3-6 bullet points. Start with verbs (Built, Fixed, Added). Group related commits.
31
+ - **Blockers:** Only if something is actually blocked.
32
+ - **Next:** 1-3 clear next actions.
33
+
34
+ ### 3. Generate DOCX
35
+
36
+ ```bash
37
+ mkdir -p .planning/reports
38
+
39
+ cat <<'REPORT_JSON' | python3 ~/.claude/qualia-framework/bin/generate-report-docx.py ".planning/reports/report-$(date +%Y-%m-%d-%H%M).docx"
40
+ {
41
+ "project": "{project-name}",
42
+ "user": "{git user.name}",
43
+ "date": "{YYYY-MM-DD}",
44
+ "time": "{HH:MM}",
45
+ "branch": "{branch}",
46
+ "phase": "{Phase N — name}",
47
+ "done": ["{accomplishment 1}", "{accomplishment 2}"],
48
+ "blockers": [],
49
+ "next": ["{next action 1}"]
50
+ }
51
+ REPORT_JSON
52
+ ```
53
+
54
+ ### 4. Commit & Upload
55
+
56
+ ```bash
57
+ REPORT_FILE=$(ls -t .planning/reports/report-*.docx 2>/dev/null | head -1)
58
+ git add "$REPORT_FILE"
59
+ git commit -m "report: session $(date +%Y-%m-%d)"
60
+ git push
61
+ ```
62
+
63
+ Auto-upload to ERP:
64
+ ```bash
65
+ curl -s -X POST "https://portal.qualiasolutions.net/api/claude/report-upload" \
66
+ -H "x-api-key: $CLAUDE_API_KEY" \
67
+ -F "file=@$REPORT_FILE" \
68
+ -F "employee_email=$(git config user.email)" \
69
+ -F "project_name=$(basename $(pwd))"
70
+ ```
71
+
72
+ Employee cannot skip this. Report goes directly to the ERP.
73
+
74
+ Update STATE.md last activity.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: qualia-ship
3
+ description: "Deploy to production — quality gates, commit, push, deploy, verify. Use when ready to go live."
4
+ ---
5
+
6
+ # /qualia-ship — Deploy
7
+
8
+ Full deployment pipeline with quality gates.
9
+
10
+ ## Process
11
+
12
+ ```
13
+ ◆ QUALIA ► SHIPPING
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ```
16
+
17
+ ### 1. Quality Gates
18
+
19
+ Run in sequence. Auto-fix failures (up to 2 attempts).
20
+
21
+ ```bash
22
+ npx tsc --noEmit # TypeScript — must pass
23
+ npx eslint . --max-warnings 0 # Lint — auto-fix first
24
+ npm run build # Build — must succeed
25
+ ```
26
+
27
+ On failure:
28
+ 1. Summarize what failed in plain language
29
+ 2. Auto-fix
30
+ 3. Re-run the gate
31
+ 4. If still failing after 2 attempts: tell the employee, suggest `/qualia-debug`
32
+
33
+ ### 2. Security Check
34
+
35
+ ```bash
36
+ # service_role in client code?
37
+ grep -r "service_role" app/ components/ src/ 2>/dev/null | grep -v node_modules | grep -v ".server."
38
+ # Should be ZERO matches
39
+ ```
40
+
41
+ ### 3. Git
42
+
43
+ ```bash
44
+ git add {specific changed files}
45
+ git commit -m "ship: {project name} production deploy"
46
+ git push
47
+ ```
48
+
49
+ Employee stays on feature branch. Never push to main.
50
+
51
+ ### 4. Deploy
52
+
53
+ ```bash
54
+ vercel --prod # Website/AI agent
55
+ # OR
56
+ supabase functions deploy # Edge functions
57
+ # OR
58
+ wrangler deploy # Cloudflare Workers
59
+ ```
60
+
61
+ ### 5. Post-Deploy Verification
62
+
63
+ ```bash
64
+ # HTTP 200
65
+ curl -s -o /dev/null -w "%{http_code}" {domain}
66
+
67
+ # Latency under 500ms
68
+ curl -s -o /dev/null -w "%{time_total}" {domain}
69
+
70
+ # Auth endpoint responds
71
+ curl -s -o /dev/null -w "%{http_code}" {domain}/api/auth/callback
72
+ ```
73
+
74
+ ### 6. Report
75
+
76
+ ```
77
+ ◆ QUALIA ► SHIPPED ✓
78
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
79
+ URL {production url}
80
+ Status HTTP 200 ✓
81
+ Latency {time}ms ✓
82
+ Auth ✓
83
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+ ```
85
+
86
+ Update STATE.md: "shipped"
87
+ Update tracking.json: status → "shipped", deployed_url
88
+
89
+ ```
90
+ → Run: /qualia-handoff
91
+ ```
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: qualia-verify
3
+ description: "Goal-backward verification — checks if the phase ACTUALLY works, not just if tasks completed. Spawns verifier agent."
4
+ ---
5
+
6
+ # /qualia-verify — Verify a Phase
7
+
8
+ Spawn a verifier agent to check if the phase goal was achieved. Does NOT trust build summaries — greps the actual codebase.
9
+
10
+ ## Usage
11
+ `/qualia-verify` — verify the current built phase
12
+ `/qualia-verify {N}` — verify specific phase
13
+
14
+ ## Process
15
+
16
+ ### 1. Load Context
17
+
18
+ ```bash
19
+ echo "---PLAN---"
20
+ cat .planning/phase-{N}-plan.md 2>/dev/null
21
+ echo "---PREVIOUS---"
22
+ cat .planning/phase-{N}-verification.md 2>/dev/null || echo "NONE"
23
+ ```
24
+
25
+ ### 2. Spawn Verifier (Fresh Context)
26
+
27
+ ```
28
+ ◆ QUALIA ► VERIFYING Phase {N}
29
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
+ Spawning verifier...
31
+ ```
32
+
33
+ ```
34
+ Agent(prompt="
35
+ Read your role: @agents/verifier.md
36
+
37
+ Phase plan with success criteria:
38
+ @.planning/phase-{N}-plan.md
39
+
40
+ {If re-verification: Previous verification with gaps:}
41
+ {@.planning/phase-{N}-verification.md}
42
+
43
+ Verify this phase. Write report to .planning/phase-{N}-verification.md
44
+ ", subagent_type="general-purpose", description="Verify phase {N}")
45
+ ```
46
+
47
+ ### 3. Present Results
48
+
49
+ Read the verification report. Present:
50
+
51
+ **If PASS:**
52
+ ```
53
+ ◆ QUALIA ► Phase {N} VERIFIED ✓
54
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
55
+
56
+ All {count} criteria passed.
57
+
58
+ → Run: /qualia-plan {N+1}
59
+ ```
60
+
61
+ **If FAIL:**
62
+ ```
63
+ ◆ QUALIA ► Phase {N} GAPS FOUND
64
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
+
66
+ Passed: {pass_count}
67
+ Failed: {fail_count}
68
+
69
+ Gaps:
70
+ ✗ {gap 1 — specific description}
71
+ ✗ {gap 2 — specific description}
72
+
73
+ → Run: /qualia-plan {N} --gaps
74
+ ```
75
+
76
+ ### 4. Update State
77
+
78
+ Update STATE.md: verification result
79
+ Update tracking.json: verification → "pass" or "fail"