qualia-framework-v2 2.3.0 → 2.4.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/README.md +10 -2
- package/bin/cli.js +135 -7
- package/bin/install.js +32 -1
- package/package.json +1 -1
- package/skills/qualia-learn/SKILL.md +84 -0
package/README.md
CHANGED
|
@@ -12,6 +12,12 @@ npx qualia-framework-v2 install
|
|
|
12
12
|
|
|
13
13
|
Enter your team code when prompted. Get your code from Fawzi.
|
|
14
14
|
|
|
15
|
+
**Other commands:**
|
|
16
|
+
```bash
|
|
17
|
+
npx qualia-framework-v2 version # Check installed version + updates
|
|
18
|
+
npx qualia-framework-v2 update # Update to latest (remembers your code)
|
|
19
|
+
```
|
|
20
|
+
|
|
15
21
|
## Usage
|
|
16
22
|
|
|
17
23
|
Open Claude Code in any project directory:
|
|
@@ -33,6 +39,7 @@ Open Claude Code in any project directory:
|
|
|
33
39
|
/qualia-handoff # Deliver to client
|
|
34
40
|
/qualia-pause # Save session, continue later
|
|
35
41
|
/qualia-resume # Pick up where you left off
|
|
42
|
+
/qualia-learn # Save a pattern, fix, or client pref
|
|
36
43
|
/qualia-report # Log your work (mandatory)
|
|
37
44
|
```
|
|
38
45
|
|
|
@@ -40,7 +47,7 @@ See `guide.md` for the full developer guide.
|
|
|
40
47
|
|
|
41
48
|
## What's Inside
|
|
42
49
|
|
|
43
|
-
- **
|
|
50
|
+
- **18 skills** — slash commands from setup to handoff, plus debugging, design, review, knowledge, and session management
|
|
44
51
|
- **3 agents** — planner, builder, verifier (each in fresh context)
|
|
45
52
|
- **7 hooks** — branch guard, pre-push tracking sync, env protection, migration guard, deploy gate, pre-compact state save, session start
|
|
46
53
|
- **3 rules** — security, frontend, deployment
|
|
@@ -85,10 +92,11 @@ npx qualia-framework-v2 install
|
|
|
85
92
|
|
|
|
86
93
|
v
|
|
87
94
|
~/.claude/
|
|
88
|
-
├── skills/
|
|
95
|
+
├── skills/ 18 slash commands
|
|
89
96
|
├── agents/ planner.md, builder.md, verifier.md
|
|
90
97
|
├── hooks/ 7 shell scripts (branch, env, migration, deploy, push, compact, session)
|
|
91
98
|
├── bin/ state.js (state machine with precondition enforcement)
|
|
99
|
+
├── knowledge/ learned-patterns.md, common-fixes.md, client-prefs.md
|
|
92
100
|
├── rules/ security.md, frontend.md, deployment.md
|
|
93
101
|
├── qualia-templates/ tracking.json, state.md, project.md, plan.md
|
|
94
102
|
├── CLAUDE.md global instructions (role-configured per team member)
|
package/bin/cli.js
CHANGED
|
@@ -1,20 +1,148 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const { execSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
3
7
|
const TEAL = "\x1b[38;2;0;206;209m";
|
|
8
|
+
const TG = "\x1b[38;2;0;170;175m";
|
|
4
9
|
const DIM = "\x1b[38;2;80;90;100m";
|
|
10
|
+
const GREEN = "\x1b[38;2;52;211;153m";
|
|
5
11
|
const WHITE = "\x1b[38;2;220;225;230m";
|
|
12
|
+
const YELLOW = "\x1b[38;2;234;179;8m";
|
|
13
|
+
const RED = "\x1b[38;2;239;68;68m";
|
|
6
14
|
const RESET = "\x1b[0m";
|
|
15
|
+
const BOLD = "\x1b[1m";
|
|
7
16
|
|
|
8
|
-
const
|
|
17
|
+
const CLAUDE_DIR = path.join(require("os").homedir(), ".claude");
|
|
18
|
+
const PKG = require("../package.json");
|
|
19
|
+
const CONFIG_FILE = path.join(CLAUDE_DIR, ".qualia-config.json");
|
|
20
|
+
|
|
21
|
+
function readConfig() {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(fs.readFileSync(CONFIG_FILE, "utf8"));
|
|
24
|
+
} catch {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function writeConfig(cfg) {
|
|
30
|
+
if (!fs.existsSync(CLAUDE_DIR)) fs.mkdirSync(CLAUDE_DIR, { recursive: true });
|
|
31
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify(cfg, null, 2) + "\n");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function banner() {
|
|
35
|
+
console.log("");
|
|
36
|
+
console.log(` ${TEAL}${BOLD}◆${RESET} ${WHITE}${BOLD}Qualia Framework${RESET} ${DIM}v${PKG.version}${RESET}`);
|
|
37
|
+
console.log(` ${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
|
|
38
|
+
}
|
|
9
39
|
|
|
10
|
-
|
|
40
|
+
// ─── Commands ────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
function cmdInstall() {
|
|
11
43
|
require("./install.js");
|
|
12
|
-
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function cmdVersion() {
|
|
47
|
+
banner();
|
|
48
|
+
const cfg = readConfig();
|
|
49
|
+
|
|
50
|
+
console.log(` ${DIM}Installed:${RESET} ${WHITE}${PKG.version}${RESET}`);
|
|
51
|
+
if (cfg.installed_by) {
|
|
52
|
+
console.log(` ${DIM}User:${RESET} ${WHITE}${cfg.installed_by}${RESET} ${DIM}(${cfg.role})${RESET}`);
|
|
53
|
+
}
|
|
54
|
+
if (cfg.installed_at) {
|
|
55
|
+
console.log(` ${DIM}Date:${RESET} ${WHITE}${cfg.installed_at}${RESET}`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Check for updates
|
|
59
|
+
try {
|
|
60
|
+
const latest = execSync("npm view qualia-framework-v2 version 2>/dev/null", {
|
|
61
|
+
encoding: "utf8",
|
|
62
|
+
timeout: 5000,
|
|
63
|
+
}).trim();
|
|
64
|
+
const semverGt = (a, b) => {
|
|
65
|
+
const pa = a.split(".").map(Number), pb = b.split(".").map(Number);
|
|
66
|
+
for (let i = 0; i < 3; i++) { if (pa[i] > pb[i]) return true; if (pa[i] < pb[i]) return false; }
|
|
67
|
+
return false;
|
|
68
|
+
};
|
|
69
|
+
if (latest && semverGt(latest, PKG.version)) {
|
|
70
|
+
console.log("");
|
|
71
|
+
console.log(` ${YELLOW}Update available:${RESET} ${WHITE}${latest}${RESET}`);
|
|
72
|
+
console.log(` ${DIM}Run:${RESET} npx qualia-framework-v2 update`);
|
|
73
|
+
} else if (latest) {
|
|
74
|
+
console.log(` ${DIM}Latest:${RESET} ${GREEN}${latest} ✓${RESET} ${DIM}(up to date)${RESET}`);
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
console.log(` ${DIM}Latest:${RESET} ${DIM}(offline — couldn't check)${RESET}`);
|
|
78
|
+
}
|
|
13
79
|
console.log("");
|
|
14
|
-
|
|
15
|
-
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function cmdUpdate() {
|
|
83
|
+
banner();
|
|
84
|
+
const cfg = readConfig();
|
|
85
|
+
|
|
86
|
+
if (!cfg.code) {
|
|
87
|
+
console.log(` ${RED}✗${RESET} No install code saved. Run ${TEAL}install${RESET} first.`);
|
|
88
|
+
console.log("");
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log(` ${DIM}Current:${RESET} ${WHITE}${PKG.version}${RESET}`);
|
|
93
|
+
console.log(` ${DIM}Updating...${RESET}`);
|
|
16
94
|
console.log("");
|
|
17
|
-
|
|
18
|
-
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
// Pull latest and reinstall with saved code
|
|
98
|
+
execSync(
|
|
99
|
+
`npx qualia-framework-v2@latest install <<< "${cfg.code}"`,
|
|
100
|
+
{ stdio: "inherit", shell: true, timeout: 60000 }
|
|
101
|
+
);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
console.log(` ${RED}✗${RESET} Update failed. Run manually: npx qualia-framework-v2@latest install`);
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function cmdHelp() {
|
|
109
|
+
banner();
|
|
19
110
|
console.log("");
|
|
111
|
+
console.log(` ${WHITE}Commands:${RESET}`);
|
|
112
|
+
console.log(` npx qualia-framework-v2 ${TEAL}install${RESET} Install or reinstall the framework`);
|
|
113
|
+
console.log(` npx qualia-framework-v2 ${TEAL}update${RESET} Update to the latest version`);
|
|
114
|
+
console.log(` npx qualia-framework-v2 ${TEAL}version${RESET} Show installed version + check for updates`);
|
|
115
|
+
console.log("");
|
|
116
|
+
console.log(` ${WHITE}After install:${RESET}`);
|
|
117
|
+
console.log(` ${TG}/qualia${RESET} What should I do next?`);
|
|
118
|
+
console.log(` ${TG}/qualia-new${RESET} Set up a new project`);
|
|
119
|
+
console.log(` ${TG}/qualia-plan${RESET} Plan a phase`);
|
|
120
|
+
console.log(` ${TG}/qualia-build${RESET} Build it (parallel tasks)`);
|
|
121
|
+
console.log(` ${TG}/qualia-verify${RESET} Verify it works`);
|
|
122
|
+
console.log(` ${TG}/qualia-design${RESET} One-shot design fix`);
|
|
123
|
+
console.log(` ${TG}/qualia-debug${RESET} Structured debugging`);
|
|
124
|
+
console.log(` ${TG}/qualia-review${RESET} Production audit`);
|
|
125
|
+
console.log(` ${TG}/qualia-ship${RESET} Deploy to production`);
|
|
126
|
+
console.log(` ${TG}/qualia-report${RESET} Log your work`);
|
|
127
|
+
console.log("");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ─── Main ────────────────────────────────────────────────
|
|
131
|
+
const cmd = process.argv[2];
|
|
132
|
+
|
|
133
|
+
switch (cmd) {
|
|
134
|
+
case "install":
|
|
135
|
+
cmdInstall();
|
|
136
|
+
break;
|
|
137
|
+
case "version":
|
|
138
|
+
case "-v":
|
|
139
|
+
case "--version":
|
|
140
|
+
cmdVersion();
|
|
141
|
+
break;
|
|
142
|
+
case "update":
|
|
143
|
+
case "upgrade":
|
|
144
|
+
cmdUpdate();
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
cmdHelp();
|
|
20
148
|
}
|
package/bin/install.js
CHANGED
|
@@ -223,6 +223,36 @@ async function main() {
|
|
|
223
223
|
warn(`guide.md — ${e.message}`);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
// ─── Knowledge directory ─────────────────────────────────
|
|
227
|
+
log(`${WHITE}Knowledge${RESET}`);
|
|
228
|
+
const knowledgeDir = path.join(CLAUDE_DIR, "knowledge");
|
|
229
|
+
if (!fs.existsSync(knowledgeDir)) fs.mkdirSync(knowledgeDir, { recursive: true });
|
|
230
|
+
const knowledgeFiles = {
|
|
231
|
+
"learned-patterns.md": "# Learned Patterns\n\nPatterns discovered across projects. Updated by `/qualia-evolve` and manual notes.\n",
|
|
232
|
+
"common-fixes.md": "# Common Fixes\n\nRecurring issues and their solutions.\n",
|
|
233
|
+
"client-prefs.md": "# Client Preferences\n\nClient-specific preferences, design choices, and requirements.\n",
|
|
234
|
+
};
|
|
235
|
+
for (const [name, defaultContent] of Object.entries(knowledgeFiles)) {
|
|
236
|
+
const dest = path.join(knowledgeDir, name);
|
|
237
|
+
if (!fs.existsSync(dest)) {
|
|
238
|
+
fs.writeFileSync(dest, defaultContent);
|
|
239
|
+
ok(`${name} (created)`);
|
|
240
|
+
} else {
|
|
241
|
+
ok(`${name} (exists)`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ─── Save config (for update command) ──────────────────
|
|
246
|
+
const configFile = path.join(CLAUDE_DIR, ".qualia-config.json");
|
|
247
|
+
const config = {
|
|
248
|
+
code,
|
|
249
|
+
installed_by: member.name,
|
|
250
|
+
role: member.role,
|
|
251
|
+
version: require("../package.json").version,
|
|
252
|
+
installed_at: new Date().toISOString().split("T")[0],
|
|
253
|
+
};
|
|
254
|
+
fs.writeFileSync(configFile, JSON.stringify(config, null, 2) + "\n");
|
|
255
|
+
|
|
226
256
|
// ─── Configure settings.json ───────────────────────────
|
|
227
257
|
console.log("");
|
|
228
258
|
log(`${WHITE}Configuring settings.json...${RESET}`);
|
|
@@ -397,7 +427,8 @@ async function main() {
|
|
|
397
427
|
console.log(` Agents: ${WHITE}3${RESET} ${DIM}(planner, builder, verifier)${RESET}`);
|
|
398
428
|
console.log(` Hooks: ${WHITE}6${RESET} ${DIM}(branch-guard, pre-push, env-block, migration-guard, deploy-gate, pre-compact)${RESET}`);
|
|
399
429
|
console.log(` Rules: ${WHITE}3${RESET} ${DIM}(security, frontend, deployment)${RESET}`);
|
|
400
|
-
console.log(` Scripts: ${WHITE}1${RESET} ${DIM}(state.js)${RESET}`);
|
|
430
|
+
console.log(` Scripts: ${WHITE}1${RESET} ${DIM}(state.js — state machine)${RESET}`);
|
|
431
|
+
console.log(` Knowledge: ${WHITE}3${RESET} ${DIM}(patterns, fixes, client prefs)${RESET}`);
|
|
401
432
|
console.log(` Templates: ${WHITE}4${RESET}`);
|
|
402
433
|
console.log(` Status line: ${GREEN}✓${RESET}`);
|
|
403
434
|
console.log(` CLAUDE.md: ${GREEN}✓${RESET} ${DIM}(${member.role})${RESET}`);
|
package/package.json
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qualia-learn
|
|
3
|
+
description: "Save a learning, pattern, fix, or client preference to the knowledge base. Persists across projects and sessions. Trigger on 'remember this', 'save this pattern', 'learned something', 'note for future', 'client prefers', 'qualia-learn'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /qualia-learn — Save Knowledge
|
|
7
|
+
|
|
8
|
+
Persist learnings across projects and sessions. Saved to `~/.claude/knowledge/`.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
- `/qualia-learn` — Interactively save a learning
|
|
13
|
+
- `/qualia-learn {description}` — Save directly
|
|
14
|
+
|
|
15
|
+
## Knowledge Types
|
|
16
|
+
|
|
17
|
+
### Patterns (`learned-patterns.md`)
|
|
18
|
+
Recurring approaches that work (or don't). Architecture decisions, library choices, prompt patterns.
|
|
19
|
+
|
|
20
|
+
**Example:** "Supabase RLS policies need to be added in the same migration as the table — adding them later causes a window where data is unprotected."
|
|
21
|
+
|
|
22
|
+
### Fixes (`common-fixes.md`)
|
|
23
|
+
Problems you've solved before. Error messages and their solutions.
|
|
24
|
+
|
|
25
|
+
**Example:** "`next/font` crash on Vercel: caused by importing font in a client component that's also used server-side. Fix: move font import to layout.tsx."
|
|
26
|
+
|
|
27
|
+
### Client Prefs (`client-prefs.md`)
|
|
28
|
+
Client-specific preferences, design choices, requirements.
|
|
29
|
+
|
|
30
|
+
**Example:** "Acme Corp: prefers dark mode, hates rounded corners, logo must be SVG not PNG, primary color #FF6B00."
|
|
31
|
+
|
|
32
|
+
## Process
|
|
33
|
+
|
|
34
|
+
### 1. Classify
|
|
35
|
+
|
|
36
|
+
If description given, classify automatically. Otherwise ask:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
What did you learn?
|
|
40
|
+
1. Pattern — approach that works (or doesn't)
|
|
41
|
+
2. Fix — problem and its solution
|
|
42
|
+
3. Client preference — client-specific requirement
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Format Entry
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
### {Title} ({date})
|
|
49
|
+
**Project:** {current project name or "general"}
|
|
50
|
+
**Context:** {brief context — what you were building when you learned this}
|
|
51
|
+
|
|
52
|
+
{The learning — be specific enough that future-you understands without context}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Append to Knowledge File
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Append to the right file
|
|
59
|
+
echo "{formatted entry}" >> ~/.claude/knowledge/{type}.md
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- Pattern → `~/.claude/knowledge/learned-patterns.md`
|
|
63
|
+
- Fix → `~/.claude/knowledge/common-fixes.md`
|
|
64
|
+
- Client pref → `~/.claude/knowledge/client-prefs.md`
|
|
65
|
+
|
|
66
|
+
### 4. Confirm
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
◆ Saved to {file}
|
|
70
|
+
"{title}"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Reading Knowledge
|
|
74
|
+
|
|
75
|
+
Skills can read knowledge files for context:
|
|
76
|
+
```bash
|
|
77
|
+
cat ~/.claude/knowledge/learned-patterns.md 2>/dev/null
|
|
78
|
+
cat ~/.claude/knowledge/common-fixes.md 2>/dev/null
|
|
79
|
+
cat ~/.claude/knowledge/client-prefs.md 2>/dev/null
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The `/qualia-debug` skill should check `common-fixes.md` before investigating.
|
|
83
|
+
The `/qualia-new` skill should check `client-prefs.md` when setting up client projects.
|
|
84
|
+
The `/qualia-plan` skill should check `learned-patterns.md` when planning phases.
|