forked from diet103/claude-code-infrastructure-showcase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskill-rules.json
More file actions
241 lines (241 loc) · 9.22 KB
/
skill-rules.json
File metadata and controls
241 lines (241 loc) · 9.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
{
"version": "1.0",
"description": "Skill activation triggers for Claude Code. Controls when skills automatically suggest or block actions.",
"skills": {
"skill-developer": {
"type": "domain",
"enforcement": "suggest",
"priority": "high",
"description": "Meta-skill for creating and managing Claude Code skills",
"promptTriggers": {
"keywords": [
"skill system",
"create skill",
"add skill",
"skill triggers",
"skill rules",
"hook system",
"skill development",
"skill-rules.json"
],
"intentPatterns": [
"(how do|how does|explain).*?skill",
"(create|add|modify|build).*?skill",
"skill.*?(work|trigger|activate|system)"
]
}
},
"backend-dev-guidelines": {
"type": "domain",
"enforcement": "suggest",
"priority": "high",
"description": "Backend development patterns for Node.js/Express/TypeScript",
"promptTriggers": {
"keywords": [
"backend",
"backend development",
"microservice",
"controller",
"service",
"repository",
"route",
"routing",
"express",
"API",
"endpoint",
"middleware",
"validation",
"Zod",
"Prisma",
"database access",
"BaseController",
"dependency injection",
"unifiedConfig",
"configuration"
],
"intentPatterns": [
"(create|add|implement|build).*?(route|endpoint|API|controller|service|repository)",
"(fix|handle|debug).*?(error|exception|backend)",
"(add|implement).*?(middleware|validation|error.*?handling)",
"(organize|structure|refactor).*?(backend|service|API)",
"(how to|best practice).*?(backend|route|controller|service)"
]
},
"fileTriggers": {
"pathPatterns": [
"blog-api/src/**/*.ts",
"auth-service/src/**/*.ts",
"notifications-service/src/**/*.ts",
"backend/**/*.ts",
"api/**/*.ts",
"server/**/*.ts",
"services/**/*.ts"
],
"pathExclusions": [
"**/*.test.ts",
"**/*.spec.ts"
],
"contentPatterns": [
"router\\.",
"app\\.(get|post|put|delete|patch)",
"export.*Controller",
"export.*Service",
"prisma\\."
]
}
},
"frontend-dev-guidelines": {
"type": "guardrail",
"enforcement": "block",
"priority": "high",
"description": "React/TypeScript best practices including MUI v7 compatibility",
"promptTriggers": {
"keywords": [
"component",
"react component",
"UI",
"interface",
"page",
"modal",
"dialog",
"form",
"MUI",
"Material-UI",
"Grid",
"styling",
"frontend",
"React"
],
"intentPatterns": [
"(create|add|make|build|update|modify|edit).*?(component|UI|page|modal|dialog|form)",
"(how to|best practice).*?(component|react|MUI)",
"(style|design|layout).*?(component|UI)"
]
},
"fileTriggers": {
"pathPatterns": [
"frontend/src/**/*.tsx",
"frontend/src/**/*.ts",
"client/src/**/*.tsx",
"client/src/**/*.ts",
"src/**/*.tsx"
],
"pathExclusions": [
"**/*.test.tsx",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.spec.ts",
"**/*.styles.ts",
"**/vite.config.ts",
"**/tsconfig.json"
],
"contentPatterns": [
"from '@mui/material';",
"import.*Grid.*from.*@mui",
"<Grid ",
"Grid2",
"Unstable_Grid",
"makeStyles",
"@material-ui/core"
]
},
"blockMessage": "⚠️ BLOCKED - Frontend Best Practices Required\n\n📋 REQUIRED ACTION:\n1. Use Skill tool: 'frontend-dev-guidelines'\n2. Review MUI v7 patterns (Grid uses size={{}} prop, NOT xs/sm props)\n3. Check React/TypeScript best practices\n4. Use proper styling patterns\n5. Then retry this edit\n\nReason: Enforce MUI v7 compatibility and React best practices\nFile: {file_path}\n\n💡 TIP: Add '// @skip-validation' comment to skip future checks",
"skipConditions": {
"sessionSkillUsed": true,
"fileMarkers": [
"@skip-validation"
],
"envOverride": "SKIP_FRONTEND_GUIDELINES"
}
},
"route-tester": {
"type": "domain",
"enforcement": "suggest",
"priority": "high",
"description": "Testing authenticated API routes with JWT cookie-based auth",
"promptTriggers": {
"keywords": [
"test route",
"test endpoint",
"test API",
"route testing",
"API testing",
"authenticated route",
"JWT testing",
"cookie auth",
"test with auth"
],
"intentPatterns": [
"(test|debug|verify).*?(route|endpoint|API)",
"(how to|how do I).*?test.*?(route|endpoint|API)",
"test.*?(authenticated|auth|JWT|cookie)"
]
},
"fileTriggers": {
"pathPatterns": [
"**/routes/**/*.ts",
"**/test-*.js",
"**/test-*.ts"
],
"contentPatterns": [
"router\\.(get|post|put|delete|patch)",
"app\\.(get|post|put|delete|patch)"
]
}
},
"error-tracking": {
"type": "domain",
"enforcement": "suggest",
"priority": "high",
"description": "Sentry error tracking and performance monitoring patterns",
"promptTriggers": {
"keywords": [
"error handling",
"exception",
"sentry",
"error tracking",
"captureException",
"monitoring",
"performance tracking"
],
"intentPatterns": [
"(add|create|implement|setup).*?(error handling|sentry|error tracking)",
"(fix|handle|catch).*?(error|exception)",
"(how to|best practice).*?(error|sentry|monitoring)"
]
},
"fileTriggers": {
"pathPatterns": [
"**/instrument.ts",
"**/sentry*.ts",
"**/*Controller.ts",
"**/*Service.ts"
],
"contentPatterns": [
"@sentry",
"Sentry\\.",
"captureException",
"captureMessage"
]
}
}
},
"notes": {
"enforcement_types": {
"suggest": "Skill suggestion appears but doesn't block execution",
"block": "Requires skill to be used before proceeding (guardrail)",
"warn": "Shows warning but allows proceeding"
},
"priority_levels": {
"critical": "Highest - Always trigger when matched",
"high": "Important - Trigger for most matches",
"medium": "Moderate - Trigger for clear matches",
"low": "Optional - Trigger only for explicit matches"
},
"customization": {
"pathPatterns": "Adjust to match your project structure (blog-api, auth-service, etc.)",
"keywords": "Add domain-specific terms relevant to your project",
"intentPatterns": "Use regex for flexible user intent matching"
}
}
}