@micuintus/enforced-todo

Enforced TODO loop for Pi: after every turn the agent reassesses its list, then works the top item, until the list is empty.

Packages

Package details

extension

Install @micuintus/enforced-todo from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@micuintus/enforced-todo
Package
@micuintus/enforced-todo
Version
1.0.0
Published
Oct 25, 2026
Downloads
206/mo · 16/wk
Author
micuintus
License
MIT
Types
extension
Size
6.6 KB
Dependencies
1 dependency · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

EnforcedTodo

A TODO loop for Pi that follows through. After every agent run, while the TODO list still has items, EnforcedTodo sends one hidden follow-up prompt:

  1. If every item is completed, clear the list (an empty list ends the loop).
  2. Reassess the list against what the last turn learned: reorder, add, remove, merge or split items.
  3. Work the top item and mark it completed.

The reassessment step runs every turn. That is what "enforced" means: the protocol always runs. Whether each item succeeds is still up to the agent.

The loop stays idle when the list is empty, when the run was aborted, when messages are already queued, and when the run ended on a provider error such as a rate limit (it notifies you instead of retrying at API speed). An agent that genuinely cannot continue is told to clear the list or mark items completed, which stops the loop.

Install

pi install git:github.com/micuintus/enforced-todo
pi install git:github.com/tintinweb/pi-manage-todo-list

or pi install npm:@micuintus/enforced-todo.

Engine

EnforcedTodo drives the manage_todo_list tool from tintinweb/pi-manage-todo-list and reads its results from the session by tool name and shape. It does not work with other TODO extensions. If the tool is missing, the prompt tells the agent to say so and stop rather than invent a list. Why tintinweb's tool: it mirrors the manage_todo_list shape models already know from Copilot; see the Pi ecosystem TODO survey.

Development

npm install
npm run check
npm test

Extracted with its history from pi-dacmicu, where it shipped as the deterministic TODO loop. The loop driver lives in @micuintus/loop-driver.