Archive completed plans and roadmap milestones. Moves finished plans to the archive directory and optionally trims closed milestones from ROADMAP.md. Use when user says "archive plans", "clean up plans", "archive completed", or "trim roadmap".
71
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Archive completed single-file plans and ultra bundle directories from
paths.plans/ into paths.archive/plans/ and
optionally trim closed milestones from ROADMAP.md into dated snapshots
under paths.archive/roadmap/.
Read .ai-factory/config.yaml if it exists to resolve:
paths.plans (default: .ai-factory/plans/)paths.archive (default: .ai-factory/archive/)paths.plan (default: .ai-factory/PLAN.md)paths.fix_plan (default: .ai-factory/FIX_PLAN.md)paths.roadmap (default: .ai-factory/ROADMAP.md)workflow.plan_id_format (default: slug) — active values: slug and
sequential. timestamp and uuid are reserved and behave like slug.
Treat any unknown value as slug.language.ui for user-facing promptsIf config doesn't exist, use defaults listed above.
Read .ai-factory/skill-context/aif-archive/SKILL.md if it exists —
project-specific overrides take priority over general instructions.
Extract mode from arguments:
(no args) → interactive mode: scan, show completable plans, ask which to archive
list → show archive contents, then STOP
--roadmap → trim closed milestones from ROADMAP.md into a snapshot
--all → archive ALL completed plans (ask confirmation first)
<plan-name> → archive a specific plan by filename or partial stem matchParsing rules:
list and --roadmap are mutually exclusive with <plan-name> and --all<plan-name> can be:
0005_feature-auth.md0005_feature-auth or 0005_feature-auth/index.md0005_feature-authfeature-auth (must match exactly one plan)paths.plans/ for root *.md files and direct child */index.md
candidates using Glob. Exclude the resolved paths.plan and
paths.fix_plan; count a directory only when its entrypoint declares
<!-- aif:plan-mode:ultra -->. Do not treat phase files or unrelated directories as plans.## Tasks section.- [x]. Plans with any - [ ] are incomplete.No completed plans found in <paths.plans/>.Completed plans ready to archive:
1. 0001_feature-alpha.md (completed 2026-05-20)
2. 0003_feature-gamma.md (completed 2026-05-24)
Incomplete plans (skipped):
- 0005_feature-delta.md (3/7 tasks done)AskUserQuestion: Which plans to archive?
Options:
1. All completed plans listed above
2. Select specific plans (enter numbers)
3. Cancellist<paths.archive>/plans/ exists.Archive is empty. No plans have been archived yet. → STOP.<paths.archive>/plans/*.md files and direct child
<paths.archive>/plans/*/index.md entrypoints containing exactly one
<!-- aif:plan-mode:ultra -->.<!-- aif:archived:YYYY-MM-DD --> immediately after the ultra
marker (index.md).Archived plans (<paths.archive>/plans/):
1. 0001_feature-alpha.md (archived: 2026-05-20)
2. 0003_feature-gamma.md (archived: 2026-05-24)
Total: 2 archived plans<paths.archive>/roadmap/ for snapshots and list them if present:
Roadmap snapshots (<paths.archive>/roadmap/):
1. 2026-05-20_roadmap-snapshot.md (3 milestones)<plan-name><plan-name> to one artifact in paths.plans/:
*/index.md match.md extension appendedPlan not found: <plan-name> with suggestions → STOP.<!-- aif:plan-mode:ultra -->;
otherwise it is not an archivable AI Factory plan.Plan <filename> is not completed (5/8 tasks done).
Only completed plans can be archived.--allpaths.plans/ for completed plans (same logic as interactive mode).AskUserQuestion: Archive ALL completed plans?
1. 0001_feature-alpha.md
2. 0003_feature-gamma.md
Options:
1. Yes, archive all 2 plans
2. Cancel--roadmappaths.roadmap file.No ROADMAP.md found at <path>. → STOP.- [x] checkbox (completed milestones).No closed milestones to archive. → STOP.Closed milestones found in ROADMAP.md:
- [x] MVP Launch — core features shipped
- [x] Beta Testing — user feedback round
AskUserQuestion: Trim these milestones from ROADMAP.md into a snapshot?
Options:
1. Yes, create snapshot and trim
2. Cancelmkdir -p <paths.archive>/roadmap/YYYY-MM-DD_roadmap-snapshot.mdRead <paths.archive>/roadmap/YYYY-MM-DD_roadmap-snapshot.mdYYYY-MM-DD_roadmap-snapshot-2.md, YYYY-MM-DD_roadmap-snapshot-3.md, etc.
Check each candidate until a free name is found.# Roadmap Snapshot — YYYY-MM-DD
Archived from: <paths.roadmap>
## Archived Milestones
- [x] MVP Launch — core features shipped
- [x] Beta Testing — user feedback roundpaths.roadmap: remove the archived - [x] lines from the
## Milestones section. Keep the ## Completed table if it exists.
Do NOT edit paths.roadmap unless the snapshot write in step 6 succeeded.INFO [aif-archive] roadmap snapshot: <resolved-path> (<N> milestones archived)For each plan artifact to archive:
mkdir -p <paths.archive>/plans/
Collision check. Before moving, verify the destination does not already exist:
Read <paths.archive>/plans/<original-name> # full plan
Read <paths.archive>/plans/<original-name>/index.md # ultra bundleIf the file exists:
<plan-name>): STOP with an error:
ERROR [aif-archive] destination already exists: <paths.archive>/plans/<filename>
A previously archived plan has the same filename. This can happen when
sequential numbering reuses a freed number after archiving.
To resolve: rename the existing archive file, or delete it if it is no
longer needed.--all): SKIP this plan with a warning, continue to the next:
WARN [aif-archive] skipped: <filename> — destination already existsDo NOT overwrite in either case.
Validate an ultra bundle before moving it. Read index.md and require:
<!-- aif:plan-mode:ultra -->, as the first line or immediately
after an optional first-line <!-- handoff:task:<id> -->;## Phase Index;A malformed bundle is not safe to archive. STOP for a single plan, or emit
WARN [aif-archive] skipped malformed ultra bundle: <filename> and continue
in --all mode.
Move the complete source artifact into the archive path first:
mv <paths.plans>/<name> <paths.archive>/plans/<name>For ultra, <name> is the whole directory, so all linked phase files move
together. This atomically removes the plan from active discovery.
Add archive metadata to the moved entrypoint using Edit (index.md for
ultra, the moved plan file otherwise).
For ultra, preserve the canonical header and insert this comment immediately
after <!-- aif:plan-mode:ultra -->:
<!-- aif:archived:YYYY-MM-DD -->Never prepend YAML or move the ultra marker: it must remain the first line or immediately after an optional first-line Handoff annotation.
For a full plan, if the file already has YAML frontmatter (between ---
markers at the top):
Edit to add archived: YYYY-MM-DD field inside the existing frontmatter block.If the full plan has no YAML frontmatter:
Edit to prepend a minimal frontmatter block before the first line:
---
archived: YYYY-MM-DD
---The original filename or directory name is preserved exactly, including any
sequential NNNN_ prefix.
Logging: INFO [aif-archive] archived: <filename> -> <paths.archive>/plans/<filename>
After all plans are processed, display summary:
## Archive Complete
Archived N plan(s) to <paths.archive>/plans/:
- 0001_feature-alpha.md
- 0003_feature-gamma.md
Skipped: K (destination already exists)
- 0002_feature-beta.md
Plans directory: <paths.plans/> (M plans remaining)Omit the "Skipped" section when K is 0.
A plan is completed when:
## Tasks section (case-insensitive header match).- [x] or - [ ] within the Tasks section
(and its subsections) are checked: every checkbox is - [x].Edge cases:
## Tasks (e.g., in ## Settings or ## Commit Plan)
are NOT counted for completion. - [x]) ARE counted.## Tasks are not archivable — emit
WARN [aif-archive] <name> has no ## Tasks section; skipping.When displaying "completed" dates in interactive mode:
completed field — use if present.git log -1 --format=%ai -- <plan-file> to get last
modification date.- [x]--all and --roadmap operationsNNNN_ prefix<!-- aif:archived:YYYY-MM-DD --> comment after the ultra marker for bundlespaths.plan) or fix plans (paths.fix_plan) —
those are single-file artifacts managed by /aif-implement and /aif-fixpaths.archive/plans/, not paths.plans/, so /aif-plan
sequential scan does not include thempaths.archive/plans/*.md, archived ultra bundle directories, and paths.archive/roadmap/*.mdpaths.plans/*.md, direct child ultra */index.md + linked phases, and paths.roadmappaths.roadmap (only with --roadmap, only after confirmation)paths.plan, paths.fix_plan, paths.description,
paths.architecture, paths.rules_file4b943ec
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.