From humanize
Refines an annotated implementation plan by extracting and processing comments, then generates a QA ledger document.
How this command is triggered — by the user, by Claude, or both
Slash command
/humanize:refine-plan --input <path/to/annotated-plan.md> [--output <path/to/refined-plan.md>] [--qa-dir <path/to/qa-dir>] [--alt-language <language-or-code>] [--discussion|--direct]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Refine Annotated Plan Read and execute below with ultrathink. ## Hard Constraint: Planning-Only Refinement This command MUST ONLY refine plan artifacts. It MUST NOT implement repository code, modify source files unrelated to the plan outputs, start RLCR automatically, or create a new plan schema. Permitted writes are limited to: - The refined plan output file (`--output`, or `--input` in in-place mode) - The QA document under `--qa-dir` - Optional translated language variants for the refined plan and QA document The refined plan MUST reuse the existing `gen-plan` schema. Do not inven...
Read and execute below with ultrathink.
This command MUST ONLY refine plan artifacts. It MUST NOT implement repository code, modify source files unrelated to the plan outputs, start RLCR automatically, or create a new plan schema.
Permitted writes are limited to:
--output, or --input in in-place mode)--qa-dirThe refined plan MUST reuse the existing gen-plan schema. Do not invent new top-level sections. Keep required sections intact, preserve optional sections when present, and preserve any --- Original Design Draft Start --- appendix or other non-comment content unless a comment explicitly requires a plan-level change there.
Sequential Execution Constraint: Execute the phases strictly in order. Do NOT parallelize work across phases. Finish each phase before moving to the next one.
alternative_plan_language and mode defaults using config-loader.sh semanticsvalidate-refine-plan-io.shCMT:/ENDCMT, <cmt>/</cmt>, <comment>/</comment>)gen-plan structureParse $ARGUMENTS and set the following variables:
INPUT_FILE from --input (required)OUTPUT_FILE from --outputQA_DIR from --qa-dirCLI_ALT_LANGUAGE_RAW from --alt-languageREFINE_PLAN_MODE_DISCUSSION=true if --discussion is presentREFINE_PLAN_MODE_DIRECT=true if --direct is presentArgument rules:
--input <path> is required.--output <path> is optional. If omitted, set OUTPUT_FILE=INPUT_FILE for in-place mode.--qa-dir <path> is optional. If omitted, set QA_DIR=.humanize/plan_qa.--alt-language <language-or-code> is optional. If present without a value, report Invalid arguments: --alt-language requires a value and stop.--discussion and --direct are mutually exclusive. If both are present, report Cannot use --discussion and --direct together and stop.Derived paths:
IN_PLACE_MODE=true when OUTPUT_FILE equals INPUT_FILE; otherwise false.QA_FILE from the input basename, not the output basename:
plan.md becomes <QA_DIR>/plan-qa.mddocs/my-plan.md becomes <QA_DIR>/my-plan-qa.mdplan becomes <QA_DIR>/plan-qa.md--alt-language out of the validator invocation because validate-refine-plan-io.sh does not accept it. Pass only:
--input--output when provided--qa-dir when provided--discussion or --direct when providedScope rules for v1:
--language or --qa-outputResolve configuration by following the same precedence and merge semantics defined in ${CLAUDE_PLUGIN_ROOT}/scripts/lib/config-loader.sh. Reuse that behavior; do not invent a separate refine-plan config model.
Use the same layer order as load_merged_config:
${CLAUDE_PLUGIN_ROOT}/config/default_config.json${XDG_CONFIG_HOME:-$HOME/.config}/humanize/config.json${HUMANIZE_CONFIG:-$PROJECT_ROOT/.humanize/config.json}Later layers override earlier layers. Malformed optional JSON objects are treated as warnings and ignored. A malformed required default config is a fatal configuration error.
Read the merged config and resolve:
CONFIG_ALT_LANGUAGE_RAW from alternative_plan_languageCONFIG_GEN_PLAN_MODE_RAW from gen_plan_modeResolve REFINE_PLAN_MODE with this priority:
--discussion => discussion--direct => directgen_plan_mode (discussion or direct, case-insensitive)discussionIf gen_plan_mode is present but invalid, log a warning and fall back to the next rule.
Resolve the variant language with this priority:
--alt-languagealternative_plan_languageNormalize the value case-insensitively using this mapping table:
| Language | Code | Suffix |
|---|---|---|
| Chinese | zh | _zh |
| Korean | ko | _ko |
| Japanese | ja | _ja |
| Spanish | es | _es |
| French | fr | _fr |
| German | de | _de |
| Portuguese | pt | _pt |
| Russian | ru | _ru |
| Arabic | ar | _ar |
Normalization rules:
English / en as a no-op: no translated variant is generated.Unsupported --alt-language "<value>" and stop.Set:
ALT_PLAN_LANGUAGE to the normalized language name or empty stringALT_PLAN_LANG_CODE to the normalized code or empty stringDo not depend on deprecated chinese_plan. refine-plan only uses alternative_plan_language.
Run the validator with the parsed arguments, excluding --alt-language:
"${CLAUDE_PLUGIN_ROOT}/scripts/validate-refine-plan-io.sh" <validated-arguments>
Handle exit codes exactly:
Input file not found and stopInput file is empty and stopInput file has no comment blocks and stopInput file is missing required gen-plan sections and stopOutput directory does not exist or is not writable - please fix it and stopQA directory is not writable and stopInvalid arguments and show the validator usage, then stopValidation notes:
validate-refine-plan-io.sh may create QA_DIR when it does not exist. Treat that as expected setup, not as a side effect to undo.ORIGINAL_PLAN_TEXT.Extract comments using a stateful scanner equivalent to POSIX awk wrapped by bash, not a naive regular expression pass. The scanner behavior must match the Task 3 findings.
Track these states while scanning the validated input in document order:
IN_FENCE with the active fence marker (``` or ~~~)IN_HTML_COMMENT for <!-- ... -->IN_CMT_BLOCKNEAREST_HEADINGExtraction rules:
CMT: as start marker and ENDCMT as end marker<cmt> as start marker and </cmt> as end marker<comment> as start marker and </comment> as end markerText before CMT: comment text ENDCMT text afterText before <cmt>comment text</cmt> text afterText before <comment>comment text</comment> text afterCMT:
comment text
ENDCMT
<cmt>
comment text
</cmt>
<comment>
comment text
</comment>
NEAREST_HEADING whenever a Markdown heading is encountered outside fenced code and HTML comments.CMT-1, CMT-2, ... only for non-empty blocks.For each non-empty comment block, capture:
id (CMT-N)original_text exactly as written between the comment markersnormalized_text with surrounding whitespace trimmedstart_line, start_columnend_line, end_columnnearest_heading or Preamble when no heading exists yetlocation_label for QA outputform = inline or multilinecontext_excerpt from the nearest non-comment source textThese are fatal extraction errors:
Every fatal parse error MUST report:
Examples of acceptable messages:
Comment parse error: nested comment block at line 48, column 3 near "## Acceptance Criteria" (context: "<cmt>split AC-2...")Comment parse error: stray comment end marker at line 109, column 1 near "## Task Breakdown" (context: "</comment>")Comment parse error: missing end marker for block opened at line 72, column 5 near "## Dependencies and Sequence"Produce:
EXTRACTED_COMMENTS: ordered list of comment recordsPLAN_WITH_COMMENTS_REMOVED: the original plan text with every valid comment block removed and surrounding inline text preservedIf EXTRACTED_COMMENTS is empty after removing no-op blocks, report No non-empty CMT blocks remain after parsing and stop.
Classify every extracted comment for downstream handling.
Each raw comment block must receive exactly one primary classification:
questionchange_requestresearch_requestUse these heuristics first:
question: asks why, how, what, explain, clarify, or says the plan is unclearchange_request: asks to add, remove, delete, rewrite, restore, rename, split, merge, or otherwise modify the planresearch_request: asks to investigate the repository, compare existing patterns, confirm current behavior, or gather evidence before decidingWhen more than one intent appears in the same raw block:
CMT-N)CMT-N.1, CMT-N.2, ...research_requestchange_requestquestionIf classification is still ambiguous after applying the heuristics:
discussion mode: use AskUserQuestion to confirm the classification before continuingdirect mode: choose the most action-driving interpretation and record the assumption in the QA documentExamples:
Why do we need two config layers here? => questionDelete task5 and fold its work into task4. => change_requestInvestigate how config loading works in this repo before deciding whether AC-3 should change. => research_request, or split into research plus follow-up change sub-items if the block clearly contains both intentsFor each raw comment block and any sub-items, record:
idparent_id when applicableclassificationclassification_rationaleneeds_user_confirmation (true or false)resolved_via_discussion (true or false)Process comments in document order. When a raw block has sub-items, process the sub-items in order before moving to the next raw block.
questionDefault behavior:
Preferred destinations for light clarification:
## Goal Description## Feasibility Hints and Suggestions## Dependencies and Sequence## Implementation Noteschange_requestDefault behavior:
gen-plan structure intact.Consistency obligations:
-Claude-Codex Deliberation and Pending User Decisions reflect the new statecoding or analyzeresearch_requestDefault behavior:
Read, Glob, and Grep.DEC-N item in ## Pending User Decisions and record the same decision in the QA document.CMT-N must end with one disposition:
answeredappliedresearcheddeferredresolveddiscussion mode, ask only the minimum necessary questiondirect mode, make the smallest safe assumption, mark it explicitly in QA, and add a pending decision when the assumption materially affects the planpartially_convergedconvergedStarting from PLAN_WITH_COMMENTS_REMOVED, apply the accepted refinements from Phase 4 and produce REFINED_PLAN_TEXT.
The refined plan MUST retain these required sections:
## Goal Description## Acceptance Criteria## Path Boundaries## Feasibility Hints and Suggestions## Dependencies and Sequence## Task Breakdown## Claude-Codex Deliberation## Pending User Decisions## Implementation NotesOptional sections that MUST be preserved when present in the input:
## Codex Team Workflow## Convergence Log--- Original Design Draft Start --- appendix and its matching end markerAC-X / AC-X.Y formatting.coding or analyze.Determine the primary language of the input plan after comment removal.
Rules:
discussion mode, ask the user whether to keep the current mix or normalize to the dominant languagedirect mode, keep the dominant language inferred from headings and body text; if still tied, default to EnglishALT_PLAN_LANGUAGE resolves to the same language as the main language, skip variant generation.Before generating the QA document, verify:
AC-* exists-coding or analyze## Pending User Decisions and ### Convergence Status agree with the actual unresolved stateIf a validation issue can be fixed by reconciling the plan, fix it before continuing. If it cannot be fixed without inventing requirements, stop and report the blocking inconsistency.
Read ${CLAUDE_PLUGIN_ROOT}/prompt-template/plan/refine-plan-qa-template.md and populate it completely. The QA document is not optional.
Populate all template sections:
## Summary## Comment Ledger## Answers## Research Findings## Plan Changes Applied## Remaining Decisions## Refinement MetadataThe Comment Ledger MUST contain exactly one row per raw CMT-N extracted in Phase 2, in document order.
Each row must include:
CMT-IDIf a raw block was split into processing sub-items, keep one ledger row for the raw ID and describe the sub-item handling in the detailed sections.
Answers: include all question items and any clarifying edits made to the planResearch Findings: include all research_request items, the files or patterns examined, and the impact on the planPlan Changes Applied: include all change_request items and cross-reference updatesRemaining Decisions: include every unresolved or assumption-heavy item that still needs user choiceLanguage rules:
REFINED_PLAN_TEXTAC-*, task IDs, file paths, API names, command flags, config keysMetadata rules:
converged or partially_convergedDo not write any final output until all content is fully prepared.
Always prepare:
OUTPUT_FILEQA_FILEConditionally prepare:
OUTPUT_FILE with _<ALT_PLAN_LANG_CODE> inserted before the extensionQA_FILE with _<ALT_PLAN_LANG_CODE> inserted before the extensionFilename construction rule for variants:
_<code> before the last ._<code>Examples:
plan.md -> plan_zh.mdfeature-a-qa.md -> feature-a-qa_zh.mdoutput -> output_zhIf ALT_PLAN_LANGUAGE is non-empty and different from the main language:
ALT_PLAN_LANGUAGEALT_PLAN_LANGUAGEIf ALT_PLAN_LANGUAGE is empty or equals the main language, do not create variant files.
REFINED_PLAN_TEXTQA_TEXTREFINED_PLAN_VARIANT_TEXTQA_VARIANT_TEXT.refine-plan-XXXXXX.refine-qa-XXXXXX.refine-plan-variant-XXXXXX.refine-qa-variant-XXXXXXSuccess condition:
Report:
discussion or direct modeIf a blocking issue occurs:
If a user decision is needed in discussion mode:
## Pending User DecisionsIf a decision is deferred in direct mode:
partially_converged when the deferred item materially affects implementation directionnpx claudepluginhub guapisolo/humanize --plugin humanize8plugins reuse this command
First indexed Apr 30, 2026
Showing the 6 earliest of 8 plugins
/refine-planRefines an annotated implementation plan by extracting and processing comments, then generates a QA ledger document.
/planrefineDeeply critiques and refines an existing plan file or content with code verification, applying TDD/DRY/SOLID principles and task management rules.
/iterate_planReads an existing implementation plan, researches codebase realities via sub-tasks, and revises the plan scope, phases, or criteria based on user feedback.
/create_planCreates detailed implementation plans interactively by researching tickets, task descriptions, and codebase using specialized analysis agents.
/deepen-planEnhances an existing plan file with parallel research agents for each section, adding best practices, optimizations, implementation details, and real-world examples.
/refine-planPlans small-scale modifications to existing code or documentation by identifying target files, surveying impact scope, and outputting a plan file consumable by refine-execute.