qualia-framework 2.4.5 → 2.4.9
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 +1 -1
- package/bin/cli.js +1 -1
- package/framework/CLAUDE.md +14 -17
- package/framework/agents/backend-agent.md +1 -1
- package/framework/agents/frontend-agent.md +2 -2
- package/framework/agents/qualia-debugger.md +1 -1
- package/framework/agents/qualia-executor.md +4 -4
- package/framework/agents/qualia-plan-checker.md +2 -2
- package/framework/agents/qualia-roadmapper.md +2 -2
- package/framework/agents/qualia-verifier.md +1 -1
- package/framework/agents/test-agent.md +1 -1
- package/framework/hooks/auto-format.sh +2 -1
- package/framework/hooks/block-env-edit.sh +5 -1
- package/framework/hooks/migration-validate.sh +13 -10
- package/framework/hooks/notification-speak.sh +1 -0
- package/framework/hooks/pre-compact.sh +1 -0
- package/framework/hooks/pre-deploy-gate.sh +14 -12
- package/framework/hooks/qualia-colors.sh +4 -4
- package/framework/hooks/retention-cleanup.sh +10 -0
- package/framework/hooks/save-session-state.sh +2 -0
- package/framework/hooks/session-learn.sh +1 -0
- package/framework/qualia-framework/VERSION +1 -1
- package/framework/qualia-framework/bin/collect-metrics.sh +8 -12
- package/framework/qualia-framework/bin/qualia-tools.js +1 -1
- package/framework/qualia-framework/references/decimal-phase-calculation.md +4 -4
- package/framework/qualia-framework/references/model-profile-resolution.md +1 -1
- package/framework/qualia-framework/references/phase-argument-parsing.md +3 -3
- package/framework/qualia-framework/references/planning-config.md +5 -5
- package/framework/qualia-framework/references/verification-patterns.md +1 -1
- package/framework/qualia-framework/templates/codebase/structure.md +10 -10
- package/framework/qualia-framework/templates/phase-prompt.md +10 -10
- package/framework/qualia-framework/workflows/add-phase.md +2 -2
- package/framework/qualia-framework/workflows/add-todo.md +3 -3
- package/framework/qualia-framework/workflows/audit-milestone.md +3 -3
- package/framework/qualia-framework/workflows/check-todos.md +2 -2
- package/framework/qualia-framework/workflows/complete-milestone.md +4 -4
- package/framework/qualia-framework/workflows/diagnose-issues.md +1 -1
- package/framework/qualia-framework/workflows/discovery-phase.md +5 -5
- package/framework/qualia-framework/workflows/discuss-phase.md +4 -4
- package/framework/qualia-framework/workflows/execute-plan.md +8 -8
- package/framework/qualia-framework/workflows/help.md +2 -2
- package/framework/qualia-framework/workflows/insert-phase.md +3 -3
- package/framework/qualia-framework/workflows/map-codebase.md +2 -2
- package/framework/qualia-framework/workflows/new-milestone.md +6 -6
- package/framework/qualia-framework/workflows/pause-work.md +2 -2
- package/framework/qualia-framework/workflows/plan-milestone-gaps.md +2 -2
- package/framework/qualia-framework/workflows/plan-phase.md +5 -5
- package/framework/qualia-framework/workflows/quick.md +2 -2
- package/framework/qualia-framework/workflows/remove-phase.md +2 -2
- package/framework/qualia-framework/workflows/research-phase.md +4 -4
- package/framework/qualia-framework/workflows/resume-project.md +2 -2
- package/framework/qualia-framework/workflows/set-profile.md +2 -2
- package/framework/qualia-framework/workflows/settings.md +2 -2
- package/framework/qualia-framework/workflows/update.md +10 -10
- package/framework/qualia-framework/workflows/verify-phase.md +5 -5
- package/framework/qualia-framework/workflows/verify-work.md +4 -4
- package/framework/rules/context7.md +7 -4
- package/framework/rules/speed.md +2 -3
- package/framework/scripts/sync-to-framework.sh +1 -1
- package/framework/skills/animate/SKILL.md +3 -3
- package/framework/skills/bolder/SKILL.md +3 -3
- package/framework/skills/colorize/SKILL.md +3 -3
- package/framework/skills/delight/SKILL.md +3 -3
- package/framework/skills/design-quieter/SKILL.md +3 -3
- package/framework/skills/distill/SKILL.md +3 -3
- package/framework/skills/qualia-add-todo/SKILL.md +1 -1
- package/framework/skills/qualia-check-todos/SKILL.md +1 -1
- package/framework/skills/qualia-debug/SKILL.md +2 -2
- package/framework/skills/qualia-discuss-phase/SKILL.md +2 -2
- package/framework/skills/qualia-framework-audit/SKILL.md +1 -1
- package/framework/skills/qualia-list-phase-assumptions/SKILL.md +1 -1
- package/framework/skills/qualia-new-milestone/SKILL.md +4 -4
- package/framework/skills/qualia-optimize/SKILL.md +7 -7
- package/framework/skills/qualia-pause-work/SKILL.md +1 -1
- package/framework/skills/qualia-plan-milestone-gaps/SKILL.md +1 -1
- package/framework/skills/qualia-production-check/SKILL.md +0 -314
- package/framework/skills/qualia-progress/SKILL.md +1 -1
- package/framework/skills/qualia-quick/SKILL.md +1 -1
- package/framework/skills/qualia-research-phase/SKILL.md +2 -2
- package/framework/skills/qualia-resume-work/SKILL.md +1 -1
- package/framework/skills/qualia-review/SKILL.md +1 -1
- package/framework/teams/review-team.md +75 -0
- package/framework/teams/ship-team.md +86 -0
- package/package.json +1 -1
- package/framework/skills/qualia-workflow/SKILL.md +0 -130
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ npx github:Qualiasolutions/qualia-framework verify
|
|
|
32
32
|
- `~/.claude/hooks/` — 13 hook scripts (pre-commit, deploy gate, etc.)
|
|
33
33
|
- `~/.claude/agents/` — 19 agent definitions
|
|
34
34
|
- `~/.claude/rules/` — Security, frontend, deployment, speed rules
|
|
35
|
-
- `~/.claude/qualia-
|
|
35
|
+
- `~/.claude/qualia-framework/` — Workflow engine
|
|
36
36
|
- `~/.claude/knowledge/` — Shared knowledge base
|
|
37
37
|
- `~/.claude/CLAUDE.md` — Personalized to your role
|
|
38
38
|
- `~/.claude/settings.json` — Merged with your existing config
|
package/bin/cli.js
CHANGED
|
@@ -458,7 +458,7 @@ async function runUpdate() {
|
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
// Clean up removed directories from old versions
|
|
461
|
-
for (const stale of ['commands', 'config', 'core']) {
|
|
461
|
+
for (const stale of ['commands', 'config', 'core', 'qualia-engine']) {
|
|
462
462
|
const p = path.join(CLAUDE_DIR, stale);
|
|
463
463
|
if (fs.existsSync(p)) {
|
|
464
464
|
fs.rmSync(p, { recursive: true, force: true });
|
package/framework/CLAUDE.md
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
# CLAUDE.md —
|
|
1
|
+
# CLAUDE.md — OWNER Profile
|
|
2
2
|
|
|
3
3
|
## Identity
|
|
4
|
-
**Fawzi Goussous** — Founder
|
|
5
|
-
|
|
4
|
+
**Fawzi Goussous** — Founder at Qualia Solutions. Nicosia, Cyprus.
|
|
5
|
+
One-man dev shop. Websites, AI agents, voice agents, AI automation.
|
|
6
|
+
- Direct, action-oriented, no fluff. Code > theory.
|
|
7
|
+
- يعني اذا حكى عربي رد عربي، اذا انجليزي رد انجليزي، واذا خلط خلط معه
|
|
6
8
|
- Stack: Next.js 16+, React 19, TypeScript, Supabase, Vercel, VAPI, ElevenLabs, Telnyx, Retell AI, OpenRouter
|
|
7
|
-
- Partner: Jay | Team: Moayad (full-time, Jordan), Ahasan (part-time, Cyprus)
|
|
8
9
|
|
|
9
10
|
## Role: OWNER
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
11
|
+
You are the founder. Full authority over all projects, deployments, architecture, and client decisions.
|
|
12
|
+
- Can deploy directly to production
|
|
13
|
+
- Can make architectural decisions unilaterally
|
|
14
|
+
- Can access all Supabase projects and service role keys
|
|
15
|
+
- Can modify CLAUDE.md, skills, hooks, and framework config
|
|
16
|
+
- Can approve/reject employee work
|
|
16
17
|
|
|
17
18
|
## Rules
|
|
18
19
|
- Read before Write/Edit — no exceptions
|
|
19
|
-
- Feature branches
|
|
20
|
+
- Feature branches preferred — OWNER may push to main when necessary (branch-guard enforces for non-OWNER)
|
|
20
21
|
- MVP first. Build only what's asked. No over-engineering.
|
|
21
22
|
- Root cause on failures — no band-aids
|
|
22
23
|
- `npx tsc --noEmit` after multi-file TS changes
|
|
23
24
|
- Glob/Grep directly — no Task(Explore) unless 5+ rounds needed
|
|
24
|
-
- For non-trivial work (multi-file changes, architectural decisions, unfamiliar codebases), confirm understanding before coding — quick tasks are exempt
|
|
25
|
+
- For non-trivial work (multi-file changes, architectural decisions, unfamiliar codebases), confirm understanding before coding: "Here's what I understand: [summary]. Correct?" — quick tasks (typo, single-file, familiar pattern) are exempt
|
|
25
26
|
- See `rules/security.md` for auth, RLS, Zod, secrets rules
|
|
26
27
|
- See `rules/frontend.md` for design standards
|
|
27
28
|
- See `rules/deployment.md` for deploy checklist
|
|
28
|
-
- See `rules/speed.md` for tool usage and workflow shortcuts
|
|
29
|
-
- See `rules/context7.md` for library documentation lookup
|
|
30
29
|
|
|
31
30
|
## Collaboration
|
|
32
31
|
Collaborator, not executor. Speak up about bugs, simpler approaches, bad architecture.
|
|
33
32
|
Be honest. Default to action. Never speculate on unread code. Say when blocked.
|
|
34
|
-
- Direct, action-oriented, no fluff. Code > theory.
|
|
35
|
-
- Arabic or English — match whatever language is used
|
|
36
33
|
|
|
37
34
|
## Workflow
|
|
38
35
|
- **MANDATORY FIRST ACTION**: On every session start, invoke the `qualia-start` skill before doing anything else. This is non-negotiable — do not wait for user input, do not skip it, do not just acknowledge the hook message. Actually invoke the skill using the Skill tool.
|
|
39
|
-
- Subagents
|
|
36
|
+
- Subagents default to Opus (set via CLAUDE_CODE_SUBAGENT_MODEL).
|
|
40
37
|
- `/compact` at 60%. `/clear` between tasks. `/learn` after mistakes.
|
|
41
38
|
|
|
42
39
|
## Qualia Mode (always active)
|
|
@@ -3,7 +3,7 @@ name: backend-agent
|
|
|
3
3
|
description: Backend/database specialist - Supabase, APIs, Edge Functions. Spawned for parallel backend development.
|
|
4
4
|
category: development
|
|
5
5
|
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
6
|
-
model:
|
|
6
|
+
model: inherit
|
|
7
7
|
skills:
|
|
8
8
|
- supabase
|
|
9
9
|
tags: [backend, supabase, api, database, typescript]
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
name: frontend-agent
|
|
3
3
|
description: Frontend implementation specialist - React, TypeScript, CSS, animations. Spawned for parallel UI development.
|
|
4
4
|
category: development
|
|
5
|
-
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
6
|
-
model:
|
|
5
|
+
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
6
|
+
model: inherit
|
|
7
7
|
skills:
|
|
8
8
|
- frontend-master
|
|
9
9
|
- responsive
|
|
@@ -983,7 +983,7 @@ mv .planning/debug/{slug}.md .planning/debug/resolved/
|
|
|
983
983
|
**Check planning config using state load (commit_docs is available from the output):**
|
|
984
984
|
|
|
985
985
|
```bash
|
|
986
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
986
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js state load)
|
|
987
987
|
# commit_docs is in the JSON output
|
|
988
988
|
```
|
|
989
989
|
|
|
@@ -20,7 +20,7 @@ Your job: Execute the plan completely, commit each task, create SUMMARY.md, upda
|
|
|
20
20
|
Load execution context:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
23
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js init execute-phase "${PHASE}")
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `plans`, `incomplete_plans`.
|
|
@@ -298,7 +298,7 @@ No user permission needed for Rules 1-3.
|
|
|
298
298
|
Before any `checkpoint:human-verify`, ensure verification environment is ready. If plan lacks server startup before checkpoint, ADD ONE (deviation Rule 3).
|
|
299
299
|
|
|
300
300
|
For full automation-first patterns, server lifecycle, CLI handling:
|
|
301
|
-
**See @/home/qualia/.claude/qualia-
|
|
301
|
+
**See @/home/qualia/.claude/qualia-framework/references/checkpoints.md**
|
|
302
302
|
|
|
303
303
|
**Quick reference:** Users NEVER run CLI commands. Users ONLY visit URLs, click UI, evaluate visuals, provide secrets. Claude does all automation.
|
|
304
304
|
|
|
@@ -722,7 +722,7 @@ git commit -m "{type}({phase}-{plan}): {concise task description}
|
|
|
722
722
|
<summary_creation>
|
|
723
723
|
After all tasks complete, create `{phase}-{plan}-SUMMARY.md` at `.planning/phases/XX-name/`.
|
|
724
724
|
|
|
725
|
-
**Use template:** @/home/qualia/.claude/qualia-
|
|
725
|
+
**Use template:** @/home/qualia/.claude/qualia-framework/templates/summary.md
|
|
726
726
|
|
|
727
727
|
**Frontmatter:** phase, plan, subsystem, tags, dependency graph (requires/provides/affects), tech-stack (added/patterns), key-files (created/modified), decisions, metrics (duration, completed date).
|
|
728
728
|
|
|
@@ -844,7 +844,7 @@ Progress: [progress bar]
|
|
|
844
844
|
|
|
845
845
|
<final_commit>
|
|
846
846
|
```bash
|
|
847
|
-
node /home/qualia/.claude/qualia-
|
|
847
|
+
node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md
|
|
848
848
|
```
|
|
849
849
|
|
|
850
850
|
Separate from per-task commits — captures execution results only.
|
|
@@ -396,7 +396,7 @@ issue:
|
|
|
396
396
|
|
|
397
397
|
Load phase operation context:
|
|
398
398
|
```bash
|
|
399
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
399
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js init phase-op "${PHASE_ARG}")
|
|
400
400
|
```
|
|
401
401
|
|
|
402
402
|
Extract from init JSON: `phase_dir`, `phase_number`, `has_plans`, `plan_count`.
|
|
@@ -405,7 +405,7 @@ Orchestrator provides CONTEXT.md content in the verification prompt. If provided
|
|
|
405
405
|
|
|
406
406
|
```bash
|
|
407
407
|
ls "$phase_dir"/*-PLAN.md 2>/dev/null
|
|
408
|
-
node /home/qualia/.claude/qualia-
|
|
408
|
+
node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js roadmap get-phase "$phase_number"
|
|
409
409
|
ls "$phase_dir"/*-BRIEF.md 2>/dev/null
|
|
410
410
|
```
|
|
411
411
|
|
|
@@ -287,7 +287,7 @@ After roadmap creation, REQUIREMENTS.md gets updated with phase mappings:
|
|
|
287
287
|
|
|
288
288
|
## ROADMAP.md Structure
|
|
289
289
|
|
|
290
|
-
Use template from `/home/qualia/.claude/qualia-
|
|
290
|
+
Use template from `/home/qualia/.claude/qualia-framework/templates/roadmap.md`.
|
|
291
291
|
|
|
292
292
|
Key sections:
|
|
293
293
|
- Overview (2-3 sentences)
|
|
@@ -296,7 +296,7 @@ Key sections:
|
|
|
296
296
|
|
|
297
297
|
## STATE.md Structure
|
|
298
298
|
|
|
299
|
-
Use template from `/home/qualia/.claude/qualia-
|
|
299
|
+
Use template from `/home/qualia/.claude/qualia-framework/templates/state.md`.
|
|
300
300
|
|
|
301
301
|
Key sections:
|
|
302
302
|
- Project Reference (core value, current focus)
|
|
@@ -55,7 +55,7 @@ Set `is_re_verification = false`, proceed with Step 1.
|
|
|
55
55
|
```bash
|
|
56
56
|
ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
|
|
57
57
|
ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
|
|
58
|
-
node /home/qualia/.claude/qualia-
|
|
58
|
+
node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js roadmap get-phase "$PHASE_NUM"
|
|
59
59
|
grep -E "^| $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -3,7 +3,7 @@ name: test-agent
|
|
|
3
3
|
description: Testing and QA specialist - unit tests, integration tests, E2E with Playwright. Spawned for parallel test development.
|
|
4
4
|
category: testing
|
|
5
5
|
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
6
|
-
model:
|
|
6
|
+
model: inherit
|
|
7
7
|
tags: [testing, jest, vitest, playwright, qa]
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Auto-format hook for PostToolUse(Write)
|
|
2
|
+
# Auto-format hook for PostToolUse(Write/Edit)
|
|
3
3
|
# Runs prettier on supported file types if available in the project
|
|
4
|
+
source "$(dirname "$0")/qualia-colors.sh"
|
|
4
5
|
|
|
5
6
|
# Parse file path from stdin JSON (Claude Code hook protocol)
|
|
6
7
|
if [ ! -t 0 ]; then
|
|
@@ -9,7 +9,10 @@ else
|
|
|
9
9
|
FILE_PATH="${1:-}"
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
|
-
[ -z "$FILE_PATH" ]
|
|
12
|
+
if [ -z "$FILE_PATH" ]; then
|
|
13
|
+
printf '{"continue":true}'
|
|
14
|
+
exit 0
|
|
15
|
+
fi
|
|
13
16
|
|
|
14
17
|
BASENAME=$(basename "$FILE_PATH")
|
|
15
18
|
|
|
@@ -35,4 +38,5 @@ EOJSON
|
|
|
35
38
|
exit 2
|
|
36
39
|
fi
|
|
37
40
|
|
|
41
|
+
printf '{"continue":true}'
|
|
38
42
|
exit 0
|
|
@@ -26,8 +26,11 @@ check_sql_file() {
|
|
|
26
26
|
q_fail "TRUNCATE in ${file}"
|
|
27
27
|
DESTRUCTIVE=$((DESTRUCTIVE + 1))
|
|
28
28
|
fi
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
# DELETE-without-WHERE: count DELETEs vs WHERE clauses (per-statement approximation)
|
|
30
|
+
local delete_count=$(grep -ciE '\bDELETE\s+FROM\b' "$file" 2>/dev/null || echo 0)
|
|
31
|
+
local where_count=$(grep -ciE '\bWHERE\b' "$file" 2>/dev/null || echo 0)
|
|
32
|
+
if [ "$delete_count" -gt 0 ] && [ "$delete_count" -gt "$where_count" ]; then
|
|
33
|
+
q_fail "DELETE without WHERE in ${file} (${delete_count} DELETEs, ${where_count} WHEREs)"
|
|
31
34
|
DESTRUCTIVE=$((DESTRUCTIVE + 1))
|
|
32
35
|
fi
|
|
33
36
|
if grep -iE '\bALTER\s+TABLE\b.*\bDROP\s+COLUMN\b' "$file" > /dev/null 2>&1; then
|
|
@@ -41,24 +44,24 @@ check_sql_file() {
|
|
|
41
44
|
fi
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
TOTAL=0
|
|
45
47
|
TRIGGERED=false
|
|
46
48
|
|
|
47
49
|
# Mode 1: SQL file written
|
|
48
50
|
if [ -n "$FILE_PATH" ] && [[ "$FILE_PATH" == *.sql ]]; then
|
|
49
51
|
TRIGGERED=true
|
|
50
52
|
check_sql_file "$FILE_PATH"
|
|
51
|
-
TOTAL=$?
|
|
52
53
|
fi
|
|
53
54
|
|
|
54
|
-
# Mode 2: supabase db push
|
|
55
|
+
# Mode 2: supabase db push — only scan new/modified migrations (not historical)
|
|
55
56
|
if [ -n "$COMMAND" ] && echo "$COMMAND" | grep -qE 'supabase\s+db\s+push'; then
|
|
56
57
|
TRIGGERED=true
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
# Scan only uncommitted or recently modified migration files
|
|
59
|
+
MODIFIED_MIGRATIONS=$(git diff --name-only HEAD -- supabase/migrations/*.sql 2>/dev/null; git diff --cached --name-only -- supabase/migrations/*.sql 2>/dev/null; git ls-files --others -- supabase/migrations/*.sql 2>/dev/null)
|
|
60
|
+
if [ -n "$MODIFIED_MIGRATIONS" ]; then
|
|
61
|
+
while IFS= read -r sql_file; do
|
|
62
|
+
[ -f "$sql_file" ] && check_sql_file "$sql_file"
|
|
63
|
+
done < <(echo "$MODIFIED_MIGRATIONS" | sort -u)
|
|
64
|
+
fi
|
|
62
65
|
fi
|
|
63
66
|
|
|
64
67
|
# Block on destructive ops, warn on missing RLS
|
|
@@ -19,20 +19,27 @@ else
|
|
|
19
19
|
COMMAND=""
|
|
20
20
|
fi
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# Skip non-deploy commands first (git, npm, etc. may mention vercel in args/messages)
|
|
23
23
|
case "$COMMAND" in
|
|
24
|
-
|
|
24
|
+
git\ *|npm\ *|node\ *|cat\ *|echo\ *|grep\ *|ls\ *|cd\ *) exit 0 ;;
|
|
25
|
+
esac
|
|
26
|
+
|
|
27
|
+
# Only gate actual vercel production deploy commands
|
|
28
|
+
case "$COMMAND" in
|
|
29
|
+
vercel\ *--prod*|npx\ vercel\ *--prod*|bunx\ vercel\ *--prod*|pnpx\ vercel\ *--prod*) ;;
|
|
25
30
|
*) exit 0 ;;
|
|
26
31
|
esac
|
|
27
32
|
|
|
28
33
|
|
|
29
|
-
# Skip if gate
|
|
34
|
+
# Skip if gate passed recently AND no code changes since
|
|
30
35
|
STAMP="/tmp/.deploy-gate-$(echo "$PWD" | md5sum | cut -c1-8)"
|
|
31
36
|
if [ -f "$STAMP" ]; then
|
|
32
37
|
AGE=$(( $(date +%s) - $(stat -c %Y "$STAMP" 2>/dev/null || echo 0) ))
|
|
33
|
-
|
|
38
|
+
DIRTY=$(git status --porcelain 2>/dev/null | head -1)
|
|
39
|
+
if [ "$AGE" -lt 300 ] && [ -z "$DIRTY" ]; then
|
|
34
40
|
exit 0
|
|
35
41
|
fi
|
|
42
|
+
rm -f "$STAMP"
|
|
36
43
|
fi
|
|
37
44
|
|
|
38
45
|
q_header "PRE-DEPLOY GATE"
|
|
@@ -135,15 +142,10 @@ else
|
|
|
135
142
|
fi
|
|
136
143
|
|
|
137
144
|
# ─── Verdict ───
|
|
145
|
+
# Warning only — /ship skill is the real quality gate. Hook is a safety net.
|
|
138
146
|
if [ "$FAILURES" -gt 0 ]; then
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"continue": false,
|
|
142
|
-
"stopReason": "◆ Deploy gate: ${FAILURES} check(s) failed",
|
|
143
|
-
"systemMessage": "◆ DEPLOY BLOCKED: ${FAILURES} check(s) failed. ${FAIL_DETAILS}Fix issues and retry with /ship."
|
|
144
|
-
}
|
|
145
|
-
EOJSON
|
|
146
|
-
exit 2
|
|
147
|
+
printf '{"continue":true,"systemMessage":"◆ DEPLOY WARNING: %d check(s) failed. %sThe /ship skill should have caught these — if deploying manually, fix first."}' "$FAILURES" "$FAIL_DETAILS"
|
|
148
|
+
exit 0
|
|
147
149
|
fi
|
|
148
150
|
|
|
149
151
|
WARN_MSG=""
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Qualia teal brand palette — source this in all hooks
|
|
2
2
|
# Usage: source "$(dirname "$0")/qualia-colors.sh"
|
|
3
3
|
|
|
4
|
-
Q_TEAL='\033[38;2;0;
|
|
5
|
-
Q_BRIGHT='\033[38;2;
|
|
6
|
-
Q_DIM='\033[38;2;0;
|
|
7
|
-
Q_WHITE='\033[38;2;
|
|
4
|
+
Q_TEAL='\033[38;2;0;140;130m'
|
|
5
|
+
Q_BRIGHT='\033[38;2;0;200;185m'
|
|
6
|
+
Q_DIM='\033[38;2;0;100;92m'
|
|
7
|
+
Q_WHITE='\033[38;2;230;230;230m'
|
|
8
8
|
Q_PASS='\033[38;2;52;211;153m'
|
|
9
9
|
Q_WARN='\033[38;2;234;179;8m'
|
|
10
10
|
Q_FAIL='\033[38;2;239;68;68m'
|
|
@@ -44,9 +44,19 @@ find "$CLAUDE_DIR/tasks/" -mindepth 1 -type d -empty -delete 2>/dev/null
|
|
|
44
44
|
# plans/ — keep 7 days (old Claude Code plan mode files)
|
|
45
45
|
find "$CLAUDE_DIR/plans/" -type f -mtime +7 -delete 2>/dev/null
|
|
46
46
|
|
|
47
|
+
# downloads/ — keep 7 days
|
|
48
|
+
find "$CLAUDE_DIR/downloads/" -type f -mtime +7 -delete 2>/dev/null
|
|
49
|
+
|
|
50
|
+
# image-cache/ — keep 7 days
|
|
51
|
+
find "$CLAUDE_DIR/image-cache/" -type f -mtime +7 -delete 2>/dev/null
|
|
52
|
+
|
|
53
|
+
# thoughts/ — keep 14 days
|
|
54
|
+
find "$CLAUDE_DIR/thoughts/" -type f -mtime +14 -delete 2>/dev/null
|
|
55
|
+
|
|
47
56
|
# session-env/ session_*.json — keep last 50 (matches save-session-state.sh)
|
|
48
57
|
ls -t "$CLAUDE_DIR/session-env"/session_*.json 2>/dev/null | tail -n +51 | while IFS= read -r f; do
|
|
49
58
|
rm -f "$f"
|
|
50
59
|
done
|
|
51
60
|
|
|
61
|
+
printf '{"continue":true}'
|
|
52
62
|
exit 0
|
|
@@ -15,6 +15,7 @@ if [ -f "$SESSION_START_FILE" ]; then
|
|
|
15
15
|
NOW_TS=$(date +%s)
|
|
16
16
|
DURATION=$((NOW_TS - START_TS))
|
|
17
17
|
if [ "$DURATION" -lt 30 ]; then
|
|
18
|
+
printf '{"continue":true}'
|
|
18
19
|
exit 0
|
|
19
20
|
fi
|
|
20
21
|
fi
|
|
@@ -180,4 +181,5 @@ ls -t "$SESSION_DIR"/session_*.json 2>/dev/null | tail -n +51 | while IFS= read
|
|
|
180
181
|
rm -f "$f"
|
|
181
182
|
done
|
|
182
183
|
|
|
184
|
+
printf '{"continue":true}'
|
|
183
185
|
exit 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
2.4.
|
|
1
|
+
2.4.9
|
|
@@ -49,18 +49,14 @@ fi
|
|
|
49
49
|
# Lab Notes count
|
|
50
50
|
LAB_NOTES=$(grep -c "^###" .planning/lab-notes.md 2>/dev/null || echo "0")
|
|
51
51
|
|
|
52
|
-
# Completion rate from ROADMAP.md (
|
|
53
|
-
TOTAL_PLANS=$(grep -
|
|
54
|
-
COMPLETED_PLANS=$(grep -
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# FQS = completion_rate / avg_sessions_to_ship * 100 (per OBJECTIVE.md)
|
|
62
|
-
if [ "$SESSIONS" != "?" ] && [ "$SESSIONS" -gt 0 ]; then
|
|
63
|
-
FQS=$(( COMPLETION_RATE * 100 / SESSIONS ))
|
|
52
|
+
# Completion rate from ROADMAP.md (case-insensitive, allows indentation)
|
|
53
|
+
TOTAL_PLANS=$(grep -ciE "^\s*- \[" .planning/ROADMAP.md 2>/dev/null || echo "0")
|
|
54
|
+
COMPLETED_PLANS=$(grep -ciE "^\s*- \[x\]" .planning/ROADMAP.md 2>/dev/null || echo "0")
|
|
55
|
+
|
|
56
|
+
# FQS = (completion_fraction) / sessions * 100 (per OBJECTIVE.md)
|
|
57
|
+
# = COMPLETED_PLANS * 100 / (TOTAL_PLANS * SESSIONS)
|
|
58
|
+
if [ "$TOTAL_PLANS" -gt 0 ] && [ "$SESSIONS" != "?" ] && [ "$SESSIONS" -gt 0 ]; then
|
|
59
|
+
FQS=$(( COMPLETED_PLANS * 100 / (TOTAL_PLANS * SESSIONS) ))
|
|
64
60
|
else
|
|
65
61
|
FQS="?"
|
|
66
62
|
fi
|
|
@@ -1192,7 +1192,7 @@ function cmdStateSnapshot(cwd, raw) {
|
|
|
1192
1192
|
|
|
1193
1193
|
// Parse "Progress: [...] N%" — extract percentage
|
|
1194
1194
|
let progressPercent = null;
|
|
1195
|
-
const progressMatch = content.match(
|
|
1195
|
+
const progressMatch = content.match(/^Progress:.*?(\d+)%/m);
|
|
1196
1196
|
if (progressMatch) progressPercent = parseInt(progressMatch[1], 10);
|
|
1197
1197
|
|
|
1198
1198
|
// Parse "Assigned to: ..."
|
|
@@ -6,7 +6,7 @@ Calculate the next decimal phase number for urgent insertions.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Get next decimal phase after phase 6
|
|
9
|
-
node /home/qualia/.claude/qualia-
|
|
9
|
+
node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js phase next-decimal 6
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Output:
|
|
@@ -32,14 +32,14 @@ With existing decimals:
|
|
|
32
32
|
## Extract Values
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
DECIMAL_INFO=$(node /home/qualia/.claude/qualia-
|
|
35
|
+
DECIMAL_INFO=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js phase next-decimal "${AFTER_PHASE}")
|
|
36
36
|
DECIMAL_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.next')
|
|
37
37
|
BASE_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.base_phase')
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Or with --raw flag:
|
|
41
41
|
```bash
|
|
42
|
-
DECIMAL_PHASE=$(node /home/qualia/.claude/qualia-
|
|
42
|
+
DECIMAL_PHASE=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js phase next-decimal "${AFTER_PHASE}" --raw)
|
|
43
43
|
# Returns just: 06.1
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -57,7 +57,7 @@ DECIMAL_PHASE=$(node /home/qualia/.claude/qualia-engine/bin/qualia-tools.js phas
|
|
|
57
57
|
Decimal phase directories use the full decimal number:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
SLUG=$(node /home/qualia/.claude/qualia-
|
|
60
|
+
SLUG=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js generate-slug "$DESCRIPTION" --raw)
|
|
61
61
|
PHASE_DIR=".planning/phases/${DECIMAL_PHASE}-${SLUG}"
|
|
62
62
|
mkdir -p "$PHASE_DIR"
|
|
63
63
|
```
|
|
@@ -12,7 +12,7 @@ Default: `balanced` if not set or config missing.
|
|
|
12
12
|
|
|
13
13
|
## Lookup Table
|
|
14
14
|
|
|
15
|
-
@/home/qualia/.claude/qualia-
|
|
15
|
+
@/home/qualia/.claude/qualia-framework/references/model-profiles.md
|
|
16
16
|
|
|
17
17
|
Look up the agent in the table for the resolved profile. Pass the model parameter to Task calls:
|
|
18
18
|
|
|
@@ -14,7 +14,7 @@ From `$ARGUMENTS`:
|
|
|
14
14
|
The `find-phase` command handles normalization and validation in one step:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
PHASE_INFO=$(node /home/qualia/.claude/qualia-
|
|
17
|
+
PHASE_INFO=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js find-phase "${PHASE}")
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Returns JSON with:
|
|
@@ -45,7 +45,7 @@ fi
|
|
|
45
45
|
Use `roadmap get-phase` to validate phase exists:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
PHASE_CHECK=$(node /home/qualia/.claude/qualia-
|
|
48
|
+
PHASE_CHECK=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js roadmap get-phase "${PHASE}")
|
|
49
49
|
if [ "$(echo "$PHASE_CHECK" | jq -r '.found')" = "false" ]; then
|
|
50
50
|
echo "ERROR: Phase ${PHASE} not found in roadmap"
|
|
51
51
|
exit 1
|
|
@@ -57,5 +57,5 @@ fi
|
|
|
57
57
|
Use `find-phase` for directory lookup:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
PHASE_DIR=$(node /home/qualia/.claude/qualia-
|
|
60
|
+
PHASE_DIR=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js find-phase "${PHASE}" --raw)
|
|
61
61
|
```
|
|
@@ -40,14 +40,14 @@ Configuration options for `.planning/` directory behavior.
|
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
# Commit with automatic commit_docs + gitignore checks:
|
|
43
|
-
node /home/qualia/.claude/qualia-
|
|
43
|
+
node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js commit "docs: update state" --files .planning/STATE.md
|
|
44
44
|
|
|
45
45
|
# Load config via state load (returns JSON):
|
|
46
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
46
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js state load)
|
|
47
47
|
# commit_docs is available in the JSON output
|
|
48
48
|
|
|
49
49
|
# Or use init commands which include commit_docs:
|
|
50
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
50
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js init execute-phase "1")
|
|
51
51
|
# commit_docs is included in all init command outputs
|
|
52
52
|
```
|
|
53
53
|
|
|
@@ -143,13 +143,13 @@ To use uncommitted mode:
|
|
|
143
143
|
|
|
144
144
|
Use `init execute-phase` which returns all config as JSON:
|
|
145
145
|
```bash
|
|
146
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
146
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js init execute-phase "1")
|
|
147
147
|
# JSON output includes: branching_strategy, phase_branch_template, milestone_branch_template
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
Or use `state load` for the config values:
|
|
151
151
|
```bash
|
|
152
|
-
INIT=$(node /home/qualia/.claude/qualia-
|
|
152
|
+
INIT=$(node /home/qualia/.claude/qualia-framework/bin/qualia-tools.js state load)
|
|
153
153
|
# Parse branching_strategy, phase_branch_template, milestone_branch_template from JSON
|
|
154
154
|
```
|
|
155
155
|
|
|
@@ -600,7 +600,7 @@ Some things can't be verified programmatically. Flag these for human testing:
|
|
|
600
600
|
|
|
601
601
|
For automation-first checkpoint patterns, server lifecycle management, CLI installation handling, and error recovery protocols, see:
|
|
602
602
|
|
|
603
|
-
**@/home/qualia/.claude/qualia-
|
|
603
|
+
**@/home/qualia/.claude/qualia-framework/references/checkpoints.md** → `<automation_reference>` section
|
|
604
604
|
|
|
605
605
|
Key principles:
|
|
606
606
|
- Claude sets up verification environment BEFORE presenting checkpoints
|
|
@@ -123,11 +123,11 @@ Template for `.planning/codebase/STRUCTURE.md` - captures physical file organiza
|
|
|
123
123
|
## Directory Layout
|
|
124
124
|
|
|
125
125
|
```
|
|
126
|
-
qualia-
|
|
126
|
+
qualia-framework/
|
|
127
127
|
├── bin/ # Executable entry points
|
|
128
128
|
├── commands/ # Slash command definitions
|
|
129
129
|
│ └── qualia/ # Qualia-specific commands
|
|
130
|
-
├── qualia-
|
|
130
|
+
├── qualia-framework/ # Skill resources
|
|
131
131
|
│ ├── references/ # Principle documents
|
|
132
132
|
│ ├── templates/ # File templates
|
|
133
133
|
│ └── workflows/ # Multi-step procedures
|
|
@@ -151,19 +151,19 @@ qualia-engine/
|
|
|
151
151
|
- Key files: new-project.md, plan-phase.md, execute-plan.md
|
|
152
152
|
- Subdirectories: None (flat structure)
|
|
153
153
|
|
|
154
|
-
**qualia-
|
|
154
|
+
**qualia-framework/references/**
|
|
155
155
|
- Purpose: Core philosophy and guidance documents
|
|
156
156
|
- Contains: principles.md, questioning.md, plan-format.md
|
|
157
157
|
- Key files: principles.md - system philosophy
|
|
158
158
|
- Subdirectories: None
|
|
159
159
|
|
|
160
|
-
**qualia-
|
|
160
|
+
**qualia-framework/templates/**
|
|
161
161
|
- Purpose: Document templates for .planning/ files
|
|
162
162
|
- Contains: Template definitions with frontmatter
|
|
163
163
|
- Key files: project.md, roadmap.md, plan.md, summary.md
|
|
164
164
|
- Subdirectories: codebase/ (new - for stack/architecture/structure templates)
|
|
165
165
|
|
|
166
|
-
**qualia-
|
|
166
|
+
**qualia-framework/workflows/**
|
|
167
167
|
- Purpose: Reusable multi-step procedures
|
|
168
168
|
- Contains: Workflow definitions called by commands
|
|
169
169
|
- Key files: execute-plan.md, research-phase.md
|
|
@@ -211,15 +211,15 @@ qualia-engine/
|
|
|
211
211
|
- Documentation: Update `README.md` with new command
|
|
212
212
|
|
|
213
213
|
**New Template:**
|
|
214
|
-
- Implementation: `qualia-
|
|
214
|
+
- Implementation: `qualia-framework/templates/{name}.md`
|
|
215
215
|
- Documentation: Template is self-documenting (includes guidelines)
|
|
216
216
|
|
|
217
217
|
**New Workflow:**
|
|
218
|
-
- Implementation: `qualia-
|
|
219
|
-
- Usage: Reference from command with `@/home/qualia/.claude/qualia-
|
|
218
|
+
- Implementation: `qualia-framework/workflows/{name}.md`
|
|
219
|
+
- Usage: Reference from command with `@/home/qualia/.claude/qualia-framework/workflows/{name}.md`
|
|
220
220
|
|
|
221
221
|
**New Reference Document:**
|
|
222
|
-
- Implementation: `qualia-
|
|
222
|
+
- Implementation: `qualia-framework/references/{name}.md`
|
|
223
223
|
- Usage: Reference from commands/workflows as needed
|
|
224
224
|
|
|
225
225
|
**Utilities:**
|
|
@@ -228,7 +228,7 @@ qualia-engine/
|
|
|
228
228
|
|
|
229
229
|
## Special Directories
|
|
230
230
|
|
|
231
|
-
**qualia-
|
|
231
|
+
**qualia-framework/**
|
|
232
232
|
- Purpose: Resources installed to /home/qualia/.claude/
|
|
233
233
|
- Source: Copied by bin/install.js during installation
|
|
234
234
|
- Committed: Yes (source of truth)
|