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.
Files changed (243) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -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 +747 -0
  7. package/skills/teamsmith/SKILL.md +312 -0
  8. package/skills/teamsmith/extension/team-bg.ts +399 -0
  9. package/skills/teamsmith/extension/team-inbox-watch.ts +1412 -0
  10. package/skills/teamsmith/extension/team-notify.ts +524 -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 +208 -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/checkout-shape-probe.sh +571 -0
  81. package/skills/teamsmith/tests/config-cli.sh +1562 -0
  82. package/skills/teamsmith/tests/container-tmux.sh +493 -0
  83. package/skills/teamsmith/tests/coverage-inventory.sh +173 -0
  84. package/skills/teamsmith/tests/death-cause.sh +564 -0
  85. package/skills/teamsmith/tests/delivery-truth.sh +1231 -0
  86. package/skills/teamsmith/tests/fake-tui.py +450 -0
  87. package/skills/teamsmith/tests/fixtures/delivery-truth-real/README.md +60 -0
  88. package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-second.py +139 -0
  89. package/skills/teamsmith/tests/fixtures/delivery-truth-real/mock-server.py +29 -0
  90. package/skills/teamsmith/tests/fixtures/delivery-truth-real/observe.ts +20 -0
  91. package/skills/teamsmith/tests/fixtures/delivery-truth-real/run-case.sh +79 -0
  92. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +175 -0
  93. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +229 -0
  94. package/skills/teamsmith/tests/fixtures/p71-incident/README.md +22 -0
  95. package/skills/teamsmith/tests/fixtures/p71-incident/dev2.seen +8 -0
  96. package/skills/teamsmith/tests/fixtures/p71-incident/dev2.wake +9 -0
  97. package/skills/teamsmith/tests/fixtures/p71-incident/pm-nudges.wake +3 -0
  98. package/skills/teamsmith/tests/fixtures/signal-lint-cases.txt +40 -0
  99. package/skills/teamsmith/tests/flip-glue.sh +162 -0
  100. package/skills/teamsmith/tests/flip-m12-26c.sh +129 -0
  101. package/skills/teamsmith/tests/flip-m12.sh +185 -0
  102. package/skills/teamsmith/tests/flip-m16.sh +166 -0
  103. package/skills/teamsmith/tests/flip-m17.sh +204 -0
  104. package/skills/teamsmith/tests/flip-m33.sh +284 -0
  105. package/skills/teamsmith/tests/flip-m34.sh +96 -0
  106. package/skills/teamsmith/tests/flip-m37.sh +185 -0
  107. package/skills/teamsmith/tests/flip-m4.3.sh +375 -0
  108. package/skills/teamsmith/tests/flip-m43.sh +128 -0
  109. package/skills/teamsmith/tests/flip-m44.sh +262 -0
  110. package/skills/teamsmith/tests/flip-m45.sh +244 -0
  111. package/skills/teamsmith/tests/flip-m46.sh +238 -0
  112. package/skills/teamsmith/tests/flip-m48.sh +304 -0
  113. package/skills/teamsmith/tests/flip-m6.2.sh +205 -0
  114. package/skills/teamsmith/tests/flip-m6.3.sh +283 -0
  115. package/skills/teamsmith/tests/flip-m6.4.sh +267 -0
  116. package/skills/teamsmith/tests/flip-m6.5.sh +113 -0
  117. package/skills/teamsmith/tests/flip-m7.1.sh +135 -0
  118. package/skills/teamsmith/tests/flip-m7.2.sh +321 -0
  119. package/skills/teamsmith/tests/flip-p144.sh +112 -0
  120. package/skills/teamsmith/tests/flip-p156.sh +133 -0
  121. package/skills/teamsmith/tests/flip-p158.sh +301 -0
  122. package/skills/teamsmith/tests/flip-p160.sh +182 -0
  123. package/skills/teamsmith/tests/flip-p171.sh +249 -0
  124. package/skills/teamsmith/tests/flip-p18.1.sh +95 -0
  125. package/skills/teamsmith/tests/flip-p20.sh +286 -0
  126. package/skills/teamsmith/tests/flip-p201.sh +249 -0
  127. package/skills/teamsmith/tests/flip-p210.sh +239 -0
  128. package/skills/teamsmith/tests/flip-p211.sh +152 -0
  129. package/skills/teamsmith/tests/flip-p217.sh +288 -0
  130. package/skills/teamsmith/tests/flip-p22.sh +123 -0
  131. package/skills/teamsmith/tests/flip-p23.sh +239 -0
  132. package/skills/teamsmith/tests/flip-p25.sh +165 -0
  133. package/skills/teamsmith/tests/flip-p71.sh +184 -0
  134. package/skills/teamsmith/tests/flip-p72.sh +202 -0
  135. package/skills/teamsmith/tests/frames/README.md +176 -0
  136. package/skills/teamsmith/tests/frames/p78-conversation-rule-below-box.txt +6 -0
  137. package/skills/teamsmith/tests/frames/p78-cursor-mid-draft.txt +6 -0
  138. package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor-line.txt +6 -0
  139. package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor.txt +6 -0
  140. package/skills/teamsmith/tests/frames/p78-draft-rule-blank-region.txt +6 -0
  141. package/skills/teamsmith/tests/frames/p78-draft-rule-only.txt +5 -0
  142. package/skills/teamsmith/tests/frames/p78-spinner-row-below-cursor.txt +6 -0
  143. package/skills/teamsmith/tests/frames/p78-wider-rule-below-cursor.txt +6 -0
  144. package/skills/teamsmith/tests/frames/p86-f1-mixed-width-disjoint-box.txt +8 -0
  145. package/skills/teamsmith/tests/frames/p86-f1-narrower-width-disjoint-box.txt +8 -0
  146. package/skills/teamsmith/tests/frames/p86-f1-spinner-top-disjoint-box.txt +8 -0
  147. package/skills/teamsmith/tests/frames/pi-0.85.1-update-banner.txt +30 -0
  148. package/skills/teamsmith/tests/frames/pi-0.87.0-draft-half-sentence.txt +30 -0
  149. package/skills/teamsmith/tests/frames/pi-0.87.0-empty-box.txt +30 -0
  150. package/skills/teamsmith/tests/frames/pi-0.87.0-one-line-draft.txt +30 -0
  151. package/skills/teamsmith/tests/frames/pi-0.87.0-project-trust-prompt.txt +30 -0
  152. package/skills/teamsmith/tests/frames/pi-0.99.2-empty-editor.txt +32 -0
  153. package/skills/teamsmith/tests/frames/pi-0.99.2-human-draft.txt +32 -0
  154. package/skills/teamsmith/tests/frames/pi-1.0.0-git-error-in-box.txt +32 -0
  155. package/skills/teamsmith/tests/gate-guard.sh +112 -0
  156. package/skills/teamsmith/tests/guard-matrix.sh +233 -0
  157. package/skills/teamsmith/tests/install-shape.sh +731 -0
  158. package/skills/teamsmith/tests/ledger-ban.sh +612 -0
  159. package/skills/teamsmith/tests/lib/box-judge.sh +68 -0
  160. package/skills/teamsmith/tests/lib/checkout-shape.sh +77 -0
  161. package/skills/teamsmith/tests/lib/loop-scan.awk +114 -0
  162. package/skills/teamsmith/tests/lib/pty-wait.sh +676 -0
  163. package/skills/teamsmith/tests/lib/section-guard.sh +855 -0
  164. package/skills/teamsmith/tests/lib/shell-lex.pl +261 -0
  165. package/skills/teamsmith/tests/lib/tmp-root.sh +528 -0
  166. package/skills/teamsmith/tests/lib/tmux-cap.sh +35 -0
  167. package/skills/teamsmith/tests/lib/tmux-iso-call-probe.sh +81 -0
  168. package/skills/teamsmith/tests/lib/tmux-iso-probe.sh +46 -0
  169. package/skills/teamsmith/tests/lib/tmux-iso.sh +381 -0
  170. package/skills/teamsmith/tests/load-experiment.sh +290 -0
  171. package/skills/teamsmith/tests/loop-inventory.tsv +84 -0
  172. package/skills/teamsmith/tests/panel-b2-slow-stub.sh +19 -0
  173. package/skills/teamsmith/tests/panel-b2.sh +1183 -0
  174. package/skills/teamsmith/tests/panel-b3-pty-mouse.py +240 -0
  175. package/skills/teamsmith/tests/panel-b3-pty-tmux-mouse.py +138 -0
  176. package/skills/teamsmith/tests/panel-b3-stub.sh +279 -0
  177. package/skills/teamsmith/tests/panel-b3.sh +1301 -0
  178. package/skills/teamsmith/tests/panel-choices.sh +572 -0
  179. package/skills/teamsmith/tests/panel-clipboard-model.ts +187 -0
  180. package/skills/teamsmith/tests/panel-compose-model.ts +290 -0
  181. package/skills/teamsmith/tests/panel-contrast.mjs +81 -0
  182. package/skills/teamsmith/tests/panel-cpu-premise.sh +173 -0
  183. package/skills/teamsmith/tests/panel-cpu.sh +391 -0
  184. package/skills/teamsmith/tests/panel-flip-m54.sh +207 -0
  185. package/skills/teamsmith/tests/panel-flip-p123.sh +278 -0
  186. package/skills/teamsmith/tests/panel-flip-p125.sh +318 -0
  187. package/skills/teamsmith/tests/panel-flip-p128.sh +259 -0
  188. package/skills/teamsmith/tests/panel-keyprobe-pty.py +99 -0
  189. package/skills/teamsmith/tests/panel-keyprobe-stub.sh +41 -0
  190. package/skills/teamsmith/tests/panel-keyprobe.sh +82 -0
  191. package/skills/teamsmith/tests/panel-keyprobe.tsx +116 -0
  192. package/skills/teamsmith/tests/panel-knobs.sh +83 -0
  193. package/skills/teamsmith/tests/panel-p21.sh +2181 -0
  194. package/skills/teamsmith/tests/panel-snapshots.sh +802 -0
  195. package/skills/teamsmith/tests/panel-strings.mjs +195 -0
  196. package/skills/teamsmith/tests/perf.sh +740 -0
  197. package/skills/teamsmith/tests/pm-box-real.sh +350 -0
  198. package/skills/teamsmith/tests/pulse-nudge-key.sh +563 -0
  199. package/skills/teamsmith/tests/routes.sh +1652 -0
  200. package/skills/teamsmith/tests/section-budgets.tsv +150 -0
  201. package/skills/teamsmith/tests/section-guard.sh +231 -0
  202. package/skills/teamsmith/tests/section-needs-audit.sh +94 -0
  203. package/skills/teamsmith/tests/section-paths.tsv +142 -0
  204. package/skills/teamsmith/tests/section-select.sh +648 -0
  205. package/skills/teamsmith/tests/signal-gate.sh +366 -0
  206. package/skills/teamsmith/tests/signal-lint-legacy.txt +14 -0
  207. package/skills/teamsmith/tests/signal-lint.pl +416 -0
  208. package/skills/teamsmith/tests/skill-load.mjs +65 -0
  209. package/skills/teamsmith/tests/smoke.sh +19599 -0
  210. package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +32 -0
  211. package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +32 -0
  212. package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +32 -0
  213. package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +32 -0
  214. package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +32 -0
  215. package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +32 -0
  216. package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +32 -0
  217. package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +32 -0
  218. package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +32 -0
  219. package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +32 -0
  220. package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +32 -0
  221. package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +32 -0
  222. package/skills/teamsmith/tests/snapshots/zh-light-120.txt +32 -0
  223. package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +32 -0
  224. package/skills/teamsmith/tests/snapshots/zh-light-160.txt +32 -0
  225. package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +32 -0
  226. package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +32 -0
  227. package/skills/teamsmith/tests/snapshots/zh-light-59.txt +32 -0
  228. package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +32 -0
  229. package/skills/teamsmith/tests/snapshots/zh-light-99.txt +32 -0
  230. package/skills/teamsmith/tests/spec-ledger-refs.tsv +78 -0
  231. package/skills/teamsmith/tests/spec-refs.sh +826 -0
  232. package/skills/teamsmith/tests/task-header-model.sh +267 -0
  233. package/skills/teamsmith/tests/team-bg-flip.sh +239 -0
  234. package/skills/teamsmith/tests/team-bg-harness.mjs +392 -0
  235. package/skills/teamsmith/tests/team-bg-stop.sh +434 -0
  236. package/skills/teamsmith/tests/team-inbox-watch-flip.sh +191 -0
  237. package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +1559 -0
  238. package/skills/teamsmith/tests/tmp-hygiene.sh +1190 -0
  239. package/skills/teamsmith/tests/tmux-lint-legacy.txt +31 -0
  240. package/skills/teamsmith/tests/tmux-lint.pl +604 -0
  241. package/skills/teamsmith-init/SKILL.md +100 -0
  242. package/skills/teamsmith-init/references/bootstrap.md +74 -0
  243. package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +46 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 teamsmith contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,157 @@
1
- # Temporary Holding Version
1
+ # teamsmith
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Give one agent real ownership of a project**: it plans, dispatches, verifies independently, merges and keeps the ledger.
4
+
5
+ Runs on Pi; the launch/notify seam is an **internal seam (frozen)** — reserved for a possible future non-Pi adapter, with no compatibility promise (ROADMAP M3.0).
6
+
7
+ In one line: teamsmith turns a single agent session into a **project owner with a crew that can be inspected** —
8
+ not "more agents chatting with each other".
9
+
10
+ ## What it actually does
11
+
12
+ | Capability | Mechanism |
13
+ |---|---|
14
+ | Dispatch | Task briefs are self-contained (context / deliverables / boundaries / copy-pasteable acceptance commands); `team dispatch` puts a worker agent into its own tmux window and git worktree |
15
+ | **Independent verification** | The agent's report is a **claim**; the PM runs the gates on an **independent checkout** (`team review <ID> --dir …`) and that becomes the evidence |
16
+ | Ledger | `BOARD.md` (state), `reviews/` (verification evidence), `threads/` (decision trail), `DECISIONS.md` (the "why") |
17
+ | Not rigid | The watchdog only wakes the owner when there is pending work; the PM can `standby` deliberately; when capacity is tight, work queues instead of thrashing |
18
+ | Boundaries | Cross-project interaction is discussion only (`team meeting`) — never command; git/forge work stays with the PM's own tools |
19
+
20
+ Design rationale: [references/philosophy.md](skills/teamsmith/references/philosophy.md) (8 principles) and
21
+ [references/protocol.md](skills/teamsmith/references/protocol.md) (why each rule exists).
22
+
23
+ ## Included
24
+
25
+ | Skill | Notes |
26
+ |---|---|
27
+ | [`teamsmith`](skills/teamsmith/SKILL.md) | See above. Former name: `pi-team` (the `skills/pi-team` compatibility symlink was removed — old absolute paths must be updated) |
28
+ | [`teamsmith-init`](skills/teamsmith-init/SKILL.md) | The new-project entry point: settles the setup questions with the user, then runs the one command that writes config, the `docs/team/` skeleton and the protocol section |
29
+
30
+ The maintainers build teamsmith *with* teamsmith, and their ledger — board, task briefs, reports, reviews, decisions —
31
+ lives in `docs/team/` of their own checkout. That ledger is deliberately **not** part of the distributed package: what
32
+ you install is the product (this file, `skills/`, `bin/`, `openspec/specs/`), not the record of building it.
33
+
34
+ ## Install
35
+
36
+ ### Global CLI + project install (recommended)
37
+
38
+ ```bash
39
+ npm install -g teamsmith # the `team` CLI: one npm bin entry, checks bash >= 5 and prints the fix if it is missing
40
+ cd your-project
41
+ team init # config + docs skeleton + both skills into the project's .pi/skills/
42
+ ```
43
+
44
+ > First session in that project: Pi asks **“Project is not trusted”** before it will load project resources
45
+ > (`.pi/skills/` is one), and the skills stay invisible until you answer. `team init` prints the same line:
46
+ > answer `pi --approve` (this once) or approve the project in Pi's UI — nothing else is needed, and the skills are
47
+ > not modified either way.
48
+
49
+ `team init` installs `teamsmith` and `teamsmith-init` into the project's **`.pi/skills/`** — Pi's project-level
50
+ skill search path — so any session in that project sees the toolkit (the `openspec init` model: per project, and
51
+ version-lockable). The default is a symlink to the package, so package updates are live; `--copy` copies the files
52
+ instead (for an ephemeral source such as an `npx` cache, excluding `.git/` and `node_modules/`), and `--no-skills`
53
+ skips the step. Re-running is idempotent, `team bootstrap` runs the same step, and a conflict is announced rather
54
+ than replaced (`--force` replaces only an entry recognised as this skill).
55
+
56
+ ### As a Pi package (no global CLI)
57
+
58
+ ```bash
59
+ pi install git:git@github.com:Track07-cda/teamsmith@v0.1.1 # user level: every project
60
+ pi install -l git:git@github.com:Track07-cda/teamsmith@v0.1.1 # project level: recorded in .pi/settings.json
61
+ ```
62
+
63
+ - **Pin a released tag**: `@v<version>`, the version `team version` prints. Latest tag:
64
+ `git tag --sort=-v:refname | head -1`.
65
+ - The `git@github.com:` form (or `ssh://git@github.com/Track07-cda/teamsmith@v0.1.1`) uses your SSH key and works
66
+ whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.1.1` takes the HTTPS
67
+ route, so it works anonymously on the public repository and asks for credentials if your access is private.
68
+ - The clone lands in `~/.pi/agent/git/<host>/<path>` (user level) or `.pi/git/<host>/<path>` (project level); the
69
+ skill directory — the `<skill>` used in every command below — is `<clone>/skills/teamsmith`.
70
+ - `pi list` shows what is installed (add `--approve` for a project you have not trusted in this session yet);
71
+ uninstall with `pi remove [-l] --approve <source>`.
72
+
73
+ ### From a checkout (developers)
74
+
75
+ ```bash
76
+ git clone git@github.com:Track07-cda/teamsmith.git ~/src/teamsmith
77
+ pi install -l ~/src/teamsmith # project level; edits in the checkout are live (nothing is copied)
78
+ ```
79
+
80
+ ### Without Pi: `install.sh`
81
+
82
+ On a non-Pi host, `install.sh` puts the skill **files** where a skill directory can be read —
83
+ `~/.agents/skills` by default, next to other agent skills:
84
+
85
+ ```bash
86
+ ./install.sh # symlink every skill under skills/ into ~/.agents/skills (edit repo → live)
87
+ ./install.sh --copy # copy instead of symlink
88
+ ./install.sh --target DIR # custom target (e.g. ~/.pi/agent/skills)
89
+ ./install.sh --uninstall # remove what this repo installed
90
+ ```
91
+
92
+ ### What the package declares — and what it deliberately does not
93
+
94
+ The manifest (`package.json`) declares the two skills (`pi.skills: ["./skills"]` loads `teamsmith` and
95
+ `teamsmith-init`) and exactly one npm `bin` entry — `team` → `bin/team.mjs`, a transparent wrapper that runs the
96
+ bash CLI with your argv, stdio and exit status. The files under `skills/teamsmith/extension/` (`team-notify.ts`, `team-bg.ts`,
97
+ `team-inbox-watch.ts`) are deliberately **not** in the manifest: teamsmith injects each of them with `-e` when it
98
+ starts a PM or a worker window, so they exist only inside team windows. Installing the package adds no global
99
+ extension, command or hook to your own session.
100
+
101
+ ## Requirements
102
+
103
+ | Need | Why |
104
+ |---|---|
105
+ | **Pi ≥ 0.76.0** | The session harness needs `--session-id`, which `team doctor` fails without; it landed in Pi 0.76.0 and is verified working on 0.85.1. Package installs work from 0.74.0 on, but 0.74.0 lacks `--session-id`, so 0.76.0 is the floor |
106
+ | `bash` ≥ 5 | The CLI is bash (no jq/python); the npm `team` entry point checks this before running and prints the fix when it is missing. Measured: `team help` and `team init` exit 2 under bash 4.0; we test on 5.2, so 5 is what we can stand behind |
107
+ | `git` ≥ 2.31 | One worktree per agent; the PM does all branching/merging |
108
+ | `tmux` | One window per agent, the PM window, and the pulse window |
109
+ | `node` ≥ 20 or `bun` ≥ 1.3 | Needed by the npm-installed `team` wrapper (its shebang is `node`) and by the pulse console/patrol (`scripts/panel`). The Pi-package route and `./install.sh` are bash-only and do not need it; point `TEAM_JS_BIN` at it when it is not on `PATH` |
110
+ | **magic-context** — `pi install npm:@cortexkit/pi-magic-context` | Recommended: the PM's cross-session memory (`ctx_search` / `ctx_memory` / `ctx_note`). `team doctor` checks it |
111
+ | **OpenSpec CLI** (`openspec`) | The spec layer and `openspec validate --all --strict` inside the gates |
112
+ | `podman` | Optional: only for the tmux-touching tests (`skills/teamsmith/tests/container-tmux.sh`) |
113
+
114
+ No forge dependency: the PM uses `git`/`gh`/`glab` directly, and cross-project contact is `team meeting`.
115
+
116
+ ## Quickstart (in a project repo)
117
+
118
+ 1. **Bring the project up** — ask your agent to run the `teamsmith-init` skill. It settles the questions with you
119
+ (session and roster, models, gates, VCS mode, patrol rhythm), shows the plan, then writes it:
120
+
121
+ ```bash
122
+ bash <skill>/scripts/team bootstrap --print # the plan; writes nothing
123
+ bash <skill>/scripts/team bootstrap # .pi/team/config.sh + docs/team/** + agent worktrees + pulse
124
+ bash <skill>/scripts/team doctor # self-check: git/tmux/agent CLI/dependencies/gates/capacity
125
+ openspec init --tools pi # required dependency: spec root + the five phase commands
126
+ ```
127
+
128
+ `bootstrap` is idempotent and prints the `git worktree add` command for each agent (git stays with the PM).
129
+
130
+ 2. **Dispatch the first task**:
131
+
132
+ ```bash
133
+ TEAM="bash <skill>/scripts/team"
134
+
135
+ $TEAM task T1.1 --title "first task" --agent dev
136
+ $EDITOR docs/team/tasks/T1.1-*.md # context / deliverables / boundaries / acceptance commands
137
+ $TEAM dispatch dev T1.1 docs/team/tasks/T1.1-*.md
138
+ ```
139
+
140
+ 3. **Verify, don't trust the report**: `$TEAM review T1.1 --dir /tmp/t1.1-check` runs the gates on an independent
141
+ checkout of the task branch and writes `docs/team/reviews/T1.1.md` — that record, not the report, is the evidence.
142
+
143
+ ## Compatibility (former name: pi-team)
144
+
145
+ - The command is still **`team`**; project config is still **`.pi/team/config.sh`**; env vars are still **`TEAM_*`**;
146
+ team docs are still **`docs/team/**`**.
147
+ - The `skills/pi-team` **compatibility symlink was removed** (the alias period ended early by the user's call).
148
+ Existing projects that reference the old absolute path must change it to `skills/teamsmith` — see
149
+ [`skills/teamsmith/references/migration.md` §2](skills/teamsmith/references/migration.md).
150
+ - An `AGENTS.md` section marked `<!-- pi-team:begin -->` is migrated in place to the new marker by the next
151
+ `team init`/`bootstrap` (idempotent).
152
+ - The Pi command `/pi-team-reload` stays registered as an alias of `/teamsmith-reload` (a command name, unrelated
153
+ to the removed path).
154
+
155
+ ## License
156
+
157
+ MIT — see [LICENSE](LICENSE).
package/bin/team.mjs ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ // teamsmith 的 npm bin 入口(package.json 的 bin.team)。**透明包装器**:它不实现、不包装、不改写
3
+ // 任何子命令,只做两件事:
4
+ // ① 先检查自己依赖的 shell(bash >= 5,README.md 的 Requirements 表;实测 4.0 下 help/init 退出 2)—— 缺 shell 或 shell 太旧时
5
+ // 印出确切的修法并非 0 退出,**不跑 CLI**;
6
+ // ② 否则原样把 argv / stdio / env 交给 bash CLI(skills/teamsmith/scripts/team),退出码逐字透传
7
+ // (被信号打断 → 128 + signo)。
8
+ // 因此 `team help` / `team version` / 失败子命令与直接跑 bash 入口逐字节、逐退出码一致。
9
+ //
10
+ // 为什么是包装器而不是直接 `bin: {"team": ".../scripts/team"}`:npm 在 Windows 上生成的
11
+ // `team.cmd` / `team.ps1` 跑不了 `.sh` 目标(CreateProcess 报错且没有任何提示);包装器能在同一个
12
+ // 代码路径上把「装 bash 5+ / 用 Git Bash 或 WSL」说清楚 —— 这正是 `team doctor` 已经做出的承诺。
13
+ import { spawnSync } from 'node:child_process'
14
+ import { existsSync, realpathSync } from 'node:fs'
15
+ import { constants as osConstants } from 'node:os'
16
+ import { dirname, resolve } from 'node:path'
17
+ import { fileURLToPath } from 'node:url'
18
+
19
+ const BASH_MIN_MAJOR = 5
20
+ const REQUIREMENTS = 'README.md 的 Requirements 表'
21
+ const SELF = realpathSync(fileURLToPath(import.meta.url))
22
+ const CLI = resolve(dirname(SELF), '..', 'skills', 'teamsmith', 'scripts', 'team')
23
+
24
+ function die(message) {
25
+ process.stderr.write(`teamsmith: ${message}\n`)
26
+ process.exit(3)
27
+ }
28
+
29
+ if (!existsSync(CLI)) {
30
+ die(`这份安装不完整:找不到 CLI 入口 ${CLI}(重新安装 teamsmith 后重试)`)
31
+ }
32
+
33
+ /** bash 在本机解析到哪、是第几个大版本:`bash -c` 探针(与 CLI 自己的解析方式一致 —— PATH)。 */
34
+ function bashMajor() {
35
+ const probe = spawnSync('bash', ['-c', 'printf %s "${BASH_VERSINFO[0]:-0}"'], { encoding: 'utf8' })
36
+ if (probe.error) return { error: probe.error.code || probe.error.message }
37
+ return { raw: String(probe.stdout).trim(), major: Number.parseInt(String(probe.stdout).trim(), 10) }
38
+ }
39
+
40
+ const found = bashMajor()
41
+ if (found.error) {
42
+ die(`找不到可用的 bash(bash: ${found.error}):CLI 是 bash 脚本,需要 bash >= ${BASH_MIN_MAJOR}。` +
43
+ `装一个 bash ${BASH_MIN_MAJOR}+(Windows 用 Git Bash 或 WSL,或把 Pi 的 shellPath 指到它)并确保它在 PATH 里;` +
44
+ `前置条件见 ${REQUIREMENTS}`)
45
+ }
46
+ if (!Number.isInteger(found.major) || found.major < BASH_MIN_MAJOR) {
47
+ die(`bash 版本太旧:解析到的 bash 报了版本 ${found.raw || '未知'},需要 bash >= ${BASH_MIN_MAJOR}。` +
48
+ `升级 bash 后重试;前置条件见 ${REQUIREMENTS}`)
49
+ }
50
+
51
+ // 透明透传:同一个 argv、同一套 stdio(inherit)、同一个环境;不解析、不改写任何参数。
52
+ const child = spawnSync('bash', [CLI, ...process.argv.slice(2)], { stdio: 'inherit' })
53
+ if (child.error) {
54
+ die(`bash 无法启动(bash: ${child.error.code || child.error.message}):需要 bash >= ${BASH_MIN_MAJOR};前置条件见 ${REQUIREMENTS}`)
55
+ }
56
+ if (child.signal) {
57
+ process.exit(128 + (osConstants.signals[child.signal] ?? 0))
58
+ }
59
+ process.exit(child.status ?? 1)
package/install.sh ADDED
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env bash
2
+ # pi-skills 安装器:把仓库里的 skill 挂到 Pi 的全局 skill 目录。
3
+ #
4
+ # ./install.sh # 软链到 ~/.agents/skills(默认,改仓库即生效)
5
+ # ./install.sh --copy # 复制而不是软链
6
+ # ./install.sh --target DIR # 自定义目标(如 ~/.pi/agent/skills)
7
+ # ./install.sh --uninstall # 移除本仓库装入的 skill
8
+ #
9
+ # 也可以用 settings.json 的 skills 数组指向本仓库的 skills/ 目录,二选一即可。
10
+ set -euo pipefail
11
+
12
+ REPO="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ TARGET="${HOME}/.agents/skills"
14
+ MODE="link"
15
+ ACTION="install"
16
+
17
+ while [ $# -gt 0 ]; do
18
+ case "$1" in
19
+ --copy) MODE="copy"; shift ;;
20
+ --link) MODE="link"; shift ;;
21
+ --target) TARGET="${2:?--target 需要目录}"; shift 2 ;;
22
+ --uninstall) ACTION="uninstall"; shift ;;
23
+ -h|--help) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
24
+ *) echo "未知参数:$1" >&2; exit 2 ;;
25
+ esac
26
+ done
27
+
28
+ [ -d "$REPO/skills" ] || { echo "找不到 $REPO/skills" >&2; exit 1; }
29
+ command -v pi >/dev/null 2>&1 || echo "提示:PATH 里没有 pi(安装后由 pi 加载 skill)" >&2
30
+ mkdir -p "$TARGET"
31
+
32
+ status=0
33
+ for src in "$REPO"/skills/*/; do
34
+ name="$(basename "$src")"
35
+ [ -f "$src/SKILL.md" ] || { echo "跳过 $name(无 SKILL.md)"; continue; }
36
+
37
+ # M7.3:skills/ 下的条目只有**真实目录**才算一个 skill。任何软链(历史上是 `skills/pi-team`
38
+ # 兼容软链,M22 已删;将来可能是别的别名)安装时一律跳过,否则目标目录里会出现两个同名 skill
39
+ # 的发现入口(链接模式两条软链指向同一份代码,复制模式会把软链再复制一份)。
40
+ # 卸载时不跳过:旧版本装出来的 pi-team 入口要能顺手清掉(见下面的 uninstall 分支)。
41
+ # M22 之后仓库里没有软链样本了,这条守卫由 smoke 的 M22 夹具(真 skill + 软链别名)继续守。
42
+ if [ "$ACTION" = "install" ] && [ -L "${src%/}" ]; then
43
+ echo "跳过 $name(兼容软链 ${src%/} → $(readlink "${src%/}");安装规范目录即可,避免同名 skill 出现两个入口)"
44
+ continue
45
+ fi
46
+
47
+ dest="$TARGET/$name"
48
+
49
+ if [ "$ACTION" = "uninstall" ]; then
50
+ if [ -L "$dest" ] || [ -d "$dest" ]; then
51
+ rm -rf "$dest" && echo "移除 $dest"
52
+ else
53
+ echo "跳过 $name(未安装)"
54
+ fi
55
+ continue
56
+ fi
57
+
58
+ if [ -e "$dest" ] && [ ! -L "$dest" ]; then
59
+ echo "冲突:$dest 已存在且不是软链;用 --copy 或先手动处理" >&2
60
+ status=1
61
+ continue
62
+ fi
63
+ rm -rf "$dest"
64
+ if [ "$MODE" = "link" ]; then
65
+ ln -s "${src%/}" "$dest" && echo "软链 $dest → ${src%/}"
66
+ else
67
+ cp -R "${src%/}" "$dest" && echo "复制 $dest"
68
+ fi
69
+ # 可执行位不能丢(systemd ExecStart、团队直接调用都依赖它)
70
+ chmod +x "$dest"/scripts/team "$dest"/tests/smoke.sh 2>/dev/null || true
71
+
72
+ # 冒烟自测(可选,失败不阻塞安装)
73
+ if [ -x "$dest/scripts/team" ]; then
74
+ bash "$dest/scripts/team" version >/dev/null 2>&1 || echo "提示:$name 的 CLI 自检失败" >&2
75
+ fi
76
+ done
77
+
78
+ # M22:历史别名 `pi-team` 的卸载清理。它以前靠「仓库里留着 skills/pi-team 软链」被主循环顺带覆盖,
79
+ # 软链删掉以后主循环再也看不到这个名字 —— 旧版本装出来的入口会永远留在磁盘上(发现入口又变两个)。
80
+ # 这里按名字显式清一次,且**只在卸载路径**做:安装永远不重建别名。
81
+ if [ "$ACTION" = "uninstall" ]; then
82
+ for legacy in pi-team; do
83
+ if [ -L "$TARGET/$legacy" ] || [ -d "$TARGET/$legacy" ]; then
84
+ rm -rf "$TARGET/$legacy" && echo "移除 $TARGET/$legacy(历史别名,M22 起不再安装)"
85
+ fi
86
+ done
87
+ fi
88
+
89
+ if [ "$ACTION" = "install" ]; then
90
+ echo
91
+ echo "完成。在项目里:bash $TARGET/teamsmith/scripts/team init"
92
+ echo "(或把 '$TARGET' 加进 ~/.pi/agent/settings.json 的 skills 数组)"
93
+ fi
94
+ exit "$status"
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "teamsmith",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Turn one agent session into a project owner: self-contained task briefs dispatched to worker agents in their own git worktrees, independent verification on a separate checkout, and an auditable ledger (BOARD / reviews / threads / DECISIONS). Runs on Pi today.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "team": "./bin/team.mjs"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Track07-cda/teamsmith.git"
12
+ },
13
+ "keywords": [
14
+ "pi-package",
15
+ "pi",
16
+ "teamsmith",
17
+ "agents",
18
+ "multi-agent",
19
+ "orchestration",
20
+ "tmux",
21
+ "git-worktree",
22
+ "project-management"
23
+ ],
24
+ "files": [
25
+ "skills/",
26
+ "bin/",
27
+ "install.sh"
28
+ ],
29
+ "pi": {
30
+ "skills": [
31
+ "./skills"
32
+ ]
33
+ },
34
+ "scripts": {
35
+ "test": "TEAM_SMOKE_FAST=1 bash skills/teamsmith/tests/smoke.sh",
36
+ "test:full": "bash skills/teamsmith/tests/smoke.sh",
37
+ "gates": "openspec validate --all --strict && bash skills/teamsmith/tests/smoke.sh"
38
+ }
39
+ }