Agent skill

Refine

by swingerman in swingerman/engineer

Use after a feature's code is implemented and passing, to clean up the changed code before verification.

MITAuto-check passedDevelopment

Install Refine

skills CLI
$ npx skills add swingerman/engineer --skill refine -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install swingerman/engineer refine --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/swingerman/engineer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineer/skills/refine .claude/skills/refine && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
refine
GitHub stars
154
Token cost
~1.8k tokens
SKILL.md length
856 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Use after a feature's code is implemented and passing, to clean up the changed code before verification.

  • Works in 8 steps: Resolve + scope — resolve the… → Dispatch three parallel review… → Consolidate — merge findings; dedup… → …
  • — /engineer.refine
  • SKILL.md covers When to use, Workflow, Handoff and References
  • Calls git

What it does

Refine is an agent skill from swingerman/engineer. Use after a feature's code is implemented and passing, to clean up the changed code before verification. Triggers — "/engineer.refine", "refine this code", "clean up the feature", "refactor what we built".

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring. The repository describes itself as: Disciplined Agentic Engineering — a methodology kit for Claude Code: acceptance-test-first specs, explicit checkpoints, and autonomy you can actually leave running. The engineer… The licence is MIT.

When your agent uses it

  • — /engineer.refine
  • Refine this code
  • Clean up the feature
  • Refactor what we built

Example prompts

  • “/engineer.refine”
  • “refine this code”
  • “clean up the feature”
  • “/refine”

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Resolve + scope — resolve the methodology root + manifest via ${CLAUDE_PLUGIN_ROOT}/scripts/dae_resolve.py (see references/resolving.md)…
  2. Dispatch three parallel review subagents: three Agent-tool calls in one message, each subagent_type: engineer:reviewer (or the project…
  3. Consolidate — merge findings; dedup overlaps (note multi-lens hits as strong signals); keep genuine conflicts as alternatives for the human.
  4. Charter filter — check every proposal against CHARTER.md (architecture, conventions, methodology, the ACs+specs contract)…
  5. Classify breaking changes — consumer-facing (something outside the blast radius depends on the old shape) → graceful path…
  6. Present; human picks — show charter-compliant proposals (change, why, blast radius, churn). The human selects which are worth the churn.
  7. Apply — apply selected; install graceful paths where needed; re-run both test streams. Before running the test streams, ensure required…
  8. Handoff — emit a summary.

What it can do on your machine

Read from SKILL.md and the folder at commit 32947eb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • notion.so

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refine loads about 1.8k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 856 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from swingerman/engineer at commit 32947eb, republished under its MIT licence (© swingerman). 856 words, ~1,810 tokens.

Download SKILL.mdSave it as .claude/skills/refine/SKILL.md (or your agent's skills folder).
name
refine
description
Use after a feature's code is implemented and passing, to clean up the changed code before verification. Triggers — "/engineer.refine", "refine this code", "clean up the feature", "refactor what we built".

refine

Charter-bound clean-up of a feature's changed code — Checkpoint 6. Modeled on Claude Code's stock /simplify (a three-subagent parallel review) with two layers the stock skill lacks: charter validation of every proposal, and graceful breaking changes.

The behavior contract (ACs + specs) is sacred — a refactor that breaks it is a category error. New shapes are introduced alongside old, never instead of.

When to use

Checkpoint 6, after atdd:atdd-team produces passing code, before crap-analyzer (Checkpoint 7).

Verification independence: if manifest.verification.apply_to_checkpoints includes 6, refine must run on a non-implementer agent. The three review subagents (Step 2) are fresh regardless, so independence is satisfied by construction.

Not for: changing behavior (feature-edit); risk analysis (crap-analyzer); code that isn't implemented/green yet.

Workflow

Step 0 — Entry gate. Before starting, verify the prior checkpoint is complete: run ${CLAUDE_PLUGIN_ROOT}/scripts/dae_handoff.py <feature-dir> --through 5. On a non-zero exit, stop and surface the gap to the human — do not proceed.

Verify branch hygiene: run ${CLAUDE_PLUGIN_ROOT}/scripts/dae_branch.py <feature-dir>. On a non-zero exit, stop and surface the message to the human — switch branches and re-invoke. The check honors the git.manual: true manifest opt-out.

After the gate passes, show the pipeline breadcrumb: run ${CLAUDE_PLUGIN_ROOT}/scripts/dae_progress.py <feature-dir> and present its output to the human — it shows where this checkpoint sits in the DAE pipeline. The breadcrumb is advisory: a non-zero exit or a missing progress.md never blocks the skill. Then create one TodoWrite todo per workflow step below. See ${CLAUDE_PLUGIN_ROOT}/references/progress-indicator.md.

  1. Resolve + scope — resolve the methodology root + manifest via ${CLAUDE_PLUGIN_ROOT}/scripts/dae_resolve.py (see references/resolving.md); locate the feature. Scope = the feature branch's changed code (git diff against the branch point). Load feature.md, acs.md, spec.md, CHARTER.md.
  2. Dispatch three parallel review subagents: three Agent-tool calls in one message, each subagent_type: engineer:reviewer (or the project override; see ${CLAUDE_PLUGIN_ROOT}/references/host-capabilities.md, "Role agents"), each over the same changed code and each with its lens named in the brief. The agent is read-only and caps its reply, so three results fit in context. Before dispatching, run ${CLAUDE_PLUGIN_ROOT}/scripts/dae_dup.py <methodology-root> to get deterministic project-wide duplicate findings; pass the JSON result into the Reuse subagent's context as a tool input (the subagent treats it as one signal alongside its own LLM judgment, and produces a unified set of findings — not a separate list). If dae_dup.py returns anything other than status: ok — status: unavailable (the backend tool isn't installed), status: skipped (manifest duplication.skip: true), status: unsupported (the configured backend isn't implemented in this version), or status: error (scan failed) — surface that status in the Reuse subagent's prompt and proceed with its existing LLM-only judgment.
    • Reuse — duplication (LLM + dae_dup.py findings), reinvented wheels, dead code, missed existing utilities. LSP-first lookup — at dispatch time, check whether an LSP MCP capability is available; pass that detection result and the LSP-first preference into the Reuse subagent's prompt so it uses find-references / workspace-symbols when available, with graceful fallback to grep + Read. See ${CLAUDE_PLUGIN_ROOT}/references/code-lookup.md.
    • Quality — clarity, structure, naming, incidental complexity, maintainability
    • Efficiency — redundant computation, repeated lookups, visible performance smells
  3. Consolidate — merge findings; dedup overlaps (note multi-lens hits as strong signals); keep genuine conflicts as alternatives for the human.
  4. Charter filter — check every proposal against CHARTER.md (architecture, conventions, methodology, the ACs+specs contract). Charter-violating proposals are rejected internally — never shown. This filter is the DAE-specific layer the stock skill lacks.
  5. Classify breaking changes — consumer-facing (something outside the blast radius depends on the old shape) → graceful path: deprecation-marked forwarding shim + migration note, new shape alongside old. Internal-only → hard change is fine.
  6. Present; human picks — show charter-compliant proposals (change, why, blast radius, churn). The human selects which are worth the churn.
  7. Apply — apply selected; install graceful paths where needed; re-run both test streams. Before running the test streams, ensure required infra is up: read manifest.yml's infra: section, then call ${CLAUDE_PLUGIN_ROOT}/scripts/dae_infra.py ensure <names> for each declared dependency the tests need. On a start-failed structured failure → stop and surface the diagnosis. On a missing manifest declaration for required infra → stop with the "declare in manifest" message. Any failure → revert that proposal and report.
  8. Handoff — emit a summary.
Show full SKILL.md (196 more words)Show less

If a charter rule itself blocks a genuinely better design, surface it in the handoff (→ feature-edit / charter amendment). refine does not amend the charter.

Handoff

Emit per ${CLAUDE_PLUGIN_ROOT}/references/handoff-summary.md. agent_id must differ from the implementer if checkpoint 6 is independence-gated. checkpoint: 6; recommended_next: "/engineer.arch-check (CP7 Light Verify; it runs crap-analyzer too)".

The handoff MUST include the exit_criteria block asserting each of Checkpoint 6's exit criteria (Foundation Design Section 8) with verified_by, met, and evidence. For verified_by: tool criteria, the evidence MUST be the tool's actual output. The checkpoint is marked done only when every criterion is met.

Before stopping, apply the dispatch rule — see ${CLAUDE_PLUGIN_ROOT}/references/handoff-dispatch.md. CP7 verify needs a fresh agent (charter §6). Dispatch subagent_type: engineer:verifier (or the project override), which cannot edit code and writes the CP7 handoff. Do not ask the human "want me to dispatch?" — auto-dispatch at autonomy medium/high; confirm-then-dispatch at low. If verify needs resources you can't reach (live emulators, prod creds), write the exact dispatch command in the handoff and stop.

References

  • ${CLAUDE_PLUGIN_ROOT}/agents/reviewer.md: the Step 2 role agent
  • ${CLAUDE_PLUGIN_ROOT}/references/parallelism.md: Tier 2, parallel Agent calls in one message
  • ${CLAUDE_PLUGIN_ROOT}/references/handoff-dispatch.md — when to dispatch vs stop
  • Foundation Design — charter format, verification independence
  • engineer/references/handoff-dispatch.md — infra-ensure-before-stop rule

© swingerman, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in engineer/skills/refine of swingerman/engineer.

Open the folder on GitHubat commit 32947eb

Compare with similar skills

Refine next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Refine compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refine this skillswingerman/engineer154—~1.8kAutomated safety check: PassMIT
Guidelinesakash-network/node1.1k22 repos~577Automated safety check: PassMIT
Component Refactoringlangflow-ai/langflow156k—~3.5kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman41k—~2.6kAutomated safety check: PassGPL-3.0
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT

Similar skills

  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 22 repos~577 tokens
    DevelopmentAuto-check passed
  • Component Refactoring

    langflow-ai/langflow

    Refactor high-complexity React components in Langflow frontend.

    156k GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    41k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Codex

    skills-directory/skill-codex

    A skill your agent uses when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing

    1.5k GitHub starsUsed in 3 repos~1.8k tokens
    DevelopmentAuto-check passed

More from swingerman/engineer

All 27 skills in this repo
  • Crap Analyzer

    swingerman/engineer

    A skill your agent uses to produce a risk-based refactor + test plan for recently-changed code on a diff/branch/PR by computing CRAP (complexity × untested) on changed methods.

    154 GitHub stars~1.2k tokensUpdated 14 days ago
    Auto-check passed
  • Atdd Mutate

    swingerman/engineer

    A skill your agent uses to add a third validation layer to the ATDD workflow — after acceptance tests verify WHAT and unit tests verify HOW, mutation testing verifies the tests actually catch bugs.

    154 GitHub stars~2.7k tokensUpdated 14 days ago
    Auto-check passed
  • Fix

    swingerman/engineer

    A skill your agent uses to drive a bug fix from first report through close, with a "why didn't we catch it?" loop at the end.

    154 GitHub stars~3k tokensUpdated 14 days ago
    Auto-check passed
  • Atdd

    swingerman/engineer

    A skill your agent uses to drive feature work through the Acceptance Test Driven Development workflow — Given/When/Then specs before code, a project-specific test pipeline, and two parallel test…

    154 GitHub stars~2.8k tokensUpdated 14 days ago
    Auto-check passed
  • Harden

    swingerman/engineer

    Use after a feature passes Light Verify (CP7), to prove the tests actually catch bugs and, where the code warrants it, to formally check its invariants — Checkpoint 8.

    154 GitHub stars~1.8k tokensUpdated 14 days ago
    Auto-check passed
  • Next

    swingerman/engineer

    Use at the start of a work session, or any time the question is "what should I pick up now" across the whole project.

    154 GitHub stars~3k tokensUpdated 14 days ago
    Auto-check passed

Categories

Questions about Refine

What does Refine do?

Use after a feature's code is implemented and passing, to clean up the changed code before verification. Refine is an agent skill from swingerman/engineer. Use after a feature's code is implemented and passing, to clean up the changed code before verification.

When should I use Refine?

Refine fits situations like: — /engineer.refine; refine this code; clean up the feature; refactor what we built.

How do I install Refine in Claude Code?

Run `npx skills add swingerman/engineer --skill refine -a claude-code`. Or copy the skill folder (engineer/skills/refine in swingerman/engineer) into .claude/skills/refine in your project. Claude Code loads it when a task matches its description.

How do I install Refine in Codex?

Run `npx skills add swingerman/engineer --skill refine -a codex`. Or copy the skill folder (engineer/skills/refine in swingerman/engineer) into .agents/skills/refine in your project. Codex loads it when a task matches its description.

Can I use Refine in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add swingerman/engineer --skill refine -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refine, .gemini/skills/refine, .github/skills/refine and .opencode/skills/refine in your project.

What does Refine need to run?

Going by SKILL.md and its folder, Refine needs the command-line tools its instructions call (git).

Does Refine access the network?

SKILL.md names 1 domain. As links in the text: notion.so. This is read from the text; nothing was executed.

Is Refine safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Refine use?

Refine is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refine use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refine?

Skills that share tags, products or a category with Refine: Guidelines (akash-network/node, 1.1k stars), Component Refactoring (langflow-ai/langflow, 156k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 41k stars) and ast-grep Structural Search (code-yeongyu/oh-my-openagent, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refine?

swingerman (a GitHub user) maintains it in swingerman/engineer, which has 154 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on September 23, 2026.

Source: swingerman/engineer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.