refine

refine is a command for coding agents from athrael-soju/framework-generator. It costs 10 tokens per session (854 once invoked), scanned A, original, MIT.

A planning command that expands each stage of a workflow into specific activities, inputs, outputs, and checks.

In plain words
What is it for?
It helps detail stages using a framework charter, stage map, user-provided domain knowledge, criteria, categories, sources, and constraints.
Why use it?
It turns a high-level stage map into concrete work that can be reviewed and carried out.

Command

Part of the framework-generator plugin — 6 commands 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 commands/athrael-soju/framework-generator/refine
Clone the repo
git clone --depth 1 https://github.com/athrael-soju/framework-generator

Or install framework-generator, the plugin that ships this one along with the rest of its 6 commands.

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/commands/athrael-soju/framework-generator/refine.svg)](https://agentmods.dev/commands/athrael-soju/framework-generator/refine)
Your own site
<a href="https://agentmods.dev/commands/athrael-soju/framework-generator/refine"><img src="https://agentmods.dev/badge/commands/athrael-soju/framework-generator/refine.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 854 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.00010 $0.00854
Opus 5 $0.00005 $0.00427
Sonnet 5 $0.00002 $0.00171
Haiku 4.5 $0.00001 $0.00085

Measured 3d ago against content hash c10194a3b213, 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 3d 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.

commands/refine.md · 155 lines

How it starts

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

Refine

Specify each stage in detail.

Inputs

Input Source
framework_charter Frame stage output
stage_map Organize stage output
stage_activities User input
context_tables User input
output_template User input
criteria User input

Input Format

From Frame stage (output/{date}/{name}/1-frame/charter.md):

## Problem
{Workflow being addressed}

## Scope
**In:** {What's covered}
**Out:** {What's excluded}

From Organize stage (output/{date}/{name}/2-organize/stage-map.md):

## Stages

| Stage | Purpose | Inputs | Outputs |
|-------|---------|--------|---------|
| {Name} | {Description} | {Inputs} | {Outputs} |

## Feedback Loops

| From | Condition | To |

User-provided domain knowledge:

domain_knowledge:
  criteria: [Scoring criteria, thresholds]
  categories: [Types, tiers, channels]
  sources: [Where to get data]
  constraints: [Rules, limits]

Process

For each stage in the stage map:

1. Define Activities - What happens in this stage:

  • Break into discrete activities
  • Each activity has inputs and outputs
  • Activities should be concrete actions, not vague descriptions

2. Create Context Tables - Reference information needed:

  • Categories, criteria, thresholds
  • Options, channels, sources
  • Any structured data the stage uses

3. Design Output Format - What the stage produces:

  • Create a template showing structure
  • Include placeholders for variable content
  • Make it specific enough to be useful

4. Set Quality Criteria - How to know if the stage is done well:

  • Checklist format (not prose)
  • Each criterion is verifiable
  • Cover completeness and correctness

5. Define Completion - What happens at stage end:

  • What to present to user
  • What approval is needed
  • What's the next stage

Interaction

Use the AskUserQuestion tool for:

  • Gathering domain-specific criteria and thresholds
  • Choosing between output format options
  • Confirming activity breakdowns per stage

Read the full file on GitHub · 155 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. 3d ago First seen · 155 lines · 10 tokens per session scan A c10194a3b213

Subscribe to this mod's changes

refine is a command published in the GitHub repository athrael-soju/framework-generator (2 stars, last pushed 6mo ago), licensed MIT. It adds 10 tokens to every session and 854 once invoked, about $0.0001 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.