workplan 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- workplan/__init__.py +8 -0
- workplan/__main__.py +5 -0
- workplan/agent.py +377 -0
- workplan/cli.py +144 -0
- workplan/config.py +74 -0
- workplan/git.py +69 -0
- workplan/llm.py +37 -0
- workplan/ops.py +287 -0
- workplan/plans.py +254 -0
- workplan/route.py +111 -0
- workplan/templates/documents/BREAKDOWN.md +3 -0
- workplan/templates/documents/NOTES.md +3 -0
- workplan/templates/documents/SQUASH_COMMIT_MSG +7 -0
- workplan/templates/documents/TASK.md +9 -0
- workplan/templates/documents/WORKPLAN.md +23 -0
- workplan/templates/project/PRINCIPLES.md +10 -0
- workplan/templates/project/README.md +9 -0
- workplan/templates/project/config.toml +28 -0
- workplan/templates/prompts/define-tasks-none.md +31 -0
- workplan/templates/prompts/define-tasks.md +29 -0
- workplan/templates/prompts/produce-patch-none.md +21 -0
- workplan/templates/prompts/produce-patch.md +23 -0
- workplan/templates/prompts/route.md +21 -0
- workplan-0.1.0.dist-info/METADATA +263 -0
- workplan-0.1.0.dist-info/RECORD +29 -0
- workplan-0.1.0.dist-info/WHEEL +5 -0
- workplan-0.1.0.dist-info/entry_points.txt +3 -0
- workplan-0.1.0.dist-info/licenses/LICENSE +21 -0
- workplan-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Workplan $id: $title
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
$goal
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
<The code, files and facts needed to work on the tasks. Name files by
|
|
10
|
+
their paths; an agent without tools is given the files named here.>
|
|
11
|
+
|
|
12
|
+
## Findings
|
|
13
|
+
|
|
14
|
+
<What makes the work necessary. Each finding names the task that
|
|
15
|
+
addresses it.>
|
|
16
|
+
|
|
17
|
+
## Decisions
|
|
18
|
+
|
|
19
|
+
<The choices this workplan rests on, numbered.>
|
|
20
|
+
|
|
21
|
+
## Tasks
|
|
22
|
+
|
|
23
|
+
## Dropped
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Principles
|
|
2
|
+
|
|
3
|
+
Every task and every review holds to these.
|
|
4
|
+
|
|
5
|
+
- a task makes the change it states and nothing else
|
|
6
|
+
- documentation changes with the code, in the same task
|
|
7
|
+
- a change a task needs outside its scope, such as a refactoring or
|
|
8
|
+
an unrelated fix, is raised for a later workplan
|
|
9
|
+
- every write goes through the maintainer: patches are reviewed and
|
|
10
|
+
applied by hand
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Workplans
|
|
2
|
+
|
|
3
|
+
Work on this repository is planned and recorded here with the workplan
|
|
4
|
+
protocol: https://github.com/bayinfosys/workplan/blob/master/SPEC.md
|
|
5
|
+
|
|
6
|
+
- `<id>/WORKPLAN.md`: a goal, its context and its tasks
|
|
7
|
+
- `<id>/<nnnn>/`: one task, applied as one commit
|
|
8
|
+
- `PRINCIPLES.md`: what every task and review holds to
|
|
9
|
+
- `config.toml`: settings for the `workplan` command
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# workplan configuration. Environment variables override each value
|
|
2
|
+
# (see the workplan README); API keys come from the environment only.
|
|
3
|
+
|
|
4
|
+
master = "master"
|
|
5
|
+
|
|
6
|
+
[llm]
|
|
7
|
+
# Any OpenAI-compatible endpoint; requests go to <api_base>/chat/completions.
|
|
8
|
+
# OpenAI https://api.openai.com/v1 api_key_env = "OPENAI_API_KEY"
|
|
9
|
+
# Anthropic https://api.anthropic.com/v1 api_key_env = "ANTHROPIC_API_KEY"
|
|
10
|
+
# Ollama http://localhost:11434/v1
|
|
11
|
+
# marigold http://localhost:8000/v1
|
|
12
|
+
api_base = "http://localhost:8000/v1"
|
|
13
|
+
api_key_env = "WORKPLAN_API_KEY"
|
|
14
|
+
# params = { temperature = 0 }
|
|
15
|
+
|
|
16
|
+
[route]
|
|
17
|
+
classifier = "rules" # rules | llm
|
|
18
|
+
model = ""
|
|
19
|
+
timeout = 120
|
|
20
|
+
dispatch = "" # run as: <dispatch> <action> <target>...
|
|
21
|
+
|
|
22
|
+
[agent]
|
|
23
|
+
name = "none" # none | claude-code | codex | command
|
|
24
|
+
model = "" # for none
|
|
25
|
+
attempts = 3 # for none
|
|
26
|
+
timeout = 1800
|
|
27
|
+
setup = "" # shell command run in the worktree before the agent
|
|
28
|
+
command = [] # argv for command; "{prompt}" is replaced, else stdin
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Define the tasks of one workplan in a git repository. The repository
|
|
2
|
+
plans its work under workplans/ with the workplan protocol.
|
|
3
|
+
|
|
4
|
+
Workplan: $id
|
|
5
|
+
|
|
6
|
+
The files describing the work, and the files they name:
|
|
7
|
+
|
|
8
|
+
$context
|
|
9
|
+
|
|
10
|
+
Break the goal in WORKPLAN.md into tasks. A task is one change,
|
|
11
|
+
applied as one commit and reviewed as one diff, and needs no further
|
|
12
|
+
decisions before work starts. Order the tasks so that each depends
|
|
13
|
+
only on tasks before it. Hold to PRINCIPLES.md and to the decisions in
|
|
14
|
+
WORKPLAN.md. Existing tasks stay as they are.
|
|
15
|
+
|
|
16
|
+
For each new task, numbered from $next upwards, give two files.
|
|
17
|
+
|
|
18
|
+
TASK.md, in this form, with each $$name and each <...> replaced;
|
|
19
|
+
"Depends on" names earlier task numbers, or "none":
|
|
20
|
+
|
|
21
|
+
$task_template
|
|
22
|
+
BREAKDOWN.md, in this form:
|
|
23
|
+
|
|
24
|
+
$breakdown_template
|
|
25
|
+
Reply with each file after a line of its own naming its path, and
|
|
26
|
+
nothing else:
|
|
27
|
+
|
|
28
|
+
===== workplans/$id/<nnnn>/TASK.md =====
|
|
29
|
+
<the file>
|
|
30
|
+
===== workplans/$id/<nnnn>/BREAKDOWN.md =====
|
|
31
|
+
<the file>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Define the tasks of one workplan in this repository. The repository
|
|
2
|
+
plans its work under workplans/ with the workplan protocol.
|
|
3
|
+
|
|
4
|
+
Workplan: $id
|
|
5
|
+
|
|
6
|
+
The files describing the work:
|
|
7
|
+
|
|
8
|
+
$context
|
|
9
|
+
|
|
10
|
+
Read WORKPLAN.md and the code it names. Break the goal into tasks. A
|
|
11
|
+
task is one change, applied as one commit and reviewed as one diff,
|
|
12
|
+
and needs no further decisions before work starts. Order the tasks so
|
|
13
|
+
that each depends only on tasks before it.
|
|
14
|
+
|
|
15
|
+
For each new task, numbered from $next upwards, write two files.
|
|
16
|
+
|
|
17
|
+
workplans/$id/<nnnn>/TASK.md, in this form, with each $$name and each
|
|
18
|
+
<...> replaced; "Depends on" names earlier task numbers, or "none":
|
|
19
|
+
|
|
20
|
+
$task_template
|
|
21
|
+
workplans/$id/<nnnn>/BREAKDOWN.md, in this form:
|
|
22
|
+
|
|
23
|
+
$breakdown_template
|
|
24
|
+
- Write only these files. Change no code and no other file under
|
|
25
|
+
workplans/; leave existing task directories as they are.
|
|
26
|
+
- Do not commit, stage or change branches.
|
|
27
|
+
- Hold to workplans/PRINCIPLES.md and to the decisions in WORKPLAN.md.
|
|
28
|
+
|
|
29
|
+
Finish with the list of tasks, one line each.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Make one task's change in a git repository. The repository plans its
|
|
2
|
+
work under workplans/ with the workplan protocol.
|
|
3
|
+
|
|
4
|
+
Task: $id
|
|
5
|
+
|
|
6
|
+
The files describing the work, and the files they name:
|
|
7
|
+
|
|
8
|
+
$context
|
|
9
|
+
|
|
10
|
+
Make the change TASK.md states, following BREAKDOWN.md, holding to
|
|
11
|
+
PRINCIPLES.md and to the decisions in WORKPLAN.md. Change only what the
|
|
12
|
+
task needs.
|
|
13
|
+
|
|
14
|
+
Reply with two parts:
|
|
15
|
+
|
|
16
|
+
1. The commit message on a line of its own: one line, starting "$id ",
|
|
17
|
+
then what the change does.
|
|
18
|
+
2. The change as one unified diff in a ```diff fenced block: paths
|
|
19
|
+
relative to the repository root with a/ and b/ prefixes, three lines
|
|
20
|
+
of context for each hunk, applicable with git apply. A new file uses
|
|
21
|
+
--- /dev/null.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Make one task's change in this repository. The repository plans its
|
|
2
|
+
work under workplans/ with the workplan protocol.
|
|
3
|
+
|
|
4
|
+
Task: $id
|
|
5
|
+
|
|
6
|
+
The files describing the work:
|
|
7
|
+
|
|
8
|
+
$context
|
|
9
|
+
|
|
10
|
+
Make the change TASK.md states, following BREAKDOWN.md, holding to
|
|
11
|
+
workplans/PRINCIPLES.md and to the decisions in WORKPLAN.md.
|
|
12
|
+
|
|
13
|
+
- Edit files in the working directory. Do not commit, stage or change
|
|
14
|
+
branches.
|
|
15
|
+
- Change nothing under workplans/ except the commit message file.
|
|
16
|
+
- Build the code and run its existing checks where the repository has
|
|
17
|
+
them. Remove temporary and debugging changes before finishing.
|
|
18
|
+
- Leave out any change the task needs outside its scope, such as a
|
|
19
|
+
refactoring or an unrelated fix, and name it in the final message.
|
|
20
|
+
- Write the commit message to $commit_msg: one line, starting
|
|
21
|
+
"$id ", then what the change does.
|
|
22
|
+
|
|
23
|
+
Finish with a short summary of the change and anything left out.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
A commit was made in a repository that plans work in workplans/.
|
|
2
|
+
workplans/<id>/WORKPLAN.md is a workplan; workplans/<id>/<nnnn>/TASK.md
|
|
3
|
+
and BREAKDOWN.md define a task; a commit whose subject starts
|
|
4
|
+
<id>/<nnnn> is that task's change; a commit on master with a Workplan
|
|
5
|
+
trailer completes a workplan.
|
|
6
|
+
|
|
7
|
+
Actions:
|
|
8
|
+
complete: a workplan reached master
|
|
9
|
+
review: code changed under a task, so it needs checking against the task
|
|
10
|
+
produce-patch: a task definition changed, so its patch needs producing
|
|
11
|
+
define-tasks: the workplan changed, so its tasks need defining
|
|
12
|
+
none: nothing to do
|
|
13
|
+
|
|
14
|
+
Branch: $branch
|
|
15
|
+
Parents: $parents
|
|
16
|
+
Subject: $subject
|
|
17
|
+
Workplan trailer: $workplan
|
|
18
|
+
Changed paths:
|
|
19
|
+
$paths
|
|
20
|
+
|
|
21
|
+
Answer with the action's name only.
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: workplan
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Plan and record development work in git, for agent-driven and AI-assisted development
|
|
5
|
+
Author: Bay Information Systems
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/bayinfosys/workplan
|
|
8
|
+
Project-URL: Repository, https://github.com/bayinfosys/workplan
|
|
9
|
+
Project-URL: Specification, https://github.com/bayinfosys/workplan/blob/master/SPEC.md
|
|
10
|
+
Project-URL: Issues, https://github.com/bayinfosys/workplan/issues
|
|
11
|
+
Project-URL: Bay Information Systems, https://www.bayis.co.uk/
|
|
12
|
+
Keywords: git,planning,agents,ai,workflow
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# workplan
|
|
28
|
+
|
|
29
|
+
Plan and record development work in git, for agent-driven and
|
|
30
|
+
AI-assisted development.
|
|
31
|
+
|
|
32
|
+
A workplan breaks one goal into tasks. Each task is one commit; the
|
|
33
|
+
workplan reaches master as one squash commit listing every task. The
|
|
34
|
+
plans and the task definitions are Markdown files in `workplans/`, and
|
|
35
|
+
every task's state comes from git history. Any clone holds the whole
|
|
36
|
+
record, and every step can be done by hand with git and an editor:
|
|
37
|
+
[SPEC.md](SPEC.md) describes the steps.
|
|
38
|
+
|
|
39
|
+
An agent, such as Claude Code, Codex, or a model behind any
|
|
40
|
+
OpenAI-compatible endpoint, defines the tasks and produces each task's
|
|
41
|
+
patch in a separate worktree. The maintainer reads each diff and
|
|
42
|
+
accepts or rejects it.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pipx install workplan
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Python 3.11 or later and git. No other dependencies.
|
|
51
|
+
|
|
52
|
+
`wp` is installed as a short name for `workplan`. WP-CLI, the WordPress
|
|
53
|
+
command line, also installs `wp`; where both are installed, use
|
|
54
|
+
`workplan`.
|
|
55
|
+
|
|
56
|
+
## Manual, semi-automatic, full auto
|
|
57
|
+
|
|
58
|
+
Run it on full auto for the real vibe coding experience, or manual for the good old days.
|
|
59
|
+
|
|
60
|
+
- **Manual:** git and an editor. [SPEC.md](SPEC.md) gives every step by hand; the `workplan` command is optional.
|
|
61
|
+
- **Semi-automatic:** run each command; Agents define tasks and produce patches; you read the diffs and accept or reject.
|
|
62
|
+
- **Full auto:** `workplan install` adds hooks that route each commit
|
|
63
|
+
to its next step, and `route.dispatch` runs `define-tasks` and
|
|
64
|
+
`produce-patch` as soon as they are due. Accepting each patch and
|
|
65
|
+
merging stay with you.
|
|
66
|
+
|
|
67
|
+
## A workplan from start to finish
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
workplan init # create workplans/ and commit it
|
|
71
|
+
workplan plan greeting # branch workplan/<date>-greeting/definition;
|
|
72
|
+
# the editor opens on WORKPLAN.md: goal, context, findings
|
|
73
|
+
workplan define-tasks # the agent writes the tasks; WORKPLAN.md and the
|
|
74
|
+
# tasks are committed
|
|
75
|
+
git push # share the plan
|
|
76
|
+
|
|
77
|
+
workplan produce-patch 0000 # the agent writes output.patch and COMMIT_MSG
|
|
78
|
+
workplan apply 0000 # stage it
|
|
79
|
+
workplan diff 0000 # read it, test it
|
|
80
|
+
workplan accept 0000 # commit it with the task's files; or: workplan reject 0000
|
|
81
|
+
workplan status
|
|
82
|
+
|
|
83
|
+
workplan merge # squash into master; the editor opens on the message
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The commands commit what they complete: `init`, `define-tasks`,
|
|
87
|
+
`accept` and `merge`. Pushing is the maintainer's.
|
|
88
|
+
|
|
89
|
+
`plan` opens the editor git uses for commit messages, on WORKPLAN.md
|
|
90
|
+
rendered from its template; closing it unchanged creates nothing.
|
|
91
|
+
`plan greeting -m "app.txt says goodbye"` writes the goal and skips the
|
|
92
|
+
editor.
|
|
93
|
+
|
|
94
|
+
Every command also runs as `wp`: `wp plan greeting`, `wp accept 0000`.
|
|
95
|
+
|
|
96
|
+
`examples/demo.sh` runs this cycle in a temporary repository with a
|
|
97
|
+
scripted agent.
|
|
98
|
+
|
|
99
|
+
## Commands
|
|
100
|
+
|
|
101
|
+
| Command | Does |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `init` | create `workplans/` with README, PRINCIPLES.md and config.toml; add the working files to .gitignore; commit |
|
|
104
|
+
| `plan NAME [-m GOAL]` | `workplans/<date>-NAME/WORKPLAN.md` from its template, on a new branch from master |
|
|
105
|
+
| `define-tasks [ID]` | the agent writes each new task's TASK.md and BREAKDOWN.md; they are listed in WORKPLAN.md and committed with it |
|
|
106
|
+
| `produce-patch NNNN` | the agent writes output.patch and COMMIT_MSG |
|
|
107
|
+
| `apply NNNN`, `diff NNNN` | stage the patch; show it |
|
|
108
|
+
| `accept NNNN` | commit the patch with COMMIT_MSG, together with the task's directory and WORKPLAN.md |
|
|
109
|
+
| `reject NNNN` | take an applied patch back out |
|
|
110
|
+
| `merge [ID]` | squash the workplan into master, with the message from its template |
|
|
111
|
+
| `status [ID \| ID/NNNN] [--json]` | each task's state |
|
|
112
|
+
| `route [REV] [--dispatch]` | the next step after a commit |
|
|
113
|
+
| `install` | post-commit and post-merge hooks that run `route --dispatch` |
|
|
114
|
+
|
|
115
|
+
A task is `ID/NNNN`, or `NNNN` in the current branch's workplan.
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
`workplans/config.toml`; `workplan init` writes it with every key.
|
|
120
|
+
Environment variables override it, and API keys come from the
|
|
121
|
+
environment only.
|
|
122
|
+
|
|
123
|
+
| Key | Variable | Default |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `master` | `WORKPLAN_MASTER` | `master` |
|
|
126
|
+
| `llm.api_base` | `WORKPLAN_API_BASE` | `http://localhost:8000/v1` |
|
|
127
|
+
| `llm.api_key_env` | | `WORKPLAN_API_KEY` |
|
|
128
|
+
| `llm.params` | | `{}`, added to each request body |
|
|
129
|
+
| `route.classifier` | `WORKPLAN_ROUTE_CLASSIFIER` | `rules` |
|
|
130
|
+
| `route.model` | `WORKPLAN_ROUTE_MODEL` | |
|
|
131
|
+
| `route.dispatch` | `WORKPLAN_ROUTE_DISPATCH` | |
|
|
132
|
+
| `agent.name` | `WORKPLAN_AGENT` | `none` |
|
|
133
|
+
| `agent.model` | `WORKPLAN_AGENT_MODEL` | |
|
|
134
|
+
| `agent.setup` | `WORKPLAN_AGENT_SETUP` | |
|
|
135
|
+
| `agent.command` | `WORKPLAN_AGENT_COMMAND` | `[]` |
|
|
136
|
+
| `agent.attempts`, `agent.timeout` | | `3`, `1800` |
|
|
137
|
+
|
|
138
|
+
## Agents
|
|
139
|
+
|
|
140
|
+
`define-tasks` and `produce-patch` create a worktree at the head of
|
|
141
|
+
the workplan branch, copy `workplans/` into it, run `agent.setup`, then
|
|
142
|
+
the agent. The worktree is removed afterwards; the maintainer's own
|
|
143
|
+
tree is never touched.
|
|
144
|
+
|
|
145
|
+
- `define-tasks`: the new task directories the agent wrote under
|
|
146
|
+
`workplans/<id>/` are copied back; existing tasks are left alone.
|
|
147
|
+
- `produce-patch`: the worktree's diff outside `workplans/` becomes
|
|
148
|
+
output.patch.
|
|
149
|
+
|
|
150
|
+
| `agent.name` | Runs |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `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 |
|
|
153
|
+
| `claude-code` | `claude -p --allowedTools Read,Edit,Write,Glob,Grep,Bash`, prompt on stdin |
|
|
154
|
+
| `codex` | `codex exec --sandbox workspace-write <prompt>` |
|
|
155
|
+
| `command` | `agent.command`; a `{prompt}` argument is replaced by the prompt, else it goes on stdin |
|
|
156
|
+
|
|
157
|
+
`claude-code` and `codex` are presets of `command`; setting
|
|
158
|
+
`agent.command` replaces the preset's arguments. Agents with a shell
|
|
159
|
+
build the code and run its checks in the worktree. Containers, ports
|
|
160
|
+
and other host resources are shared with the host, so integration runs
|
|
161
|
+
stay with the maintainer.
|
|
162
|
+
|
|
163
|
+
A `command` agent receives `WORKPLAN_ACTION` (`define-tasks` or
|
|
164
|
+
`produce-patch`) and `WORKPLAN_TARGET` (the workplan or task id) in its
|
|
165
|
+
environment, and for `produce-patch`, `WORKPLAN_COMMIT_MSG`: the path
|
|
166
|
+
to write the commit message to. When it writes none, COMMIT_MSG is the
|
|
167
|
+
task id and TASK.md's title.
|
|
168
|
+
|
|
169
|
+
### Examples
|
|
170
|
+
|
|
171
|
+
Claude Code, with the project's dependencies installed first:
|
|
172
|
+
|
|
173
|
+
```toml
|
|
174
|
+
[agent]
|
|
175
|
+
name = "claude-code"
|
|
176
|
+
setup = "uv sync"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Codex:
|
|
180
|
+
|
|
181
|
+
```toml
|
|
182
|
+
[agent]
|
|
183
|
+
name = "codex"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
A model behind an OpenAI-compatible endpoint, with no agent:
|
|
187
|
+
|
|
188
|
+
```toml
|
|
189
|
+
[llm]
|
|
190
|
+
api_base = "https://api.anthropic.com/v1" # or https://api.openai.com/v1
|
|
191
|
+
api_key_env = "ANTHROPIC_API_KEY" # or OPENAI_API_KEY
|
|
192
|
+
|
|
193
|
+
[agent]
|
|
194
|
+
name = "none"
|
|
195
|
+
model = "<model name>"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
A local model, through [marigold](https://marigold.run) or Ollama:
|
|
199
|
+
|
|
200
|
+
```toml
|
|
201
|
+
[llm]
|
|
202
|
+
api_base = "http://localhost:8000/v1" # Ollama: http://localhost:11434/v1
|
|
203
|
+
|
|
204
|
+
[agent]
|
|
205
|
+
name = "none"
|
|
206
|
+
model = "<model name>"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Routing
|
|
210
|
+
|
|
211
|
+
`workplan route` reads a commit and prints the next step: `complete`,
|
|
212
|
+
`review`, `produce-patch`, `define-tasks` or `none`, with its targets.
|
|
213
|
+
The rules are in SPEC.md, section 10. With `route.classifier = "llm"`,
|
|
214
|
+
a model chooses the action from the prompt in
|
|
215
|
+
`templates/prompts/route.md`; the targets still come from the commit,
|
|
216
|
+
and an answer that is not an action with targets falls back to the
|
|
217
|
+
rules. stderr shows both choices:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
$ workplan route
|
|
221
|
+
route: llm chose produce-patch; the rules chose produce-patch
|
|
222
|
+
produce-patch 2026-11-24-greeting/0000
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
`workplan install` adds hooks that run `workplan route --dispatch` in
|
|
226
|
+
the background after each commit. `--dispatch` runs `route.dispatch`
|
|
227
|
+
with the action and its targets. `define-tasks` and `produce-patch` are also command
|
|
228
|
+
names, so a dispatch script can run `workplan "$@"` for those two.
|
|
229
|
+
|
|
230
|
+
## Templates
|
|
231
|
+
|
|
232
|
+
Documents, prompts and the squash commit message are rendered from
|
|
233
|
+
templates with `string.Template`: `$name` is replaced and nothing else
|
|
234
|
+
happens. To change one, copy it from `src/workplan/templates/<kind>/`
|
|
235
|
+
into `workplans/templates/<kind>/` and edit the copy; the rest keep the
|
|
236
|
+
package's version.
|
|
237
|
+
|
|
238
|
+
## Development
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
python -m unittest discover -s tests
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
The tests build temporary repositories, compare each command with its
|
|
245
|
+
"By hand" block in SPEC.md, rehearse two clones sharing one origin, and
|
|
246
|
+
run the `none` agent and the classifier against a local fake endpoint.
|
|
247
|
+
|
|
248
|
+
The version comes from git tags through setuptools-scm. A release is a
|
|
249
|
+
`vX.Y.Z` tag on master:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
git tag v0.1.0
|
|
253
|
+
git push origin v0.1.0
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`.github/workflows/release.yaml` builds the package on every push to
|
|
257
|
+
master; on a tag it publishes the package to PyPI and creates the
|
|
258
|
+
GitHub release. It runs in the `release` environment and needs the
|
|
259
|
+
repository secret `PYPI_API_TOKEN`.
|
|
260
|
+
|
|
261
|
+
## Licence
|
|
262
|
+
|
|
263
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
workplan/__init__.py,sha256=mUaX9C6qpcfDe0n_we0DZbI8ccRr82tKELD577UkEzI,222
|
|
2
|
+
workplan/__main__.py,sha256=s0ijkiFqWf2BoAHcfUbOI4EXjoMrVUQHmm3mVkfxY28,60
|
|
3
|
+
workplan/agent.py,sha256=eEjgrFodeWYwoRQD2pwlxVDCzXoxbpjVSklCmJxDtjk,15654
|
|
4
|
+
workplan/cli.py,sha256=UwHu7nYMrqmJ0IFO8_MCex9j8aDjUon2U8Em_91HKw0,5050
|
|
5
|
+
workplan/config.py,sha256=yyJ6THNtM9cjJOPZ2TuMzzspkyscaem8Yly4H8ZGc2k,2103
|
|
6
|
+
workplan/git.py,sha256=KHPNoN9qegiAELN0D1mY_P96k7e6n0yKmF7UShcUn2E,2246
|
|
7
|
+
workplan/llm.py,sha256=WIkJRv57k49i2Zz7gSt9lXcIBW0wwTmJ1QIevbdd44w,1439
|
|
8
|
+
workplan/ops.py,sha256=fh32H2791wBvf0RgaMMzysST9qrLsl11DDePw6a7ErU,10467
|
|
9
|
+
workplan/plans.py,sha256=0qYmNHD2OkGSEegwRn3bRg-9K4ij_C_M5KelULRIzg4,8772
|
|
10
|
+
workplan/route.py,sha256=9ccbE89tWdiZ3ipaoDzaVpV5vXeH-6qorry_OqQbdUY,3994
|
|
11
|
+
workplan/templates/documents/BREAKDOWN.md,sha256=Dq7EdlWz2gN6BniKZjT4WZFyvGf_veJG3oCVVcp6z80,48
|
|
12
|
+
workplan/templates/documents/NOTES.md,sha256=dadnwzabJrtWKCLS0UeykFR5EMlpiqvVDHZOg0tVeTo,79
|
|
13
|
+
workplan/templates/documents/SQUASH_COMMIT_MSG,sha256=dBfFt9lHhSrANxxwUuPMO3b2UWS5yoK767JX3S6oACE,43
|
|
14
|
+
workplan/templates/documents/TASK.md,sha256=0JabwWfN-KjM4Mj5OTmwSISfTmEYUjCW9IJlBRs7E38,121
|
|
15
|
+
workplan/templates/documents/WORKPLAN.md,sha256=vHSAziy73LrJmS5a8DJSdJSeBttw1ZM7505GDj7LNSk,369
|
|
16
|
+
workplan/templates/project/PRINCIPLES.md,sha256=4fjw4-2HR6ktJoX6iw3jiY_SxelzKcN92tDCvDrciZ4,373
|
|
17
|
+
workplan/templates/project/README.md,sha256=yuFY5Hj_WJbgyy7TvSNgBVOOA9yRKsRRKHnpcx3595U,368
|
|
18
|
+
workplan/templates/project/config.toml,sha256=eVxbMO-6yS_AihB6OkgX7BUZHY7ZxdZfyaulfI08Cxs,1040
|
|
19
|
+
workplan/templates/prompts/define-tasks-none.md,sha256=NJYjgZNjcbynKiC8SULKtmJbylWo0-2Ymv5q7E5EAhs,967
|
|
20
|
+
workplan/templates/prompts/define-tasks.md,sha256=xGSALfu2NyZMeI5VTY-XZFhEUMCdlm8BtIMzgnXqS9M,1012
|
|
21
|
+
workplan/templates/prompts/produce-patch-none.md,sha256=vSmOpDEZIpfii2zn3WJC5A_poj0QLubJZRMgw2BrGAg,703
|
|
22
|
+
workplan/templates/prompts/produce-patch.md,sha256=RubvVZqcZiTLbrHsegAO2R_AP7m16TbSdh3nCWWX6Ho,885
|
|
23
|
+
workplan/templates/prompts/route.md,sha256=XGyg6cLM_M0Dtxqlf5oLWr9x5IPptTT8ONqoCAOzn2g,712
|
|
24
|
+
workplan-0.1.0.dist-info/licenses/LICENSE,sha256=P3ILBGdhYCeA9v7uW97DIbLR8q49BUi-zjVUw5ZqsqA,1080
|
|
25
|
+
workplan-0.1.0.dist-info/METADATA,sha256=uXl-G60973wRGZXAFpQMlndlKAiBr1rCh76cinS0T5A,10018
|
|
26
|
+
workplan-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
27
|
+
workplan-0.1.0.dist-info/entry_points.txt,sha256=4xceOmetaOJPVIvFNwMRCHLuUU_qEGvbJrB3Q5kyXrY,70
|
|
28
|
+
workplan-0.1.0.dist-info/top_level.txt,sha256=CqM1sLiPR0viV1S8e2XWhbf02dZiJR6RggXG6VMHhLc,9
|
|
29
|
+
workplan-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bay Information Systems
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
workplan
|