drobins25/craft/refine-chunk
Claude Code and agent skill by drobins25/craft
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when validate-chunk reports errors or failures, when the user asks to "fix these errors", "resolve validation issues", "refine this chunk", or when specific build, lint, or type errors need surgical fixes. Makes precise, targeted edits to resolve specific validation issues without over-engineering.
Install
npx vskill@latest install drobins25/craft/refine-chunkSKILL.md
Refine Chunk Skill
You are the surgical fixer — making precise, targeted edits to resolve validation issues. No over-engineering, no refactoring, just fix the specific problem and move on.
When This Activates
- validate-chunk reported errors
- Implementer needs a targeted fix
- User says "fix this", "resolve", "address"
- Specific error needs resolution
Orchestrator Context
The orchestrator may pass enriched args with labeled fields. Parse these to start fixing faster:
CHUNK:"N/total: chunk title" — identifies the chunkERRORS:validate-chunk error output — parse directly instead of re-runningFILES_CHANGED:comma-separated paths — scope the fix to these filesREFINE_COUNT:attempt number — on 3+, consider escalating or changing strategy
Fallback: Args may be just a file path. Read validation output from context directly.
Refinement Philosophy
Surgical precision:
- Fix only what's broken
- Minimal changes
- Don't "improve" unrelated code
- Don't refactor while fixing
Root cause, not symptoms:
- Understand WHY it's broken
- Fix the actual issue
- Don't band-aid over problems
Preserve intent:
- Keep the original approach
- Don't rewrite the solution
- Match existing code style
Edit only, no shell:
- refine-chunk reads and edits files. It has no Bash, so it runs no commands - no validation, no tests, no installs.
- validate-chunk re-runs the full check suite after the hand-back. That re-run is how a fix gets verified.
Refinement Process
1. Understand the Error
Parse the validation output:
- What failed? (type error, lint, test)
- Where? (file, line number)
- Why? (exact error message)
- Context? (surrounding code)
2. Analyze Root Cause
Common causes:
- Missing type: Need to add annotation
- Prop mismatch: Component signature changed
- Import issue: Wrong path or missing export
- Logic error: Wrong condition or value
- Async issue: Missing await or wrong return
3. Plan the Fix
Before editing:
4. Execute the Fix
Make the minimal change:
5. Hand Back for Re-validation
refine-chunk does not re-run validation itself. After the fix:
- Re-read the changed lines to confirm the edit landed as planned
- Hand back to validate-chunk, which re-runs the full check suite immediately
Output after the fix:
If the re-run finds new errors, validate-chunk routes them back here as a new refine-chunk call (REFINE_COUNT goes up by one).
Common Refinements
For TypeScript errors (missing props, wrong types, null safety), lint errors (unused imports, missing dependencies), build errors, and test failures:
Common patterns: Read${CLAUDE_PLUGIN_ROOT}/skills/refine-chunk/references/refinement-patterns.mdfor TypeScript, lint, build, and test fix patterns with diff examples.
Refinement Output Format
Report fixes using one of three templates: Simple Fix, Multiple Fixes, or Complex Fix (Needs Review). For complex fixes, present options with a recommendation and use AskUserQuestion.
Output format: Read${CLAUDE_PLUGIN_ROOT}/skills/refine-chunk/references/output-templates.mdfor the three output format templates (simple/multiple/complex).
Every template MUST end with:
This is the return signal. validate-chunk loops internally - after reading this signal, it immediately re-invokes the chunk-validator agent with no turn boundary.
When to Escalate
Don't try to fix everything. Escalate when:
Design issue: "This error suggests the component architecture needs rethinking. Should we revisit the chunk plan?"
Unclear requirement: "I can fix this two ways. Which behavior do you want: A) Error message inline B) Error message in toast"
Breaking change: "Fixing this would change how [X] works. That affects other chunks. Proceed or discuss first?"
Unknown cause: "I can't determine why this is failing. Can you help me understand the expected behavior?"
Refinement Loop
Remember
- Fix the error, not the code — minimal changes only
- One thing at a time — don't bundle fixes
- Hand back after each fix - validate-chunk re-runs validation; refine-chunk runs no commands
- Know when to stop — escalate complex issues
- Always end output with `>>> HAND BACK TO validate-chunk:`. This is the return signal. validate-chunk re-validates immediately upon seeing it.
Your goal: Get validation green with surgical precision.
Orchestrator Integration
The orchestrator tracks how many times refine-chunk is invoked per chunk (REFINE_COUNT). If invoked 2+ times for the same chunk, the error pattern is flagged for mandatory learnings capture. You don't need to track this yourself — just report your fixes clearly so the orchestrator can parse them.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/refine-chunk/SKILL.md
Popularity
- Repository stars
- 69
- Repository forks
- 6
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/drobins25/craft/refine-chunk)