cmp-standards 2.7.0 → 2.8.0-alpha

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 (114) hide show
  1. package/README.md +633 -633
  2. package/dist/cache/EmbeddingCache.d.ts +109 -0
  3. package/dist/cache/EmbeddingCache.d.ts.map +1 -0
  4. package/dist/cache/EmbeddingCache.js +239 -0
  5. package/dist/cache/EmbeddingCache.js.map +1 -0
  6. package/dist/cache/index.d.ts +6 -0
  7. package/dist/cache/index.d.ts.map +1 -0
  8. package/dist/cache/index.js +6 -0
  9. package/dist/cache/index.js.map +1 -0
  10. package/dist/cli/index.js +0 -0
  11. package/dist/db/turso-client.js +11 -11
  12. package/dist/eslint/rules/no-async-useeffect.js +6 -6
  13. package/dist/events/EventBus.d.ts +87 -0
  14. package/dist/events/EventBus.d.ts.map +1 -0
  15. package/dist/events/EventBus.js +200 -0
  16. package/dist/events/EventBus.js.map +1 -0
  17. package/dist/events/index.d.ts +7 -0
  18. package/dist/events/index.d.ts.map +1 -0
  19. package/dist/events/index.js +9 -0
  20. package/dist/events/index.js.map +1 -0
  21. package/dist/events/types.d.ts +989 -0
  22. package/dist/events/types.d.ts.map +1 -0
  23. package/dist/events/types.js +136 -0
  24. package/dist/events/types.js.map +1 -0
  25. package/dist/experts/ConsensusEngine.d.ts +57 -0
  26. package/dist/experts/ConsensusEngine.d.ts.map +1 -0
  27. package/dist/experts/ConsensusEngine.js +146 -0
  28. package/dist/experts/ConsensusEngine.js.map +1 -0
  29. package/dist/experts/ExpertPanelService.d.ts +84 -0
  30. package/dist/experts/ExpertPanelService.d.ts.map +1 -0
  31. package/dist/experts/ExpertPanelService.js +204 -0
  32. package/dist/experts/ExpertPanelService.js.map +1 -0
  33. package/dist/experts/ExpertRouter.d.ts +68 -0
  34. package/dist/experts/ExpertRouter.d.ts.map +1 -0
  35. package/dist/experts/ExpertRouter.js +374 -0
  36. package/dist/experts/ExpertRouter.js.map +1 -0
  37. package/dist/experts/VoteCollector.d.ts +58 -0
  38. package/dist/experts/VoteCollector.d.ts.map +1 -0
  39. package/dist/experts/VoteCollector.js +146 -0
  40. package/dist/experts/VoteCollector.js.map +1 -0
  41. package/dist/experts/index.d.ts +9 -0
  42. package/dist/experts/index.d.ts.map +1 -0
  43. package/dist/experts/index.js +13 -0
  44. package/dist/experts/index.js.map +1 -0
  45. package/dist/hooks/cloud-pre-tool-use.js +20 -20
  46. package/dist/hooks/expert-review.d.ts +74 -0
  47. package/dist/hooks/expert-review.d.ts.map +1 -0
  48. package/dist/hooks/expert-review.js +220 -0
  49. package/dist/hooks/expert-review.js.map +1 -0
  50. package/dist/hooks/index.d.ts +1 -0
  51. package/dist/hooks/index.d.ts.map +1 -1
  52. package/dist/hooks/index.js +2 -0
  53. package/dist/hooks/index.js.map +1 -1
  54. package/dist/index.d.ts +13 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +22 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/performance/Debouncer.d.ts +91 -0
  59. package/dist/performance/Debouncer.d.ts.map +1 -0
  60. package/dist/performance/Debouncer.js +198 -0
  61. package/dist/performance/Debouncer.js.map +1 -0
  62. package/dist/performance/MemoryDecay.d.ts +82 -0
  63. package/dist/performance/MemoryDecay.d.ts.map +1 -0
  64. package/dist/performance/MemoryDecay.js +153 -0
  65. package/dist/performance/MemoryDecay.js.map +1 -0
  66. package/dist/performance/index.d.ts +7 -0
  67. package/dist/performance/index.d.ts.map +1 -0
  68. package/dist/performance/index.js +9 -0
  69. package/dist/performance/index.js.map +1 -0
  70. package/dist/schema/expert-types.d.ts +395 -0
  71. package/dist/schema/expert-types.d.ts.map +1 -0
  72. package/dist/schema/expert-types.js +250 -0
  73. package/dist/schema/expert-types.js.map +1 -0
  74. package/dist/services/ContextGenerator.js +7 -7
  75. package/dist/services/ProjectScaffold.js +76 -76
  76. package/dist/services/memory-router.js +35 -35
  77. package/dist/services/pattern-tracker.js +90 -90
  78. package/dist/services/semantic-search.js +2 -2
  79. package/package.json +105 -104
  80. package/standards/README.md +50 -50
  81. package/standards/experts/expert-routing.md +215 -215
  82. package/standards/general/code-quality.md +86 -86
  83. package/standards/general/memory-usage.md +205 -205
  84. package/standards/general/sync-workflow.md +235 -235
  85. package/standards/general/workflow.md +82 -82
  86. package/standards/hooks/mandatory-tracking.md +446 -446
  87. package/standards/infrastructure/cloud-database.md +287 -287
  88. package/standards/mcp/server-design.md +243 -243
  89. package/standards/mcp/tool-patterns.md +354 -354
  90. package/standards/skills/skill-structure.md +286 -286
  91. package/standards/skills/workflow-design.md +323 -323
  92. package/standards/tools/tool-design.md +297 -297
  93. package/templates/agents/architecture-expert.md +61 -61
  94. package/templates/agents/database-expert.md +62 -62
  95. package/templates/agents/documentation-expert.md +57 -57
  96. package/templates/agents/memory-expert.md +88 -88
  97. package/templates/agents/performance-expert.md +61 -61
  98. package/templates/agents/security-expert.md +59 -59
  99. package/templates/agents/ux-expert.md +63 -63
  100. package/templates/agents/worker.md +75 -75
  101. package/templates/ai-skills/SKILL_TEMPLATE.md +55 -55
  102. package/templates/claude-settings.json +72 -72
  103. package/templates/commands/experts.md +138 -138
  104. package/templates/hooks/README.md +158 -158
  105. package/templates/hooks/project.config.json.template +77 -77
  106. package/templates/hooks/settings.local.json.template +57 -57
  107. package/templates/memory-config.json +56 -56
  108. package/templates/memory-config.schema.json +212 -212
  109. package/templates/settings.json +58 -58
  110. package/templates/skills/continue.md +205 -205
  111. package/templates/workflows/business-improvement.md +264 -264
  112. package/templates/workflows/expert-review.md +153 -153
  113. package/templates/workflows/internal-app.md +245 -245
  114. package/templates/workflows/sync-docs.md +187 -187
@@ -1,153 +1,153 @@
1
- ---
2
- description: "/experts - Multi-lens code review with consensus-based approval"
3
- ---
4
-
5
- # Expert Review Workflow
6
-
7
- This workflow provides structured code review through multiple expert lenses.
8
-
9
- ## When to Use
10
- - Before committing critical code (finance, auth, schema)
11
- - After completing a large refactor
12
- - When you want structured code feedback
13
-
14
- ## Steps
15
-
16
- ### 1. Identify Criticality
17
-
18
- Analyze the files being reviewed:
19
- - **CRITICAL**: finance/*, auth/*, schema/*, payments/*
20
- - **NORMAL**: components/*, utils/*, pages/*
21
-
22
- ### 2. Run Expert Lenses
23
-
24
- For each file, analyze through these lenses:
25
-
26
- **Security Lens:**
27
- - SQL injection risks (no raw SQL)
28
- - Input validation (Zod schemas)
29
- - Auth checks (protected procedures)
30
- - Finance dual-write compliance
31
-
32
- **Performance Lens:**
33
- - API waterfalls
34
- - N+1 queries
35
- - Missing lazy loading
36
- - Inline functions in JSX
37
-
38
- **Architecture Lens:**
39
- - Type inference chain (DB -> API -> UI)
40
- - Domain-driven structure
41
- - Circular dependencies
42
- - SOLID principles
43
-
44
- **UX Lens:**
45
- - Accessibility (ARIA, keyboard nav)
46
- - Mobile-first (320px, touch targets)
47
- - Semantic tokens
48
- - Correct modal system
49
-
50
- **Database Lens:**
51
- - Schema consistency
52
- - Migration safety
53
- - Query optimization
54
- - Relation integrity
55
-
56
- **Memory Lens:**
57
- - Pattern detection
58
- - ESLint rule generation
59
- - Knowledge extraction
60
- - Recurring issue tracking
61
-
62
- ### 3. Collect Issues
63
-
64
- Document findings:
65
- ```
66
- APPROVE / REJECT / ABSTAIN per lens
67
- If REJECT: clearly state why and how to fix
68
- ```
69
-
70
- ### 4. Verdict
71
-
72
- **For CRITICAL code:**
73
- - All lenses must APPROVE (0 REJECT)
74
-
75
- **For NORMAL code:**
76
- - Majority (3/4+) must APPROVE
77
-
78
- ### 5. Self-Improvement Check
79
-
80
- If you found a pattern that occurred 3+ times:
81
- 1. Propose an ESLint rule
82
- 2. Record in memory system as 'knowledge'
83
- 3. Consider creating a check script
84
-
85
- ### 6. Record Review
86
-
87
- ```bash
88
- cmp-memory capture --type knowledge --title "Review: {files}" --content "{summary}"
89
- ```
90
-
91
- ## Example Output Format
92
-
93
- ```
94
- ## Expert Review: src/server/api/routers/finances/expenses.ts
95
-
96
- Criticality: CRITICAL (finance code)
97
- Consensus: UNANIMITY required
98
-
99
- Security: APPROVE
100
- Zod validation present, no SQL injection
101
-
102
- Performance: APPROVE
103
- No N+1 queries, proper pagination
104
-
105
- Architecture: APPROVE
106
- Type inference correct, domain structure valid
107
-
108
- UX: ABSTAIN
109
- No UI changes
110
-
111
- Database: APPROVE
112
- Queries optimized, indexes used correctly
113
-
114
- Verdict: APPROVED (4 APPROVE, 0 REJECT, 1 ABSTAIN)
115
- ```
116
-
117
- ## Criticality Mapping
118
-
119
- | Path Pattern | Criticality | Required Consensus |
120
- |:---|:---|:---|
121
- | `*/finance/*` | CRITICAL | Unanimity |
122
- | `*/auth/*` | CRITICAL | Unanimity |
123
- | `*/schema/*` | CRITICAL | Unanimity |
124
- | `*/payments/*` | CRITICAL | Unanimity |
125
- | `*/api/*` | HIGH | 4/5 Approve |
126
- | `*/components/*` | NORMAL | Majority |
127
- | `*/utils/*` | NORMAL | Majority |
128
- | `*/pages/*` | NORMAL | Majority |
129
-
130
- ## Expert Specializations
131
-
132
- Each expert has specific focus areas:
133
-
134
- - **Security Expert**: OWASP Top 10, input validation, auth/authz
135
- - **Performance Expert**: Bundle size, render optimization, caching
136
- - **Architecture Expert**: SOLID, DDD, type chains, circular deps
137
- - **UX Expert**: A11y, mobile-first, brand compliance
138
- - **Database Expert**: Schema design, migrations, query optimization
139
- - **Memory Expert**: Pattern learning, rule generation
140
- - **Documentation Expert**: Code comments, API docs, README updates
141
-
142
- ## Integration with CI/CD
143
-
144
- ```yaml
145
- # Example GitHub Action
146
- - name: Expert Review
147
- run: cmp-memory experts --files "${{ github.event.pull_request.files }}"
148
- ```
149
-
150
- ---
151
-
152
- **Last Updated**: {{date}}
153
- **Status**: Production Ready
1
+ ---
2
+ description: "/experts - Multi-lens code review with consensus-based approval"
3
+ ---
4
+
5
+ # Expert Review Workflow
6
+
7
+ This workflow provides structured code review through multiple expert lenses.
8
+
9
+ ## When to Use
10
+ - Before committing critical code (finance, auth, schema)
11
+ - After completing a large refactor
12
+ - When you want structured code feedback
13
+
14
+ ## Steps
15
+
16
+ ### 1. Identify Criticality
17
+
18
+ Analyze the files being reviewed:
19
+ - **CRITICAL**: finance/*, auth/*, schema/*, payments/*
20
+ - **NORMAL**: components/*, utils/*, pages/*
21
+
22
+ ### 2. Run Expert Lenses
23
+
24
+ For each file, analyze through these lenses:
25
+
26
+ **Security Lens:**
27
+ - SQL injection risks (no raw SQL)
28
+ - Input validation (Zod schemas)
29
+ - Auth checks (protected procedures)
30
+ - Finance dual-write compliance
31
+
32
+ **Performance Lens:**
33
+ - API waterfalls
34
+ - N+1 queries
35
+ - Missing lazy loading
36
+ - Inline functions in JSX
37
+
38
+ **Architecture Lens:**
39
+ - Type inference chain (DB -> API -> UI)
40
+ - Domain-driven structure
41
+ - Circular dependencies
42
+ - SOLID principles
43
+
44
+ **UX Lens:**
45
+ - Accessibility (ARIA, keyboard nav)
46
+ - Mobile-first (320px, touch targets)
47
+ - Semantic tokens
48
+ - Correct modal system
49
+
50
+ **Database Lens:**
51
+ - Schema consistency
52
+ - Migration safety
53
+ - Query optimization
54
+ - Relation integrity
55
+
56
+ **Memory Lens:**
57
+ - Pattern detection
58
+ - ESLint rule generation
59
+ - Knowledge extraction
60
+ - Recurring issue tracking
61
+
62
+ ### 3. Collect Issues
63
+
64
+ Document findings:
65
+ ```
66
+ APPROVE / REJECT / ABSTAIN per lens
67
+ If REJECT: clearly state why and how to fix
68
+ ```
69
+
70
+ ### 4. Verdict
71
+
72
+ **For CRITICAL code:**
73
+ - All lenses must APPROVE (0 REJECT)
74
+
75
+ **For NORMAL code:**
76
+ - Majority (3/4+) must APPROVE
77
+
78
+ ### 5. Self-Improvement Check
79
+
80
+ If you found a pattern that occurred 3+ times:
81
+ 1. Propose an ESLint rule
82
+ 2. Record in memory system as 'knowledge'
83
+ 3. Consider creating a check script
84
+
85
+ ### 6. Record Review
86
+
87
+ ```bash
88
+ cmp-memory capture --type knowledge --title "Review: {files}" --content "{summary}"
89
+ ```
90
+
91
+ ## Example Output Format
92
+
93
+ ```
94
+ ## Expert Review: src/server/api/routers/finances/expenses.ts
95
+
96
+ Criticality: CRITICAL (finance code)
97
+ Consensus: UNANIMITY required
98
+
99
+ Security: APPROVE
100
+ Zod validation present, no SQL injection
101
+
102
+ Performance: APPROVE
103
+ No N+1 queries, proper pagination
104
+
105
+ Architecture: APPROVE
106
+ Type inference correct, domain structure valid
107
+
108
+ UX: ABSTAIN
109
+ No UI changes
110
+
111
+ Database: APPROVE
112
+ Queries optimized, indexes used correctly
113
+
114
+ Verdict: APPROVED (4 APPROVE, 0 REJECT, 1 ABSTAIN)
115
+ ```
116
+
117
+ ## Criticality Mapping
118
+
119
+ | Path Pattern | Criticality | Required Consensus |
120
+ |:---|:---|:---|
121
+ | `*/finance/*` | CRITICAL | Unanimity |
122
+ | `*/auth/*` | CRITICAL | Unanimity |
123
+ | `*/schema/*` | CRITICAL | Unanimity |
124
+ | `*/payments/*` | CRITICAL | Unanimity |
125
+ | `*/api/*` | HIGH | 4/5 Approve |
126
+ | `*/components/*` | NORMAL | Majority |
127
+ | `*/utils/*` | NORMAL | Majority |
128
+ | `*/pages/*` | NORMAL | Majority |
129
+
130
+ ## Expert Specializations
131
+
132
+ Each expert has specific focus areas:
133
+
134
+ - **Security Expert**: OWASP Top 10, input validation, auth/authz
135
+ - **Performance Expert**: Bundle size, render optimization, caching
136
+ - **Architecture Expert**: SOLID, DDD, type chains, circular deps
137
+ - **UX Expert**: A11y, mobile-first, brand compliance
138
+ - **Database Expert**: Schema design, migrations, query optimization
139
+ - **Memory Expert**: Pattern learning, rule generation
140
+ - **Documentation Expert**: Code comments, API docs, README updates
141
+
142
+ ## Integration with CI/CD
143
+
144
+ ```yaml
145
+ # Example GitHub Action
146
+ - name: Expert Review
147
+ run: cmp-memory experts --files "${{ github.event.pull_request.files }}"
148
+ ```
149
+
150
+ ---
151
+
152
+ **Last Updated**: {{date}}
153
+ **Status**: Production Ready