cmp-standards 3.5.1 → 3.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.
- package/README.md +399 -633
- package/dist/analytics/CrossProjectAnalytics.js +65 -65
- package/dist/cli/index.js +255 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/tokens.js +173 -173
- package/dist/db/cloud.d.ts +1 -0
- package/dist/db/cloud.d.ts.map +1 -1
- package/dist/db/migrations.js +256 -256
- package/dist/db/turso-client.js +2 -2
- package/dist/db/upstash-client.d.ts +9 -0
- package/dist/db/upstash-client.d.ts.map +1 -1
- package/dist/db/upstash-client.js +11 -0
- package/dist/db/upstash-client.js.map +1 -1
- package/dist/eslint/rules/no-async-useeffect.js +6 -6
- package/dist/experts/ExpertVotePersistence.js +9 -9
- package/dist/hooks/cloud-post-tool-use.d.ts.map +1 -1
- package/dist/hooks/cloud-post-tool-use.js +72 -10
- package/dist/hooks/cloud-post-tool-use.js.map +1 -1
- package/dist/hooks/cloud-pre-tool-use.d.ts +12 -9
- package/dist/hooks/cloud-pre-tool-use.d.ts.map +1 -1
- package/dist/hooks/cloud-pre-tool-use.js +227 -99
- package/dist/hooks/cloud-pre-tool-use.js.map +1 -1
- package/dist/hooks/cloud-session-start.js +5 -5
- package/dist/hooks/resilient-hook-runner.d.ts +78 -0
- package/dist/hooks/resilient-hook-runner.d.ts.map +1 -0
- package/dist/hooks/resilient-hook-runner.js +201 -0
- package/dist/hooks/resilient-hook-runner.js.map +1 -0
- package/dist/hooks/session-end.js +14 -14
- package/dist/patterns/registry.js +90 -90
- package/dist/schema/codewiki-types.d.ts +10 -10
- package/dist/schema/docs-types.d.ts +8 -8
- package/dist/schema/ecosystem-types.d.ts +12 -12
- package/dist/services/BootstrapService.d.ts +123 -0
- package/dist/services/BootstrapService.d.ts.map +1 -0
- package/dist/services/BootstrapService.js +309 -0
- package/dist/services/BootstrapService.js.map +1 -0
- package/dist/services/CodeWikiIndexer.js +3 -3
- package/dist/services/ContextGenerator.js +7 -7
- package/dist/services/FeedbackCollector.js +11 -11
- package/dist/services/GitIntegration.js +9 -9
- package/dist/services/HookVerifier.js +70 -70
- package/dist/services/KnowledgeGapDetector.d.ts +122 -0
- package/dist/services/KnowledgeGapDetector.d.ts.map +1 -0
- package/dist/services/KnowledgeGapDetector.js +530 -0
- package/dist/services/KnowledgeGapDetector.js.map +1 -0
- package/dist/services/ProjectScaffold.d.ts.map +1 -1
- package/dist/services/ProjectScaffold.js +79 -78
- package/dist/services/ProjectScaffold.js.map +1 -1
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +6 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/knowledge-graph.d.ts +121 -0
- package/dist/services/knowledge-graph.d.ts.map +1 -0
- package/dist/services/knowledge-graph.js +446 -0
- package/dist/services/knowledge-graph.js.map +1 -0
- package/dist/services/memory-router.d.ts +25 -0
- package/dist/services/memory-router.d.ts.map +1 -1
- package/dist/services/memory-router.js +236 -98
- package/dist/services/memory-router.js.map +1 -1
- package/dist/services/pattern-learning.d.ts +79 -0
- package/dist/services/pattern-learning.d.ts.map +1 -0
- package/dist/services/pattern-learning.js +312 -0
- package/dist/services/pattern-learning.js.map +1 -0
- package/dist/services/pattern-tracker.js +95 -95
- package/dist/services/semantic-search.js +2 -2
- package/package.json +124 -116
- package/standards/README.md +94 -50
- package/standards/experts/expert-routing.md +215 -215
- package/standards/general/code-quality.md +86 -86
- package/standards/general/ecosystem.md +243 -0
- package/standards/general/learning-loop.md +192 -0
- package/standards/general/memory-usage.md +205 -205
- package/standards/general/project-onboarding.md +339 -0
- package/standards/general/sync-workflow.md +235 -235
- package/standards/general/workflow.md +82 -82
- package/standards/hooks/mandatory-tracking.md +446 -446
- package/standards/infrastructure/cloud-database.md +287 -287
- package/standards/mcp/server-design.md +243 -243
- package/standards/mcp/tool-patterns.md +354 -354
- package/standards/skills/skill-structure.md +286 -286
- package/standards/skills/workflow-design.md +323 -323
- package/standards/tools/tool-design.md +297 -297
- 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/ecosystem-expert.md +104 -0
- 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 -72
- 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/hooks.config.json +21 -0
- package/templates/memory-config.json +56 -56
- package/templates/memory-config.schema.json +212 -212
- package/templates/settings.json +58 -58
- package/templates/skills/continue.md +205 -205
- 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,158 +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).
|
|
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).
|
|
@@ -1,77 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/settings.json",
|
|
3
|
-
"hooks": {
|
|
4
|
-
"SessionStart": [
|
|
5
|
-
{
|
|
6
|
-
"matcher": "*",
|
|
7
|
-
"hooks": [
|
|
8
|
-
{
|
|
9
|
-
"type": "command",
|
|
10
|
-
"command": "npx cmp-memory session-context"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"PreToolUse": [
|
|
16
|
-
{
|
|
17
|
-
"matcher": "Edit|Write",
|
|
18
|
-
"hooks": [
|
|
19
|
-
{
|
|
20
|
-
"type": "command",
|
|
21
|
-
"command": "npx cmp-memory pre-tool-guard"
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"matcher": "Task",
|
|
27
|
-
"hooks": [
|
|
28
|
-
{
|
|
29
|
-
"type": "command",
|
|
30
|
-
"command": "npx cmp-memory inject-knowledge"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"PostToolUse": [
|
|
36
|
-
{
|
|
37
|
-
"matcher": "Edit|Write",
|
|
38
|
-
"hooks": [
|
|
39
|
-
{
|
|
40
|
-
"type": "command",
|
|
41
|
-
"command": "npx cmp-memory checkpoint"
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"allowedTools": [
|
|
48
|
-
"Read",
|
|
49
|
-
"Glob",
|
|
50
|
-
"Grep",
|
|
51
|
-
"WebSearch",
|
|
52
|
-
"WebFetch"
|
|
53
|
-
],
|
|
54
|
-
"denyTools": [],
|
|
55
|
-
"contextWindow": 200000,
|
|
56
|
-
"model": "opus"
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/settings.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "*",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "npx cmp-memory session-context"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"PreToolUse": [
|
|
16
|
+
{
|
|
17
|
+
"matcher": "Edit|Write",
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "npx cmp-memory pre-tool-guard"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"matcher": "Task",
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "npx cmp-memory inject-knowledge"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"PostToolUse": [
|
|
36
|
+
{
|
|
37
|
+
"matcher": "Edit|Write",
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "npx cmp-memory checkpoint"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"allowedTools": [
|
|
48
|
+
"Read",
|
|
49
|
+
"Glob",
|
|
50
|
+
"Grep",
|
|
51
|
+
"WebSearch",
|
|
52
|
+
"WebFetch"
|
|
53
|
+
],
|
|
54
|
+
"denyTools": [],
|
|
55
|
+
"contextWindow": 200000,
|
|
56
|
+
"model": "opus"
|
|
57
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./hooks.config.schema.json",
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"timeout": 2000,
|
|
5
|
+
"silentFail": true,
|
|
6
|
+
"features": {
|
|
7
|
+
"sessionTracking": false,
|
|
8
|
+
"taskTracking": false,
|
|
9
|
+
"fileTracking": true,
|
|
10
|
+
"knowledgeInjection": true
|
|
11
|
+
},
|
|
12
|
+
"_comment": {
|
|
13
|
+
"enabled": "Master switch to enable/disable all hooks",
|
|
14
|
+
"timeout": "Maximum time (ms) for hook execution before fallback",
|
|
15
|
+
"silentFail": "If true, hooks never block tool execution on errors",
|
|
16
|
+
"sessionTracking": "Track sessions in Redis (requires network)",
|
|
17
|
+
"taskTracking": "Track active tasks in Turso (requires network)",
|
|
18
|
+
"fileTracking": "Track file modifications locally",
|
|
19
|
+
"knowledgeInjection": "Inject relevant knowledge on Task tool calls"
|
|
20
|
+
}
|
|
21
|
+
}
|