Refine Chunk logo

Refine Chunk

Community
drobins25
refine-chunk

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.

Overview

Publisherdrobins25
Repositorycraft
Skill namerefine-chunk
Stars
69
Forks
6
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by drobins25 on GitHub. Read the source before you install it.

Installation

Install the Refine Chunk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/drobins25/craft/tree/main/skills/refine-chunk
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/drobins25/craft.git /tmp/craft
mkdir -p .claude/skills
cp -r /tmp/craft/skills/refine-chunk .claude/skills/refine-chunk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Refine Chunk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Refine Chunk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Refine Chunk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 chunk
  • ERRORS: validate-chunk error output — parse directly instead of re-running
  • FILES_CHANGED: comma-separated paths — scope the fix to these files
  • REFINE_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:

markdown
## Fix Plan

**Error:** Property 'onSubmit' is missing in type
**File:** `LoginForm.tsx:42`
**Root cause:** Form component expects onSubmit but wasn't passed

**Fix:**
1. Add onSubmit handler to Form props
2. Wire up existing handleSubmit function

**Changes:** 1 file, ~3 lines

4. Execute the Fix

Make the minimal change:

diff
- <Form>
+ <Form onSubmit={handleSubmit}>
    <Input ... />
    <Button type="submit">Submit</Button>
  </Form>

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:

## Refinement Applied

[Fix details per output template]

>>> HAND BACK TO validate-chunk: Refinement applied. Re-validate this chunk with the full check suite.

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.md for 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.md for the three output format templates (simple/multiple/complex).

Every template MUST end with:

>>> HAND BACK TO validate-chunk: Refinement complete. Re-validate this chunk now.

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

validate-chunk
     │
     ├─── Pass ───→ Continue to next chunk
     │
     └─── Fail ───→ refine-chunk
                         │
                         ├─── Simple fix ───→ Hand back (validate-chunk re-validates)
                         │
                         └─── Complex ───→ Ask for guidance
                                               │
                                               └─── Hand back (validate-chunk re-validates)

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Refine Chunk AI skill do?

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.

Why use Refine Chunk on TypingMind?

Because you install it once and use it with any model. Refine Chunk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Refine Chunk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/drobins25/craft/tree/main/skills/refine-chunk. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Refine Chunk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Refine Chunk?

As many as you like. As long as a model supports skills, you can use Refine Chunk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Refine Chunk AI skill free?

Yes. It is published on GitHub by drobins25 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇