refine

refine is a command for coding agents from MostAshraf/ai-sdlc-harness. It costs 0 tokens per session (568 once invoked), scanned A, original, MIT.

An interactive command for restructuring a work item section by section into a standard user-story format. It pauses for confirmation as it works through the content.

In plain words
What is it for?
It is for collaboratively refining a work item when its context, description, acceptance criteria, or scope needs careful discussion.
Why use it?
It provides a deliberate way to resolve complex or disputed requirements instead of rewriting the whole story in one pass.

Command

Part of the ai-sdlc-harness plugin — 8 skills, 4 commands, 3 agents, 4 hooks 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/mostashraf/ai-sdlc-harness/refine
Clone the repo
git clone --depth 1 https://github.com/MostAshraf/ai-sdlc-harness

Or install ai-sdlc-harness, the plugin that ships this one along with the rest of its 8 skills, 4 commands, 3 agents, 4 hooks.

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/mostashraf/ai-sdlc-harness/refine.svg)](https://agentmods.dev/commands/mostashraf/ai-sdlc-harness/refine)
Your own site
<a href="https://agentmods.dev/commands/mostashraf/ai-sdlc-harness/refine"><img src="https://agentmods.dev/badge/commands/mostashraf/ai-sdlc-harness/refine.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 568 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.00000 $0.00568
Opus 5 $0.00000 $0.00284
Sonnet 5 $0.00000 $0.00114
Haiku 4.5 $0.00000 $0.00057

Measured 5d ago against content hash 02a66e98d028, 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 5d 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.

skills/story-workflow/commands/refine.md · 45 lines

How it starts

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

/story-workflow refine

Interactive, section-by-section restructuring of a story into the canonical template through a collaborative conversation. Slower than improve on purpose.

For most sessions improve is the better choice. Reach for refine when a story is complex or contentious and you want to work through it one section at a time, confirming each before moving on.

Steps

  1. Fetch the work item per shared/provider-io.md (title, description, acceptance criteria, state, links).
  2. Session notes: if the user passed notes after the id, use them. If not, ask once: "Any notes from the refinement session — bullet points, rough notes, decisions? If not, I'll work from the work item." Notes capture PO clarifications and scope calls that never made it into the item.
  3. Load templates/story-template.md (the target format) and, for terminology, shared/context.md.
  4. Work the template one section at a time, proposing content and getting approval before moving on:
    • Context — draft the business "why"; ask if it's captured correctly.
    • Description — one As a … I want … so that …. If it spans multiple capabilities, flag a possible split before continuing.
    • Acceptance Criteria — draft Given/When/Then, happy path first then error/edge cases; present them together and ask what's missing.
    • Out of Scope — propose explicit exclusions from the notes and context; ask what else to exclude.
    • Open Questions — collect unresolved items, tag each [PO] / [Tech] / [Team], ask if any remain.
    • Technical Notes — leave empty; it's populated by groom. If the user volunteers technical context, note it but say the full analysis is groom.
  5. Assemble the complete story and present it whole for a final review.
  6. Post on approval per shared/provider-io.md — a comment on remote providers; for local-markdown, offer the in-place overwrite of the source file (this command is one of the two that may rewrite a story in place).

Read the full file on GitHub · 45 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. 5d ago First seen · 45 lines · 0 tokens per session scan A 02a66e98d028

Subscribe to this mod's changes

refine is a command published in the GitHub repository MostAshraf/ai-sdlc-harness (18 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 568 tokens. 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.