Teach the existing implementation-plan skill to convert an existing markdown plan into a full, interactive HTML implementation plan — auto-detecting a .md source token, transcribing every section into the rich skeleton, and enriching thin areas through the built-in interview — so one skill both generates and converts plans without a second skill.
Read and implement all steps in the plan at docs/plans/add-markdown-plan-conversion.html — Add markdown-source conversion to the implementation-plan skill
add-markdown-plan-conversion.html
docs/plans/add-markdown-plan-conversion.html
Context
The plan-agent plugin already turns an objective into a rich interactive HTML plan via the implementation-plan skill, and it already accepts alternate input sources — GitHub/GitLab issue refs (#n) and .html revision files ($PLAN_FILE). What it cannot do is take an existing markdown plan (the SKELETON.md shape: Context, Objective, Steps with Why/Verify, Acceptance Criteria, Verification, Next Steps, Unresolved Questions) and produce the same full HTML plan. The repo holds many such markdown plans under docs/plans/*.md.
The conversion maps almost 1:1: every SKELETON.md section has a matching placeholder in SKELETON.html ({context}, {objective}, {step-N-action}/{step-N-why}/{step-N-verify}, {criterion-N}, {end-to-end-verification}, {next-step-N-*}, {question-N-*}). The existing plan-interview:markdown-to-html skill only emits a generic render — it does not produce the interactive plan-agent format (step chips, acceptance checkboxes, implement prompt, completion checklist), so a real gap remains. Per the decision to keep one skill, this work adds a markdown-source input mode to implementation-plan rather than creating a second skill, reusing the entire downstream pipeline (frontmatter, browser render, implement/edit/exit). Fidelity is transcribe + enrich: faithfully map the markdown, then run the built-in interview to deepen thin steps and criteria.
Files to Modify
- .claude-plugin/
marketplace.jsonmodified bump plan-agent 1.7.0 → 1.8.0; update description- kit/plugins/plan-agent/
- .claude-plugin/
plugin.jsonmodified update description to mention markdown-source conversion- skills/implementation-plan/
SKILL.mdmodified .md detection, Step 0.6 ingestion, mapping table, conversion branch, argument-hintCHANGELOG.mdmodified add v1.8.0 entryREADME.mdmodified document the markdown-source input mode
Conversion Mapping
| Markdown source (SKELETON.md) | HTML target (SKELETON.html) |
|---|---|
YAML frontmatter status / type / created / repo-name | <meta> tags + {status} / {type} / {created} / {repo-name} |
# Plan: <title> | {title} + <title> |
## Context | {context} |
## Objective | {objective} |
## Steps — n. action — Why: … Verify: … | {step-N-action} / {step-N-why} / {step-N-verify} |
## Acceptance Criteria — - [ ] items | {criterion-N} + {criteria-count} |
## Verification | {end-to-end-verification} |
## Next Steps — label + fenced text prompt | {next-step-N-label} / {next-step-N-prompt} |
## Unresolved Questions — label + fenced prompt | {question-N-label} / {question-N-prompt} |
| source filename basename | <meta name="plan-source"> (provenance) |
Steps
.md source token in argument parsing. Extend the "Plan file reference detection" block in SKILL.md so a first non-flag token ending in .md is captured as $MD_SOURCE, mirroring the existing .html → $PLAN_FILE rule: reduce to basename, resolve only against the plan roots (--dir / plansDirectory / docs/plans/), and fall back to AskUserQuestion when the file can't be read.
.html revision files, so /plan-agent:implementation-plan some-plan.md parses cleanly without the filename polluting the objective.Verify
SKILL.md: the detection paragraph names .md → $MD_SOURCE with basename path-safety and graceful fallback, evaluated before objective extraction and after issue-ref detection.$MD_SOURCE is set, read the file and parse each SKELETON.md section into planning-input variables (title, context, objective, steps[] with action/why/verify, criteria[], verification, next-steps[], questions[], and frontmatter status/type/created), HTML-escaping every captured value at capture time.
& < > " ') prevents injection from arbitrary markdown content.Verify
docs/plans/harden-plan-documenter-completion-guard.md, which uses Context/Objective/Steps/Verification headings matching SKELETON.md) and confirm each parsed section appears in the resolved inputs with special characters escaped.SKILL.md near the new Step 0.6 — markdown section → HTML placeholder/meta-tag, covering frontmatter, title, Context, Objective, Steps (action/why/verify), Acceptance Criteria, Verification, Next Steps, and Unresolved Questions.
SKELETON.md and SKELETON.html as either evolves.Verify
SKELETON.md section mapped to its {placeholder} / <meta> target with no section left unmapped (matches the Conversion Mapping table in this plan).$MD_SOURCE path: the objective and section content come from the parsed file (not generated); Explore/Clarify act as enrichment only (confirm files/symbols the plan references still exist); the output filename derives from the source basename (foo.md → foo.html), re-validated against the verb-target convention and renamed if non-descriptive.
Verify
<meta name="plan-source" content="<basename>.md"> to Step 3 frontmatter for provenance.
Verify
plan-source meta, reflects interview-added detail, and flags (--type, --priority, --no-interview) still override the source frontmatter.marketplace.json plan-agent 1.7.0 → 1.8.0 (a MINOR — new capability), update its description and plugin.json description to mention markdown-source conversion, add a v1.8.0 CHANGELOG.md entry, and update README.md plus the SKILL argument-hint to show the <plan.md> source form.
marketplace.json only, never plugin.json.Verify
marketplace.json shows 1.8.0 (and no version in plugin.json); CHANGELOG.md has the v1.8.0 entry; argument-hint and README.md mention the .md source.Acceptance Criteria
Verification
End-to-end: run /plan-agent:implementation-plan harden-plan-documenter-completion-guard.md against an existing conforming markdown plan in docs/plans/ (this file uses Context/Objective/Steps/Verification headings matching SKELETON.md). Confirm the skill (1) auto-detects the .md token as the source, (2) parses every section into the skeleton, (3) renders the result in the browser via Step 7 with all sections populated and HTML-escaped, (4) names the output harden-plan-documenter-completion-guard.html (source basename), (5) carries the source frontmatter plus a plan-source meta tag, and (6) presents the Step 8 implement/edit/exit menu unchanged. Then re-read SKILL.md end-to-end to confirm no second skill was introduced and the conversion path is a branch of the existing workflow. Finally verify marketplace.json shows 1.8.0, plugin.json has no version, and the CHANGELOG/README/argument-hint all mention the markdown source.
Completion Checklist
Completion Report
No items to report — all requirements met.