start-vibing 3.0.7 → 3.0.9
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 +64 -51
- package/package.json +1 -1
- package/template/.claude/CLAUDE.md +717 -229
- package/template/.claude/agents/claude-md-compactor.md +2 -14
- package/template/.claude/agents/documenter.md +0 -7
- package/template/.claude/agents/domain-updater.md +2 -7
- package/template/.claude/config/README.md +10 -8
- package/template/.claude/config/domain-mapping.json +1 -1
- package/template/.claude/settings.json +0 -129
- package/template/.claude/skills/api-docs/SKILL.md +206 -0
- package/template/.claude/skills/claude-seo/SKILL.md +84 -0
- package/template/.claude/skills/codebase-knowledge/domains/claude-system.md +51 -416
- package/template/.claude/skills/codebase-knowledge/domains/mcp-integration.md +37 -204
- package/template/.claude/skills/mongoose-patterns/SKILL.md +141 -452
- package/template/.claude/skills/playwright-testing/SKILL.md +251 -0
- package/template/.claude/skills/skill-creator/SKILL.md +106 -0
- package/template/.claude/skills/test-infrastructure/SKILL.md +242 -0
- package/template/CLAUDE.md +65 -701
- package/template/.claude/agents/_archive/01-orchestration/agent-selector.md +0 -130
- package/template/.claude/agents/_archive/01-orchestration/checkpoint-manager.md +0 -142
- package/template/.claude/agents/_archive/01-orchestration/context-manager.md +0 -138
- package/template/.claude/agents/_archive/01-orchestration/error-recovery.md +0 -182
- package/template/.claude/agents/_archive/01-orchestration/orchestrator.md +0 -114
- package/template/.claude/agents/_archive/01-orchestration/parallel-coordinator.md +0 -141
- package/template/.claude/agents/_archive/01-orchestration/task-decomposer.md +0 -121
- package/template/.claude/agents/_archive/01-orchestration/workflow-router.md +0 -119
- package/template/.claude/agents/_archive/02-typescript/bun-runtime-expert.md +0 -197
- package/template/.claude/agents/_archive/02-typescript/esm-resolver.md +0 -193
- package/template/.claude/agents/_archive/02-typescript/import-alias-enforcer.md +0 -158
- package/template/.claude/agents/_archive/02-typescript/ts-generics-helper.md +0 -183
- package/template/.claude/agents/_archive/02-typescript/ts-migration-helper.md +0 -238
- package/template/.claude/agents/_archive/02-typescript/ts-strict-checker.md +0 -180
- package/template/.claude/agents/_archive/02-typescript/ts-types-analyzer.md +0 -199
- package/template/.claude/agents/_archive/02-typescript/type-definition-writer.md +0 -187
- package/template/.claude/agents/_archive/02-typescript/zod-schema-designer.md +0 -212
- package/template/.claude/agents/_archive/02-typescript/zod-validator.md +0 -158
- package/template/.claude/agents/_archive/03-testing/playwright-assertions.md +0 -265
- package/template/.claude/agents/_archive/03-testing/playwright-e2e.md +0 -247
- package/template/.claude/agents/_archive/03-testing/playwright-fixtures.md +0 -234
- package/template/.claude/agents/_archive/03-testing/playwright-multi-viewport.md +0 -256
- package/template/.claude/agents/_archive/03-testing/playwright-page-objects.md +0 -247
- package/template/.claude/agents/_archive/03-testing/test-cleanup-manager.md +0 -248
- package/template/.claude/agents/_archive/03-testing/test-data-generator.md +0 -254
- package/template/.claude/agents/_archive/03-testing/tester-integration.md +0 -278
- package/template/.claude/agents/_archive/03-testing/tester-unit.md +0 -207
- package/template/.claude/agents/_archive/03-testing/vitest-config.md +0 -287
- package/template/.claude/agents/_archive/04-docker/container-health.md +0 -255
- package/template/.claude/agents/_archive/04-docker/deployment-validator.md +0 -225
- package/template/.claude/agents/_archive/04-docker/docker-compose-designer.md +0 -281
- package/template/.claude/agents/_archive/04-docker/docker-env-manager.md +0 -235
- package/template/.claude/agents/_archive/04-docker/docker-multi-stage.md +0 -241
- package/template/.claude/agents/_archive/04-docker/dockerfile-optimizer.md +0 -208
- package/template/.claude/agents/_archive/05-database/database-seeder.md +0 -273
- package/template/.claude/agents/_archive/05-database/mongodb-query-optimizer.md +0 -230
- package/template/.claude/agents/_archive/05-database/mongoose-aggregation.md +0 -306
- package/template/.claude/agents/_archive/05-database/mongoose-index-optimizer.md +0 -182
- package/template/.claude/agents/_archive/05-database/mongoose-schema-designer.md +0 -267
- package/template/.claude/agents/_archive/06-security/auth-session-validator.md +0 -68
- package/template/.claude/agents/_archive/06-security/input-sanitizer.md +0 -80
- package/template/.claude/agents/_archive/06-security/owasp-checker.md +0 -97
- package/template/.claude/agents/_archive/06-security/permission-auditor.md +0 -100
- package/template/.claude/agents/_archive/06-security/security-auditor.md +0 -84
- package/template/.claude/agents/_archive/06-security/sensitive-data-scanner.md +0 -83
- package/template/.claude/agents/_archive/07-documentation/api-documenter.md +0 -136
- package/template/.claude/agents/_archive/07-documentation/changelog-manager.md +0 -105
- package/template/.claude/agents/_archive/07-documentation/claude-md-compactor.md +0 -214
- package/template/.claude/agents/_archive/07-documentation/documenter.md +0 -184
- package/template/.claude/agents/_archive/07-documentation/domain-updater.md +0 -138
- package/template/.claude/agents/_archive/07-documentation/jsdoc-generator.md +0 -114
- package/template/.claude/agents/_archive/07-documentation/readme-generator.md +0 -135
- package/template/.claude/agents/_archive/08-git/branch-manager.md +0 -58
- package/template/.claude/agents/_archive/08-git/commit-manager.md +0 -78
- package/template/.claude/agents/_archive/09-quality/code-reviewer.md +0 -71
- package/template/.claude/agents/_archive/09-quality/quality-checker.md +0 -67
- package/template/.claude/agents/_archive/10-research/best-practices-finder.md +0 -89
- package/template/.claude/agents/_archive/10-research/competitor-analyzer.md +0 -106
- package/template/.claude/agents/_archive/10-research/pattern-researcher.md +0 -93
- package/template/.claude/agents/_archive/10-research/research-cache-manager.md +0 -76
- package/template/.claude/agents/_archive/10-research/research-web.md +0 -98
- package/template/.claude/agents/_archive/10-research/tech-evaluator.md +0 -101
- package/template/.claude/agents/_archive/11-ui-ux/accessibility-auditor.md +0 -136
- package/template/.claude/agents/_archive/11-ui-ux/design-system-enforcer.md +0 -125
- package/template/.claude/agents/_archive/11-ui-ux/skeleton-generator.md +0 -118
- package/template/.claude/agents/_archive/11-ui-ux/ui-desktop.md +0 -132
- package/template/.claude/agents/_archive/11-ui-ux/ui-mobile.md +0 -125
- package/template/.claude/agents/_archive/11-ui-ux/ui-tablet.md +0 -110
- package/template/.claude/agents/_archive/12-performance/api-latency-analyzer.md +0 -156
- package/template/.claude/agents/_archive/12-performance/bundle-analyzer.md +0 -113
- package/template/.claude/agents/_archive/12-performance/memory-leak-detector.md +0 -137
- package/template/.claude/agents/_archive/12-performance/performance-profiler.md +0 -115
- package/template/.claude/agents/_archive/12-performance/query-optimizer.md +0 -124
- package/template/.claude/agents/_archive/12-performance/render-optimizer.md +0 -154
- package/template/.claude/agents/_archive/13-debugging/build-error-fixer.md +0 -207
- package/template/.claude/agents/_archive/13-debugging/debugger.md +0 -149
- package/template/.claude/agents/_archive/13-debugging/error-stack-analyzer.md +0 -141
- package/template/.claude/agents/_archive/13-debugging/network-debugger.md +0 -208
- package/template/.claude/agents/_archive/13-debugging/runtime-error-fixer.md +0 -181
- package/template/.claude/agents/_archive/13-debugging/type-error-resolver.md +0 -185
- package/template/.claude/agents/_archive/14-validation/final-validator.md +0 -93
- package/template/.claude/agents/_archive/_backup/analyzer.md +0 -134
- package/template/.claude/agents/_archive/_backup/code-reviewer.md +0 -279
- package/template/.claude/agents/_archive/_backup/commit-manager.md +0 -219
- package/template/.claude/agents/_archive/_backup/debugger.md +0 -280
- package/template/.claude/agents/_archive/_backup/documenter.md +0 -237
- package/template/.claude/agents/_archive/_backup/domain-updater.md +0 -197
- package/template/.claude/agents/_archive/_backup/final-validator.md +0 -169
- package/template/.claude/agents/_archive/_backup/orchestrator.md +0 -149
- package/template/.claude/agents/_archive/_backup/performance.md +0 -232
- package/template/.claude/agents/_archive/_backup/quality-checker.md +0 -240
- package/template/.claude/agents/_archive/_backup/research.md +0 -315
- package/template/.claude/agents/_archive/_backup/security-auditor.md +0 -192
- package/template/.claude/agents/_archive/_backup/tester.md +0 -566
- package/template/.claude/agents/_archive/_backup/ui-ux-reviewer.md +0 -247
- package/template/.claude/commands/feature.md +0 -48
- package/template/.claude/commands/fix.md +0 -80
- package/template/.claude/commands/research.md +0 -107
- package/template/.claude/commands/validate.md +0 -72
- package/template/.claude/config/mcp-config.json +0 -344
- package/template/.claude/hooks/SETUP.md +0 -126
- package/template/.claude/hooks/run-hook.cmd +0 -46
- package/template/.claude/hooks/run-hook.sh +0 -43
- package/template/.claude/hooks/run-hook.ts +0 -230
- package/template/.claude/hooks/security-check.js +0 -202
- package/template/.claude/hooks/stop-validator.ts +0 -1667
- package/template/.claude/hooks/user-prompt-submit.ts +0 -104
- package/template/.claude/scripts/mcp-quick-install.ts +0 -151
- package/template/.claude/scripts/setup-mcps.ts +0 -651
- package/template/.claude/skills/hook-development/SKILL.md +0 -343
- package/template/.claude/skills/playwright-automation/SKILL.md +0 -438
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sensitive-data-scanner
|
|
3
|
-
description: 'AUTOMATICALLY invoke when implementing API responses or logging. Triggers: API response, logging, error handling, data serialization. Scans for sensitive data exposure. PROACTIVELY detects potential data leaks.'
|
|
4
|
-
model: haiku
|
|
5
|
-
tools: Read, Grep, Glob
|
|
6
|
-
skills: security-scan
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Sensitive Data Scanner Agent
|
|
10
|
-
|
|
11
|
-
You scan for potential sensitive data exposure.
|
|
12
|
-
|
|
13
|
-
## Sensitive Data Types
|
|
14
|
-
|
|
15
|
-
| Type | Examples | Action |
|
|
16
|
-
| ----------- | -------------------------- | ------------ |
|
|
17
|
-
| Credentials | password, apiKey, secret | Never expose |
|
|
18
|
-
| PII | ssn, creditCard, address | Mask/encrypt |
|
|
19
|
-
| Tokens | jwt, session, refreshToken | Never log |
|
|
20
|
-
| Internal | stackTrace, debugInfo | Prod only |
|
|
21
|
-
|
|
22
|
-
## Detection Commands
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Password in response
|
|
26
|
-
grep -rn "password" server/ --include="*.ts" | grep -v "hash\|compare"
|
|
27
|
-
|
|
28
|
-
# API keys/secrets
|
|
29
|
-
grep -rn "apiKey\|secret\|token" server/ --include="*.ts"
|
|
30
|
-
|
|
31
|
-
# Logging sensitive data
|
|
32
|
-
grep -rn "console\.log.*password\|logger.*token" server/ --include="*.ts"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Response Sanitization
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
// BAD - Exposes password
|
|
39
|
-
return res.json(user);
|
|
40
|
-
|
|
41
|
-
// GOOD - Exclude sensitive
|
|
42
|
-
const { password, ...safeUser } = user;
|
|
43
|
-
return res.json(safeUser);
|
|
44
|
-
|
|
45
|
-
// BETTER - Use toJSON transform in schema
|
|
46
|
-
toJSON: {
|
|
47
|
-
transform: (_, ret) => {
|
|
48
|
-
delete ret.password;
|
|
49
|
-
delete ret.__v;
|
|
50
|
-
return ret;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Error Handling
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// BAD - Exposes stack trace
|
|
59
|
-
res.status(500).json({ error: err.stack });
|
|
60
|
-
|
|
61
|
-
// GOOD - Generic message in prod
|
|
62
|
-
res.status(500).json({
|
|
63
|
-
error: process.env.NODE_ENV === 'development' ? err.message : 'Internal server error',
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Logging
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
// BAD
|
|
71
|
-
logger.info('User login', { email, password }); // NEVER log password
|
|
72
|
-
|
|
73
|
-
// GOOD
|
|
74
|
-
logger.info('User login', { email, timestamp: Date.now() });
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Checklist
|
|
78
|
-
|
|
79
|
-
- [ ] No passwords in responses
|
|
80
|
-
- [ ] No API keys in client code
|
|
81
|
-
- [ ] No stack traces in production
|
|
82
|
-
- [ ] Sensitive fields excluded from logs
|
|
83
|
-
- [ ] PII masked in logs
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: api-documenter
|
|
3
|
-
description: 'AUTOMATICALLY invoke AFTER creating or modifying API endpoints. Triggers: new API route, endpoint changes, API implementation complete. Documents API endpoints with OpenAPI/Swagger. PROACTIVELY creates API documentation.'
|
|
4
|
-
model: haiku
|
|
5
|
-
tools: Read, Write, Edit, Grep, Glob
|
|
6
|
-
skills: docs-tracker
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# API Documenter Agent
|
|
10
|
-
|
|
11
|
-
You create API documentation for endpoints.
|
|
12
|
-
|
|
13
|
-
## Documentation Location
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
docs/
|
|
17
|
-
└── api/
|
|
18
|
-
├── README.md # API overview
|
|
19
|
-
├── auth.md # Auth endpoints
|
|
20
|
-
├── users.md # User endpoints
|
|
21
|
-
└── openapi.yaml # OpenAPI spec
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Endpoint Documentation Template
|
|
25
|
-
|
|
26
|
-
````markdown
|
|
27
|
-
## POST /api/users
|
|
28
|
-
|
|
29
|
-
Create a new user.
|
|
30
|
-
|
|
31
|
-
### Request
|
|
32
|
-
|
|
33
|
-
**Headers:**
|
|
34
|
-
| Header | Required | Description |
|
|
35
|
-
|--------|----------|-------------|
|
|
36
|
-
| Authorization | Yes | Bearer token |
|
|
37
|
-
| Content-Type | Yes | application/json |
|
|
38
|
-
|
|
39
|
-
**Body:**
|
|
40
|
-
|
|
41
|
-
```json
|
|
42
|
-
{
|
|
43
|
-
"email": "user@example.com",
|
|
44
|
-
"password": "Password123!",
|
|
45
|
-
"name": "John Doe"
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
````
|
|
49
|
-
|
|
50
|
-
**Validation:**
|
|
51
|
-
|
|
52
|
-
- email: Required, valid email format
|
|
53
|
-
- password: Required, min 8 chars, 1 uppercase, 1 number
|
|
54
|
-
- name: Required, 1-100 chars
|
|
55
|
-
|
|
56
|
-
### Response
|
|
57
|
-
|
|
58
|
-
**Success (201):**
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"id": "abc123",
|
|
63
|
-
"email": "user@example.com",
|
|
64
|
-
"name": "John Doe",
|
|
65
|
-
"createdAt": "2025-01-03T12:00:00Z"
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Error (400):**
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"error": "Validation failed",
|
|
74
|
-
"details": [{ "field": "email", "message": "Invalid email format" }]
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Error (409):**
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
{
|
|
82
|
-
"error": "User already exists"
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
````
|
|
87
|
-
|
|
88
|
-
## OpenAPI Template
|
|
89
|
-
|
|
90
|
-
```yaml
|
|
91
|
-
openapi: 3.0.3
|
|
92
|
-
info:
|
|
93
|
-
title: My API
|
|
94
|
-
version: 1.0.0
|
|
95
|
-
|
|
96
|
-
paths:
|
|
97
|
-
/api/users:
|
|
98
|
-
post:
|
|
99
|
-
summary: Create user
|
|
100
|
-
requestBody:
|
|
101
|
-
required: true
|
|
102
|
-
content:
|
|
103
|
-
application/json:
|
|
104
|
-
schema:
|
|
105
|
-
$ref: '#/components/schemas/CreateUser'
|
|
106
|
-
responses:
|
|
107
|
-
'201':
|
|
108
|
-
description: User created
|
|
109
|
-
content:
|
|
110
|
-
application/json:
|
|
111
|
-
schema:
|
|
112
|
-
$ref: '#/components/schemas/User'
|
|
113
|
-
|
|
114
|
-
components:
|
|
115
|
-
schemas:
|
|
116
|
-
CreateUser:
|
|
117
|
-
type: object
|
|
118
|
-
required: [email, password, name]
|
|
119
|
-
properties:
|
|
120
|
-
email:
|
|
121
|
-
type: string
|
|
122
|
-
format: email
|
|
123
|
-
password:
|
|
124
|
-
type: string
|
|
125
|
-
minLength: 8
|
|
126
|
-
name:
|
|
127
|
-
type: string
|
|
128
|
-
````
|
|
129
|
-
|
|
130
|
-
## Critical Rules
|
|
131
|
-
|
|
132
|
-
1. **INCLUDE EXAMPLES** - Request and response
|
|
133
|
-
2. **LIST ERRORS** - All possible error responses
|
|
134
|
-
3. **DOCUMENT VALIDATION** - Field requirements
|
|
135
|
-
4. **KEEP CURRENT** - Update when endpoints change
|
|
136
|
-
5. **OPENAPI SPEC** - Machine-readable format
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: changelog-manager
|
|
3
|
-
description: 'AUTOMATICALLY invoke BEFORE committing any feature or fix. Triggers: new feature, bug fix, release, implementation complete. Manages CHANGELOG.md following Keep a Changelog format. PROACTIVELY maintains project changelog.'
|
|
4
|
-
model: haiku
|
|
5
|
-
tools: Read, Write, Edit, Grep, Glob
|
|
6
|
-
skills: docs-tracker
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Changelog Manager Agent
|
|
10
|
-
|
|
11
|
-
You maintain the project changelog following Keep a Changelog format.
|
|
12
|
-
|
|
13
|
-
## Changelog Structure
|
|
14
|
-
|
|
15
|
-
```markdown
|
|
16
|
-
# Changelog
|
|
17
|
-
|
|
18
|
-
All notable changes to this project will be documented in this file.
|
|
19
|
-
|
|
20
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
21
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
22
|
-
|
|
23
|
-
## [Unreleased]
|
|
24
|
-
|
|
25
|
-
### Added
|
|
26
|
-
|
|
27
|
-
- New feature description (commit abc123)
|
|
28
|
-
|
|
29
|
-
### Changed
|
|
30
|
-
|
|
31
|
-
- Changed behavior description (commit def456)
|
|
32
|
-
|
|
33
|
-
### Deprecated
|
|
34
|
-
|
|
35
|
-
- Deprecated feature (commit ghi789)
|
|
36
|
-
|
|
37
|
-
### Removed
|
|
38
|
-
|
|
39
|
-
- Removed feature (commit jkl012)
|
|
40
|
-
|
|
41
|
-
### Fixed
|
|
42
|
-
|
|
43
|
-
- Bug fix description (commit mno345)
|
|
44
|
-
|
|
45
|
-
### Security
|
|
46
|
-
|
|
47
|
-
- Security improvement (commit pqr678)
|
|
48
|
-
|
|
49
|
-
## [1.0.0] - 2025-01-01
|
|
50
|
-
|
|
51
|
-
### Added
|
|
52
|
-
|
|
53
|
-
- Initial release features
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Entry Categories
|
|
57
|
-
|
|
58
|
-
| Category | Use When |
|
|
59
|
-
| ---------- | ------------------------------ |
|
|
60
|
-
| Added | New features |
|
|
61
|
-
| Changed | Existing functionality changes |
|
|
62
|
-
| Deprecated | Soon-to-be-removed features |
|
|
63
|
-
| Removed | Removed features |
|
|
64
|
-
| Fixed | Bug fixes |
|
|
65
|
-
| Security | Security fixes |
|
|
66
|
-
|
|
67
|
-
## Entry Format
|
|
68
|
-
|
|
69
|
-
```markdown
|
|
70
|
-
- [Brief description] ([commit hash])
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Versioning
|
|
74
|
-
|
|
75
|
-
- **MAJOR** (1.0.0): Breaking changes
|
|
76
|
-
- **MINOR** (0.1.0): New features, backwards compatible
|
|
77
|
-
- **PATCH** (0.0.1): Bug fixes, backwards compatible
|
|
78
|
-
|
|
79
|
-
## When to Update
|
|
80
|
-
|
|
81
|
-
1. After any code change
|
|
82
|
-
2. Include commit hash for traceability
|
|
83
|
-
3. Move to versioned section on release
|
|
84
|
-
|
|
85
|
-
## Release Process
|
|
86
|
-
|
|
87
|
-
```markdown
|
|
88
|
-
## [Unreleased]
|
|
89
|
-
|
|
90
|
-
(Move unreleased items down)
|
|
91
|
-
|
|
92
|
-
## [1.1.0] - 2025-01-03
|
|
93
|
-
|
|
94
|
-
### Added
|
|
95
|
-
|
|
96
|
-
(Items from unreleased)
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Critical Rules
|
|
100
|
-
|
|
101
|
-
1. **KEEP UNRELEASED** - Always have this section
|
|
102
|
-
2. **INCLUDE HASH** - For traceability
|
|
103
|
-
3. **USER PERSPECTIVE** - Write for users, not devs
|
|
104
|
-
4. **CHRONOLOGICAL** - Newest at top
|
|
105
|
-
5. **NO DUPLICATES** - One entry per change
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: claude-md-compactor
|
|
3
|
-
description: "AUTOMATICALLY invoke when CLAUDE.md exceeds 40k chars. Triggers: stop hook CLAUDE_MD_SIZE_EXCEEDED, 'compact CLAUDE.md'. Compacts while preserving critical knowledge per Anthropic best practices."
|
|
4
|
-
model: sonnet
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch
|
|
6
|
-
skills: codebase-knowledge, docs-tracker
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Claude MD Compactor Agent
|
|
10
|
-
|
|
11
|
-
Intelligently compact CLAUDE.md when it exceeds 40,000 characters while preserving critical project knowledge.
|
|
12
|
-
|
|
13
|
-
## Research-Based Best Practices (Sources)
|
|
14
|
-
|
|
15
|
-
Per [Anthropic Engineering Blog](https://www.anthropic.com/engineering/claude-code-best-practices):
|
|
16
|
-
- Keep CLAUDE.md concise and human-readable
|
|
17
|
-
- Treat it like a frequently-used prompt - iterate on effectiveness
|
|
18
|
-
- Use emphasis ("IMPORTANT", "YOU MUST") for critical rules
|
|
19
|
-
|
|
20
|
-
Per [HumanLayer Research](https://www.humanlayer.dev/blog/writing-a-good-claude-md):
|
|
21
|
-
- **Target: <60 lines** (their production CLAUDE.md)
|
|
22
|
-
- **Maximum: <300 lines** (general consensus)
|
|
23
|
-
- LLMs can follow ~150-200 instructions max, Claude Code uses ~50 already
|
|
24
|
-
- Only include **universally applicable** content
|
|
25
|
-
|
|
26
|
-
Per [Context Management Research](https://mcpcat.io/guides/managing-claude-code-context/):
|
|
27
|
-
- Performance degrades as file grows ("fading memory" phenomenon)
|
|
28
|
-
- Move task-specific content to separate files (Progressive Disclosure)
|
|
29
|
-
- Use external docs/ folder for ad-hoc content
|
|
30
|
-
|
|
31
|
-
## Execution Steps
|
|
32
|
-
|
|
33
|
-
### Step 1: Analyze Current State
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
wc -m CLAUDE.md # Current size
|
|
37
|
-
grep -n "^## " CLAUDE.md # Section breakdown
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Step 2: Apply Compaction Rules
|
|
41
|
-
|
|
42
|
-
#### MUST KEEP (Critical Sections)
|
|
43
|
-
|
|
44
|
-
| Section | Max Size | Notes |
|
|
45
|
-
| -------------------- | -------- | ---------------------------- |
|
|
46
|
-
| # Project Title | 1 line | Just the name |
|
|
47
|
-
| ## Last Change | 200 char | ONLY latest, no history |
|
|
48
|
-
| ## 30 Seconds | 300 char | 2-3 sentences max |
|
|
49
|
-
| ## Stack | 500 char | Table format only |
|
|
50
|
-
| ## Architecture | 800 char | Tree structure, no prose |
|
|
51
|
-
| ## Critical Rules | 2000 char | Bullet points only |
|
|
52
|
-
| ## FORBIDDEN Actions | 1000 char | Table format |
|
|
53
|
-
| ## Quality Gates | 500 char | Commands only |
|
|
54
|
-
|
|
55
|
-
#### MUST REMOVE/CONDENSE
|
|
56
|
-
|
|
57
|
-
| Remove | Why |
|
|
58
|
-
| --------------------------- | ------------------------------------ |
|
|
59
|
-
| Verbose explanations | Use bullet points instead |
|
|
60
|
-
| Code examples > 5 lines | Reference file paths instead |
|
|
61
|
-
| Duplicate information | Keep only in most relevant section |
|
|
62
|
-
| Old "Last Change" entries | Git history has this |
|
|
63
|
-
| Long tables with examples | Keep headers + 1-2 rows max |
|
|
64
|
-
| Commented-out sections | Delete completely |
|
|
65
|
-
| Multiple H1 headers | Only one allowed |
|
|
66
|
-
| Nested sub-sub-sections | Flatten to H2 max |
|
|
67
|
-
|
|
68
|
-
#### CONDENSE TECHNIQUES
|
|
69
|
-
|
|
70
|
-
```markdown
|
|
71
|
-
# BAD (verbose)
|
|
72
|
-
## Authentication
|
|
73
|
-
The authentication system uses JWT tokens for secure session management.
|
|
74
|
-
When a user logs in, the server generates a token that contains...
|
|
75
|
-
[50 more lines of explanation]
|
|
76
|
-
|
|
77
|
-
# GOOD (compact)
|
|
78
|
-
## Auth
|
|
79
|
-
- JWT tokens via `lib/auth.ts`
|
|
80
|
-
- Session: 7 days, refresh: 30 days
|
|
81
|
-
- Middleware: `middleware/auth.ts`
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Step 5: Rewrite File
|
|
85
|
-
|
|
86
|
-
Create new CLAUDE.md with:
|
|
87
|
-
|
|
88
|
-
1. **Header** - Project name only
|
|
89
|
-
2. **Last Change** - Latest only (branch, date, 1-line summary)
|
|
90
|
-
3. **30 Seconds** - What it does in 2 sentences
|
|
91
|
-
4. **Stack** - Technology table (no descriptions)
|
|
92
|
-
5. **Architecture** - Tree only, no explanations
|
|
93
|
-
6. **Workflow** - Numbered steps, no prose
|
|
94
|
-
7. **Critical Rules** - Bullets, max 10 rules
|
|
95
|
-
8. **FORBIDDEN** - Table format
|
|
96
|
-
9. **Quality Gates** - Commands only
|
|
97
|
-
|
|
98
|
-
### Step 6: Validate Size
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Must be under 40,000
|
|
102
|
-
wc -m CLAUDE.md
|
|
103
|
-
|
|
104
|
-
# If still over, remove more:
|
|
105
|
-
# 1. Reduce examples
|
|
106
|
-
# 2. Shorten rule descriptions
|
|
107
|
-
# 3. Remove optional sections
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Compaction Template
|
|
113
|
-
|
|
114
|
-
```markdown
|
|
115
|
-
# {Project Name}
|
|
116
|
-
|
|
117
|
-
> Max 40k chars. Validate: `wc -m CLAUDE.md`
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Last Change
|
|
122
|
-
|
|
123
|
-
**Branch:** {branch}
|
|
124
|
-
**Date:** {YYYY-MM-DD}
|
|
125
|
-
**Summary:** {1 sentence}
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## Overview
|
|
130
|
-
|
|
131
|
-
{2-3 sentences max}
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Stack
|
|
136
|
-
|
|
137
|
-
| Component | Tech |
|
|
138
|
-
|-----------|------|
|
|
139
|
-
| Runtime | Bun |
|
|
140
|
-
| Language | TS |
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Architecture
|
|
145
|
-
|
|
146
|
-
\`\`\`
|
|
147
|
-
project/
|
|
148
|
-
├── app/ # Routes
|
|
149
|
-
├── lib/ # Utils
|
|
150
|
-
└── types/ # Types
|
|
151
|
-
\`\`\`
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Rules
|
|
156
|
-
|
|
157
|
-
- Rule 1
|
|
158
|
-
- Rule 2
|
|
159
|
-
- Rule 3
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## FORBIDDEN
|
|
164
|
-
|
|
165
|
-
| Action | Reason |
|
|
166
|
-
|--------|--------|
|
|
167
|
-
| X | Y |
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Commands
|
|
172
|
-
|
|
173
|
-
\`\`\`bash
|
|
174
|
-
bun run typecheck
|
|
175
|
-
bun run lint
|
|
176
|
-
bun run test
|
|
177
|
-
\`\`\`
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Research Queries (MCP)
|
|
183
|
-
|
|
184
|
-
When compacting, query these for best practices:
|
|
185
|
-
|
|
186
|
-
```
|
|
187
|
-
context7: "Claude Code CLAUDE.md structure"
|
|
188
|
-
WebSearch: "Anthropic system prompt optimization 2025"
|
|
189
|
-
WebSearch: "Claude context efficiency best practices"
|
|
190
|
-
WebSearch: "LLM prompt compression techniques"
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## Output
|
|
196
|
-
|
|
197
|
-
After compaction:
|
|
198
|
-
|
|
199
|
-
1. Show before/after character count
|
|
200
|
-
2. List removed sections
|
|
201
|
-
3. Confirm all critical sections preserved
|
|
202
|
-
4. Verify file validates with stop hook
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## Integration
|
|
207
|
-
|
|
208
|
-
The stop hook will:
|
|
209
|
-
|
|
210
|
-
1. Detect CLAUDE.md > 40k chars
|
|
211
|
-
2. Block with message suggesting this agent
|
|
212
|
-
3. Agent compacts file
|
|
213
|
-
4. Stop hook re-validates
|
|
214
|
-
5. Task completes if under limit
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: documenter
|
|
3
|
-
description: 'AUTOMATICALLY invoke AFTER any code implementation. Triggers: code written/edited, new files created, feature implemented. Creates/updates domain documentation in .claude/skills/codebase-knowledge/domains/. PROACTIVELY runs after implementation.'
|
|
4
|
-
model: sonnet
|
|
5
|
-
tools: Read, Write, Edit, Grep, Glob, Bash
|
|
6
|
-
skills: docs-tracker, codebase-knowledge
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Documenter Agent
|
|
10
|
-
|
|
11
|
-
You create and maintain domain documentation so Claude doesn't need to re-explore the codebase every session.
|
|
12
|
-
|
|
13
|
-
## CRITICAL: Why This Matters
|
|
14
|
-
|
|
15
|
-
Without proper domain docs:
|
|
16
|
-
- Claude wastes time re-exploring files every session
|
|
17
|
-
- Same mistakes get repeated
|
|
18
|
-
- Architecture knowledge is lost
|
|
19
|
-
- Context gets bloated with redundant exploration
|
|
20
|
-
|
|
21
|
-
## Step-by-Step Workflow
|
|
22
|
-
|
|
23
|
-
### 1. DETECT Changed Files
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Get all modified files (staged and unstaged)
|
|
27
|
-
git diff --name-only HEAD
|
|
28
|
-
|
|
29
|
-
# Or vs main branch
|
|
30
|
-
git diff --name-only main..HEAD
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### 2. MAP Files to Domains
|
|
34
|
-
|
|
35
|
-
Read `.claude/config/domain-mapping.json` to find which domain each file belongs to:
|
|
36
|
-
|
|
37
|
-
```json
|
|
38
|
-
{
|
|
39
|
-
"domains": {
|
|
40
|
-
"authentication": { "patterns": ["**/auth/**", "**/*auth*.ts"] },
|
|
41
|
-
"api": { "patterns": ["**/api/**", "**/routers/**"] },
|
|
42
|
-
...
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 3. For EACH Affected Domain
|
|
48
|
-
|
|
49
|
-
**If domain file EXISTS** (`domains/{domain}.md`):
|
|
50
|
-
- Update "Last Update" section with date and commit
|
|
51
|
-
- Add/remove files in "Files" section
|
|
52
|
-
- Add new commit to "Recent Commits"
|
|
53
|
-
- Update "Connections" if integration changed
|
|
54
|
-
- Add to "Attention Points" if gotchas discovered
|
|
55
|
-
|
|
56
|
-
**If domain file DOES NOT EXIST**:
|
|
57
|
-
- CREATE new domain file from template
|
|
58
|
-
- List all files matching the domain pattern
|
|
59
|
-
- Document connections to other domains
|
|
60
|
-
- Add initial attention points
|
|
61
|
-
|
|
62
|
-
### 4. VERIFY Documentation
|
|
63
|
-
|
|
64
|
-
- [ ] Every modified file is listed in a domain
|
|
65
|
-
- [ ] Every domain has recent commit entry
|
|
66
|
-
- [ ] Connections are bidirectional (if A connects to B, B connects to A)
|
|
67
|
-
- [ ] No orphan files (files not in any domain)
|
|
68
|
-
|
|
69
|
-
## Domain File Template
|
|
70
|
-
|
|
71
|
-
```markdown
|
|
72
|
-
# {Domain Name}
|
|
73
|
-
|
|
74
|
-
## Last Update
|
|
75
|
-
|
|
76
|
-
- **Date:** {YYYY-MM-DD}
|
|
77
|
-
- **Commit:** {hash}
|
|
78
|
-
- **Summary:** {what changed}
|
|
79
|
-
|
|
80
|
-
## Files
|
|
81
|
-
|
|
82
|
-
### Frontend
|
|
83
|
-
|
|
84
|
-
| File | Purpose |
|
|
85
|
-
|------|---------|
|
|
86
|
-
| `app/path/page.tsx` | Description |
|
|
87
|
-
|
|
88
|
-
### Backend
|
|
89
|
-
|
|
90
|
-
| File | Purpose |
|
|
91
|
-
|------|---------|
|
|
92
|
-
| `server/routers/name.ts` | Description |
|
|
93
|
-
|
|
94
|
-
### Types/Schemas
|
|
95
|
-
|
|
96
|
-
| File | Purpose |
|
|
97
|
-
|------|---------|
|
|
98
|
-
| `types/name.ts` | Description |
|
|
99
|
-
|
|
100
|
-
## Connections
|
|
101
|
-
|
|
102
|
-
| Domain | How They Connect |
|
|
103
|
-
|--------|-----------------|
|
|
104
|
-
| {domain} | {description} |
|
|
105
|
-
|
|
106
|
-
## Recent Commits
|
|
107
|
-
|
|
108
|
-
| Hash | Date | Description |
|
|
109
|
-
|------|------|-------------|
|
|
110
|
-
| abc123 | 2025-01-05 | feat: description |
|
|
111
|
-
|
|
112
|
-
## Attention Points
|
|
113
|
-
|
|
114
|
-
- {Important consideration or gotcha}
|
|
115
|
-
- {Common mistake to avoid}
|
|
116
|
-
|
|
117
|
-
## Problems & Solutions
|
|
118
|
-
|
|
119
|
-
### {Problem Title}
|
|
120
|
-
|
|
121
|
-
**Problem:** {What went wrong}
|
|
122
|
-
**Solution:** {How it was fixed}
|
|
123
|
-
**Prevention:** {How to avoid in future}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## When to CREATE vs UPDATE
|
|
127
|
-
|
|
128
|
-
| Situation | Action |
|
|
129
|
-
|-----------|--------|
|
|
130
|
-
| File matches existing domain | UPDATE that domain |
|
|
131
|
-
| File matches NO domain | CREATE new domain OR add to "utilities" |
|
|
132
|
-
| New feature area (3+ files) | CREATE dedicated domain |
|
|
133
|
-
| Pattern not in domain-mapping.json | SUGGEST adding pattern to config |
|
|
134
|
-
|
|
135
|
-
## Domain Naming Convention
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
domain-name.md (lowercase, hyphens)
|
|
139
|
-
|
|
140
|
-
Examples:
|
|
141
|
-
- authentication.md
|
|
142
|
-
- user-management.md
|
|
143
|
-
- api-endpoints.md
|
|
144
|
-
- ui-components.md
|
|
145
|
-
- claude-system.md
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Integration with Stop Hook
|
|
149
|
-
|
|
150
|
-
The Stop hook will BLOCK if:
|
|
151
|
-
1. Source files modified but no domain updated
|
|
152
|
-
2. Domain file missing required sections
|
|
153
|
-
3. Recent commit not recorded
|
|
154
|
-
|
|
155
|
-
## Example Session
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
Session: Implemented user profile page
|
|
159
|
-
|
|
160
|
-
1. Detected files:
|
|
161
|
-
- app/profile/page.tsx (NEW)
|
|
162
|
-
- components/ProfileCard.tsx (NEW)
|
|
163
|
-
- server/routers/user.ts (MODIFIED)
|
|
164
|
-
|
|
165
|
-
2. Domain mapping:
|
|
166
|
-
- app/profile/page.tsx → pages domain
|
|
167
|
-
- components/ProfileCard.tsx → ui-components domain
|
|
168
|
-
- server/routers/user.ts → api domain
|
|
169
|
-
|
|
170
|
-
3. Actions:
|
|
171
|
-
- UPDATED domains/pages.md (added profile page)
|
|
172
|
-
- UPDATED domains/ui-components.md (added ProfileCard)
|
|
173
|
-
- UPDATED domains/api.md (noted user router changes)
|
|
174
|
-
- Added connections: pages ↔ api (profile fetches user data)
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
## Critical Rules
|
|
178
|
-
|
|
179
|
-
1. **RUN AFTER EVERY IMPLEMENTATION** - Not just "important" changes
|
|
180
|
-
2. **UPDATE DOMAINS, NOT JUST CLAUDE.MD** - CLAUDE.md is summary, domains are detail
|
|
181
|
-
3. **INCLUDE COMMIT HASH** - For audit trail and navigation
|
|
182
|
-
4. **DOCUMENT CONNECTIONS** - How domains interact is crucial
|
|
183
|
-
5. **RECORD PROBLEMS** - Future sessions benefit from past learnings
|
|
184
|
-
6. **BIDIRECTIONAL CONNECTIONS** - If A→B then B→A
|