cmp-standards 2.4.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 (97) hide show
  1. package/README.md +633 -611
  2. package/dist/cli/index.js +0 -0
  3. package/dist/db/drizzle-client.d.ts +3 -3
  4. package/dist/db/drizzle-client.d.ts.map +1 -1
  5. package/dist/db/drizzle-client.js +57 -58
  6. package/dist/db/drizzle-client.js.map +1 -1
  7. package/dist/db/turso-client.js +11 -11
  8. package/dist/eslint/rules/no-async-useeffect.js +6 -6
  9. package/dist/hooks/cloud-pre-tool-use.js +20 -20
  10. package/dist/hooks/cloud-session-start.d.ts +15 -3
  11. package/dist/hooks/cloud-session-start.d.ts.map +1 -1
  12. package/dist/hooks/cloud-session-start.js +135 -8
  13. package/dist/hooks/cloud-session-start.js.map +1 -1
  14. package/dist/hooks/session-start.d.ts +2 -1
  15. package/dist/hooks/session-start.d.ts.map +1 -1
  16. package/dist/hooks/session-start.js +99 -74
  17. package/dist/hooks/session-start.js.map +1 -1
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +4 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/mcp/server.js +2 -2
  23. package/dist/mcp/server.js.map +1 -1
  24. package/dist/schema/plans.d.ts +194 -0
  25. package/dist/schema/plans.d.ts.map +1 -0
  26. package/dist/schema/plans.js +180 -0
  27. package/dist/schema/plans.js.map +1 -0
  28. package/dist/schema/tracking.d.ts +90 -90
  29. package/dist/services/ContextGenerator.d.ts +16 -0
  30. package/dist/services/ContextGenerator.d.ts.map +1 -0
  31. package/dist/services/ContextGenerator.js +62 -0
  32. package/dist/services/ContextGenerator.js.map +1 -0
  33. package/dist/services/PlanManager.d.ts +99 -0
  34. package/dist/services/PlanManager.d.ts.map +1 -0
  35. package/dist/services/PlanManager.js +372 -0
  36. package/dist/services/PlanManager.js.map +1 -0
  37. package/dist/services/ProjectScaffold.js +76 -76
  38. package/dist/services/context-injector.d.ts +111 -0
  39. package/dist/services/context-injector.d.ts.map +1 -0
  40. package/dist/services/context-injector.js +397 -0
  41. package/dist/services/context-injector.js.map +1 -0
  42. package/dist/services/index.d.ts +15 -15
  43. package/dist/services/index.d.ts.map +1 -1
  44. package/dist/services/index.js +18 -20
  45. package/dist/services/index.js.map +1 -1
  46. package/dist/services/memory-router.d.ts +122 -0
  47. package/dist/services/memory-router.d.ts.map +1 -0
  48. package/dist/services/memory-router.js +517 -0
  49. package/dist/services/memory-router.js.map +1 -0
  50. package/dist/services/pattern-tracker.d.ts +97 -0
  51. package/dist/services/pattern-tracker.d.ts.map +1 -0
  52. package/dist/services/pattern-tracker.js +425 -0
  53. package/dist/services/pattern-tracker.js.map +1 -0
  54. package/dist/services/semantic-search.d.ts +33 -35
  55. package/dist/services/semantic-search.d.ts.map +1 -1
  56. package/dist/services/semantic-search.js +207 -165
  57. package/dist/services/semantic-search.js.map +1 -1
  58. package/dist/types/index.d.ts +329 -4
  59. package/dist/types/index.d.ts.map +1 -1
  60. package/dist/types/index.js +186 -9
  61. package/dist/types/index.js.map +1 -1
  62. package/package.json +104 -100
  63. package/standards/README.md +50 -50
  64. package/standards/experts/expert-routing.md +215 -215
  65. package/standards/general/code-quality.md +86 -86
  66. package/standards/general/memory-usage.md +205 -205
  67. package/standards/general/sync-workflow.md +235 -235
  68. package/standards/general/workflow.md +82 -82
  69. package/standards/hooks/mandatory-tracking.md +446 -446
  70. package/standards/infrastructure/cloud-database.md +287 -287
  71. package/standards/mcp/server-design.md +243 -243
  72. package/standards/mcp/tool-patterns.md +354 -354
  73. package/standards/skills/skill-structure.md +286 -286
  74. package/standards/skills/workflow-design.md +323 -323
  75. package/standards/tools/tool-design.md +297 -297
  76. package/templates/agents/architecture-expert.md +61 -61
  77. package/templates/agents/database-expert.md +62 -62
  78. package/templates/agents/documentation-expert.md +57 -57
  79. package/templates/agents/memory-expert.md +88 -88
  80. package/templates/agents/performance-expert.md +61 -61
  81. package/templates/agents/security-expert.md +59 -59
  82. package/templates/agents/ux-expert.md +63 -63
  83. package/templates/agents/worker.md +75 -75
  84. package/templates/ai-skills/SKILL_TEMPLATE.md +55 -55
  85. package/templates/claude-settings.json +72 -72
  86. package/templates/commands/experts.md +138 -138
  87. package/templates/hooks/README.md +158 -158
  88. package/templates/hooks/project.config.json.template +77 -77
  89. package/templates/hooks/settings.local.json.template +57 -57
  90. package/templates/memory-config.json +56 -56
  91. package/templates/memory-config.schema.json +212 -212
  92. package/templates/settings.json +58 -58
  93. package/templates/skills/continue.md +205 -205
  94. package/templates/workflows/business-improvement.md +264 -264
  95. package/templates/workflows/expert-review.md +153 -153
  96. package/templates/workflows/internal-app.md +245 -245
  97. 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