/plan-agent:plan-maintenance [--archive] [--index] [--variants] [--all] [--background] — run one or more maintenance sub-workflowsfrom plan-agent
Archive completed plans as HTML, generate a README index, and review variant/duplicate files
Ships in plan-agent. Installing the plugin adds it to Claude Code.
Archive completed plans as browsable HTML, generate a directory index, and surface variant/duplicate files for cleanup. Sub-workflows run with user confirmation gates between each.
Check $ARGUMENTS for flags:
--archive — run the archive sub-workflow--index — run the index sub-workflow--variants — run the variant review sub-workflow--all — run all three in order: variants → archive → index--background — when combined with --archive or --all, spawn the
rendering loop as a background agentIf no flag is provided, default to --all.
Resolve the plans directory using the same priority as update-plan-status:
plansDirectory: Read the "plansDirectory" key following
Claude Code's settings precedence — project-local .claude/settings.local.json,
then project .claude/settings.json, then global ~/.claude/settings.json.
Use the first that sets it.${PWD}/docs/plans/.Use TodoWrite to create a todo for each active sub-workflow. Mark each
status: "completed" as you finish it.
--variants)When --all is active, this runs first — consolidate before archiving.
Glob all *.md and *.html files in the plans directory. Scan filenames for:
-alt, -revised, -v\d+ (e.g.,
-v2, -v2.3), or -review.htmlmake-deep-grill-default-yes.md and make-deep-grill-optional.md share
the prefix make-deep-grill.For each cluster, output:
Cluster: "make-deep-grill" (3 files)
1. make-deep-grill-default-yes.md status: completed created: 2026-03-10
2. make-deep-grill-optional.md status: completed created: 2026-03-12
3. promote-deep-grill-to-mandatory.md status: completed created: 2026-03-15
Recommendation: keep #3 (most recent completed), archive #1 and #2
For .html review artifacts with no matching plan purpose:
Orphan artifact: add-rejection-remediation-prompt-review.html
Recommendation: delete (review artifact, not a source plan)
Ask via AskUserQuestion for each cluster:
"How would you like to handle this cluster?"
Options:
For "Apply recommendation":
git rm them (they are variant duplicates;
the canonical file remains).html artifacts): git rmIf any files were removed:
git add -A <plansDir>/ && git commit -m "chore(plans): consolidate N variant plan files"
Where <plansDir> is the resolved plans directory from Step 0.
If no changes were made, skip the commit silently.
--archive)When --all is active, this runs second — after variant consolidation.
Glob all *.md files in the plans directory. Read frontmatter for each.
A file is an archive candidate if ALL of these are true:
status: completedmodified if present, otherwise created) is 30+ days
before todayREADME.mdAlso check if a reference doc exists at docs/<slug>.md (generated by the
documenting-plans skill). This is informational — not a requirement for
archiving.
Archive candidates (N files, completed 30+ days ago):
# File Type Created Has Doc
── ──────────────────────────────────── ─────── ────────── ───────
1 add-allowed-tools-recommendation.md feature 2026-03-26 yes
2 create-skill-reviewer-plugin.md feature 2026-02-10 yes
3 fix-login-redirect.md fix 2026-01-15 no
4 document-plugin-version-bump.md docs 2026-03-01 yes
...
Target folders:
features/ 12 files
fixes/ 5 files
refactors/ 3 files
docs/ 4 files
chores/ 6 files
general/ 2 files (no type field)
Ask via AskUserQuestion:
"Archive N plans as HTML to docs/archive//? Source .md files will be git rm'd (git history preserves originals)."
Options:
Determine whether to run foreground or background based on --background flag.
Foreground (default):
For each candidate:
type field. The archive root is always
docs/archive/ (a project-level documentation artifact, independent of
<plansDir>):
feature → docs/archive/features/fix → docs/archive/fixes/refactor → docs/archive/refactors/docs → docs/archive/docs/chore → docs/archive/chores/docs/archive/general/mkdir -p the target foldermarkdown-to-html skill with --mode=plan on the source file.
The skill writes <slug>.html next to the source .md in the plans
directory.mv <plansDir>/<slug>.html docs/archive/<type>/<slug>.htmlgit rm <plansDir>/<slug>.md-review.html exists, move it to the same type folder."Archived 12/33: <slug>.html → docs/archive/features/"Commit safety: Stage all changes incrementally but defer the final commit until ALL files are processed. If any render fails mid-batch:
git checkout -- . to undo all staged changesOn full success:
git add -A <plansDir>/ docs/archive/ && git commit -m "chore(plans): archive N completed plans as HTML"
Background (with --background flag):
Spawn a background Agent with the full candidate list and rendering
instructions. The agent:
--all was active, also runs Sub-workflow C (Index) after the commit,
since index depends on the archive being completeThe parent session continues immediately after spawning.
--index)When --all is active, this runs last — after archiving, so counts are
accurate.
Glob *.md files in the plans directory (exclude README.md). Read
frontmatter from each. Group by status:
in-progress — currently active worktodo — planned but not starteddraft — early ideascompleted — done but not yet archived (< 30 days old)Check if docs/archive/ exists. If so, count .html files in each type
subdirectory (features/, fixes/, refactors/, docs/, chores/,
general/).
Write <plansDir>/README.md with the following structure. Compute relative
links from <plansDir> to docs/archive/ so they resolve correctly
regardless of where the plans directory is configured:
<!-- auto-generated by plan-maintenance — do not edit manually -->
# Plans
Last updated: YYYY-MM-DD
## Active Plans
### In Progress (N)
| Plan | Type | Created |
|------|------|---------|
| [add-dark-mode-toggle](add-dark-mode-toggle.md) | feature | 2026-05-10 |
| [fix-auth-redirect](fix-auth-redirect.md) | fix | 2026-05-12 |
### Todo (N)
| Plan | Type | Created |
|------|------|---------|
| ... | ... | ... |
### Draft (N)
| Plan | Type | Created |
|------|------|---------|
| ... | ... | ... |
### Recently Completed (N)
Plans completed within the last 30 days — not yet archived.
| Plan | Type | Created |
|------|------|---------|
| ... | ... | ... |
## Archived Plans
N plans archived as browsable HTML in [`docs/archive/`](../archive/).
| Category | Count |
|----------|-------|
| [Features](../archive/features/) | 12 |
| [Fixes](../archive/fixes/) | 5 |
| [Refactors](../archive/refactors/) | 3 |
| [Docs](../archive/docs/) | 4 |
| [Chores](../archive/chores/) | 6 |
| [General](../archive/general/) | 2 |
Omit any status section that has zero files. Omit the Archived section if
docs/archive/ does not exist or is empty. Omit type rows with zero count.
git add <plansDir>/README.md && git commit -m "docs(plans): regenerate plans index"
/plan-agent:plan-maintenance # runs --all (variants → archive → index)
/plan-agent:plan-maintenance --archive # archive only
/plan-agent:plan-maintenance --index # regenerate index only
/plan-agent:plan-maintenance --variants # variant review only
/plan-agent:plan-maintenance --all --background # full cycle, rendering in background
/plan-agent:plan-maintenance --archive --background # archive in background
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub shawn-sandy/agentics-kit --plugin plan-agent9 commands in this plugin
/deep-grillDeep GrillWalk each decision branch in an implementation plan with focused questions and codebase exploration/documenting-plansDocumenting PlansGenerate developer-friendly documentation at docs/<slug>.md from a completed plan file, synthesized from the plan body, live code inspection, and git history/fixAuthor and implement a fix plan — the /plan-agent:build chain, typed as a fix2 plugins ship this exact command · first indexed Jul 18, 2026