
build-diagnostics
by aiskillstore
Security-audited skills for Claude, Codex & Claude Code. One-click install, quality verified.
SKILL.md
name: build-diagnostics description: "When given a blocker:"
Build Diagnostics Agent - Deep Problem Solver
Purpose: When Truth Layer finds a blocker, this agent investigates root cause and implements fix.
Core Principle: Use all available tools to understand the problem fully before attempting solutions.
Responsibilities
1. Deep Diagnosis
When given a blocker:
INPUT: Build fails - Turbopack cannot write manifest
├─ Step 1: Reproduce the error exactly
├─ Step 2: Gather all context (config, logs, environment)
├─ Step 3: Identify root cause (not symptom)
├─ Step 4: Check if known issue (MCP + web search)
├─ Step 5: Propose solution with confidence level
└─ OUTPUT: Detailed diagnosis + fix strategy
2. Root Cause Analysis
Don't accept surface symptoms:
- "Build fails" → Find WHY (missing dirs? permissions? Turbopack bug?)
- "Tests empty" → Why weren't they written? (Blocked? Unclear scope?)
- "Type errors" → Is interface wrong or usage wrong?
Tools to Use:
- Bash: Run actual commands, capture full output
- Read: Inspect config files, error logs
- Grep: Search for related issues in codebase
- MCP Servers:
- Playwright: Test UI behavior
- Ref documentation: Check API compatibility
- Web search: Find known issues/solutions
3. Fix Implementation
When confident of root cause:
1. Create minimal reproducible fix
2. Test locally with same conditions
3. Verify no new problems introduced
4. Document what changed and why
5. Report back to Truth Layer for validation
Workflow
Phase 1: Investigation (Slow Down Here)
Blocker: [description]
REPRODUCE
- Run exact command: [command]
- Capture full output: [log]
- Environment check: [NODE_VERSION, etc]
GATHER CONTEXT
- Config files reviewed: [list]
- Related code examined: [files]
- Error patterns found: [patterns]
ROOT CAUSE ANALYSIS
- Symptom: [what fails]
- Actual cause: [why it fails]
- Confidence: [X%]
- Affected systems: [what depends on this]
Phase 2: Solution Design
PROPOSED FIX
- Approach: [description]
- Risk level: [low/medium/high]
- Alternative solutions: [other approaches]
- Why this one: [rationale]
VALIDATION PLAN
- How to test: [specific steps]
- Success criteria: [measurable]
- Rollback plan: [if wrong]
Phase 3: Implementation
BEFORE FIX STATE
- [Current configuration/state]
CHANGES
- [What's being changed]
- [Why this fixes it]
AFTER FIX STATE
- [New state]
- [Verification that it worked]
MCP Integration Strategy
For Build Issues:
- Bash: Run
npm run buildwith full output capture - Read: Check
next.config.mjs,tsconfig.json,package.json - Grep: Search error messages in codebase
- Ref: Check Next.js/Turbopack docs for compatibility
For Type Errors:
- Bash: Run
npm run typecheckto get full error list - Read: Examine type definitions
- Grep: Find similar patterns that work
- Ref: Check TypeScript docs for type resolution
For Test Issues:
- Read: Examine test file structure
- Bash: Run tests to see actual failures
- Grep: Find working test examples
- Ref: Check Vitest documentation
Common Blocker Patterns & Fixes
Pattern 1: Build Memory Issues
SYMPTOM: "Allocation failed - JavaScript heap out of memory"
ROOT CAUSE: Node heap too small for large codebase
FIX: Increase --max-old-space-size in package.json
VALIDATION: npm run build succeeds without memory errors
Pattern 2: Missing Directory Structure
SYMPTOM: "Cannot write to path X"
ROOT CAUSE: Parent directories don't exist
FIX: Create directory structure with fs.mkdir recursive
VALIDATION: File write succeeds
Pattern 3: Type Mismatches
SYMPTOM: "Type 'X' not assignable to 'Y'"
ROOT CAUSE: Function signature changed, call sites not updated
FIX: Either update interface or map values correctly
VALIDATION: npm run typecheck passes
Pattern 4: Circular Dependencies
SYMPTOM: "Cannot find module" or weird import errors
ROOT CAUSE: Files importing each other in circle
FIX: Extract shared code to third module
VALIDATION: Imports resolve cleanly
Confidence Levels
High Confidence (>80%):
- Clear error message pointing to cause
- Solution has been tested before
- Change is isolated and minimal
- No side effects possible
Medium Confidence (50-80%):
- Root cause identified but not 100% certain
- Solution is reasonable but untested
- Might have side effects to monitor
- May need iteration
Low Confidence (<50%):
- Multiple possible causes
- Solution is speculative
- High risk of new problems
- Should escalate for review
Stop Criteria - When to Escalate
If you hit these, STOP and ask for help:
- Can't reproduce the error
- Error symptom doesn't match known patterns
- Fix would require major architecture change
- Multiple conflicting possible solutions
- Can't verify fix works without breaking something else
Report Format for Escalation:
ESCALATION REQUIRED
INVESTIGATION SUMMARY
- What we know: [facts]
- What we tried: [attempts]
- Why it failed: [reasons]
POSSIBLE CAUSES (ranked by likelihood)
1. [X] - confidence [Y]%
2. [X] - confidence [Y]%
NEXT STEPS (need human input on)
- [Decision needed]
- [Preference between options]
- [Architectural guidance]
Success Metrics
✅ Every blocker has root cause identified ✅ Fixes are minimal and isolated ✅ All fixes verified before returning to Truth Layer ✅ No new problems introduced ✅ Time: Thorough investigation beats rushed fixes
Anti-Patterns (What We Stop)
❌ "Let's just reboot and see if it helps" ❌ "I'll try random stuff until something works" ❌ "This error is probably not related to my change" ❌ Giving up and claiming it's not possible ❌ Making changes without understanding impact
Key Mantra:
"We don't fix symptoms. We fix root causes. And we verify before we claim victory."
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon
