refine

refine is a skill for Claude Code, Codex from dhofheinz/open-plugins. It costs 93 tokens per session (3,248 once invoked), scanned A, original, MIT.

A specification-management guide for planning software systems and features. A specification is a written description of what should be built, how it should work, and how the work should be organized.

In plain words
What is it for?
Creating specifications, refining existing ones, reviewing quality, detecting changes from the agreed design, finalizing plans, and breaking work into traceable tickets.
Why use it?
It keeps architecture, requirements, plans, reviews, and later changes connected in files so the project can be checked for gaps or drift.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the refinery plugin — 2 skills, 6 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dhofheinz/open-plugins/refine
Any agent
npx skills add dhofheinz/open-plugins --skill refine
Clone the repo
git clone --depth 1 https://github.com/dhofheinz/open-plugins

Made for: Claude Code, Codex.

Or install refinery, the plugin that ships this one along with the rest of its 2 skills, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refine

README.md
[![agentmods](https://agentmods.dev/badge/skills/dhofheinz/open-plugins/refine.svg)](https://agentmods.dev/skills/dhofheinz/open-plugins/refine)
Your own site
<a href="https://agentmods.dev/skills/dhofheinz/open-plugins/refine"><img src="https://agentmods.dev/badge/skills/dhofheinz/open-plugins/refine.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,248 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00093 $0.03248
Opus 5 $0.00046 $0.01624
Sonnet 5 $0.00019 $0.00650
Haiku 4.5 $0.00009 $0.00325

Measured 4d ago against content hash adc874559342, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/refinery/skills/refine/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refinery — Unified Specification Refinement

You are the orchestrator for the Refinery plugin. Your job is to interpret the user's intent and dispatch to the correct mode procedure, never to perform operations directly. Mode files (loaded on demand) contain the actual procedures.

Directive

Refinery treats specifications as typed nodes in an artifact graph. Every operation reads working-directory state from artifact frontmatter, executes a focused mode procedure, writes results back to artifacts, and exits. The plugin is stateless across invocations — all state lives in markdown files.

Your responsibility on every invocation:

  1. Parse $ARGUMENTS to determine intent
  2. Read working-directory state (read frontmatter only — do not load full artifact bodies until a mode requires them)
  3. Resolve to one of eleven modes
  4. Load the corresponding mode file via Read from ${CLAUDE_SKILL_DIR}/mode-<name>.md
  5. Execute the mode's procedure (which may load further stage files, reference files, templates, and spawn agents)
  6. Report outcome and suggest next action
  7. Exit

You never embed mode logic directly in this orchestrator. You dispatch.

Working Directory

Default resolution order (highest priority first):

  1. --output-dir=<path> flag on the invocation
  2. ${user_config.working_directory} if set in plugin user config
  3. docs/refinery/ (built-in default, distinct from docs/specs/ to avoid colliding with legacy artifacts)

If the resolved working directory does not exist and the user did not invoke init, prompt before creating it.

Input Parsing

Process $ARGUMENTS in the following order. First match wins.

  1. Empty arguments + working directory has artifacts → mode = status
  2. Empty arguments + working directory has no artifacts → AskUserQuestion: "What would you like to refine?" with options:
    • "Initialize project conventions" → init
    • "Start a new system from an idea" → prompt for idea then advance --stage=principles
    • "Document an existing feature" → prompt for feature name then advance --stage=feature-spec
    • "Cancel"
  3. Mode keyword as first argument (init, advance, iterate, review, finalize, check, tickets, update, status, archive, mark-implemented) → use that mode; remaining arguments are passed through to the mode file.
  4. --stage=<name> flag present → mode = advance; target stage = <name>
  5. First argument is an existing file path (matches *.md and exists) → inspect file's artifact: and status: frontmatter; suggest the most likely operation and confirm via AskUserQuestion if ambiguous.
  6. First argument is a free-text idea (multi-word, no special characters that suggest a path or feature name) → mode = advance; target stage = principles; idea text passed as input.
  7. First argument is a single-word identifier that doesn't match a mode keyword and doesn't exist as a file → assumed to be a feature name; mode = advance; target stage = feature-spec; scope = feature; feature name = the argument.
  8. Otherwise → AskUserQuestion to clarify intent (do not guess).

Read the full file on GitHub · 216 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 216 lines · 93 tokens per session scan A adc874559342

Subscribe to this mod's changes

refine is a skill published in the GitHub repository dhofheinz/open-plugins (9 stars, last pushed 4mo ago), licensed MIT. It adds 93 tokens to every session and 3,248 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens