refine

refine is a skill for Claude Code from sharpdeveye/maestro. It costs 28 tokens per session (660 once invoked), scanned A, original, MIT.

A workflow guide for polishing an AI workflow after it already works, including its prompts, tools, errors, and logging.

In plain words
What is it for?
Use it for a final review of prompts, output formats, tool descriptions, error messages, and logs before release.
Why use it?
It helps find quality issues that can remain hidden even when the workflow produces results.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it for a final review of prompts, output formats, tool descriptions, error messages, and logs before release.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sharpdeveye/maestro/refine
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.

Any agent
npx skills add sharpdeveye/maestro --skill refine
Clone the repo
git clone --depth 1 https://github.com/sharpdeveye/maestro

Made for: Claude Code.

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/sharpdeveye/maestro/refine/github.svg)](https://agentmods.dev/skills/sharpdeveye/maestro/refine)
Your own site
<a href="https://agentmods.dev/skills/sharpdeveye/maestro/refine"><img src="https://agentmods.dev/badge/skills/sharpdeveye/maestro/refine/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refine

Your own site · 80×15
<a href="https://agentmods.dev/skills/sharpdeveye/maestro/refine"><img src="https://agentmods.dev/badge/skills/sharpdeveye/maestro/refine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 660 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00028 $0.00660
Opus 5.5 $0.00011 $0.00264
Sonnet 5.5 $0.00006 $0.00132
Haiku 4.5 $0.00003 $0.00066

Measured 1mo ago against content hash 2dfb74cefcab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

source/skills/refine/SKILL.md · 86 lines

How it starts

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

MANDATORY PREPARATION

Invoke /agent-workflow — it contains workflow principles, anti-patterns, and the Context Gathering Protocol. Follow the protocol before proceeding — if no workflow context exists yet, you MUST run /teach-maestro first.


This is the final quality pass. The workflow works — now make it excellent.

Refinement Checklist

Prompts

  • Every prompt follows the 4-zone pattern (role, context, instructions, output)
  • Output schemas are explicit and validated
  • Negative instructions clarify what NOT to do
  • No contradictory instructions
  • Few-shot examples included for ambiguous tasks
  • Chain-of-thought used for multi-step reasoning tasks

Tool Descriptions

  • Every tool has a multi-line description: what, when to use, when NOT to use, returns
  • Input parameters have descriptions and types
  • Error responses are documented
  • At least one example input/output in the description

Error Messages

  • Error messages are specific (not "an error occurred")
  • Error messages suggest corrective action
  • Errors include context (what was being attempted)
  • Errors are structured (code + message + details)

Logging

  • Every model call is logged (input tokens, output tokens, latency, cost)
  • Tool calls are logged with inputs and outputs
  • Errors are logged with full context
  • PII is redacted from logs
  • Workflow ID traces through all log entries

Configuration

  • All magic numbers are named constants
  • Environment-specific values are in config, not code
  • Defaults are sensible — config is for overrides
  • Cost ceilings are set
  • Timeout values are set for all external calls

Output

For each checklist item that fails, provide:

  1. What's wrong (specific finding)
  2. Where it is (file, line, or component)
  3. How to fix it (concrete suggestion)
  4. Priority (critical / important / nice-to-have)

Priority Matrix

Priority Criteria Maestro Action
Critical Affects correctness or safety /fortify or /guard before shipping
Important Affects quality or maintainability /calibrate in current cycle
Nice-to-have Cosmetic or minor inconsistency Note for next /refine pass

Read the full file on GitHub · 86 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. 1mo ago First seen · 86 lines · 28 tokens per session scan A 2dfb74cefcab

Subscribe to this mod's changes

refine is a skill published in the GitHub repository sharpdeveye/maestro (591 stars, last pushed 5mo ago), licensed MIT. It adds 28 tokens to every session and 660 once invoked, about $0.0001 per session on Opus 5.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-30.