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.
- package/LICENSE +21 -0
- package/README.md +158 -2
- package/bin/team.mjs +59 -0
- package/install.sh +94 -0
- package/package.json +37 -4
- package/skills/teamsmith/CHANGELOG.md +763 -0
- package/skills/teamsmith/SKILL.md +312 -0
- package/skills/teamsmith/extension/team-bg.ts +435 -0
- package/skills/teamsmith/extension/team-inbox-watch.ts +1412 -0
- package/skills/teamsmith/extension/team-notify.ts +663 -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 +222 -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/bg-ledger-harness.mjs +682 -0
- package/skills/teamsmith/tests/bg-ledger.sh +307 -0
- package/skills/teamsmith/tests/checkout-shape-probe.sh +800 -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 +129 -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 +655 -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 +19711 -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
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,159 @@
|
|
|
1
|
-
#
|
|
1
|
+
# teamsmith
|
|
2
2
|
|
|
3
|
-
|
|
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.2 # user level: every project
|
|
60
|
+
pi install -l git:git@github.com:Track07-cda/teamsmith@v0.1.2 # 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.2`) uses your SSH key and works
|
|
66
|
+
whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.1.2` 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 generated phase commands
|
|
126
|
+
# (a pin without a `verify` workflow — 1.8.0 has only `core` —
|
|
127
|
+
# does not generate `opsx-verify`; see references/openspec.md §6)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`bootstrap` is idempotent and prints the `git worktree add` command for each agent (git stays with the PM).
|
|
131
|
+
|
|
132
|
+
2. **Dispatch the first task**:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
TEAM="bash <skill>/scripts/team"
|
|
136
|
+
|
|
137
|
+
$TEAM task T1.1 --title "first task" --agent dev
|
|
138
|
+
$EDITOR docs/team/tasks/T1.1-*.md # context / deliverables / boundaries / acceptance commands
|
|
139
|
+
$TEAM dispatch dev T1.1 docs/team/tasks/T1.1-*.md
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
3. **Verify, don't trust the report**: `$TEAM review T1.1 --dir /tmp/t1.1-check` runs the gates on an independent
|
|
143
|
+
checkout of the task branch and writes `docs/team/reviews/T1.1.md` — that record, not the report, is the evidence.
|
|
144
|
+
|
|
145
|
+
## Compatibility (former name: pi-team)
|
|
146
|
+
|
|
147
|
+
- The command is still **`team`**; project config is still **`.pi/team/config.sh`**; env vars are still **`TEAM_*`**;
|
|
148
|
+
team docs are still **`docs/team/**`**.
|
|
149
|
+
- The `skills/pi-team` **compatibility symlink was removed** (the alias period ended early by the user's call).
|
|
150
|
+
Existing projects that reference the old absolute path must change it to `skills/teamsmith` — see
|
|
151
|
+
[`skills/teamsmith/references/migration.md` §2](skills/teamsmith/references/migration.md).
|
|
152
|
+
- An `AGENTS.md` section marked `<!-- pi-team:begin -->` is migrated in place to the new marker by the next
|
|
153
|
+
`team init`/`bootstrap` (idempotent).
|
|
154
|
+
- The Pi command `/pi-team-reload` stays registered as an alias of `/teamsmith-reload` (a command name, unrelated
|
|
155
|
+
to the removed path).
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
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.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.2",
|
|
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
|
+
}
|