Implementation Plan

Add markdown plan conversion to implementation-plan

completed
2026-06-12 agentics feature

Teach /plan-agent:implementation-plan to accept a markdown plan path and convert it natively into the HTML implementation-plan format — the exact pipeline proven manually in the skill-box plan conversion session, promoted to a first-class skill capability (plan-agent 2.2.0).

Implement Read and implement all steps in the plan at docs/plans/add-md-plan-conversion-to-implementation-plan.html — Teach implementation-plan to convert markdown plans to HTML natively
File add-md-plan-conversion-to-implementation-plan.html
Path docs/plans/add-md-plan-conversion-to-implementation-plan.html
Acceptance criteria 5 / 5 done

Context

The implementation-plan skill's argument parser recognized only issue references (#n, GitHub/GitLab URLs) and .html plan-file tokens. When a user passed a markdown plan path — "convert docs/plans/distribute-skills-via-skill-box-catalog.md into an HTML implementation plan" — the path fell through to plain objective text, and the conversion semantics had to be improvised in-session: treating the source as authoritative, skipping Clarify/Align/Interview on pre-validated content, preserving frontmatter, swapping the extension, and asking whether to keep or remove the source.

That improvised run also surfaced a recovery path worth encoding: the markdown had landed on origin/main (via a merged PR) after the working tree last updated, so the file looked missing until a fetch + fast-forward recovered it. This change formalizes the whole flow as conversion mode$MD_SOURCE detection, resolution order (cwd → plan roots → default branch), implied --no-clarify --no-align --no-interview, 1:1 section mapping, frontmatter carry-over, and the Step 8 keep-or-remove source question — so the next markdown conversion needs zero improvisation.

Files to Modify

agentics/
  • kit/plugins/plan-agent/
    • CHANGELOG.md modified 2.2.0 entry for conversion mode
    • README.md modified document the plan.md argument and conversion semantics
    • skills/implementation-plan/SKILL.md modified $MD_SOURCE detection + conversion mode defaults
  • .claude-plugin/marketplace.json modified plan-agent 2.1.0 → 2.2.0 + description
  • CLAUDE.md modified plugin table row notes .md conversion
  • docs/plans/add-md-plan-conversion-to-implementation-plan.html new this plan — committed with the change

Steps

1
todo Add markdown conversion detection and conversion-mode defaults to SKILL.md
The parser needs a third token type: a first non-flag token ending in .md sets $MD_SOURCE and enters conversion mode. The block defines resolution order (cwd → plan roots by basename → default branch via fetch/fast-forward or git show), a graceful AskUserQuestion fallback that never invents content under a conversion label, implied --no-clarify --no-align --no-interview, 1:1 section mapping, frontmatter carry-over (created preserved; plannedtodo), extension-swap output naming, the conversion-mode echo, and the Step 8 keep-or-remove source question.
Verify
grep -c 'MD_SOURCE' kit/plugins/plan-agent/skills/implementation-plan/SKILL.md returns ≥ 3; the file stays under the 500-line skill-authoring cap (wc -l).
2
todo Advertise the trigger in frontmatter and parsing rules
Model-path activation depends on the description ("convert a markdown plan into an HTML implementation plan"); command-path discoverability depends on argument-hint (<plan.md>). The model-invocation paragraph and the Objective bullet must also name the new token type so derived text routes through the same detection.
Verify
grep 'plan.md' …/SKILL.md hits the argument-hint; grep 'convert a markdown plan' …/SKILL.md hits the description; the Objective bullet lists the .md conversion source token.
3
todo Bump plan-agent to 2.2.0 in .claude-plugin/marketplace.json
New capability on an existing skill = MINOR per the marketplace versioning rules; the value must be higher than 2.1.0 on main. The plugin description also gains a clause so the marketplace listing advertises conversion mode.
Verify
python3 -c "import json; print([p['version'] for p in json.load(open('.claude-plugin/marketplace.json'))['plugins'] if p['name']=='plan-agent'][0])" prints 2.2.0; the settings hook validates the JSON on write.
4
todo Add the 2.2.0 entry to kit/plugins/plan-agent/CHANGELOG.md
Project convention: every plugin change ships a changelog entry. The entry documents $MD_SOURCE detection, conversion-mode defaults, and the docs updates, matching the existing Keep-a-Changelog-style format.
Verify
head -5 kit/plugins/plan-agent/CHANGELOG.md shows the 2.2.0 — Markdown plan conversion heading above 2.1.0.
5
todo Document usage in the plugin README.md and the repo CLAUDE.md plugin table
The README's invocation syntax, examples, and overview must show the <plan.md> form and explain conversion-mode behavior (PR checklist requires README coverage); the CLAUDE.md plugin table row keeps repo-level guidance accurate.
Verify
grep 'conversion mode' kit/plugins/plan-agent/README.md and grep 'conversion to HTML' CLAUDE.md both return hits; the README example block includes a .md invocation.

Tests

Tier 2 — Non-code plan (markdown skill instructions + manifest metadata)
Objective Conversion contract is declared and versioned

File: none committed — spec smoke run from the repo root (skills have no executable test harness; behavior is exercised by the manual smoke in Verification)

Type: smoke test

Asserts: the skill declares $MD_SOURCE detection and conversion-mode defaults, advertises the trigger in argument-hint, and ships as plan-agent 2.2.0 with a matching changelog entry.

Run: grep -q 'MD_SOURCE' kit/plugins/plan-agent/skills/implementation-plan/SKILL.md && grep -q 'plan.md' kit/plugins/plan-agent/skills/implementation-plan/SKILL.md && grep -q '2.2.0' kit/plugins/plan-agent/CHANGELOG.md && python3 -c "import json; assert [p['version'] for p in json.load(open('.claude-plugin/marketplace.json'))['plugins'] if p['name']=='plan-agent'][0]=='2.2.0'" && echo PASS

Acceptance Criteria

Verification

  1. Run the objective spec smoke from the Tests section — it prints PASS.
  2. wc -l kit/plugins/plan-agent/skills/implementation-plan/SKILL.md — under the 500-line skill-authoring cap.
  3. Manual smoke (fresh session, plugin loaded): /plan-agent:implementation-plan docs/plans/<any>.md — the run echoes Conversion mode: <md path> → <html path>, skips Clarify/Align/Interview, writes the .html beside the source with frontmatter carried over, and Step 8 offers the keep-or-remove source question.
  4. Model-path smoke: ask "convert docs/plans/<any>.md into an HTML implementation plan" without the slash command — the skill auto-activates into conversion mode.

Completion Checklist

Required

Completion Report

No items to report — all requirements met.

Next Steps

Fixture-based conversion smoke test

Paste this prompt into Claude to execute this follow-up:

In the agentics repo, the plan-agent implementation-plan skill (kit/plugins/plan-agent/skills/implementation-plan/SKILL.md) supports conversion mode: passing a .md plan path produces an HTML implementation plan. Add an automated smoke for the conversion contract: a fixture markdown plan under tests/fixtures/ (frontmatter with status + created, Context/Objective/Steps/Verification sections) and a shell or .mjs test under tests/ that asserts the SKILL.md conversion contract strings exist (MD_SOURCE detection, implied --no-clarify --no-align --no-interview, frontmatter carry-over, extension swap) and that the fixture parses cleanly. Follow the existing tests/publish/ pass/fail-counter style, wire nothing into CI workflows without asking, and report what you added.