Skip to main content

workplan

Plan and record development work in git, for agent-driven and AI-assisted development.

A workplan breaks one goal into tasks. Each task is one commit; the workplan reaches the parent branch, master or main, as one squash commit listing every task. The plans and the task definitions are Markdown files in workplans/, and every task's state comes from git history. Any clone holds the whole record, and every step can be done by hand with git and an editor: PROTOCOL.md defines the protocol and gives each step as git commands.

An agent, such as Claude Code, Codex, or a model behind any OpenAI-compatible endpoint, defines the tasks and produces each task's patch in a separate worktree. The maintainer reads each diff and accepts or rejects it.

  • Git as state. Plans, tasks and their states are files and commits; there is no other store, and any clone is the whole record.
  • A protocol, not a service. No server, no account, any agent or none; PROTOCOL.md is enough to implement it again.

Install

pipx install workplan

Python 3.11 or later and git. No other dependencies. It runs on Linux; the hooks and dispatch.sh need a POSIX shell.

Try it on this repository

This repository is planned with workplan: every change since v0.1.0 is a workplan in workplans/, merged as one squash commit.

git clone https://github.com/bayinfosys/workplan
cd workplan
pipx install workplan
wp list                            # the workplans, and where they are held
wp show 2026-11-26-change-kinds    # a workplan's goal and its tasks' states
wp changelog v0.1.0                # what changed since v0.1.0, from git alone
wp serve                           # the board, in a local web page

wp is installed as a short name for workplan. WP-CLI, the WordPress command line, also installs wp; where both are installed, use workplan.

Manual, semi-automatic, full auto

Run it on full auto for the real vibe coding experience, or manual for the good old days.

  • Manual: git and an editor. PROTOCOL.md gives every step as git commands; the workplan command is optional.
  • Semi-automatic: run each command; Agents define tasks and produce patches; you read the diffs and accept or reject.
  • Full auto: workplan install adds hooks that route each commit to its next step, and route.dispatch runs task gen and patch gen as soon as they are due. Accepting each patch and merging stay with you.

Every step can be done by hand; PROTOCOL.md gives each as git commands. Most steps are several git operations in a fixed order: patch accept applies the patch, checks COMMIT_MSG and commits it with the task's files; merge runs the tests, squashes, commits and deletes the branch. The library ensures that order, checks what a step needs before it starts, and restores the tree when a step fails. It reads and changes the repository through git commands only.

A workplan from start to finish

workplan init                      # create workplans/ and commit it
$EDITOR workplans/BACKLOG.md       # the work not yet started: one ## heading per item
workplan new greeting              # branch workplan/<date>-greeting/definition;
                                   # the editor opens on WORKPLAN.md: goal, context, findings;
                                   # it is committed
workplan task gen                  # the agent writes the tasks; WORKPLAN.md and the
                                   # tasks are committed
git push                           # share the plan

workplan patch gen 0000            # the agent writes output.patch and COMMIT_MSG
workplan patch apply 0000          # stage it
workplan patch show 0000           # the task, its commit, its dependencies and the diff:
                                   # read it, test it
workplan patch accept 0000         # commit it with the task's files; or: patch reject
workplan status

workplan merge                     # squash into the parent branch; the editor opens on the message;
                                   # the local definition branch is deleted
workplan publish                   # push the parent branch; delete the workplan's
                                   # branches on the remote

The commands that complete a step or change a document commit it: init, new, edit, task add, task gen, task edit, task drop, patch accept and merge. patch apply stages a patch for review and commits nothing. publish is the only command that pushes to a branch the remote already has.

The workplan's commands are verbs on their own: new, list, show, edit and merge; new and merge are the two that change branches. Tasks and patches take a noun, then a verb: task add, patch show. list and show read; add is you supplying something; gen is the agent producing it; edit changes a document; apply, accept, reject and merge are the protocol's steps. status is a second name for task list.

To write tasks yourself in place of task gen, use task add "Say goodbye" --depend 0000 for each.

new opens the editor git uses for commit messages, on WORKPLAN.md rendered from its template; closing it unchanged creates nothing. new greeting -m "app.txt says goodbye" writes the goal and skips the editor. new greeting --reply WORKPLAN.md takes a whole WORKPLAN.md, written by a chat or by hand; its heading must name the new id. edit and task edit open the editor the same way on an existing document.

Every command that changes a document commits it, on the checked-out branch and with nothing else that is staged: new as <id> workplan, task add as <id> add <nnnn>, task add --reply as <id> define tasks, and edit and task edit as <id> edit <document>. An edit that changes nothing commits nothing.

Every command also runs as wp: wp new greeting, wp task add, wp patch show 0000.

Commands

Protocol commands change the repository in the protocol's terms; each links to its git commands in PROTOCOL.md.

Command Does
init create workplans/ with README, PRINCIPLES.md, BACKLOG.md, config.toml and dispatch.sh; add the working files to .gitignore; commit
new NAME [-m GOAL | --reply FILE] workplans/<date>-NAME/WORKPLAN.md from its template, or the whole file given, on a new branch from the parent branch; commit
edit [ID] WORKPLAN.md in the editor; commit
merge [ID] [-m MESSAGE] [--show] run test.command and stop if it fails; squash the workplan into the parent branch, with the message from its template; --show prints the message
publish [ID] push the parent branch to the remote, then delete the workplan's branches there; stops, deleting nothing, if the push is refused
task add TITLE [--depend N] [-m CHANGE] the next task's TASK.md and BREAKDOWN.md from their templates, and its line in WORKPLAN.md; the editor opens on TASK.md; commit
task add --reply FILE the new tasks in a task gen reply from a chat; - reads standard input; commit
task gen [ID] [--prompt] the agent writes each new task's TASK.md and BREAKDOWN.md; they are listed in WORKPLAN.md and committed with it; --prompt prints the prompt for a chat
task edit NNNN [--doc NAME] TASK.md, BREAKDOWN.md or NOTES.md in the editor; commit
task drop NNNN move the task to ## Dropped in WORKPLAN.md and commit WORKPLAN.md
patch add NNNN [FILE] a reply from a chat, with its commit message line and diff, becomes output.patch and COMMIT_MSG; standard input when FILE is left out
patch gen NNNN [--prompt] the agent writes output.patch and COMMIT_MSG; --prompt prints the prompt for a chat
patch apply NNNN stage the patch in the tree and the index
patch accept NNNN commit the patch with COMMIT_MSG, together with the task's directory and WORKPLAN.md
patch reject NNNN take an applied patch back out
patch drop NNNN delete an unapplied output.patch and its COMMIT_MSG

Supporting commands read git or run the library; they change nothing in the protocol.

Command Does
list every workplan, in the tree or on another branch, and whether it is editable
show [ID] the workplan's goal and its tasks' states
task list [ID], status [ID] each task's state; a workplan held only on another branch shows its committed states
task show NNNN the task's state and TASK.md
patch show NNNN the task, its state, COMMIT_MSG, its dependencies and their states, the files changed; then the staged change if applied, else output.patch
changelog [FROM] [TO] [--audience NAME] the changelog in Markdown, from the squash commits between two tags or commits and their tasks' trailers; writes nothing
route [REV] [--dispatch] the next step after a commit
install post-commit and post-merge hooks that run route --dispatch
serve [--port N] the board in a local web page, on 127.0.0.1

A task is ID/NNNN, or NNNN in the current branch's workplan. Every command takes --json to print its result as JSON.

Manual mode with a chat

With no agent configured, any chat can do the agent's work. --prompt prints the prompt the none agent would send, with the files it names; paste it into a chat, and paste the reply back:

workplan task gen --prompt          # paste into a chat
workplan task add --reply reply.txt # its new tasks; - reads standard input
workplan patch gen 0000 --prompt
workplan patch add 0000 reply.txt   # its diff and commit message line

patch add applies the reply's diff to the head of the workplan's branch in a separate worktree, and refuses a reply with no diff or one that does not apply. In the page, Copy prompt and Paste reply do the same, beside Gen tasks and Gen patch.

Changelog

Each task ends with git trailers saying what kind of change it makes, for whom, and what it breaks:

Depends: 0000
Change: feat
Audience: users
Breaking: wp add-task is now wp task add

workplan changelog reads the squash commits since the latest tag, and each of their tasks' trailers, and prints a changelog: breaking changes first, then Added, Fixed, Changed and Other.

workplan changelog                     # the latest tag to HEAD
workplan changelog v0.1.0 v0.2.0       # between two tags or commits
workplan changelog --audience users    # leave out developers and internal

It reads git and writes nothing; its output can go into CHANGELOG.md or a release. The squash commits in the range with a Workplan trailer give the workplans, and each task's trailers, as the files stand at TO, give its section:

from=v0.1.0; to=HEAD
git log --reverse --format='%(trailers:key=Workplan,valueonly)' $from..$to |
  while read -r plan; do
    [ -n "$plan" ] || continue
    for f in $(dirname "$plan")/[0-9][0-9][0-9][0-9]/TASK.md; do
      echo "$f"; git show "$to:$f" | git interpret-trailers --parse
    done
  done

Configuration

workplans/config.toml; workplan init writes it with every key, and writes workplans/dispatch.sh for route.dispatch. Environment variables override it, and API keys come from the environment only.

Key Variable Default
parent WORKPLAN_PARENT master; init writes the branch checked out
remote WORKPLAN_REMOTE origin
llm.api_base WORKPLAN_API_BASE http://localhost:8000/v1
llm.api_key_env WORKPLAN_API_KEY
llm.params {}, added to each request body
route.classifier WORKPLAN_ROUTE_CLASSIFIER rules
route.model WORKPLAN_ROUTE_MODEL
route.dispatch WORKPLAN_ROUTE_DISPATCH
agent.name WORKPLAN_AGENT none
agent.model WORKPLAN_AGENT_MODEL
agent.setup WORKPLAN_AGENT_SETUP
agent.command WORKPLAN_AGENT_COMMAND []
agent.attempts, agent.timeout 3, 1800
test.command WORKPLAN_TEST_COMMAND

Agents

task gen and patch gen work in a worktree at the head of the workplan branch, so the maintainer's own tree is never touched:

git worktree add --detach /tmp/wt $b
cp -r workplans /tmp/wt/                             # uncommitted edits are seen
( cd /tmp/wt && <agent.setup> )
git -C /tmp/wt add -A && base=$(git -C /tmp/wt write-tree)
( cd /tmp/wt && <the agent> )
x=":(exclude)workplans/*/*/output.patch"; y=":(exclude)workplans/*/*/COMMIT_MSG"
git -C /tmp/wt add -A -- . "$x" "$y"
git -C /tmp/wt diff --cached --binary $base -- . "$x" "$y" > $t/output.patch
cp /tmp/wt/$t/COMMIT_MSG $t/
git worktree remove --force /tmp/wt
  • task gen: the new task directories the agent wrote under workplans/<id>/ are copied back; existing tasks are left alone.
  • patch gen: the worktree's diff from the base, output.patch and COMMIT_MSG left out, becomes output.patch; it can change files under workplans/, and the documents copied in are not part of it.
agent.name Runs
none completions from llm.api_base; the plan files and the files they name go in the prompt; the reply holds the task files or a diff, retried with the error up to agent.attempts times
claude-code claude -p --allowedTools Read,Edit,Write,Glob,Grep,Bash, prompt on stdin
codex codex exec --sandbox workspace-write <prompt>
command agent.command; a {prompt} argument is replaced by the prompt, else it goes on stdin

claude-code and codex are presets of command; setting agent.command replaces the preset's arguments. Agents with a shell build the code and run its checks in the worktree. Containers, ports and other host resources are shared with the host, so integration runs stay with the maintainer.

A command agent receives WORKPLAN_ACTION (task-gen or patch-gen) and WORKPLAN_TARGET (the workplan or task id) in its environment, and for patch-gen, WORKPLAN_COMMIT_MSG: the path to write the commit message to. When it writes none, COMMIT_MSG is the task id and TASK.md's title.

Examples

Claude Code, with the project's dependencies installed first:

[agent]
name = "claude-code"
setup = "uv sync"

Codex:

[agent]
name = "codex"

A model behind an OpenAI-compatible endpoint, with no agent:

[llm]
api_base = "https://api.anthropic.com/v1"     # or https://api.openai.com/v1
api_key_env = "ANTHROPIC_API_KEY"             # or OPENAI_API_KEY

[agent]
name = "none"
model = "<model name>"

A local model, through marigold or Ollama:

[llm]
api_base = "http://localhost:8000/v1"         # Ollama: http://localhost:11434/v1

[agent]
name = "none"
model = "<model name>"

Routing

workplan route reads a commit and prints the next step: complete, review, patch-gen, task-gen or none, with its targets. The rules take the first action in this table that has targets:

Action When Targets
complete a commit on the parent branch with a Workplan: trailer the workplan
review code changed in a commit whose subject is a task id the task
patch-gen TASK.md or BREAKDOWN.md changed each task
task-gen WORKPLAN.md changed the workplan
none anything else, such as a change to the protocol's files --

A task's commit, which also carries its files and WORKPLAN.md, leads to review; the commit that defines the tasks leads to patch-gen. The rules read git show --name-only --format='%s%n%(trailers:key=Workplan)' REV. With route.classifier = "llm", a model chooses the action from the prompt in templates/prompts/route.md; the targets still come from the commit, and an answer that is not an action with targets falls back to the rules. stderr shows both choices:

$ workplan route
route: llm chose patch-gen; the rules chose patch-gen
patch-gen 2026-11-24-greeting/0000

workplan install adds hooks that run workplan route --dispatch in the background after each commit. --dispatch runs route.dispatch with the action and its targets. workplan init writes a dispatch script, workplans/dispatch.sh: for task-gen it runs workplan task gen, for patch-gen it runs workplan patch gen for each target in parallel, and on review it produces each stale patch again. Set route.dispatch = "workplans/dispatch.sh" and run workplan install for full auto. The hooks clear the variables git sets for hooks, such as GIT_INDEX_FILE, so that the commands a dispatch script runs work in their own worktrees.

Serve

workplan serve                     # http://127.0.0.1:8765/?token=...

serve starts a web server on 127.0.0.1 and prints its address, with a token made at startup. The page runs the same operations as the commands, so the whole flow can run from the browser, for instance over a screen share while a team refines the tasks. A workplan is editable while its definition branch is checked out; workplans on other branches are shown read-only, read from their branches.

The page shows the workplan's title, branch and goal, and a board with a column for each state. A card opens the task's TASK.md, BREAKDOWN.md, NOTES.md and patch, rendered, with Edit and Save; its buttons are the steps its state allows: Gen patch, Apply, Accept, Reject. The header holds Gen tasks and Merge, and the merge message opens in a text box. New workplan asks for a name and a goal. The selector lists every workplan, those on other branches marked read-only. The page refreshes every five seconds, so commits made in a terminal appear on their own.

The page and the commands share one API: every command but init, install and serve has a route, given by its verb and noun. task list is GET /api/workplan/{id}/task, patch accept is POST /api/task/{id}/{nnnn}/patch/accept, and so on; registry.py holds the rule.

Every request must name 127.0.0.1 or localhost as its host, and every API request must carry the token, so another site open in the browser can neither read nor change anything. Operations that change the repository run one at a time. The server keeps no state of its own: everything it shows comes from the files and git.

Templates

Documents, prompts and the squash commit message are rendered from templates with string.Template: $name is replaced and nothing else happens. To change one, copy it from src/workplan/templates/<kind>/ into workplans/templates/<kind>/ and edit the copy; the rest keep the package's version. The document templates are listed in PROTOCOL.md; the prompts are the library's:

Template Values
prompts/task-gen.md $id, $next, $context, $task_template, $breakdown_template
prompts/task-gen-none.md as task-gen.md
prompts/patch-gen.md $id, $workplan, $context, $commit_msg
prompts/patch-gen-none.md as patch-gen.md
prompts/route.md $branch, $parents, $subject, $workplan, $paths

Development

python -m unittest discover -s tests

workplans/config.toml sets this as test.command, so wp merge runs it, quietly, before squashing a workplan into master.

The tests build temporary repositories, compare each command with its by-hand git sequence, rehearse two clones sharing one origin, and run the none agent and the classifier against a local fake endpoint.

The version comes from git tags through setuptools-scm. A release is a vX.Y.Z tag on master:

git tag v0.1.0
git push origin v0.1.0

.github/workflows/release.yaml builds the package on every push to master; on a tag it publishes the package to PyPI and creates the GitHub release. It runs in the release environment and needs the repository secret PYPI_API_TOKEN.

Removing workplan

rm .git/hooks/post-commit .git/hooks/post-merge   # if workplan install wrote them
$EDITOR .gitignore                                # remove the two workplans/ lines
git rm -r workplans && git commit -m "remove workplans"
pipx uninstall workplan

The history keeps every workplan's squash commit and its Workplan trailer.

Licence

MIT. See LICENSE.

Metadata

Release files for workplan 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for workplan 0.3.0
File Size Uploaded Provenance Actions
workplan-0.3.0.tar.gz 148.4 kB Without provenance Details for workplan-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for workplan 0.3.0
File Interpreter ABI Platform Actions
workplan-0.3.0-py3-none-any.whl Python 3 none any Details for workplan-0.3.0-py3-none-any.whl

Total release size: 211.9 kB

Release files / workplan-0.3.0.tar.gz

Download URL workplan-0.3.0.tar.gz
Size 148.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9300cb1587c5b94ed49eca8ad1839ca9b567f923846a57b941f3a9a247e9d299
BLAKE2b-256 checksum
How to use checksums
0647cdbe2205fcb8061392613ab736d0c55f44e7e3e5ecafe82e5ae0f9f82dc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / workplan-0.3.0-py3-none-any.whl

Download URL workplan-0.3.0-py3-none-any.whl
Size 63.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c2fe4cf1a69fc8daedf01ebaaab2da0950f6176392f1c3bef6894b05c3845c9
BLAKE2b-256 checksum
How to use checksums
765607e5ae1b9af45b64c3504ea610174bb15d1e6a7ceb809ddeb673d50bb783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for workplan 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page