teamsmith 0.0.0-stage → 0.1.2

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.
Files changed (245) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +158 -2
  3. package/bin/team.mjs +59 -0
  4. package/install.sh +94 -0
  5. package/package.json +37 -4
  6. package/skills/teamsmith/CHANGELOG.md +763 -0
  7. package/skills/teamsmith/SKILL.md +312 -0
  8. package/skills/teamsmith/extension/team-bg.ts +435 -0
  9. package/skills/teamsmith/extension/team-inbox-watch.ts +1412 -0
  10. package/skills/teamsmith/extension/team-notify.ts +663 -0
  11. package/skills/teamsmith/references/agent-adapters.md +643 -0
  12. package/skills/teamsmith/references/config.md +477 -0
  13. package/skills/teamsmith/references/meeting.md +124 -0
  14. package/skills/teamsmith/references/memory.md +133 -0
  15. package/skills/teamsmith/references/migration.md +227 -0
  16. package/skills/teamsmith/references/openspec.md +222 -0
  17. package/skills/teamsmith/references/philosophy.md +95 -0
  18. package/skills/teamsmith/references/protocol.md +712 -0
  19. package/skills/teamsmith/references/troubleshooting.md +1384 -0
  20. package/skills/teamsmith/references/workflows.md +448 -0
  21. package/skills/teamsmith/scripts/lib/cmd-agents.sh +1709 -0
  22. package/skills/teamsmith/scripts/lib/cmd-bg.sh +284 -0
  23. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +311 -0
  24. package/skills/teamsmith/scripts/lib/cmd-config.sh +1156 -0
  25. package/skills/teamsmith/scripts/lib/cmd-death.sh +562 -0
  26. package/skills/teamsmith/scripts/lib/cmd-docs.sh +149 -0
  27. package/skills/teamsmith/scripts/lib/cmd-draft.sh +124 -0
  28. package/skills/teamsmith/scripts/lib/cmd-init.sh +212 -0
  29. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +904 -0
  30. package/skills/teamsmith/scripts/lib/cmd-outbox.sh +196 -0
  31. package/skills/teamsmith/scripts/lib/cmd-project.sh +642 -0
  32. package/skills/teamsmith/scripts/lib/cmd-review.sh +1393 -0
  33. package/skills/teamsmith/scripts/lib/cmd-status.sh +1399 -0
  34. package/skills/teamsmith/scripts/lib/cmd-update.sh +191 -0
  35. package/skills/teamsmith/scripts/lib/cmd-watch.sh +1681 -0
  36. package/skills/teamsmith/scripts/lib/common.sh +4964 -0
  37. package/skills/teamsmith/scripts/lib/draft-entry.sh +51 -0
  38. package/skills/teamsmith/scripts/lib/outbox.sh +2042 -0
  39. package/skills/teamsmith/scripts/lib/tmux-argv.sh +165 -0
  40. package/skills/teamsmith/scripts/monitor.mjs +616 -0
  41. package/skills/teamsmith/scripts/panel/README.md +192 -0
  42. package/skills/teamsmith/scripts/panel/build.sh +47 -0
  43. package/skills/teamsmith/scripts/panel/bun.lock +109 -0
  44. package/skills/teamsmith/scripts/panel/draft-send.sh +68 -0
  45. package/skills/teamsmith/scripts/panel/package.json +24 -0
  46. package/skills/teamsmith/scripts/panel/panel.js +388 -0
  47. package/skills/teamsmith/scripts/panel/src/App.tsx +2150 -0
  48. package/skills/teamsmith/scripts/panel/src/clipboard.ts +154 -0
  49. package/skills/teamsmith/scripts/panel/src/compose.ts +691 -0
  50. package/skills/teamsmith/scripts/panel/src/data.ts +555 -0
  51. package/skills/teamsmith/scripts/panel/src/format.ts +50 -0
  52. package/skills/teamsmith/scripts/panel/src/layout.ts +2562 -0
  53. package/skills/teamsmith/scripts/panel/src/main.tsx +894 -0
  54. package/skills/teamsmith/scripts/panel/src/markdown.ts +340 -0
  55. package/skills/teamsmith/scripts/panel/src/sanitize.ts +42 -0
  56. package/skills/teamsmith/scripts/panel/src/settings.ts +154 -0
  57. package/skills/teamsmith/scripts/panel/src/strings/en.ts +416 -0
  58. package/skills/teamsmith/scripts/panel/src/strings/index.ts +65 -0
  59. package/skills/teamsmith/scripts/panel/src/strings/types.ts +9 -0
  60. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +414 -0
  61. package/skills/teamsmith/scripts/panel/src/theme.ts +116 -0
  62. package/skills/teamsmith/scripts/panel/src/types.ts +652 -0
  63. package/skills/teamsmith/scripts/panel/src/width.ts +105 -0
  64. package/skills/teamsmith/scripts/panel/tsconfig.json +16 -0
  65. package/skills/teamsmith/scripts/shim/signal-gate +156 -0
  66. package/skills/teamsmith/scripts/shim/tmux +403 -0
  67. package/skills/teamsmith/scripts/team +143 -0
  68. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +147 -0
  69. package/skills/teamsmith/templates/BOARD.md.tmpl +18 -0
  70. package/skills/teamsmith/templates/DECISIONS.md.tmpl +22 -0
  71. package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +25 -0
  72. package/skills/teamsmith/templates/PROTOCOL.md.tmpl +84 -0
  73. package/skills/teamsmith/templates/ROADMAP.md.tmpl +29 -0
  74. package/skills/teamsmith/templates/config.sh.tmpl +106 -0
  75. package/skills/teamsmith/templates/memory-seed.md.tmpl +46 -0
  76. package/skills/teamsmith/templates/pm-prompt.md.tmpl +110 -0
  77. package/skills/teamsmith/templates/report.md.tmpl +36 -0
  78. package/skills/teamsmith/templates/task.md.tmpl +65 -0
  79. package/skills/teamsmith/templates/threads-README.md +17 -0
  80. package/skills/teamsmith/tests/bg-ledger-harness.mjs +682 -0
  81. package/skills/teamsmith/tests/bg-ledger.sh +307 -0
  82. package/skills/teamsmith/tests/checkout-shape-probe.sh +800 -0
  83. package/skills/teamsmith/tests/config-cli.sh +1562 -0
  84. package/skills/teamsmith/tests/container-tmux.sh +493 -0
  85. package/skills/teamsmith/tests/coverage-inventory.sh +173 -0
  86. package/skills/teamsmith/tests/death-cause.sh +564 -0
  87. package/skills/teamsmith/tests/delivery-truth.sh +1231 -0
  88. package/skills/teamsmith/tests/fake-tui.py +450 -0
  89. package/skills/teamsmith/tests/fixtures/delivery-truth-real/README.md +60 -0
  90. package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-second.py +139 -0
  91. package/skills/teamsmith/tests/fixtures/delivery-truth-real/mock-server.py +29 -0
  92. package/skills/teamsmith/tests/fixtures/delivery-truth-real/observe.ts +20 -0
  93. package/skills/teamsmith/tests/fixtures/delivery-truth-real/run-case.sh +79 -0
  94. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +175 -0
  95. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +229 -0
  96. package/skills/teamsmith/tests/fixtures/p71-incident/README.md +22 -0
  97. package/skills/teamsmith/tests/fixtures/p71-incident/dev2.seen +8 -0
  98. package/skills/teamsmith/tests/fixtures/p71-incident/dev2.wake +9 -0
  99. package/skills/teamsmith/tests/fixtures/p71-incident/pm-nudges.wake +3 -0
  100. package/skills/teamsmith/tests/fixtures/signal-lint-cases.txt +40 -0
  101. package/skills/teamsmith/tests/flip-glue.sh +162 -0
  102. package/skills/teamsmith/tests/flip-m12-26c.sh +129 -0
  103. package/skills/teamsmith/tests/flip-m12.sh +185 -0
  104. package/skills/teamsmith/tests/flip-m16.sh +166 -0
  105. package/skills/teamsmith/tests/flip-m17.sh +204 -0
  106. package/skills/teamsmith/tests/flip-m33.sh +284 -0
  107. package/skills/teamsmith/tests/flip-m34.sh +96 -0
  108. package/skills/teamsmith/tests/flip-m37.sh +185 -0
  109. package/skills/teamsmith/tests/flip-m4.3.sh +375 -0
  110. package/skills/teamsmith/tests/flip-m43.sh +128 -0
  111. package/skills/teamsmith/tests/flip-m44.sh +262 -0
  112. package/skills/teamsmith/tests/flip-m45.sh +244 -0
  113. package/skills/teamsmith/tests/flip-m46.sh +238 -0
  114. package/skills/teamsmith/tests/flip-m48.sh +304 -0
  115. package/skills/teamsmith/tests/flip-m6.2.sh +205 -0
  116. package/skills/teamsmith/tests/flip-m6.3.sh +283 -0
  117. package/skills/teamsmith/tests/flip-m6.4.sh +267 -0
  118. package/skills/teamsmith/tests/flip-m6.5.sh +113 -0
  119. package/skills/teamsmith/tests/flip-m7.1.sh +135 -0
  120. package/skills/teamsmith/tests/flip-m7.2.sh +321 -0
  121. package/skills/teamsmith/tests/flip-p144.sh +112 -0
  122. package/skills/teamsmith/tests/flip-p156.sh +133 -0
  123. package/skills/teamsmith/tests/flip-p158.sh +301 -0
  124. package/skills/teamsmith/tests/flip-p160.sh +182 -0
  125. package/skills/teamsmith/tests/flip-p171.sh +249 -0
  126. package/skills/teamsmith/tests/flip-p18.1.sh +95 -0
  127. package/skills/teamsmith/tests/flip-p20.sh +286 -0
  128. package/skills/teamsmith/tests/flip-p201.sh +249 -0
  129. package/skills/teamsmith/tests/flip-p210.sh +239 -0
  130. package/skills/teamsmith/tests/flip-p211.sh +152 -0
  131. package/skills/teamsmith/tests/flip-p217.sh +288 -0
  132. package/skills/teamsmith/tests/flip-p22.sh +123 -0
  133. package/skills/teamsmith/tests/flip-p23.sh +239 -0
  134. package/skills/teamsmith/tests/flip-p25.sh +165 -0
  135. package/skills/teamsmith/tests/flip-p71.sh +184 -0
  136. package/skills/teamsmith/tests/flip-p72.sh +202 -0
  137. package/skills/teamsmith/tests/frames/README.md +176 -0
  138. package/skills/teamsmith/tests/frames/p78-conversation-rule-below-box.txt +6 -0
  139. package/skills/teamsmith/tests/frames/p78-cursor-mid-draft.txt +6 -0
  140. package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor-line.txt +6 -0
  141. package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor.txt +6 -0
  142. package/skills/teamsmith/tests/frames/p78-draft-rule-blank-region.txt +6 -0
  143. package/skills/teamsmith/tests/frames/p78-draft-rule-only.txt +5 -0
  144. package/skills/teamsmith/tests/frames/p78-spinner-row-below-cursor.txt +6 -0
  145. package/skills/teamsmith/tests/frames/p78-wider-rule-below-cursor.txt +6 -0
  146. package/skills/teamsmith/tests/frames/p86-f1-mixed-width-disjoint-box.txt +8 -0
  147. package/skills/teamsmith/tests/frames/p86-f1-narrower-width-disjoint-box.txt +8 -0
  148. package/skills/teamsmith/tests/frames/p86-f1-spinner-top-disjoint-box.txt +8 -0
  149. package/skills/teamsmith/tests/frames/pi-0.85.1-update-banner.txt +30 -0
  150. package/skills/teamsmith/tests/frames/pi-0.87.0-draft-half-sentence.txt +30 -0
  151. package/skills/teamsmith/tests/frames/pi-0.87.0-empty-box.txt +30 -0
  152. package/skills/teamsmith/tests/frames/pi-0.87.0-one-line-draft.txt +30 -0
  153. package/skills/teamsmith/tests/frames/pi-0.87.0-project-trust-prompt.txt +30 -0
  154. package/skills/teamsmith/tests/frames/pi-0.99.2-empty-editor.txt +32 -0
  155. package/skills/teamsmith/tests/frames/pi-0.99.2-human-draft.txt +32 -0
  156. package/skills/teamsmith/tests/frames/pi-1.0.0-git-error-in-box.txt +32 -0
  157. package/skills/teamsmith/tests/gate-guard.sh +112 -0
  158. package/skills/teamsmith/tests/guard-matrix.sh +233 -0
  159. package/skills/teamsmith/tests/install-shape.sh +731 -0
  160. package/skills/teamsmith/tests/ledger-ban.sh +612 -0
  161. package/skills/teamsmith/tests/lib/box-judge.sh +68 -0
  162. package/skills/teamsmith/tests/lib/checkout-shape.sh +129 -0
  163. package/skills/teamsmith/tests/lib/loop-scan.awk +114 -0
  164. package/skills/teamsmith/tests/lib/pty-wait.sh +676 -0
  165. package/skills/teamsmith/tests/lib/section-guard.sh +855 -0
  166. package/skills/teamsmith/tests/lib/shell-lex.pl +261 -0
  167. package/skills/teamsmith/tests/lib/tmp-root.sh +528 -0
  168. package/skills/teamsmith/tests/lib/tmux-cap.sh +35 -0
  169. package/skills/teamsmith/tests/lib/tmux-iso-call-probe.sh +81 -0
  170. package/skills/teamsmith/tests/lib/tmux-iso-probe.sh +46 -0
  171. package/skills/teamsmith/tests/lib/tmux-iso.sh +381 -0
  172. package/skills/teamsmith/tests/load-experiment.sh +290 -0
  173. package/skills/teamsmith/tests/loop-inventory.tsv +84 -0
  174. package/skills/teamsmith/tests/panel-b2-slow-stub.sh +19 -0
  175. package/skills/teamsmith/tests/panel-b2.sh +1183 -0
  176. package/skills/teamsmith/tests/panel-b3-pty-mouse.py +240 -0
  177. package/skills/teamsmith/tests/panel-b3-pty-tmux-mouse.py +138 -0
  178. package/skills/teamsmith/tests/panel-b3-stub.sh +279 -0
  179. package/skills/teamsmith/tests/panel-b3.sh +1301 -0
  180. package/skills/teamsmith/tests/panel-choices.sh +572 -0
  181. package/skills/teamsmith/tests/panel-clipboard-model.ts +187 -0
  182. package/skills/teamsmith/tests/panel-compose-model.ts +290 -0
  183. package/skills/teamsmith/tests/panel-contrast.mjs +81 -0
  184. package/skills/teamsmith/tests/panel-cpu-premise.sh +173 -0
  185. package/skills/teamsmith/tests/panel-cpu.sh +391 -0
  186. package/skills/teamsmith/tests/panel-flip-m54.sh +207 -0
  187. package/skills/teamsmith/tests/panel-flip-p123.sh +278 -0
  188. package/skills/teamsmith/tests/panel-flip-p125.sh +318 -0
  189. package/skills/teamsmith/tests/panel-flip-p128.sh +259 -0
  190. package/skills/teamsmith/tests/panel-keyprobe-pty.py +99 -0
  191. package/skills/teamsmith/tests/panel-keyprobe-stub.sh +41 -0
  192. package/skills/teamsmith/tests/panel-keyprobe.sh +82 -0
  193. package/skills/teamsmith/tests/panel-keyprobe.tsx +116 -0
  194. package/skills/teamsmith/tests/panel-knobs.sh +83 -0
  195. package/skills/teamsmith/tests/panel-p21.sh +2181 -0
  196. package/skills/teamsmith/tests/panel-snapshots.sh +802 -0
  197. package/skills/teamsmith/tests/panel-strings.mjs +195 -0
  198. package/skills/teamsmith/tests/perf.sh +740 -0
  199. package/skills/teamsmith/tests/pm-box-real.sh +350 -0
  200. package/skills/teamsmith/tests/pulse-nudge-key.sh +563 -0
  201. package/skills/teamsmith/tests/routes.sh +1652 -0
  202. package/skills/teamsmith/tests/section-budgets.tsv +150 -0
  203. package/skills/teamsmith/tests/section-guard.sh +231 -0
  204. package/skills/teamsmith/tests/section-needs-audit.sh +94 -0
  205. package/skills/teamsmith/tests/section-paths.tsv +142 -0
  206. package/skills/teamsmith/tests/section-select.sh +655 -0
  207. package/skills/teamsmith/tests/signal-gate.sh +366 -0
  208. package/skills/teamsmith/tests/signal-lint-legacy.txt +14 -0
  209. package/skills/teamsmith/tests/signal-lint.pl +416 -0
  210. package/skills/teamsmith/tests/skill-load.mjs +65 -0
  211. package/skills/teamsmith/tests/smoke.sh +19711 -0
  212. package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +32 -0
  213. package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +32 -0
  214. package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +32 -0
  215. package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +32 -0
  216. package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +32 -0
  217. package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +32 -0
  218. package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +32 -0
  219. package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +32 -0
  220. package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +32 -0
  221. package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +32 -0
  222. package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +32 -0
  223. package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +32 -0
  224. package/skills/teamsmith/tests/snapshots/zh-light-120.txt +32 -0
  225. package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +32 -0
  226. package/skills/teamsmith/tests/snapshots/zh-light-160.txt +32 -0
  227. package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +32 -0
  228. package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +32 -0
  229. package/skills/teamsmith/tests/snapshots/zh-light-59.txt +32 -0
  230. package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +32 -0
  231. package/skills/teamsmith/tests/snapshots/zh-light-99.txt +32 -0
  232. package/skills/teamsmith/tests/spec-ledger-refs.tsv +78 -0
  233. package/skills/teamsmith/tests/spec-refs.sh +826 -0
  234. package/skills/teamsmith/tests/task-header-model.sh +267 -0
  235. package/skills/teamsmith/tests/team-bg-flip.sh +239 -0
  236. package/skills/teamsmith/tests/team-bg-harness.mjs +392 -0
  237. package/skills/teamsmith/tests/team-bg-stop.sh +434 -0
  238. package/skills/teamsmith/tests/team-inbox-watch-flip.sh +191 -0
  239. package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +1559 -0
  240. package/skills/teamsmith/tests/tmp-hygiene.sh +1190 -0
  241. package/skills/teamsmith/tests/tmux-lint-legacy.txt +31 -0
  242. package/skills/teamsmith/tests/tmux-lint.pl +604 -0
  243. package/skills/teamsmith-init/SKILL.md +100 -0
  244. package/skills/teamsmith-init/references/bootstrap.md +74 -0
  245. package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +46 -0
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: teamsmith-init
3
+ description: teamsmith-init is the new-project entry point of the teamsmith toolkit — organize multiple agents into a team, set up an agent collaboration protocol, and bootstrap this skill into a new project. It walks the questions to settle with the user first (dependencies, session and roster, per-agent models, gates, VCS mode, install command, and the project's ROADMAP/OWNERSHIP/AGENTS.md red lines), then runs the one command that writes `.pi/team/config.sh` + the `docs/team/` skeleton + the `AGENTS.md` protocol section and starts the pulse, and finally hands day-to-day operation to the `teamsmith` skill. Use when the user wants to bootstrap teamsmith into a new repository, set up a brand-new team, organize multiple agents into a team, or set up an agent collaboration protocol where none exists yet.
4
+ license: MIT
5
+ metadata:
6
+ version: "0.1.2"
7
+ ---
8
+
9
+ # teamsmith-init · bring a new project to "ready to dispatch"
10
+
11
+ You are the first session in a repository that has no team yet. **Install first**, then settle the questions below
12
+ with the user, run one command, then hand day-to-day operation to the **`teamsmith`** skill.
13
+
14
+ ## 0. Install the CLI and the project's skills
15
+
16
+ ```bash
17
+ npm install -g teamsmith # the `team` CLI (one npm bin entry; it checks bash >= 5 and prints the fix)
18
+ team init # in this project: config + docs skeleton + the skills into .pi/skills/
19
+ ```
20
+
21
+ `team init` installs both skills into the project's **`.pi/skills/`** (Pi's project-level search path), so this
22
+ project's own sessions find `teamsmith`/`teamsmith-init` without a machine-global install; the default is a symlink
23
+ to the package (updates are live), `--copy` copies instead, `--no-skills` skips the step. Because `.pi/skills/` is
24
+ one of the project resources Pi asks about, the **first interactive `pi` run in this project shows a project-trust
25
+ prompt** — the install step prints a line saying so and naming the three answers: `pi --approve` (trust the
26
+ project-local files for that one run), `/trust` inside Pi (save the decision), and `team init --no-skills` (skip the
27
+ install altogether). Two alternatives when npm
28
+ is not your route: the Pi package (`pi install …` at a released tag — no global CLI needed) and `./install.sh` from
29
+ a checkout, which writes into `~/.agents/skills`. Everything that follows the setup (dispatch, the pulse, review,
30
+ merge) belongs to the daily skill; this one only brings the project up.
31
+
32
+ ## 1. Settle these with the user, in this order
33
+
34
+ 1. **Preconditions.** A git repository with at least one commit, `tmux` in the room, and `team doctor` green
35
+ (magic-context, OpenSpec, a JS runtime for the console, the shell — bash ≥ 4, which the npm entry checks).
36
+ Fix what doctor reports *before* writing config — a missing required dependency is a hard failure later, not a
37
+ warning now.
38
+ 2. **Identity and a minimal starting roster.** The tmux session name (`TEAM_SESSION` must match the session the PM
39
+ lives in — the pulse and every notification are delivered inside it), the PM window name, the roster
40
+ (`TEAM_AGENTS`), each agent's model (`TEAM_AGENT_MODELS`, or `TEAM_DEFAULT_MODEL` for all of them) and
41
+ `TEAM_MODEL_LIMITS` when a provider quota is tight. **Start the roster minimal — one `dev` plus one `verify` is
42
+ plenty**; `team add-agent <name> --register` grows the roster and `team teardown --agent <name> --register`
43
+ shrinks it (both audited; a bare `team add-agent <name>` refuses a seat not in the roster), so the roster
44
+ follows the board, not a guess. (A PM-only start is legal too — `team doctor` only warns; dispatch refuses.)
45
+ 3. **Gates, install command, VCS mode, patrol rhythm.** `TEAM_GATES` is the command that decides pass/fail during
46
+ every verification (it must run from a clean checkout of a task branch); `TEAM_INSTALL_CMD` runs after a worktree
47
+ is created; `TEAM_VCS` is a label for the wording (`local` = no forge, the PM squash-merges locally);
48
+ `TEAM_PULSE_INTERVAL` is the patrol rhythm (default 15 minutes).
49
+ 4. **Pi version and installed plugins.** Check Pi against the floor `README.md` states (Pi ≥ 0.76.0 — the
50
+ `--session-id` criterion `team doctor`'s `pi` row fails on), then let `team doctor` report the plugins this
51
+ project already has (`已装插件 packages`: the names, and whether each is project- or user-level). That row is
52
+ information only: **teamsmith never asks the user to install a third-party plugin** — the team's own background
53
+ lane ships with the skill (`team-bg`), and the only package worth recommending is a teamsmith requirement such as
54
+ magic-context, which `doctor` already checks. A long task can also always fall back to a
55
+ background tmux window plus `team notify`; both lanes are in `references/troubleshooting.md` §17 of the daily skill.
56
+ 5. **The project's own documents** — the PM writes these, the tool does not: `docs/team/ROADMAP.md` (the goal,
57
+ milestones with **executable** exit criteria, and explicit non-goals), `docs/team/OWNERSHIP.md` (which directory
58
+ belongs to which agent; everything unlisted belongs to the PM), and the project-specific red lines in
59
+ `AGENTS.md` (the protocol section itself is injected automatically).
60
+ 6. **Then run it.** Show the plan first — it writes nothing:
61
+
62
+ ```bash
63
+ bash <teamsmith>/scripts/team bootstrap --print # the plan: detect / config / docs / skills / worktrees / pulse
64
+ bash <teamsmith>/scripts/team bootstrap [--agents "dev verify"]
65
+ bash <teamsmith>/scripts/team doctor # re-check after bootstrap
66
+ openspec init --tools pi # required dependency: spec root + the five phase commands
67
+ ```
68
+
69
+ `bootstrap` is idempotent (a rerun fills in what is missing and leaves the rest alone, including the project's
70
+ `.pi/skills/` install — that is the upgrade route for a project set up before this skill version) and it
71
+ **prints** the `git worktree add` command for each agent — git stays with the PM (`--create-worktrees`
72
+ delegates creation).
73
+ The command's own behaviour is in `references/bootstrap.md`; a prompt you can hand to a new project's PM is
74
+ `templates/bootstrap-prompt.md.tmpl`.
75
+ 7. **The first task.** `team task T1.1 --title "…" --agent dev` → edit the brief until it is self-contained →
76
+ `team dispatch dev T1.1 docs/team/tasks/T1.1-*.md`. From here the daily loop takes over.
77
+
78
+ ## 2. Handoff
79
+
80
+ Day-to-day operation lives in the **`teamsmith`** skill: the PM loop, dispatch, independent verification, merging,
81
+ the pulse, updates and the troubleshooting guide are all there — read `skills/teamsmith/SKILL.md` and follow it.
82
+ The three commands that answer "what now?": `team digest` (pending work), `team pulse status` (patrol and PM
83
+ liveness), `team doctor` (environment).
84
+
85
+ The handover itself is three steps, and the middle one is the one people skip:
86
+
87
+ 1. **Bootstrap.** `bash <teamsmith>/scripts/team bootstrap [--agents "dev verify"]` — it prints the plan first
88
+ with `--print`, and a rerun is idempotent.
89
+ 2. **Leave the room — or prove you are the PM.** `team up` starts the PM in this project's tmux session, and the
90
+ PM is a *different* conversation from this one. Exit this session once bootstrap is done (keep it only if this
91
+ session already lives in the PM window).
92
+ 3. **Start the PM.** `bash <teamsmith>/scripts/team up [--fresh-pm]`. By default `up` continues **the last
93
+ conversation in this directory** (`pi -c`) — which is *this init conversation*, so the PM wakes up with the
94
+ init history. Add `--fresh-pm` to start the PM on a clean conversation instead (the old session file stays in
95
+ history as the kickoff record); it wins over `TEAM_PM_SESSION_ID` / `TEAM_PM_RESUME_ARGS` for that one launch
96
+ and is not written into the config. `team up --print` shows the decision and the exact command.
97
+
98
+ If step 3 prints `检测到同目录 … 还有 … 活着的 … 会话`, a session started in this directory is still running:
99
+ exit it first, or rerun with `--fresh-pm` — continuing one session from two processes at once would have both
100
+ write the same session file.
@@ -0,0 +1,74 @@
1
+ # Bootstrapping teamsmith in a project
2
+
3
+ The shortest path for a new project (or a PM taking over a repository for the first time).
4
+ **The PM owns the setup, including configuring the pulse.**
5
+
6
+ > Upgrading a project that was set up earlier (including one still carrying the former name `pi-team`), or rolling a
7
+ > bad upgrade back: see [migration.md](../../teamsmith/references/migration.md).
8
+
9
+ ## In one line
10
+
11
+ ```bash
12
+ bash <skill>/scripts/team bootstrap # idempotent; detects the current tmux session/window
13
+ bash <skill>/scripts/team bootstrap --agents "dev verify api" # custom roster
14
+ bash <skill>/scripts/team bootstrap --print # print the plan, change nothing
15
+ ```
16
+
17
+ Or hand the contents of `templates/bootstrap-prompt.md.tmpl` (placeholders substituted) to the PM of the new project:
18
+ "read this, then execute it".
19
+
20
+ ## What bootstrap actually does
21
+
22
+ | Step | Result | Idempotence |
23
+ |---|---|---|
24
+ | Detect tmux | adopts the `session:window` the PM itself runs in and writes it into the config (no manual fill-in) | recomputed every run |
25
+ | Write config | `.pi/team/config.sh` (identity/roster/models/gates/install command/forge/guards/pulse) | if it exists it is kept; only missing entries are filled in |
26
+ | Required dependencies | checks magic-context (Pi package `@cortexkit/pi-magic-context`) and OpenSpec (CLI resolvable + the spec dir); a missing one prints its exact fix/downgrade command, and does not block the setup | ✔ |
27
+ | Docs skeleton | `docs/team/{ROADMAP,BOARD,OWNERSHIP,DECISIONS,PROTOCOL}.md`, `tasks/`, `reports/`, `reviews/`, `threads/`, `inbox/` | skipped when present |
28
+ | Team protocol | injects the `<!-- teamsmith:begin --> … end -->` section into `AGENTS.md` (**refreshes** it instead of appending twice) | ✔ |
29
+ | `.gitignore` | `.pi/team/state/`, `docs/team/inbox/`, `docs/team/reviews/*.log`, `.worktrees/`, `.pi/skills/` | ✔ |
30
+ | Project skills | installs the running skills (`teamsmith`, and `teamsmith-init` when present) into the project's `.pi/skills/` — link by default, `--copy` for an ephemeral source; one line per skill; because `.pi/skills/` is a resource Pi asks about, the step also prints one line naming the project-trust prompt the first interactive `pi` run will show and its answers (`pi --approve` for a single run, `/trust` in Pi to save, `team init --no-skills` to skip); a conflict is announced with its routes and never replaced silently | a rerun `skip`s what is already right, and says the trust line again; this runs even when the config already exists (the upgrade path) |
31
+ | Agent worktrees | one long-lived `.worktrees/<agent>` per roster member (branch `agent/<agent>`), installing dependencies when `TEAM_INSTALL_CMD` is set | skipped when present |
32
+ | Pulse | `team pulse up`: a `pulse` window in the same session runs the monitor (patrolling every 15 minutes by default) | skipped when already running |
33
+ | Checklist | prints "what next" (ROADMAP/OWNERSHIP → first task → dispatch → digest) | — |
34
+
35
+ ## What the PM does afterwards
36
+
37
+ ```bash
38
+ openspec init --tools none # required dependency: create the project's spec root (TEAM_SPEC_DIR)
39
+ team pulse status # pulse window / patrol interval / pending work / PM liveness / capacity
40
+ team task T1.1 --title "…" --agent dev
41
+ team dispatch dev T1.1 docs/team/tasks/T1.1-*.md
42
+ team digest # pending work: notifications + reports awaiting verification + board
43
+ ```
44
+
45
+ ## The pulse is a window, configured by the PM
46
+
47
+ > The name: this was the `watchdog` until v1.36.0; its old command names are aliases (`team watchdog …`, `watchdog-status`,
48
+ > `install-watchdog`, `uninstall-watchdog`), the `watchdog` window name and the `TEAM_WATCH_*` variables keep
49
+ > working as aliases/fallbacks until v2.0.0 — an old project's patrol keeps running untouched, and
50
+ > `team pulse status` / `team doctor` name every legacy variable still in effect. The `state/watchdog.*` file
51
+ > names stay unchanged during the alias period (two patrols side by side is the one thing that must never happen).
52
+
53
+ - `team pulse up|down|restart|status|logs` (**there is exactly one backend**: a `pulse` window in the same session).
54
+ - **Default (tmux)**: start a `pulse` window in the same session that runs `team monitor` —
55
+ the top half is team status (PM/pending work/capacity/standby), the bottom half is each agent's Pi session activity
56
+ (who is doing what, how long they have been idle, recent events), and it patrols on `TEAM_PULSE_INTERVAL` at the same
57
+ time. `team pulse logs` shows a snapshot of the screen.
58
+ - Why only one backend (since v1.12.0 there is no podman/container/systemd form): **fewer dependencies are more
59
+ reliable** — one less runtime, one less layer of socket/permission/image problems, and only one place to look when
60
+ something breaks. The pulse does not need to survive the tmux server: if the server is gone the PM is gone too,
61
+ and rebuilding brings `team up` / `team pulse up` back together.
62
+ - What if the pulse itself died: `team pulse status` notices it is not there; `team pulse up` rebuilds the
63
+ window. Nothing restarts it automatically (that is the price of "managing less", paid for with zero extra runtime).
64
+ - Changing the patrol period: edit `TEAM_PULSE_INTERVAL` in `.pi/team/config.sh`, then `team pulse restart`.
65
+ - Do not introduce a second backend (container/systemd): the little bit of extra survivability costs another runtime,
66
+ permission model and socket, which is not worth it.
67
+
68
+ ## Common problems
69
+
70
+ | Symptom | What to do |
71
+ |---|---|
72
+ | `container not created` | stale error from before v1.12.0 (the container backend was removed) — `team pulse up` uses the tmux window, no image is built |
73
+ | The window is there but nothing patrols | `team pulse logs` to read the panel; `team watch --once` runs a single patrol tick to locate the problem |
74
+ | Want to shut it down completely | `team pulse down` (followed by `team standby on` so the PM stops being woken) |
@@ -0,0 +1,46 @@
1
+ # Bootstrap a new project with teamsmith
2
+
3
+ You are being asked to bring **this project** to the point where work can be dispatched. Follow these steps and
4
+ report back concisely. Do not invent scope beyond them.
5
+
6
+ ## 0. Preconditions
7
+
8
+ - A git repository with at least one commit (teamsmith uses git worktrees for isolation).
9
+ - `tmux` available, and `team` usable: `bash {{SKILL_DIR}}/scripts/team help`.
10
+
11
+ ## 1. Bring the project up
12
+
13
+ ```bash
14
+ bash {{SKILL_DIR}}/scripts/team bootstrap --agents "<dev verify>" --session "<session>" # idempotent
15
+ bash {{SKILL_DIR}}/scripts/team doctor
16
+ ```
17
+
18
+ `bootstrap` does all of this idempotently:
19
+
20
+ 1. writes `.pi/team/config.sh` (session, roster, gates, models, guards);
21
+ 2. writes the `docs/team/` skeleton (BOARD / ROADMAP / OWNERSHIP / PROTOCOL / DECISIONS / tasks / reports / reviews / threads / inbox);
22
+ 3. **prints** the `git worktree add` command for each agent (git stays with you; `--create-worktrees` creates them);
23
+ 4. starts the pulse (`pulse` window in the same session);
24
+ 5. prints the next steps.
25
+
26
+ ## 2. Fill in the project-specific parts (this is your work, not the tool's)
27
+
28
+ - `{{DOCS_DIR}}/ROADMAP.md` -- product goal, milestones with **executable** exit criteria, and explicit non-goals.
29
+ - `{{DOCS_DIR}}/OWNERSHIP.md` -- which directories belong to which agent; everything unlisted belongs to you.
30
+ - `.pi/team/config.sh` -- `TEAM_GATES` (the command that decides pass/fail during verification), the roster and
31
+ per-agent models, and `TEAM_MODEL_LIMITS` if a provider has a tight quota.
32
+ - `AGENTS.md` -- the protocol section is injected automatically; make sure the project-specific red lines are there.
33
+
34
+ ## 3. Make the first task real
35
+
36
+ ```bash
37
+ bash {{SKILL_DIR}}/scripts/team task T1.1 --title "<first slice>" --agent dev
38
+ $EDITOR {{DOCS_DIR}}/tasks/T1.1-*.md # context / deliverables / boundaries / acceptance commands
39
+ bash {{SKILL_DIR}}/scripts/team dispatch dev T1.1 {{DOCS_DIR}}/tasks/T1.1-*.md
40
+ ```
41
+
42
+ ## 4. Report back
43
+
44
+ State, in a few lines: what you configured (with the file paths), what the gates are, the first task, and anything
45
+ you need from the user (authorization, credentials, a decision). Evidence over prose: quote the commands you ran
46
+ and their outcome.