Archive completed task/spec work to ./.gtd/archive/
Core responsibilities:
Flow: Verify Exists → Create Archive → Move Files → Clean Up </objective>
<context> **Task name:** $ARGUMENTS (if not provided, ask user which task to archive)Source:
./.gtd/<task_name>/ — Task work to archiveDestination:
./.gtd/archive/<task_name>-{timestamp}/ — Archived task workFiles to archive:
Only archive when task is complete or abandoned.
</philosophy> <process> </process>Keep all files for future reference and learning.
After archiving, task folder is removed to keep .gtd/ clean.
If no argument provided, ask user:
Which task would you like to archive?
Available tasks:
- {task 1}
- {task 2}
Verify ./.gtd/<task_name>/ exists:
if [ ! -d "./.gtd/<task_name>" ]; then
echo "Error: Task '<task_name>' not found"
exit 1
fi
Generate archive name with timestamp:
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
ARCHIVE_DIR="./.gtd/archive/<task_name>-${TIMESTAMP}"
mkdir -p "./.gtd/archive"
Move entire task folder to archive:
mv "./.gtd/<task_name>" "${ARCHIVE_DIR}"
Commit the archive:
git add ./.gtd/archive/
git commit -m "chore: archive task <task_name> to {task_name}-${TIMESTAMP}"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GTD ► TASK ARCHIVED ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Task: {task_name}
Archived to: ./.gtd/archive/{task_name}-{timestamp}/
Phases archived: {count}
Files archived: {count}
Task folder removed from ./.gtd/
─────────────────────────────────────────────────────
<forced_stop> STOP. The workflow is complete. Do NOT automatically run the next command. Wait for the user. </forced_stop>