teamsmith 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +156 -2
- package/bin/team.mjs +59 -0
- package/install.sh +94 -0
- package/package.json +37 -4
- package/skills/teamsmith/CHANGELOG.md +747 -0
- package/skills/teamsmith/SKILL.md +312 -0
- package/skills/teamsmith/extension/team-bg.ts +399 -0
- package/skills/teamsmith/extension/team-inbox-watch.ts +1412 -0
- package/skills/teamsmith/extension/team-notify.ts +524 -0
- package/skills/teamsmith/references/agent-adapters.md +643 -0
- package/skills/teamsmith/references/config.md +477 -0
- package/skills/teamsmith/references/meeting.md +124 -0
- package/skills/teamsmith/references/memory.md +133 -0
- package/skills/teamsmith/references/migration.md +227 -0
- package/skills/teamsmith/references/openspec.md +208 -0
- package/skills/teamsmith/references/philosophy.md +95 -0
- package/skills/teamsmith/references/protocol.md +712 -0
- package/skills/teamsmith/references/troubleshooting.md +1384 -0
- package/skills/teamsmith/references/workflows.md +448 -0
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +1709 -0
- package/skills/teamsmith/scripts/lib/cmd-bg.sh +284 -0
- package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +311 -0
- package/skills/teamsmith/scripts/lib/cmd-config.sh +1156 -0
- package/skills/teamsmith/scripts/lib/cmd-death.sh +562 -0
- package/skills/teamsmith/scripts/lib/cmd-docs.sh +149 -0
- package/skills/teamsmith/scripts/lib/cmd-draft.sh +124 -0
- package/skills/teamsmith/scripts/lib/cmd-init.sh +212 -0
- package/skills/teamsmith/scripts/lib/cmd-meeting.sh +904 -0
- package/skills/teamsmith/scripts/lib/cmd-outbox.sh +196 -0
- package/skills/teamsmith/scripts/lib/cmd-project.sh +642 -0
- package/skills/teamsmith/scripts/lib/cmd-review.sh +1393 -0
- package/skills/teamsmith/scripts/lib/cmd-status.sh +1399 -0
- package/skills/teamsmith/scripts/lib/cmd-update.sh +191 -0
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +1681 -0
- package/skills/teamsmith/scripts/lib/common.sh +4964 -0
- package/skills/teamsmith/scripts/lib/draft-entry.sh +51 -0
- package/skills/teamsmith/scripts/lib/outbox.sh +2042 -0
- package/skills/teamsmith/scripts/lib/tmux-argv.sh +165 -0
- package/skills/teamsmith/scripts/monitor.mjs +616 -0
- package/skills/teamsmith/scripts/panel/README.md +192 -0
- package/skills/teamsmith/scripts/panel/build.sh +47 -0
- package/skills/teamsmith/scripts/panel/bun.lock +109 -0
- package/skills/teamsmith/scripts/panel/draft-send.sh +68 -0
- package/skills/teamsmith/scripts/panel/package.json +24 -0
- package/skills/teamsmith/scripts/panel/panel.js +388 -0
- package/skills/teamsmith/scripts/panel/src/App.tsx +2150 -0
- package/skills/teamsmith/scripts/panel/src/clipboard.ts +154 -0
- package/skills/teamsmith/scripts/panel/src/compose.ts +691 -0
- package/skills/teamsmith/scripts/panel/src/data.ts +555 -0
- package/skills/teamsmith/scripts/panel/src/format.ts +50 -0
- package/skills/teamsmith/scripts/panel/src/layout.ts +2562 -0
- package/skills/teamsmith/scripts/panel/src/main.tsx +894 -0
- package/skills/teamsmith/scripts/panel/src/markdown.ts +340 -0
- package/skills/teamsmith/scripts/panel/src/sanitize.ts +42 -0
- package/skills/teamsmith/scripts/panel/src/settings.ts +154 -0
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +416 -0
- package/skills/teamsmith/scripts/panel/src/strings/index.ts +65 -0
- package/skills/teamsmith/scripts/panel/src/strings/types.ts +9 -0
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +414 -0
- package/skills/teamsmith/scripts/panel/src/theme.ts +116 -0
- package/skills/teamsmith/scripts/panel/src/types.ts +652 -0
- package/skills/teamsmith/scripts/panel/src/width.ts +105 -0
- package/skills/teamsmith/scripts/panel/tsconfig.json +16 -0
- package/skills/teamsmith/scripts/shim/signal-gate +156 -0
- package/skills/teamsmith/scripts/shim/tmux +403 -0
- package/skills/teamsmith/scripts/team +143 -0
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +147 -0
- package/skills/teamsmith/templates/BOARD.md.tmpl +18 -0
- package/skills/teamsmith/templates/DECISIONS.md.tmpl +22 -0
- package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +25 -0
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +84 -0
- package/skills/teamsmith/templates/ROADMAP.md.tmpl +29 -0
- package/skills/teamsmith/templates/config.sh.tmpl +106 -0
- package/skills/teamsmith/templates/memory-seed.md.tmpl +46 -0
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +110 -0
- package/skills/teamsmith/templates/report.md.tmpl +36 -0
- package/skills/teamsmith/templates/task.md.tmpl +65 -0
- package/skills/teamsmith/templates/threads-README.md +17 -0
- package/skills/teamsmith/tests/checkout-shape-probe.sh +571 -0
- package/skills/teamsmith/tests/config-cli.sh +1562 -0
- package/skills/teamsmith/tests/container-tmux.sh +493 -0
- package/skills/teamsmith/tests/coverage-inventory.sh +173 -0
- package/skills/teamsmith/tests/death-cause.sh +564 -0
- package/skills/teamsmith/tests/delivery-truth.sh +1231 -0
- package/skills/teamsmith/tests/fake-tui.py +450 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/README.md +60 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-second.py +139 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/mock-server.py +29 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/observe.ts +20 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/run-case.sh +79 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +175 -0
- package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +229 -0
- package/skills/teamsmith/tests/fixtures/p71-incident/README.md +22 -0
- package/skills/teamsmith/tests/fixtures/p71-incident/dev2.seen +8 -0
- package/skills/teamsmith/tests/fixtures/p71-incident/dev2.wake +9 -0
- package/skills/teamsmith/tests/fixtures/p71-incident/pm-nudges.wake +3 -0
- package/skills/teamsmith/tests/fixtures/signal-lint-cases.txt +40 -0
- package/skills/teamsmith/tests/flip-glue.sh +162 -0
- package/skills/teamsmith/tests/flip-m12-26c.sh +129 -0
- package/skills/teamsmith/tests/flip-m12.sh +185 -0
- package/skills/teamsmith/tests/flip-m16.sh +166 -0
- package/skills/teamsmith/tests/flip-m17.sh +204 -0
- package/skills/teamsmith/tests/flip-m33.sh +284 -0
- package/skills/teamsmith/tests/flip-m34.sh +96 -0
- package/skills/teamsmith/tests/flip-m37.sh +185 -0
- package/skills/teamsmith/tests/flip-m4.3.sh +375 -0
- package/skills/teamsmith/tests/flip-m43.sh +128 -0
- package/skills/teamsmith/tests/flip-m44.sh +262 -0
- package/skills/teamsmith/tests/flip-m45.sh +244 -0
- package/skills/teamsmith/tests/flip-m46.sh +238 -0
- package/skills/teamsmith/tests/flip-m48.sh +304 -0
- package/skills/teamsmith/tests/flip-m6.2.sh +205 -0
- package/skills/teamsmith/tests/flip-m6.3.sh +283 -0
- package/skills/teamsmith/tests/flip-m6.4.sh +267 -0
- package/skills/teamsmith/tests/flip-m6.5.sh +113 -0
- package/skills/teamsmith/tests/flip-m7.1.sh +135 -0
- package/skills/teamsmith/tests/flip-m7.2.sh +321 -0
- package/skills/teamsmith/tests/flip-p144.sh +112 -0
- package/skills/teamsmith/tests/flip-p156.sh +133 -0
- package/skills/teamsmith/tests/flip-p158.sh +301 -0
- package/skills/teamsmith/tests/flip-p160.sh +182 -0
- package/skills/teamsmith/tests/flip-p171.sh +249 -0
- package/skills/teamsmith/tests/flip-p18.1.sh +95 -0
- package/skills/teamsmith/tests/flip-p20.sh +286 -0
- package/skills/teamsmith/tests/flip-p201.sh +249 -0
- package/skills/teamsmith/tests/flip-p210.sh +239 -0
- package/skills/teamsmith/tests/flip-p211.sh +152 -0
- package/skills/teamsmith/tests/flip-p217.sh +288 -0
- package/skills/teamsmith/tests/flip-p22.sh +123 -0
- package/skills/teamsmith/tests/flip-p23.sh +239 -0
- package/skills/teamsmith/tests/flip-p25.sh +165 -0
- package/skills/teamsmith/tests/flip-p71.sh +184 -0
- package/skills/teamsmith/tests/flip-p72.sh +202 -0
- package/skills/teamsmith/tests/frames/README.md +176 -0
- package/skills/teamsmith/tests/frames/p78-conversation-rule-below-box.txt +6 -0
- package/skills/teamsmith/tests/frames/p78-cursor-mid-draft.txt +6 -0
- package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor-line.txt +6 -0
- package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor.txt +6 -0
- package/skills/teamsmith/tests/frames/p78-draft-rule-blank-region.txt +6 -0
- package/skills/teamsmith/tests/frames/p78-draft-rule-only.txt +5 -0
- package/skills/teamsmith/tests/frames/p78-spinner-row-below-cursor.txt +6 -0
- package/skills/teamsmith/tests/frames/p78-wider-rule-below-cursor.txt +6 -0
- package/skills/teamsmith/tests/frames/p86-f1-mixed-width-disjoint-box.txt +8 -0
- package/skills/teamsmith/tests/frames/p86-f1-narrower-width-disjoint-box.txt +8 -0
- package/skills/teamsmith/tests/frames/p86-f1-spinner-top-disjoint-box.txt +8 -0
- package/skills/teamsmith/tests/frames/pi-0.85.1-update-banner.txt +30 -0
- package/skills/teamsmith/tests/frames/pi-0.87.0-draft-half-sentence.txt +30 -0
- package/skills/teamsmith/tests/frames/pi-0.87.0-empty-box.txt +30 -0
- package/skills/teamsmith/tests/frames/pi-0.87.0-one-line-draft.txt +30 -0
- package/skills/teamsmith/tests/frames/pi-0.87.0-project-trust-prompt.txt +30 -0
- package/skills/teamsmith/tests/frames/pi-0.99.2-empty-editor.txt +32 -0
- package/skills/teamsmith/tests/frames/pi-0.99.2-human-draft.txt +32 -0
- package/skills/teamsmith/tests/frames/pi-1.0.0-git-error-in-box.txt +32 -0
- package/skills/teamsmith/tests/gate-guard.sh +112 -0
- package/skills/teamsmith/tests/guard-matrix.sh +233 -0
- package/skills/teamsmith/tests/install-shape.sh +731 -0
- package/skills/teamsmith/tests/ledger-ban.sh +612 -0
- package/skills/teamsmith/tests/lib/box-judge.sh +68 -0
- package/skills/teamsmith/tests/lib/checkout-shape.sh +77 -0
- package/skills/teamsmith/tests/lib/loop-scan.awk +114 -0
- package/skills/teamsmith/tests/lib/pty-wait.sh +676 -0
- package/skills/teamsmith/tests/lib/section-guard.sh +855 -0
- package/skills/teamsmith/tests/lib/shell-lex.pl +261 -0
- package/skills/teamsmith/tests/lib/tmp-root.sh +528 -0
- package/skills/teamsmith/tests/lib/tmux-cap.sh +35 -0
- package/skills/teamsmith/tests/lib/tmux-iso-call-probe.sh +81 -0
- package/skills/teamsmith/tests/lib/tmux-iso-probe.sh +46 -0
- package/skills/teamsmith/tests/lib/tmux-iso.sh +381 -0
- package/skills/teamsmith/tests/load-experiment.sh +290 -0
- package/skills/teamsmith/tests/loop-inventory.tsv +84 -0
- package/skills/teamsmith/tests/panel-b2-slow-stub.sh +19 -0
- package/skills/teamsmith/tests/panel-b2.sh +1183 -0
- package/skills/teamsmith/tests/panel-b3-pty-mouse.py +240 -0
- package/skills/teamsmith/tests/panel-b3-pty-tmux-mouse.py +138 -0
- package/skills/teamsmith/tests/panel-b3-stub.sh +279 -0
- package/skills/teamsmith/tests/panel-b3.sh +1301 -0
- package/skills/teamsmith/tests/panel-choices.sh +572 -0
- package/skills/teamsmith/tests/panel-clipboard-model.ts +187 -0
- package/skills/teamsmith/tests/panel-compose-model.ts +290 -0
- package/skills/teamsmith/tests/panel-contrast.mjs +81 -0
- package/skills/teamsmith/tests/panel-cpu-premise.sh +173 -0
- package/skills/teamsmith/tests/panel-cpu.sh +391 -0
- package/skills/teamsmith/tests/panel-flip-m54.sh +207 -0
- package/skills/teamsmith/tests/panel-flip-p123.sh +278 -0
- package/skills/teamsmith/tests/panel-flip-p125.sh +318 -0
- package/skills/teamsmith/tests/panel-flip-p128.sh +259 -0
- package/skills/teamsmith/tests/panel-keyprobe-pty.py +99 -0
- package/skills/teamsmith/tests/panel-keyprobe-stub.sh +41 -0
- package/skills/teamsmith/tests/panel-keyprobe.sh +82 -0
- package/skills/teamsmith/tests/panel-keyprobe.tsx +116 -0
- package/skills/teamsmith/tests/panel-knobs.sh +83 -0
- package/skills/teamsmith/tests/panel-p21.sh +2181 -0
- package/skills/teamsmith/tests/panel-snapshots.sh +802 -0
- package/skills/teamsmith/tests/panel-strings.mjs +195 -0
- package/skills/teamsmith/tests/perf.sh +740 -0
- package/skills/teamsmith/tests/pm-box-real.sh +350 -0
- package/skills/teamsmith/tests/pulse-nudge-key.sh +563 -0
- package/skills/teamsmith/tests/routes.sh +1652 -0
- package/skills/teamsmith/tests/section-budgets.tsv +150 -0
- package/skills/teamsmith/tests/section-guard.sh +231 -0
- package/skills/teamsmith/tests/section-needs-audit.sh +94 -0
- package/skills/teamsmith/tests/section-paths.tsv +142 -0
- package/skills/teamsmith/tests/section-select.sh +648 -0
- package/skills/teamsmith/tests/signal-gate.sh +366 -0
- package/skills/teamsmith/tests/signal-lint-legacy.txt +14 -0
- package/skills/teamsmith/tests/signal-lint.pl +416 -0
- package/skills/teamsmith/tests/skill-load.mjs +65 -0
- package/skills/teamsmith/tests/smoke.sh +19599 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-120.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-160.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-59.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +32 -0
- package/skills/teamsmith/tests/snapshots/zh-light-99.txt +32 -0
- package/skills/teamsmith/tests/spec-ledger-refs.tsv +78 -0
- package/skills/teamsmith/tests/spec-refs.sh +826 -0
- package/skills/teamsmith/tests/task-header-model.sh +267 -0
- package/skills/teamsmith/tests/team-bg-flip.sh +239 -0
- package/skills/teamsmith/tests/team-bg-harness.mjs +392 -0
- package/skills/teamsmith/tests/team-bg-stop.sh +434 -0
- package/skills/teamsmith/tests/team-inbox-watch-flip.sh +191 -0
- package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +1559 -0
- package/skills/teamsmith/tests/tmp-hygiene.sh +1190 -0
- package/skills/teamsmith/tests/tmux-lint-legacy.txt +31 -0
- package/skills/teamsmith/tests/tmux-lint.pl +604 -0
- package/skills/teamsmith-init/SKILL.md +100 -0
- package/skills/teamsmith-init/references/bootstrap.md +74 -0
- package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +46 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<!-- teamsmith:begin -->
|
|
2
|
+
## Team protocol (teamsmith)
|
|
3
|
+
|
|
4
|
+
This project runs a team of agents: a **PM (orchestrator)** in tmux `{{SESSION}}:{{PM_WINDOW}}` owns tasks and merge
|
|
5
|
+
authority, while **worker agents** implement in parallel inside their own git worktrees.
|
|
6
|
+
Tooling: `bash {{SKILL_DIR}}/scripts/team help`.
|
|
7
|
+
|
|
8
|
+
### Roles and boundaries
|
|
9
|
+
|
|
10
|
+
| Role | Owns | Must not |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| PM | Briefs / roadmap / decision log, dispatch, independent verification, merging, wrap-up | Treat "the agent says it passed" as evidence |
|
|
13
|
+
| agent:<name> | Exactly the brief, tests and reports, opening PR/MRs | push `main`, force-push, merge PR/MRs, touch other people's directories |
|
|
14
|
+
|
|
15
|
+
Roster: {{AGENTS}} (editable in `.pi/team/config.sh`).
|
|
16
|
+
|
|
17
|
+
### Reading order (before any agent starts)
|
|
18
|
+
|
|
19
|
+
1. This file (especially this section)
|
|
20
|
+
2. Your own thread `{{DOCS_DIR}}/threads/<agent>.md` (the PM may have added instructions)
|
|
21
|
+
3. The task brief `{{DOCS_DIR}}/tasks/<ID>-<slug>.md` (the single source of scope and acceptance commands)
|
|
22
|
+
|
|
23
|
+
### Specs (OpenSpec)
|
|
24
|
+
|
|
25
|
+
Specs and change proposals live in `openspec/` -- a **required dependency** (`openspec init --tools none` creates
|
|
26
|
+
the spec root; `openspec init --tools pi` also generates the five phase commands, see
|
|
27
|
+
`{{SKILL_DIR}}/references/openspec.md`). Before implementing a change, read its proposal in
|
|
28
|
+
`openspec/changes/<id>/` and the capability spec it touches (`openspec/specs/<capability>/spec.md`; finished changes
|
|
29
|
+
move to `openspec/changes/archive/`). `openspec validate --all --strict` is part of the gate. **Do not create a
|
|
30
|
+
parallel spec system**: no requirement lists, spec copies or design sections in task briefs or docs -- if it must
|
|
31
|
+
hold, it goes into a spec.
|
|
32
|
+
|
|
33
|
+
A change runs as **five phases, one brief and one owner each**: an explorer runs `opsx-explore`, then
|
|
34
|
+
`opsx-propose` (planning only); a dev runs `opsx-apply`; a **different** agent runs `opsx-verify`; the PM runs
|
|
35
|
+
`opsx-archive`. Two hard rules: **no `apply` brief before the PM's proposal review
|
|
36
|
+
(`{{DOCS_DIR}}/reviews/<change>-proposal.md`) is ACCEPTED**, and no agent verifies its own work; the PM archives
|
|
37
|
+
only after independent verification **and the user's confirmation**. The phase names go in the brief's `phase:`
|
|
38
|
+
line; the full pipeline and its gates are in `{{SKILL_DIR}}/references/openspec.md`.
|
|
39
|
+
|
|
40
|
+
**The change is the assignment unit** (`1 change : N tasks`, `1 task : 0..1 change`): the brief's header is the
|
|
41
|
+
foreign key — `change:` (exactly one id, or `-`), `specs:`/`anchor:` (a change-less brief must resolve
|
|
42
|
+
`openspec/specs/<capability>/spec.md#<requirement>` or declare `anchor: none (infra) — <reason>`) and `deltas:`
|
|
43
|
+
(the change's delta files this task writes; an absent line means the whole set). `team dispatch` refuses **before it
|
|
44
|
+
opens a window**: more than one `change:` id (no override), an unresolvable anchor, two unfinished tasks of one
|
|
45
|
+
change writing the same delta file, and a `verify` task whose agent authored an `apply` task of that change (the
|
|
46
|
+
last three take `--force` + one audited line). `team change status <id>` shows the tasks/deltas/blockers and exits
|
|
47
|
+
0 only when every mapped task is finished; an `archive` task cannot be set `done` while a sibling is unfinished.
|
|
48
|
+
|
|
49
|
+
### Non-negotiable discipline
|
|
50
|
+
|
|
51
|
+
- **Only change directories you own** (`{{DOCS_DIR}}/OWNERSHIP.md`); for cross-directory work write `BLOCKED:` in
|
|
52
|
+
the report and hand it back to the PM.
|
|
53
|
+
- **Never stop mid-task to ask for confirmation**: either deliver (gates run + report + push + PR/MR) or be
|
|
54
|
+
hard-blocked (notify the PM + PARTIAL report).
|
|
55
|
+
- **Never claim tests passed without having run them.** The PM re-runs in an independent worktree; a false report
|
|
56
|
+
fails the task.
|
|
57
|
+
- Never write tokens/secrets into code, config, logs or commit messages; never read credential files
|
|
58
|
+
(e.g. `~/.pi/agent/auth.json`).
|
|
59
|
+
- Never push `{{PROTECTED_BRANCH}}`, never `git push --force`, never merge PR/MRs or rebase/delete other branches.
|
|
60
|
+
- Commit in small steps: every verifiable step gets a commit (Conventional Commits + task ID + `Agent: <name>` trailer).
|
|
61
|
+
|
|
62
|
+
### Collaboration loop
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
PM writes the brief + creates the agent worktree
|
|
66
|
+
│ team dispatch <agent> <ID> <task-file>
|
|
67
|
+
▼
|
|
68
|
+
agent implements in its worktree → small commits → runs gates → writes report → pushes branch → opens PR/MR
|
|
69
|
+
│ on turn end, automatically: appends {{DOCS_DIR}}/inbox/<agent>.md + knocks {{SESSION}}:{{PM_WINDOW}}
|
|
70
|
+
▼
|
|
71
|
+
PM reads the inbox → team review <ID> (independent worktree, runs gates)
|
|
72
|
+
▼
|
|
73
|
+
pass → the PM runs git itself (`merge --squash` + commit + push; with a PR, merge the PR first then
|
|
74
|
+
`fetch && merge --ff-only`) → `team board set <ID> done` → `team close <ID>`
|
|
75
|
+
fail → team say <agent> "..." with the concrete failure evidence
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- Blocked, or found someone else's bug: `bash {{SKILL_DIR}}/scripts/team notify <agent> "<one line>"`, and write a
|
|
79
|
+
PARTIAL report.
|
|
80
|
+
- Gates: `{{GATES}}` (a brief may require stricter commands; the brief wins).
|
|
81
|
+
- One gate at a time: the full suite is the machine's shared resource — `TEAM_SMOKE_FAST=1` inside a batch, the
|
|
82
|
+
full suite before delivery and review. `team review` queues on the gate lock (`TEAM_SMOKE_LOCK`,
|
|
83
|
+
`TEAM_SMOKE_LOCK_WAIT`, the holder in `<lock>.holder`) before its hard timeout starts, so the record shows
|
|
84
|
+
`queued` and `ran` separately; a queue past the cap is a loud `FAIL` naming the holder, not a `TIMEOUT`. On a
|
|
85
|
+
busy machine the panel timing lines (2000 ms frame, 1 % CPU — medians of three printed samples) print the
|
|
86
|
+
measured values and the load and **skip visibly** instead of reporting a red the machine owes; the premise is
|
|
87
|
+
`loadavg ≤ factor × cores` with `factor` 0.75 in the gate and 0.25 for the cold-start fixture.
|
|
88
|
+
- Messages are not deliverables: the real evidence lives in `{{DOCS_DIR}}/reports/`, `{{DOCS_DIR}}/reviews/` and commits.
|
|
89
|
+
|
|
90
|
+
### Bootstrap (first step in a new project)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bash {{SKILL_DIR}}/scripts/team bootstrap # idempotent: config + docs skeleton + worktrees + pulse window + next steps
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Cross-project meetings (PM to PM)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bash {{SKILL_DIR}}/scripts/team meeting inbox # meetings waiting for my reply
|
|
100
|
+
bash {{SKILL_DIR}}/scripts/team meeting say <slug> --intent proposal "…"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Allowed: interface work, advice with evidence, problem reports, scheduling joint test windows. Not allowed:
|
|
104
|
+
commanding another PM, deciding on their behalf, impersonating a human. Consensus requires both sides to `agree`;
|
|
105
|
+
landing the work always happens in each side's own project. **Workers do not attend** (cross-project traffic is PM-only).
|
|
106
|
+
|
|
107
|
+
### Periodic patrol (not a heartbeat)
|
|
108
|
+
|
|
109
|
+
The pulse is a **metronome that wakes the PM**, not a daemon that keeps it alive:
|
|
110
|
+
|
|
111
|
+
- **The PM owns the pulse**: `team pulse up|status|logs|down` -- by default it runs `team monitor` in a
|
|
112
|
+
`pulse` window of the same tmux session (team status on top, per-agent activity below, optional) and patrols
|
|
113
|
+
on an interval. There is exactly one backend (that window) -- no container, no systemd.
|
|
114
|
+
- **Bring it up at session start**: if the pulse is not running and you are not on standby, `team pulse up` is part of
|
|
115
|
+
the PM's job -- no one else will do it; while `standby on` is set, leave it alone.
|
|
116
|
+
- Every **15 minutes** by default (`TEAM_PULSE_INTERVAL=900`, 300-3600 recommended) it asks "is there work for the
|
|
117
|
+
PM?": unread notifications / reports awaiting verification / board todo·wip (opt-in) / blocked / agents with
|
|
118
|
+
unfinished tasks that stopped running.
|
|
119
|
+
- **Pending work** → wake the PM (nudge it if running, start it if not). **Nothing pending** → do nothing at all --
|
|
120
|
+
the team stays quiet and the PM is not required to be running.
|
|
121
|
+
- If there is nothing to do, or a human is needed, the PM can `team standby on --reason "…"` and stand down; the
|
|
122
|
+
pulse stops waking it (backlog still lands in `state/watchdog.log`). A human runs `team standby off`.
|
|
123
|
+
- It **does not manage tmux layout or agents** (agents belong to the PM: `team resume`).
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bash <skill>/scripts/team pulse status # interval / standby / pending / PM state
|
|
127
|
+
bash <skill>/scripts/team standby on --reason "waiting for the user to pick a stack"
|
|
128
|
+
bash <skill>/scripts/team standby off
|
|
129
|
+
bash <skill>/scripts/team up # manual rescue: build the tmux stage + start the PM (agents untouched)
|
|
130
|
+
bash <skill>/scripts/team up --agents # also resume agents that have tasks but no window
|
|
131
|
+
bash <skill>/scripts/team watch --once # run a single patrol tick
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- The capacity floor is **swap must not be exhausted** (tight RAM only means slowness, not refusal); `team ps` shows headroom.
|
|
135
|
+
|
|
136
|
+
### Directories
|
|
137
|
+
|
|
138
|
+
| Path | Owner | Purpose |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| `{{DOCS_DIR}}/tasks/` | PM | Task briefs |
|
|
141
|
+
| `{{DOCS_DIR}}/reports/` | agent (its own file only) | Delivery reports |
|
|
142
|
+
| `{{DOCS_DIR}}/reviews/` | PM | Independent verification records |
|
|
143
|
+
| `{{DOCS_DIR}}/threads/` | PM + that agent (append-only) | Decision/clarification messages |
|
|
144
|
+
| `{{DOCS_DIR}}/inbox/` | generated (gitignored) | Turn-end briefings |
|
|
145
|
+
| `{{DOCS_DIR}}/{BOARD,ROADMAP,OWNERSHIP,DECISIONS}.md` | PM | Board / milestones / ownership / decisions |
|
|
146
|
+
| `{{WORKTREES_DIR}}/<agent>/` | that agent | Long-lived worktree (sessions are keyed by cwd -- keep it stable) |
|
|
147
|
+
<!-- teamsmith:end -->
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# {{PROJECT}} · 任务板
|
|
2
|
+
|
|
3
|
+
> PM 维护;agent 只读。状态:`todo` / `wip` / `review`(已交付待复验) / `done` / `blocked` / `dropped`
|
|
4
|
+
> 工具:`team task <ID> --title ...` 建行 | `team board set <ID> <状态>` 改状态 | `team board assign <ID> <agent>` 指派 | `team board ls`
|
|
5
|
+
|
|
6
|
+
| ID | 任务 | Agent | 分支 | 依赖 | 状态 |
|
|
7
|
+
|---|---|---|---|---|---|
|
|
8
|
+
| — | (还没有任务:`team task T1.1 --title "第一个任务" --agent dev`) | - | - | - | dropped |
|
|
9
|
+
|
|
10
|
+
## 当前里程碑
|
|
11
|
+
|
|
12
|
+
见 [ROADMAP.md](ROADMAP.md)。创建于 {{TODAY}}。
|
|
13
|
+
|
|
14
|
+
## 阻塞与风险
|
|
15
|
+
|
|
16
|
+
| # | 事项 | 影响 | 处理 |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| — | — | — | — |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# {{PROJECT}} · 决策日志
|
|
2
|
+
|
|
3
|
+
> 谁写的:PM(agent 只能在报告里提出证据,不能直接改本文件)。
|
|
4
|
+
> 状态:`暂定`(待证据)/ `决定`(PM 已定,用户可推翻)/ `已确认`(用户确认)/ `废弃`
|
|
5
|
+
> 格式:`D<序号> · <日期> · <状态> — <决策>` + **理由** + **影响**(少了理由,半年后没人敢改)。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## D1 · {{TODAY}} · 决定 — 采用 teamsmith 的多 Agent 协作流程
|
|
10
|
+
|
|
11
|
+
- **决策**:Issue → agent worktree/分支 → 报告 + 门禁 → PM 独立复验 → squash 合并。
|
|
12
|
+
- **理由**:可追溯、并行不冲突、合并权集中在 PM(质量门禁不被绕过)。
|
|
13
|
+
- **影响**:agent 不得 push 保护分支 / 不得 merge;PM 必须真的跑复验,不能只看报告。
|
|
14
|
+
|
|
15
|
+
## D2 · {{TODAY}} · 暂定 — <技术栈/选型类决策>
|
|
16
|
+
|
|
17
|
+
> 规则:凡是**选型**(语言/框架/库/存储/协议),先派 research agent 拿出证据(① 本机实测 >
|
|
18
|
+
> ② 官方文档 > ③ 二手资料,无实测必须标注)+ 劣势清单,PM 复验证据链后才升为「决定」。
|
|
19
|
+
|
|
20
|
+
- **决策**:<...>
|
|
21
|
+
- **理由**:<...>
|
|
22
|
+
- **影响**:<...>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# {{PROJECT}} · Directory ownership
|
|
2
|
+
|
|
3
|
+
> **Only change directories you own.** For cross-directory work, write `BLOCKED:` in your report naming who should
|
|
4
|
+
> change what, and hand it back to the PM. Anything not listed here belongs to the PM.
|
|
5
|
+
|
|
6
|
+
| Path | Owner | Purpose |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| `<path>/**` | agent:<name> | <what this directory is responsible for> |
|
|
9
|
+
| `docs/**` | PM | Briefs / reports / verification / decisions |
|
|
10
|
+
| `.pi/**`, `AGENTS.md` | PM | Team protocol and configuration |
|
|
11
|
+
| `scripts/team*`, root config (lockfile/tsconfig, ...) | PM | New dependencies → raise them in the report |
|
|
12
|
+
|
|
13
|
+
## Roster
|
|
14
|
+
|
|
15
|
+
| Agent | Model | Long-lived worktree | Scope |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| <name> | <provider/model> | `.worktrees/<name>` | <module> |
|
|
18
|
+
|
|
19
|
+
## Change process
|
|
20
|
+
|
|
21
|
+
1. Need a new directory? The PM updates this file (and references it in the brief).
|
|
22
|
+
2. Temporary borrowing (e.g. one package handled by another agent for a phase) must be marked **temporary** in the
|
|
23
|
+
brief together with the hand-over condition.
|
|
24
|
+
| `openspec/specs/**` · `openspec/config.yaml` | PM | 规格与配置是账本的一部分 |
|
|
25
|
+
| `openspec/changes/<change>/**` | 该 change 当前阶段的 owner(任务书明授) | propose 归提案者;apply 归实现者;archive 由 PM 执行 |
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# {{PROJECT}} · Collaboration protocol (teamsmith)
|
|
2
|
+
|
|
3
|
+
> **This file is the short operational summary.** The full version lives in the teamsmith section of the project's
|
|
4
|
+
> `AGENTS.md` plus the skill's `references/`. Tooling entry point: `bash {{SKILL_DIR}}/scripts/team help`
|
|
5
|
+
|
|
6
|
+
## Roles
|
|
7
|
+
|
|
8
|
+
| Role | Where | Owns | Red lines |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| PM | tmux `{{SESSION}}:pm` | Milestones/board/briefs/decisions; dispatch; independent verification; merging; wrap-up | Never let an agent's own account replace evidence; never write tokens into any artifact |
|
|
11
|
+
| agent:<name> | `{{WORKTREES_DIR}}/<name>` | Implementation + tests + report + PR/MR | Never push the protected branch, force-push, merge, or change directories it does not own |
|
|
12
|
+
|
|
13
|
+
## Lifecycle of a task
|
|
14
|
+
|
|
15
|
+
1. **PM**: write the brief `{{DOCS_DIR}}/tasks/<ID>-<slug>.md` (context / deliverables / boundaries / acceptance commands / report requirements).
|
|
16
|
+
2. **PM**: `team add-agent <a>` for the long-lived worktree → `team dispatch <a> <ID> <taskfile>`.
|
|
17
|
+
3. **agent**: implement in the worktree; commit in small steps; run the acceptance commands; write the report
|
|
18
|
+
`{{DOCS_DIR}}/reports/<ID>-<a>.md`; push the branch; open a PR/MR; **the PM is notified automatically when the
|
|
19
|
+
turn ends** (inbox + tmux wake-up).
|
|
20
|
+
4. **PM**: `team digest` for pending work → `team review <ID> --dir <independent checkout>` (run gates, read the
|
|
21
|
+
diff, write `{{DOCS_DIR}}/reviews/<ID>.md`).
|
|
22
|
+
5. **Pass** → the PM runs git: `merge --squash` + commit + push (with a PR, merge the PR first and then
|
|
23
|
+
`fetch && merge --ff-only`) → `team board set <ID> done` → `team close <ID>`.
|
|
24
|
+
**Fail** → `team say <a> "<concrete failure evidence>"` and send it back.
|
|
25
|
+
|
|
26
|
+
## Hard rules
|
|
27
|
+
|
|
28
|
+
1. Never claim the acceptance commands passed without having run them. The PM re-runs independently; a false report fails the task.
|
|
29
|
+
2. One long-lived worktree per agent (sessions are keyed by cwd; moving the path makes them un-resumable); each task gets its own branch inside it.
|
|
30
|
+
3. Commit in small steps -- never one dump at the end; include the task ID and an `Agent: <name>` trailer.
|
|
31
|
+
4. Only change directories assigned to you in `{{DOCS_DIR}}/OWNERSHIP.md`; cross-directory needs → write `BLOCKED:` in the report.
|
|
32
|
+
5. Blocked, or you found a bug: `team notify <a> "<one line>"`, write a PARTIAL report, then end the turn.
|
|
33
|
+
6. Only the PM advances the protected branch (`main` by default); agents push their own task branches only.
|
|
34
|
+
7. Tokens are injected only when the PM calls a real tool (`GH_TOKEN="$(< .gh-pat)" gh …`); never echoed, never written into project files.
|
|
35
|
+
|
|
36
|
+
## Gates
|
|
37
|
+
|
|
38
|
+
- Project gates: `{{GATES}}`
|
|
39
|
+
- Verification uses an **independent checkout**: the PM prepares it (`git worktree add --detach`), then
|
|
40
|
+
`team review <ID> --dir <checkout>` runs the gates and writes the evidence.
|
|
41
|
+
- A brief may require stricter commands than the project gates; the brief wins.
|
|
42
|
+
|
|
43
|
+
## Specs (OpenSpec)
|
|
44
|
+
|
|
45
|
+
Specs and change proposals live in `openspec/` (required dependency). `openspec validate --all --strict` is part of
|
|
46
|
+
the gate. A brief names the change id and the scenarios it must satisfy; `openspec change show <id>` reads a
|
|
47
|
+
proposal, and the PM archives a change (`openspec archive -y <id>`) only after independent verification has landed
|
|
48
|
+
and the user confirmed. No parallel spec system.
|
|
49
|
+
|
|
50
|
+
A change runs as **five phases, one brief and one owner each**: `opsx-explore` (an explorer) → `opsx-propose` (the
|
|
51
|
+
same explorer, planning only) → `opsx-apply` (a dev) → `opsx-verify` (an **independent** agent) → `opsx-archive`
|
|
52
|
+
(the PM). Two hard rules: an `apply` brief may not start before the PM's proposal review
|
|
53
|
+
(`{{DOCS_DIR}}/reviews/<change>-proposal.md`) is **ACCEPTED**, and no agent verifies its own work. The pipeline, its
|
|
54
|
+
gates and the PM's review checklist: `{{SKILL_DIR}}/references/openspec.md`.
|
|
55
|
+
|
|
56
|
+
**The change is the assignment unit** (`1 change : N tasks`, `1 task : 0..1 change`): the brief's header is the
|
|
57
|
+
foreign key — `change:` (exactly one id, or `-`), `specs:`/`anchor:` (a change-less brief must resolve
|
|
58
|
+
`openspec/specs/<capability>/spec.md#<requirement>` or declare `anchor: none (infra) — <reason>`) and `deltas:`
|
|
59
|
+
(the change's delta files this task writes; an absent line means the whole set). `team dispatch` refuses **before it
|
|
60
|
+
opens a window**: more than one `change:` id (no override), an unresolvable anchor, two unfinished tasks of one
|
|
61
|
+
change writing the same delta file, and a `verify` task whose agent authored an `apply` task of that change (the
|
|
62
|
+
last three take `--force` + one audited line). `team change status <id>` shows the tasks/deltas/blockers and exits
|
|
63
|
+
0 only when every mapped task is finished; an `archive` task cannot be set `done` while a sibling is unfinished.
|
|
64
|
+
|
|
65
|
+
## Bootstrap and pulse
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bash {{SKILL_DIR}}/scripts/team bootstrap # new project in one command: config + docs skeleton + worktrees + pulse window
|
|
69
|
+
bash {{SKILL_DIR}}/scripts/team pulse up # the pulse window runs the monitor + patrols (PM-configured)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Liveness and periodic patrol
|
|
73
|
+
|
|
74
|
+
- The pulse is a **metronome that wakes the PM**, not a heartbeat: every 15 minutes by default
|
|
75
|
+
(`TEAM_PULSE_INTERVAL=900`, 300-3600 recommended) it checks for work (unread notifications / reports awaiting
|
|
76
|
+
verification / board todo·wip / blocked / agents with unfinished tasks that stopped). With work → wake the PM
|
|
77
|
+
(nudge if running, start with `pi -c` if not). Without work → stay silent, start nothing.
|
|
78
|
+
- Nothing to do, or a human is needed: `team standby on --reason "…"`. No further wake-ups; a human runs
|
|
79
|
+
`team standby off`.
|
|
80
|
+
- It does not manage tmux layout or agents: a missing session/window is only reported (a human runs `team up`, or
|
|
81
|
+
set `TEAM_PULSE_REBUILD_TMUX=1`); starting/resuming agents is the PM's job (`team resume [--dry-run]`,
|
|
82
|
+
or a human runs `team up --agents`).
|
|
83
|
+
- The capacity floor is swap must not be exhausted (`team ps` shows headroom); tight RAM only means slowness.
|
|
84
|
+
- Standing the team down completely: `team standby on` (temporary), or `team teardown --all` for teardown.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# {{PROJECT}} · Roadmap
|
|
2
|
+
|
|
3
|
+
> Maintained by the PM. A milestone's exit criteria must be **executable verification** (a command you can run and
|
|
4
|
+
> evidence you can look at), never a feeling of "it's basically done".
|
|
5
|
+
|
|
6
|
+
## Product goal (one sentence)
|
|
7
|
+
|
|
8
|
+
<who this project solves what for>
|
|
9
|
+
|
|
10
|
+
## Milestones
|
|
11
|
+
|
|
12
|
+
| Milestone | Goal | Exit criteria (executable) | Status |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| M0 | Skeleton / contracts frozen | `<command>` is green; interfaces and directory ownership recorded in OWNERSHIP.md | ⚪ not started |
|
|
15
|
+
| M1 | <first vertical slice> | end-to-end demo script runs; gates green | ⚪ not started |
|
|
16
|
+
|
|
17
|
+
## Current work breakdown
|
|
18
|
+
|
|
19
|
+
| ID | Task | Owner | Depends on |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| — | — | — | — |
|
|
22
|
+
|
|
23
|
+
## Out of scope (non-goals)
|
|
24
|
+
|
|
25
|
+
- <be explicit about what you are NOT doing, so agents do not helpfully expand the scope>
|
|
26
|
+
|
|
27
|
+
## Key constraints
|
|
28
|
+
|
|
29
|
+
- <stack / environment / credentials / performance / compliance constraints>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# teamsmith project config (generated by `team init`; edit freely; sourced by bash and parsed by the notify extension)
|
|
2
|
+
#
|
|
3
|
+
# Format: flat `TEAM_KEY="value"`, one per line, no newlines inside values.
|
|
4
|
+
# Change a value through the CLI: `team config list` (classes + defaults), `team config set <KEY> <VALUE>` (validated, fingerprint-guarded, audited).
|
|
5
|
+
# The notify extension reads only a few keys and does **not** source this file (it never runs project code).
|
|
6
|
+
|
|
7
|
+
# ---- identity ----
|
|
8
|
+
TEAM_PROJECT="{{PROJECT}}"
|
|
9
|
+
TEAM_SESSION="{{SESSION}}" # tmux session name (the PM and every agent live in this one session)
|
|
10
|
+
# The PM window name is a convention, not a copy of whatever the window happens to be called right now:
|
|
11
|
+
# `team bootstrap` writes this default and renames a differently-named current window instead of inheriting it.
|
|
12
|
+
TEAM_PM_WINDOW="{{PM_WINDOW}}" # window running the PM; notifications are typed into it
|
|
13
|
+
|
|
14
|
+
# ---- roster and models ----
|
|
15
|
+
TEAM_AGENTS="{{AGENTS}}"
|
|
16
|
+
# Per-agent default model (optional; falls back to TEAM_DEFAULT_MODEL): "dev=deepseek/deepseek-flash verify=xai/grok-4.6"
|
|
17
|
+
TEAM_AGENT_MODELS=""
|
|
18
|
+
TEAM_DEFAULT_MODEL="{{DEFAULT_MODEL}}"
|
|
19
|
+
# Concurrency caps ("provider/model=N"): important when a provider quota is small,
|
|
20
|
+
# e.g. "kimi-coding/k3=2 openai-codex/gpt-5.6-sol=1" (wildcards allowed)
|
|
21
|
+
TEAM_MODEL_LIMITS="kimi-coding/k3=2 openai-codex/*=1"
|
|
22
|
+
# Extra arguments appended to the agent CLI on dispatch (space separated)
|
|
23
|
+
TEAM_EXTRA_PI_ARGS=""
|
|
24
|
+
|
|
25
|
+
# ---- agent adapter (internal seam (frozen): reserved for a possible future non-Pi adapter, no compatibility
|
|
26
|
+
# promise; not asked in the init questionnaire. Leave all four empty for the built-in Pi behaviour) ----
|
|
27
|
+
# launch template; placeholders: {cwd} {session_id} {model} {provider} {prompt_file} {prompt}
|
|
28
|
+
# {skill_dir} {notify_ext} {extra_args}
|
|
29
|
+
# (any unknown/malformed placeholder, a blank template or a newline aborts the dispatch; the first word must be
|
|
30
|
+
# a bare executable name)
|
|
31
|
+
TEAM_AGENT_CMD=""
|
|
32
|
+
# end-of-turn notification; placeholders: {summary_file} {summary} {agent} {cwd} {session_id} {model} {provider} {skill_dir}
|
|
33
|
+
# The summary is data: the worker writes it into {summary_file} and runs a fixed command, so nothing it types is ever
|
|
34
|
+
# interpolated into a shell line. {summary} is kept for old templates (rendered as a quoted read of that file).
|
|
35
|
+
TEAM_AGENT_NOTIFY_CMD=""
|
|
36
|
+
# log source for `team monitor --activity` ({agent} = agent name); empty = Pi session files
|
|
37
|
+
TEAM_AGENT_LOG_GLOB=""
|
|
38
|
+
# adapter binary (window readiness wait / existence checks); empty = first word of TEAM_AGENT_CMD
|
|
39
|
+
TEAM_AGENT_BIN=""
|
|
40
|
+
# Worked examples and the placeholder tables live in references/agent-adapters.md, under the same frozen wording;
|
|
41
|
+
# this template offers no ready-to-use example of another CLI.
|
|
42
|
+
|
|
43
|
+
# ---- workflow ----
|
|
44
|
+
TEAM_GATES="{{GATES}}" # gate command; verification runs it on an independent checkout
|
|
45
|
+
TEAM_PI_BIN="pi" # agent CLI binary (use an absolute path if it is not on PATH)
|
|
46
|
+
TEAM_INSTALL_CMD="" # dependency install after creating a worktree, e.g. "pnpm install --frozen-lockfile"
|
|
47
|
+
TEAM_DOCS_DIR="{{DOCS_DIR}}" # where briefs/reports/threads/inbox live
|
|
48
|
+
TEAM_WORKTREES_DIR=".worktrees"
|
|
49
|
+
# Branch model: task (default; one branch per task -- the unit of verification/merge/rollback) | agent (one long-lived branch per agent)
|
|
50
|
+
TEAM_BRANCH_MODE="task"
|
|
51
|
+
TEAM_TASK_BRANCH_PREFIX="task"
|
|
52
|
+
TEAM_TASK_BRANCH_RESET=1 # after close, switch the agent worktree back to the protected branch
|
|
53
|
+
TEAM_PROTECTED_BRANCH="main" # agents must never push it; they open PR/MRs or hand over to the PM
|
|
54
|
+
TEAM_REMOTE="origin"
|
|
55
|
+
|
|
56
|
+
# ---- version control / forge ----
|
|
57
|
+
# {{DETECTED_VCS}} was auto-detected for this repo; local = no forge, the PM squash-merges locally.
|
|
58
|
+
TEAM_VCS="{{VCS}}" # local | github | gitlab | other (a label only; the skill calls no forge)
|
|
59
|
+
TEAM_TOKEN_FILE=".gh-pat" # optional: PAT file at the repo root (chmod 600, gitignored) for the PM's own calls
|
|
60
|
+
TEAM_GITLAB_HOST="" # optional: e.g. https://gitlab.example.com:8443
|
|
61
|
+
TEAM_GITLAB_PROJECT="" # optional: e.g. group/sub/project
|
|
62
|
+
TEAM_GITLAB_TOKEN_FILE="$HOME/.gitlab-pa-token"
|
|
63
|
+
TEAM_CONFIRM_WRITES=1 # 1 = every shared-state change needs --yes (recommended)
|
|
64
|
+
|
|
65
|
+
# ---- guards (the floor is: swap must not be exhausted; tight RAM only means slowness) ----
|
|
66
|
+
TEAM_MIN_FREE_SWAP_MB=1024 # refuse dispatch below this much free swap (exhaustion gets processes OOM-killed)
|
|
67
|
+
TEAM_MIN_TOTAL_MB=512 # absolute floor for RAM + swap
|
|
68
|
+
TEAM_REVIEW_TIMEOUT=1800 # hard timeout for verification gates (seconds); a timeout counts as FAIL
|
|
69
|
+
TEAM_MIN_AVAIL_MB=1024 # hard floor for MemAvailable (one machine used 4096 here)
|
|
70
|
+
TEAM_WARN_AVAIL_MB=4096 # below this MemAvailable: warn only (slowness is acceptable)
|
|
71
|
+
TEAM_ZRAM_WARN_PCT=85 # warn above this zram usage (zram pages live in RAM)
|
|
72
|
+
TEAM_AGENT_MEM_MB=6144 # empirical memory per agent, used by `team ps` estimates
|
|
73
|
+
TEAM_NOTIFY_TMUX=1 # 0 = write the inbox only, never knock on the PM window
|
|
74
|
+
TEAM_NOTIFY_DEDUP_SEC=20 # dedup window for identical briefings (Pi may settle repeatedly)
|
|
75
|
+
TEAM_INBOX_MAX_CHARS=150
|
|
76
|
+
TEAM_NOTIFY_LOG="/tmp/{{PROJECT}}-teamsmith-notify.log"
|
|
77
|
+
# ---- deferred delivery (delivery-guard: never type into an input box that already holds a draft) ----
|
|
78
|
+
TEAM_DEFER_TTL=300 # seconds a queued message may wait before it moves to state/outbox/held/
|
|
79
|
+
TEAM_OUTBOX_MAX=200 # maximum active queue entries (the oldest escalates to held/ beyond it)
|
|
80
|
+
|
|
81
|
+
# ---- periodic patrol (the metronome that wakes the PM) ----
|
|
82
|
+
# Renamed watchdog → pulse in v1.36.0: the legacy TEAM_WATCH_* names keep working as fallbacks until v2.0.0
|
|
83
|
+
# (precedence: TEAM_PULSE_<NAME> > TEAM_WATCH_<NAME> > default; `team pulse status` names any legacy variable in effect).
|
|
84
|
+
TEAM_PULSE_WINDOW="pulse" # tmux window running the monitor
|
|
85
|
+
TEAM_MONITOR_REFRESH=3 # monitor refresh interval (seconds); console default (was 5)
|
|
86
|
+
TEAM_PULSE_PENDING_BOARD=0 # 0 = board todo/wip is not a wake-up signal (blocked/unread/awaiting review/stopped agents are)
|
|
87
|
+
TEAM_MONITOR_ACTIVITY=0 # 1 = append per-agent activity streams below the panel (current session only)
|
|
88
|
+
TEAM_MONITOR_EVENTS=4 # recent events per agent when activity is enabled
|
|
89
|
+
# Required dependencies: magic-context (the PM's cross-compaction, cross-restart memory) and OpenSpec
|
|
90
|
+
# (the spec layer: why a change happens / what it changes). `team doctor` fails when one is missing;
|
|
91
|
+
# dispatch only warns (a worker can still work), bootstrap prints the fix. Set a TEAM_REQUIRE_*=0 to downgrade.
|
|
92
|
+
TEAM_REQUIRE_MAGIC_CONTEXT=1
|
|
93
|
+
TEAM_PI_SETTINGS_FILE="$HOME/.pi/agent/settings.json" # where the extension is detected (tests/multi-user: point it elsewhere)
|
|
94
|
+
TEAM_REQUIRE_OPENSPEC=1
|
|
95
|
+
TEAM_OPENSPEC_BIN="openspec" # absolute path allowed, same pattern as TEAM_PI_BIN
|
|
96
|
+
TEAM_SPEC_DIR="openspec" # the project's OpenSpec root (relative to the main worktree)
|
|
97
|
+
TEAM_PULSE_INTERVAL=900 # patrol interval (seconds): 15 minutes by default, 300-3600 recommended
|
|
98
|
+
TEAM_PULSE_NUDGE_GAP=900 # minimum gap before the same backlog is mentioned again (seconds)
|
|
99
|
+
TEAM_PULSE_REBUILD_TMUX=0 # 0 = leave tmux alone (report a missing session/window); 1 = allow rebuilding
|
|
100
|
+
TEAM_PULSE_MAX_RESTARTS=5 # maximum automatic PM restarts per hour (crash-loop guard)
|
|
101
|
+
TEAM_PM_MODEL="" # the PM's own model; empty = TEAM_DEFAULT_MODEL
|
|
102
|
+
TEAM_PM_SESSION_ID="" # empty = `pi -c` (continue the previous session in this directory, keeping history)
|
|
103
|
+
TEAM_PM_EXTRA_PI_ARGS=""
|
|
104
|
+
|
|
105
|
+
# ---- misc ----
|
|
106
|
+
# Recorded by init for humans: skill path {{SKILL_DIR}}; initialised on {{TODAY}}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# {{PROJECT}} · PM memory seed (optional)
|
|
2
|
+
|
|
3
|
+
> The PM is a long-lived session: every time the pulse raises it or a new session starts, it has to
|
|
4
|
+
> re-learn the project. With magic-context installed (`@cortexkit/pi-magic-context`), write the facts below into
|
|
5
|
+
> project memory (`ctx_memory`) so each PM session starts with them instead of re-deriving them.
|
|
6
|
+
> Without magic-context it still works: treat this file as a reading checklist at the start of a session
|
|
7
|
+
> (`team doctor` reports whether magic-context is installed). How to use memory, what belongs in it and what
|
|
8
|
+
> survives a restart: `references/memory.md` in the skill.
|
|
9
|
+
|
|
10
|
+
## Items worth recording in project memory (each must be a standalone fact)
|
|
11
|
+
|
|
12
|
+
### Project facts (each one verifiable)
|
|
13
|
+
- Project: {{PROJECT}}; main worktree `{{MAIN_ROOT}}`; team docs `{{DOCS_DIR}}`.
|
|
14
|
+
- tmux session/window: `{{SESSION}}:{{PM_WINDOW}}` (PM), agent windows per roster, pulse window `pulse`.
|
|
15
|
+
- Roster: {{AGENTS}}; gates command: `{{GATES}}`.
|
|
16
|
+
- The protected branch `{{PROTECTED_BRANCH}}` is PM-only; one branch per task `task/<ID>-<slug>`.
|
|
17
|
+
- Branch mode: `{{BRANCH_MODE}}`; agent worktrees: `{{WORKTREES_DIR}}/<agent>` (**never move them**: sessions are keyed by cwd).
|
|
18
|
+
|
|
19
|
+
### Working rules (the creed; cross-project)
|
|
20
|
+
- Deliverables must be independently verifiable: an agent's report is a claim; the PM's gates on an independent
|
|
21
|
+
checkout are the evidence.
|
|
22
|
+
- Status is a promise: `done` only after the code really landed on the protected branch; on failure keep the old state.
|
|
23
|
+
- Govern less to be reliable: the skill does not wrap git/forge, the PM does not implement, the pulse only wakes.
|
|
24
|
+
- Failure is information: a false green is worse than nothing; gates need hard timeouts; skips must be declared.
|
|
25
|
+
- Repeated problems must become mechanisms: incident → guard/assertion/spec, never "be careful next time".
|
|
26
|
+
- Everything must be handover-ready: disk beats memory; decisions carry their rationale.
|
|
27
|
+
|
|
28
|
+
### Project-specific traps (add as you hit them)
|
|
29
|
+
- <e.g. the e2e gate needs `pnpm build` first, otherwise it fails>
|
|
30
|
+
- <e.g. one test is flaky ~5%; re-run once before judging>
|
|
31
|
+
- <e.g. gates must carry `timeout`, otherwise a hang once lasted 85 minutes>
|
|
32
|
+
|
|
33
|
+
## How to use it (two moments for the PM)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# On start (raised by the pulse, or a new session):
|
|
37
|
+
# 1) with memory tooling, search for "project <name> constraints / last progress / rejected options";
|
|
38
|
+
# without it, read DECISIONS.md and the roadmap's leftovers
|
|
39
|
+
# 2) team digest + team inbox --ack
|
|
40
|
+
# On wrap-up (after delivery or a decision):
|
|
41
|
+
# 1) land the conclusion and this round's evidence on disk (report / reviews / BOARD / DECISIONS)
|
|
42
|
+
# 2) new facts that hold across tasks → project memory; "do later" → a note or the roadmap leftovers
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> Boundary: **project memory is the PM's shortcut, not the evidence.** Everyone else (people without
|
|
46
|
+
> magic-context, other tools) only trusts the files under `{{DOCS_DIR}}/**` and the commits -- so write both.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
You are the PM (orchestrator) for **{{PROJECT}}**, working in `{{MAIN_ROOT}}`.
|
|
2
|
+
Team tooling: `bash {{SKILL_DIR}}/scripts/team help` (referred to as `team` below).
|
|
3
|
+
|
|
4
|
+
## Your creed (read these five first; the full version is `{{SKILL_DIR}}/references/philosophy.md`)
|
|
5
|
+
|
|
6
|
+
1. **Deliverables must be independently verifiable**: a report is a claim, your verification is the evidence; if you cannot reproduce it another way, treat it as not done.
|
|
7
|
+
2. **Status is a promise**: `done` means the code really landed on the protected branch and was pushed; mark `blocked` rather than write a pretty status.
|
|
8
|
+
3. **Govern less to be reliable**: you own briefs / verification / merging / decisions; git and forge work is done by you with real tools, never by the skill pretending to.
|
|
9
|
+
4. **Failure is information**: errors must be visible, recoverable and auditable; **a false green is worse than nothing** (a checker must be falsifiable).
|
|
10
|
+
5. **Everything must be handover-ready**: disk beats memory (you will be restarted); decisions need their rationale; an incident must become a mechanism, not a promise to "be careful next time".
|
|
11
|
+
|
|
12
|
+
## Talking to the user: a code never stands alone
|
|
13
|
+
|
|
14
|
+
The ledger thinks in codes (`M12`, `P14`, `V15`, `T1.1`); the user does not have the ledger in their head. So in
|
|
15
|
+
**user-facing output** -- reports, reminders, messages, release notes, anything the user reads -- every code that
|
|
16
|
+
names a task carries its short human-readable name in the same place: `M12 (fix the smoke flake)`. The same holds
|
|
17
|
+
for milestones and change ids, and for long lists: a row is read on its own, so a repeated code is named again on
|
|
18
|
+
its line. Commands keep the bare code (`team close M12`) -- there it is a key, not a reference.
|
|
19
|
+
`team digest` / `team status` / `team roster` already render the name next to the code; use the same shape in your
|
|
20
|
+
own messages. Prefer the BOARD's task column as the name (that is the shared short name), not a fresh description.
|
|
21
|
+
|
|
22
|
+
## First moves (on every start / whenever the pulse raises you)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
team pulse status # is the pulse running? (if not: team pulse up)
|
|
26
|
+
team digest # pending: new notifications + reports awaiting verification + board
|
|
27
|
+
team inbox --ack # read the inbox and mark it read (the async channel from agents)
|
|
28
|
+
team resume --dry-run # which agents still have unfinished tasks but are not running
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If magic-context is installed (recommended for long-lived PM sessions): start with `ctx_search` for existing
|
|
32
|
+
decisions and constraints about this task/module instead of re-deriving what was already settled.
|
|
33
|
+
Without it, read `{{DOCS_DIR}}/DECISIONS.md` and the latest thread entries instead.
|
|
34
|
+
|
|
35
|
+
If the pulse restarted you: first check the tail of `{{DOCS_DIR}}/../.pi/team/state/watchdog.log` and the newest
|
|
36
|
+
`{{DOCS_DIR}}/threads/*.md` entries, work out where you stopped, and **do not redo finished work**.
|
|
37
|
+
|
|
38
|
+
> If the project has never been initialised (no `.pi/team/config.sh`): run `team bootstrap` first
|
|
39
|
+
> (one command: config + docs skeleton + agent worktrees + pulse window + next steps).
|
|
40
|
+
|
|
41
|
+
## Cross-project (you may talk; you may not command)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
team meeting inbox # is anyone waiting for my reply?
|
|
45
|
+
team meeting read <slug> # read messages (with intent and identity stamp)
|
|
46
|
+
team meeting say <slug> --intent proposal "…" # advice / problem report / question (no command intent exists)
|
|
47
|
+
team meeting agree <slug> A1 # confirm the other side's proposal (record your own decision in DECISIONS)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Allowed: interface work, advice with evidence, problem reports, scheduling joint test windows, each side taking
|
|
51
|
+
its own half. Not allowed: commanding the other PM/agent, deciding for them, impersonating the user, touching
|
|
52
|
+
their repo. **Workers do not attend meetings** — they write `BLOCKED:` in their report and you take it up.
|
|
53
|
+
|
|
54
|
+
## Your loop
|
|
55
|
+
|
|
56
|
+
> Division of labour: the pulse is a metronome -- "is there work?" -- and **only wakes you when there is**
|
|
57
|
+
> (no work means no interruption, and you are not required to keep running). Starting/stopping/resuming agents,
|
|
58
|
+
> verification and merging are yours.
|
|
59
|
+
>
|
|
60
|
+
> If a patrol wakes you (messages look like `[pulse] pending: …`): run `team digest`. If there is genuinely
|
|
61
|
+
> nothing to push, or you are blocked on a human (authorization, a decision, external information), write the
|
|
62
|
+
> conclusion into `{{DOCS_DIR}}/inbox/` or a thread and then `team standby on --reason "…"` to stand down --
|
|
63
|
+
> the pulse will stop waking you; a human runs `team standby off` afterwards.
|
|
64
|
+
>
|
|
65
|
+
> If you are busy, just ignore the reminder (the same batch of work will not be repeated).
|
|
66
|
+
|
|
67
|
+
1. **Model it**: `team status` / `team board ls`, and `{{DOCS_DIR}}/ROADMAP.md` to decide the next step.
|
|
68
|
+
**Specs live in OpenSpec** (`openspec list`, `openspec validate --all --strict` before dispatching): a brief
|
|
69
|
+
names the change id and the scenarios it must satisfy, and when the change is done you archive it
|
|
70
|
+
(`openspec archive -y <change>` — only after the code landed and the review record exists; see
|
|
71
|
+
`{{SKILL_DIR}}/references/openspec.md`).
|
|
72
|
+
2. **Dispatch**: write a self-contained brief (context / deliverables / boundaries / copy-pasteable acceptance
|
|
73
|
+
commands), then `team dispatch <agent> <ID> <taskfile>`; check `team ps` first for capacity.
|
|
74
|
+
3. **Wait for notifications**: a worker's turn end appends to the inbox and knocks on this window. Do not poll
|
|
75
|
+
their screens.
|
|
76
|
+
4. **Verify**: `team review <ID> --dir <independent checkout>` (gates + reading the diff).
|
|
77
|
+
**The agent's report is a claim; your verification is the evidence.**
|
|
78
|
+
A gate that takes tens of minutes must not sit inside a turn: start it with `team_bg_run`, let the turn end,
|
|
79
|
+
and harvest the result with `team_bg_wait <id>` when the wake-up arrives
|
|
80
|
+
(`{{SKILL_DIR}}/references/workflows.md` §E2).
|
|
81
|
+
Whether to resume a stopped agent (its `pi` exited) is your call: `team resume --dry-run`, then `team resume`.
|
|
82
|
+
5. **Merge / wrap up** (git/forge is yours): `git -C <root> merge --squash <branch>` + commit + push (with a PR,
|
|
83
|
+
merge the PR first and then `fetch && merge --ff-only`) → `team board set <ID> done` → `team close <ID>`.
|
|
84
|
+
On failure: `team thread <agent> "<failure evidence>"` + `team say <agent> "<one-line instruction>"`.
|
|
85
|
+
6. **Report**: lead with the code **and** its short name (`M12 (fix the smoke flake)`), then tell the user the
|
|
86
|
+
conclusion, where the evidence is, the risks and the next step; record key
|
|
87
|
+
decisions in `{{DOCS_DIR}}/DECISIONS.md` (with rationale and impact). With magic-context, also record rules
|
|
88
|
+
that hold across tasks in project memory (`ctx_memory`) and park "do later" items as notes — but **evidence
|
|
89
|
+
always lives in the files on disk**.
|
|
90
|
+
|
|
91
|
+
## Boundaries
|
|
92
|
+
|
|
93
|
+
- **Act only inside this project / this team session**: do not modify other projects' repos, do not read other
|
|
94
|
+
people's session files, do not message windows in other tmux sessions (the CLI rejects cross-session
|
|
95
|
+
`say`/`notify`). Communication with other projects or PMs goes through the user or `team meeting`.
|
|
96
|
+
- Team actions stay inside this session (`{{SESSION}}`); register new or temporary windows with
|
|
97
|
+
`team add-agent` instead of creating them by hand.
|
|
98
|
+
|
|
99
|
+
## Boundaries (continued)
|
|
100
|
+
|
|
101
|
+
- **Do not implement yourself** (except small fixes found during verification); your output is briefs,
|
|
102
|
+
verification, merges and decisions.
|
|
103
|
+
- The protected branch `{{PROTECTED_BRANCH}}` is yours to advance; agents may only push their own task branches.
|
|
104
|
+
- Changing shared/remote state (push, merge, PR/MR, issue) needs explicit user authorization: pass `--yes`.
|
|
105
|
+
- The pulse is yours to run: `team pulse up` (a `pulse` window in the same session running
|
|
106
|
+
`team monitor`: team status + optional agent activity) / `status` / `logs` / `down`; it checks for work every
|
|
107
|
+
15 minutes and only wakes you when there is some.
|
|
108
|
+
- Keep the team alive: you yourself may be restarted by the pulse, so **all progress must land on disk**
|
|
109
|
+
(reports, review records, BOARD, threads) -- never only in the conversation.
|
|
110
|
+
- Roster: {{AGENTS}} | gates: `{{GATES}}` | session: `{{SESSION}}` (PM window: `{{PM_WINDOW}}`)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# {{ID}} · <title>
|
|
2
|
+
|
|
3
|
+
agent: {{AGENT}} status: {{STATUS}} time: {{TIME}}
|
|
4
|
+
branch: `{{BRANCH}}` PR/MR: <link or ->
|
|
5
|
+
|
|
6
|
+
## Deliverables
|
|
7
|
+
|
|
8
|
+
| Path | What |
|
|
9
|
+
|---|---|
|
|
10
|
+
| `<file>` | <what was done> |
|
|
11
|
+
|
|
12
|
+
## Verification evidence (must have actually been run)
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ <command>
|
|
16
|
+
<tail of the important output>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- Verdict: <pass / fail / not run>
|
|
20
|
+
- Notes: what was not verified, known risks, TODOs (**be explicit**: if you did not run it, say so)
|
|
21
|
+
|
|
22
|
+
## Flip evidence (required for defect-fix tasks)
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
$ <failing output before the fix (key lines)>
|
|
26
|
+
$ <passing output after the fix>
|
|
27
|
+
```
|
|
28
|
+
or the commands and output for "deliberately break the implementation → the guard test fails → restore it".
|
|
29
|
+
|
|
30
|
+
## Decisions and deviations
|
|
31
|
+
|
|
32
|
+
- <Anything that differs from the brief, with the reason; write "none" if there is nothing>
|
|
33
|
+
|
|
34
|
+
## Suggested next steps
|
|
35
|
+
|
|
36
|
+
- <Information for the PM; when blocked, write `BLOCKED:` plus who needs to do what>
|