rpi-refine

rpi-refine is a skill for Claude Code from microsoft/hve-core. It costs 64 tokens per session (2,652 once invoked), scanned A, original, MIT.

A post-implementation review process that looks for ways to remove, simplify, combine, or redesign parts of completed work.

In plain words
What is it for?
Use it to review code, tests, documentation, dependencies, architecture, error handling, performance, language versions, and configuration, then send findings to a plan or follow-up task.
Why use it?
It helps find unnecessary complexity after the main coding is done, instead of adding more wrappers or safeguards without a clear benefit.

Skill for Claude Code ✓ vendor

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions subagents.

Good fit Use it to review code, tests, documentation, dependencies, architecture, error handling, performance, language versions, and configuration, then send findings to a plan or follow-up task.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/hve-core/rpi-refine
About the project

HVE Core is a collection of agents, prompts, coding instructions, and skills for building repeatable software-development workflows with GitHub Copilot. It is intended for individuals and teams that want structured AI-assisted research, planning, implementation, and review, while the catalogue entries provide many of its reusable workflow components.

microsoft/hve-core · 1,652 stars · on GitHub

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 microsoft/hve-core --skill rpi-refine
Clone the repo
git clone --depth 1 https://github.com/microsoft/hve-core

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 rpi-refine

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/hve-core/rpi-refine/github.svg)](https://agentmods.dev/skills/microsoft/hve-core/rpi-refine)
Your own site
<a href="https://agentmods.dev/skills/microsoft/hve-core/rpi-refine"><img src="https://agentmods.dev/badge/skills/microsoft/hve-core/rpi-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 rpi-refine

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/hve-core/rpi-refine"><img src="https://agentmods.dev/badge/skills/microsoft/hve-core/rpi-refine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,652 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.00064 $0.02652
Opus 5.5 $0.00026 $0.01061
Sonnet 5.5 $0.00013 $0.00530
Haiku 4.5 $0.00006 $0.00265

Measured 11d ago against content hash f7d729d8058f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rpi-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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.github/skills/rpi/rpi-refine/SKILL.md · 85 lines

How it starts

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

RPI Refine

Goal

Produce one complete, human-readable subtractive refinement record after implementation finishes. Focus on what can be removed, simplified, or redesigned across everything the session worked on: code, tests, documents, domain language, dependencies, error boundaries, runtime performance, language versions, and configuration. Reject additive wrappers and speculative guards that do not cut complexity or prevent a concrete failure mode.

Read references/refinement.md for the four subtractive lenses, main-agent execution and targeted subagent lookups, depth tiers, outcome vocabulary, routing rules, conversation protocol, and per-finding walkthrough. Use templates/refinement-log.md as the canonical record skeleton.

Flow

  1. Resolve one task artifact set: current task-centered plan, changes record, relevant research, and changed workspace files. Use supplied paths, or the work's name and date: the task slug for a task's first work, or the name a later request's documents carry. Stop if multiple unrelated sets remain ambiguous.
  2. Resolve review depth. Use standard by default. Use surface when a parent session runs a bounded refinement check after a repeated loop introduced significant changes in the same session, or when the user asks for a surface pass. Use deep only when the user explicitly requests a deep review; do not infer deep from task size, complexity, or risk. Record depth and provenance.
  3. Resolve candidate decision participation: user-owned for standalone and manual RPI, agent-owned by default for a confirmed automatic RPI session, and user-retained when an automatic-session user keeps Review decisions. When the refinement record already exists, use its latest Parent Decision Record participation event. Record provenance.
  4. Confirm the plan, changes record, changed files, remaining work, follow-up items, and validation state form a clear review boundary. Inspect the refinement path. When a record exists, continue a started review from its saved record, and reuse a finished record unless the user asks for a new review or a parent session runs a surface pass after significant same-session loop changes.
  5. Start the review by creating the record skeleton from templates/refinement-log.md at .copilot-tracking/reviews/logs/{{YYYY-MM-DD}}/{{task_slug}}-refinement.md, named like the plan it reviews, or at the next numbered path such as {{task_slug}}-refinement-2.md for an explicit repeat or surface pass. Persist Scope and Evidence and Opening Refinement State with review execution started and append one participation event to Parent Decision Record. When parent state exists, record the refinement path before assessing lenses so readers and the canvas follow the record as it grows. Send the opening message defined in the reference.
  6. Assess the completed work yourself across the four subtractive lenses and active depth tier in references/refinement.md. Activate domain skills whose descriptions say they apply during review when they fit the touched stack; exclude this skill and other RPI lifecycle phase entrypoints.
    • The main agent owns and performs the refinement analysis, backward logic tracing, assumption and domain evaluation, cross-lens synthesis, and authoring of the -refinement.md record. Never offload whole review lenses or core refinement judgment to a lower-intelligence subagent.
    • When a dispatch tool is available and subagent direction allows subagents (auto by default, or guided by this skill, a coordinating Project, or the user), create and manage regular subagents strictly for narrow, bounded lookups as references/refinement.md defines, and verify every return at the cited files while keeping synthesis and judgment in the main agent.
    • When subagents are unavailable or subagents=none is set, run all lookups and all four lenses directly in the main agent without failing or skipping a gate.
    • Follow the surface, standard, or deep boundary in references/refinement.md; deep remains a single review pass without open-ended external research.
  7. Write the evidence body as each lens finishes, saving the record as findings are verified while execution stays started. Record each confirmed RF-xxx finding with its dimension, current state, what to remove or rework, impact, resolution condition, and proposed destination. Once all lenses are merged, write the assessed execution status, assessed outcome, validation coverage, kept-as-is summary, limitations, and reviewer self-check, then update review execution from started to Complete, Partial, or Blocked.
  8. Resolve every actionable RF-xxx according to decision participation. Treat Decision History within ## Parent Decision Record as the append-only canonical decision log using stable FD-xxx event IDs. Append events for participation, walkthrough, execution, outcome, route dispositions, and continuation; never rewrite or delete earlier events. Refresh Current Disposition from those events.
    • For user-owned or user-retained, walk through each actionable finding one at a time as references/refinement.md defines, and persist each answer before moving to the next finding. A user-retained automatic session remains automatic and resumes once decisions are recorded.
    • For agent-owned, skip per-item prompts, record the walkthrough as skipped-auto, and decide every proposal from evidence.
  9. Decide final execution and outcome from the verified findings and resolved or deferred routes, appending those events to ## Parent Decision Record without rewriting the evidence body. When parent state exists, update derived next_action and accepted follow-up projections only after saving the canonical record.
  10. Route each accepted finding once to rpi-plan, rpi-implement, rpi-research, or follow-up as references/refinement.md defines (feeding in-session rpi-plan routes into new Pxx phases on the active plan, or into a separate RPI session for broader rework).
  11. Persist and finalize the complete canonical refinement record before presenting handoff guidance or ## Next Steps, then close with the Final response.

Read the full file on GitHub · 85 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 85 lines · 64 tokens per session scan A f7d729d8058f

Subscribe to this mod's changes

rpi-refine is a skill published in the GitHub repository microsoft/hve-core (1,652 stars, last pushed today), licensed MIT. It adds 64 tokens to every session and 2,652 once invoked, about $0.0003 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-11-20.

Related

rpi-refine compared with skills from other repositories

rpi-refine next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rpi-refinemicrosoft/hve-coreSkill1.7ktodayMITA64Claude Code
autoreviewopenclaw/clawhubSkill9.6ktodayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.2ktodayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k9d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5k2d agoMITA65Claude Code
revdiff-planumputun/revdiffSkill9742d agoMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5ktodayMITA51Claude Code, Codex