qualia-framework-v2 2.5.0 → 2.7.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.
Files changed (41) hide show
  1. package/README.md +14 -10
  2. package/agents/planner.md +8 -2
  3. package/agents/qa-browser.md +186 -0
  4. package/bin/install.js +52 -27
  5. package/bin/qualia-ui.js +278 -0
  6. package/hooks/auto-update.js +92 -0
  7. package/hooks/block-env-edit.js +30 -0
  8. package/hooks/branch-guard.js +47 -0
  9. package/hooks/migration-guard.js +60 -0
  10. package/hooks/pre-compact.js +32 -0
  11. package/hooks/pre-deploy-gate.js +110 -0
  12. package/hooks/pre-push.js +33 -0
  13. package/hooks/session-start.js +84 -0
  14. package/package.json +1 -1
  15. package/skills/qualia/SKILL.md +15 -11
  16. package/skills/qualia-build/SKILL.md +17 -16
  17. package/skills/qualia-debug/SKILL.md +14 -0
  18. package/skills/qualia-design/SKILL.md +4 -0
  19. package/skills/qualia-handoff/SKILL.md +5 -9
  20. package/skills/qualia-learn/SKILL.md +4 -0
  21. package/skills/qualia-new/SKILL.md +13 -14
  22. package/skills/qualia-pause/SKILL.md +4 -0
  23. package/skills/qualia-plan/SKILL.md +21 -20
  24. package/skills/qualia-polish/SKILL.md +15 -19
  25. package/skills/qualia-quick/SKILL.md +9 -0
  26. package/skills/qualia-report/SKILL.md +4 -0
  27. package/skills/qualia-resume/SKILL.md +11 -6
  28. package/skills/qualia-review/SKILL.md +4 -0
  29. package/skills/qualia-ship/SKILL.md +10 -13
  30. package/skills/qualia-skill-new/SKILL.md +148 -0
  31. package/skills/qualia-task/SKILL.md +11 -15
  32. package/skills/qualia-verify/SKILL.md +49 -20
  33. package/tests/hooks.test.sh +108 -44
  34. package/hooks/auto-update.sh +0 -56
  35. package/hooks/block-env-edit.sh +0 -11
  36. package/hooks/branch-guard.sh +0 -18
  37. package/hooks/migration-guard.sh +0 -43
  38. package/hooks/pre-compact.sh +0 -11
  39. package/hooks/pre-deploy-gate.sh +0 -50
  40. package/hooks/pre-push.sh +0 -28
  41. package/hooks/session-start.sh +0 -17
@@ -1,43 +0,0 @@
1
- #!/bin/bash
2
- # Catch dangerous SQL patterns in migration files
3
- # Runs as PreToolUse hook on Write/Edit of migration files
4
-
5
- INPUT=$(cat)
6
- FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""' 2>/dev/null)
7
- CONTENT=$(echo "$INPUT" | jq -r '.tool_input.content // .tool_input.new_string // ""' 2>/dev/null)
8
-
9
- # Only check migration/SQL files
10
- case "$FILE" in
11
- *migration*|*migrate*|*.sql) ;;
12
- *) exit 0 ;;
13
- esac
14
-
15
- ERRORS=""
16
-
17
- # DROP TABLE without safeguards
18
- if echo "$CONTENT" | grep -qi "DROP TABLE" && ! echo "$CONTENT" | grep -qi "IF EXISTS"; then
19
- ERRORS="${ERRORS}\n ✗ DROP TABLE without IF EXISTS"
20
- fi
21
-
22
- # DELETE without WHERE
23
- if echo "$CONTENT" | grep -qi "DELETE FROM" && ! echo "$CONTENT" | grep -qi "WHERE"; then
24
- ERRORS="${ERRORS}\n ✗ DELETE FROM without WHERE clause"
25
- fi
26
-
27
- # TRUNCATE (almost always wrong in migrations)
28
- if echo "$CONTENT" | grep -qi "TRUNCATE"; then
29
- ERRORS="${ERRORS}\n ✗ TRUNCATE detected — are you sure?"
30
- fi
31
-
32
- # CREATE TABLE without RLS
33
- if echo "$CONTENT" | grep -qi "CREATE TABLE" && ! echo "$CONTENT" | grep -qi "ENABLE ROW LEVEL SECURITY"; then
34
- ERRORS="${ERRORS}\n ✗ CREATE TABLE without ENABLE ROW LEVEL SECURITY"
35
- fi
36
-
37
- if [ -n "$ERRORS" ]; then
38
- echo "◆ Migration guard — dangerous patterns found:"
39
- echo -e "$ERRORS"
40
- echo ""
41
- echo "Fix these before proceeding. If intentional, ask Fawzi to approve."
42
- exit 2
43
- fi
@@ -1,11 +0,0 @@
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
@@ -1,50 +0,0 @@
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
- # Lint check
16
- if [ -f "package.json" ] && grep -q '"lint"' package.json; then
17
- if ! npm run lint 2>/dev/null; then
18
- echo "BLOCKED: Lint errors. Fix before deploying."
19
- exit 1
20
- fi
21
- echo " ✓ Lint"
22
- fi
23
-
24
- # Test check
25
- if [ -f "package.json" ] && grep -q '"test"' package.json; then
26
- if ! npm test 2>/dev/null; then
27
- echo "BLOCKED: Tests failed. Fix before deploying."
28
- exit 1
29
- fi
30
- echo " ✓ Tests"
31
- fi
32
-
33
- # Build check
34
- if [ -f "package.json" ] && grep -q '"build"' package.json; then
35
- if ! npm run build 2>/dev/null; then
36
- echo "BLOCKED: Build failed. Fix before deploying."
37
- exit 1
38
- fi
39
- echo " ✓ Build"
40
- fi
41
-
42
- # Security: no service_role in client code
43
- LEAKS=$(grep -r "service_role" app/ components/ src/ 2>/dev/null | grep -v node_modules | grep -v ".server." | wc -l)
44
- if [ "$LEAKS" -gt 0 ]; then
45
- echo "BLOCKED: service_role found in client code. Remove before deploying."
46
- exit 1
47
- fi
48
- echo " ✓ Security"
49
-
50
- echo "◆ All gates passed."
package/hooks/pre-push.sh DELETED
@@ -1,28 +0,0 @@
1
- #!/bin/bash
2
- # Update tracking.json timestamps before push
3
- # State.js handles phase/status sync — this just updates commit hash and timestamp
4
-
5
- TRACKING=".planning/tracking.json"
6
-
7
- if [ -f "$TRACKING" ]; then
8
- if ! command -v node &>/dev/null; then
9
- echo "WARNING: node not found, skipping tracking sync" >&2
10
- exit 0
11
- fi
12
-
13
- LAST_COMMIT=$(git log --oneline -1 --format="%h" 2>/dev/null)
14
- NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
15
-
16
- node -e "
17
- const fs = require('fs');
18
- try {
19
- const t = JSON.parse(fs.readFileSync('$TRACKING', 'utf8'));
20
- t.last_commit = '${LAST_COMMIT}';
21
- t.last_updated = '${NOW}';
22
- fs.writeFileSync('$TRACKING', JSON.stringify(t, null, 2) + '\n');
23
- } catch (e) {
24
- process.stderr.write('WARNING: tracking sync failed: ' + e.message + '\n');
25
- }
26
- "
27
- git add "$TRACKING" 2>/dev/null
28
- fi
@@ -1,17 +0,0 @@
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