@softure-ai/skills 0.12.0 → 0.14.0
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.
- package/README.md +1 -1
- package/WORKFLOW.md +20 -2
- package/package.json +1 -1
- package/rules/AGENTS.md +45 -12
- package/skills/softure-init/SKILL.md +1 -1
- package/skills/softure-roadmap/SKILL.md +7 -0
- package/skills/softure-worktree/SKILL.md +10 -0
- package/skills/softure-worktree/scripts/wt-startable.py +153 -0
- package/skills/softure-worktree-manager/SKILL.md +19 -6
- package/skills/softure-worktree-manager/references/report-routine.md +11 -5
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ installer injects only that mode's section into the rules block:
|
|
|
36
36
|
| who decides | the owner, step by step; skills ask | the agent takes the recommended option and records it |
|
|
37
37
|
| implementation | one phase per run, commit on the owner's approval | all phases, one commit per phase |
|
|
38
38
|
| merge into the main branch | on the owner's signal | standing consent: serial merge queue, via PR (`autonomy.merge`) |
|
|
39
|
-
| parallel sessions, reports | only when the owner starts them | coordinator + one session per change, report every 60 min |
|
|
39
|
+
| parallel sessions, reports | only when the owner starts them | coordinator + one session per change, report every 60 min, around the clock |
|
|
40
40
|
| release | the owner | the owner while `release.owner` is true; production deploy always the owner |
|
|
41
41
|
|
|
42
42
|
The autonomous standard (roles of the coordinator and its threads, results always sent to the main
|
package/WORKFLOW.md
CHANGED
|
@@ -84,7 +84,9 @@ or languages.
|
|
|
84
84
|
"merge": "pr", // "pr": pull request with fresh <main>, merged on the forge after green checks (default);
|
|
85
85
|
// "push": local --no-ff merge, then push <main> through the pre-push hook
|
|
86
86
|
"reports": { "every": 60, "hours": null } // coordinator status reports: minutes (default 60, 0 = off), optional "10:00-22:30"
|
|
87
|
-
// window; one recurring routine on full hours, `every` rounded up to a multiple of 60
|
|
87
|
+
// window; one recurring routine on full hours, `every` rounded up to a multiple of 60.
|
|
88
|
+
// `hours: null` = around the clock (24/7), recommended for autonomous runs: the routine
|
|
89
|
+
// is also the heartbeat that starts unblocked items and nudges stalled threads
|
|
88
90
|
},
|
|
89
91
|
"research": { // optional: extra knowledge sources softure-research should consult
|
|
90
92
|
"sources": ["docs/", "context/foundation/prd.md"]
|
|
@@ -480,6 +482,10 @@ AGENTS.md (the managed SOFTURE block) and context/workflow.json from the main br
|
|
|
480
482
|
coordinator described there: follow "Operating mode: autonomous", starting with "Start of a run".
|
|
481
483
|
```
|
|
482
484
|
|
|
485
|
+
**New roadmap.** When the owner hands over a new roadmap, the coordinator starts one roadmap thread
|
|
486
|
+
that only runs `softure-roadmap`, merges `roadmap.md` and ends. Only then does it start one thread
|
|
487
|
+
per ready item. A single thread never records a roadmap and implements its items.
|
|
488
|
+
|
|
483
489
|
Nothing else needs saying: the rules, the roadmap and the owner's standing orders live in the
|
|
484
490
|
repository (§8.4). Thread briefs still name "follow AGENTS.md → Operating mode: autonomous"; a thread
|
|
485
491
|
runs in a checkout and reads the block itself.
|
|
@@ -490,7 +496,7 @@ runs in a checkout and reads the block itself.
|
|
|
490
496
|
| --- | --- | --- |
|
|
491
497
|
| launch (M3) | `wm-launch.sh` | start a thread session with the standard brief (item ID, change-id, outcome, base, owned files, waits for, merge path, report-to, "follow AGENTS.md → Operating mode: autonomous") |
|
|
492
498
|
| in-flight state (M0.1) | `wm-resume.sh` | roadmap rows on `origin/<main>` (with `cloudState: "branch"` they show only at merge, so also memory), the harness's thread list, open pull requests |
|
|
493
|
-
| watch (M4) | `wm-watch.sh` Monitor | thread messages and the report routine; no polling |
|
|
499
|
+
| watch (M4) | `wm-watch.sh` Monitor | thread messages and the report routine; no polling when PR events reach the threads, otherwise each thread polls its own CI (below) |
|
|
494
500
|
| READY / merged report | `SendMessage` | cross-session message to the coordinator's session, never a reply in the thread |
|
|
495
501
|
| go | a signal in the conversation | coordinator-to-thread message |
|
|
496
502
|
| branch | `<change-id>` in a worktree | the branch the harness assigns; the change-id lives in `context/changes/` and `change.md` → `branch:` |
|
|
@@ -498,6 +504,18 @@ runs in a checkout and reads the block itself.
|
|
|
498
504
|
| reports / heartbeat | `CronCreate` | a recurring routine; without a scheduling tool, a setup thread creates it from `softure-worktree-manager/references/report-routine.md` |
|
|
499
505
|
| close | `claude stop` + worktree removal | the thread resolves itself after its pull request is merged; on the merge result the coordinator checks it and resolves it if still open |
|
|
500
506
|
|
|
507
|
+
**When PR events do not arrive.** A thread checks at session start whether pull request activity can
|
|
508
|
+
reach it (the subscription succeeds, the forge app has access to the repository). If not, after every
|
|
509
|
+
push it checks its pull request's checks itself until they finish (a scheduled wake-up every few
|
|
510
|
+
minutes, at most about 60 minutes) instead of ending the turn waiting for an event. The coordinator
|
|
511
|
+
records in memory which forge events do not arrive in this project, and nudges a thread whose go has
|
|
512
|
+
produced no merge SHA within 30 minutes.
|
|
513
|
+
|
|
514
|
+
**Startable set.** On every merge result and every report the coordinator recomputes, from
|
|
515
|
+
`roadmap.md` on `origin/<main>`, every item that is not done, has no thread and has all prerequisites
|
|
516
|
+
on `<main>` (or none), and starts a thread for each; `softure-worktree/scripts/wt-startable.py` prints
|
|
517
|
+
the set. It never derives the next start only from the thread that just merged.
|
|
518
|
+
|
|
501
519
|
`worktree.cloudState` (§2) and `install.gitignore: false` (for containers that never run
|
|
502
520
|
`npm install`) apply to the threads as to any cloud session. Forge access in a hosted session is often
|
|
503
521
|
scoped to the project's own repository: attach a repository the run needs (for example SOFTURE/SKILLS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/skills",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "SOFTURE agent skills: a spec-driven delivery workflow (shape → prd → roadmap → plan → implement → review) plus parallel worktree orchestration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/rules/AGENTS.md
CHANGED
|
@@ -108,10 +108,14 @@ irreversible action nobody asked for, a secret or access only the owner has, sco
|
|
|
108
108
|
hosted project's main-chat session on its first message) starts the run itself, without waiting for
|
|
109
109
|
the owner's "go":
|
|
110
110
|
1. read `context/workflow.json` and the roadmap (or the issue queue) on the main branch; outside a
|
|
111
|
-
checkout, read them, and this block, from the repository first
|
|
111
|
+
checkout, read them, and this block, from the repository first. Then read the project's memory and
|
|
112
|
+
its own coordinator conventions (the project's `AGENTS.md` outside this block). When memory lacks
|
|
113
|
+
the run state (the serial merge queue holder, the report routine id, the lanes, which forge events
|
|
114
|
+
do not reach the threads), write it there before starting threads;
|
|
112
115
|
2. adopt what is already in flight: roadmap rows `in_progress` or `ready_to_merge`, the harness's open
|
|
113
116
|
threads, open pull requests (`softure-worktree-manager` M0.1); give the go to every READY thread;
|
|
114
|
-
3. start a thread for every
|
|
117
|
+
3. start a thread for every startable item (below), items with no prerequisites included, whatever
|
|
118
|
+
lane they sit in;
|
|
115
119
|
4. create the report routine and post the first roadmap report.
|
|
116
120
|
Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
117
121
|
|
|
@@ -132,9 +136,19 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
|
132
136
|
- One thread = one change (one issue). Very similar tiny items may share a thread; items that touch
|
|
133
137
|
the same files go to the same thread or wait. A planning thread hands its result over and is closed.
|
|
134
138
|
Before starting a thread, check that the item has none yet.
|
|
139
|
+
- **A new roadmap is two steps, never one thread.** When the owner hands over a new roadmap (or a
|
|
140
|
+
revision), brief one roadmap thread that only shapes, records, commits and merges `roadmap.md`,
|
|
141
|
+
then ends. Once it is merged, start one thread per ready item, as for any run. Never brief a single
|
|
142
|
+
thread to record a roadmap and implement its items, or to implement a whole roadmap.
|
|
135
143
|
- Runs as many threads as are parallel-safe; `worktree.maxParallel` is a soft default.
|
|
136
|
-
- **The roadmap keeps rolling
|
|
137
|
-
|
|
144
|
+
- **The roadmap keeps rolling: recompute the startable set on every merge result and every report.**
|
|
145
|
+
Read `roadmap.md` on `origin/<main>`; every item that is not done, has no thread, and whose
|
|
146
|
+
prerequisites are all `done` or `done_code` on `<main>` (or has none) gets a thread now, within the
|
|
147
|
+
parallel-safe limit. Never derive it only from the thread that just merged or from its lane
|
|
148
|
+
successor: an item with no prerequisites is never "unblocked by a merge", and an item a sloppy
|
|
149
|
+
merge round missed must still be picked up. `softure-worktree/scripts/wt-startable.py` prints the
|
|
150
|
+
set (`START` rows; `WAIT` rows name the missing prerequisites). Never wait for the rest of the wave.
|
|
151
|
+
Take no new items beyond the roadmap or the issue queue without the owner.
|
|
138
152
|
- A brief names the item ID and change-id, the outcome, the base branch, the files it owns, what it
|
|
139
153
|
waits for, the merge path, how to report back (condensed, to the coordinator's session), and "follow
|
|
140
154
|
AGENTS.md → Operating mode: autonomous". Project-specific standing orders are appended.
|
|
@@ -143,13 +157,16 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
|
143
157
|
the owner. **Check every thread waiting for your go on every report and every wake-up**: give the go
|
|
144
158
|
or say what blocks it. A green PR that sits unmerged because nobody said "go" is the coordinator's
|
|
145
159
|
failure.
|
|
160
|
+
- **Stale go:** a thread that got its go and has sent no merge SHA within 30 minutes is nudged at once
|
|
161
|
+
(what is it waiting for, CI or a conflict?), not at the next report.
|
|
146
162
|
- Posts every thread's result in the main chat as it arrives (condensed, decision first).
|
|
147
163
|
- **Makes sure finished threads are closed.** On every merge result, and whenever a thread with a
|
|
148
164
|
one-off job hands its result over (a planning thread, the report routine setup thread once it sends
|
|
149
165
|
the routine id back, a report thread), check that the thread is resolved and resolve it yourself
|
|
150
166
|
(`set_thread_resolved` or the equivalent) if it is not. Never close a thread whose pull request is
|
|
151
167
|
still open.
|
|
152
|
-
- Nudges stalled threads (waiting on CI, stopped by a usage limit) on every report
|
|
168
|
+
- Nudges stalled threads (waiting on CI, stopped by a usage limit) on every report: every working
|
|
169
|
+
thread silent for 45 minutes or more gets a nudge in that firing.
|
|
153
170
|
- A new question about the roadmap goes to a new thread; the old one is closed.
|
|
154
171
|
|
|
155
172
|
**Thread duties:**
|
|
@@ -157,6 +174,11 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
|
157
174
|
- At READY (green PR, fresh main branch merged in): send the condensed result to the coordinator and
|
|
158
175
|
wait for its go. Never write that it waits for the owner. Without a coordinator, merge at READY.
|
|
159
176
|
- After the go: merge (below), then send the merge result to the coordinator.
|
|
177
|
+
- **Watch your own CI when PR events cannot reach you.** At session start, check whether pull request
|
|
178
|
+
activity can reach the thread (the subscription succeeds, the forge app has access to the
|
|
179
|
+
repository). If not, after every push check the pull request's checks yourself until they finish:
|
|
180
|
+
a scheduled wake-up every few minutes, for at most about 60 minutes, then report what is still
|
|
181
|
+
pending. Never end the turn waiting for an event that cannot arrive.
|
|
160
182
|
- **Close the thread only when the work is really done: its pull request is merged into the main
|
|
161
183
|
branch** (`set_thread_resolved` or the equivalent). A thread with an open pull request stays open,
|
|
162
184
|
READY included. It stays open also while an owner action gates its result.
|
|
@@ -165,6 +187,9 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
|
165
187
|
- Merges are serial, first ready first merged. A ready merge never waits for the owner.
|
|
166
188
|
- Right before merging, merge the fresh main branch into the branch and resolve conflicts yourself.
|
|
167
189
|
The main branch is the source of truth: what it has and the branch lacks is pulled in and wired.
|
|
190
|
+
- Merging the fresh main branch in does not re-run the full local suite when the incoming changes
|
|
191
|
+
touch no file the branch changes and add no migration: the pull request's CI on the merged branch is
|
|
192
|
+
the gate. Overlapping files or a migration: run the full gates again before pushing.
|
|
168
193
|
- `autonomy.merge: "pr"` (default): open a pull request (`Closes #N` when it solves an issue), wait for
|
|
169
194
|
green checks, merge it on the forge; the forge deletes the head branch. `"push"`: `git merge --no-ff`
|
|
170
195
|
locally, then push the main branch through the pre-push hook.
|
|
@@ -178,7 +203,11 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
|
178
203
|
|
|
179
204
|
**Roadmap reports** (coordinator, pasted into the main chat, times in `timezone`):
|
|
180
205
|
- When: after every batch of thread starts (an ad-hoc post), and every `autonomy.reports.every`
|
|
181
|
-
minutes (default 60) on full hours inside `autonomy.reports.hours`, only while work runs.
|
|
206
|
+
minutes (default 60) on full hours inside `autonomy.reports.hours`, only while work runs.
|
|
207
|
+
`hours: null` (the default) means around the clock, and that is the recommended setting for an
|
|
208
|
+
autonomous run: the report routine is also the run's heartbeat (it recomputes the startable set,
|
|
209
|
+
gives the go, nudges stalled threads), so a window that sleeps at night leaves the night
|
|
210
|
+
unsupervised. Routines
|
|
182
211
|
fire at most once an hour, on the full hour, so the schedule is `every` rounded up to a multiple of
|
|
183
212
|
60 (60 → `0 * * * *`, 120 → `0 */2 * * *`; `wt_config.py --report-cron` prints it); a value below 60
|
|
184
213
|
runs hourly. **One recurring routine** drives the reports: the coordinator creates it when work
|
|
@@ -198,10 +227,12 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
|
|
|
198
227
|
- **ID**: the roadmap item ID, an uppercase prefix of two or three letters plus a number (`FC-5`,
|
|
199
228
|
`SA-12`, `CMP-3`); in issue mode the issue number (`#42`). Bold, nothing else in the cell.
|
|
200
229
|
- **What it does**: the outcome in a few words.
|
|
201
|
-
- **Stage**: `waiting for <IDs
|
|
230
|
+
- **Stage**: `waiting for <IDs>` (the prerequisite IDs not yet on `<main>`; `waiting for
|
|
231
|
+
predecessors` without IDs is invalid), `research`, `frame`, `plan`, `plan-review`, `implement N/M`,
|
|
202
232
|
`impl-review`, `integration`, `archive`, `ready to merge (PR #N)`, `merging (PR #N)`,
|
|
203
233
|
`blocked (<why>)`, `waits for the owner (<what>)`; add `stalled` when the thread has not moved
|
|
204
|
-
since the last report.
|
|
234
|
+
since the last report. An item whose prerequisites are all on `<main>` but has no thread is a
|
|
235
|
+
coordinator failure: start its thread in the same firing, before posting the report.
|
|
205
236
|
- **Link**: a markdown link to the thread that carries the item, `[thread](<url>)`; `—` when it has
|
|
206
237
|
none. Never a forge URL: the PR number lives in Stage;
|
|
207
238
|
4. `Decision: …` when the owner has something to decide;
|
|
@@ -264,12 +295,14 @@ pull requests, CI, releases, issues), then nudge the interrupted threads. If the
|
|
|
264
295
|
push, merge or publish this section covers, cite this section and `mode` once; if it still refuses,
|
|
265
296
|
ask the owner for a word in that session and keep the other work going.
|
|
266
297
|
|
|
267
|
-
**Memory** holds only project state (queue, IDs, counters, the owner's specific orders and decisions)
|
|
268
|
-
|
|
269
|
-
|
|
298
|
+
**Memory** holds only project state (queue, IDs, counters, the owner's specific orders and decisions)
|
|
299
|
+
and the run state a fresh coordinator needs (the merge queue holder, the report routine id, the lanes,
|
|
300
|
+
which forge events do not reach the threads). The rules above are not memory material. **When the
|
|
301
|
+
owner has to explain or correct how the process runs** (a step that should have happened by itself, a rule that is missing or wrong), that is a gap in
|
|
270
302
|
these skills: the session that received it checks SOFTURE/SKILLS for a duplicate, files an issue right
|
|
271
303
|
away (neutral text, "an adopting app") and posts the link in the main chat. Memory keeps only the
|
|
272
|
-
project-specific order itself.
|
|
304
|
+
project-specific order itself. The same holds when an audit finds a coordinator miss: record the
|
|
305
|
+
project-specific consequence in memory, file the generic gap.
|
|
273
306
|
|
|
274
307
|
## Conventions
|
|
275
308
|
|
|
@@ -133,7 +133,7 @@ only when it was detected or the user asked for it:
|
|
|
133
133
|
| `worktree.cloudState` | `"main"` | the user runs cloud sessions that must keep state on the branch (`"branch"`) |
|
|
134
134
|
| `research.sources` | none | step 2 found docs, ADRs or a PRD (interactive: listed in the plan; `--auto`: only paths that exist) |
|
|
135
135
|
| `install` | gitignore the skills, inject all rule sections | the user wants committed skills or fewer rule sections (the language section always ships; `allowNonEnglishCode: true` only on the owner's explicit word) |
|
|
136
|
-
| `autonomy` | roadmap as the work source, merge via pull request, reports every 60 min (`reports.every`; routines fire at most hourly) | `mode` is `autonomous` and the user names issues as the queue, merges by push, or another report cadence |
|
|
136
|
+
| `autonomy` | roadmap as the work source, merge via pull request, reports every 60 min around the clock (`reports.every`, `reports.hours: null`; routines fire at most hourly; the routine is also the run's heartbeat, so keep it 24/7) | `mode` is `autonomous` and the user names issues as the queue, merges by push, or another report cadence |
|
|
137
137
|
|
|
138
138
|
Content of the README files, and a complete worked example (detection, plan, report) for a
|
|
139
139
|
fictional repo: read `references/templates.md` **when writing the READMEs** and
|
|
@@ -290,6 +290,9 @@ Record each choice under `## Decisions (auto)` at the end of the file:
|
|
|
290
290
|
and `softure-archive`.
|
|
291
291
|
- Do not estimate in hours, days, points or sizes. Order and slice size are the planning tools here.
|
|
292
292
|
- Do not chain into the next skill on your own; the handoff is a recommendation.
|
|
293
|
+
- Do not implement roadmap items in the session that wrote the roadmap. In a coordinated run
|
|
294
|
+
(autonomous mode, a hosted project), the roadmap thread commits and merges `roadmap.md`, reports to
|
|
295
|
+
the coordinator, and ends; the coordinator then starts one thread per item.
|
|
293
296
|
|
|
294
297
|
## Handoff
|
|
295
298
|
|
|
@@ -305,3 +308,7 @@ item, not a menu. Take the first rule that applies:
|
|
|
305
308
|
Name the command (`softure-new <change-id>`, or `--open-changes` then `softure-worktree-manager`
|
|
306
309
|
for parallel execution, `softure-worktree <ID>` for one item end to end), the next two items after
|
|
307
310
|
it, and what waits for the owner.
|
|
311
|
+
|
|
312
|
+
**In a coordinated run, this thread ends here.** Once `roadmap.md` is merged into the main branch,
|
|
313
|
+
send the summary to the coordinator and close the thread. The coordinator starts one thread per
|
|
314
|
+
ready item (`AGENTS.md` → Operating mode: autonomous); this thread never implements an item.
|
|
@@ -873,6 +873,16 @@ coordinator, the report is sent after the merge with its SHA and PR.
|
|
|
873
873
|
Then end the turn. Don't poll, don't schedule wake-ups, and don't ask "shall I
|
|
874
874
|
merge?". The report already says what happens next.
|
|
875
875
|
|
|
876
|
+
**Exception: PR events cannot reach this session.** In a cloud session with
|
|
877
|
+
`autonomy.merge: "pr"`, check at session start whether pull request activity can
|
|
878
|
+
reach you (subscribing to the pull request succeeds, the forge app has access
|
|
879
|
+
to the repository). If it cannot, ending the turn after a push or after the go
|
|
880
|
+
means sleeping until someone nudges you. Then, after every push of a branch
|
|
881
|
+
with an open pull request (READY, and Phase B after the go), check its checks
|
|
882
|
+
yourself until they finish: a scheduled wake-up every few minutes, for at most
|
|
883
|
+
about 60 minutes, then report to the coordinator what is still pending. When
|
|
884
|
+
the checks are green after the go, merge at once.
|
|
885
|
+
|
|
876
886
|
## Phase B — merge (on the owner's signal; autonomous mode: see *Operating mode*)
|
|
877
887
|
|
|
878
888
|
Signals (in any language the owner uses): "merge", "go into main", "main is free",
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Print the startable set of the roadmap on the main branch, so the coordinator's check is mechanical.
|
|
3
|
+
|
|
4
|
+
wt-startable.py [--ref <git-ref>] [--file <path>] [--no-fetch]
|
|
5
|
+
|
|
6
|
+
Reads `context/foundation/roadmap.md` from `origin/<main>` (fetched first; `--ref` picks another ref,
|
|
7
|
+
`--file` a file on disk) and prints one line per item that is not done yet:
|
|
8
|
+
|
|
9
|
+
START FC-3 pricing-one-section no prerequisites
|
|
10
|
+
START FC-5 checkout-summary prerequisites on main: FC-1, FC-2
|
|
11
|
+
PROPOSED FC-9 dark-mode prerequisites on main (start when no START item can take a slot)
|
|
12
|
+
WAIT FC-6 invoice-pdf waiting for FC-5 (in_progress), FC-7 (ready)
|
|
13
|
+
FLIGHT FC-4 password-reset in_progress (implement 2/3, since 2026-10-20; ...)
|
|
14
|
+
BLOCKED FC-8 sso-login blocked (SOFTURE/AI#301)
|
|
15
|
+
OWNER FC-10 release Mode: owner
|
|
16
|
+
|
|
17
|
+
START = `ready`, `Mode` is `autonomous`, every prerequisite `done` or `done_code` on the main branch (or
|
|
18
|
+
none). Every START item that has no thread yet gets one now (`rules/AGENTS.md` → Coordinator duties).
|
|
19
|
+
WAIT always names the missing prerequisite IDs with their status; use them verbatim in the report's
|
|
20
|
+
Stage (`waiting for FC-5, FC-7`). FLIGHT rows are `in_progress` or `ready_to_merge`: they should have a
|
|
21
|
+
thread; one without a thread is adopted (`softure-worktree-manager` M0.1).
|
|
22
|
+
|
|
23
|
+
The script cannot see threads: it lists what the roadmap allows, the coordinator matches it against
|
|
24
|
+
its thread list. Parsing follows WORKFLOW.md §5; a prerequisite ID that is not in the table counts as
|
|
25
|
+
done only when `## Done` names it. Only the `## At a glance` table is read.
|
|
26
|
+
"""
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
import argparse
|
|
30
|
+
import os
|
|
31
|
+
import re
|
|
32
|
+
import subprocess
|
|
33
|
+
import sys
|
|
34
|
+
|
|
35
|
+
sys.dont_write_bytecode = True # no __pycache__ inside the consumer's .claude/skills
|
|
36
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
37
|
+
from wt_config import main_branch, main_root # noqa: E402
|
|
38
|
+
|
|
39
|
+
ROADMAP = "context/foundation/roadmap.md"
|
|
40
|
+
ID_RE = re.compile(r"[A-Z]+-\d+")
|
|
41
|
+
ROW_RE = re.compile(r"^\| \*\*(?P<id>[A-Z]+-\d+)\*\* \| `(?P<change>[^`]+)` \|")
|
|
42
|
+
DONE_STATUSES = ("done", "done_code")
|
|
43
|
+
FLIGHT_STATUSES = ("in_progress", "ready_to_merge")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def read_roadmap(args: argparse.Namespace) -> str:
|
|
47
|
+
if args.file:
|
|
48
|
+
with open(args.file, encoding="utf-8") as fh:
|
|
49
|
+
return fh.read()
|
|
50
|
+
root = main_root()
|
|
51
|
+
ref = args.ref
|
|
52
|
+
if not ref:
|
|
53
|
+
branch = main_branch(root)
|
|
54
|
+
ref = f"origin/{branch}"
|
|
55
|
+
if not args.no_fetch:
|
|
56
|
+
subprocess.run(["git", "-C", root, "fetch", "-q", "origin", branch], capture_output=True)
|
|
57
|
+
shown = subprocess.run(["git", "-C", root, "show", f"{ref}:{ROADMAP}"], capture_output=True, text=True)
|
|
58
|
+
if shown.returncode != 0:
|
|
59
|
+
sys.exit(f"cannot read {ROADMAP} at {ref}: {shown.stderr.strip()}")
|
|
60
|
+
return shown.stdout
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def cells(line: str) -> list[str]:
|
|
64
|
+
return [cell.strip() for cell in line.strip().strip("|").split("|")]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def status_word(status: str) -> str:
|
|
68
|
+
return status.replace("*", "").strip().split(" ", 1)[0].split("(", 1)[0]
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def parse(text: str) -> tuple[list[dict], set[str]]:
|
|
72
|
+
items: list[dict] = []
|
|
73
|
+
done_section: set[str] = set()
|
|
74
|
+
section = ""
|
|
75
|
+
for line in text.splitlines():
|
|
76
|
+
if line.startswith("## "):
|
|
77
|
+
section = line[3:].strip().lower()
|
|
78
|
+
continue
|
|
79
|
+
if section == "done":
|
|
80
|
+
done_section.update(ID_RE.findall(line))
|
|
81
|
+
continue
|
|
82
|
+
if section != "at a glance" or not ROW_RE.match(line):
|
|
83
|
+
continue
|
|
84
|
+
row = cells(line)
|
|
85
|
+
if len(row) < 6:
|
|
86
|
+
continue
|
|
87
|
+
items.append({
|
|
88
|
+
"id": row[0].strip("*"),
|
|
89
|
+
"change": row[1].strip("`"),
|
|
90
|
+
"deps": ID_RE.findall(row[3]),
|
|
91
|
+
"mode": row[4].strip().lower(),
|
|
92
|
+
"status": row[-1].replace("*", "").strip(),
|
|
93
|
+
})
|
|
94
|
+
return items, done_section
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def classify(items: list[dict], done_section: set[str]) -> list[tuple[str, dict, str]]:
|
|
98
|
+
status_of = {item["id"]: status_word(item["status"]) for item in items}
|
|
99
|
+
rows = []
|
|
100
|
+
for item in items:
|
|
101
|
+
word = status_word(item["status"])
|
|
102
|
+
if word in DONE_STATUSES:
|
|
103
|
+
continue
|
|
104
|
+
if word in FLIGHT_STATUSES:
|
|
105
|
+
rows.append(("FLIGHT", item, item["status"]))
|
|
106
|
+
continue
|
|
107
|
+
if word == "blocked":
|
|
108
|
+
rows.append(("BLOCKED", item, item["status"]))
|
|
109
|
+
continue
|
|
110
|
+
if item["mode"] == "owner":
|
|
111
|
+
rows.append(("OWNER", item, "Mode: owner"))
|
|
112
|
+
continue
|
|
113
|
+
missing = [
|
|
114
|
+
dep for dep in item["deps"]
|
|
115
|
+
if status_of.get(dep) not in DONE_STATUSES and not (dep not in status_of and dep in done_section)
|
|
116
|
+
]
|
|
117
|
+
if missing:
|
|
118
|
+
named = ", ".join(f"{dep} ({status_of.get(dep, 'not on the roadmap')})" for dep in missing)
|
|
119
|
+
rows.append(("WAIT", item, f"waiting for {named}"))
|
|
120
|
+
continue
|
|
121
|
+
reason = f"prerequisites on main: {', '.join(item['deps'])}" if item["deps"] else "no prerequisites"
|
|
122
|
+
if word == "ready":
|
|
123
|
+
rows.append(("START", item, reason))
|
|
124
|
+
elif word == "proposed":
|
|
125
|
+
rows.append(("PROPOSED", item, f"{reason} (start when no START item can take a slot)"))
|
|
126
|
+
else:
|
|
127
|
+
rows.append(("UNKNOWN", item, f"unrecognised status: {item['status']}"))
|
|
128
|
+
return rows
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def main() -> None:
|
|
132
|
+
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
|
133
|
+
parser.add_argument("--ref", help="git ref to read the roadmap from (default: origin/<main>)")
|
|
134
|
+
parser.add_argument("--file", help="read this roadmap file instead of a git ref")
|
|
135
|
+
parser.add_argument("--no-fetch", action="store_true", help="do not fetch origin/<main> first")
|
|
136
|
+
args = parser.parse_args()
|
|
137
|
+
|
|
138
|
+
items, done_section = parse(read_roadmap(args))
|
|
139
|
+
if not items:
|
|
140
|
+
sys.exit(f"no roadmap rows found in {ROADMAP} (WORKFLOW.md §5 table format)")
|
|
141
|
+
rows = classify(items, done_section)
|
|
142
|
+
order = ["START", "PROPOSED", "WAIT", "FLIGHT", "BLOCKED", "OWNER", "UNKNOWN"]
|
|
143
|
+
rows.sort(key=lambda row: order.index(row[0]))
|
|
144
|
+
id_width = max((len(item["id"]) for _, item, _ in rows), default=0)
|
|
145
|
+
change_width = max((len(item["change"]) for _, item, _ in rows), default=0)
|
|
146
|
+
for kind, item, detail in rows:
|
|
147
|
+
print(f"{kind:<9} {item['id']:<{id_width}} {item['change']:<{change_width}} {detail}")
|
|
148
|
+
if not rows:
|
|
149
|
+
print("nothing left: every roadmap item is done or done_code")
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
if __name__ == "__main__":
|
|
153
|
+
main()
|
|
@@ -121,7 +121,14 @@ project's main-chat session: no shell over the workers, no `claude agents`, no
|
|
|
121
121
|
| M5 cleanup | `claude stop` + worktree removal | the thread resolves itself after its pull request is merged; on its merge result check it and resolve it if still open |
|
|
122
122
|
|
|
123
123
|
A fresh main-chat session starts the run by itself (`AGENTS.md` → Start of a
|
|
124
|
-
run); it does not wait for this skill to be invoked.
|
|
124
|
+
run); it does not wait for this skill to be invoked. It loads the project's
|
|
125
|
+
memory and coordinator conventions first, and records the run state there
|
|
126
|
+
(merge queue holder, routine id, lanes, which forge events do not arrive).
|
|
127
|
+
On every merge result and every report firing it recomputes the startable set
|
|
128
|
+
from the roadmap (M6), nudges a thread whose go has produced no merge SHA
|
|
129
|
+
within 30 minutes, and nudges every working thread silent for 45 minutes or
|
|
130
|
+
more. Where PR events do not reach the threads, they poll their own CI
|
|
131
|
+
(`softure-worktree` → READY).
|
|
125
132
|
|
|
126
133
|
## The coordinator does not fix — it commissions
|
|
127
134
|
|
|
@@ -387,7 +394,7 @@ job), then:
|
|
|
387
394
|
CronCreate(
|
|
388
395
|
cron: "4,19,34,49 * * * *", # every 15 min, off the :00/:30 marks
|
|
389
396
|
recurring: true,
|
|
390
|
-
prompt: "Status for the owner + loop heartbeat (/softure-worktree-manager). If several of these fired while busy, do one. 1) bash <M>/wm-resume.sh + the latest commits of the worker branches. 2) Report as the status table (format under 'The report itself'); nothing moved → one line. 3) Resume the loop by the wm-resume actions (M0.1 table): MERGE → M5 and M6; NUDGE → SendMessage 'continue' (usage limit: after its reset time); RELAUNCH → claude stop + wm-launch.sh; wm-watch Monitor expired → re-arm with the IDs in flight;
|
|
397
|
+
prompt: "Status for the owner + loop heartbeat (/softure-worktree-manager). If several of these fired while busy, do one. 1) bash <M>/wm-resume.sh + the latest commits of the worker branches. 2) Report as the status table (format under 'The report itself'); nothing moved → one line. 3) Resume the loop by the wm-resume actions (M0.1 table): MERGE → M5 and M6; NUDGE → SendMessage 'continue' (usage limit: after its reset time); RELAUNCH → claude stop + wm-launch.sh; wm-watch Monitor expired → re-arm with the IDs in flight; recompute the startable set over the whole roadmap (python3 <S>/wt-startable.py), and every START item without a session and without collision → M1–M3. Work until the roadmap is done / done_code. 4) End → M7 (integration suite on <main>, unless the release covers it; close the roadmap and push <main> only if the roadmap header orders it; tag, release and deploy never — those are the owner's) and CronDelete this job. Write the report in chatLanguage (default: language) and the times in the timezone from context/workflow.json; paste the content into the message, never a file to link.")
|
|
391
398
|
```
|
|
392
399
|
|
|
393
400
|
This prompt is also the run's **heartbeat**: a worker stuck on a usage limit
|
|
@@ -527,10 +534,16 @@ points of this skill:
|
|
|
527
534
|
point: pick the next item, queue it, launch it, keep the order of `## Order`,
|
|
528
535
|
without asking.
|
|
529
536
|
|
|
530
|
-
After every merge
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
`
|
|
537
|
+
After every merge **and on every status firing**, run M1 again over the whole
|
|
538
|
+
roadmap on `origin/<main>`, not only over the successors of the item that just
|
|
539
|
+
merged: every item that is not done, has no session, and whose prerequisites
|
|
540
|
+
are all `done` / `done_code` on `<main>` (or has none) is eligible now, not
|
|
541
|
+
after the whole batch. An item with no prerequisites is never "unblocked by a
|
|
542
|
+
merge", so a refill that looks only at the merged item never starts it.
|
|
543
|
+
`python3 <S>/wt-startable.py` prints the set (`START` rows; `WAIT` rows name
|
|
544
|
+
the missing prerequisites, which is what the report's `waiting for <IDs>`
|
|
545
|
+
shows). Queue (M2), launch (M3), add them to the watch (re-arm the Monitor
|
|
546
|
+
with the new ID list — `TaskStop` the old one first).
|
|
534
547
|
|
|
535
548
|
### M7 — Done
|
|
536
549
|
|
|
@@ -34,12 +34,18 @@ Roadmap report for <roadmap name> (SOFTURE workflow, AGENTS.md → Operating mod
|
|
|
34
34
|
If several firings queued up while busy, do one.
|
|
35
35
|
- Running as the coordinator: post the roadmap report in the main chat in the standard shape
|
|
36
36
|
(title, "X of N on <main>", the four-column table of the items not done yet, Decision, times),
|
|
37
|
-
in chatLanguage, times in timezone.
|
|
38
|
-
|
|
37
|
+
in chatLanguage, times in timezone. Before posting, run the heartbeat: recompute the startable set
|
|
38
|
+
from roadmap.md on origin/<main> (softure-worktree/scripts/wt-startable.py; never only the
|
|
39
|
+
successors of the last merge) and start a thread for every item that is not done, has no thread
|
|
40
|
+
and has all prerequisites on <main> or none; give the go to every READY thread; nudge every
|
|
41
|
+
thread whose go has produced no merge SHA for 30 minutes and every working thread silent for
|
|
42
|
+
45 minutes or more. Stage "waiting for <IDs>" names the prerequisite IDs not on <main> yet.
|
|
43
|
+
Nothing moved: one line.
|
|
39
44
|
- Running in a session of its own: read <owner/repo> on the main branch (context/foundation/roadmap.md,
|
|
40
|
-
open pull requests and their checks
|
|
41
|
-
facts in one message ("Report due <HH:MM>: X of
|
|
42
|
-
|
|
45
|
+
open pull requests and their checks; the startable set from wt-startable.py), send the
|
|
46
|
+
coordinator's session <coordinator session id> the facts in one message ("Report due <HH:MM>: X of
|
|
47
|
+
N on <main>; startable: <IDs>; <ID> <stage> (PR #N, checks); ...") and ask it to post the report
|
|
48
|
+
and run its heartbeat. Then end this session. Change nothing in
|
|
43
49
|
the repository.
|
|
44
50
|
```
|
|
45
51
|
|