pi-todo-md
v0.4.0
Published
A shareable pi extension for managing a repo-local TODO.md file.
Maintainers
Readme
pi-todo-md
A shareable pi package that gives the agent a structured todo_md tool backed by a repo-local TODO.md file.
What it does
- manages
TODO.mdthrough a structured tool instead of ad-hoc file edits - finds the nearest
TODO.mdin the current directory or a parent directory - creates
TODO.mdat the git repo root when none exists yet - keeps stable task IDs with hidden HTML comments
- writes a hidden file schema marker for future migrations
- supports sections, reordering, bulk add, rename, focus mode, priority metadata, notes, subtasks, check/uncheck, archive, and prioritize
- adds an interactive
/todos [section]browser inside pi with keyboard actions - injects a compact active-task summary into relevant agent turns so pi can stay aligned with the current working set
Install
From npm
pi install npm:pi-todo-mdFrom a local checkout
pi install /absolute/path/to/pi-todo-md -lQuick start
After installing, start pi in your project and ask things like:
Show me the current todo listAdd a task to TODO.md to publish the pluginAdd these tasks to TODO.md: write docs, record demo, publish packageWhat should I work on next from TODO.md?Focus task #2 and show me the current focus listMark task #3 as high priorityCreate an Inbox section and move task #5 thereRename task #2 to finish README polishAdd a note to task #2 saying publish after the docs landAdd subtasks to #2 for writing docs and publishing the packageMark task #2 as doneArchive all completed tasksMove task #3 to In ProgressPrioritize task #5/todos/todos In Progress
Tool API
The extension registers a tool named todo_md.
| Action | Required | Optional | Description |
|---|---|---|---|
| list | — | section | Show the current task list |
| list_focused | — | — | Show the current focused tasks |
| next_task | — | section | Recommend the next open task |
| create_section | section | — | Create a new section |
| rename_section | section | targetSection | Rename a section |
| remove_section | section | targetSection | Remove a section, optionally moving its tasks |
| move_section | section, index | — | Reorder sections |
| add | text | section, index | Add one task |
| bulk_add | items | section, index | Add multiple tasks at once |
| check | id | — | Mark a task done |
| uncheck | id | — | Mark a task not done |
| rename | id, text | — | Change task text |
| focus_task | id | — | Mark a task as part of the active working set |
| unfocus_task | id | — | Remove a task from the active working set |
| set_priority | id, priority | — | Set priority to low, medium, or high |
| clear_priority | id | — | Remove priority metadata |
| set_note | id, text | — | Replace a task's note text |
| append_note | id, text | — | Append note line(s) to a task |
| clear_note | id | — | Remove all notes from a task |
| add_subtask | id, text | — | Add a subtask to a task |
| check_subtask | id, subtask | — | Mark a subtask done |
| uncheck_subtask | id, subtask | — | Mark a subtask not done |
| remove_subtask | id, subtask | — | Delete a subtask |
| archive_done | — | section | Move completed tasks into Archive |
| remove | id | — | Delete a task |
| move | id | section, index | Move a task to another section or position |
| prioritize | id | section | Move a task to the top of a section |
There is also a /todos [section] command for an interactive view. Inside the browser you can use:
↑↓orj/kto movexto toggle the selected task or subtaskfto focus or unfocus the selected taskh,m,l, or0to set high, medium, low, or no priorityrto rename a tasknto edit a task notesto add a subtaskpto prioritize a taskdto delete the selected task or subtaskato archive completed tasksoto toggle done items on and off
Managed file format
pi-todo-md normalizes TODO.md into a canonical format like this:
# TODO
<!-- pi-todo-md:schema=1 -->
## Tasks
- [ ] ship the plugin [focus] [high] <!-- pi-todo-md:id=1 -->
- note: publish after trusted publishing works
- [ ] write docs
- [ ] publish package
- [x] read the docs <!-- pi-todo-md:id=2 -->
## In Progress
- [ ] package it for sharing <!-- pi-todo-md:id=3 -->
## Archive
- [x] initial release <!-- pi-todo-md:id=4 -->The hidden <!-- pi-todo-md:schema=1 --> marker reserves room for future file migrations, and the hidden <!-- pi-todo-md:id=... --> markers keep task IDs stable across edits.
File placement rules
When the tool runs, it will:
- use
TODO.mdin the current directory if present - otherwise walk up parent directories looking for
TODO.md - if none exists, create one at the nearest git repo root
- if not inside a git repo, create one in the current directory
Local development
Run the tests:
npm testPreview the publish tarball:
npm pack --dry-runTry the extension directly without installing it globally:
pi -e ./extensions/todo-md.jsContributing
See CONTRIBUTING.md for:
- release conventions
- Release Please workflow details
- npm trusted publishing setup
- release debugging notes
License
MIT
