- Scan directory structure for project type identification
- Detect language, framework, package manager
- Identify build tools, CI/CD config, test framework
- Map high-level architecture (monorepo, microservices, etc.)
2. Semantic Index Building
Four parallel index domains:
- Code Index: Source files with exports, purposes, dependencies
- Test Index: Test files with cases, fixtures, patterns
- Config Index: Configuration files with parsed rules
- API Index: Public interfaces, types, data models
3. Convention Discovery
- Code style patterns (naming, structure, organization)
- Error handling conventions
- Testing conventions (naming, structure, assertions)
- Git commit message conventions
- Documentation standards
- Language-conditional standards
4. Rule Generation
Convert conventions into enforceable rules:
{
"id": "ts-no-any",
"category": "coding-standards",
"description": "Avoid 'any' type; use 'unknown' and narrow",
"severity": "error",
"autoFixable": false,
"language": "typescript"
}
Rule Categories
| Category |
Examples |
| core |
task-and-workflow, testing, verification |
| dev-practices |
development-practices, context-management |
| tools |
research-tools, cli-tools |
| coding-standards |
Language-specific rules (conditional) |
Output Artifacts
artifacts/CONVENTIONS.md -- Discovered conventions
artifacts/SEARCH-INDEX.json -- Semantic search index
artifacts/RULES.md -- Generated project rules
1---2name: codebase-sync3description: Convention discovery and rule generation from codebase analysis. Scans project structure, builds search indexes, identifies patterns, and generates enforceable rules.4---5
6- Scan directory structure for project type identification
7- Detect language, framework, package manager
8- Identify build tools, CI/CD config, test framework
9- Map high-level architecture (monorepo, microservices, etc.)
10
11### 2. Semantic Index Building
12Four parallel index domains:
13- **Code Index**: Source files with exports, purposes, dependencies
14- **Test Index**: Test files with cases, fixtures, patterns
15- **Config Index**: Configuration files with parsed rules
16- **API Index**: Public interfaces, types, data models
17
18### 3. Convention Discovery
19- Code style patterns (naming, structure, organization)
20- Error handling conventions
21- Testing conventions (naming, structure, assertions)
22- Git commit message conventions
23- Documentation standards
24- Language-conditional standards
25
26### 4. Rule Generation
27Convert conventions into enforceable rules:
28```json
29{
30 "id": "ts-no-any",
31 "category": "coding-standards",
32 "description": "Avoid 'any' type; use 'unknown' and narrow",
33 "severity": "error",
34 "autoFixable": false,
35 "language": "typescript"
36}
37```
38
39## Rule Categories
40
41| Category | Examples |
42|----------|---------|
43| **core** | task-and-workflow, testing, verification |
44| **dev-practices** | development-practices, context-management |
45| **tools** | research-tools, cli-tools |
46| **coding-standards** | Language-specific rules (conditional) |
47
48## Output Artifacts
49
50- `artifacts/CONVENTIONS.md` -- Discovered conventions
51- `artifacts/SEARCH-INDEX.json` -- Semantic search index
52- `artifacts/RULES.md` -- Generated project rules