qualia-framework 2.1.5 → 2.2.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 (76) hide show
  1. package/bin/cli.js +14 -9
  2. package/framework/.claudeignore +51 -0
  3. package/framework/CLAUDE.md +54 -0
  4. package/framework/MCP_SETUP.md +229 -0
  5. package/framework/agents/architecture-strategist.md +1 -1
  6. package/framework/agents/code-simplicity-reviewer.md +1 -1
  7. package/framework/agents/kieran-typescript-reviewer.md +1 -1
  8. package/framework/agents/performance-oracle.md +1 -1
  9. package/framework/agents/qualia-codebase-mapper.md +1 -0
  10. package/framework/agents/qualia-debugger.md +1 -0
  11. package/framework/agents/qualia-executor.md +1 -0
  12. package/framework/agents/qualia-integration-checker.md +1 -0
  13. package/framework/agents/qualia-phase-researcher.md +1 -0
  14. package/framework/agents/qualia-plan-checker.md +1 -0
  15. package/framework/agents/qualia-planner.md +1 -0
  16. package/framework/agents/qualia-project-researcher.md +1 -0
  17. package/framework/agents/qualia-research-synthesizer.md +1 -0
  18. package/framework/agents/qualia-roadmapper.md +1 -0
  19. package/framework/agents/qualia-verifier.md +1 -0
  20. package/framework/agents/security-auditor.md +72 -0
  21. package/framework/agents/team-orchestrator.md +1 -0
  22. package/framework/agents/teams/framework-audit-team.md +66 -0
  23. package/framework/agents/teams/review-team.md +11 -3
  24. package/framework/hooks/block-env-edit.sh +4 -8
  25. package/framework/hooks/branch-guard.sh +2 -5
  26. package/framework/hooks/confirm-delete.sh +7 -4
  27. package/framework/hooks/migration-validate.sh +9 -8
  28. package/framework/hooks/notification-speak.sh +1 -1
  29. package/framework/hooks/pre-commit.sh +22 -10
  30. package/framework/hooks/pre-deploy-gate.sh +5 -6
  31. package/framework/hooks/retention-cleanup.sh +11 -2
  32. package/framework/hooks/save-session-state.sh +22 -0
  33. package/framework/hooks/session-context-loader.sh +27 -29
  34. package/framework/hooks/session-learn.sh +6 -5
  35. package/framework/hooks/skill-announce.sh +109 -6
  36. package/framework/hooks/tool-error-announce.sh +16 -7
  37. package/framework/install.ps1 +323 -0
  38. package/framework/install.sh +306 -0
  39. package/framework/qualia-engine/references/completion-checklists.md +359 -0
  40. package/framework/rules/deployment.md +4 -3
  41. package/framework/rules/speed.md +4 -0
  42. package/framework/skills/animate/SKILL.md +1 -1
  43. package/framework/skills/bolder/SKILL.md +1 -1
  44. package/framework/skills/colorize/SKILL.md +1 -1
  45. package/framework/skills/deep-research/SKILL.md +19 -13
  46. package/framework/skills/delight/SKILL.md +1 -1
  47. package/framework/skills/design-quieter/SKILL.md +1 -1
  48. package/framework/skills/distill/SKILL.md +1 -1
  49. package/framework/skills/qualia-audit-milestone/SKILL.md +1 -1
  50. package/framework/skills/qualia-complete-milestone/SKILL.md +2 -2
  51. package/framework/skills/qualia-design/SKILL.md +2 -2
  52. package/framework/skills/qualia-framework-audit/SKILL.md +604 -0
  53. package/framework/skills/qualia-help/SKILL.md +11 -1
  54. package/framework/skills/qualia-pause-work/SKILL.md +2 -2
  55. package/framework/skills/qualia-review/SKILL.md +1 -1
  56. package/framework/skills/qualia-start/SKILL.md +8 -1
  57. package/framework/skills/qualia-verify-work/SKILL.md +1 -1
  58. package/framework/skills/ship/SKILL.md +1 -1
  59. package/framework/teams/default/inboxes/plan-04.json +9 -0
  60. package/package.json +1 -1
  61. package/framework/askpass.sh +0 -2
  62. package/framework/commands/design.md +0 -53
  63. package/framework/commands/quick-db.md +0 -22
  64. package/framework/config/retention.json +0 -35
  65. package/framework/core/PRINCIPLES.md +0 -77
  66. package/framework/knowledge/claudecode-bible.md +0 -1384
  67. package/framework/knowledge/client-prefs.md +0 -22
  68. package/framework/knowledge/common-fixes.md +0 -25
  69. package/framework/knowledge/deployment-map.md +0 -35
  70. package/framework/knowledge/email-signature.html +0 -1
  71. package/framework/knowledge/employees.md +0 -8
  72. package/framework/knowledge/learned-patterns.md +0 -51
  73. package/framework/knowledge/optimization-research-2026.md +0 -137
  74. package/framework/knowledge/qualia-context.md +0 -67
  75. package/framework/knowledge/supabase-patterns.md +0 -50
  76. package/framework/knowledge/voice-agent-patterns.md +0 -46
package/bin/cli.js CHANGED
@@ -139,7 +139,12 @@ function mergeSettings(existingPath, templatePath) {
139
139
  // Overwrite hooks, permissions, statusLine from template (framework-managed)
140
140
  merged.hooks = template.hooks;
141
141
  merged.permissions = template.permissions;
142
- merged.statusLine = template.statusLine;
142
+ // Use node-based statusline on Windows (no bash), bash on Unix
143
+ if (process.platform === 'win32') {
144
+ merged.statusLine = { type: 'command', command: 'node ~/.claude/statusline-command.js' };
145
+ } else {
146
+ merged.statusLine = template.statusLine;
147
+ }
143
148
 
144
149
  // Preserve user's existing plugins and MCP servers
145
150
  if (existing.enabledPlugins) {
@@ -233,8 +238,8 @@ async function runInstall() {
233
238
  }
234
239
  }
235
240
 
236
- // Copy standalone files
237
- for (const f of ['statusline-command.sh', 'askpass.sh']) {
241
+ // Copy standalone files (both .sh and .js for cross-platform)
242
+ for (const f of ['statusline-command.sh', 'statusline-command.js', 'askpass.sh']) {
238
243
  const src = path.join(FRAMEWORK_DIR, f);
239
244
  if (fs.existsSync(src)) {
240
245
  fs.copyFileSync(src, path.join(CLAUDE_DIR, f));
@@ -251,9 +256,9 @@ async function runInstall() {
251
256
  }
252
257
  }
253
258
  // Make standalone scripts executable
254
- for (const f of ['statusline-command.sh', 'askpass.sh']) {
259
+ for (const f of ['statusline-command.sh', 'statusline-command.js', 'askpass.sh']) {
255
260
  const p = path.join(CLAUDE_DIR, f);
256
- if (fs.existsSync(p)) fs.chmodSync(p, 0o755);
261
+ if (fs.existsSync(p)) try { fs.chmodSync(p, 0o755); } catch {}
257
262
  }
258
263
  // Make qualia-engine bin executable
259
264
  const engineBin = path.join(CLAUDE_DIR, 'qualia-engine', 'bin');
@@ -411,12 +416,12 @@ async function runUpdate() {
411
416
  }
412
417
  }
413
418
 
414
- // Copy standalone files
415
- for (const f of ['statusline-command.sh', 'askpass.sh']) {
419
+ // Copy standalone files (both .sh and .js for cross-platform)
420
+ for (const f of ['statusline-command.sh', 'statusline-command.js', 'askpass.sh']) {
416
421
  const src = path.join(FRAMEWORK_DIR, f);
417
422
  if (fs.existsSync(src)) {
418
423
  fs.copyFileSync(src, path.join(CLAUDE_DIR, f));
419
- fs.chmodSync(path.join(CLAUDE_DIR, f), 0o755);
424
+ try { fs.chmodSync(path.join(CLAUDE_DIR, f), 0o755); } catch {}
420
425
  }
421
426
  }
422
427
 
@@ -424,7 +429,7 @@ async function runUpdate() {
424
429
  const hooksDir = path.join(CLAUDE_DIR, 'hooks');
425
430
  if (fs.existsSync(hooksDir)) {
426
431
  for (const f of fs.readdirSync(hooksDir)) {
427
- if (f.endsWith('.sh')) fs.chmodSync(path.join(hooksDir, f), 0o755);
432
+ if (f.endsWith('.sh')) try { fs.chmodSync(path.join(hooksDir, f), 0o755); } catch {}
428
433
  }
429
434
  }
430
435
 
@@ -0,0 +1,51 @@
1
+ # ~/.claude/.claudeignore
2
+ # Patterns to exclude from Claude Code context
3
+
4
+ # Secrets and credentials
5
+ .env
6
+ .env.*
7
+ *.pem
8
+ *.key
9
+ credentials.json
10
+ *secret*
11
+ .credentials.json
12
+ askpass.sh
13
+
14
+ # Analytics and internal state
15
+ usage-data/
16
+ sessions/
17
+ statsig/
18
+
19
+ # Node modules (anywhere)
20
+ skills/*/node_modules/
21
+ plugins/cache/*/node_modules/
22
+ node_modules/
23
+
24
+ # Large generated directories
25
+ .next/
26
+ dist/
27
+ build/
28
+ *.log
29
+
30
+ # Claude internals (prevent recursion/bloat)
31
+ plugins/cache/
32
+ shell-snapshots/
33
+ debug/
34
+ file-history/
35
+ projects/
36
+ archive/
37
+ todos/
38
+ session-env/
39
+ paste-cache/
40
+ backups/
41
+ cache/
42
+ cowork-knowledge-pack.md
43
+
44
+ # IDE and editor
45
+ .vscode/
46
+ .idea/
47
+
48
+ # History and state files
49
+ history.jsonl
50
+ *.jsonl
51
+ cleanup.log
@@ -0,0 +1,54 @@
1
+ # CLAUDE.md — Qualia Solutions
2
+
3
+ ## Identity
4
+ **Fawzi Goussous** — Founder, Qualia Solutions. Nicosia, Cyprus.
5
+
6
+ - 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
+ ## Role: OWNER
10
+
11
+ Full authority over all projects, deployments, architecture, and client decisions.
12
+ - Deploy directly to production
13
+ - Make architectural decisions unilaterally
14
+ - Access all Supabase projects and service role keys
15
+ - Modify the Qualia framework (CLAUDE.md, skills, hooks)
16
+
17
+ ## Rules
18
+ - Read before Write/Edit — no exceptions
19
+ - Feature branches only — never commit to main/master
20
+ - MVP first. Build only what's asked. No over-engineering.
21
+ - Root cause on failures — no band-aids
22
+ - `npx tsc --noEmit` after multi-file TS changes
23
+ - 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
+ - See `rules/security.md` for auth, RLS, Zod, secrets rules
26
+ - See `rules/frontend.md` for design standards
27
+ - 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
+
31
+ ## Collaboration
32
+ Collaborator, not executor. Speak up about bugs, simpler approaches, bad architecture.
33
+ 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
+
37
+ ## Workflow
38
+ - **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 (Opus) for research and complex reasoning.
40
+ - `/compact` at 60%. `/clear` between tasks. `/learn` after mistakes.
41
+
42
+ ## Qualia Mode (always active)
43
+ These behaviors apply to ALL interactions:
44
+ - **Frontend guard:** Read .planning/DESIGN.md before any frontend file changes
45
+ - **Deploy guard:** Check .planning/REVIEW.md freshness before any deploy command (run /qualia-review to generate)
46
+ - **Intent verification:** Confirm before modifying 3+ files in one response
47
+ - **Task-type detection:** Auto-load relevant skill patterns based on what's being done
48
+ - **Quality defaults:** Security rules, tsc checks, RLS consideration — always enforced
49
+
50
+ ## Compaction — ALWAYS preserve:
51
+ Project path/name/ref, branch, modified files, decisions, test results, in-progress work, errors, Qualia phase/milestone state, Qualia mode active/inactive state, session digest context.
52
+
53
+ ## Learned Patterns & Gotchas
54
+ See ~/.claude/knowledge/learned-patterns.md for full rules and project gotchas.
@@ -0,0 +1,229 @@
1
+ # MCP Server Setup & Security Guide
2
+
3
+ Configuration and security best practices for Model Context Protocol servers.
4
+
5
+ ---
6
+
7
+ ## Current Configuration
8
+
9
+ ### Active MCP Servers (as of 2026-03-30)
10
+
11
+ | Server | Package | Purpose | Status |
12
+ |--------|---------|---------|--------|
13
+ | `filesystem` | `@modelcontextprotocol/server-filesystem` | Local file operations | Active |
14
+ | `context7` | `@context7/mcp-server` | Documentation search | Active |
15
+ | `playwright` | `@playwright/mcp@latest` | Browser automation | Active |
16
+ | `vapi` | `@vapi-ai/mcp-server` | Voice AI integration | Active |
17
+ | `telnyx_api` | `telnyx-mcp-server` | Telecom integration | Active |
18
+ | `elevenlabs` | `@anthropic/elevenlabs-mcp-server` | Audio synthesis | Active |
19
+
20
+ **Removed servers:**
21
+ - `supabase` MCP — replaced by the `/supabase` skill (CLI + Management API, zero context overhead)
22
+ - `n8n-mcp` — removed, not actively used
23
+
24
+ ---
25
+
26
+ ## Server Details
27
+
28
+ ### Filesystem
29
+ ```json
30
+ {
31
+ "filesystem": {
32
+ "command": "npx",
33
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/qualia"]
34
+ }
35
+ }
36
+ ```
37
+ **Security:** Restricts access to home directory only.
38
+
39
+ ---
40
+
41
+ ### Context7
42
+ ```json
43
+ {
44
+ "context7": {
45
+ "command": "npx",
46
+ "args": ["-y", "@context7/mcp-server"]
47
+ }
48
+ }
49
+ ```
50
+ **Purpose:** Search and retrieve up-to-date library documentation.
51
+
52
+ ---
53
+
54
+ ### Playwright
55
+ ```json
56
+ {
57
+ "playwright": {
58
+ "command": "npx",
59
+ "args": ["-y", "@playwright/mcp@latest"]
60
+ }
61
+ }
62
+ ```
63
+ **Purpose:** Browser automation and web testing.
64
+
65
+ ---
66
+
67
+ ### ~~Supabase~~ (REMOVED)
68
+ Replaced by the `/supabase` skill which uses CLI + Management API with zero context overhead.
69
+
70
+ Previously:
71
+ "command": "npx",
72
+ "args": ["-y", "@anthropic-ai/mcp-supabase"],
73
+ "env": {
74
+ "SUPABASE_URL": "${SUPABASE_URL}",
75
+ "SUPABASE_KEY": "${SUPABASE_KEY}"
76
+ }
77
+ }
78
+ }
79
+ ```
80
+ **Security:** Store credentials in `.env.claude` only.
81
+
82
+ ---
83
+
84
+ ## Security Best Practices
85
+
86
+ ### 1. Credential Storage
87
+
88
+ **DO:**
89
+ ```bash
90
+ # Store in .env.claude
91
+ SUPABASE_URL="https://xxx.supabase.co"
92
+ SUPABASE_KEY="your-key-here"
93
+ ```
94
+
95
+ **DON'T:**
96
+ ```json
97
+ // Never put credentials directly in settings.json
98
+ "env": {
99
+ "SUPABASE_KEY": "eyJhbGciOiJIUzI1NiIs..." // BAD!
100
+ }
101
+ ```
102
+
103
+ ### 2. File Permissions
104
+ ```bash
105
+ chmod 600 ~/.claude/.env.claude
106
+ chmod 600 ~/.claude/settings.json
107
+ chmod 600 ~/.claude/.credentials.json
108
+ ```
109
+
110
+ ### 3. Environment Variable Reference
111
+ Use variable interpolation in settings.json:
112
+ ```json
113
+ "env": {
114
+ "API_KEY": "${API_KEY}" // References .env.claude
115
+ }
116
+ ```
117
+
118
+ ### 4. Read-Only Mode
119
+ For production safety, consider read-only configurations:
120
+ ```json
121
+ "env": {
122
+ "SUPABASE_READ_ONLY": "true"
123
+ }
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Adding New MCP Servers
129
+
130
+ ### Step 1: Install the Server
131
+ ```bash
132
+ npx -y @anthropic-ai/mcp-<server-name>
133
+ ```
134
+
135
+ ### Step 2: Add to settings.json
136
+ ```json
137
+ {
138
+ "mcpServers": {
139
+ "new-server": {
140
+ "command": "npx",
141
+ "args": ["-y", "@anthropic-ai/mcp-new-server"],
142
+ "env": {
143
+ "API_KEY": "${NEW_SERVER_API_KEY}"
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ ### Step 3: Add Credentials to .env.claude
151
+ ```bash
152
+ echo 'NEW_SERVER_API_KEY="your-key"' >> ~/.claude/.env.claude
153
+ ```
154
+
155
+ ### Step 4: Restart Claude Code
156
+ ```bash
157
+ source ~/.claude/.env.claude && claude
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Troubleshooting
163
+
164
+ ### Server Not Starting
165
+ 1. Check if package is installed: `npx -y @anthropic-ai/mcp-<name> --help`
166
+ 2. Verify environment variables are set
167
+ 3. Check Claude Code logs: `~/.claude/debug/`
168
+
169
+ ### Authentication Errors
170
+ 1. Verify credentials in `.env.claude`
171
+ 2. Check file permissions
172
+ 3. Ensure variables are exported: `source ~/.env.claude`
173
+
174
+ ### Connection Timeouts
175
+ 1. Check network connectivity
176
+ 2. Verify API endpoint is accessible
177
+ 3. Consider adding timeout configuration
178
+
179
+ ---
180
+
181
+ ## Credential Rotation
182
+
183
+ ### Schedule
184
+ - API keys: Every 90 days
185
+ - OAuth tokens: Automatic refresh
186
+ - Service role keys: Every 90 days
187
+
188
+ ### Rotation Process
189
+ 1. Generate new key in service dashboard
190
+ 2. Update `.env.claude`
191
+ 3. Test connectivity
192
+ 4. Revoke old key
193
+
194
+ ---
195
+
196
+ ## Monitoring
197
+
198
+ ### Health Checks
199
+ MCP servers should respond to basic requests within 5 seconds.
200
+
201
+ ### Log Locations
202
+ - MCP errors: `~/.claude/debug/`
203
+ - Connection issues: Check terminal output
204
+
205
+ ---
206
+
207
+ ## Permissions Matrix
208
+
209
+ | Server | Read | Write | Execute |
210
+ |--------|------|-------|---------|
211
+ | filesystem | ✓ | ✓ | - |
212
+ | supabase | ✓ | ✓ | - |
213
+ | playwright | - | - | ✓ |
214
+ | context7 | ✓ | - | - |
215
+
216
+ ---
217
+
218
+ ## Quick Commands
219
+
220
+ ```bash
221
+ # Start Claude with MCP servers
222
+ source ~/.claude/.env.claude && claude
223
+
224
+ # List active servers
225
+ cat ~/.claude/settings.json | jq '.mcpServers | keys'
226
+
227
+ # Test specific server
228
+ npx -y @anthropic-ai/mcp-supabase --help
229
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: architecture-strategist
3
- description: "Use this agent when you need to analyze code changes from an architectural perspective, evaluate system design decisions, or ensure that modifications align with established architectural patterns. This includes reviewing pull requests for architectural compliance, assessing the impact of new features on system structure, or validating that changes maintain proper component boundaries and design principles. <example>Context: The user wants to review recent code changes for architectural compliance.\\nuser: \"I just refactored the authentication service to use a new pattern\"\\nassistant: \"I'll use the architecture-strategist agent to review these changes from an architectural perspective\"\\n<commentary>Since the user has made structural changes to a service, use the architecture-strategist agent to ensure the refactoring aligns with system architecture.</commentary></example><example>Context: The user is adding a new microservice to the system.\\nuser: \"I've added a new notification service that integrates with our existing services\"\\nassistant: \"Let me analyze this with the architecture-strategist agent to ensure it fits properly within our system architecture\"\\n<commentary>New service additions require architectural review to verify proper boundaries and integration patterns.</commentary></example>"
3
+ description: "Analyze code changes from an architectural perspective component boundaries, coupling, SOLID principles, design pattern compliance. Use after refactors, new service additions, or when validating structural decisions."
4
4
  model: inherit
5
5
  tools: Read, Bash, Grep, Glob
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: code-simplicity-reviewer
3
- description: "Use this agent when you need a final review pass to ensure code changes are as simple and minimal as possible. This agent should be invoked after implementation is complete but before finalizing changes, to identify opportunities for simplification, remove unnecessary complexity, and ensure adherence to YAGNI principles. Examples: <example>Context: The user has just implemented a new feature and wants to ensure it's as simple as possible. user: \"I've finished implementing the user authentication system\" assistant: \"Great! Let me review the implementation for simplicity and minimalism using the code-simplicity-reviewer agent\" <commentary>Since implementation is complete, use the code-simplicity-reviewer agent to identify simplification opportunities.</commentary></example> <example>Context: The user has written complex business logic and wants to simplify it. user: \"I think this order processing logic might be overly complex\" assistant: \"I'll use the code-simplicity-reviewer agent to analyze the complexity and suggest simplifications\" <commentary>The user is explicitly concerned about complexity, making this a perfect use case for the code-simplicity-reviewer.</commentary></example>"
3
+ description: "Final review pass for simplicity and minimalism identifies unnecessary complexity, premature abstractions, YAGNI violations, and dead code. Use after implementation is complete, before finalizing changes."
4
4
  model: inherit
5
5
  tools: Read, Bash, Grep, Glob
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: kieran-typescript-reviewer
3
- description: "Use this agent when you need to review TypeScript code changes with an extremely high quality bar. This agent should be invoked after implementing features, modifying existing code, or creating new TypeScript components. The agent applies Kieran's strict TypeScript conventions and taste preferences to ensure code meets exceptional standards.\\n\\nExamples:\\n- <example>\\n Context: The user has just implemented a new React component with hooks.\\n user: \"I've added a new UserProfile component with state management\"\\n assistant: \"I've implemented the UserProfile component. Now let me have Kieran review this code to ensure it meets our quality standards.\"\\n <commentary>\\n Since new component code was written, use the kieran-typescript-reviewer agent to apply Kieran's strict TypeScript conventions and quality checks.\\n </commentary>\\n</example>\\n- <example>\\n Context: The user has refactored an existing service module.\\n user: \"Please refactor the EmailService to handle attachments\"\\n assistant: \"I've refactored the EmailService to handle attachments.\"\\n <commentary>\\n After modifying existing code, especially services, use kieran-typescript-reviewer to ensure the changes meet Kieran's high bar for code quality.\\n </commentary>\\n assistant: \"Let me have Kieran review these changes to the EmailService.\"\\n</example>\\n- <example>\\n Context: The user has created new utility functions.\\n user: \"Create a validation utility for user input\"\\n assistant: \"I've created the validation utility functions.\"\\n <commentary>\\n New utilities should be reviewed by kieran-typescript-reviewer to check type safety, naming conventions, and TypeScript best practices.\\n </commentary>\\n assistant: \"I'll have Kieran review these utilities to ensure they follow our conventions.\"\\n</example>"
3
+ description: "Review TypeScript code with an extremely high quality bar strict types, naming conventions, pattern adherence, type safety gaps. Use after implementing features, modifying existing code, or creating new TypeScript components."
4
4
  model: inherit
5
5
  tools: Read, Bash, Grep, Glob
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: performance-oracle
3
- description: "Use this agent when you need to analyze code for performance issues, optimize algorithms, identify bottlenecks, or ensure scalability. This includes reviewing database queries, memory usage, caching strategies, and overall system performance. The agent should be invoked after implementing features or when performance concerns arise.\\n\\n<example>\\nContext: The user has just implemented a new feature that processes user data.\\nuser: \"I've implemented the user analytics feature. Can you check if it will scale?\"\\nassistant: \"I'll use the performance-oracle agent to analyze the scalability and performance characteristics of your implementation.\"\\n<commentary>\\nSince the user is concerned about scalability, use the Task tool to launch the performance-oracle agent to analyze the code for performance issues.\\n</commentary>\\n</example>\\n\\n<example>\\nContext: The user is experiencing slow API responses.\\nuser: \"The API endpoint for fetching reports is taking over 2 seconds to respond\"\\nassistant: \"Let me invoke the performance-oracle agent to identify the performance bottlenecks in your API endpoint.\"\\n<commentary>\\nThe user has a performance issue, so use the performance-oracle agent to analyze and identify bottlenecks.\\n</commentary>\\n</example>\\n\\n<example>\\nContext: After writing a data processing algorithm.\\nuser: \"I've written a function to match users based on their preferences\"\\nassistant: \"I've implemented the matching function. Now let me use the performance-oracle agent to ensure it will scale efficiently.\"\\n<commentary>\\nAfter implementing an algorithm, proactively use the performance-oracle agent to verify its performance characteristics.\\n</commentary>\\n</example>"
3
+ description: "Analyze code for performance issues database queries, algorithms, memory usage, caching strategies, bundle size, render performance. Use after implementing features or when performance concerns arise."
4
4
  model: inherit
5
5
  tools: Read, Bash, Grep, Glob
6
6
  ---
@@ -2,6 +2,7 @@
2
2
  name: qualia-codebase-mapper
3
3
  description: Explores codebase and writes structured analysis documents. Spawned by map-codebase with a focus area (tech, arch, quality, concerns). Writes documents directly to reduce orchestrator context load.
4
4
  tools: Read, Bash, Grep, Glob, Write
5
+ model: inherit
5
6
  color: cyan
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-debugger
3
3
  description: Investigates bugs using scientific method, manages debug sessions, handles checkpoints. Spawned by /qualia:debug orchestrator.
4
4
  tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch
5
+ model: inherit
5
6
  color: orange
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-executor
3
3
  description: Executes Qualia plans with atomic commits, deviation handling, checkpoint protocols, and state management. Spawned by execute-phase orchestrator or execute-plan command.
4
4
  tools: Read, Write, Edit, Bash, Grep, Glob
5
+ model: inherit
5
6
  color: yellow
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-integration-checker
3
3
  description: Verifies cross-phase integration and E2E flows. Checks that phases connect properly and user workflows complete end-to-end.
4
4
  tools: Read, Bash, Grep, Glob
5
+ model: inherit
5
6
  color: blue
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-phase-researcher
3
3
  description: Researches how to implement a phase before planning. Produces RESEARCH.md consumed by qualia-planner. Spawned by /qualia:plan-phase orchestrator.
4
4
  tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch, mcp__context7__*
5
+ model: inherit
5
6
  color: cyan
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-plan-checker
3
3
  description: Verifies plans will achieve phase goal before execution. Goal-backward analysis of plan quality. Spawned by /qualia:plan-phase orchestrator.
4
4
  tools: Read, Bash, Glob, Grep
5
+ model: inherit
5
6
  color: green
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-planner
3
3
  description: Creates executable phase plans with task breakdown, dependency analysis, and goal-backward verification. Spawned by /qualia:plan-phase orchestrator.
4
4
  tools: Read, Write, Bash, Glob, Grep, WebFetch, mcp__context7__*
5
+ model: inherit
5
6
  color: green
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-project-researcher
3
3
  description: Researches domain ecosystem before roadmap creation. Produces files in .planning/research/ consumed during roadmap creation. Spawned by /qualia:new-project or /qualia:new-milestone orchestrators.
4
4
  tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch, mcp__context7__*
5
+ model: inherit
5
6
  color: cyan
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-research-synthesizer
3
3
  description: Synthesizes research outputs from parallel researcher agents into SUMMARY.md. Spawned by /qualia:new-project after 4 researcher agents complete.
4
4
  tools: Read, Write, Bash
5
+ model: inherit
5
6
  color: purple
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-roadmapper
3
3
  description: Creates project roadmaps with phase breakdown, requirement mapping, success criteria derivation, and coverage validation. Spawned by /qualia:new-project orchestrator.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
+ model: inherit
5
6
  color: purple
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
  name: qualia-verifier
3
3
  description: Verifies phase goal achievement through goal-backward analysis. Checks codebase delivers what phase promised, not just that tasks completed. Creates VERIFICATION.md report.
4
4
  tools: Read, Bash, Grep, Glob
5
+ model: inherit
5
6
  color: green
6
7
  ---
7
8
 
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: security-auditor
3
+ description: Security audit specialist — RLS policies, service_role exposure, auth patterns, input validation, secrets scanning, dependency vulnerabilities. Use when auditing a project's security posture before deploy or client handoff.
4
+ model: inherit
5
+ tools: Read, Bash, Grep, Glob
6
+ color: red
7
+ ---
8
+
9
+ You are a security auditor for web applications built with Next.js, Supabase, and Vercel. Your job is to find security vulnerabilities, not code quality issues.
10
+
11
+ ## Audit Dimensions
12
+
13
+ ### 1. Supabase RLS
14
+ For each table in the project:
15
+ - Verify RLS is enabled
16
+ - Check SELECT/INSERT/UPDATE/DELETE policies exist
17
+ - Verify policies use `auth.uid()` — never trust client-provided IDs
18
+ - Flag tables with no policies (wide open)
19
+
20
+ ### 2. Service Role Key Exposure
21
+ Scan for service_role in client-side code:
22
+ ```bash
23
+ grep -r "service_role\|SERVICE_ROLE\|supabase.*service" --include="*.ts" --include="*.tsx" \
24
+ --exclude-dir=node_modules --exclude-dir=.next \
25
+ | grep -v "server\.\|api/\|supabase/server\|lib/supabase/server\|edge-functions\|supabase/functions"
26
+ ```
27
+ Any match in a client component is **CRITICAL**.
28
+
29
+ ### 3. Auth Pattern Verification
30
+ - Server-side mutations use `lib/supabase/server.ts` (not `client.ts`)
31
+ - API routes derive user from `auth.uid()`, never from request body/params
32
+ - Middleware protects authenticated routes
33
+ - Auth tokens have expiry/refresh
34
+
35
+ ### 4. Input Validation
36
+ - All user inputs validated with Zod or equivalent
37
+ - No raw `req.body` usage without validation
38
+ - No `dangerouslySetInnerHTML` or `eval()`
39
+ - No `innerHTML =` or `document.write()`
40
+
41
+ ### 5. Secrets & Environment
42
+ - `.env` files in `.gitignore`
43
+ - No hardcoded API keys, passwords, or tokens in source
44
+ - `NEXT_PUBLIC_` only for client-safe values
45
+ - Service role key only in server contexts
46
+
47
+ ### 6. HTTP Security
48
+ - CORS properly restricted (not wildcard `*`)
49
+ - Rate limiting on auth endpoints
50
+ - Security headers configured (CSP, HSTS, X-Frame-Options)
51
+ - HTTPS enforced
52
+
53
+ ### 7. Dependency Vulnerabilities
54
+ ```bash
55
+ npm audit --json 2>/dev/null | node -e "const d=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8'));console.log('Vulnerabilities:',d.metadata?.vulnerabilities||'unknown')"
56
+ ```
57
+
58
+ ### 8. Migration Safety
59
+ - No destructive migrations without guards (DROP TABLE, DROP COLUMN)
60
+ - New tables have corresponding RLS policies
61
+ - No migrations that disable RLS
62
+
63
+ ## Output Format
64
+
65
+ For EVERY finding:
66
+ - **What**: description
67
+ - **Where**: file:line
68
+ - **Impact**: what an attacker could do
69
+ - **Fix**: concrete remediation
70
+ - **Severity**: CRITICAL / HIGH / MEDIUM / LOW
71
+
72
+ CRITICAL = data breach risk. HIGH = auth bypass risk. MEDIUM = defense-in-depth gap. LOW = best practice.
@@ -2,6 +2,7 @@
2
2
  name: team-orchestrator
3
3
  description: Meta-agent that coordinates specialist agent teams using pipeline, fan-out/fan-in, or review loop patterns. Spawned by /team command or Qualia execute-phase with team field.
4
4
  tools: Read, Write, Edit, Bash, Grep, Glob
5
+ model: inherit
5
6
  color: magenta
6
7
  ---
7
8