Claude-skill-registry generate-fix-suggestions
Generate fix suggestions based on error patterns and best practices. Use when analyzing failures to get actionable remediation steps.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/generate-fix-suggestions" ~/.claude/skills/majiayu000-claude-skill-registry-generate-fix-suggestions && rm -rf "$T"
manifest:
skills/data/generate-fix-suggestions/SKILL.mdsource content
Generate Fix Suggestions from Errors
Analyze error patterns to suggest specific fixes and improvements.
When to Use
- Test failures need concrete solutions
- Build errors require remediation steps
- Code review finding actionable recommendations
- Automating fix suggestions for common errors
- Creating PR comments with suggestions
Quick Reference
# Categorize errors grep "Error\|FAILED" output.log | sed 's/.*Error: //' | sort | uniq -c | sort -rn # Get context around error grep -B 3 -A 3 "AssertionError" output.log # Extract error type grep -o "Error[A-Za-z]*" output.log | sort | uniq -c # Find patterns in multiple failures for file in test_*.log; do echo "=== $file ===" grep "Error:" "$file" | head -3 done
Fix Generation Workflow
- Analyze error: Categorize error type and context
- Match pattern: Compare against known error patterns
- Find root cause: Determine what caused the error
- Generate suggestion: Recommend specific fix
- Provide example: Show before/after code if applicable
- Prioritize fixes: High impact fixes first
- Report suggestions: Organized by priority
Common Error Patterns & Fixes
Assertion Errors:
- Pattern:
failsassert_equal(actual, expected) - Fix: Check expected value is correct, verify test logic
- Example: Update expected value or fix test setup
Type Mismatches:
- Pattern:
,TypeError
in function callAttributeError - Fix: Check argument types, verify method exists
- Example: Add type annotation or check imports
Out of Bounds:
- Pattern:
or array access failureIndexError - Fix: Verify array size, check loop bounds
- Example: Initialize array properly before access
Import/Module Errors:
- Pattern:
,ModuleNotFoundErrorImportError - Fix: Check module path, verify file exists
- Example: Add to
or fix path__init__.mojo
Memory/Initialization:
- Pattern: Uninitialized variable, null pointer
- Fix: Ensure variable initialized before use
- Example: Add explicit initialization or use
var
Output Format
Report suggestions with:
- Error Summary - What went wrong
- Root Cause - Why it happened
- Fix Steps - Numbered remediation steps
- Code Example - Before/after code snippet
- Priority - Critical/High/Medium/Low
- Testing - How to verify fix works
Priority Levels
Critical (fix immediately):
- Compilation errors
- All tests failing
- Core functionality broken
- Security issues
High (fix soon):
- Multiple tests failing
- Performance degradation
- Memory leaks
- Type safety issues
Medium (nice to have):
- Single test failing
- Code style issues
- Minor improvements
- Warnings
Low (backlog):
- Code polish
- Optional refactoring
- Documentation improvements
Error Handling
| Problem | Solution |
|---|---|
| Unknown error type | Classify as "other", suggest general investigation |
| Insufficient context | Request more detailed error info |
| Multiple causes | Suggest fixes in priority order |
| No matching pattern | Flag for manual review |
| False positives | Verify suggestion with test run |
References
- See extract-test-failures for error extraction
- See analyze-ci-failure-logs for CI-specific analysis
- See CLAUDE.md for code standards and error handling