start-vibing 1.1.2 → 1.1.4
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/package.json +1 -1
- package/template/.claude/CLAUDE.md +129 -168
- package/template/.claude/agents/analyzer.md +0 -14
- package/template/.claude/agents/commit-manager.md +0 -19
- package/template/.claude/agents/documenter.md +0 -10
- package/template/.claude/agents/domain-updater.md +194 -200
- package/template/.claude/agents/final-validator.md +0 -18
- package/template/.claude/agents/orchestrator.md +36 -34
- package/template/.claude/agents/quality-checker.md +0 -24
- package/template/.claude/agents/research.md +299 -262
- package/template/.claude/agents/security-auditor.md +1 -14
- package/template/.claude/agents/tester.md +0 -8
- package/template/.claude/agents/ui-ux-reviewer.md +80 -18
- package/template/.claude/commands/feature.md +48 -102
- package/template/.claude/config/README.md +30 -30
- package/template/.claude/config/project-config.json +53 -53
- package/template/.claude/config/quality-gates.json +46 -46
- package/template/.claude/config/security-rules.json +45 -45
- package/template/.claude/config/testing-config.json +168 -168
- package/template/.claude/hooks/SETUP.md +52 -181
- package/template/.claude/hooks/user-prompt-submit.py +184 -46
- package/template/.claude/settings.json +0 -39
- package/template/.claude/skills/codebase-knowledge/SKILL.md +145 -145
- package/template/.claude/skills/codebase-knowledge/domains/claude-system.md +260 -321
- package/template/.claude/skills/docs-tracker/SKILL.md +239 -239
- package/template/.claude/skills/final-check/SKILL.md +284 -284
- package/template/.claude/skills/quality-gate/SKILL.md +278 -278
- package/template/.claude/skills/research-cache/SKILL.md +207 -207
- package/template/.claude/skills/security-scan/SKILL.md +206 -206
- package/template/.claude/skills/test-coverage/SKILL.md +441 -441
- package/template/.claude/skills/ui-ux-audit/SKILL.md +254 -254
- package/template/.claude/config/domain-mapping.json +0 -26
- package/template/.claude/hooks/post-tool-use.py +0 -155
- package/template/.claude/hooks/pre-tool-use.py +0 -159
- package/template/.claude/hooks/stop-validation.py +0 -155
- package/template/.claude/hooks/validate-commit.py +0 -200
- package/template/.claude/hooks/workflow-manager.py +0 -350
- package/template/.claude/workflow-state.schema.json +0 -200
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
UserPromptSubmit Hook -
|
|
3
|
+
UserPromptSubmit Hook - STRICT Workflow Enforcement
|
|
4
4
|
|
|
5
|
-
This hook runs BEFORE Claude processes any user prompt and:
|
|
6
|
-
1.
|
|
7
|
-
2.
|
|
8
|
-
3.
|
|
9
|
-
4.
|
|
5
|
+
This hook runs BEFORE Claude processes any user prompt and ENFORCES:
|
|
6
|
+
1. MANDATORY detailed todo list creation from prompt
|
|
7
|
+
2. MANDATORY research agent for new features
|
|
8
|
+
3. STRICT workflow: audit -> branch -> implement -> document -> quality -> PR
|
|
9
|
+
4. Separate UI for mobile/tablet/desktop (NOT just responsive)
|
|
10
|
+
5. NRY patterns (Never Repeat Yourself - common Claude mistakes)
|
|
10
11
|
|
|
11
12
|
Output is sent to Claude as context before processing the user's request.
|
|
12
13
|
|
|
@@ -24,6 +25,22 @@ PROJECT_DIR = os.environ.get('CLAUDE_PROJECT_DIR', os.getcwd())
|
|
|
24
25
|
WORKFLOW_STATE_PATH = Path(PROJECT_DIR) / '.claude' / 'workflow-state.json'
|
|
25
26
|
SETTINGS_PATH = Path(PROJECT_DIR) / '.claude' / 'settings.json'
|
|
26
27
|
|
|
28
|
+
# STRICT WORKFLOW SEQUENCE (MANDATORY)
|
|
29
|
+
STRICT_WORKFLOW = """
|
|
30
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
31
|
+
│ STRICT WORKFLOW (MANDATORY) │
|
|
32
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
33
|
+
│ 1. TODO LIST → Create DETAILED todo list from prompt │
|
|
34
|
+
│ 2. RESEARCH → Run research agent for NEW features │
|
|
35
|
+
│ 3. AUDIT → Check last audit docs OR run fresh audit │
|
|
36
|
+
│ 4. BRANCH → Create feature/ | fix/ | refactor/ | test/ │
|
|
37
|
+
│ 5. IMPLEMENT → Follow rules + analyzer approval │
|
|
38
|
+
│ 6. DOCUMENT → Document results, bugs, solutions (with hash)│
|
|
39
|
+
│ 7. QUALITY → typecheck + lint + test (Husky enforced) │
|
|
40
|
+
│ 8. PR → Create PR to main with doc references │
|
|
41
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
42
|
+
"""
|
|
43
|
+
|
|
27
44
|
# Agent definitions with triggers
|
|
28
45
|
AGENTS = {
|
|
29
46
|
'orchestrator': {
|
|
@@ -39,22 +56,24 @@ AGENTS = {
|
|
|
39
56
|
'when': 'BEFORE any Edit/Write to source files'
|
|
40
57
|
},
|
|
41
58
|
'research': {
|
|
42
|
-
'description': 'Researches best practices
|
|
43
|
-
'triggers': ['research', 'investigate', 'study', 'best practice', 'how to', 'pattern'],
|
|
59
|
+
'description': 'Researches best practices (2024-2025) - MANDATORY for new features',
|
|
60
|
+
'triggers': ['research', 'investigate', 'study', 'best practice', 'how to', 'pattern', 'new feature', 'implement'],
|
|
44
61
|
'priority': 3,
|
|
45
|
-
'when': '
|
|
62
|
+
'when': 'MANDATORY for ANY new feature or complex bug fix',
|
|
63
|
+
'mandatory_for': ['feature', 'fix']
|
|
46
64
|
},
|
|
47
65
|
'ui-ux-reviewer': {
|
|
48
|
-
'description': 'Reviews UI/UX
|
|
49
|
-
'triggers': ['ui', 'component', 'page', 'design', 'layout', 'style', '
|
|
66
|
+
'description': 'Reviews UI/UX - ENFORCES separate mobile/tablet/desktop UIs',
|
|
67
|
+
'triggers': ['ui', 'component', 'page', 'design', 'layout', 'style', 'frontend', 'mobile', 'desktop'],
|
|
50
68
|
'priority': 3,
|
|
51
|
-
'when': 'Files in components/, app/, or .tsx with JSX'
|
|
69
|
+
'when': 'Files in components/, app/, or .tsx with JSX',
|
|
70
|
+
'enforces': 'SEPARATE UIs for each platform (NOT just responsive)'
|
|
52
71
|
},
|
|
53
72
|
'documenter': {
|
|
54
|
-
'description': '
|
|
73
|
+
'description': 'Documents results with commit hash references',
|
|
55
74
|
'triggers': ['document', 'readme', 'docs', 'explain'],
|
|
56
75
|
'priority': 4,
|
|
57
|
-
'when': 'After
|
|
76
|
+
'when': 'After implementation - MUST include commit hash for audit trail'
|
|
58
77
|
},
|
|
59
78
|
'tester': {
|
|
60
79
|
'description': 'Creates unit tests (Vitest) and E2E tests (Playwright)',
|
|
@@ -70,10 +89,10 @@ AGENTS = {
|
|
|
70
89
|
'can_veto': True
|
|
71
90
|
},
|
|
72
91
|
'quality-checker': {
|
|
73
|
-
'description': 'Runs typecheck, lint, test, build',
|
|
92
|
+
'description': 'Runs typecheck, lint, test, build (Husky pre-commit)',
|
|
74
93
|
'triggers': ['check', 'verify', 'validate', 'run tests', 'quality'],
|
|
75
94
|
'priority': 7,
|
|
76
|
-
'when': '
|
|
95
|
+
'when': 'BEFORE any commit - Husky enforces this'
|
|
77
96
|
},
|
|
78
97
|
'final-validator': {
|
|
79
98
|
'description': 'Final validation before commit (CAN VETO)',
|
|
@@ -168,7 +187,7 @@ def format_agent_list() -> str:
|
|
|
168
187
|
def format_workflow_status(state: dict) -> str:
|
|
169
188
|
"""Format current workflow status"""
|
|
170
189
|
if not state or not state.get('currentTask'):
|
|
171
|
-
return "STATUS: No active task. Start with orchestrator
|
|
190
|
+
return "STATUS: No active task. Start with orchestrator agent"
|
|
172
191
|
|
|
173
192
|
task = state['currentTask']
|
|
174
193
|
agents = task.get('agents', {})
|
|
@@ -202,12 +221,44 @@ def main():
|
|
|
202
221
|
task_type = detect_task_type(prompt) if prompt else 'unknown'
|
|
203
222
|
best_agent, reason = detect_best_agent(prompt) if prompt else ('orchestrator', 'Default')
|
|
204
223
|
|
|
224
|
+
# Check if task is new feature (requires research)
|
|
225
|
+
is_new_feature = task_type in ['feature'] or any(word in prompt.lower() for word in ['new', 'implement', 'create', 'add'])
|
|
226
|
+
is_ui_task = any(word in prompt.lower() for word in ['ui', 'component', 'page', 'design', 'layout', 'mobile', 'desktop', 'tablet'])
|
|
227
|
+
|
|
205
228
|
# Build output message
|
|
206
229
|
output = f"""
|
|
207
230
|
================================================================================
|
|
208
|
-
WORKFLOW ENFORCEMENT - UserPromptSubmit Hook
|
|
231
|
+
STRICT WORKFLOW ENFORCEMENT - UserPromptSubmit Hook
|
|
209
232
|
================================================================================
|
|
233
|
+
{STRICT_WORKFLOW}
|
|
210
234
|
|
|
235
|
+
{"⚠️ NEW FEATURE DETECTED - RESEARCH AGENT IS MANDATORY!" if is_new_feature else ""}
|
|
236
|
+
{"⚠️ UI TASK DETECTED - SEPARATE UIs FOR MOBILE/TABLET/DESKTOP REQUIRED!" if is_ui_task else ""}
|
|
237
|
+
|
|
238
|
+
================================================================================
|
|
239
|
+
STEP 1: CREATE DETAILED TODO LIST (MANDATORY)
|
|
240
|
+
================================================================================
|
|
241
|
+
|
|
242
|
+
BEFORE doing anything, you MUST use TodoWrite to create a detailed todo list.
|
|
243
|
+
Break down the user's prompt into specific, actionable items.
|
|
244
|
+
|
|
245
|
+
Example:
|
|
246
|
+
User prompt: "Add login feature"
|
|
247
|
+
Todo list:
|
|
248
|
+
1. Research login best practices 2024-2025
|
|
249
|
+
2. Check existing auth documentation
|
|
250
|
+
3. Create feature/login branch
|
|
251
|
+
4. Implement login form (mobile UI)
|
|
252
|
+
5. Implement login form (tablet UI)
|
|
253
|
+
6. Implement login form (desktop UI)
|
|
254
|
+
7. Add validation with visual feedback
|
|
255
|
+
8. Create unit tests
|
|
256
|
+
9. Create E2E tests
|
|
257
|
+
10. Document implementation with commit hash
|
|
258
|
+
11. Run quality gates
|
|
259
|
+
12. Create PR to main
|
|
260
|
+
|
|
261
|
+
================================================================================
|
|
211
262
|
AVAILABLE AGENTS:
|
|
212
263
|
{format_agent_list()}
|
|
213
264
|
|
|
@@ -215,50 +266,137 @@ TASK ANALYSIS:
|
|
|
215
266
|
Detected type: {task_type}
|
|
216
267
|
Recommended agent: {best_agent}
|
|
217
268
|
Reason: {reason}
|
|
269
|
+
Research required: {"YES (MANDATORY)" if is_new_feature else "Optional"}
|
|
270
|
+
Separate UIs required: {"YES (MANDATORY)" if is_ui_task else "N/A"}
|
|
218
271
|
Workflow sequence: {' -> '.join(WORKFLOWS.get(task_type, WORKFLOWS['feature']))}
|
|
219
272
|
|
|
220
273
|
{format_workflow_status(state)}
|
|
221
274
|
|
|
222
275
|
================================================================================
|
|
223
|
-
|
|
276
|
+
UI ARCHITECTURE RULES (MANDATORY FOR WEB APPS)
|
|
277
|
+
================================================================================
|
|
278
|
+
|
|
279
|
+
❌ DO NOT make "responsive" UI only
|
|
280
|
+
✅ CREATE SEPARATE UIs for each platform:
|
|
281
|
+
|
|
282
|
+
MOBILE (375px):
|
|
283
|
+
- Bottom navigation bar
|
|
284
|
+
- Full-screen modal for search (closable)
|
|
285
|
+
- Pull-to-refresh
|
|
286
|
+
- Touch targets 44x44px minimum
|
|
287
|
+
|
|
288
|
+
TABLET (768px):
|
|
289
|
+
- Condensed data in dropdowns
|
|
290
|
+
- Hybrid collapsible sidebar
|
|
291
|
+
- Adapted touch/click
|
|
292
|
+
|
|
293
|
+
DESKTOP (1280px+):
|
|
294
|
+
- Left sidebar: notifications, profile, nav
|
|
295
|
+
- Top navbar: centered Levenshtein search
|
|
296
|
+
- High information density
|
|
297
|
+
|
|
298
|
+
SHARED:
|
|
299
|
+
- Featured carousel section
|
|
300
|
+
- Hidden scrollbars (but scroll works)
|
|
301
|
+
- Scroll indicators (arrows)
|
|
302
|
+
- Framer Motion transitions
|
|
303
|
+
|
|
304
|
+
================================================================================
|
|
305
|
+
INPUT VALIDATION RULES (ALL INPUTS)
|
|
306
|
+
================================================================================
|
|
307
|
+
|
|
308
|
+
Every input MUST have:
|
|
309
|
+
- Real-time visual feedback (green/red borders)
|
|
310
|
+
- Error checklist below input (disappears when fixed)
|
|
311
|
+
- Autofill validation (prevent email in nickname field)
|
|
312
|
+
- onInput + onAnimationStart for autofill detection
|
|
313
|
+
|
|
314
|
+
================================================================================
|
|
315
|
+
NRY - NEVER REPEAT YOURSELF (Common Claude Mistakes)
|
|
316
|
+
================================================================================
|
|
317
|
+
|
|
318
|
+
❌ Multi-line bash with backslash (breaks permissions)
|
|
319
|
+
❌ Relative paths in permissions
|
|
320
|
+
❌ Ignoring context size (use /compact)
|
|
321
|
+
❌ Relying on undo for critical code
|
|
322
|
+
❌ Executing agent logic manually
|
|
323
|
+
❌ Using bash for file operations (cat, echo >)
|
|
324
|
+
|
|
325
|
+
✅ Single-line commands with &&
|
|
326
|
+
✅ Absolute paths in permissions
|
|
327
|
+
✅ Commit to git before major changes
|
|
328
|
+
✅ Use Task tool to invoke agents
|
|
329
|
+
✅ Use Read/Write/Edit for files
|
|
330
|
+
|
|
331
|
+
================================================================================
|
|
332
|
+
AGENT INVOCATION (VIA TASK TOOL ONLY)
|
|
224
333
|
================================================================================
|
|
225
334
|
|
|
226
335
|
You MUST use the Task tool with subagent_type to invoke agents.
|
|
227
336
|
DO NOT execute agent logic manually - INVOKE the agent properly.
|
|
228
337
|
|
|
229
|
-
AGENTS
|
|
230
|
-
-
|
|
231
|
-
- analyzer:
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
338
|
+
AGENTS INVOCABLE VIA TASK TOOL:
|
|
339
|
+
- research: Task(subagent_type="research", prompt="...") {"<-- MANDATORY FOR THIS TASK" if is_new_feature else ""}
|
|
340
|
+
- analyzer: Task(subagent_type="analyzer", prompt="...")
|
|
341
|
+
- ui-ux-reviewer: Task(subagent_type="ui-ux-reviewer", prompt="...") {"<-- MANDATORY FOR THIS TASK" if is_ui_task else ""}
|
|
342
|
+
- tester: Task(subagent_type="tester", prompt="...")
|
|
343
|
+
- security-auditor: Task(subagent_type="security-auditor", prompt="...")
|
|
344
|
+
- quality-checker: Task(subagent_type="quality-checker", prompt="...")
|
|
345
|
+
- final-validator: Task(subagent_type="final-validator", prompt="...")
|
|
346
|
+
- documenter: Task(subagent_type="documenter", prompt="...")
|
|
347
|
+
- commit-manager: Task(subagent_type="commit-manager", prompt="...")
|
|
348
|
+
- orchestrator: Task(subagent_type="orchestrator", prompt="...")
|
|
239
349
|
|
|
240
|
-
|
|
241
|
-
|
|
350
|
+
================================================================================
|
|
351
|
+
MANDATORY RULES CHECKLIST:
|
|
352
|
+
================================================================================
|
|
353
|
+
|
|
354
|
+
[ ] 1. I WILL create a DETAILED todo list using TodoWrite FIRST
|
|
355
|
+
[ ] 2. I WILL run research agent for new features (MANDATORY)
|
|
356
|
+
[ ] 3. I WILL check/create audit documentation
|
|
357
|
+
[ ] 4. I WILL create proper branch (feature/fix/refactor/test)
|
|
358
|
+
[ ] 5. I WILL create SEPARATE UIs for mobile/tablet/desktop (if UI task)
|
|
359
|
+
[ ] 6. I WILL add real-time validation to ALL inputs
|
|
360
|
+
[ ] 7. I WILL document with commit hash references
|
|
361
|
+
[ ] 8. I WILL run quality gates before commit (Husky enforced)
|
|
362
|
+
[ ] 9. I WILL create PR to main with doc references
|
|
363
|
+
[ ] 10. I WILL use Task tool to invoke agents (NOT manually)
|
|
364
|
+
|
|
365
|
+
================================================================================
|
|
366
|
+
COMPONENT DESIGN RULES (SELF-AWARE RESPONSIVE):
|
|
367
|
+
================================================================================
|
|
242
368
|
|
|
243
|
-
|
|
244
|
-
|
|
369
|
+
Components CAN be responsive internally (detect their own device type).
|
|
370
|
+
But layouts MUST be separate for each platform.
|
|
371
|
+
|
|
372
|
+
CARD COMPONENTS:
|
|
373
|
+
- NO BORDERS - Use shadows and backgrounds instead
|
|
374
|
+
- Use useDeviceType() hook for self-awareness
|
|
375
|
+
- Adapt padding/layout based on device
|
|
376
|
+
- Desktop: hover effects (scale, shadow)
|
|
377
|
+
- Mobile: touch-optimized (44px targets)
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
// GOOD - Self-aware component
|
|
381
|
+
const device = useDeviceType();
|
|
382
|
+
<div className={cn(
|
|
383
|
+
'rounded-2xl shadow-lg', // NO borders
|
|
384
|
+
device === 'mobile' ? 'p-4' : 'p-6 hover:scale-[1.02]'
|
|
385
|
+
)} />
|
|
386
|
+
```
|
|
245
387
|
|
|
246
388
|
================================================================================
|
|
247
|
-
MANDATORY
|
|
389
|
+
END OF WORKFLOW MANDATORY:
|
|
248
390
|
================================================================================
|
|
249
391
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
WORKFLOW COMMANDS (for tracking, not replacement for agents):
|
|
260
|
-
Start task: python .claude/hooks/workflow-manager.py start-task --type {task_type} --description "..."
|
|
261
|
-
Approve files: python .claude/hooks/workflow-manager.py approve-files --files "path/to/file"
|
|
392
|
+
After completing any task, you MUST:
|
|
393
|
+
|
|
394
|
+
1. Run commit-manager agent via Task tool
|
|
395
|
+
2. Commit all changes with conventional commit format
|
|
396
|
+
3. Create PR to main if on feature/fix branch
|
|
397
|
+
4. NEVER leave uncommitted changes
|
|
398
|
+
|
|
399
|
+
This is MANDATORY - workflow is NOT complete until committed.
|
|
262
400
|
|
|
263
401
|
================================================================================
|
|
264
402
|
"""
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "AI Builder Development",
|
|
3
|
-
"version": "1.2.0",
|
|
4
|
-
"description": "Configuracao para agentes de desenvolvimento do AI Builder - Todos agentes pesquisam best practices",
|
|
5
2
|
|
|
6
3
|
"model": "claude-opus-4-5-20251101",
|
|
7
4
|
"max_tokens": 8192,
|
|
@@ -66,42 +63,6 @@
|
|
|
66
63
|
}
|
|
67
64
|
]
|
|
68
65
|
}
|
|
69
|
-
],
|
|
70
|
-
"PreToolUse": [
|
|
71
|
-
{
|
|
72
|
-
"matcher": "Edit|Write|NotebookEdit",
|
|
73
|
-
"hooks": [
|
|
74
|
-
{
|
|
75
|
-
"type": "command",
|
|
76
|
-
"command": "python .claude/hooks/pre-tool-use.py",
|
|
77
|
-
"timeout": 5
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
"PostToolUse": [
|
|
83
|
-
{
|
|
84
|
-
"matcher": "Edit|Write|NotebookEdit",
|
|
85
|
-
"hooks": [
|
|
86
|
-
{
|
|
87
|
-
"type": "command",
|
|
88
|
-
"command": "python .claude/hooks/post-tool-use.py",
|
|
89
|
-
"timeout": 5
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
"Stop": [
|
|
95
|
-
{
|
|
96
|
-
"matcher": "",
|
|
97
|
-
"hooks": [
|
|
98
|
-
{
|
|
99
|
-
"type": "command",
|
|
100
|
-
"command": "python .claude/hooks/stop-validation.py",
|
|
101
|
-
"timeout": 10
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
66
|
]
|
|
106
67
|
},
|
|
107
68
|
|
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: codebase-knowledge
|
|
3
|
-
description: Provides cached knowledge about project domains. Maps files by domain, tracks connections between components, records recent commits. Use before implementing to understand affected areas.
|
|
4
|
-
allowed-tools: Read, Glob, Grep
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Codebase Knowledge - Domain Mapping System
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This skill provides cached knowledge about project domains:
|
|
12
|
-
|
|
13
|
-
- **Maps** files by domain/feature area
|
|
14
|
-
- **Tracks** connections between components
|
|
15
|
-
- **Records** recent commits per area
|
|
16
|
-
- **Caches** architecture decisions
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## How It Works
|
|
21
|
-
|
|
22
|
-
### Domain Files Location
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
.claude/skills/codebase-knowledge/domains/
|
|
26
|
-
├── [domain-name].md # One file per domain
|
|
27
|
-
└── ...
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Domain File Template
|
|
31
|
-
|
|
32
|
-
```markdown
|
|
33
|
-
# [Domain Name]
|
|
34
|
-
|
|
35
|
-
## Last Update
|
|
36
|
-
|
|
37
|
-
- **Date:** YYYY-MM-DD
|
|
38
|
-
- **Commit:** [hash]
|
|
39
|
-
|
|
40
|
-
## Files
|
|
41
|
-
|
|
42
|
-
### Frontend
|
|
43
|
-
|
|
44
|
-
- `app/[path]/page.tsx` - Description
|
|
45
|
-
- `components/[path]/*.tsx` - Description
|
|
46
|
-
|
|
47
|
-
### Backend
|
|
48
|
-
|
|
49
|
-
- `server/trpc/routers/[name].router.ts` - Router
|
|
50
|
-
- `server/db/models/[name].model.ts` - Model
|
|
51
|
-
|
|
52
|
-
### Types/Schemas
|
|
53
|
-
|
|
54
|
-
- `lib/validators/[name].ts` - Zod schemas
|
|
55
|
-
|
|
56
|
-
## Connections
|
|
57
|
-
|
|
58
|
-
- **[other-domain]:** How they connect
|
|
59
|
-
|
|
60
|
-
## Recent Commits
|
|
61
|
-
|
|
62
|
-
| Hash | Date | Description |
|
|
63
|
-
| ------ | ---------- | ----------------- |
|
|
64
|
-
| abc123 | YYYY-MM-DD | feat: description |
|
|
65
|
-
|
|
66
|
-
## Attention Points
|
|
67
|
-
|
|
68
|
-
- [Special rules, gotchas, etc]
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Workflow
|
|
74
|
-
|
|
75
|
-
### BEFORE Implementation
|
|
76
|
-
|
|
77
|
-
1. **Identify** which domain is affected
|
|
78
|
-
2. **Read** `domains/[domain].md` file
|
|
79
|
-
3. **Check** affected files listed
|
|
80
|
-
4. **Verify** recent commits for context
|
|
81
|
-
5. **Note** connections with other domains
|
|
82
|
-
|
|
83
|
-
### AFTER Implementation
|
|
84
|
-
|
|
85
|
-
1. **Update** the domain file
|
|
86
|
-
2. **Add** new commit to "Recent Commits"
|
|
87
|
-
3. **Add/remove** files if changed
|
|
88
|
-
4. **Update** connections if affected
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Commands
|
|
93
|
-
|
|
94
|
-
### Check Recent Commits by Domain
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
git log --oneline -10 -- [list of domain files]
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Check Uncommitted Changes
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
git diff --name-status main..HEAD
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Create New Domain File
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
# Copy template
|
|
110
|
-
cp .claude/skills/codebase-knowledge/TEMPLATE.md .claude/skills/codebase-knowledge/domains/[name].md
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## Rules
|
|
116
|
-
|
|
117
|
-
### MANDATORY
|
|
118
|
-
|
|
119
|
-
1. **READ domain before implementing** - Always check cached knowledge
|
|
120
|
-
2. **UPDATE after implementing** - Keep cache current
|
|
121
|
-
3. **VERIFY connections** - Changes may affect other domains
|
|
122
|
-
4. **RECORD commits** - Maintain history
|
|
123
|
-
|
|
124
|
-
### FORBIDDEN
|
|
125
|
-
|
|
126
|
-
1. **Ignore cached knowledge** - It exists to accelerate development
|
|
127
|
-
2. **Leave outdated** - Old docs are worse than none
|
|
128
|
-
3. **Modify without recording** - Every commit should be noted
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
## Integration with Agents
|
|
133
|
-
|
|
134
|
-
The **analyzer** agent MUST use this skill:
|
|
135
|
-
|
|
136
|
-
1. Check which domain is affected
|
|
137
|
-
2. Read domain file for context
|
|
138
|
-
3. Report affected files and connections
|
|
139
|
-
4. Update domain after implementation
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## Version
|
|
144
|
-
|
|
145
|
-
- **v2.0.0** - Generic template (no project-specific domains)
|
|
1
|
+
---
|
|
2
|
+
name: codebase-knowledge
|
|
3
|
+
description: Provides cached knowledge about project domains. Maps files by domain, tracks connections between components, records recent commits. Use before implementing to understand affected areas.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codebase Knowledge - Domain Mapping System
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
This skill provides cached knowledge about project domains:
|
|
12
|
+
|
|
13
|
+
- **Maps** files by domain/feature area
|
|
14
|
+
- **Tracks** connections between components
|
|
15
|
+
- **Records** recent commits per area
|
|
16
|
+
- **Caches** architecture decisions
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## How It Works
|
|
21
|
+
|
|
22
|
+
### Domain Files Location
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
.claude/skills/codebase-knowledge/domains/
|
|
26
|
+
├── [domain-name].md # One file per domain
|
|
27
|
+
└── ...
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Domain File Template
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# [Domain Name]
|
|
34
|
+
|
|
35
|
+
## Last Update
|
|
36
|
+
|
|
37
|
+
- **Date:** YYYY-MM-DD
|
|
38
|
+
- **Commit:** [hash]
|
|
39
|
+
|
|
40
|
+
## Files
|
|
41
|
+
|
|
42
|
+
### Frontend
|
|
43
|
+
|
|
44
|
+
- `app/[path]/page.tsx` - Description
|
|
45
|
+
- `components/[path]/*.tsx` - Description
|
|
46
|
+
|
|
47
|
+
### Backend
|
|
48
|
+
|
|
49
|
+
- `server/trpc/routers/[name].router.ts` - Router
|
|
50
|
+
- `server/db/models/[name].model.ts` - Model
|
|
51
|
+
|
|
52
|
+
### Types/Schemas
|
|
53
|
+
|
|
54
|
+
- `lib/validators/[name].ts` - Zod schemas
|
|
55
|
+
|
|
56
|
+
## Connections
|
|
57
|
+
|
|
58
|
+
- **[other-domain]:** How they connect
|
|
59
|
+
|
|
60
|
+
## Recent Commits
|
|
61
|
+
|
|
62
|
+
| Hash | Date | Description |
|
|
63
|
+
| ------ | ---------- | ----------------- |
|
|
64
|
+
| abc123 | YYYY-MM-DD | feat: description |
|
|
65
|
+
|
|
66
|
+
## Attention Points
|
|
67
|
+
|
|
68
|
+
- [Special rules, gotchas, etc]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Workflow
|
|
74
|
+
|
|
75
|
+
### BEFORE Implementation
|
|
76
|
+
|
|
77
|
+
1. **Identify** which domain is affected
|
|
78
|
+
2. **Read** `domains/[domain].md` file
|
|
79
|
+
3. **Check** affected files listed
|
|
80
|
+
4. **Verify** recent commits for context
|
|
81
|
+
5. **Note** connections with other domains
|
|
82
|
+
|
|
83
|
+
### AFTER Implementation
|
|
84
|
+
|
|
85
|
+
1. **Update** the domain file
|
|
86
|
+
2. **Add** new commit to "Recent Commits"
|
|
87
|
+
3. **Add/remove** files if changed
|
|
88
|
+
4. **Update** connections if affected
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Commands
|
|
93
|
+
|
|
94
|
+
### Check Recent Commits by Domain
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git log --oneline -10 -- [list of domain files]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Check Uncommitted Changes
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
git diff --name-status main..HEAD
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Create New Domain File
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Copy template
|
|
110
|
+
cp .claude/skills/codebase-knowledge/TEMPLATE.md .claude/skills/codebase-knowledge/domains/[name].md
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Rules
|
|
116
|
+
|
|
117
|
+
### MANDATORY
|
|
118
|
+
|
|
119
|
+
1. **READ domain before implementing** - Always check cached knowledge
|
|
120
|
+
2. **UPDATE after implementing** - Keep cache current
|
|
121
|
+
3. **VERIFY connections** - Changes may affect other domains
|
|
122
|
+
4. **RECORD commits** - Maintain history
|
|
123
|
+
|
|
124
|
+
### FORBIDDEN
|
|
125
|
+
|
|
126
|
+
1. **Ignore cached knowledge** - It exists to accelerate development
|
|
127
|
+
2. **Leave outdated** - Old docs are worse than none
|
|
128
|
+
3. **Modify without recording** - Every commit should be noted
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Integration with Agents
|
|
133
|
+
|
|
134
|
+
The **analyzer** agent MUST use this skill:
|
|
135
|
+
|
|
136
|
+
1. Check which domain is affected
|
|
137
|
+
2. Read domain file for context
|
|
138
|
+
3. Report affected files and connections
|
|
139
|
+
4. Update domain after implementation
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Version
|
|
144
|
+
|
|
145
|
+
- **v2.0.0** - Generic template (no project-specific domains)
|