Ship a plans-library skill in the plan-agent plugin that scans every HTML plan in the plans directory, reads each plan's status, type, title, and created date from its <meta> tags, and renders them into a single self-contained docs/plans/index.html gallery — filterable by status and type, searchable by title, and openable in the browser — mirroring the media-library skill from social-media-tools.
add-plans-library-to-plan-agent.html
docs/plans/add-plans-library-to-plan-agent.html
Context
The plan-agent plugin now emits every plan as a self-contained .html file in docs/plans/, each carrying machine-readable <meta> tags (plan-status, plan-type, plan-created, plan-repo) and a <title>. With 100+ plan files in that directory there is no way to browse or organise them without knowing exact filenames.
The sibling social-media-tools plugin already solves the identical problem for its cards: the media-library skill scans docs/media/social/*.html, parses each file, populates a static templates/gallery.html with one card per entry, writes index.html, and opens it in the browser. This plan ports that proven template-plus-skill pattern to plan-agent, adapting the data source (plan <meta> tags instead of filename parsing) and the filter dimensions (status + type instead of card type).
An existing todo plan, create-plans-index-page.html, describes a one-off bash-script index for this repo only. Per the chosen direction this plan supersedes it: instead of a repo-local script, we deliver a reusable plugin skill any plan-agent user can invoke. The old plan is marked superseded in Step 6.
Files
- new
kit/plugins/plan-agent/skills/plans-library/SKILL.md— the scanning & rendering skill - new
kit/plugins/plan-agent/templates/plans-gallery.html— static gallery template with placeholders - edit
.claude-plugin/marketplace.json— bump plan-agent0.10.0→0.11.0(MINOR: new skill) - edit
kit/plugins/plan-agent/CHANGELOG.md— add0.11.0entry - edit
kit/plugins/plan-agent/README.md— document the skill; update structure tree & Components - edit
kit/plugins/plan-agent/.claude-plugin/plugin.json— extend description to mention the library skill - edit
docs/plans/create-plans-index-page.html— mark superseded
Steps
plans-gallery.html templateSKELETON.html so the gallery matches the plans it indexes.Verify
data-status and data-type plus title search.{{GALLERY_ENTRIES}}, {{PLAN_COUNT}}, {{GENERATED_AT}} mirror media-library's contract.Verify
<a href="{filename}"> with data-status and data-type attributes; clicking a card opens the underlying plan file via a relative link.SKILL.md with the scan → parse → render → open workflowVerify
name: plans-library, a two-sentence description with a trigger phrase, and allowed-tools: Bash, Read, Write, ToolSearch, ExitPlanMode. Body covers: locate plans dir, scan *.html (exclude index.html and archive/), parse meta tags + title per file, build entries, substitute into template, write index.html, open in browser, then STOP.plansDirectory setting → docs/plans/ → default). The library must scan that same directory, and must never include docs/plans/archive/ (global + project search-exclusion rule) or the generated index.html.Verify
docs/plans/*.html, omits index.html, and does not descend into archive/. Plans missing a meta tag fall back gracefully (e.g. plan-type → untyped, title → filename).marketplace.json for relative-path plugins; CHANGELOG, README, and plugin.json description keep the plugin self-documenting.Verify
marketplace.json shows plan-agent 0.11.0; plugin.json has no version field; CHANGELOG has a 0.11.0 entry; README lists plans-library under Features, the structure tree, and Components; the .claude/settings.json marketplace-JSON validator passes.create-plans-index-page.html as supersededtodo would invite duplicate work on a now-redundant approach.Verify
<html data-status> and the plan-status meta) with a one-line note pointing to this plan / the plans-library skill.Acceptance Criteria
Verification
End-to-end: Load the plugin locally with claude --plugin-dir ~/devbox/agentics/kit/plugins/plan-agent, then trigger the skill (e.g. “browse my plans”). Confirm it scans docs/plans/, writes docs/plans/index.html, and opens it in the browser.
In the browser: Verify the card count matches ls docs/plans/*.html | grep -v index.html | wc -l; click a completed chip and confirm only completed plans remain; click a feature chip and confirm the set narrows further; type a known plan title into the search box and confirm a single card matches; click a card and confirm the underlying plan opens.
Regression: Re-run the skill and confirm index.html is regenerated (not duplicated) and is itself excluded from the next scan. Confirm no archive/ plans appear. Confirm the marketplace-JSON validator passes after the version bump.