Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Refine

A Claude Code agent skill that silently rewrites your prompt into a stronger form before answering, using task-type recipes — plus visible modes when you want to see the work.

What it does

While active, Refine detects the type of each request, reshapes it with the matching recipe, then answers the improved version. You see only the final answer (unless a visible mode is on). It never changes what you ask — only how it is framed — and always answers in your language.

Recipes

Ten input-type recipes, each loaded only when it matches:

Recipe Fires on
debug a stack trace or error log
sql a query to optimize, or an EXPLAIN plan
regex a pattern to write, explain, or fix
commit-msg a diff + "write a commit message"
ticket a ticket / user-story to turn into a mini-spec
api-design "design an API / endpoints for X"
test-gen "write tests for X"
review code pasted with "take a look"
interview a big, vague build request
agent a direct order to change code in this project

Unrecognized input gets a light generic cleanup — no recipe is forced.

Install

git clone https://github.com/dafuct/prompt-refine.git
ln -s "$(pwd)/prompt-refine/skill" ~/.claude/skills/refine

Then restart your Claude Code session.

Commands

Command Effect
/refine turn on silent refinement
/refine off turn off
/refine teach show an annotated rewrite before each answer
/refine vs <prompt> answer twice — raw vs refined — side by side
/refine audit post-mortem of the previous answer
!raw <prompt> skip refinement for one message

Optional hook (hard enforcement)

To keep the mode alive across context compaction, register a UserPromptSubmit hook in ~/.claude/settings.json:

{ "hooks": { "UserPromptSubmit": [ { "hooks": [ { "type": "command",
  "command": "sh ~/.claude/skills/refine/hooks/refine-gate.sh" } ] } ] } }

The gate is controlled by the flag file skill/hooks/.refine-active: /refine creates it, /refine off deletes it. Without the flag the hook stays silent.

Design

  • Zero runtime dependencies — Markdown + POSIX shell only.
  • Token-budgeted: SKILL.md ≤ 8 KB, each recipe ≤ 2 KB. Run sh scripts/check-budget.sh before changing skill files.
  • Silent by default; the rewrite is shown only in vs / teach mode.

About

Personal Claude Code agent skill: silently refines your prompts (10 input-type recipes) with visible /refine vs, teach and audit modes. Markdown + POSIX shell, zero deps.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages