
Refine
Guides a steerable review of existing code and a human-approved refactor plan
Refine is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 19
- Last commit
- License
- Apache-2.0
- Listing updated
Similar skills
About Refine
Refine is a review phase for code that already exists. It looks across architecture, coupling, error handling, testability, security and performance, and lets the user narrow or widen which areas are in scope before the review runs. Findings come back as a prioritized list, each marked as behavior-preserving or behavior-changing, with the tradeoffs spelled out and a few alternative directions to choose from.
The skill is deliberately one-way: it proposes and never edits code. Nothing moves forward until the user explicitly approves a scoped set of refinements. The approved set is then handed to a separate spec skill, which adds behavior-preserved acceptance criteria so that characterization tests are written before any structural change. Any change that falls outside the approved set has to be re-approved first.
The skill is written for the mokata workflow and calls its command-line tools for code graph queries, spec checks and run progress. It ships as a single SKILL.md with no bundled scripts, and it expects a codebase to review, with the mokata tooling optional and a plain read-and-grep fallback described when it is absent.
When your agent uses it
mokata · Deep, user-steerable review of EXISTING code → propose prioritized refinements → HARD-GATE a scoped set, then hand off to spec.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (13 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the mokata plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add JasGujral/mokata-oss
/plugin install mokata@mostackOr copy only this skill to ~/.claude/skills/refine:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/refine &&
cp -R "$tmp/src/mokata/skills/refine" ~/.claude/skills/refine &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/refine inside it instead.
Copy the skill folder to ~/.agents/skills/refine to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/refine &&
cp -R "$tmp/src/mokata/skills/refine" ~/.agents/skills/refine &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/refine inside it instead.
Copy the skill folder to ~/.cursor/skills/refine to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/refine &&
cp -R "$tmp/src/mokata/skills/refine" ~/.cursor/skills/refine &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/refine inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/JasGujral/mokata-oss.git --path src/mokata/skills/refineOr copy the folder to ~/.gemini/skills/refine yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/refine:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/refine &&
cp -R "$tmp/src/mokata/skills/refine" ~/.copilot/skills/refine &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/refine inside it instead.
Get the folder:
git clone --depth 1 https://github.com/JasGujral/mokata-oss.gitThen copy mokata-oss/src/mokata/skills/refine into your agent's skills folder as refine. Agents that support SKILL.md read one folder per skill.
What it does
- Steerable review scope
- Lets the user include or exclude dimensions such as security or performance before the review starts.
- Prioritized refinement list
- Presents each proposed change with its rationale, principle, tradeoff and behavior impact, ordered by priority.
- Alternative directions
- Offers two or three coherent refactoring options so the user can choose the scope of change.
- Human approval gate
- Blocks any spec or code work until the user explicitly approves a scoped set of refinements.
- Handoff to spec
- Passes the approved changes to a spec skill that writes acceptance criteria and characterization tests.
- Spec and decision checks
- Routes changes that touch saved specs or recorded decisions through a deviation gate for confirmation.
Good for
- Review this module for architecture and coupling problems before we change it
- Suggest what to refactor or clean up in the auth code, focusing on security
- List prioritized hardening fixes for the public API without changing behavior
- Scope a set of cleanup changes and hand them off for a spec
Refine FAQ
Does refine change my code?
No. It only proposes refinements. Any implementation happens later in the develop phase, after a spec is written and approved.
What happens after I approve a set of refinements?
The approved set is handed to the spec skill, which turns it into acceptance criteria, including characterization tests for behavior-preserving changes.
Can I limit which areas the review covers?
Yes. You can give free-form guidance such as focusing on a module or excluding performance, and the skill states which areas are in and out of scope.
Does Refine work without the mokata tools?
The skill describes a fallback where it reads and greps the target code and says that the answer is degraded when the code graph or memory is absent.
How do I install Refine in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/refine to use it in all your projects, or to .claude/skills/refine in one project. Or install the mokata plugin, which includes it: /plugin marketplace add JasGujral/mokata-oss, then /plugin install mokata@mostack.
Does Refine run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Refine?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Refine?
The closest alternatives to Refine are Review, Refactor plan, Refactor, Harness review and Refactor seams.
Where this comes from
- Description: from the skill's own SKILL.md.
More from JasGujral/mokata-oss

Makes the agent design API contracts first and check callers before changing them
- Open source
- 19 GitHub stars
- Developer tools

Gives an agent NestJS rules for guards, DTO validation, modules and tests
- Open source
- 19 GitHub stars
- Developer tools

Guides an agent through Socratic exploration of an approach before any spec or code
- Open source
- 19 GitHub stars
- Developer tools

Guides an agent to capture live browser console, network and page state for tests
- Open source
- 19 GitHub stars
- Developer tools

Guides the agent to reproduce a reported bug with a failing test before fixing it
- Open source
- 19 GitHub stars
- Developer tools

Guides an agent on CI/CD pipelines, release builds and pinned supply-chain posture
- Open source
- 19 GitHub stars
- Developer tools



