@nidvue/teamwork 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +329 -0
  2. package/LICENSE +661 -0
  3. package/NOTICE +16 -0
  4. package/README.md +462 -2
  5. package/SECURITY.md +64 -0
  6. package/package.json +71 -4
  7. package/prompts/teamwork-pulse.md +12 -0
  8. package/prompts/teamwork-review.md +16 -0
  9. package/skills/teamwork/AGENTS.md +462 -0
  10. package/skills/teamwork/SKILL.md +795 -0
  11. package/skills/teamwork/references/Adapters.md +112 -0
  12. package/skills/teamwork/references/Audit.md +120 -0
  13. package/skills/teamwork/references/Concurrency.md +160 -0
  14. package/skills/teamwork/references/Dissent.md +85 -0
  15. package/skills/teamwork/references/Docs.md +74 -0
  16. package/skills/teamwork/references/Engineering.md +410 -0
  17. package/skills/teamwork/references/Evidence.md +140 -0
  18. package/skills/teamwork/references/Remotes.md +144 -0
  19. package/skills/teamwork/references/Roles.md +201 -0
  20. package/skills/teamwork/references/State.md +64 -0
  21. package/skills/teamwork/references/Testing.md +144 -0
  22. package/skills/teamwork/roles/architect.md +153 -0
  23. package/skills/teamwork/roles/ceo.md +218 -0
  24. package/skills/teamwork/roles/cfo.md +150 -0
  25. package/skills/teamwork/roles/coo.md +147 -0
  26. package/skills/teamwork/roles/cto.md +162 -0
  27. package/skills/teamwork/roles/data-engineer.md +120 -0
  28. package/skills/teamwork/roles/designer.md +349 -0
  29. package/skills/teamwork/roles/developer.md +166 -0
  30. package/skills/teamwork/roles/product-manager.md +151 -0
  31. package/skills/teamwork/roles/project-manager.md +159 -0
  32. package/skills/teamwork/roles/release-engineer.md +245 -0
  33. package/skills/teamwork/roles/reviewer.md +254 -0
  34. package/skills/teamwork/roles/security-auditor.md +157 -0
  35. package/skills/teamwork/roles/technical-writer.md +121 -0
  36. package/skills/teamwork/roles/tester.md +180 -0
  37. package/skills/teamwork/scripts/build_pi_package.py +200 -0
  38. package/skills/teamwork/scripts/privacy_scan.py +1185 -0
  39. package/skills/teamwork/scripts/sync_skill.py +108 -0
  40. package/skills/teamwork/scripts/teamwork.py +28 -0
  41. package/skills/teamwork/scripts/verify_release.py +502 -0
  42. package/skills/teamwork/src/teamwork/__init__.py +18 -0
  43. package/skills/teamwork/src/teamwork/__main__.py +10 -0
  44. package/skills/teamwork/src/teamwork/bundle.py +157 -0
  45. package/skills/teamwork/src/teamwork/cli.py +16 -0
  46. package/skills/teamwork/src/teamwork/config.py +396 -0
  47. package/skills/teamwork/src/teamwork/engine.py +10119 -0
  48. package/skills/teamwork/src/teamwork/gitutil.py +172 -0
  49. package/skills/teamwork/src/teamwork/imaging.py +124 -0
  50. package/skills/teamwork/src/teamwork/io.py +144 -0
  51. package/skills/teamwork/src/teamwork/layout.py +253 -0
  52. package/skills/teamwork/src/teamwork/names.py +191 -0
  53. package/skills/teamwork/src/teamwork/portable.py +79 -0
  54. package/skills/teamwork/src/teamwork/records.py +1220 -0
  55. package/skills/teamwork/src/teamwork/resources.py +120 -0
  56. package/skills/teamwork/src/teamwork/version.py +13 -0
  57. package/skills/teamwork/templates/AGENTS.md +460 -0
  58. package/skills/teamwork/templates/Docs/Architecture.md +40 -0
  59. package/skills/teamwork/templates/Docs/Archive.md +8 -0
  60. package/skills/teamwork/templates/Docs/Board.md +28 -0
  61. package/skills/teamwork/templates/Docs/Costs.md +30 -0
  62. package/skills/teamwork/templates/Docs/Decisions.md +26 -0
  63. package/skills/teamwork/templates/Docs/Design.md +106 -0
  64. package/skills/teamwork/templates/Docs/Plan.md +24 -0
  65. package/skills/teamwork/templates/Docs/Project.md +40 -0
  66. package/skills/teamwork/templates/Docs/Release.md +43 -0
  67. package/skills/teamwork/templates/Docs/Research.md +36 -0
  68. package/skills/teamwork/templates/Docs/Risks.md +18 -0
  69. package/skills/teamwork/templates/TeamMap.md +100 -0
  70. package/skills/teamwork-pi/SKILL.md +77 -0
@@ -0,0 +1,28 @@
1
+ # BOARD - live status
2
+
3
+ Owner: Project Manager. Machine view: `teamwork.py board`. This file is the human
4
+ summary plus the blocker list.
5
+
6
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Research](Research.md) · [Design](Design.md) · [Risks](Risks.md) · [Costs](Costs.md) · [Archive](Archive.md)
7
+
8
+ ## Snapshot
9
+
10
+ - Date: - Milestone: - Verified criteria: <n>/<m>
11
+
12
+ ## In flight
13
+
14
+ | agent | task | prio | state | artifact |
15
+ |---|---|---|---|---|
16
+ | | | | | |
17
+
18
+ ## Blocked
19
+
20
+ | task | waiting on | owner | unblock action |
21
+ |---|---|---|---|
22
+ | | | | |
23
+
24
+ ## Duplicate or conflicting work
25
+
26
+ | what | owners | resolution |
27
+ |---|---|---|
28
+ | | | |
@@ -0,0 +1,30 @@
1
+ # COSTS - budget, unit economics, ROI
2
+
3
+ Owner: CFO. Every number states its assumption and check date. Escalate early if a
4
+ cap is projected to be hit.
5
+
6
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Research](Research.md) · [Design](Design.md) · [Risks](Risks.md) · [Archive](Archive.md)
7
+
8
+ ## Cost model
9
+
10
+ | driver | unit | rate | volume | monthly | note |
11
+ |---|---|---|---|---|---|
12
+ | | | | | | |
13
+
14
+ ## Budget
15
+
16
+ - Approved: - Hard caps and behaviour at cap: - Current burn:
17
+
18
+ ## Unit economics
19
+
20
+ - Cost per user / task / run: - Break-even assumption:
21
+
22
+ ## Build vs buy
23
+
24
+ | need | build | buy | recommendation | reason |
25
+ |---|---|---|---|---|
26
+ | | | | | |
27
+
28
+ ## Sources
29
+
30
+ - [title](https://full-url) - accessed YYYY-MM-DD
@@ -0,0 +1,26 @@
1
+ # DECISIONS
2
+
3
+ Owner: Architect for technical entries, CEO for governance, tribunal and red-line
4
+ entries. Append-only, newest last, binding. Every entry is traceable: it names who
5
+ decided, on what evidence, and what would falsify it.
6
+
7
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Research](Research.md) · [Design](Design.md) · [Risks](Risks.md) · [Costs](Costs.md) · [Release](Release.md) · [Archive](Archive.md)
8
+
9
+ ## D-0001 - <title>
10
+
11
+ - date: YYYY-MM-DD
12
+ - kind: technical | governance | redline | tribunal | scope | cost | process
13
+ - status: proposed | accepted | superseded | rejected
14
+ - deciders: <role or instance>
15
+ - decided by: <instance>
16
+ - task: <T-id>
17
+ - context: <the problem, one or two lines>
18
+ - options considered: <A - pro/con; B - pro/con>
19
+ - decision: <what>
20
+ - why: <the reasoning from evidence to conclusion>
21
+ - evidence: `<command or measurement> @<rev> -> <result>`
22
+ - falsified by: <the observation that would overturn this>
23
+ - consequences: <follow-ups, affected docs and lanes>
24
+
25
+ Record entries with `teamwork.py decision add --by <instance> ...` so they also
26
+ land in the tamper-evident ledger (`teamwork.py ledger verify`).
@@ -0,0 +1,106 @@
1
+ # DESIGN - UX, interaction, accessibility, visual assets
2
+
3
+ Owner: Designer. Developer-ready specs, not illustrations of finished code, plus
4
+ the record for every visual asset (raster and vector) the deliverable needs.
5
+
6
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Research](Research.md) · [Risks](Risks.md) · [Costs](Costs.md) · [Archive](Archive.md)
7
+
8
+ ## Principles
9
+
10
+ User first. Every choice - layout, typography, font, colour, image - is justified
11
+ by the user's task, not by taste. Simplicity, efficiency, usability and a great
12
+ experience, in that order. See `roles/designer.md` for the full policy.
13
+
14
+ | principle | what it means here | check |
15
+ |---|---|---|
16
+ | Simple | shortest correct path, one primary action, remove before adding | steps in the primary flow |
17
+ | Efficient | fewest actions, no dead ends, progressive disclosure | actions to complete the task |
18
+ | Usable | keyboard, focus, contrast, targets, semantics, zoom | contrast >= 4.5:1, target >= 24px, 200% zoom |
19
+ | Great experience | consistent states, honest errors, no dark patterns | every state specified |
20
+
21
+ ## Typography and fonts
22
+
23
+ | field | value |
24
+ |---|---|
25
+ | type scale | e.g. 12 / 14 / 16 / 20 / 28 px |
26
+ | body size / line height | >= 16 px / 1.4-1.6 |
27
+ | measure | 45-75 characters |
28
+ | font stack | `<platform stack>`, fallbacks stated explicitly |
29
+ | shipped font? | name + licence + subset, or "none - platform stack" |
30
+ | text-as-image | never; all text is real text |
31
+
32
+ ## Flows
33
+
34
+ | flow | entry | steps | success | errors | a11y |
35
+ |---|---|---|---|---|---|
36
+ | | | | | | |
37
+
38
+ ## Components and states
39
+
40
+ | component | default / hover / focus / active / disabled / loading / empty / error | tokens |
41
+ |---|---|---|
42
+ | | | |
43
+
44
+ ## Visual system
45
+
46
+ - Spacing / type / colour tokens: ...
47
+ - Layout and breakpoints: ...
48
+ - Motion: ...
49
+
50
+ ## Copy
51
+
52
+ | context | string |
53
+ |---|---|
54
+ | | |
55
+
56
+ ## Visual assets
57
+
58
+ You decide what the deliverable needs and you own it end to end - see
59
+ `roles/designer.md` for the policy, the model ranking and the improvement loop.
60
+ Vector first; raster only where the surface needs one.
61
+
62
+ ### Capability
63
+
64
+ | field | value |
65
+ |---|---|
66
+ | probe | `<teamwork imaging probe>` output (provider, model, source) |
67
+ | model licence | |
68
+ | local fallback | |
69
+ | cloud prompt policy | no private data, no real people, metadata stripped |
70
+ | medium decision | vector first; say why for each raster |
71
+
72
+ ### Assets
73
+
74
+ | id | asset | medium | purpose / surface | path | size | candidates | status |
75
+ |---|---|---|---|---|---|---|---|
76
+ | IMG-1 | | svg / raster / diagram | | | | 4 (raster) | planned |
77
+
78
+ ### IMG-1 - <name>
79
+
80
+ - medium: `<svg | raster | diagram-as-code>` and why
81
+ - prompt (raster) or viewBox/tokens (vector): `<verbatim>`
82
+ - negative: `text, letters, words, watermark, logo, ...`
83
+ - seed base (raster): `<n>` (candidate i uses seed+i)
84
+ - acceptance criteria: composition and safe area, legibility at 16 px and 2x,
85
+ no rendered text, correct anatomy, palette match, no watermark, resolution and
86
+ sharpness, accessible title/desc for vector
87
+ - licence / terms:
88
+ - candidates reviewed:
89
+ - selected:
90
+ - evidence: `<command @rev -> observed result>`
91
+
92
+ ### Review log
93
+
94
+ | candidate | verdict | reason | reviewer |
95
+ |---|---|---|---|
96
+ | IMG-1-0 | | | |
97
+
98
+ ### Improvement log
99
+
100
+ | round | what changed | why (criterion) | review after |
101
+ |---|---|---|---|
102
+ | 1 | | | |
103
+
104
+ > Cap: three improvement rounds per asset. If it still fails, escalate to the CEO
105
+ > with the criteria it cannot meet and the two best attempts. Never lower a
106
+ > criterion to make an asset pass, and never delete a rejected attempt.
@@ -0,0 +1,24 @@
1
+ # PLAN - milestones and task graph
2
+
3
+ Owner: Project Manager. One row per task; `deps` must be `done` before it runs.
4
+ Priority: P0 code, P1 tests, P2 docs.
5
+
6
+ Related: [Project](Project.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Research](Research.md) · [Design](Design.md) · [Risks](Risks.md) · [Costs](Costs.md) · [Release](Release.md) · [Archive](Archive.md)
7
+
8
+ ## M1 - <name>
9
+
10
+ Exit: <verifiable statement>
11
+
12
+ | id | task | role | prio | deps | artifact | status |
13
+ |---|---|---|---|---|---|---|
14
+ | T-0001 | Freeze interfaces | architect | P0 | - | Architecture.md | todo |
15
+ | T-0002 | Implement + unit tests | developer | P0 | architect:T-0001 | src/... | todo |
16
+ | T-0003 | Integration/E2E tests | tester | P1 | architect:T-0001 | tests/... | todo |
17
+ | T-0004 | UX spec | designer | P1 | architect:T-0001 | Design.md | todo |
18
+ | T-0005 | Docs | product-manager | P2 | developer:T-0002 | docs/... | todo |
19
+
20
+ ## Parallel rules
21
+
22
+ - Freeze interfaces first, then run dev / test / design lanes concurrently.
23
+ - Tests are written from the frozen contract, in parallel with implementation.
24
+ - Docs never block code or tests.
@@ -0,0 +1,40 @@
1
+ # PROJECT - <name>
2
+
3
+ Owner: CEO. Single source of truth for *what done means*. No task closes without
4
+ mapping to an acceptance criterion here.
5
+
6
+ Related: [Plan](Plan.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Research](Research.md) · [Design](Design.md) · [Risks](Risks.md) · [Costs](Costs.md) · [Release](Release.md) · [Archive](Archive.md)
7
+
8
+ ## Objective
9
+
10
+ <one paragraph: what we are building and what "finished" means>
11
+
12
+ ## Definition of done
13
+
14
+ - [ ] AC-1 <verifiable statement> - proof: `<command or artifact>`
15
+ - [ ] AC-2 ...
16
+ - [ ] All criteria verified by executed evidence on a recorded revision
17
+ - [ ] Unit + integration tests pass; docs match merged code
18
+
19
+ ## Scope
20
+
21
+ - In: ...
22
+ - Out (not doing): ...
23
+ - Constraints (time / budget / technical): ...
24
+ - Invariants that must not break: ...
25
+
26
+ ## Metrics
27
+
28
+ | Metric | Target | How measured |
29
+ |---|---|---|
30
+ | | | |
31
+
32
+ ## Assumptions and open questions
33
+
34
+ | # | Item | Owner | Status | Resolution |
35
+ |---|---|---|---|---|
36
+ | 1 | | | open | |
37
+
38
+ ## Sources
39
+
40
+ - [title](https://full-url) - accessed YYYY-MM-DD
@@ -0,0 +1,43 @@
1
+ # RELEASE - build, ship, roll back
2
+
3
+ Owner: Release Engineer. The canonical answer to "how does this get built, shipped,
4
+ verified and reverted". Keep it executable: every command here must run as written.
5
+
6
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Archive](Archive.md)
7
+
8
+ ## Build
9
+
10
+ | step | command | expected result |
11
+ |---|---|---|
12
+ | clean checkout | | |
13
+ | build | | |
14
+ | package / artefact | | |
15
+ | provenance (hash, signing) | | |
16
+
17
+ ## CI gates
18
+
19
+ | gate | command | blocks a merge? |
20
+ |---|---|---|
21
+ | | | |
22
+
23
+ ## Deploy
24
+
25
+ - environments and what differs between them:
26
+ - order of operations (migrations first? feature flag?):
27
+ - configuration and secrets *mechanism* (never values):
28
+
29
+ ## Rollback
30
+
31
+ - one command to return to the previous version:
32
+ - what is *not* reversible (data migrations) and how it is handled:
33
+ - last drill: `<command> @<rev> -> <result>` (date, duration, outcome)
34
+
35
+ ## Observability
36
+
37
+ - metrics, logs, traces, dashboards:
38
+ - alerts and their thresholds:
39
+ - runbooks:
40
+
41
+ ## Sources
42
+
43
+ - [title](https://full-url) - accessed YYYY-MM-DD
@@ -0,0 +1,36 @@
1
+ # RESEARCH - market, competitors, state of the art
2
+
3
+ Owner: Product Manager. Every claim carries a source and an access date; anything
4
+ unverified is marked UNVERIFIED.
5
+
6
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Design](Design.md) · [Risks](Risks.md) · [Costs](Costs.md) · [Archive](Archive.md)
7
+
8
+ ## 1. Problem and users
9
+
10
+ ## 2. Alternatives compared
11
+
12
+ | solution | approach | strengths | weaknesses | licence / price | relevance |
13
+ |---|---|---|---|---|---|
14
+ | | | | | | |
15
+
16
+ ## 3. State of the art
17
+
18
+ - Dominant techniques and why: ...
19
+ - Changes in the last 12-18 months: ...
20
+ - Benchmarks (numbers, not adjectives): ...
21
+
22
+ ## 4. What practitioners ship
23
+
24
+ ## 5. Gap analysis
25
+
26
+ | gap | evidence | opportunity | risk | recommendation |
27
+ |---|---|---|---|---|
28
+ | | | | | |
29
+
30
+ ## 6. Recommendation
31
+
32
+ <build this, not that, because ...>
33
+
34
+ ## Sources
35
+
36
+ - [title](https://full-url) - accessed YYYY-MM-DD
@@ -0,0 +1,18 @@
1
+ # RISKS - risk register
2
+
3
+ Owner: COO. Reviewed at every integration point. No entry without an owner and a
4
+ mitigation - otherwise escalate to the CEO instead of recording it.
5
+
6
+ Related: [Project](Project.md) · [Plan](Plan.md) · [Board](Board.md) · [Architecture](Architecture.md) · [Decisions](Decisions.md) · [Research](Research.md) · [Design](Design.md) · [Costs](Costs.md) · [Archive](Archive.md)
7
+
8
+ | id | risk | category | likelihood | impact | mitigation / trigger | owner | status |
9
+ |---|---|---|---|---|---|---|---|
10
+ | R-1 | | tech / delivery / security / cost | low-med-high | low-med-high | | | open |
11
+
12
+ ## Process health
13
+
14
+ - Cycle time: - Blocked hotspots: - Duplicate work seen: - Tooling gaps:
15
+
16
+ ## Sources
17
+
18
+ - [title](https://full-url) - accessed YYYY-MM-DD
@@ -0,0 +1,100 @@
1
+ # Team map
2
+
3
+ The team's own tree. **Hidden and independent of project output.** Every name is
4
+ PascalCase; one tree per team, so two teams in one repository never collide.
5
+
6
+ ```text
7
+ {project}/.pi/Teamwork/Teams/<Team>/ # this tree (hidden, never committed)
8
+ ├── TeamMap.md # this map
9
+ ├── Settings.json # provider caps
10
+ ├── Global/ # CEO-owned shared memory
11
+ │ ├── GlobalMemory.md
12
+ │ └── GlobalMemoryArchive.md (created on first eviction)
13
+ ├── Criteria.md # acceptance criteria + verification evidence
14
+ ├── Tests.md # one record per test layer and area
15
+ ├── TestPlan.md # required layers per area
16
+ ├── Ledger.jsonl # append-only, hash-chained audit trail
17
+ ├── Skills.md # team-skill registry
18
+ ├── Disputes.md # design/decision challenges
19
+ ├── Reviews.md # PRs awaiting / passed the Reviewer
20
+ ├── Roles/<Role>/ # SHARED memory + queue for every instance of a role
21
+ │ ├── Role.md
22
+ │ ├── ShortTermMemory.md
23
+ │ ├── LongTermMemory.md
24
+ │ ├── ArchivedMemory.md
25
+ │ └── TaskQueue.md
26
+ ├── Agents/<Instance>/ # private to one instance
27
+ │ ├── StartHere.md WorkLog.md Inbox.md
28
+ │ └── Artifacts/ Reports/ Scratch/
29
+ └── Runtime/ # ephemeral
30
+ ├── LedgerHead.json
31
+ ├── Locks/
32
+ ├── Worktrees/<Instance>/ # optional per-instance worktree
33
+ └── Slots/<Provider>/<Agent>.slot
34
+ ```
35
+
36
+ Project output - code, tests and the reviewed documents in `{docs}/` - lives in
37
+ the repository and is committed. The team tree above is local state and is
38
+ gitignored.
39
+
40
+ ## Team
41
+
42
+ - Team name: `<Team>`
43
+ - Project: `{project}`
44
+ - Team root: `.pi/Teamwork/Teams/<Team>/`
45
+
46
+ ## Audit trail
47
+
48
+ Every mutation appends one hash-chained record to `Ledger.jsonl`, and every record
49
+ carries provenance (actor, role, target, revision). Verify it, follow a claim, or
50
+ export an externally checkable manifest:
51
+
52
+ ```sh
53
+ python3 {skill}/scripts/teamwork.py ledger verify # recompute the chain
54
+ python3 {skill}/scripts/teamwork.py ledger show --tail 40
55
+ python3 {skill}/scripts/teamwork.py trace <T-id>
56
+ python3 {skill}/scripts/teamwork.py ledger export # -> {docs}/AuditManifest.json
57
+ ```
58
+
59
+ ## Commands
60
+
61
+ ```sh
62
+ python3 {skill}/scripts/teamwork.py map # this map + detected code/test dirs
63
+ python3 {skill}/scripts/teamwork.py agents # roles, instances, queue sizes
64
+ python3 {skill}/scripts/teamwork.py board # shared queues and next task per role
65
+ python3 {skill}/scripts/teamwork.py parallel # free slots vs ready work
66
+ python3 {skill}/scripts/teamwork.py task next <instance> # claim the next task of your role
67
+ python3 {skill}/scripts/teamwork.py load <instance> # your role's short-term memory
68
+ python3 {skill}/scripts/teamwork.py recall "<query>" --all # search long-term + global memory
69
+ ```
70
+
71
+ ## Quality gates and integration path
72
+
73
+ ```text
74
+ branch start -> commit -> SelfCheck -> Review -> done -> merged into main
75
+ (owner) (Reviewer) (Reviewer only)
76
+ ```
77
+
78
+ The owner self-reviews and self-tests, then the Reviewer verifies independently.
79
+ Every agent works on its own branch; `main` only receives Reviewer merges, and a
80
+ merged branch is deleted.
81
+
82
+ Every role owns one test layer: `goal` CEO, `requirements` Product Manager, `plan`
83
+ Project Manager, `tech` CTO, `release` Release Engineer, `data` Data Engineer,
84
+ `process` COO, `cost` CFO, `system` Architect, `ui` Designer, `docs` Technical
85
+ Writer, `unit` Developer, `integration` Tester, `acceptance` Reviewer, `security`
86
+ Security Auditor. `tests plan` shows coverage and gaps; the default per area is the
87
+ core set (`unit`, `integration`, `acceptance`).
88
+
89
+ ## Concurrency
90
+
91
+ Caps in `Settings.json` (Ollama Cloud 64, DeepSeek official API ~2500, openai/anthropic 64). Hold a
92
+ lease for model-heavy work: `slot acquire --agent <instance>`, `slot renew`,
93
+ `slot release`. At the cap, do work needing no slot or fan out on another
94
+ provider - never block.
95
+
96
+ ## Priority
97
+
98
+ 1. **Code** - working, reviewed, merged implementation.
99
+ 2. **Tests** - unit tests (Developer) and integration/E2E tests (Tester), run.
100
+ 3. **Documentation** - from verified code, never blocking 1 or 2.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: teamwork-pi
3
+ description: "pi native layer for the teamwork skill - how a pi agent spawns and steers team lanes with subagent, schedules the pulse, and replies to lane decisions. Use together with /skill:teamwork when running a team on pi."
4
+ ---
5
+
6
+ # Teamwork on pi
7
+
8
+ Owner: CEO. Related: `../teamwork/SKILL.md` (the protocol) · `../teamwork/references/Adapters.md` · `../teamwork/references/Concurrency.md`
9
+
10
+ The core skill is host-agnostic. This one maps its six host operations onto the
11
+ tools a pi session actually has. Read it once per session, then work from the core
12
+ skill.
13
+
14
+ ## Six operations
15
+
16
+ | Operation | On pi |
17
+ |---|---|
18
+ | spawn a lane | `subagent({ agent, task, async: true, cwd })` |
19
+ | fan many lanes out | `subagent({ workflow: "./packet.js", async: true })` with `runs.all([...])` inside |
20
+ | send a fact to a lane | `subagent({ action: "steer", id, message })` while it runs; `subagent_supervisor({action:"reply"})` for a child that asked |
21
+ | inspect | `subagent({ action: "status", id })`, `subagent_supervisor({action:"list"})` |
22
+ | pulse | `subagent({ action: "schedule.create", id: "teamwork-pulse", workflow: "./.pi/workflows/teamwork-pulse.js", options: { every: "5m" } })` |
23
+ | close | `subagent({ action: "stop", id })` per live lane, then the final report |
24
+
25
+ There is no `teams()` tool on pi. A lane is a bounded run: it reads its role
26
+ charter and the shared queue, takes work with `task next`, commits, self-checks,
27
+ opens a PR and returns. The queue - not the tool - is what makes the team.
28
+
29
+ ## Agent names
30
+
31
+ `software-architect` (architect), `product-manager`, `project-manager` is not a
32
+ subagent, so the plan lane runs through `delegate` with the instance name stated
33
+ in the packet; `developer`, `tester`, `reviewer`, `security-auditor`,
34
+ `release-engineer` runs through `delegate`, `designer`, plus builtins `delegate`,
35
+ `worker`, `oracle`, `scout`, `researcher`.
36
+
37
+ State the instance name in the packet (`developer-1`, `reviewer-2`) and require it
38
+ in every `--by` flag, because provenance is recorded per instance.
39
+
40
+ ## Packet shape that survives a bounded lane
41
+
42
+ At most two features, numbered steps with exact commands, a tool-call budget
43
+ (<= 16) and a hard minute budget, an explicit "stop and report the blocker"
44
+ clause, and an anchor-first reading rule (`grep -n` then read +/-30 lines). Lanes
45
+ that were given open-ended verification timed out at 30 minutes with zero commits;
46
+ the same work finished in 8 calls when the packet named the commands.
47
+
48
+ ## Pulse workflow
49
+
50
+ `.pi/workflows/teamwork-pulse.js`:
51
+
52
+ ```js
53
+ export default async function (ctx) {
54
+ return await ctx.runs.all([{
55
+ key: 'pulse',
56
+ agent: 'delegate',
57
+ task: `Teamwork pulse in ${ctx.cwd}: run
58
+ python3 ${ctx.cwd}/scripts/teamwork.py pulse --commit, then message every
59
+ assigned lane to start now, give each idle lane its highest-priority
60
+ unblocked task, unblock what is stuck, aim a DIFFERENT Reviewer lane at each
61
+ unclaimed deliverable, and report one short line. Never stop the team while
62
+ loop says CONTINUE.`,
63
+ }]);
64
+ }
65
+ ```
66
+
67
+ ## Rules that cost us real time
68
+
69
+ - A lane that cannot run `teamwork` needs `TEAMWORK_ROOT=<repo>/.pi/Teamwork/Teams/<Team>`
70
+ exported; a worktree does not carry `.pi/`.
71
+ - Worktree isolation is refused on a dirty tree; run lanes in the shared checkout
72
+ and commit with `--paths` so no lane sweeps a peer's uncommitted work.
73
+ - A review verdict names the revision it measured; a lane that reviewed a stale
74
+ head is re-dispatched with the head sha and told to assert it first.
75
+ - One task, one branch: `branch start` creates the branch from the default branch
76
+ and switches the checkout, so start it before writing and never from a lane
77
+ branch.