$npx -y skills add PaulRBerg/agent-skills --skill todo-archiveArchive checked TODO.md tasks into .ai/todos/TODO_UNTIL_YYYY_MM_DD.md, leaving unchecked tasks.
| 1 | # TODO Archive |
| 2 | |
| 3 | `TODO.md` and `.ai/` are conventionally git-ignored, so they are untracked and `git diff` shows nothing for them. |
| 4 | Inspect changes against the filesystem, not git. |
| 5 | |
| 6 | ## Arguments |
| 7 | |
| 8 | - `path` (optional): Repository root or any path inside the repository. Default to the current directory. |
| 9 | - `--hint TEXT` (optional): Archive only the section whose heading contains `TEXT` (case-insensitive substring), |
| 10 | including its subsections. Without it, archive checked tasks from the whole file. Checked tasks outside the matched |
| 11 | section stay in `TODO.md`. |
| 12 | - `--date YYYY-MM-DD|YYYY_MM_DD` (optional): Archive date. Default to today's local date. |
| 13 | - `--dry-run` (optional): Preview target paths and rendered content without writing. |
| 14 | - `--force` (optional): Overwrite the date-only archive in place instead of rolling a same-day re-run over to a |
| 15 | timestamped file. |
| 16 | |
| 17 | ## Workflow |
| 18 | |
| 19 | 1. Resolve the repository root: |
| 20 | |
| 21 | ```sh |
| 22 | git rev-parse --show-toplevel |
| 23 | ``` |
| 24 | |
| 25 | If the command fails, use the provided `path` or current directory as the root. |
| 26 | |
| 27 | 2. Verify `TODO.md` exists at the root. If it is missing, stop and report the path checked. |
| 28 | |
| 29 | 3. Run the helper from this skill directory: |
| 30 | |
| 31 | ```sh |
| 32 | uv run python scripts/archive_todo.py --root "$repo_root" |
| 33 | ``` |
| 34 | |
| 35 | Pass through `--hint`, `--date`, `--dry-run`, or `--force` when the user requested them. |
| 36 | |
| 37 | 4. Report the rewritten `TODO.md`, the created archive path, the matched section (when `--hint` was given), and the |
| 38 | archived/remaining task counts. If an archive for the date already exists, the helper rolls the new batch over to |
| 39 | `TODO_UNTIL_YYYY_MM_DD_HHMM.md` and keeps the earlier file; report both paths. If the helper reports no checked |
| 40 | tasks, treat it as a no-op. If `--hint` matches no heading, the helper exits non-zero and lists the available |
| 41 | sections; relay them. When `--force` replaces an existing archive, say `⚠️ Overwrote existing archive`, never |
| 42 | `Created`. |
| 43 | |
| 44 | 5. If useful, inspect only the touched paths. `TODO.md` and `.ai/` are git-ignored, so use the filesystem rather than |
| 45 | `git diff`: |
| 46 | |
| 47 | ```sh |
| 48 | cat TODO.md && ls .ai/todos/ |
| 49 | ``` |
| 50 | |
| 51 | ## Helper Behavior |
| 52 | |
| 53 | `scripts/archive_todo.py` reads only `<root>/TODO.md`, writes archived tasks to |
| 54 | `<root>/.ai/todos/TODO_UNTIL_YYYY_MM_DD.md`, and rewrites `<root>/TODO.md` with the remaining tasks (a minimal `# TODO` |
| 55 | stub if everything was archived). With `--hint`, it restricts archiving to the matched heading's subtree and exits |
| 56 | non-zero listing available headings when nothing matches. It rolls a same-day re-run over to a timestamped |
| 57 | `TODO_UNTIL_YYYY_MM_DD_HHMM.md` sibling instead of clobbering the earlier archive, unless `--force` is passed. |
| 58 | |
| 59 | ## Completion |
| 60 | |
| 61 | Completion evidence is the helper's archive path plus archived and remaining task counts; a no-checked-task result is a |
| 62 | successful no-op. Dry-run completion requires rendered paths/content with no filesystem changes. Finish with |
| 63 | `### 📦 Archived <count> checked tasks` and concise TODO/archive/scope/count rows; use |
| 64 | `### ✅ Nothing to archive — no files written` for a no-op and `### 🔎 Archive preview — no files written` for dry runs. |
| 65 | Do not repeat full dry-run document content in the final message or add decoration to TODO/archive files, paths, |
| 66 | commands, or helper diagnostics. |