claude-dev-kit 2.1.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.
Files changed (89) hide show
  1. package/.claude/agents/angelic-workshop-energy-clearing.md +113 -0
  2. package/.claude/agents/angelic-workshop-intake.md +84 -0
  3. package/.claude/agents/angelic-workshop-integration.md +140 -0
  4. package/.claude/agents/angelic-workshop-invocation.md +92 -0
  5. package/.claude/agents/angelic-workshop-lead.md +225 -0
  6. package/.claude/agents/angelic-workshop-transmission.md +108 -0
  7. package/.claude/agents/deep-think-partner.md +41 -0
  8. package/.claude/agents/dev-backend.md +74 -0
  9. package/.claude/agents/dev-e2e.md +101 -0
  10. package/.claude/agents/dev-frontend.md +82 -0
  11. package/.claude/agents/dev-lead.md +144 -0
  12. package/.claude/agents/dev-reviewer.md +122 -0
  13. package/.claude/agents/dev-test.md +88 -0
  14. package/.claude/agents/documentation-manager.md +73 -0
  15. package/.claude/agents/haiku-executor.md +8 -0
  16. package/.claude/agents/pm-groomer.md +98 -0
  17. package/.claude/agents/pm-prp-writer.md +144 -0
  18. package/.claude/agents/pm-sizer.md +84 -0
  19. package/.claude/agents/project-manager.md +91 -0
  20. package/.claude/agents/system-architect.md +98 -0
  21. package/.claude/agents/validation-gates.md +121 -0
  22. package/.claude/agents/workflow-builder.md +416 -0
  23. package/.claude/commands/ai/detect.md +117 -0
  24. package/.claude/commands/ai/route.md +128 -0
  25. package/.claude/commands/ai/switch.md +121 -0
  26. package/.claude/commands/bs/brainstorm_full.md +149 -0
  27. package/.claude/commands/bs/claude.md +37 -0
  28. package/.claude/commands/bs/codex.md +37 -0
  29. package/.claude/commands/bs/gemini.md +37 -0
  30. package/.claude/commands/bs/glm.md +37 -0
  31. package/.claude/commands/bs/grok.md +37 -0
  32. package/.claude/commands/bs/kimi.md +37 -0
  33. package/.claude/commands/bs/minimax.md +37 -0
  34. package/.claude/commands/bs/ollama.md +71 -0
  35. package/.claude/commands/code/build-and-fix.md +80 -0
  36. package/.claude/commands/code/simplify.md +77 -0
  37. package/.claude/commands/dev/backend.md +47 -0
  38. package/.claude/commands/dev/e2e.md +49 -0
  39. package/.claude/commands/dev/frontend.md +45 -0
  40. package/.claude/commands/dev/review.md +48 -0
  41. package/.claude/commands/dev/test.md +54 -0
  42. package/.claude/commands/dev-epic.md +121 -0
  43. package/.claude/commands/dev-issue.md +79 -0
  44. package/.claude/commands/dev.md +134 -0
  45. package/.claude/commands/execute-prp.md +113 -0
  46. package/.claude/commands/fix-github-issue.md +14 -0
  47. package/.claude/commands/generate-prp.md +73 -0
  48. package/.claude/commands/git/status.md +14 -0
  49. package/.claude/commands/haiku.md +13 -0
  50. package/.claude/commands/improve.md +178 -0
  51. package/.claude/commands/init.md +311 -0
  52. package/.claude/commands/pm/groom.md +58 -0
  53. package/.claude/commands/pm/plan-epic.md +74 -0
  54. package/.claude/commands/pm/size.md +46 -0
  55. package/.claude/commands/pm.md +47 -0
  56. package/.claude/commands/primer.md +16 -0
  57. package/.claude/commands/self-improve.md +243 -0
  58. package/.claude/commands/think.md +68 -0
  59. package/.claude/commands/workflow/angelic-workshop.md +89 -0
  60. package/.claude/commands/workflow/build.md +91 -0
  61. package/.claude/hooks/pre-tool-use/block-dangerous-commands.js +196 -0
  62. package/.claude/hooks/skill-activation-prompt/package-lock.json +560 -0
  63. package/.claude/hooks/skill-activation-prompt/package.json +16 -0
  64. package/.claude/hooks/skill-activation-prompt/skill-activation-prompt.ts +135 -0
  65. package/.claude/hooks/skill-activation-prompt/skill-rules.json +50 -0
  66. package/.claude/hooks/stop/context_monitor.py +155 -0
  67. package/.claude/hooks/stop/learning_logger.py +218 -0
  68. package/.claude/skills/ai-router/SKILL.md +119 -0
  69. package/.claude/skills/build-and-fix/SKILL.md +271 -0
  70. package/.claude/skills/build-and-fix/examples/javascript-lint-fix.md +37 -0
  71. package/.claude/skills/build-and-fix/language-configs/javascript.yaml +139 -0
  72. package/.claude/skills/build-and-fix/references/config-schema.md +120 -0
  73. package/.claude/skills/build-and-fix/references/error-patterns.md +273 -0
  74. package/.claude/skills/code-investigator/SKILL.md +299 -0
  75. package/.claude/skills/code-investigator/references/investigation-workflows.md +542 -0
  76. package/.claude/skills/code-investigator/references/language-specific.md +761 -0
  77. package/.claude/skills/code-investigator/references/search-patterns.md +258 -0
  78. package/.claude/skills/code-investigator/references/serena-patterns.md +328 -0
  79. package/.claude/skills/stack-detector/SKILL.md +153 -0
  80. package/.claude/skills/verification-before-completion/SKILL.md +143 -0
  81. package/.claude/templates/claude-md-template.md +56 -0
  82. package/.claude/templates/stacks/express-node.md +134 -0
  83. package/.claude/templates/stacks/fastapi.md +152 -0
  84. package/.claude/templates/stacks/generic.md +101 -0
  85. package/.claude/templates/stacks/nextjs-prisma.md +235 -0
  86. package/README.md +499 -0
  87. package/bin/claude-dev-kit.js +11 -0
  88. package/package.json +31 -0
  89. package/scripts/install.sh +448 -0
@@ -0,0 +1,271 @@
1
+ ---
2
+ version: 1.1.0
3
+ name: build-and-fix
4
+ description: This skill should be used when the user asks to "build the project", "run build", "build and fix errors", "fix lint errors", "fix formatting", "run cargo build", "npm run build", "pnpm build", "yarn build", "poetry build", "cmake build", "make it compile", "check if code compiles", "verify build", "fix build failures", "validate before commit", "pre-commit validation", or "check compilation". Auto-detects project type (Rust/JS/TS/Python/C++), runs build, and automatically fixes simple errors like formatting and linting. Does NOT fix type errors, logic bugs, or missing dependencies - bails to user for complex issues.
5
+ ---
6
+
7
+ # Build & Fix
8
+
9
+ **Notification:** At skill start, output: "Using build-and-fix to detect and build project..."
10
+
11
+ ## When to Use
12
+
13
+ - Build a project and ensure it compiles successfully
14
+ - Fix simple build errors automatically (formatting, linting)
15
+ - Validate changes before committing
16
+ - Debug build failures efficiently
17
+
18
+ ## When NOT to Use
19
+
20
+ - Complex refactoring requiring semantic understanding
21
+ - Fixing type errors, logic bugs, or missing imports
22
+ - Projects requiring manual build configuration
23
+ - When user needs to understand the error (don't hide it)
24
+
25
+ ## Supported Languages
26
+
27
+ | Language | Build Systems | Priority |
28
+ |----------|--------------|----------|
29
+ | **Rust** | cargo | 1 (highest) |
30
+ | **JavaScript/TypeScript** | npm/yarn/pnpm | 2 |
31
+ | **Python** | pip/poetry/pipenv | 3 |
32
+ | **C++** | cmake only | 4 (lowest) |
33
+
34
+ ## Workflow
35
+
36
+ ### 1. Pre-flight Checks
37
+
38
+ Before building, verify environment is ready:
39
+
40
+ ```
41
+ [PREFLIGHT] Checking build environment...
42
+ ```
43
+
44
+ - **Verify build tool exists**: Run the `preflight` command from config (e.g., `cargo --version`)
45
+ - **Check dependencies**: Verify lockfile/node_modules/target directory exists
46
+ - **If tool missing (exit 127)**: Bail immediately with installation instructions
47
+ - **If deps missing**: Suggest running install command (don't auto-install without permission)
48
+
49
+ ### 2. Detect Project Type
50
+
51
+ ```
52
+ [DETECT] Scanning for project manifests...
53
+ ```
54
+
55
+ - Search current working directory for manifest files using Glob
56
+ - Match against `detection.required_files` in each language config
57
+ - If multiple languages detected, use `priority` field (lower = higher priority)
58
+ - For monorepos: Check for workspace configs (see Workspace Detection below)
59
+
60
+ ### 3. Load Language Config
61
+
62
+ - Read `language-configs/{language}.yaml` using Read tool
63
+ - Extract commands, fix patterns, bail patterns, and limits
64
+ - Determine package manager if applicable (from lockfiles)
65
+
66
+ ### 4. Configure Build (C++ only)
67
+
68
+ ```
69
+ [CONFIGURE] Configuring build system...
70
+ ```
71
+
72
+ - Run `cmake -S . -B build` before building
73
+ - Exit codes: 0 = success, 127 = cmake not found (bail), other = config error (bail)
74
+
75
+ ### 5. Build Project
76
+
77
+ ```
78
+ [BUILD] Building project...
79
+ ```
80
+
81
+ - Run build command from config via Bash
82
+ - Apply timeout from config (default: 300s for C++, 120s for others)
83
+ - Capture stdout + stderr for error parsing
84
+ - Check exit code:
85
+ - 0 = success
86
+ - 127 = tool not found (bail with install instructions)
87
+ - 130 = user interrupted (stop gracefully)
88
+ - Other = build failure (proceed to error parsing)
89
+
90
+ ### 6. Parse Errors (if build failed)
91
+
92
+ ```
93
+ [ANALYZE] Parsing build output...
94
+ ```
95
+
96
+ **Error Extraction Process:**
97
+
98
+ 1. **Check bail patterns FIRST** - If any `bail_on` regex matches, stop immediately
99
+ 2. **Extract error locations** using `error_parsing` patterns from config:
100
+ - Pattern groups: `{file}`, `{line}`, `{column}`, `{message}`
101
+ 3. **Match fix patterns** - Compare errors against `fixes[]` list
102
+ 4. **Classify errors**:
103
+ - Auto-fixable: formatting, linting, whitespace
104
+ - Bail immediately: type errors, syntax errors, missing deps
105
+
106
+ ### 7. Apply Fixes
107
+
108
+ ```
109
+ [FIX] Applying {count} fixes...
110
+ ```
111
+
112
+ - Look up `action` in commands (e.g., 'format' → 'cargo fmt')
113
+ - Substitute captured values: `{1}` = first capture group, `{file}` = matched file
114
+ - Execute fix via Bash
115
+ - Track which fixes were applied
116
+
117
+ ### 8. Retry Build
118
+
119
+ ```
120
+ [RETRY] Retrying build (attempt {n}/{max})...
121
+ ```
122
+
123
+ - Maximum 2 retry cycles
124
+ - **Stop immediately if:**
125
+ - Same errors recur (compare error text, ignore line numbers)
126
+ - Total errors exceed `max_errors` from config
127
+ - Any `bail_on` pattern matches
128
+
129
+ ### 9. Report Results
130
+
131
+ **Success:**
132
+ ```
133
+ [SUCCESS] Build passed!
134
+ - Fixes applied: {list}
135
+ - Build time: {duration}
136
+ - Retry cycles: {count}
137
+ ```
138
+
139
+ **Failure:**
140
+ ```
141
+ [BAIL] Build failed - manual intervention required
142
+ - Error: {summary}
143
+ - Location: {file}:{line}
144
+ - Reason: {why auto-fix stopped}
145
+ - Suggestion: {next steps}
146
+ ```
147
+
148
+ ## Config Schema
149
+
150
+ See `references/config-schema.md` for the complete schema reference.
151
+
152
+ **Quick summary:** Each `language-configs/{language}.yaml` contains:
153
+ - `detection` - Files that identify the project type
154
+ - `preflight` - Pre-build verification commands
155
+ - `commands` - Build, format, lint commands
156
+ - `fixes` - Auto-fixable error patterns
157
+ - `bail_on` - Errors requiring manual intervention
158
+ - `max_errors`, `max_retries` - Safety limits
159
+
160
+ ## Workspace Detection
161
+
162
+ For monorepos with multiple projects:
163
+
164
+ | Language | Workspace Indicator | Behavior |
165
+ |----------|-------------------|----------|
166
+ | Rust | `[workspace]` in Cargo.toml | Build from workspace root |
167
+ | JavaScript | `workspaces` in package.json | Detect package manager workspace commands |
168
+ | Python | `tool.poetry.packages` in pyproject.toml | Build from monorepo root |
169
+
170
+ If workspace detected:
171
+ 1. Note it in output: `[DETECT] Rust workspace (3 members)`
172
+ 2. Build from workspace root, not individual package
173
+ 3. Errors may reference multiple packages
174
+
175
+ ## Safety Guidelines
176
+
177
+ **DO auto-fix:**
178
+ - Formatting issues (rustfmt, black, prettier)
179
+ - Simple linting errors with `--fix` flag
180
+ - Trailing whitespace
181
+
182
+ **DO NOT auto-fix:**
183
+ - Dependency changes (npm audit fix, cargo update)
184
+ - Auto-upgrades of any kind
185
+ - Destructive file operations
186
+ - Anything requiring user confirmation
187
+
188
+ **Always bail on:**
189
+ - Type errors
190
+ - Syntax errors
191
+ - Missing imports/modules
192
+ - Linker errors
193
+ - Permission errors
194
+
195
+ ## Tool Usage
196
+
197
+ | Tool | Use For | Never Use For |
198
+ |------|---------|---------------|
199
+ | **Glob** | Find manifest files | - |
200
+ | **Read** | Load configs, examine source | - |
201
+ | **Edit** | Apply code fixes | - |
202
+ | **Bash** | Run build/fix commands | File operations, sed, awk |
203
+ | **Grep** | Parse build output | - |
204
+
205
+ ## Progress Markers
206
+
207
+ Output these markers during execution:
208
+
209
+ | Marker | When |
210
+ |--------|------|
211
+ | `[PREFLIGHT]` | Checking build environment |
212
+ | `[DETECT]` | Project type detection |
213
+ | `[CONFIGURE]` | CMake configuration (C++ only) |
214
+ | `[BUILD]` | Build command execution |
215
+ | `[ANALYZE]` | Parsing build errors |
216
+ | `[FIX]` | Applying auto-fixes |
217
+ | `[RETRY]` | Retrying build after fixes |
218
+ | `[SUCCESS]` | Build passed |
219
+ | `[BAIL]` | Stopping due to unfixable errors |
220
+
221
+ ## Example Flows
222
+
223
+ ### Success with Auto-Fix
224
+ ```
225
+ User: Build the project and fix errors
226
+
227
+ [PREFLIGHT] Checking build environment... cargo v1.75.0 found
228
+ [DETECT] Rust project (Cargo.toml found)
229
+ [BUILD] Building project...
230
+ [ANALYZE] Build failed - 2 errors found
231
+ [FIX] Applying 2 formatting fixes... Running cargo fmt
232
+ [RETRY] Retrying build (attempt 1/2)...
233
+ [SUCCESS] Build passed! Fixed 2 formatting issues in 1 retry cycle.
234
+ ```
235
+
236
+ ### Bail on Complex Error
237
+ ```
238
+ User: Run cargo build
239
+
240
+ [PREFLIGHT] Checking build environment... cargo v1.75.0 found
241
+ [DETECT] Rust project (Cargo.toml found)
242
+ [BUILD] Building project...
243
+ [ANALYZE] Build failed - 1 error found
244
+ [BAIL] Type error detected (E0308) - cannot auto-fix
245
+
246
+ Error at src/main.rs:15:20
247
+ mismatched types: expected `i32`, found `&str`
248
+
249
+ This requires manual code changes. The variable is declared as i32 but assigned a string.
250
+ ```
251
+
252
+ ## Additional Resources
253
+
254
+ Detailed reference documentation:
255
+ - `references/config-schema.md` - Complete configuration schema
256
+ - `references/error-patterns.md` - Common error patterns by language
257
+ - `references/troubleshooting.md` - Build tool issues and solutions
258
+ - `references/extending.md` - How to add new language support
259
+
260
+ Language configurations in `language-configs/`:
261
+ - `rust.yaml`, `javascript.yaml`, `python.yaml`, `cpp.yaml`
262
+
263
+ Example scenarios in `examples/`:
264
+ - `rust-format-fix.md` - Rust formatting fix
265
+ - `javascript-lint-fix.md` - ESLint auto-fix
266
+ - `python-format-fix.md` - Black formatting
267
+ - `bail-on-type-error.md` - Bail on complex error
268
+ - `tool-not-found.md` - Missing build tool handling
269
+ - `monorepo-detection.md` - Workspace project handling
270
+ - `max-errors-exceeded.md` - Error threshold exceeded
271
+ - `cpp-clang-format.md` - C++ clang-format fix
@@ -0,0 +1,37 @@
1
+ # Example: JavaScript ESLint Fix
2
+
3
+ ## Scenario
4
+ User runs build on a JS/TS project with fixable ESLint errors.
5
+
6
+ ## Build Output
7
+ ```
8
+ $ npm run build
9
+
10
+ > project@1.0.0 build
11
+ > eslint . && tsc
12
+
13
+ /src/utils.ts
14
+ 5:1 error Expected indentation of 2 spaces indent
15
+ 12:20 error Missing semicolon semi
16
+
17
+ 2 problems (2 errors, 0 warnings)
18
+ 2 errors and 0 warnings potentially fixable with the `--fix` option.
19
+ ```
20
+
21
+ ## Expected Response
22
+ ```
23
+ Using build-and-fix to detect and build project...
24
+
25
+ [DETECT] JavaScript/TypeScript project (package.json found, using npm)
26
+ [BUILD] Building project...
27
+ [ERROR] Build failed - 2 ESLint errors
28
+ [ANALYZE] Analyzing build errors...
29
+ [FIX] Applying fixes... Running npm run lint -- --fix...
30
+ [RETRY] Building project...
31
+ [SUCCESS] Build passed! Fixed 2 linting issues in 1 retry cycle.
32
+ ```
33
+
34
+ ## Key Points
35
+ - Pattern `\d+ fixable with.*--fix` detects ESLint fixable errors
36
+ - Package manager detected from lock files (npm/yarn/pnpm)
37
+ - Uses appropriate lint command for detected package manager
@@ -0,0 +1,139 @@
1
+ # JavaScript/TypeScript Language Configuration
2
+ version: "1.1.0"
3
+ name: javascript
4
+ display_name: JavaScript/TypeScript
5
+ priority: 2
6
+
7
+ # Detection: Files that identify this as a JS/TS project
8
+ detection:
9
+ required_files: [package.json]
10
+ confidence_boost_files: [tsconfig.json, package-lock.json, yarn.lock, pnpm-lock.yaml]
11
+ workspace_indicators:
12
+ file: package.json
13
+ pattern: '"workspaces"'
14
+
15
+ # Package manager detection (check lock files in this order)
16
+ package_manager_detection:
17
+ - lockfile: pnpm-lock.yaml
18
+ manager: pnpm
19
+ - lockfile: yarn.lock
20
+ manager: yarn
21
+ - lockfile: package-lock.json
22
+ manager: npm
23
+ - default: npm
24
+
25
+ # Pre-flight checks (by package manager)
26
+ preflight:
27
+ npm:
28
+ check_tool: npm --version
29
+ check_deps: test -d node_modules
30
+ install_hint: "Install Node.js from https://nodejs.org"
31
+ yarn:
32
+ check_tool: yarn --version
33
+ check_deps: test -d node_modules
34
+ install_hint: "Install Yarn: npm install -g yarn"
35
+ pnpm:
36
+ check_tool: pnpm --version
37
+ check_deps: test -d node_modules
38
+ install_hint: "Install pnpm: npm install -g pnpm"
39
+
40
+ # Timeouts (seconds)
41
+ timeouts:
42
+ build: 180
43
+ fix: 60
44
+
45
+ # Build commands by package manager
46
+ commands:
47
+ npm:
48
+ build: npm run build
49
+ check: npm run build --dry-run 2>/dev/null || npm run typecheck 2>/dev/null || true
50
+ lint: npm run lint
51
+ lint_fix: npm run lint -- --fix
52
+ format: npm run format 2>/dev/null || npx prettier --write .
53
+ test: npm test
54
+ yarn:
55
+ build: yarn build
56
+ check: yarn build --dry-run 2>/dev/null || yarn typecheck 2>/dev/null || true
57
+ lint: yarn lint
58
+ lint_fix: yarn lint --fix
59
+ format: yarn format 2>/dev/null || yarn prettier --write .
60
+ test: yarn test
61
+ pnpm:
62
+ build: pnpm build
63
+ check: pnpm build --dry-run 2>/dev/null || pnpm typecheck 2>/dev/null || true
64
+ lint: pnpm lint
65
+ lint_fix: pnpm lint --fix
66
+ format: pnpm format 2>/dev/null || pnpm prettier --write .
67
+ test: pnpm test
68
+
69
+ # Error parsing - extract file:line:column from various tools
70
+ error_parsing:
71
+ patterns:
72
+ # TypeScript errors: src/file.ts(10,5): error TS2322
73
+ - regex: '(.+)\((\d+),(\d+)\): error (TS\d+): (.+)'
74
+ file: 1
75
+ line: 2
76
+ column: 3
77
+ code: 4
78
+ message: 5
79
+ # ESLint errors: /path/file.js:10:5 error Message
80
+ - regex: '(.+):(\d+):(\d+)\s+(error|warning)\s+(.+)'
81
+ file: 1
82
+ line: 2
83
+ column: 3
84
+ severity: 4
85
+ message: 5
86
+ # Webpack/Vite errors
87
+ - regex: 'ERROR in (.+):(\d+):(\d+)'
88
+ file: 1
89
+ line: 2
90
+ column: 3
91
+ # Generic error with file path
92
+ - regex: 'Error: (.+) in (.+):(\d+)'
93
+ message: 1
94
+ file: 2
95
+ line: 3
96
+
97
+ # Error patterns with auto-fixes (only include fixable errors)
98
+ fixes:
99
+ - pattern: '\d+ errors? and \d+ warnings? potentially fixable with the `--fix` option'
100
+ action: lint_fix
101
+ description: Auto-fix ESLint errors with --fix flag
102
+ confidence: high
103
+ - pattern: '\d+ fixable with.*--fix'
104
+ action: lint_fix
105
+ description: Auto-fix ESLint errors
106
+ confidence: high
107
+ - pattern: 'Run Prettier to fix'
108
+ action: format
109
+ description: Fix formatting with Prettier
110
+ confidence: high
111
+ - pattern: 'style:.*\(prettier'
112
+ action: format
113
+ description: Fix Prettier formatting issues
114
+ confidence: medium
115
+
116
+ # Bail immediately on these errors (no auto-fix possible)
117
+ bail_on:
118
+ - pattern: 'error TS\d+:.*is not assignable to type'
119
+ description: TypeScript type mismatch
120
+ - pattern: 'error TS\d+:.*Property .* does not exist'
121
+ description: TypeScript missing property
122
+ - pattern: 'error TS\d+:.*Cannot find module'
123
+ description: TypeScript missing module
124
+ - pattern: 'SyntaxError:'
125
+ description: JavaScript syntax error
126
+ - pattern: 'ReferenceError:'
127
+ description: Undefined variable reference
128
+ - pattern: 'TypeError:'
129
+ description: Type error at runtime
130
+ - pattern: 'The engine "node" is incompatible'
131
+ description: Node.js version mismatch
132
+ - pattern: 'Module not found'
133
+ description: Missing dependency
134
+ - pattern: 'ENOENT.*package\.json'
135
+ description: Missing package.json
136
+
137
+ # Limits
138
+ max_errors: 15
139
+ max_retries: 2
@@ -0,0 +1,120 @@
1
+ # Config Schema Reference
2
+
3
+ Each `language-configs/{language}.yaml` follows this structure:
4
+
5
+ ```yaml
6
+ # Metadata
7
+ version: "1.1.0"
8
+ name: rust # Internal identifier
9
+ display_name: Rust (Cargo) # Human-readable name
10
+ priority: 1 # Detection priority (lower = higher)
11
+
12
+ # Detection
13
+ detection:
14
+ required_files: [Cargo.toml] # Must exist (any one)
15
+ confidence_boost_files: [Cargo.lock] # Optional, increases confidence
16
+ workspace_indicators: [members] # For monorepo detection
17
+
18
+ # Pre-flight checks
19
+ preflight:
20
+ check_tool: cargo --version # Verify tool exists
21
+ check_deps: test -f Cargo.lock # Verify deps installed
22
+
23
+ # Timeouts (seconds)
24
+ timeouts:
25
+ build: 120
26
+ fix: 30
27
+
28
+ # Commands (by package manager if applicable)
29
+ commands:
30
+ build: cargo build
31
+ check: cargo check # Fast pre-build verification
32
+ format: cargo fmt
33
+ test: cargo test
34
+
35
+ # Error parsing - extract file:line:column from output
36
+ error_parsing:
37
+ patterns:
38
+ - regex: 'error.*--> (.+):(\d+):(\d+)'
39
+ file: 1
40
+ line: 2
41
+ column: 3
42
+ - regex: '^error: (.+)$'
43
+ message: 1
44
+
45
+ # Auto-fixable patterns
46
+ fixes:
47
+ - pattern: 'Diff in .+\.rs' # Regex to match
48
+ action: format # Command to run
49
+ description: Fix formatting # Human-readable
50
+ confidence: high # high, medium, low
51
+
52
+ # Bail patterns - stop immediately, don't retry
53
+ bail_on:
54
+ - pattern: 'error\[E0308\]'
55
+ description: Type mismatch
56
+ - pattern: 'error\[E0597\]'
57
+ description: Lifetime error
58
+
59
+ # Limits
60
+ max_errors: 10
61
+ max_retries: 2
62
+ ```
63
+
64
+ ## Pattern Syntax
65
+
66
+ - **Patterns use regex** (Python `re` module compatible)
67
+ - **Capture groups**: `()` creates groups, referenced as `{1}`, `{2}`, etc.
68
+ - **Named groups**: `(?P<file>.+)` can be referenced as `{file}`
69
+ - **Bail patterns checked first**, before any fix patterns
70
+
71
+ ## Command Substitution
72
+
73
+ - `{1}`, `{2}`: Numbered capture groups from pattern match
74
+ - `{file}`: Matched filename (if extracted)
75
+ - `{line}`: Matched line number (if extracted)
76
+
77
+ ## Required Fields
78
+
79
+ | Field | Type | Description |
80
+ |-------|------|-------------|
81
+ | `version` | string | Config version (e.g., "1.1.0") |
82
+ | `name` | string | Internal identifier |
83
+ | `display_name` | string | Human-readable name |
84
+ | `priority` | int | Detection priority (1 = highest) |
85
+ | `detection.required_files` | list | Files that identify this language |
86
+ | `commands.build` | string | Build command |
87
+ | `max_errors` | int | Error threshold before bailing |
88
+ | `max_retries` | int | Maximum retry cycles |
89
+
90
+ ## Optional Fields
91
+
92
+ | Field | Type | Description |
93
+ |-------|------|-------------|
94
+ | `detection.confidence_boost_files` | list | Additional files that increase confidence |
95
+ | `detection.at_least_one` | bool | If true, any required file matches |
96
+ | `detection.workspace_indicators` | object | Monorepo detection config |
97
+ | `preflight` | object | Pre-build verification commands |
98
+ | `timeouts` | object | Timeout values in seconds |
99
+ | `error_parsing` | object | Patterns to extract error locations |
100
+ | `fixes` | list | Auto-fixable error patterns |
101
+ | `bail_on` | list | Patterns that trigger immediate bail |
102
+
103
+ ## Fix Confidence Levels
104
+
105
+ | Level | Meaning | Example |
106
+ |-------|---------|---------|
107
+ | `high` | Safe, always works | `cargo fmt`, `black .` |
108
+ | `medium` | Usually works, may need verification | `eslint --fix` |
109
+ | `low` | Experimental, requires user confirmation | - |
110
+
111
+ ## Error Parsing Groups
112
+
113
+ | Group Name | Purpose |
114
+ |------------|---------|
115
+ | `file` | Captured file path |
116
+ | `line` | Line number |
117
+ | `column` | Column number |
118
+ | `message` | Error message text |
119
+ | `code` | Error code (e.g., E0308, TS2322) |
120
+ | `severity` | error/warning level |