qualia-framework-v2 2.0.0 → 2.1.1

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/README.md CHANGED
@@ -1,16 +1,17 @@
1
1
  # Qualia Framework v2
2
2
 
3
- Claude Code workflow framework for Qualia Solutions. Guides projects from setup to client handoff.
3
+ A prompt orchestration 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
+
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.
4
6
 
5
7
  ## Install
6
8
 
7
9
  ```bash
8
- git clone https://github.com/qualia-solutions/qualia-framework-v2.git
9
- cd qualia-framework-v2
10
- chmod +x install.sh
11
- ./install.sh
10
+ npx qualia-framework-v2 install
12
11
  ```
13
12
 
13
+ Enter your team code when prompted. Get your code from Fawzi.
14
+
14
15
  ## Usage
15
16
 
16
17
  Open Claude Code in any project directory:
@@ -29,20 +30,58 @@ See `guide.md` for the full developer guide.
29
30
 
30
31
  ## What's Inside
31
32
 
32
- - **10 skills** — the commands that guide you from setup to handoff
33
+ - **11 skills** — slash commands that guide you from setup to handoff
33
34
  - **3 agents** — planner, builder, verifier (each in fresh context)
34
- - **6 hooks** — session start, branch guard, env protection, deploy gate, state save, tracking sync
35
+ - **7 hooks** — branch guard, pre-push tracking sync, env protection, migration guard, deploy gate, pre-compact state save, session start
35
36
  - **3 rules** — security, frontend, deployment
36
37
  - **4 templates** — tracking.json, state.md, project.md, plan.md
37
38
 
39
+ ## Why It Works
40
+
41
+ ### Goal-Backward Verification
42
+
43
+ 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. When Claude says "I built the chat component," this catches the cases where it wrote a skeleton with `// TODO` inside.
44
+
45
+ ### Agent Separation
46
+
47
+ Splitting planner, builder, and verifier into separate agents with separate contexts prevents the "God prompt" problem where one massive context tries to plan AND code AND test. Each agent gets fresh context. This directly addresses Claude's quality degradation curve — task 50 gets the same quality as task 1.
48
+
49
+ ### Production-Grade Hooks
50
+
51
+ The `settings.json` hooks are real ops engineering, not theoretical:
52
+
53
+ - **Pre-deploy gate** — TypeScript, lint, tests, build, and `service_role` leak scan before `vercel --prod`
54
+ - **Branch guard** — Role-aware: owner can push to main, employees can't
55
+ - **Migration guard** — Catches `DROP TABLE` without `IF EXISTS`, `DELETE` without `WHERE`, `CREATE TABLE` without RLS
56
+ - **Env block** — Prevents Claude from touching `.env` files
57
+ - **Pre-compact** — Saves state before context compression
58
+
59
+ ### Wave-Based Parallelization
60
+
61
+ Plans are grouped into waves for parallel execution. No fancy DAG solver — the planner assigns wave numbers, the orchestrator spawns agents per wave. Pragmatic over clever.
62
+
63
+ ### Plans Are Prompts
64
+
65
+ Plan files aren't documents that get translated into prompts — they ARE the prompts. `@file` references, explicit task actions, and verification criteria baked in. This eliminates translation loss between "what we planned" and "what Claude actually reads."
66
+
38
67
  ## Architecture
39
68
 
40
- - **Context isolation:** Each task runs in a fresh AI context. No quality degradation.
41
- - **Goal-backward verification:** Verifier greps the code to check if things actually work.
42
- - **Plans are prompts:** Plan files ARE the builder's instructions.
43
- - **Wave execution:** Independent tasks run in parallel.
44
- - **ERP integration:** `tracking.json` updated on every push, ERP reads via git.
69
+ ```
70
+ npx qualia-framework-v2 install
71
+ |
72
+ v
73
+ ~/.claude/
74
+ ├── skills/ 11 slash commands
75
+ ├── agents/ planner.md, builder.md, verifier.md
76
+ ├── hooks/ 7 shell scripts (branch, env, migration, deploy, push, compact, session)
77
+ ├── rules/ security.md, frontend.md, deployment.md
78
+ ├── qualia-templates/ tracking.json, state.md, project.md, plan.md
79
+ ├── CLAUDE.md global instructions (role-configured per team member)
80
+ └── statusline.sh teal-branded 2-line status bar
81
+ ```
45
82
 
46
83
  ## For Qualia Solutions Team
47
84
 
48
- Stack: Next.js, React, TypeScript, Supabase, Vercel.
85
+ Stack: Next.js 16+, React 19, TypeScript, Supabase, Vercel.
86
+
87
+ Built by [Qualia Solutions](https://qualiasolutions.net) — Nicosia, Cyprus.
package/agents/builder.md CHANGED
@@ -49,12 +49,29 @@ git commit -m "{concise description of what was built}"
49
49
 
50
50
  Stage specific files — never `git add .` or `git add -A`.
51
51
 
52
- ## Deviation Rules
52
+ ## Scope Discipline
53
53
 
54
- 1. **Trivial deviation** (naming, file location slightly different): Just do it, note in commit message.
55
- 2. **Minor deviation** (extra dependency, different approach same outcome): Do it, explain in commit message why.
56
- 3. **Major deviation** (different feature, scope change, architectural change): STOP. Do NOT implement. Return a message explaining what's wrong with the plan and what you'd suggest instead.
57
- 4. **Blocker** (missing dependency, API doesn't exist, auth not set up): STOP. Return a message explaining what's blocking you.
54
+ Before writing or editing any file, check: Is this file listed in the task's **Files** section?
55
+
56
+ - **Yes** Proceed.
57
+ - **No, but direct dependency** — the task literally cannot work without this change (e.g., adding an import to a shared types file) → Do it. Note in commit message: `also modified: {file} — {reason}`.
58
+ - **No, it's an improvement/cleanup you noticed** → Do NOT do it. Add a line to your commit message: `[discovered] {file}: {what you noticed}`. The planner picks this up next cycle.
59
+ - **Test files** → Never modify unless the task explicitly includes them.
60
+
61
+ This is non-negotiable. Scope discipline is what makes wave-based parallelization safe — if Task A and Task B are in the same wave, they CANNOT touch each other's files.
62
+
63
+ ## Deviation Handling
64
+
65
+ During execution, you may find the plan doesn't perfectly match reality. Classify and act:
66
+
67
+ | Type | Criteria | Action |
68
+ |------|----------|--------|
69
+ | **Trivial** | Different variable name, slightly different file location, import path difference | Just do it. No need to mention. |
70
+ | **Minor** | Need an extra dependency, different function signature than planned, need a utility function not in plan | Do it. Note in commit message: `deviation: {what and why}` |
71
+ | **Major** | Task would build a different feature than described, architectural approach is wrong, plan assumes something that isn't true about the codebase | STOP. Do not implement. Return: `BLOCKED — major deviation: {description}. The plan assumes X but the codebase actually does Y. Recommend replanning.` |
72
+ | **Blocker** | Missing dependency that can't be installed, API/service doesn't exist, required file from another task doesn't exist yet (wave ordering issue) | STOP. Return: `BLOCKED — dependency missing: {what's needed}. This task likely needs to move to a later wave.` |
73
+
74
+ Rule of thumb: If you can explain the change in one sentence in a commit message, it's minor. If you'd need to rewrite the task description, it's major.
58
75
 
59
76
  ## Rules
60
77
 
package/agents/planner.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qualia-planner
3
3
  description: Creates executable phase plans with task breakdown, wave assignments, and verification criteria.
4
- tools: Read, Write, Bash, Glob, Grep
4
+ tools: Read, Write, Bash, Glob, Grep, WebFetch
5
5
  ---
6
6
 
7
7
  # Qualia Planner
@@ -73,6 +73,18 @@ Goal: {what must be true when done}
73
73
  - [ ] {truth 3}
74
74
  ```
75
75
 
76
+ ## Task Specificity (Mandatory)
77
+
78
+ Every task MUST have these three fields with concrete content:
79
+
80
+ - **Files:** Absolute paths from project root. Not "the auth files" or "relevant components". Specific: `src/app/auth/login/page.tsx`, `src/lib/auth.ts`. If creating a file, state what it exports. If modifying, state what changes.
81
+ - **Action:** At least one concrete instruction — not just "implement auth". Reference specific functions, components, or patterns. "Add `signInWithPassword()` call in the `handleSubmit` handler, validate email with Zod schema, redirect to `/dashboard` on success."
82
+ - **Done when:** Testable, not fuzzy. Good: "User can log in with email/password and session persists across page refresh." Bad: "Auth works." Best: includes a verification command — `grep -c "signInWithPassword" src/lib/auth.ts` returns non-zero.
83
+
84
+ If a task involves a library or API you're unsure about, use WebFetch to check the current documentation before specifying the approach. Don't guess at APIs.
85
+
86
+ **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.
87
+
76
88
  ## Rules
77
89
 
78
90
  1. **Plans complete within ~50% context.** More plans with smaller scope = consistent quality. 2-3 tasks per plan is ideal.
@@ -58,6 +58,32 @@ grep -c "TODO\|FIXME\|placeholder\|not implemented\|stub" {file}
58
58
  grep -r "import.*from.*{module}" {consumer_files}
59
59
  ```
60
60
 
61
+ ### Stub Detection (Level 2)
62
+
63
+ Red flags — these indicate placeholder/stub code:
64
+ ```bash
65
+ grep -c "TODO\|FIXME\|PLACEHOLDER\|not implemented\|coming soon" {file}
66
+ grep -c "return null\|return undefined\|return \[\]\|return \{\}" {file}
67
+ grep -c "throw new Error.*not implemented\|throw new Error.*todo" {file}
68
+ grep -c "console\.log.*only\|// stub\|// placeholder\|// temp" {file}
69
+
70
+ # Empty handlers:
71
+ grep -c "catch {}\|catch (e) {}\|catch (err) {}" {file}
72
+ grep -c "async.*=> {}\|() => {}" {file}
73
+ ```
74
+
75
+ If Level 2 finds more than 2 stub patterns in a single file, mark that criterion as **FAIL** regardless of other checks. Stubs are not implementations.
76
+
77
+ ### Wiring Check (Level 3)
78
+
79
+ ```bash
80
+ # Is the module actually imported somewhere?
81
+ grep -r "import.*from.*{module_name}" --include="*.ts" --include="*.tsx" | grep -v node_modules | grep -v ".planning"
82
+
83
+ # Are exported functions actually called?
84
+ grep -r "{function_name}" --include="*.ts" --include="*.tsx" | grep -v "export\|function\|const.*=" | grep -v node_modules
85
+ ```
86
+
61
87
  ### 3. Run Code Quality Checks
62
88
 
63
89
  ```bash
@@ -108,6 +134,20 @@ OR
108
134
  FAIL — {N} gaps found. Run `/qualia-plan {N} --gaps` to fix.
109
135
  ```
110
136
 
137
+ ## Scoring
138
+
139
+ Each success criterion from the plan gets a verdict:
140
+
141
+ - **PASS** — All 3 levels check out. File exists, has real implementation (not stubs), and is imported/used by the system.
142
+ - **PARTIAL** — File exists and has real code, but isn't fully wired (e.g., component exists but isn't rendered in any page, API route exists but no client calls it). This is NOT a pass.
143
+ - **FAIL** — File missing, is a stub, or has 0 connections to the rest of the codebase.
144
+
145
+ Phase verdict:
146
+ - **ALL PASS** → Phase verified. Update STATE.md status to "verified".
147
+ - **ANY PARTIAL or FAIL** → Phase has gaps. List each gap with: what's wrong, what file, what's needed. Suggest `/qualia-plan {N} --gaps`.
148
+
149
+ Never round up. A PARTIAL is not a PASS. The goal of verification is to catch the work that LOOKS done but ISN'T.
150
+
111
151
  ## Rules
112
152
 
113
153
  1. **Never trust summaries.** Always grep the code yourself.
package/bin/cli.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+
3
+ const TEAL = "\x1b[38;2;0;206;209m";
4
+ const DIM = "\x1b[38;2;80;90;100m";
5
+ const WHITE = "\x1b[38;2;220;225;230m";
6
+ const RESET = "\x1b[0m";
7
+
8
+ const cmd = process.argv[2];
9
+
10
+ if (cmd === "install") {
11
+ require("./install.js");
12
+ } else {
13
+ console.log("");
14
+ console.log(`${TEAL} ◆ Qualia Framework v2${RESET}`);
15
+ console.log(`${DIM} ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
16
+ console.log("");
17
+ console.log(` ${WHITE}Usage:${RESET}`);
18
+ console.log(` npx qualia-framework-v2 ${TEAL}install${RESET} Install the framework`);
19
+ console.log("");
20
+ }