skills/aif-archive/SKILL.md
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".
npx skillsauth add lee-to/ai-factory aif-archiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Archive completed plans 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 match
Parsing rules:
list and --roadmap are mutually exclusive with <plan-name> and --all<plan-name> can be:
0005_feature-auth.md0005_feature-authfeature-auth (must match exactly one plan)paths.plans/ for all *.md files using Glob.## Tasks section.- [x]. Plans with any - [ ] are incomplete.No completed plans found in <paths.plans/>.
→ STOP.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. Cancel
list<paths.archive>/plans/ exists.Archive is empty. No plans have been archived yet. → STOP.<paths.archive>/plans/*.md.archived date.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 a file in paths.plans/:
.md extension appended<plan-name> in filenames)Plan not found: <plan-name> with suggestions → STOP.Plan <filename> is not completed (5/8 tasks done).
Only completed plans can be archived.
→ STOP.--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. Cancel
mkdir -p <paths.archive>/roadmap/YYYY-MM-DD_roadmap-snapshot.mdRead <paths.archive>/roadmap/YYYY-MM-DD_roadmap-snapshot.md
If the file exists, append a counter suffix to produce a non-colliding name:
YYYY-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 round
paths.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 to archive:
mkdir -p <paths.archive>/plans/
Collision check. Before moving, verify the destination does not already exist:
Read <paths.archive>/plans/<original-filename>
If 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 exists
Do NOT overwrite in either case.
Move the source file into the archive path first:
mv <paths.plans>/<filename> <paths.archive>/plans/<filename>
This atomically removes the plan from the active directory.
Add archive metadata to the moved file using Edit:
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 file has no YAML frontmatter:
Edit to prepend a minimal frontmatter block before the first line:
---
archived: YYYY-MM-DD
---
The original filename 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 section are not archivable — emit
WARN [aif-archive] <filename> 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_ prefixarchived: YYYY-MM-DD in YAML frontmatterpaths.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, paths.archive/roadmap/*.mdpaths.plans/*.md, paths.roadmappaths.roadmap (only with --roadmap, only after confirmation)paths.plan, paths.fix_plan, paths.description,
paths.architecture, paths.rules_filetools
Set up agent context for a project. Analyzes tech stack, installs relevant skills from skills.sh, generates custom skills, and configures MCP servers. Use when starting new project, setting up AI context, or asking "set up project", "configure AI", "what skills do I need".
development
Verify completed implementation against the plan. Checks that all tasks were fully implemented, nothing was forgotten, code compiles, tests pass, and quality standards are met. Use after "/aif-implement" completes, or when user says "verify", "check work", "did we miss anything".
data-ai
Plan implementation for a feature or task. Two modes — fast (single quick plan) or full (richer plan with optional git branch/worktree flow). Use when user says "plan", "new feature", "start feature", "create tasks".
development
Refine an existing implementation plan with a second iteration. Re-analyzes the codebase for gaps, missing tasks, and wrong dependencies. Use after /aif-plan or to improve an /aif-fix plan. Optional +check flag validates refinements via a fresh-context subagent.