From claude-refine
Runs automatically after a plan is approved that references a .claude-refine/ promoted spec. Triggered by the claude-refine plugin's PostToolUse hook on ExitPlanMode. Captures plan-time mind-changes back into the spec under 'Updates After Planning'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-refine:-internal-post-planThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill runs after the user approves a plan (via `ExitPlanMode`) that references a promoted `.claude-refine/<file>.md` spec. It captures product-level mind-changes the user made during planning back into that spec.
This skill runs after the user approves a plan (via ExitPlanMode) that references a promoted .claude-refine/<file>.md spec. It captures product-level mind-changes the user made during planning back into that spec.
The hook injects two paths into the invocation reason: PLAN_FILE (the approved plan in ~/.claude/plans/) and SPEC_FILE (the referenced promoted markdown). Use those exact paths.
Read inputs. Read PLAN_FILE and SPEC_FILE. If either is missing or unreadable, stop and tell the user — do not invent content.
Parse the spec's fixed sections. The spec follows a fixed structure: Problem Statement, Target User, Core Functionality, Out of Scope, Success Criteria, Codebase Context (optional), Assumptions, Open Questions. Section order and headings are stable; rely on ## markers.
Detect deltas. Compare the plan against the spec and produce two lists:
Strict exclusions (these are NOT deltas):
No-op case. If both lists are empty, do not modify the spec. Tell the user in one sentence: Plan was consistent with `<SPEC_FILE>` — no updates. Then immediately resume executing the approved plan in the same turn — skip the remaining steps below.
Get the timestamp. Run date '+%Y-%m-%d %H:%M' via the Bash tool. Use the exact stdout — do not reformat from memory.
Append the section. In SPEC_FILE:
If ## Updates After Planning does not exist, append it at the end of the file, preceded by a blank line.
Under that heading, append a new subsection (do not modify or replace earlier subsections):
### <YYYY-MM-DD HH:MM> — from plan <basename of PLAN_FILE>
**Contradictions to refined content:**
- **[Spec section]:** Originally [what the spec said]. Plan diverges to [what the plan does]. Reason: [if discernible from plan, else omit "Reason"].
**New decisions made during planning:**
- **[Topic]:** [Decision]. Reason: [rationale from plan, else omit "Reason"].
Omit either bullet group entirely if its list is empty. Use exactly one blank line between the subsection heading, the bold group labels, the bullet lists, and any following subsections.
Confirm and continue. One to three sentences stating the spec path that was updated and how many contradictions and new decisions were captured. Then, in the same turn, immediately resume executing the approved plan — the user has already approved it and is not expected to prompt you again. Do not ask for confirmation or wait for further input.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub carlosas/claude-refine --plugin claude-refine