qualia-framework-v2 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.
- package/CLAUDE.md +63 -0
- package/README.md +48 -0
- package/agents/builder.md +75 -0
- package/agents/planner.md +102 -0
- package/agents/verifier.md +118 -0
- package/bin/install.js +248 -0
- package/guide.md +63 -0
- package/hooks/block-env-edit.sh +8 -0
- package/hooks/branch-guard.sh +13 -0
- package/hooks/pre-compact.sh +11 -0
- package/hooks/pre-deploy-gate.sh +32 -0
- package/hooks/pre-push.sh +29 -0
- package/hooks/session-start.sh +17 -0
- package/install.sh +223 -0
- package/package.json +40 -0
- package/rules/deployment.md +30 -0
- package/rules/frontend.md +33 -0
- package/rules/security.md +12 -0
- package/skills/qualia/SKILL.md +54 -0
- package/skills/qualia-build/SKILL.md +93 -0
- package/skills/qualia-handoff/SKILL.md +68 -0
- package/skills/qualia-new/SKILL.md +282 -0
- package/skills/qualia-plan/SKILL.md +84 -0
- package/skills/qualia-polish/SKILL.md +57 -0
- package/skills/qualia-quick/SKILL.md +25 -0
- package/skills/qualia-report/SKILL.md +74 -0
- package/skills/qualia-ship/SKILL.md +91 -0
- package/skills/qualia-verify/SKILL.md +79 -0
- package/statusline.sh +93 -0
- package/templates/plan.md +28 -0
- package/templates/project.md +22 -0
- package/templates/state.md +27 -0
- package/templates/tracking.json +19 -0
package/guide.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Qualia Developer Guide
|
|
2
|
+
|
|
3
|
+
> Follow the road. Type the commands. The framework handles the rest.
|
|
4
|
+
|
|
5
|
+
## The Road
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/qualia-new ← Set up project (once)
|
|
9
|
+
↓
|
|
10
|
+
For each phase:
|
|
11
|
+
/qualia-plan ← Plan it (planner agent)
|
|
12
|
+
/qualia-build ← Build it (builder subagents)
|
|
13
|
+
/qualia-verify ← Verify it works (verifier agent)
|
|
14
|
+
↓
|
|
15
|
+
/qualia-polish ← Design pass
|
|
16
|
+
/qualia-ship ← Deploy to production
|
|
17
|
+
/qualia-handoff ← Deliver to client
|
|
18
|
+
↓
|
|
19
|
+
Done.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## The 10 Commands
|
|
23
|
+
|
|
24
|
+
| When | Command | What it does |
|
|
25
|
+
|------|---------|-------------|
|
|
26
|
+
| Starting | `/qualia-new` | Set up project from scratch |
|
|
27
|
+
| Building | `/qualia-plan` | Plan the current phase |
|
|
28
|
+
| | `/qualia-build` | Build it (parallel tasks) |
|
|
29
|
+
| | `/qualia-verify` | Check it actually works |
|
|
30
|
+
| Quick fix | `/qualia-quick` | Skip planning, just do it |
|
|
31
|
+
| Finishing | `/qualia-polish` | Design and UX pass |
|
|
32
|
+
| | `/qualia-ship` | Deploy to production |
|
|
33
|
+
| | `/qualia-handoff` | Deliver to client |
|
|
34
|
+
| Reporting | `/qualia-report` | Log what you did (mandatory) |
|
|
35
|
+
| **Lost?** | **`/qualia`** | **Tells you the exact next command** |
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
1. **Feature branches only** — never push to main
|
|
40
|
+
2. **Read before write** — don't edit files you haven't read
|
|
41
|
+
3. **MVP first** — build what's asked, nothing extra
|
|
42
|
+
4. **`/qualia` is your friend** — lost? type it
|
|
43
|
+
|
|
44
|
+
## When You're Stuck
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
/qualia ← "what's next?"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If that doesn't help, paste the error and ask Claude directly. If Claude can't fix it, tell Fawzi.
|
|
51
|
+
|
|
52
|
+
## Session Start / End
|
|
53
|
+
|
|
54
|
+
**Start:** Claude loads your project context automatically.
|
|
55
|
+
**End:** Run `/qualia-report` — this is mandatory before clock-out.
|
|
56
|
+
|
|
57
|
+
## How It Works (you don't need to know this, but if curious)
|
|
58
|
+
|
|
59
|
+
- **Context isolation:** Each task runs in a fresh AI brain. Task 50 gets the same quality as Task 1.
|
|
60
|
+
- **Goal-backward verification:** The verifier doesn't trust "I built it." It greps the code to check if things actually work.
|
|
61
|
+
- **Plans are prompts:** The plan file IS what the builder reads. No translation loss.
|
|
62
|
+
- **Wave execution:** Independent tasks run in parallel. Dependent tasks wait.
|
|
63
|
+
- **tracking.json:** Updated on every push. The ERP reads it automatically.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Prevent Claude from editing .env files
|
|
3
|
+
|
|
4
|
+
FILE="$1"
|
|
5
|
+
if [[ "$FILE" == *.env* ]] || [[ "$FILE" == *".env.local"* ]] || [[ "$FILE" == *".env.production"* ]]; then
|
|
6
|
+
echo "BLOCKED: Cannot edit environment files. Ask Fawzi to update secrets."
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Block non-OWNER push to main/master
|
|
3
|
+
|
|
4
|
+
BRANCH=$(git branch --show-current 2>/dev/null)
|
|
5
|
+
ROLE=$(grep -m1 "^## Role:" ~/.claude/CLAUDE.md 2>/dev/null | sed 's/^## Role: *//')
|
|
6
|
+
|
|
7
|
+
if [[ "$BRANCH" == "main" || "$BRANCH" == "master" ]]; then
|
|
8
|
+
if [[ "$ROLE" != "OWNER" ]]; then
|
|
9
|
+
echo "BLOCKED: Employees cannot push to $BRANCH. Create a feature branch first."
|
|
10
|
+
echo "Run: git checkout -b feature/your-feature-name"
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Save state before context compression
|
|
3
|
+
|
|
4
|
+
if [ -f ".planning/STATE.md" ]; then
|
|
5
|
+
echo "QUALIA: Saving state before compaction..."
|
|
6
|
+
# State is in git — just ensure it's committed
|
|
7
|
+
if git diff --name-only .planning/STATE.md 2>/dev/null | grep -q STATE; then
|
|
8
|
+
git add .planning/STATE.md
|
|
9
|
+
git commit -m "state: pre-compaction save" 2>/dev/null
|
|
10
|
+
fi
|
|
11
|
+
fi
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Quality gates before production deploy
|
|
3
|
+
|
|
4
|
+
echo "◆ Pre-deploy gate..."
|
|
5
|
+
|
|
6
|
+
# TypeScript check
|
|
7
|
+
if [ -f "tsconfig.json" ]; then
|
|
8
|
+
if ! npx tsc --noEmit 2>/dev/null; then
|
|
9
|
+
echo "BLOCKED: TypeScript errors. Fix before deploying."
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
echo " ✓ TypeScript"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# Build check
|
|
16
|
+
if [ -f "package.json" ] && grep -q '"build"' package.json; then
|
|
17
|
+
if ! npm run build 2>/dev/null; then
|
|
18
|
+
echo "BLOCKED: Build failed. Fix before deploying."
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
echo " ✓ Build"
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Security: no service_role in client code
|
|
25
|
+
LEAKS=$(grep -r "service_role" app/ components/ src/ 2>/dev/null | grep -v node_modules | grep -v ".server." | wc -l)
|
|
26
|
+
if [ "$LEAKS" -gt 0 ]; then
|
|
27
|
+
echo "BLOCKED: service_role found in client code. Remove before deploying."
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
echo " ✓ Security"
|
|
31
|
+
|
|
32
|
+
echo "◆ All gates passed."
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Update tracking.json from STATE.md before push
|
|
3
|
+
|
|
4
|
+
TRACKING=".planning/tracking.json"
|
|
5
|
+
STATE=".planning/STATE.md"
|
|
6
|
+
|
|
7
|
+
if [ -f "$STATE" ] && [ -f "$TRACKING" ]; then
|
|
8
|
+
# Extract current phase from STATE.md
|
|
9
|
+
PHASE=$(grep "^Phase:" "$STATE" | head -1 | sed 's/Phase: *//' | cut -d' ' -f1)
|
|
10
|
+
STATUS=$(grep "^Status:" "$STATE" | head -1 | sed 's/Status: *//')
|
|
11
|
+
LAST_COMMIT=$(git log --oneline -1 --format="%h" 2>/dev/null)
|
|
12
|
+
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
13
|
+
|
|
14
|
+
# Update tracking.json with current values
|
|
15
|
+
if command -v python3 &>/dev/null; then
|
|
16
|
+
python3 -c "
|
|
17
|
+
import json
|
|
18
|
+
with open('$TRACKING', 'r') as f:
|
|
19
|
+
t = json.load(f)
|
|
20
|
+
t['phase'] = int('${PHASE:-0}') if '${PHASE:-0}'.isdigit() else t.get('phase', 0)
|
|
21
|
+
t['status'] = '${STATUS:-unknown}'.lower().replace(' ', '_')
|
|
22
|
+
t['last_commit'] = '${LAST_COMMIT}'
|
|
23
|
+
t['last_updated'] = '${NOW}'
|
|
24
|
+
with open('$TRACKING', 'w') as f:
|
|
25
|
+
json.dump(t, f, indent=2)
|
|
26
|
+
" 2>/dev/null
|
|
27
|
+
git add "$TRACKING" 2>/dev/null
|
|
28
|
+
fi
|
|
29
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Qualia session start — load project context
|
|
3
|
+
# Triggered on Claude Code session start
|
|
4
|
+
|
|
5
|
+
STATE=".planning/STATE.md"
|
|
6
|
+
TRACKING=".planning/tracking.json"
|
|
7
|
+
|
|
8
|
+
if [ -f "$STATE" ]; then
|
|
9
|
+
PHASE=$(grep "^Phase:" "$STATE" 2>/dev/null | head -1)
|
|
10
|
+
STATUS=$(grep "^Status:" "$STATE" 2>/dev/null | head -1)
|
|
11
|
+
echo "QUALIA: Project loaded. $PHASE | $STATUS"
|
|
12
|
+
echo "QUALIA: Run /qualia for next step."
|
|
13
|
+
elif [ -f ".continue-here.md" ]; then
|
|
14
|
+
echo "QUALIA: Handoff file found. Read .continue-here.md to resume."
|
|
15
|
+
else
|
|
16
|
+
echo "QUALIA: No project detected. Run /qualia-new to start."
|
|
17
|
+
fi
|
package/install.sh
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Qualia Framework v2 — Installer
|
|
3
|
+
# Installs skills, agents, rules, hooks, templates, status line, and configures settings.json
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
FRAMEWORK_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
+
CLAUDE_DIR="$HOME/.claude"
|
|
9
|
+
|
|
10
|
+
echo "◆ Qualia Framework v2"
|
|
11
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
12
|
+
echo " Installing to $CLAUDE_DIR"
|
|
13
|
+
echo ""
|
|
14
|
+
|
|
15
|
+
# Skills
|
|
16
|
+
echo " Installing skills..."
|
|
17
|
+
for skill_dir in "$FRAMEWORK_DIR"/skills/*/; do
|
|
18
|
+
skill_name=$(basename "$skill_dir")
|
|
19
|
+
mkdir -p "$CLAUDE_DIR/skills/$skill_name"
|
|
20
|
+
cp "$skill_dir/SKILL.md" "$CLAUDE_DIR/skills/$skill_name/SKILL.md"
|
|
21
|
+
echo " ✓ $skill_name"
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
# Agents
|
|
25
|
+
echo " Installing agents..."
|
|
26
|
+
mkdir -p "$CLAUDE_DIR/agents"
|
|
27
|
+
for agent in "$FRAMEWORK_DIR"/agents/*.md; do
|
|
28
|
+
cp "$agent" "$CLAUDE_DIR/agents/"
|
|
29
|
+
echo " ✓ $(basename "$agent")"
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
# Rules
|
|
33
|
+
echo " Installing rules..."
|
|
34
|
+
mkdir -p "$CLAUDE_DIR/rules"
|
|
35
|
+
for rule in "$FRAMEWORK_DIR"/rules/*.md; do
|
|
36
|
+
cp "$rule" "$CLAUDE_DIR/rules/"
|
|
37
|
+
echo " ✓ $(basename "$rule")"
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
# Hook scripts
|
|
41
|
+
echo " Installing hook scripts..."
|
|
42
|
+
mkdir -p "$CLAUDE_DIR/hooks"
|
|
43
|
+
for hook in "$FRAMEWORK_DIR"/hooks/*.sh; do
|
|
44
|
+
cp "$hook" "$CLAUDE_DIR/hooks/"
|
|
45
|
+
chmod +x "$CLAUDE_DIR/hooks/$(basename "$hook")"
|
|
46
|
+
echo " ✓ $(basename "$hook")"
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
# Status line
|
|
50
|
+
echo " Installing status line..."
|
|
51
|
+
cp "$FRAMEWORK_DIR/statusline.sh" "$CLAUDE_DIR/statusline.sh"
|
|
52
|
+
chmod +x "$CLAUDE_DIR/statusline.sh"
|
|
53
|
+
echo " ✓ statusline.sh"
|
|
54
|
+
|
|
55
|
+
# Templates
|
|
56
|
+
echo " Installing templates..."
|
|
57
|
+
mkdir -p "$CLAUDE_DIR/qualia-templates"
|
|
58
|
+
for tmpl in "$FRAMEWORK_DIR"/templates/*; do
|
|
59
|
+
cp "$tmpl" "$CLAUDE_DIR/qualia-templates/"
|
|
60
|
+
echo " ✓ $(basename "$tmpl")"
|
|
61
|
+
done
|
|
62
|
+
|
|
63
|
+
# CLAUDE.md (user-level — applies to all projects)
|
|
64
|
+
echo " Installing CLAUDE.md..."
|
|
65
|
+
cp "$FRAMEWORK_DIR/CLAUDE.md" "$CLAUDE_DIR/CLAUDE.md"
|
|
66
|
+
echo " ✓ CLAUDE.md"
|
|
67
|
+
|
|
68
|
+
# Guide
|
|
69
|
+
cp "$FRAMEWORK_DIR/guide.md" "$CLAUDE_DIR/qualia-guide.md"
|
|
70
|
+
echo " ✓ guide.md"
|
|
71
|
+
|
|
72
|
+
# Configure settings.json with hooks, status line, and env
|
|
73
|
+
echo ""
|
|
74
|
+
echo " Configuring settings.json..."
|
|
75
|
+
|
|
76
|
+
python3 << 'PYEOF'
|
|
77
|
+
import json, os
|
|
78
|
+
|
|
79
|
+
settings_path = os.path.expanduser("~/.claude/settings.json")
|
|
80
|
+
|
|
81
|
+
# Load existing settings or start fresh
|
|
82
|
+
if os.path.exists(settings_path):
|
|
83
|
+
with open(settings_path) as f:
|
|
84
|
+
settings = json.load(f)
|
|
85
|
+
else:
|
|
86
|
+
settings = {}
|
|
87
|
+
|
|
88
|
+
# Env vars
|
|
89
|
+
settings.setdefault("env", {})
|
|
90
|
+
settings["env"].update({
|
|
91
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
|
|
92
|
+
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "0",
|
|
93
|
+
"MAX_MCP_OUTPUT_TOKENS": "25000",
|
|
94
|
+
"CLAUDE_CODE_NO_FLICKER": "1"
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
# Status line — teal branded, 2-line
|
|
98
|
+
settings["statusLine"] = {
|
|
99
|
+
"type": "command",
|
|
100
|
+
"command": "~/.claude/statusline.sh"
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# Spinner verbs — Qualia branded
|
|
104
|
+
settings["spinnerVerbs"] = {
|
|
105
|
+
"mode": "replace",
|
|
106
|
+
"verbs": [
|
|
107
|
+
"Qualia-fying", "Solution-ing", "Teal-crafting", "Vibe-forging",
|
|
108
|
+
"Shipping", "Wiring", "Polishing", "Verifying",
|
|
109
|
+
"Orchestrating", "Architecting", "Deploying", "Hardening"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
# Spinner tips — Qualia tips
|
|
114
|
+
settings["spinnerTipsOverride"] = {
|
|
115
|
+
"excludeDefault": True,
|
|
116
|
+
"tips": [
|
|
117
|
+
"◆ Lost? Type /qualia for the next step",
|
|
118
|
+
"◆ Small fix? Use /qualia-quick to skip planning",
|
|
119
|
+
"◆ End of day? /qualia-report before you clock out",
|
|
120
|
+
"◆ Context isolation: every task gets a fresh AI brain",
|
|
121
|
+
"◆ The verifier doesn't trust claims — it greps the code",
|
|
122
|
+
"◆ Plans are prompts — the plan IS what the builder reads",
|
|
123
|
+
"◆ Feature branches only — never push to main",
|
|
124
|
+
"◆ Read before write — no exceptions",
|
|
125
|
+
"◆ MVP first — build what's asked, nothing extra",
|
|
126
|
+
"◆ tracking.json syncs to ERP on every push"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Hooks
|
|
131
|
+
hooks_dir = os.path.expanduser("~/.claude/hooks")
|
|
132
|
+
settings["hooks"] = {
|
|
133
|
+
"PreToolUse": [
|
|
134
|
+
{
|
|
135
|
+
"matcher": "Bash",
|
|
136
|
+
"hooks": [{
|
|
137
|
+
"type": "command",
|
|
138
|
+
"if": "Bash(git push*)",
|
|
139
|
+
"command": f"{hooks_dir}/branch-guard.sh",
|
|
140
|
+
"timeout": 10,
|
|
141
|
+
"statusMessage": "◆ Checking branch permissions..."
|
|
142
|
+
}]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"matcher": "Edit|Write",
|
|
146
|
+
"hooks": [{
|
|
147
|
+
"type": "command",
|
|
148
|
+
"if": "Edit(*.env*)",
|
|
149
|
+
"command": f"{hooks_dir}/block-env-edit.sh",
|
|
150
|
+
"timeout": 5,
|
|
151
|
+
"statusMessage": "◆ Checking file permissions..."
|
|
152
|
+
}]
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"PostToolUse": [
|
|
156
|
+
{
|
|
157
|
+
"matcher": "Bash",
|
|
158
|
+
"hooks": [{
|
|
159
|
+
"type": "command",
|
|
160
|
+
"if": "Bash(vercel --prod*)",
|
|
161
|
+
"command": f"{hooks_dir}/pre-deploy-gate.sh",
|
|
162
|
+
"timeout": 120,
|
|
163
|
+
"statusMessage": "◆ Running quality gates..."
|
|
164
|
+
}]
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"PreCompact": [
|
|
168
|
+
{
|
|
169
|
+
"matcher": "compact",
|
|
170
|
+
"hooks": [{
|
|
171
|
+
"type": "command",
|
|
172
|
+
"command": f"{hooks_dir}/pre-compact.sh",
|
|
173
|
+
"timeout": 15,
|
|
174
|
+
"statusMessage": "◆ Saving state..."
|
|
175
|
+
}]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"SubagentStart": [
|
|
179
|
+
{
|
|
180
|
+
"matcher": ".*",
|
|
181
|
+
"hooks": [{
|
|
182
|
+
"type": "command",
|
|
183
|
+
"command": "echo '{\"additionalContext\": \"◆ Qualia agent spawned\"}'"
|
|
184
|
+
}]
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
# Permissions
|
|
190
|
+
settings.setdefault("permissions", {})
|
|
191
|
+
settings["permissions"].setdefault("allow", [])
|
|
192
|
+
settings["permissions"].setdefault("deny", [
|
|
193
|
+
"Read(./.env)",
|
|
194
|
+
"Read(./.env.*)",
|
|
195
|
+
"Read(./secrets/**)"
|
|
196
|
+
])
|
|
197
|
+
|
|
198
|
+
# Effort level
|
|
199
|
+
settings["effortLevel"] = "high"
|
|
200
|
+
|
|
201
|
+
with open(settings_path, "w") as f:
|
|
202
|
+
json.dump(settings, f, indent=2)
|
|
203
|
+
|
|
204
|
+
print(" ✓ Hooks registered (branch-guard, env-block, deploy-gate, pre-compact, subagent-label)")
|
|
205
|
+
print(" ✓ Status line configured (2-line teal branded)")
|
|
206
|
+
print(" ✓ Spinner verbs: Qualia branded")
|
|
207
|
+
print(" ✓ Spinner tips: Qualia tips")
|
|
208
|
+
print(" ✓ Environment variables set")
|
|
209
|
+
PYEOF
|
|
210
|
+
|
|
211
|
+
echo ""
|
|
212
|
+
echo "◆ Installed ✓"
|
|
213
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
214
|
+
echo " Skills: 10"
|
|
215
|
+
echo " Agents: 3 (planner, builder, verifier)"
|
|
216
|
+
echo " Hooks: 4 (branch-guard, env-block, deploy-gate, pre-compact)"
|
|
217
|
+
echo " Rules: 3 (security, frontend, deployment)"
|
|
218
|
+
echo " Templates: 4"
|
|
219
|
+
echo " Status line: ✓"
|
|
220
|
+
echo " CLAUDE.md: ✓ (user-level)"
|
|
221
|
+
echo ""
|
|
222
|
+
echo " Restart Claude Code, then type /qualia in any project."
|
|
223
|
+
echo ""
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "qualia-framework-v2",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Claude Code workflow framework by Qualia Solutions. Plan, build, verify, ship.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"qualia-framework-v2": "./bin/install.js"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"claude-code",
|
|
10
|
+
"claude",
|
|
11
|
+
"ai",
|
|
12
|
+
"framework",
|
|
13
|
+
"workflow",
|
|
14
|
+
"qualia",
|
|
15
|
+
"agents",
|
|
16
|
+
"automation"
|
|
17
|
+
],
|
|
18
|
+
"author": "Qualia Solutions <hello@qualia.solutions>",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/qualia-solutions/qualia-framework-v2"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/qualia-solutions/qualia-framework-v2#readme",
|
|
25
|
+
"files": [
|
|
26
|
+
"bin/",
|
|
27
|
+
"agents/",
|
|
28
|
+
"hooks/",
|
|
29
|
+
"rules/",
|
|
30
|
+
"skills/",
|
|
31
|
+
"templates/",
|
|
32
|
+
"CLAUDE.md",
|
|
33
|
+
"guide.md",
|
|
34
|
+
"statusline.sh",
|
|
35
|
+
"install.sh"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
globs: ["vercel.json", "next.config.*", "wrangler.*", "Dockerfile"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Deployment (MANDATORY - Every Project)
|
|
6
|
+
|
|
7
|
+
When work on a project is **done**, ALWAYS execute these steps in order:
|
|
8
|
+
|
|
9
|
+
## 1. Push to GitHub
|
|
10
|
+
Commit and push all changes to the remote repository.
|
|
11
|
+
|
|
12
|
+
## 2. Redeploy to Vercel
|
|
13
|
+
Deploy through the Vercel CLI (`vercel --prod`) or project-appropriate method (e.g., `wrangler deploy` for Cloudflare Workers).
|
|
14
|
+
|
|
15
|
+
## 3. Verify Supabase
|
|
16
|
+
Confirm Supabase is configured correctly via CLI or Management API (check tables, RLS, migrations are applied).
|
|
17
|
+
|
|
18
|
+
## 4. Post-Deploy Verification Checklist
|
|
19
|
+
|
|
20
|
+
After deployment, verify all 5 checks pass:
|
|
21
|
+
|
|
22
|
+
- [ ] **HTTP 200** — Homepage loads successfully (`curl -s -o /dev/null -w "%{http_code}" <url>` returns 200)
|
|
23
|
+
- [ ] **Auth flow** — Login/signup endpoint responds correctly (test auth callback URL)
|
|
24
|
+
- [ ] **Console errors** — No critical JS errors in browser console on homepage load
|
|
25
|
+
- [ ] **API latency** — Key API endpoints respond under 500ms (`curl -w "%{time_total}" <api-url>`)
|
|
26
|
+
- [ ] **UptimeRobot** — Verify monitor shows UP on https://stats.uptimerobot.com/bKudHy1pLs
|
|
27
|
+
|
|
28
|
+
If any check fails, investigate and fix before considering deployment complete.
|
|
29
|
+
|
|
30
|
+
This applies to **every project, every time**. No exceptions. Don't ask — just do it.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
globs: ["*.tsx", "*.jsx", "*.css", "*.scss", "tailwind.config.*"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Frontend Aesthetics
|
|
6
|
+
|
|
7
|
+
- Distinctive fonts (not Inter/Arial)
|
|
8
|
+
- Cohesive color palette with sharp accents
|
|
9
|
+
- CSS transitions, staggered animations
|
|
10
|
+
- Layered backgrounds, subtle gradients
|
|
11
|
+
- Avoid: card grids, generic heroes, blue-purple gradients
|
|
12
|
+
- Full-width layouts — no hardcoded 1200px/1280px caps. Use fluid widths that fill the viewport with sensible padding.
|
|
13
|
+
|
|
14
|
+
Note: Qualia agents MUST follow these rules when building any frontend component. These are Fawzi's brand standards, not suggestions.
|
|
15
|
+
|
|
16
|
+
## Impeccable Design Skills (global)
|
|
17
|
+
Use these `/commands` for design refinement on any frontend work:
|
|
18
|
+
- `/polish` — Final detail pass before shipping (spacing, alignment, consistency)
|
|
19
|
+
- `/bolder` — Amplify safe/boring designs to be more striking
|
|
20
|
+
- `/design-quieter` — Tone down overly aggressive designs
|
|
21
|
+
- `/animate` — Add purposeful micro-interactions and motion
|
|
22
|
+
- `/colorize` — Inject strategic color into monochrome UIs
|
|
23
|
+
- `/clarify` — Fix unclear UX copy, labels, error messages
|
|
24
|
+
- `/critique` — Design director-level review (run before shipping)
|
|
25
|
+
- `/distill` — Strip unnecessary complexity
|
|
26
|
+
- `/delight` — Add memorable touches and personality
|
|
27
|
+
- `/harden` — Edge cases, overflow, i18n robustness
|
|
28
|
+
- `/onboard` — First-time user experience flows
|
|
29
|
+
- `/normalize` — Align with project design system
|
|
30
|
+
- `/responsive` — Cross-device responsive adaptation
|
|
31
|
+
|
|
32
|
+
### Recommended workflow
|
|
33
|
+
1. Build feature → 2. `/critique` → 3. `/polish` → 4. `/harden` → ship
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
globs: ["**/api/**", "**/actions/**", "**/lib/supabase/**", "**/*.sql", "**/middleware.*"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Security Rules
|
|
6
|
+
|
|
7
|
+
- Always check auth server-side. Never trust client IDs. Derive user from `auth.uid()`.
|
|
8
|
+
- Enable RLS on every table. Write policies checking `auth.uid()`. Never expose `service_role` key client-side.
|
|
9
|
+
- Validate with Zod. Never use `dangerouslySetInnerHTML`. Never use `eval()`.
|
|
10
|
+
- Never hardcode keys. Never commit `.env`.
|
|
11
|
+
- Audit that service role key is never imported in any client component.
|
|
12
|
+
- Use `lib/supabase/server.ts` for mutations, never `lib/supabase/client.ts`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qualia
|
|
3
|
+
description: "Router — reads STATE.md and tells you the exact next command. Use whenever you type /qualia, 'what next', 'next', or are lost."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /qualia — What's Next?
|
|
7
|
+
|
|
8
|
+
Read project state. Tell the employee the exact next command. No analysis, no advice — just routing.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
### 1. Read State
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
echo "---STATE---"
|
|
16
|
+
cat .planning/STATE.md 2>/dev/null || echo "NO_STATE"
|
|
17
|
+
echo "---TRACKING---"
|
|
18
|
+
cat .planning/tracking.json 2>/dev/null || echo "NO_TRACKING"
|
|
19
|
+
echo "---PHASE_PLANS---"
|
|
20
|
+
ls .planning/phase-*-plan.md 2>/dev/null || echo "NO_PLANS"
|
|
21
|
+
echo "---VERIFICATIONS---"
|
|
22
|
+
ls .planning/phase-*-verification.md 2>/dev/null || echo "NO_VERIFICATIONS"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. Route
|
|
26
|
+
|
|
27
|
+
| Condition | Command |
|
|
28
|
+
|-----------|---------|
|
|
29
|
+
| No `.planning/` | → `/qualia-new` |
|
|
30
|
+
| Phase N has no plan | → `/qualia-plan {N}` |
|
|
31
|
+
| Phase N has plan, not built | → `/qualia-build {N}` |
|
|
32
|
+
| Phase N built, not verified | → `/qualia-verify {N}` |
|
|
33
|
+
| Phase N verified with FAIL | → `/qualia-plan {N} --gaps` |
|
|
34
|
+
| Phase N verified PASS, more phases | → `/qualia-plan {N+1}` |
|
|
35
|
+
| All phases verified PASS | → `/qualia-polish` |
|
|
36
|
+
| Polish done | → `/qualia-ship` |
|
|
37
|
+
| Shipped | → `/qualia-handoff` |
|
|
38
|
+
| Handed off | → Done. Run `/qualia-report` |
|
|
39
|
+
|
|
40
|
+
### 3. Display
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
◆ QUALIA
|
|
44
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
45
|
+
Project {name}
|
|
46
|
+
Phase {N} of {total} — {name}
|
|
47
|
+
Status {status}
|
|
48
|
+
Progress {bar} {percent}%
|
|
49
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
50
|
+
|
|
51
|
+
→ Run: /qualia-{next command}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That's it. One command. One answer.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qualia-build
|
|
3
|
+
description: "Execute the current phase — spawns builder subagents per task with wave-based parallelization. Fresh context per task."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /qualia-build — Build a Phase
|
|
7
|
+
|
|
8
|
+
Execute the phase plan. Each task runs in a fresh subagent context. Independent tasks run in parallel.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
`/qualia-build` — build the current planned phase
|
|
12
|
+
`/qualia-build {N}` — build specific phase
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
### 1. Load Plan
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cat .planning/phase-{N}-plan.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Parse: tasks, waves, file references.
|
|
23
|
+
|
|
24
|
+
### 2. Execute Waves
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
◆ QUALIA ► BUILDING Phase {N}
|
|
28
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**For each wave (sequential):**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
◆ Wave {W} ({count} tasks)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**For each task in the wave (parallel if multiple):**
|
|
38
|
+
|
|
39
|
+
Spawn a fresh builder subagent:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Agent(prompt="
|
|
43
|
+
Read your role: @agents/builder.md
|
|
44
|
+
|
|
45
|
+
Project context:
|
|
46
|
+
@.planning/PROJECT.md
|
|
47
|
+
|
|
48
|
+
YOUR TASK:
|
|
49
|
+
{paste the single task block from the plan — title, files, action, context refs, done-when}
|
|
50
|
+
|
|
51
|
+
Execute this task. Read all @file references before writing. Commit when done.
|
|
52
|
+
", subagent_type="general-purpose", description="Task {N}: {title}")
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**After each task completes:**
|
|
56
|
+
- Verify the commit exists: `git log --oneline -1`
|
|
57
|
+
- Show result:
|
|
58
|
+
```
|
|
59
|
+
✓ Task {N}: {title} ({commit hash})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**After each wave completes:**
|
|
63
|
+
- Move to next wave
|
|
64
|
+
- Show wave summary
|
|
65
|
+
|
|
66
|
+
### 3. Wave Completion
|
|
67
|
+
|
|
68
|
+
After all waves complete:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
◆ QUALIA ► Phase {N} Built
|
|
72
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
73
|
+
Tasks: {done}/{total} ✓
|
|
74
|
+
Commits: {count}
|
|
75
|
+
Waves: {count}
|
|
76
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 4. Handle Failures
|
|
80
|
+
|
|
81
|
+
If a builder subagent returns a deviation or blocker:
|
|
82
|
+
- **Minor deviation:** Log it, continue
|
|
83
|
+
- **Major deviation:** Show to employee, ask how to proceed
|
|
84
|
+
- **Blocker:** Show the blocker, suggest fix or escalation
|
|
85
|
+
|
|
86
|
+
### 5. Update State
|
|
87
|
+
|
|
88
|
+
Update STATE.md: status → "built", tasks completed
|
|
89
|
+
Update tracking.json: tasks_done, wave, status
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
→ Run: /qualia-verify {N}
|
|
93
|
+
```
|