ワンクリックで
skill-archive-task
Complete protocol for archiving TASK.md and PLAN.md (lockstep) with ID generation. Single source of truth for archiving.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Complete protocol for archiving TASK.md and PLAN.md (lockstep) with ID generation. Single source of truth for archiving.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when decomposing tasks into parallel sub-tasks or spawning sub-agents. Vendor-agnostic core; load a per-vendor reference for concrete tool names, directory conventions, and invocation syntax.
Use when performing Verification-Driven Development with adversarial approach. Actively challenge assumptions and find weak spots.
Use when performing VDD adversarial review with an opt-in sarcastic, provocative delivery style — a stylistic skin over vdd-adversarial mechanics (exhaustive reporting + objective bar).
Performance critic in adversarial style (optional sarcastic skin). Part of VDD Multi-Adversarial pipeline.
Use when performing OWASP security critique in adversarial style (optional sarcastic skin). Part of VDD Multi-Adversarial pipeline.
Use when performing security vulnerability assessment (OWASP, secrets, dependencies, IaC, LLM, API, MCP/agentic) or when "thinking like a hacker" to find exploits.
| name | skill-archive-task |
| description | Complete protocol for archiving TASK.md and PLAN.md (lockstep) with ID generation. Single source of truth for archiving. |
| tier | 1 |
| version | 1.3 |
This skill encapsulates the complete protocol for archiving docs/TASK.md to docs/tasks/
and docs/PLAN.md to docs/plans/ (in lockstep with TASK.md).
Archive docs/TASK.md ONLY when:
docs/TASK.md exists with DIFFERENT contentDO NOT archive when:
docs/TASK.md does not exist[!IMPORTANT] PLAN.md rotates in lockstep with TASK.md. Whenever TASK.md is archived for a NEW task, the old
docs/PLAN.md(if present) is archived too — see "PLAN.md Archiving (Lockstep)" below. On task refinement, PLAN.md is overwritten in place, never archived.docs/ARCHITECTURE.mdis a LIVING document and is never touched by this skill.
IF user request implies a NEW SEPARATE feature/refactor:
→ Archive existing TASK.md, then create new
IF user request is a clarification/refinement of CURRENT task:
→ Overwrite TASK.md, do NOT archive
Indicators of NEW task:
Indicators of REFINEMENT:
IF NOT exists("docs/TASK.md"):
SKIP archiving → Create new TASK.md
Read from current docs/TASK.md:
If Meta Information is missing or malformed:
000 or increment last known ID manually.Option A: Use Tool (Preferred)
If generate_task_archive_filename tool is available:
result = generate_task_archive_filename(slug="task-slug")
filename = result["filename"]
Option B: Manual Generation (Fallback) If tool is NOT available:
task-[ID]-[slug].md (e.g. task-033-login-flow.md)docs/tasks/ (check via ls).BEFORE moving file, update docs/TASK.md:
mv docs/TASK.md docs/tasks/{filename}
[!IMPORTANT] This command is SAFE TO AUTO-RUN. Do NOT wait for user approval.
Verify:
docs/TASK.md does NOT existdocs/tasks/{filename} existsIf validation fails:
docs/TASK.md still exists: retry mv or notify userdocs/PLAN.md has no Meta block or identity of its own, and there is always exactly
one PLAN per TASK. Therefore PLAN.md is never archived independently — it rotates
in lockstep with TASK.md, reusing the same ID and slug TASK.md was just archived
under.
Result:
docs/tasks/task-NNN-slug.md↔docs/plans/plan-NNN-slug.mdalways pair up.
[!IMPORTANT]
docs/tasks/is shared — it also holds planner sub-task files (task-NNN-SubID-slug.md). PLAN.md therefore archives to a separatedocs/plans/directory, never todocs/tasks/.
Run this only after Step 6 validation passed (TASK.md successfully archived for a NEW task). Execute sub-steps 7.1–7.7 in order.
7.1 — Condition check. No PLAN.md means the task never reached planning:
IF NOT exists("docs/PLAN.md"):
SKIP plan archiving → DONE
7.2 — Refinement guard. Step 7 is normally only reached on the NEW-task path; this
guard is stated explicitly so re-planning the SAME task overwrites docs/PLAN.md:
IF Step 1 decision was REFINEMENT (not a NEW task):
DO NOT archive PLAN.md — Planner overwrites it in place → DONE
7.3 — Ensure destination (idempotent, SAFE TO AUTO-RUN):
mkdir -p docs/plans
7.4 — Derive filename (NO new ID generation):
plan_filename = "plan-{used_id}-{slug}.md"
{used_id} and {slug} are REUSED VERBATIM from the TASK.md archive just completed —
specifically the post-correction used_id returned by generate_task_archive_filename
(Step 3), NOT the ID read from TASK.md's Meta block. If the tool corrected a conflicting
ID (e.g. 100 → 101), TASK and PLAN must both use the corrected ID to stay paired.
7.5 — Collision guard:
IF exists("docs/plans/{plan_filename}"):
STOP. Do NOT overwrite. Report to user:
"Plan archive collision: docs/plans/{plan_filename} already exists."
7.6 — Archive (move):
mv docs/PLAN.md docs/plans/{plan_filename}
7.7 — Validate:
ASSERT NOT exists("docs/PLAN.md")
ASSERT exists("docs/plans/{plan_filename}")
IF validation fails: retry mv once, else notify user.
| Case | Behavior |
|---|---|
docs/PLAN.md absent | Skip silently (7.1). Not an error — many tasks reach analysis but not planning. |
| Task refinement (same task) | Step 7.2 returns early. PLAN.md is overwritten in place by the Planner. |
docs/plans/ missing | mkdir -p in 7.3 creates it. |
Corrected used_id | 7.4 uses the corrected ID, so TASK and PLAN stay paired. |
| Orphan PLAN.md (PLAN.md exists, no TASK.md) | Step 1 skipped archiving (no TASK.md) → Step 7 is never reached. The orphan PLAN.md is left in place. Warn the user it may be stale. PLAN.md has no independent ID, so it cannot be safely archived alone — this is a deliberate limitation. |
See
skill-safe-commandsfor the authoritative list of commands safe for auto-execution.
Key commands for this skill:
mv docs/TASK.md docs/tasks/... — archiving TASK.mdmv docs/PLAN.md docs/plans/... — archiving PLAN.md (lockstep)mkdir -p docs/plans — ensure PLAN archive destination existsls, cat — validationThis skill performs file mutations (mv, mkdir). The following boundaries apply:
mv only — docs/TASK.md / docs/PLAN.md
content is relocated, never destroyed.docs/ARCHITECTURE.md is never moved or archived.mv is followed by an existence assertion
(Steps 6, 7.7); on failure, retry once then notify the user — do not continue blindly.02_analyst_prompt.md): Before creating new TASK.md01_orchestrator.md): At Completion stageTrigger: User says "Create new task for implementing login feature."
skill-archive-task.docs/TASK.md exists? → YES (contains Task {OLD_ID}: {Old Feature}).{OLD_ID}, Slug = {old-slug}.task-{OLD_ID}-{old-slug}.md.mv docs/TASK.md docs/tasks/task-{OLD_ID}-{old-slug}.md.docs/TASK.md does NOT exist ✓.docs/PLAN.md exists? → YES.
mkdir -p docs/plans{OLD_ID} + {old-slug} from the TASK archive above.mv docs/PLAN.md docs/plans/plan-{OLD_ID}-{old-slug}.md.docs/PLAN.md does NOT exist ✓.docs/TASK.md for the login feature with ID {NEW_ID}.