# Refine

> Refine is an open-source agent skill for developer tools. Guides a steerable review of existing code and a human-approved refactor plan. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/JasGujral/mokata-oss/tree/main/src/mokata/skills/refine
- **Repository:** https://github.com/jasgujral/mokata-oss
- **GitHub stars:** 19
- **License:** Apache-2.0
- **Skill name:** refine
- **Collection:** https://github.com/JasGujral/mokata-oss
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/refine)
- [License: Apache-2.0](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/refine)

## Features

- **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

## Install

### Claude Code

This skill ships in the `mokata` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add JasGujral/mokata-oss
/plugin install mokata@mostack
```

Or copy only this skill to `~/.claude/skills/refine`:

```sh
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.

### Codex

Copy the skill folder to `~/.agents/skills/refine` to use it in every repository:

```sh
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.

### Cursor

Copy the skill folder to `~/.cursor/skills/refine` to use it in every project:

```sh
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.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/JasGujral/mokata-oss.git --path src/mokata/skills/refine
```

Or copy the folder to `~/.gemini/skills/refine` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/refine`:

```sh
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.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git
```

Then 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.

## 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.

## Alternatives

- [Review](https://ai-powered.com/skills/review-jasgujral): Review is an open-source agent skill for developer tools.
- [Refactor plan](https://ai-powered.com/skills/refactor-plan): Refactor plan is an open-source agent skill for developer tools.
- [Refactor](https://ai-powered.com/skills/refactor): Refactor is an open-source agent skill for developer tools.
- [Harness review](https://ai-powered.com/skills/harness-review-chachamaru127): Harness review is an open-source agent skill for developer tools.
- [Refactor seams](https://ai-powered.com/skills/refactor-seams): Refactor seams is an open-source agent skill for developer tools.
- [Improve architecture](https://ai-powered.com/skills/improve-architecture): Improve architecture is an open-source agent skill for developer tools.
- [Review and refactor](https://ai-powered.com/skills/review-and-refactor): Review and refactor is an open-source agent skill for developer tools.
- [Code simplifier](https://ai-powered.com/skills/code-simplifier): Code simplifier is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/refine
