Skip to content
merge-archive-plan logo

Merge and Archive Plan

merge-archive-plan

Archive completed implementation plans after PR merge. Use when a plan's implementation has been merged to main, or after plan-execute completes on main branch.

SKILL.md

Full skill instructions

Merge and Archive Plan

Archive completed implementation plans with full metadata after successful merge to main.

Purpose

Maintain a clean, organized plan history by:

  • Moving completed plans to docs/​plans/​archive/
  • Adding comprehensive archive metadata
  • Preserving execution history and lessons learned
  • Keeping active plans directory focused

When to Use

  • After a plan's implementation PR is merged to main
  • When plan-execute completes successfully (with confirmation if on main)
  • Manual cleanup of completed plans

Trigger Behavior

Automatic Invocation (from plan-execute)

If invoked automatically after plan-execute completes:

  1. Check current branch
  2. If on feature branch/​worktree: Skip - wait for PR merge
  3. If on main branch: Prompt user for confirmation
Plan execution complete on main branch.

Would you like to archive this plan now?
- The plan will be moved to docs/​plans/​archive/
- Archive metadata will be added

[Yes] [No, I'll do it later]

Slash Command Invocation

If invoked via /​ak-merge-archive-plan:

  • Proceed directly without double-confirmation
  • User explicitly requested archiving

Archive Workflow

Step 1: Identify the Plan

If plan path provided: Use directly.

If no path:

  1. Check conversation context for recently executed plan
  2. List completed plans in docs/​plans/
  3. Ask user which plan to archive

Step 2: Verify Merge Status

Before archiving, verify the implementation is merged:

# Check if on main branch
git branch --show-current

# If on feature branch, check if merged to main
git log main --oneline | grep -q "{plan-related-commit}"

If not merged:

⚠️ Plan implementation doesn't appear to be merged to main yet.

Current branch: feature/​0042_user-auth
Merge status: Not merged

Options:
1. Archive anyway (not recommended)
2. Wait for merge
3. Check a different plan

How would you like to proceed?

Step 3: Gather Archive Metadata

Collect comprehensive information:

# Get PR information (if available)
gh pr list --state merged --search "{plan-name}" --json number,title,url,mergedAt

# Get commits from implementation
git log --oneline main~{N}..main --grep="{plan-name}"

# Get files changed
git diff --stat {first-commit}^..{last-commit}

Step 4: Update Plan with Archive Header

Use the Edit tool to prepend the archive metadata block at the top of the plan file. Do NOT create a new file - edit the existing plan in place.

See assets/​archive-header-template.md for the full template.

Step 5: Move to Archive with git mv

Use git mv to move the plan - this preserves git history and stages the change in one step.

# Ensure archive directory exists
mkdir -p docs/​plans/​archive/

# Move the plan using git mv (preserves history)
git mv docs/​plans/​{NNNN}_{name}.md docs/​plans/​archive/

# Move any subplans
git mv docs/​plans/​{NNNN}A_*.md docs/​plans/​archive/ 2>/​dev/​null || true
git mv docs/​plans/​{NNNN}B_*.md docs/​plans/​archive/ 2>/​dev/​null || true

Example:

mkdir -p docs/​plans/​archive/
git mv docs/​plans/​0001_bootstrap.md docs/​plans/​archive/

Step 6: Commit Archive

git add docs/​plans/​archive/​{plan-files}
git add docs/​plans/  # To capture the removal
git commit -m "docs(plans): archive {NNNN}_{name}

- Moved to docs/​plans/​archive/
- Added archive metadata
- PR: {PR URL}

🤖 Generated with [Claude Code](https://claude.com/​claude-code)

Co-Authored-By: Claude <[email protected]>"

Step 7: Report

## Plan Archived: {plan-name}

**Status:** ✅ Archived successfully

| Detail | Value |
|--------|-------|
| Plan | `{NNNN}_{name}.md` |
| New Location | `docs/​plans/​archive/` |
| PR | [{PR title}]({URL}) |
| Commits | {N} |
| Files Changed | {N} |

Subplans also archived:
- `{NNNN}A_{subplan}.md`
- `{NNNN}B_{subplan}.md`

Archive Directory Structure

docs/​plans/
├── 0043_current-feature.md     # Active plans
├── 0044_upcoming-work.md
└── archive/                     # Completed plans
    ├── 0001_bootstrap.md
    ├── 0002_cli-core.md
    ├── 0040_old-feature.md
    ├── 0041_another-done.md
    └── 0042_user-auth.md

Metadata Template

See assets/​archive-header-template.md for the full archive header format.

Edge Cases

Plan with No PR

If implementation was done directly on main without a PR:

## Archive Information

| Field | Value |
|-------|-------|
| Archived | {date} |
| PR | N/​A (direct to main) |
| Commits | {N} commits |

Partial Implementation

If plan was only partially completed:

---
archived: true
archived_date: {date}
partial: true
---

## Archive Information

**Note:** This plan was partially implemented. See Lessons Learned for details.

### Completed
- Phase 1: Database Schema ✅
- Phase 2: API Endpoints ✅

### Not Completed
- Phase 3: Frontend (deferred to plan 0050)
- Phase 4: Integration Tests (covered by 0050)

Abandoned Plan

For plans that were abandoned:

---
archived: true
archived_date: {date}
status: ABANDONED
---

## Archive Information

**Status:** ABANDONED

**Reason:** {Why the plan was abandoned}

**Disposition:**
- Requirements changed
- Superseded by plan {NNNN}
- No longer needed

Examples

Example: Archive after PR merge

User: Archive the user-auth plan, the PR just merged

Claude: [Checks git status]
[Finds merged PR via gh cli]
[Gathers commit history]

Archiving plan 0042_user-auth...

[Updates plan with archive header]
[Moves to docs/​plans/​archive/]
[Commits changes]

## Plan Archived: 0042_user-auth

✅ Archived successfully

| Detail | Value |
|--------|-------|
| Plan | `0042_user-auth.md` |
| PR | [feat: add user authentication](#123) |
| Commits | 8 |
| Files Changed | 12 |

Example: Auto-invocation on main

[plan-execute completes on main branch]

Claude: Plan execution complete on main branch.

Would you like to archive this plan now?
- The plan will be moved to docs/​plans/​archive/
- Archive metadata will be added

User: Yes

Claude: [Proceeds with archiving]

Related Skills

  • plan-execute - May invoke this skill after completion
  • create-plan - Creates plans this skill archives
  • review-plan - Reviews plans before execution

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View