Archive Tasks Skill
Purpose
Prevents the tasks/completed/ directory from accumulating hundreds of task files by periodically compacting completed tasks into dense, single-file milestone summaries in docs/history/.
Workflow
- Scan completed tasks for the current milestone:
ls tasks/completed/*.md 2>/dev/null
Read each file and extract:
- Task number and title
- Type (bug/improvement/feature)
- Source (from the
**Source:**metadata line) - Execution Log & Reasoning (architectural reasoning)
- Key files modified
Generate a milestone summary at
docs/history/milestone-X-summary.mdwith the following structure:# Milestone X Summary **Date:** YYYY-MM-DD **Tasks Compacted:** N ## Source Distribution | Source | Count | | ------------ | ----- | | orchestrator | N | | telegram | N | | manager | N | ## Architectural Changes [Dense summary of all architectural changes across the milestone] ## Files Modified | File | Change | | ------------ | ----------- | | path/to/file | description | ## Criteria Met | Task | Acceptance Criteria | Status | | ---- | ------------------- | ------ | | XX | [Extracted criteria from the completed task's `## Acceptance Criteria` section] | ✅ Met | ## Individual Task Summaries ### Task XX: Title - **Type:** bug|improvement|feature - **Source:** [orchestrator|telegram|manager] - **Reasoning:** [condensed execution log]Create the
docs/history/directory if it does not exist:
mkdir -p docs/history
- Move completed files to archive:
git mv tasks/completed/*.md tasks/archive/
Note: If files are untracked, use standard mv and then git add tasks/archive/.
Memory Validation: After compacting tasks, audit the project memory bank for stale or superseded entries: a. Call
list_namespacesto enumerate all memory namespaces. b. For each namespace, callsearch_memoryusing keywords from the archived tasks. c. Identify memories that reference archived/completed task files or superseded workflows. d. Detect duplicates: if two memories in the same namespace cover the same topic and one references a newer date or task, flag the older one as superseded. e. Output a## Stale Memory Reportlisting all flagged memories with their namespace, key, and reason for flagging. f. Wait for Manager approval before callingdelete_memoryon any flagged entry. NEVER auto-delete memories without explicit Manager confirmation.Stage the new summary and moved files:
git add docs/history/ tasks/archive/
When to Run
Run this skill at the end of each milestone or when tasks/completed/ contains more than 20 files. The milestone number should be determined by reading the highest existing milestone in docs/history/ and incrementing by one.