cmp-standards 2.0.1 → 2.6.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.
- package/README.md +633 -541
- package/dist/cli/index.js +239 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +203 -39
- package/dist/dashboard/server.js.map +1 -1
- package/dist/db/cloud.d.ts +174 -0
- package/dist/db/cloud.d.ts.map +1 -0
- package/dist/db/cloud.js +241 -0
- package/dist/db/cloud.js.map +1 -0
- package/dist/db/drizzle-client.d.ts +3 -3
- package/dist/db/drizzle-client.d.ts.map +1 -1
- package/dist/db/drizzle-client.js +57 -58
- package/dist/db/drizzle-client.js.map +1 -1
- package/dist/db/errors.d.ts +76 -0
- package/dist/db/errors.d.ts.map +1 -0
- package/dist/db/errors.js +135 -0
- package/dist/db/errors.js.map +1 -0
- package/dist/db/turso-client.d.ts +178 -0
- package/dist/db/turso-client.d.ts.map +1 -0
- package/dist/db/turso-client.js +455 -0
- package/dist/db/turso-client.js.map +1 -0
- package/dist/db/upstash-client.d.ts +161 -0
- package/dist/db/upstash-client.d.ts.map +1 -0
- package/dist/db/upstash-client.js +325 -0
- package/dist/db/upstash-client.js.map +1 -0
- package/dist/eslint/rules/no-async-useeffect.js +6 -6
- package/dist/hooks/cloud-post-tool-use.d.ts +30 -0
- package/dist/hooks/cloud-post-tool-use.d.ts.map +1 -0
- package/dist/hooks/cloud-post-tool-use.js +116 -0
- package/dist/hooks/cloud-post-tool-use.js.map +1 -0
- package/dist/hooks/cloud-pre-tool-use.d.ts +19 -0
- package/dist/hooks/cloud-pre-tool-use.d.ts.map +1 -0
- package/dist/hooks/cloud-pre-tool-use.js +149 -0
- package/dist/hooks/cloud-pre-tool-use.js.map +1 -0
- package/dist/hooks/cloud-session-start.d.ts +32 -0
- package/dist/hooks/cloud-session-start.d.ts.map +1 -0
- package/dist/hooks/cloud-session-start.js +257 -0
- package/dist/hooks/cloud-session-start.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/memory-checkpoint.d.ts.map +1 -1
- package/dist/hooks/memory-checkpoint.js +12 -20
- package/dist/hooks/memory-checkpoint.js.map +1 -1
- package/dist/hooks/pre-tool-use.d.ts +2 -8
- package/dist/hooks/pre-tool-use.d.ts.map +1 -1
- package/dist/hooks/pre-tool-use.js +7 -106
- package/dist/hooks/pre-tool-use.js.map +1 -1
- package/dist/hooks/session-start.d.ts +2 -1
- package/dist/hooks/session-start.d.ts.map +1 -1
- package/dist/hooks/session-start.js +111 -77
- package/dist/hooks/session-start.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +225 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/schema/plans.d.ts +194 -0
- package/dist/schema/plans.d.ts.map +1 -0
- package/dist/schema/plans.js +180 -0
- package/dist/schema/plans.js.map +1 -0
- package/dist/schema/tracking.d.ts +644 -0
- package/dist/schema/tracking.d.ts.map +1 -0
- package/dist/schema/tracking.js +204 -0
- package/dist/schema/tracking.js.map +1 -0
- package/dist/services/ContextGenerator.d.ts +16 -0
- package/dist/services/ContextGenerator.d.ts.map +1 -0
- package/dist/services/ContextGenerator.js +62 -0
- package/dist/services/ContextGenerator.js.map +1 -0
- package/dist/services/PlanManager.d.ts +99 -0
- package/dist/services/PlanManager.d.ts.map +1 -0
- package/dist/services/PlanManager.js +372 -0
- package/dist/services/PlanManager.js.map +1 -0
- package/dist/services/ProjectScaffold.d.ts.map +1 -1
- package/dist/services/ProjectScaffold.js +109 -81
- package/dist/services/ProjectScaffold.js.map +1 -1
- package/dist/services/TaskTracker.d.ts +1 -1
- package/dist/services/TaskTracker.d.ts.map +1 -1
- package/dist/services/TaskTracker.js +4 -8
- package/dist/services/TaskTracker.js.map +1 -1
- package/dist/services/WorkPlanManager.d.ts +1 -1
- package/dist/services/WorkPlanManager.d.ts.map +1 -1
- package/dist/services/WorkPlanManager.js +8 -14
- package/dist/services/WorkPlanManager.js.map +1 -1
- package/dist/services/auto-inject.d.ts +1 -0
- package/dist/services/auto-inject.d.ts.map +1 -1
- package/dist/services/auto-inject.js +12 -17
- package/dist/services/auto-inject.js.map +1 -1
- package/dist/services/context-injector.d.ts +105 -0
- package/dist/services/context-injector.d.ts.map +1 -0
- package/dist/services/context-injector.js +357 -0
- package/dist/services/context-injector.js.map +1 -0
- package/dist/services/cross-project-sync.d.ts +2 -0
- package/dist/services/cross-project-sync.d.ts.map +1 -1
- package/dist/services/cross-project-sync.js +26 -21
- package/dist/services/cross-project-sync.js.map +1 -1
- package/dist/services/index.d.ts +15 -15
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +18 -20
- package/dist/services/index.js.map +1 -1
- package/dist/services/memory-consolidation.d.ts.map +1 -1
- package/dist/services/memory-consolidation.js +30 -27
- package/dist/services/memory-consolidation.js.map +1 -1
- package/dist/services/memory-router.d.ts +98 -0
- package/dist/services/memory-router.d.ts.map +1 -0
- package/dist/services/memory-router.js +373 -0
- package/dist/services/memory-router.js.map +1 -0
- package/dist/services/pattern-tracker.d.ts +93 -0
- package/dist/services/pattern-tracker.d.ts.map +1 -0
- package/dist/services/pattern-tracker.js +347 -0
- package/dist/services/pattern-tracker.js.map +1 -0
- package/dist/services/semantic-search.d.ts +33 -35
- package/dist/services/semantic-search.d.ts.map +1 -1
- package/dist/services/semantic-search.js +207 -165
- package/dist/services/semantic-search.js.map +1 -1
- package/dist/utils/env-loader.d.ts +41 -0
- package/dist/utils/env-loader.d.ts.map +1 -0
- package/dist/utils/env-loader.js +78 -0
- package/dist/utils/env-loader.js.map +1 -0
- package/dist/utils/git.d.ts +52 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +267 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/paths.d.ts +39 -5
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +88 -7
- package/dist/utils/paths.js.map +1 -1
- package/package.json +100 -94
- package/standards/README.md +50 -0
- package/standards/experts/expert-routing.md +215 -0
- package/standards/general/code-quality.md +86 -0
- package/standards/general/memory-usage.md +205 -0
- package/standards/general/sync-workflow.md +235 -0
- package/standards/general/workflow.md +82 -0
- package/standards/hooks/mandatory-tracking.md +446 -0
- package/standards/infrastructure/cloud-database.md +287 -0
- package/standards/mcp/server-design.md +243 -0
- package/standards/mcp/tool-patterns.md +354 -0
- package/standards/skills/skill-structure.md +286 -0
- package/standards/skills/workflow-design.md +323 -0
- package/standards/tools/tool-design.md +297 -0
- package/templates/agents/architecture-expert.md +61 -61
- package/templates/agents/database-expert.md +62 -62
- package/templates/agents/documentation-expert.md +57 -57
- package/templates/agents/memory-expert.md +88 -88
- package/templates/agents/performance-expert.md +61 -61
- package/templates/agents/security-expert.md +59 -59
- package/templates/agents/ux-expert.md +63 -63
- package/templates/agents/worker.md +75 -75
- package/templates/ai-skills/SKILL_TEMPLATE.md +55 -55
- package/templates/claude-settings.json +72 -0
- package/templates/commands/experts.md +138 -138
- package/templates/hooks/README.md +158 -158
- package/templates/hooks/project.config.json.template +77 -77
- package/templates/hooks/settings.local.json.template +57 -57
- package/templates/memory-config.json +56 -82
- package/templates/memory-config.schema.json +212 -212
- package/templates/settings.json +58 -58
- package/templates/skills/continue.md +205 -0
- package/templates/workflows/business-improvement.md +264 -264
- package/templates/workflows/expert-review.md +153 -153
- package/templates/workflows/internal-app.md +245 -245
- 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
|