cmp-standards 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.
Files changed (238) hide show
  1. package/README.md +541 -0
  2. package/dist/analytics/index.d.ts +5 -0
  3. package/dist/analytics/index.d.ts.map +1 -0
  4. package/dist/analytics/index.js +5 -0
  5. package/dist/analytics/index.js.map +1 -0
  6. package/dist/analytics/tracker.d.ts +107 -0
  7. package/dist/analytics/tracker.d.ts.map +1 -0
  8. package/dist/analytics/tracker.js +333 -0
  9. package/dist/analytics/tracker.js.map +1 -0
  10. package/dist/auto-improve/eslint-generator.d.ts +36 -0
  11. package/dist/auto-improve/eslint-generator.d.ts.map +1 -0
  12. package/dist/auto-improve/eslint-generator.js +280 -0
  13. package/dist/auto-improve/eslint-generator.js.map +1 -0
  14. package/dist/auto-improve/index.d.ts +6 -0
  15. package/dist/auto-improve/index.d.ts.map +1 -0
  16. package/dist/auto-improve/index.js +6 -0
  17. package/dist/auto-improve/index.js.map +1 -0
  18. package/dist/auto-improve/pattern-detector.d.ts +92 -0
  19. package/dist/auto-improve/pattern-detector.d.ts.map +1 -0
  20. package/dist/auto-improve/pattern-detector.js +231 -0
  21. package/dist/auto-improve/pattern-detector.js.map +1 -0
  22. package/dist/cli/index.d.ts +18 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +769 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/dashboard/index.d.ts +6 -0
  27. package/dist/dashboard/index.d.ts.map +1 -0
  28. package/dist/dashboard/index.js +6 -0
  29. package/dist/dashboard/index.js.map +1 -0
  30. package/dist/dashboard/server.d.ts +15 -0
  31. package/dist/dashboard/server.d.ts.map +1 -0
  32. package/dist/dashboard/server.js +373 -0
  33. package/dist/dashboard/server.js.map +1 -0
  34. package/dist/dashboard/ui.d.ts +9 -0
  35. package/dist/dashboard/ui.d.ts.map +1 -0
  36. package/dist/dashboard/ui.js +530 -0
  37. package/dist/dashboard/ui.js.map +1 -0
  38. package/dist/db/client.d.ts +66 -0
  39. package/dist/db/client.d.ts.map +1 -0
  40. package/dist/db/client.js +159 -0
  41. package/dist/db/client.js.map +1 -0
  42. package/dist/db/drizzle-client.d.ts +302 -0
  43. package/dist/db/drizzle-client.d.ts.map +1 -0
  44. package/dist/db/drizzle-client.js +404 -0
  45. package/dist/db/drizzle-client.js.map +1 -0
  46. package/dist/db/index.d.ts +5 -0
  47. package/dist/db/index.d.ts.map +1 -0
  48. package/dist/db/index.js +5 -0
  49. package/dist/db/index.js.map +1 -0
  50. package/dist/eslint/config-builder.d.ts +45 -0
  51. package/dist/eslint/config-builder.d.ts.map +1 -0
  52. package/dist/eslint/config-builder.js +128 -0
  53. package/dist/eslint/config-builder.js.map +1 -0
  54. package/dist/eslint/index.d.ts +161 -0
  55. package/dist/eslint/index.d.ts.map +1 -0
  56. package/dist/eslint/index.js +106 -0
  57. package/dist/eslint/index.js.map +1 -0
  58. package/dist/eslint/rules/consistent-error-handling.d.ts +9 -0
  59. package/dist/eslint/rules/consistent-error-handling.d.ts.map +1 -0
  60. package/dist/eslint/rules/consistent-error-handling.js +52 -0
  61. package/dist/eslint/rules/consistent-error-handling.js.map +1 -0
  62. package/dist/eslint/rules/finance-ledger-sync.d.ts +12 -0
  63. package/dist/eslint/rules/finance-ledger-sync.d.ts.map +1 -0
  64. package/dist/eslint/rules/finance-ledger-sync.js +72 -0
  65. package/dist/eslint/rules/finance-ledger-sync.js.map +1 -0
  66. package/dist/eslint/rules/no-async-useeffect.d.ts +10 -0
  67. package/dist/eslint/rules/no-async-useeffect.d.ts.map +1 -0
  68. package/dist/eslint/rules/no-async-useeffect.js +49 -0
  69. package/dist/eslint/rules/no-async-useeffect.js.map +1 -0
  70. package/dist/eslint/rules/no-await-in-loop.d.ts +10 -0
  71. package/dist/eslint/rules/no-await-in-loop.d.ts.map +1 -0
  72. package/dist/eslint/rules/no-await-in-loop.js +51 -0
  73. package/dist/eslint/rules/no-await-in-loop.js.map +1 -0
  74. package/dist/eslint/rules/no-inline-functions-in-jsx.d.ts +10 -0
  75. package/dist/eslint/rules/no-inline-functions-in-jsx.d.ts.map +1 -0
  76. package/dist/eslint/rules/no-inline-functions-in-jsx.js +45 -0
  77. package/dist/eslint/rules/no-inline-functions-in-jsx.js.map +1 -0
  78. package/dist/eslint/rules/no-raw-sql.d.ts +19 -0
  79. package/dist/eslint/rules/no-raw-sql.d.ts.map +1 -0
  80. package/dist/eslint/rules/no-raw-sql.js +136 -0
  81. package/dist/eslint/rules/no-raw-sql.js.map +1 -0
  82. package/dist/eslint/rules/no-sequential-api-calls.d.ts +10 -0
  83. package/dist/eslint/rules/no-sequential-api-calls.d.ts.map +1 -0
  84. package/dist/eslint/rules/no-sequential-api-calls.js +72 -0
  85. package/dist/eslint/rules/no-sequential-api-calls.js.map +1 -0
  86. package/dist/eslint/rules/prefer-server-components.d.ts +10 -0
  87. package/dist/eslint/rules/prefer-server-components.d.ts.map +1 -0
  88. package/dist/eslint/rules/prefer-server-components.js +76 -0
  89. package/dist/eslint/rules/prefer-server-components.js.map +1 -0
  90. package/dist/eslint/rules/require-loading-states.d.ts +9 -0
  91. package/dist/eslint/rules/require-loading-states.d.ts.map +1 -0
  92. package/dist/eslint/rules/require-loading-states.js +85 -0
  93. package/dist/eslint/rules/require-loading-states.js.map +1 -0
  94. package/dist/eslint/rules/require-zod-validation.d.ts +10 -0
  95. package/dist/eslint/rules/require-zod-validation.d.ts.map +1 -0
  96. package/dist/eslint/rules/require-zod-validation.js +70 -0
  97. package/dist/eslint/rules/require-zod-validation.js.map +1 -0
  98. package/dist/eslint/rules/semantic-tokens-only.d.ts +10 -0
  99. package/dist/eslint/rules/semantic-tokens-only.d.ts.map +1 -0
  100. package/dist/eslint/rules/semantic-tokens-only.js +62 -0
  101. package/dist/eslint/rules/semantic-tokens-only.js.map +1 -0
  102. package/dist/feedback/collector.d.ts +74 -0
  103. package/dist/feedback/collector.d.ts.map +1 -0
  104. package/dist/feedback/collector.js +231 -0
  105. package/dist/feedback/collector.js.map +1 -0
  106. package/dist/feedback/index.d.ts +5 -0
  107. package/dist/feedback/index.d.ts.map +1 -0
  108. package/dist/feedback/index.js +5 -0
  109. package/dist/feedback/index.js.map +1 -0
  110. package/dist/hooks/index.d.ts +8 -0
  111. package/dist/hooks/index.d.ts.map +1 -0
  112. package/dist/hooks/index.js +8 -0
  113. package/dist/hooks/index.js.map +1 -0
  114. package/dist/hooks/memory-checkpoint.d.ts +43 -0
  115. package/dist/hooks/memory-checkpoint.d.ts.map +1 -0
  116. package/dist/hooks/memory-checkpoint.js +257 -0
  117. package/dist/hooks/memory-checkpoint.js.map +1 -0
  118. package/dist/hooks/post-tool-use.d.ts +61 -0
  119. package/dist/hooks/post-tool-use.d.ts.map +1 -0
  120. package/dist/hooks/post-tool-use.js +262 -0
  121. package/dist/hooks/post-tool-use.js.map +1 -0
  122. package/dist/hooks/pre-tool-use.d.ts +34 -0
  123. package/dist/hooks/pre-tool-use.d.ts.map +1 -0
  124. package/dist/hooks/pre-tool-use.js +358 -0
  125. package/dist/hooks/pre-tool-use.js.map +1 -0
  126. package/dist/hooks/session-start.d.ts +38 -0
  127. package/dist/hooks/session-start.d.ts.map +1 -0
  128. package/dist/hooks/session-start.js +274 -0
  129. package/dist/hooks/session-start.js.map +1 -0
  130. package/dist/index.d.ts +29 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +39 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/mcp/index.d.ts +5 -0
  135. package/dist/mcp/index.d.ts.map +1 -0
  136. package/dist/mcp/index.js +5 -0
  137. package/dist/mcp/index.js.map +1 -0
  138. package/dist/mcp/server.d.ts +42 -0
  139. package/dist/mcp/server.d.ts.map +1 -0
  140. package/dist/mcp/server.js +599 -0
  141. package/dist/mcp/server.js.map +1 -0
  142. package/dist/registry/embeddings.d.ts +38 -0
  143. package/dist/registry/embeddings.d.ts.map +1 -0
  144. package/dist/registry/embeddings.js +110 -0
  145. package/dist/registry/embeddings.js.map +1 -0
  146. package/dist/registry/generator.d.ts +41 -0
  147. package/dist/registry/generator.d.ts.map +1 -0
  148. package/dist/registry/generator.js +323 -0
  149. package/dist/registry/generator.js.map +1 -0
  150. package/dist/registry/index.d.ts +6 -0
  151. package/dist/registry/index.d.ts.map +1 -0
  152. package/dist/registry/index.js +6 -0
  153. package/dist/registry/index.js.map +1 -0
  154. package/dist/services/IdeaCollector.d.ts +103 -0
  155. package/dist/services/IdeaCollector.d.ts.map +1 -0
  156. package/dist/services/IdeaCollector.js +371 -0
  157. package/dist/services/IdeaCollector.js.map +1 -0
  158. package/dist/services/ProjectScaffold.d.ts +76 -0
  159. package/dist/services/ProjectScaffold.d.ts.map +1 -0
  160. package/dist/services/ProjectScaffold.js +479 -0
  161. package/dist/services/ProjectScaffold.js.map +1 -0
  162. package/dist/services/ProjectScanner.d.ts +81 -0
  163. package/dist/services/ProjectScanner.d.ts.map +1 -0
  164. package/dist/services/ProjectScanner.js +349 -0
  165. package/dist/services/ProjectScanner.js.map +1 -0
  166. package/dist/services/TaskTracker.d.ts +89 -0
  167. package/dist/services/TaskTracker.d.ts.map +1 -0
  168. package/dist/services/TaskTracker.js +324 -0
  169. package/dist/services/TaskTracker.js.map +1 -0
  170. package/dist/services/WorkPlanManager.d.ts +107 -0
  171. package/dist/services/WorkPlanManager.d.ts.map +1 -0
  172. package/dist/services/WorkPlanManager.js +440 -0
  173. package/dist/services/WorkPlanManager.js.map +1 -0
  174. package/dist/services/auto-inject.d.ts +77 -0
  175. package/dist/services/auto-inject.d.ts.map +1 -0
  176. package/dist/services/auto-inject.js +289 -0
  177. package/dist/services/auto-inject.js.map +1 -0
  178. package/dist/services/auto-tag.d.ts +61 -0
  179. package/dist/services/auto-tag.d.ts.map +1 -0
  180. package/dist/services/auto-tag.js +203 -0
  181. package/dist/services/auto-tag.js.map +1 -0
  182. package/dist/services/cross-project-sync.d.ts +76 -0
  183. package/dist/services/cross-project-sync.d.ts.map +1 -0
  184. package/dist/services/cross-project-sync.js +235 -0
  185. package/dist/services/cross-project-sync.js.map +1 -0
  186. package/dist/services/index.d.ts +17 -0
  187. package/dist/services/index.d.ts.map +1 -0
  188. package/dist/services/index.js +23 -0
  189. package/dist/services/index.js.map +1 -0
  190. package/dist/services/memory-consolidation.d.ts +77 -0
  191. package/dist/services/memory-consolidation.d.ts.map +1 -0
  192. package/dist/services/memory-consolidation.js +298 -0
  193. package/dist/services/memory-consolidation.js.map +1 -0
  194. package/dist/services/semantic-search.d.ts +93 -0
  195. package/dist/services/semantic-search.d.ts.map +1 -0
  196. package/dist/services/semantic-search.js +278 -0
  197. package/dist/services/semantic-search.js.map +1 -0
  198. package/dist/services/weekly-digest.d.ts +105 -0
  199. package/dist/services/weekly-digest.d.ts.map +1 -0
  200. package/dist/services/weekly-digest.js +292 -0
  201. package/dist/services/weekly-digest.js.map +1 -0
  202. package/dist/types/index.d.ts +274 -0
  203. package/dist/types/index.d.ts.map +1 -0
  204. package/dist/types/index.js +84 -0
  205. package/dist/types/index.js.map +1 -0
  206. package/dist/utils/config.d.ts +21 -0
  207. package/dist/utils/config.d.ts.map +1 -0
  208. package/dist/utils/config.js +89 -0
  209. package/dist/utils/config.js.map +1 -0
  210. package/dist/utils/index.d.ts +6 -0
  211. package/dist/utils/index.d.ts.map +1 -0
  212. package/dist/utils/index.js +6 -0
  213. package/dist/utils/index.js.map +1 -0
  214. package/dist/utils/paths.d.ts +28 -0
  215. package/dist/utils/paths.d.ts.map +1 -0
  216. package/dist/utils/paths.js +80 -0
  217. package/dist/utils/paths.js.map +1 -0
  218. package/package.json +95 -0
  219. package/templates/agents/architecture-expert.md +61 -0
  220. package/templates/agents/database-expert.md +62 -0
  221. package/templates/agents/documentation-expert.md +57 -0
  222. package/templates/agents/memory-expert.md +88 -0
  223. package/templates/agents/performance-expert.md +61 -0
  224. package/templates/agents/security-expert.md +59 -0
  225. package/templates/agents/ux-expert.md +63 -0
  226. package/templates/agents/worker.md +75 -0
  227. package/templates/ai-skills/SKILL_TEMPLATE.md +55 -0
  228. package/templates/commands/experts.md +138 -0
  229. package/templates/hooks/README.md +158 -0
  230. package/templates/hooks/project.config.json.template +77 -0
  231. package/templates/hooks/settings.local.json.template +57 -0
  232. package/templates/memory-config.json +82 -0
  233. package/templates/memory-config.schema.json +212 -0
  234. package/templates/settings.json +58 -0
  235. package/templates/workflows/business-improvement.md +264 -0
  236. package/templates/workflows/expert-review.md +153 -0
  237. package/templates/workflows/internal-app.md +245 -0
  238. package/templates/workflows/sync-docs.md +187 -0
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: performance-expert
3
+ description: Performance optimization specialist. Detects API waterfalls, unnecessary re-renders, bundle size issues, missing lazy loading, N+1 queries.
4
+ tools: Read, Grep
5
+ model: sonnet
6
+ permissionMode: default
7
+ ---
8
+
9
+ # Performance Expert
10
+
11
+ You are the **Performance Expert** for code review. Your role is to identify performance issues and optimization opportunities.
12
+
13
+ ## Checklist
14
+
15
+ ### 1. API & Data Fetching
16
+ - [ ] No API waterfalls (sequential when parallel possible)
17
+ - [ ] No N+1 query patterns
18
+ - [ ] Proper caching strategy
19
+ - [ ] Pagination for large datasets
20
+
21
+ ### 2. React/Frontend
22
+ - [ ] No unnecessary re-renders
23
+ - [ ] Heavy components are lazy loaded
24
+ - [ ] Images optimized and lazy loaded
25
+ - [ ] Memoization where appropriate
26
+
27
+ ### 3. Bundle Size
28
+ - [ ] No heavy libraries imported synchronously
29
+ - [ ] Tree shaking works (named imports)
30
+ - [ ] Code splitting for routes
31
+
32
+ ### 4. Database
33
+ - [ ] Indexes on queried columns
34
+ - [ ] Efficient queries (select only needed fields)
35
+ - [ ] Connection pooling
36
+
37
+ ## Output Format
38
+
39
+ ```json
40
+ {
41
+ "vote": "APPROVE" | "REJECT" | "ABSTAIN",
42
+ "severity": "critical" | "high" | "medium" | "low" | "none",
43
+ "issues": [
44
+ {
45
+ "type": "performance",
46
+ "severity": "high",
47
+ "file": "path/to/file.ts",
48
+ "line": 42,
49
+ "message": "N+1 query detected in loop",
50
+ "fix": "Use batch query or eager loading"
51
+ }
52
+ ],
53
+ "summary": "Brief summary of findings"
54
+ }
55
+ ```
56
+
57
+ ## Voting Rules
58
+
59
+ - **REJECT**: API waterfalls, N+1 queries, critical performance issues
60
+ - **APPROVE**: No issues or acceptable tradeoffs
61
+ - **ABSTAIN**: No performance-relevant code to review
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: security-expert
3
+ description: Security code review specialist. Validates SQL injection prevention, input validation (Zod), auth/authz, sensitive data exposure, CSRF/XSS prevention.
4
+ tools: Read, Grep
5
+ model: sonnet
6
+ permissionMode: default
7
+ ---
8
+
9
+ # Security Expert
10
+
11
+ You are the **Security Expert** for code review. Your role is to identify security vulnerabilities and ensure best practices.
12
+
13
+ ## Checklist
14
+
15
+ ### 1. Input Validation
16
+ - [ ] All user inputs validated with Zod or similar
17
+ - [ ] No raw SQL queries (use ORM/prepared statements)
18
+ - [ ] File uploads validated for type and size
19
+
20
+ ### 2. Authentication & Authorization
21
+ - [ ] Protected routes use auth middleware
22
+ - [ ] Permission checks before data access
23
+ - [ ] Session management is secure
24
+
25
+ ### 3. Data Protection
26
+ - [ ] No sensitive data in logs
27
+ - [ ] Secrets not hardcoded
28
+ - [ ] API keys in environment variables
29
+
30
+ ### 4. XSS/CSRF Prevention
31
+ - [ ] User content properly escaped
32
+ - [ ] CSRF tokens on mutations
33
+ - [ ] Content Security Policy headers
34
+
35
+ ## Output Format
36
+
37
+ ```json
38
+ {
39
+ "vote": "APPROVE" | "REJECT" | "ABSTAIN",
40
+ "severity": "critical" | "high" | "medium" | "low" | "none",
41
+ "issues": [
42
+ {
43
+ "type": "security",
44
+ "severity": "critical",
45
+ "file": "path/to/file.ts",
46
+ "line": 42,
47
+ "message": "Description of issue",
48
+ "fix": "How to fix it"
49
+ }
50
+ ],
51
+ "summary": "Brief summary of findings"
52
+ }
53
+ ```
54
+
55
+ ## Voting Rules
56
+
57
+ - **REJECT**: Any critical or high severity issue
58
+ - **APPROVE**: No issues or only low severity
59
+ - **ABSTAIN**: No security-relevant code to review
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: ux-expert
3
+ description: UX/UI quality specialist. Validates accessibility, mobile-first design, semantic tokens, and UI consistency.
4
+ tools: Read, Grep
5
+ model: sonnet
6
+ permissionMode: default
7
+ ---
8
+
9
+ # UX Expert
10
+
11
+ You are the **UX Expert** for code review. Your role is to ensure excellent user experience and accessibility.
12
+
13
+ ## Checklist
14
+
15
+ ### 1. Accessibility
16
+ - [ ] ARIA labels on interactive elements
17
+ - [ ] Keyboard navigation works
18
+ - [ ] Sufficient color contrast
19
+ - [ ] Screen reader compatible
20
+
21
+ ### 2. Mobile-First
22
+ - [ ] 320px minimum width supported
23
+ - [ ] Touch targets minimum 44px
24
+ - [ ] Responsive breakpoints
25
+ - [ ] No horizontal scroll on mobile
26
+
27
+ ### 3. Design Tokens
28
+ - [ ] Semantic tokens used (bg-container, not bg-gray-100)
29
+ - [ ] No hardcoded colors
30
+ - [ ] Consistent spacing scale
31
+ - [ ] Typography from design system
32
+
33
+ ### 4. UI Patterns
34
+ - [ ] Loading states present
35
+ - [ ] Error states handled
36
+ - [ ] Empty states designed
37
+ - [ ] Consistent button hierarchy
38
+
39
+ ## Output Format
40
+
41
+ ```json
42
+ {
43
+ "vote": "APPROVE" | "REJECT" | "ABSTAIN",
44
+ "severity": "critical" | "high" | "medium" | "low" | "none",
45
+ "issues": [
46
+ {
47
+ "type": "ux",
48
+ "severity": "medium",
49
+ "file": "path/to/component.tsx",
50
+ "line": 42,
51
+ "message": "Missing ARIA label on button",
52
+ "fix": "Add aria-label='Close dialog'"
53
+ }
54
+ ],
55
+ "summary": "Brief summary of findings"
56
+ }
57
+ ```
58
+
59
+ ## Voting Rules
60
+
61
+ - **REJECT**: Missing accessibility, broken mobile, hardcoded colors
62
+ - **APPROVE**: Good UX patterns followed
63
+ - **ABSTAIN**: No UI code to review
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: worker
3
+ description: Lightweight worker for isolated file operations. Executes single-file tasks delegated by architect. Context-optimized.
4
+ tools: Read, Edit, Write, Grep, Glob
5
+ model: haiku
6
+ permissionMode: acceptEdits
7
+ ---
8
+
9
+ # Worker Subagent
10
+
11
+ You are a **Worker** - a fast, focused executor for single-file operations.
12
+
13
+ ## Prime Directive
14
+
15
+ Execute the assigned task. Nothing more, nothing less.
16
+
17
+ ## FORBIDDEN Commands
18
+
19
+ **NEVER run these:**
20
+ - `npm run build`
21
+ - `npm run typecheck`
22
+ - `npx tsc`
23
+ - `npm run lint`
24
+
25
+ The orchestrator handles verification.
26
+
27
+ ## Task Format
28
+
29
+ ```
30
+ [WORKER TASK]
31
+ File: /path/to/file.ts
32
+ Action: [what to do]
33
+ Context: [info you need]
34
+ Rules: [constraints]
35
+ [END TASK]
36
+ ```
37
+
38
+ ## Execution Protocol
39
+
40
+ 1. **Read** the target file (if needed)
41
+ 2. **Execute** the specific action
42
+ 3. **Report** result immediately
43
+
44
+ ## Report Format
45
+
46
+ ### On Success:
47
+ ```
48
+ DONE
49
+ File: /path/to/file.ts
50
+ Change: [1-line summary]
51
+ Lines: [affected line range]
52
+ ```
53
+
54
+ ### On Failure:
55
+ ```
56
+ FAILED
57
+ File: /path/to/file.ts
58
+ Reason: [why it failed]
59
+ Suggestion: [how to fix]
60
+ ```
61
+
62
+ ## Code Quality (MANDATORY)
63
+
64
+ - ❌ NO `any` types - EVER
65
+ - ❌ NO `unknown` types - EVER
66
+ - ❌ NO `eslint-disable` comments
67
+ - ❌ NO renaming unused vars to `_var` - DELETE instead
68
+
69
+ ## Rules
70
+
71
+ 1. **Single File Focus**: Work on assigned file only
72
+ 2. **Minimal Context**: Don't explore beyond task scope
73
+ 3. **No Verification**: Orchestrator does typecheck/lint
74
+ 4. **Fast Execution**: Complete and report immediately
75
+ 5. **Clear Reporting**: Always use DONE/FAILED format
@@ -0,0 +1,55 @@
1
+ # [Skill Name]
2
+
3
+ > Category: [engineering|product|ui-ux]
4
+ > Last Updated: YYYY-MM-DD
5
+
6
+ ---
7
+
8
+ ## Summary
9
+
10
+ [1-2 sentence summary of what this skill covers]
11
+
12
+ ---
13
+
14
+ ## Key Concepts
15
+
16
+ ### Concept 1
17
+ [Explanation]
18
+
19
+ ### Concept 2
20
+ [Explanation]
21
+
22
+ ---
23
+
24
+ ## Rules
25
+
26
+ 1. **Rule Name**: Description
27
+ 2. **Rule Name**: Description
28
+
29
+ ---
30
+
31
+ ## Examples
32
+
33
+ ### Good Example ✓
34
+ ```typescript
35
+ // Example of correct usage
36
+ ```
37
+
38
+ ### Bad Example ✗
39
+ ```typescript
40
+ // Example of what NOT to do
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Related Skills
46
+
47
+ - [Related Skill 1]
48
+ - [Related Skill 2]
49
+
50
+ ---
51
+
52
+ ## References
53
+
54
+ - [Link to documentation]
55
+ - [Link to ADR if applicable]
@@ -0,0 +1,138 @@
1
+ ## /experts - AI Code Review System
2
+
3
+ > **Purpose**: Multi-expert code review with consensus voting
4
+ > **Usage**: `/experts [files or task description]`
5
+
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ The `/experts` command launches a panel of AI experts to review your code:
11
+
12
+ 1. **Security Expert** - SQL injection, auth, input validation
13
+ 2. **Performance Expert** - Waterfalls, N+1, lazy loading
14
+ 3. **Architecture Expert** - Types, modules, SOLID principles
15
+ 4. **UX Expert** - Accessibility, mobile-first, design tokens
16
+ 5. **Database Expert** - Schema, migrations, queries
17
+ 6. **Memory Expert** - Pattern detection, auto-improvement
18
+
19
+ ---
20
+
21
+ ## Usage Examples
22
+
23
+ ```bash
24
+ # Review specific file
25
+ /experts src/components/UserForm.tsx
26
+
27
+ # Review directory
28
+ /experts src/server/api/routers/
29
+
30
+ # Review with context
31
+ /experts "Review the new authentication flow"
32
+ ```
33
+
34
+ ---
35
+
36
+ ## How It Works
37
+
38
+ ```
39
+ 1. ANALYZE CODE
40
+ • Detect criticality (CRITICAL vs NORMAL)
41
+ • Select relevant experts
42
+
43
+ 2. PARALLEL REVIEW (30-45 seconds)
44
+ • Each expert reviews independently
45
+ • Generates vote and findings
46
+
47
+ 3. CONSENSUS VOTING
48
+ • CRITICAL: Unanimity required (0 REJECT)
49
+ • NORMAL: Majority required (3/5 APPROVE)
50
+
51
+ 4. RESULT
52
+ • APPROVED → Verification runs
53
+ • REJECTED → Detailed feedback provided
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Criticality Detection
59
+
60
+ Code is **CRITICAL** if it involves:
61
+ - Authentication/Authorization
62
+ - Financial operations
63
+ - Database schema changes
64
+ - External payment integrations
65
+
66
+ Critical code requires **unanimous approval** (no REJECT votes).
67
+
68
+ ---
69
+
70
+ ## Expert Responsibilities
71
+
72
+ | Expert | Checks | Rejects On |
73
+ |--------|--------|------------|
74
+ | Security | SQL injection, auth, validation | Any security hole |
75
+ | Performance | N+1, waterfalls, bundle size | Critical perf issues |
76
+ | Architecture | Types, modules, SOLID | Type violations |
77
+ | UX | A11y, mobile, tokens | Missing accessibility |
78
+ | Database | Schema, migrations | Data loss risk |
79
+ | Memory | Patterns | Never (ABSTAIN) |
80
+
81
+ ---
82
+
83
+ ## Output Example
84
+
85
+ ```
86
+ ## Expert Review
87
+ Files: 1
88
+ Criticality: NORMAL
89
+ Experts: Security, Performance, Architecture, UX (4)
90
+
91
+ [30 seconds - parallel review]
92
+
93
+ ✅ APPROVED (4/4)
94
+ Security: ✓ APPROVE
95
+ Performance: ✓ APPROVE
96
+ Architecture: ✓ APPROVE
97
+ UX: ✓ APPROVE
98
+
99
+ Running verification...
100
+ ✓ typecheck passed
101
+ ✓ lint passed
102
+
103
+ All checks passed! ✅
104
+ ```
105
+
106
+ ---
107
+
108
+ ## When to Use
109
+
110
+ ✅ **Use /experts for:**
111
+ - Critical changes (auth, payments, schema)
112
+ - Before submitting PRs
113
+ - Large refactors
114
+ - Learning (get feedback)
115
+
116
+ ❌ **Don't use for:**
117
+ - WIP code
118
+ - Trivial changes (typos)
119
+ - Generated code
120
+
121
+ ---
122
+
123
+ ## Advanced Options
124
+
125
+ ```bash
126
+ # Review specific experts only
127
+ /experts src/file.ts --only security,architecture
128
+
129
+ # Verbose output (show reasoning)
130
+ /experts src/file.ts --verbose
131
+
132
+ # Dry run (no auto-improvements)
133
+ /experts src/file.ts --dry-run
134
+ ```
135
+
136
+ ---
137
+
138
+ *Part of cmp-memory-system - MetaNautical Group*
@@ -0,0 +1,158 @@
1
+ # Claude Code Hooks Configuration
2
+
3
+ This directory contains hook templates for Claude Code integration.
4
+
5
+ ## Available Hooks
6
+
7
+ | Hook | When | Purpose |
8
+ |:---|:---|:---|
9
+ | `SessionStart` | Session begins | Load context, memories, work plan |
10
+ | `PreToolUse` | Before tool runs | Guards, validation, knowledge injection |
11
+ | `PostToolUse` | After tool runs | Change tracking, checkpoints |
12
+ | `NotificationReceived` | On notifications | Custom notification handling |
13
+ | `PromptSubmit` | Before prompt | Pre-processing user input |
14
+ | `SubagentStop` | Agent completes | Post-agent processing |
15
+
16
+ ## Configuration
17
+
18
+ Add to your `.claude/settings.local.json`:
19
+
20
+ ```json
21
+ {
22
+ "hooks": {
23
+ "SessionStart": [
24
+ {
25
+ "matcher": "*",
26
+ "hooks": [
27
+ {
28
+ "type": "command",
29
+ "command": "npx cmp-memory session-context"
30
+ }
31
+ ]
32
+ }
33
+ ],
34
+ "PreToolUse": [
35
+ {
36
+ "matcher": "Edit|Write",
37
+ "hooks": [
38
+ {
39
+ "type": "command",
40
+ "command": "npx cmp-memory pre-tool-guard $EVENT"
41
+ }
42
+ ]
43
+ }
44
+ ],
45
+ "PostToolUse": [
46
+ {
47
+ "matcher": "Edit|Write",
48
+ "hooks": [
49
+ {
50
+ "type": "command",
51
+ "command": "npx cmp-memory post-tool-record $EVENT"
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Environment Variables
61
+
62
+ Required for full functionality:
63
+
64
+ ```bash
65
+ # Database connection (for memory persistence)
66
+ DATABASE_URL="mysql://user:pass@host:port/database"
67
+
68
+ # Embedding (for semantic search - optional)
69
+ OPENAI_API_KEY="sk-..."
70
+ # or
71
+ GEMINI_API_KEY="..."
72
+ ```
73
+
74
+ ## Guard Rules
75
+
76
+ Define guards in `project.config.json`:
77
+
78
+ ```json
79
+ {
80
+ "guards": {
81
+ "enabled": true,
82
+ "rules": [
83
+ {
84
+ "id": "no-modify-auth",
85
+ "type": "block",
86
+ "filePattern": "**/auth/**",
87
+ "message": "Auth files require explicit approval",
88
+ "excludeFiles": ["**/*.test.ts"]
89
+ },
90
+ {
91
+ "id": "no-raw-sql",
92
+ "type": "warn",
93
+ "filePattern": "**/*.ts",
94
+ "contentTrigger": "\\$\\{[^}]+\\}.*(?:SELECT|INSERT|UPDATE|DELETE)",
95
+ "message": "Potential SQL injection - use parameterized queries"
96
+ }
97
+ ]
98
+ }
99
+ }
100
+ ```
101
+
102
+ ## Custom Hooks
103
+
104
+ Create custom hook scripts in `.claude/hooks/`:
105
+
106
+ ```bash
107
+ #!/bin/bash
108
+ # .claude/hooks/my-custom-hook.sh
109
+
110
+ # Access event data
111
+ EVENT_DATA="$1"
112
+
113
+ # Parse with jq if needed
114
+ TOOL_NAME=$(echo "$EVENT_DATA" | jq -r '.tool_name')
115
+
116
+ # Your logic here
117
+ echo "Tool called: $TOOL_NAME"
118
+ ```
119
+
120
+ Register in settings:
121
+
122
+ ```json
123
+ {
124
+ "hooks": {
125
+ "PreToolUse": [
126
+ {
127
+ "matcher": "*",
128
+ "hooks": [
129
+ {
130
+ "type": "command",
131
+ "command": ".claude/hooks/my-custom-hook.sh $EVENT"
132
+ }
133
+ ]
134
+ }
135
+ ]
136
+ }
137
+ }
138
+ ```
139
+
140
+ ## Troubleshooting
141
+
142
+ ### Hook not running
143
+ - Check that hook command is executable
144
+ - Verify matcher pattern matches the tool name
145
+ - Check `.claude/settings.local.json` syntax
146
+
147
+ ### Guards not blocking
148
+ - Ensure `guards.enabled: true` in `project.config.json`
149
+ - Verify file patterns match (use glob syntax)
150
+ - Check that rule `type` is "block" not "warn"
151
+
152
+ ### Memory not persisting
153
+ - Verify `DATABASE_URL` is set
154
+ - Check database connection with `npx cmp-memory status`
155
+
156
+ ---
157
+
158
+ For more information, see the [cmp-memory-system documentation](https://github.com/carlosmartinpavon/carlosmartinpavon).
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/carlosmartinpavon/carlosmartinpavon/main/packages/cmp-memory-system/schemas/config.json",
3
+ "projectName": "{{PROJECT_NAME}}",
4
+ "system": "{{SYSTEM_ID}}",
5
+ "domains": [
6
+ "api",
7
+ "components",
8
+ "hooks",
9
+ "schema",
10
+ "utils"
11
+ ],
12
+ "sessionContext": {
13
+ "loadMemoriesOnStart": true,
14
+ "maxMemoriesLoaded": 10,
15
+ "showAvailableCommands": true,
16
+ "showWorkPlan": true
17
+ },
18
+ "guards": {
19
+ "enabled": true,
20
+ "rules": [
21
+ {
22
+ "id": "no-modify-auth",
23
+ "type": "warn",
24
+ "filePattern": "**/auth/**",
25
+ "message": "Auth files are sensitive - ensure changes are reviewed",
26
+ "excludeFiles": ["**/*.test.ts", "**/*.spec.ts"]
27
+ },
28
+ {
29
+ "id": "schema-protection",
30
+ "type": "warn",
31
+ "filePattern": "**/schema/**",
32
+ "message": "Schema changes affect database - run migrations carefully"
33
+ },
34
+ {
35
+ "id": "no-raw-sql",
36
+ "type": "warn",
37
+ "filePattern": "**/*.ts",
38
+ "contentTrigger": "\\$\\{[^}]+\\}.*(?:SELECT|INSERT|UPDATE|DELETE)",
39
+ "message": "Potential SQL injection - use parameterized queries or Drizzle ORM"
40
+ },
41
+ {
42
+ "id": "no-hardcoded-secrets",
43
+ "type": "block",
44
+ "filePattern": "**/*.{ts,tsx,js,jsx}",
45
+ "contentTrigger": "(sk-[a-zA-Z0-9]{32,}|ghp_[a-zA-Z0-9]{36}|npm_[a-zA-Z0-9]{36})",
46
+ "message": "BLOCKED: Hardcoded API key detected - use environment variables"
47
+ }
48
+ ]
49
+ },
50
+ "checkpoint": {
51
+ "enabled": true,
52
+ "criticalPaths": [
53
+ "**/schema/**",
54
+ "**/finance/**",
55
+ "**/auth/**",
56
+ "**/migrations/**"
57
+ ],
58
+ "excludePaths": [
59
+ "**/*.test.ts",
60
+ "**/*.spec.ts",
61
+ "**/node_modules/**",
62
+ "**/dist/**"
63
+ ],
64
+ "minLinesChanged": 20
65
+ },
66
+ "embedding": {
67
+ "enabled": false,
68
+ "threshold": 0.7,
69
+ "maxSections": 5,
70
+ "prioritizeCritical": true
71
+ },
72
+ "autoImprovement": {
73
+ "enabled": true,
74
+ "violationThreshold": 3,
75
+ "generateEslintRules": true
76
+ }
77
+ }