@nidvue/teamwork 0.0.0-stage → 1.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 (70) hide show
  1. package/CHANGELOG.md +343 -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
package/README.md CHANGED
@@ -1,3 +1,463 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/Nidvue/Teamwork/main/assets/banner.svg" alt="Teamwork banner: three connected nodes and the pitch 'One prompt in. A whole company of agents out.'" width="100%">
3
+ <img src="https://raw.githubusercontent.com/Nidvue/Teamwork/main/docs/assets/nidvue-icon.svg" alt="Nidvue" width="88" height="88">
4
+ <h1>Nidvue Teamwork</h1>
5
+ <p><strong>One prompt in. A whole company of agents out.</strong></p>
6
+ <p>An autonomous, self-organising multi-agent company for coding agents:<br>
7
+ evidence-gated, role-shared, and auditable by design.</p>
8
+ <p>
9
+ <a href="https://github.com/Nidvue/Teamwork/actions/workflows/ci.yml"><img alt="CI status" src="https://img.shields.io/github/actions/workflow/status/Nidvue/Teamwork/ci.yml?branch=main&amp;label=CI&amp;logo=github"></a>
10
+ <a href="LICENSE"><img alt="License: AGPL-3.0" src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg"></a>
11
+ <a href="docs/Team/Architecture.md"><img alt="Python 3.9 to 3.13" src="https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue"></a>
12
+ <a href="docs/guide/install.md"><img alt="Skill: one clone to install" src="https://img.shields.io/badge/skill-install%20in%20one%20clone-8957e5"></a>
13
+ <a href="CONTRIBUTING.md"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
14
+ <a href="https://github.com/Nidvue/Teamwork/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/Nidvue/Teamwork?style=social"></a>
15
+ </p>
16
+ </div>
2
17
 
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.
18
+ <p align="center">
19
+ <img src="https://raw.githubusercontent.com/Nidvue/Teamwork/main/assets/demo.svg" alt="Animated terminal: one git clone installs the skill, one request that names the skill starts the company, and the loop gate reports CONTINUE until every acceptance criterion is verified." width="820">
20
+ </p>
21
+
22
+ Nidvue Teamwork is **a skill for your coding agent** - not a standalone
23
+ application. Install it like any other skill (one clone, no package manager), then
24
+ ask your agent for the team:
25
+
26
+ ```text
27
+ > use the teamwork skill: Build a URL shortener with a CLI, tests and docs
28
+ ```
29
+
30
+ That prompt becomes a team of AI agents that plans, builds, tests and
31
+ **independently reviews its own work until every acceptance criterion has
32
+ executed evidence**. The agent host supplies the LLM API, and **every agent's model
33
+ is configured independently** (`teamwork model set <agent>`): a strong model for the
34
+ Reviewer, a cheap one for the mechanical lanes. The engine (`teamwork.py`, standard
35
+ library only) ships inside the skill and is what the CEO calls; installing it as a package is optional.
36
+
37
+ ## Why Teamwork
38
+
39
+ | # | Differentiator | What it means in practice |
40
+ |---|---|---|
41
+ | 1 | **Evidence or `UNVERIFIED`** | A task cannot reach `done` without a recorded `command @revision -> result`. Evidence is a packet - baseline, action, result, hashed artifact, replay - and a bug fix must prove the failure before the fix. `teamwork loop` refuses `STOP` while any criterion or required test layer is unverified. |
42
+ | 2 | **Role-shared memory** | Memory and the priority queue belong to the **role**, not the instance (`Roles/Developer/` is shared by `Developer-1..N`). Agents reuse verified facts instead of re-asking, and the CEO pulse feeds every idle lane. |
43
+ | 3 | **Hash-chained audit trail** | Every mutation is appended to `Ledger.jsonl` with `by` / `src` / `rev` provenance. `ledger verify` detects tampering, `trace T-0007` follows a claim end to end, and `ledger export` writes a manifest anyone can check without trusting the team. |
44
+
45
+ ## Features
46
+
47
+ | Feature | What you get |
48
+ |---|---|
49
+ | Autonomous org | 15 role charters - CEO, CTO, COO, CFO, Architect, Product Manager, Project Manager, Designer, Developer, Tester, Release Engineer, Technical Writer, Data Engineer, Reviewer, Security Auditor. |
50
+ | Two-stage quality gate | The author self-checks with a real test, then a **different** role reviews from scratch. Only the Reviewer may merge. |
51
+ | Parallel lanes | Freeze interfaces first, then developer, tester and designer lanes run concurrently against one frozen contract. |
52
+ | Layered tests | Each role designs, builds and runs its own test layer (`unit`, `integration`, `acceptance`, `ui`, `security`, ...); `tests plan` shows coverage and gaps. |
53
+ | Designed images | The Designer owns every visual asset, raster **and** vector, and decides what the deliverable needs: vector first (SVG, diagram-as-code), and for a raster `imaging probe` picks the best available text-to-image model (cloud first, else local, else SVG), then plan -> 4+ candidates -> visual review -> improve until it passes -> integrate, with privacy and licence rules. |
54
+ | Stop condition as a record | Acceptance criteria are machine records, not checkboxes. The loop stops only when they are all verified. |
55
+ | Role-shared state | One memory and one priority queue per role; a private, disposable workspace per instance. |
56
+ | Concurrency control | Provider slot leases respect per-provider caps, so N agents never overload a model endpoint. |
57
+ | Disputes and tribunal | A challenged design goes through evidence rounds; a 3-round deadlock is ruled on by the CEO + CTO + CFO and recorded. |
58
+ | Portable, dependency-free | CPython 3.9-3.13 on Linux, macOS and Windows. **Zero third-party runtime dependencies.** |
59
+ | Enforced standards | One canonical toolchain per language, run by the team: `ruff format` + `ruff check` gate CI, `mypy` runs as a non-blocking report (the engine is a tracked post-1.0 typing refactor); the full per-language table is in `references/Engineering.md`. |
60
+ | Automatic model routing | `teamwork model auto` detects the running agent host where the environment identifies it and routes the strongest available model to the decision lanes and the economy model to the mechanical lanes - best output where it compounds, lowest cost where it does not. Every lane's model is configurable independently (`model set <agent>`). |
61
+ | Clean, modular history | Work commits are rebased and squashed before review, feature work squash-merges into `main`, and the naming policy (PascalCase directories, ecosystem-correct files) is written down rather than argued about. |
62
+ | Skill first, engine optional | The product is a skill: `SKILL.md`, role charters, references, templates and the stdlib-only engine in one directory. Any agent host that loads skills or reads `AGENTS.md` runs the same protocol (optional adapter mapping: `references/Adapters.md`); the Python package is only a convenience for driving the engine from a terminal. |
63
+ | Remote-agnostic integrity | Branch protection, required checks, squash-only merges and protected `v*` tags are enforced on GitHub, GitLab, Bitbucket, Gitea/Forgejo or Azure DevOps alike. |
64
+
65
+ ## Install the skill
66
+
67
+ Teamwork is a directory with a `SKILL.md`, the role charters, the references and
68
+ the engine - no package manager, no daemon, no hosted service. Clone it where
69
+ your agent discovers skills:
70
+
71
+ | Scope | Path | Use it when |
72
+ |---|---|---|
73
+ | Project | `.agents/skills/teamwork/` | Commit it so every teammate, session and worktree gets the same protocol |
74
+ | User | `~/.agents/skills/teamwork/` | You want the team available in every project |
75
+
76
+ ```bash
77
+ # project-local: plain files in your repository, not a nested git repo
78
+ mkdir -p .agents/skills
79
+ git clone --depth 1 https://github.com/Nidvue/Teamwork.git .agents/skills/teamwork
80
+ rm -rf .agents/skills/teamwork/.git
81
+
82
+ # user-level: keep .git so `git pull` updates the skill
83
+ git clone https://github.com/Nidvue/Teamwork.git ~/.agents/skills/teamwork
84
+ ```
85
+
86
+ `rm -rf` of the nested `.git` is deliberate: without it git records the skill as a
87
+ gitlink (a submodule without `.gitmodules`) and a fresh clone of your project gets
88
+ an empty directory. The skill must be plain tracked files. Prefer a submodule?
89
+ `git submodule add https://github.com/Nidvue/Teamwork.git .agents/skills/teamwork`
90
+ works too - teammates then run `git submodule update --init`.
91
+
92
+ Any host that discovers skills from a directory reads this one. A host without a
93
+ skill loader uses the same protocol through `AGENTS.md` (`teamwork agents-md`).
94
+ Exact search paths are host policy, not part of the skill; where a host names its
95
+ own skills directory, put the clone there instead. The optional per-host adapter
96
+ mapping is in [`references/Adapters.md`](https://github.com/Nidvue/Teamwork/blob/main/references/Adapters.md).
97
+
98
+ Re-scan or reload skills in the host, then ask for the team by name:
99
+
100
+ ```text
101
+ > use the teamwork skill: <prompt>
102
+ ```
103
+
104
+ Where a host exposes skills as slash commands, the same request is
105
+ `/teamwork <prompt>`. The host runs the bundled `scripts/teamwork.py` - Python
106
+ 3.9+, standard library only, no network access, nothing to build.
107
+
108
+ ### Optional: put the engine on your PATH
109
+
110
+ The skill works without this step. Install the same engine as a package when you
111
+ want to drive the team yourself from a terminal, or when your host cannot run a
112
+ bundled script:
113
+
114
+ ```bash
115
+ # pipx - isolated CLI, put on PATH
116
+ pipx install teamwork-agents
117
+
118
+ # uv - run without installing
119
+ uvx --from teamwork-agents teamwork --version
120
+
121
+ # pip
122
+ python -m pip install teamwork-agents
123
+
124
+ # from source
125
+ git clone https://github.com/Nidvue/Teamwork.git
126
+ cd Teamwork && python -m pip install .
127
+ ```
128
+
129
+ Run it straight from a checkout without installing anything:
130
+
131
+ ```bash
132
+ python3 scripts/teamwork.py --version # teamwork 1.0.2
133
+ ```
134
+
135
+ > The distribution name is `teamwork-agents` (the name `teamwork` is taken on
136
+ > PyPI); the import name and the console script are both `teamwork`. PyPI
137
+ > publishing is prepared but not enabled for this release - until then, install
138
+ > from the [GitHub release](https://github.com/Nidvue/Teamwork/releases) wheel
139
+ > or from source.
140
+
141
+ ## 30-second quickstart
142
+
143
+ ```bash
144
+ # 1. install the skill (one clone, nothing to build; drop the nested .git so the
145
+ # skill is committed as plain files, not a submodule)
146
+ $ mkdir -p .agents/skills && git clone --depth 1 https://github.com/Nidvue/Teamwork.git .agents/skills/teamwork && rm -rf .agents/skills/teamwork/.git
147
+
148
+ # 2. in any project, ask your agent for the team
149
+ $ cd my-project
150
+ > use the teamwork skill: Build a URL shortener with a CLI, tests and docs
151
+ ```
152
+
153
+ The CEO takes it from there: it writes `AGENTS.md`, staffs the roster, freezes the
154
+ interfaces, records the acceptance criteria and opens the lanes. `init` creates
155
+ the hidden, gitignored workspace at `.pi/Teamwork/Teams/<Team>/` and leaves your
156
+ project tree untouched. Project output (`AGENTS.md`, code, tests, docs) is
157
+ committed; team state is local.
158
+
159
+ The skill calls the engine for you. When you want to see or steer the machine
160
+ yourself, the same run is three commands:
161
+
162
+ ```bash
163
+ $ teamwork agents-md # write or patch the AGENTS.md constitution
164
+ $ teamwork map # the workspace layout, roles and instances
165
+ $ teamwork criteria list # the machine records that define "done"
166
+ ```
167
+
168
+ Read the full walkthrough in [`docs/guide/quickstart.md`](https://github.com/Nidvue/Teamwork/blob/main/docs/guide/quickstart.md).
169
+
170
+ ## For agents
171
+
172
+ If you are the agent reading this repository, not the human who installed it: you
173
+ can install and drive this skill yourself. Do the steps in order, and repeat them
174
+ safely - every one is idempotent.
175
+
176
+ ### 1. Find the skill directory, then install
177
+
178
+ A skill is a directory; the only host-specific part is where that directory is
179
+ scanned from. Use your host's skills directory if it names one, otherwise the
180
+ portable conventions below work.
181
+
182
+ | Scope | Convention | When |
183
+ |---|---|---|
184
+ | Project | `.agents/skills/teamwork/` | The team protocol should travel with the repository |
185
+ | User | `~/.agents/skills/teamwork/` | The team should be available in every project |
186
+
187
+ ```bash
188
+ # already installed? any hit means yes
189
+ ls .agents/skills/teamwork/SKILL.md ~/.agents/skills/teamwork/SKILL.md 2>/dev/null
190
+
191
+ # not installed: clone once into the directory your host scans
192
+ mkdir -p .agents/skills
193
+ git clone --depth 1 https://github.com/Nidvue/Teamwork.git .agents/skills/teamwork
194
+ rm -rf .agents/skills/teamwork/.git # plain files, not a nested repo
195
+ ```
196
+
197
+ ### 2. Verify before you promise anything
198
+
199
+ ```console
200
+ $ python3 .agents/skills/teamwork/scripts/teamwork.py selftest
201
+ teamwork selftest: 5/5 checks passed
202
+ ```
203
+
204
+ Use the directory you actually cloned to; the engine is the same in all of them.
205
+
206
+ Exit `0` means the bundle and the engine are intact. Anything else: report the
207
+ failure with the command and its output, and stop. Do not improvise a replacement.
208
+
209
+ ### 3. Follow the skill, from its own directory
210
+
211
+ 1. Read `<skill>/SKILL.md` completely, then `<skill>/roles/<your-role>.md` for the
212
+ role you are acting as.
213
+ 2. Run `scripts/teamwork.py init --roster slim` (or `standard`/`full`, or
214
+ `--agents` for an exact list; the skill usually does this for you) and
215
+ `agents-md` so the constitution is in place before any work starts.
216
+ 3. Claim work with `task next <you>`; never sit idle while ready work exists.
217
+ 4. Record evidence as `command @revision -> result`; submit with `selfcheck`, then
218
+ `pr open`. A different role reviews and merges - you never merge your own work.
219
+ 5. Stop only when `loop` prints `STOP` and `audit` reports no problems.
220
+
221
+ Read [`references/Adapters.md`](https://github.com/Nidvue/Teamwork/blob/main/references/Adapters.md) for the six host
222
+ operations, [`references/Concurrency.md`](https://github.com/Nidvue/Teamwork/blob/main/references/Concurrency.md) for slot
223
+ leases and model routing, and [`docs/guide/quickstart.md`](https://github.com/Nidvue/Teamwork/blob/main/docs/guide/quickstart.md)
224
+ for the workspace layout. Do not read the whole tree first; the skill is written
225
+ to be loaded on demand.
226
+
227
+ ### 4. Rules that are not optional
228
+
229
+ - No claim about code, tests or CI without a recorded command, revision and result.
230
+ - Never fake a test run, never merge your own work, never weaken a gate.
231
+ - A red line (secrets, force-push, publishing, production calls) is refused and
232
+ recorded with `redline` - then escalated, never executed.
233
+ - The user talks to the CEO only. Every other role reports to its manager
234
+ (`teamwork.py map` draws the tree): the CTO for engineering, the COO for
235
+ planning, the Product Manager for requirements and docs. Escalate upward,
236
+ not sideways to the CEO.
237
+
238
+ ## Common ways to use it
239
+
240
+ The transcripts are trimmed from a real run of the engine in this repository
241
+ (paths elided); the prompts in A-C are illustrative.
242
+
243
+ ### A. New project from one prompt
244
+
245
+ ```console
246
+ $ cd ~/code/url-shortener
247
+ > use the teamwork skill: build a URL shortener - a CLI with shorten and expand,
248
+ SQLite storage, a pytest suite and a README. Keep it dependency-free.
249
+ ```
250
+
251
+ The CEO writes `AGENTS.md`, records `AC-1..AC-n`, freezes the interfaces and opens
252
+ the lanes. You keep working in the host; the team reports through the CEO.
253
+
254
+ ### B. A feature in an existing repository
255
+
256
+ ```console
257
+ $ cd existing-repo
258
+ $ mkdir -p .agents/skills && git clone --depth 1 https://github.com/Nidvue/Teamwork.git .agents/skills/teamwork && rm -rf .agents/skills/teamwork/.git
259
+ > use the teamwork skill: add per-key rate limiting to the public API - 100
260
+ requests/minute, 429 with Retry-After, and tests that prove the boundary.
261
+ ```
262
+
263
+ Committing `.agents/skills/teamwork` gives every teammate the same protocol on a
264
+ fresh clone.
265
+
266
+ ### C. A bug or a red CI run
267
+
268
+ ```console
269
+ $ cd repo
270
+ > use the teamwork skill: fix the failing CI job on main, prove the fix with the
271
+ exact test command, and do not touch unrelated files.
272
+ ```
273
+
274
+ The protocol degrades the same way everywhere: without a teammate tool one agent
275
+ switches hats, and the evidence gates still hold (`references/Adapters.md`).
276
+
277
+ ### D. Steer the machine yourself
278
+
279
+ The skill calls these for you; run them when you want to see or change the plan.
280
+
281
+ ```console
282
+ $ teamwork init --roster slim # or: teamwork init --agents ceo,architect,developer-1,tester-1,reviewer-1
283
+ $ teamwork criteria add --id AC-1 --text "shorten then expand returns the original URL" --owner developer --by ceo
284
+ $ teamwork criteria add --id AC-2 --text "pytest -q passes on the matrix" --owner tester --by ceo
285
+ $ teamwork task add developer "Implement shorten/expand with tests" --priority P0
286
+ $ teamwork loop
287
+
288
+ > CONTINUE
289
+ ! 2 acceptance criteria unverified
290
+ ! no layered test records
291
+ ! 1 task(s) not finished
292
+ ```
293
+
294
+ ### E. Keep the lanes full
295
+
296
+ ```console
297
+ $ teamwork pulse --interval 5
298
+ $ teamwork parallel
299
+
300
+ ## provider slots
301
+ - anthropic used=0 cap=64 free=64
302
+ - deepseek used=0 cap=2500 free=2500
303
+ - ollama-cloud used=0 cap=64 free=64
304
+ - openai used=0 cap=64 free=64
305
+ - TOTAL free slots: 2692
306
+
307
+ ## executable work
308
+ - developer 1 ready next: developer/T-0001 [P0] Implement shorten/expand with tests
309
+ ```
310
+
311
+ `pulse --commit` dispatches to idle instances. `parallel` shows how many lanes may
312
+ start without exceeding a provider cap.
313
+
314
+ ### F. Resume after a crash or a new session
315
+
316
+ All state is on disk, so a fresh agent resumes without a handover meeting.
317
+
318
+ ```console
319
+ $ teamwork load developer-1 # the role's short-term memory
320
+ $ teamwork task next developer-1
321
+ $ teamwork map # roles, instances, open work
322
+ ```
323
+
324
+ ### G. Prove the audit trail to someone who does not trust the team
325
+
326
+ ```console
327
+ $ teamwork ledger verify
328
+ # Ledger verify (.../Ledger.jsonl)
329
+ # records: 5 | head: a23748ba85cf962f
330
+ - chain intact, every digest matches
331
+
332
+ $ teamwork trace T-0001
333
+ ## task T-0001 [todo] Implement shorten/expand with tests (developer)
334
+ ## ledger events (1)
335
+ - #0005 task.add developer [P0] Implement shorten/expand with tests
336
+ ```
337
+
338
+ `ledger export` writes a manifest that a reviewer can verify without access to
339
+ the workspace.
340
+
341
+ ### H. Route the models, not just the roles
342
+
343
+ ```console
344
+ $ teamwork model auto
345
+ - architect strong deepseek-v4.1-flash
346
+ - ceo strong deepseek-v4.1-flash
347
+ - developer economy deepseek-v4.1-flash
348
+ - product-manager economy deepseek-v4.1-flash
349
+ - project-manager economy deepseek-v4.1-flash
350
+ - reviewer strong deepseek-v4.1-flash
351
+ - tester economy deepseek-v4.1-flash
352
+ # dry run: rerun with --apply to write these into Settings.json
353
+ ```
354
+
355
+ Decision lanes get the strongest model the host exposes; mechanical lanes get the
356
+ economy one. `model set <agent>` overrides a single lane.
357
+
358
+ ## How it works
359
+
360
+ ```mermaid
361
+ flowchart TD
362
+ U[User prompt] --> CEO[CEO: intake, acceptance criteria, roster]
363
+ CEO --> RM[Product Manager: research and gaps]
364
+ CEO --> AR[Architect: frozen interfaces and ADRs]
365
+ CEO --> PJ[Project Manager: dependency-ordered tasks]
366
+ AR --> LANES
367
+ PJ --> LANES
368
+ CEO -.->|model auto: strong lanes, economy lanes| LANES
369
+ subgraph LANES[Parallel lanes]
370
+ DEV[Developer: code + unit tests]
371
+ TST[Tester: integration + E2E tests]
372
+ DES[Designer: UX and accessibility specs]
373
+ end
374
+ LANES --> SC[Author self-check: run your own test]
375
+ SC --> RV{Independent Reviewer}
376
+ RV -- fail + findings --> LANES
377
+ RV -- pass --> MG[Reviewer merges to main]
378
+ MG --> LP{teamwork loop}
379
+ LP -- criterion or layer failing --> LANES
380
+ LP -- every criterion verified --> STOP[STOP + final report]
381
+ ```
382
+
383
+ Nothing is dispatched before the interfaces are frozen, and nothing reaches
384
+ `main` without the Reviewer's own evidence. Everything else runs in parallel.
385
+
386
+ ## Teamwork vs alternatives
387
+
388
+ | Project | Orchestration model | Evidence gate | Audit trail | Coding-agent skill | Zero runtime deps | License |
389
+ |---|---|---|---|---|---|---|
390
+ | **Nidvue Teamwork** | Persistent role org: shared role memory, priority queues, parallel lanes, CEO pulse | **Enforced** - `loop` blocks `STOP` until every criterion and required test layer has evidence | **Hash-chained** `Ledger.jsonl`, `ledger verify`, `trace`, `ledger export` | **Yes** - ships `SKILL.md`, `roles/`, `references/`, `templates/` | **Yes** - standard library only | AGPL-3.0 |
391
+ | CrewAI | Role-based crews, sequential or hierarchical process | No | Task output and logs, not tamper-evident | No - Python library | No | MIT |
392
+ | AutoGen | Event-driven multi-agent conversations | No | Conversation logs, not tamper-evident | No - Python library | No | CC-BY-4.0 (archived) |
393
+ | MetaGPT | SOP-driven "software company" pipeline | No | Artifact files, not tamper-evident | No - Python library | No | MIT |
394
+ | LangGraph | Stateful graph / state machine over LLM agents | No | Checkpointing, not hash-chained | No - Python library | No | MIT |
395
+ | Aider | Single AI pair programmer in the terminal, git-aware | No | Git commits | No - terminal CLI | No | Apache-2.0 |
396
+
397
+ Competitor facts were checked against each upstream repository and its GitHub
398
+ licence metadata on 2026-10-17:
399
+
400
+ - [crewAIInc/crewAI](https://github.com/crewAIInc/crewAI) - accessed 2026-10-17
401
+ - [microsoft/autogen (archived)](https://github.com/microsoft/autogen) - accessed 2026-10-17
402
+ - [FoundationAgents/MetaGPT](https://github.com/FoundationAgents/MetaGPT) - accessed 2026-10-17
403
+ - [langchain-ai/langgraph](https://github.com/langchain-ai/langgraph) - accessed 2026-10-17
404
+ - [Aider-AI/aider](https://github.com/Aider-AI/aider) - accessed 2026-10-17
405
+
406
+ ## Architecture at a glance
407
+
408
+ One skill, one engine, one workspace format - the package is a thin face on the
409
+ same files:
410
+
411
+ ```text
412
+ Teamwork/
413
+ ├── SKILL.md # canonical skill entry (the host loads this)
414
+ ├── roles/ references/ templates/
415
+ ├── src/teamwork/ # engine, cli, resources, portable
416
+ ├── scripts/teamwork.py # compatibility shim, stdlib only
417
+ ├── tests/{unit,integration,acceptance}/
418
+ ├── docs/ # mkdocs site + docs/Team/ project documents
419
+ ├── assets/ # SVG banner, logo, terminal demo
420
+ └── .github/workflows/ # ci.yml, release.yml, docs.yml
421
+ ```
422
+
423
+ The engine resolves its bundle from `$TEAMWORK_SKILL_DIR`, then the installed
424
+ `teamwork/data/`, then the checkout - so it works identically from a git clone
425
+ and from a wheel. The frozen contracts live in
426
+ [`docs/Team/Architecture.md`](https://github.com/Nidvue/Teamwork/blob/main/docs/Team/Architecture.md); the design brief for
427
+ this README and its visuals lives in [`docs/Team/Design.md`](https://github.com/Nidvue/Teamwork/blob/main/docs/Team/Design.md).
428
+
429
+ ## Roadmap
430
+
431
+ | Version | Status | Focus |
432
+ |---|---|---|
433
+ | `v1.0.0` | released | Package, skill bundle, CLI, 15 role charters, layered tests, CI/release workflows, docs site. |
434
+ | `v1.x` | current | Release wheel, checksums and SBOMs are shipped; the remaining step is PyPI trusted publishing. |
435
+ | next | exploring | More provider adapters, end-to-end worked examples, an opt-in ledger dashboard. |
436
+
437
+ Direction, not a promise: no hosted service, and stars cannot be bought - this
438
+ project optimises the conversion inputs (demo, README, topics, license, releases).
439
+
440
+ ## Contributing, security and license
441
+
442
+ - **Contributing** - work on your own branch, run `pytest -q` and `ruff check`,
443
+ and open a PR; a Reviewer - never the author - merges it. Read
444
+ [`CONTRIBUTING.md`](https://github.com/Nidvue/Teamwork/blob/main/CONTRIBUTING.md) and the
445
+ [code of conduct](https://github.com/Nidvue/Teamwork/blob/main/CODE_OF_CONDUCT.md).
446
+ - **Security** - please report vulnerabilities privately via
447
+ [GitHub security advisories](https://github.com/Nidvue/Teamwork/security/advisories/new);
448
+ see [`SECURITY.md`](https://github.com/Nidvue/Teamwork/blob/main/SECURITY.md).
449
+ - **License** - [AGPL-3.0](https://github.com/Nidvue/Teamwork/blob/main/LICENSE), copyright (C) 2026 **Nidvue** (see [NOTICE](https://github.com/Nidvue/Teamwork/blob/main/NOTICE)). The strong copyleft is deliberate: this is a
450
+ governance tool, and its audit guarantees should survive modification.
451
+ - **No personal data, no local leakage** - a hard project rule: no personal
452
+ names, emails, domains, absolute home paths or credentials in the tree or the
453
+ history, and no agent-host configuration or local working state (`.pi/` auth,
454
+ settings and sessions, virtualenvs, build output, caches). `scripts/privacy_scan.py`
455
+ fails the build on any of them.
456
+ Identity defaults to `agents.nidvue.com` and is overridable with
457
+ `TEAMWORK_IDENTITY_DOMAIN`.
458
+
459
+ ## Star history
460
+
461
+ <a href="https://star-history.com/#Nidvue/Teamwork&amp;Date">
462
+ <img src="https://api.star-history.com/svg?repos=Nidvue/Teamwork&amp;type=Date" alt="Star history chart for Teamwork" width="720">
463
+ </a>
package/SECURITY.md ADDED
@@ -0,0 +1,64 @@
1
+ # Security Policy
2
+
3
+ Owner: Technical Writer.
4
+
5
+ Related: [Contributing](CONTRIBUTING.md) · [Code of conduct](CODE_OF_CONDUCT.md)
6
+
7
+ ## Supported versions
8
+
9
+ | Version | Supported |
10
+ |---|---|
11
+ | 1.0.x | Yes |
12
+ | < 1.0 | No |
13
+
14
+ Security fixes are released for the latest minor line.
15
+
16
+ ## Reporting a vulnerability
17
+
18
+ Use [GitHub Security Advisories](https://github.com/Nidvue/Teamwork/security/advisories/new)
19
+ to report a vulnerability privately. This is the **only** supported channel: no
20
+ personal email address is published, and reports sent by other means cannot be
21
+ guaranteed to reach the maintainers.
22
+
23
+ Please include:
24
+
25
+ - the affected version and platform;
26
+ - a description of the issue and its impact;
27
+ - reproduction steps or a proof of concept;
28
+ - any suggested fix or mitigation.
29
+
30
+ Do not open a public issue, and do not disclose the issue publicly before a fix
31
+ is released.
32
+
33
+ ## Our process
34
+
35
+ 1. We acknowledge the report through the advisory thread as soon as possible.
36
+ 2. We confirm the issue and assess severity.
37
+ 3. We prepare and test a fix on a private branch.
38
+ 4. We release the fix and publish the advisory, crediting the reporter unless
39
+ they ask to remain anonymous.
40
+
41
+ ## Scope
42
+
43
+ In scope: the `teamwork` package, the `teamwork` CLI, the bundled skill bundle,
44
+ and the documented workspace format.
45
+
46
+ Out of scope: vulnerabilities in third-party tools or services you run alongside
47
+ Teamwork; social engineering; and reports that require access to a private
48
+ machine.
49
+
50
+ ## Privacy allowlist
51
+
52
+ `scripts/privacy_scan.py` runs with `--allow .github/privacy-allow.txt` in
53
+ `make privacy` and in CI. The file holds one regular expression per line plus a
54
+ reason; it exists so a false positive cannot force a history rewrite. It carries
55
+ exactly one entry today (`^\.pi/agent/npm$`, a package path quoted by T-0001; the tree still carries the scanner's own
56
+ fixture for it, and three history blobs match, so the gate needs the entry). A second entry needs a recorded decision and, if it
57
+ masks a credential rule, the Security Auditor's review - growing the list is
58
+ weakening the gate.
59
+
60
+ ## Safe harbour
61
+
62
+ Good-faith security research is welcome. We will not pursue action against
63
+ researchers who follow this policy, avoid privacy violations and data
64
+ destruction, and do not exploit an issue beyond what is needed to demonstrate it.
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@nidvue/teamwork",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.1",
4
+ "description": "Nidvue Teamwork - an autonomous, self-governing agent company for pi: CEO-led decomposition, parallel lanes, two-stage review, hash-chained audit ledger and layered role-owned tests. Python 3.9+, stdlib only.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi",
8
+ "pi-coding-agent",
9
+ "nidvue",
10
+ "teamwork",
11
+ "multi-agent",
12
+ "orchestration",
13
+ "agents",
14
+ "skill"
15
+ ],
16
+ "license": "AGPL-3.0-or-later",
17
+ "author": {
18
+ "name": "Nidvue contributors"
19
+ },
20
+ "homepage": "https://github.com/Nidvue/Teamwork",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/Nidvue/Teamwork.git"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/Nidvue/Teamwork/issues"
27
+ },
28
+ "files": [
29
+ "skills",
30
+ "prompts",
31
+ "README.md",
32
+ "LICENSE",
33
+ "NOTICE",
34
+ "CHANGELOG.md",
35
+ "SECURITY.md"
36
+ ],
37
+ "pi": {
38
+ "skills": [
39
+ "./skills"
40
+ ],
41
+ "prompts": [
42
+ "./prompts"
43
+ ],
44
+ "image": "https://raw.githubusercontent.com/Nidvue/Teamwork/main/assets/social-preview.png"
45
+ },
46
+ "peerDependencies": {
47
+ "@earendil-works/pi-ai": "*",
48
+ "@earendil-works/pi-agent-core": "*",
49
+ "@earendil-works/pi-coding-agent": "*",
50
+ "@earendil-works/pi-tui": "*",
51
+ "typebox": "*"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "@earendil-works/pi-ai": {
55
+ "optional": true
56
+ },
57
+ "@earendil-works/pi-agent-core": {
58
+ "optional": true
59
+ },
60
+ "@earendil-works/pi-coding-agent": {
61
+ "optional": true
62
+ },
63
+ "@earendil-works/pi-tui": {
64
+ "optional": true
65
+ },
66
+ "typebox": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "engines": {
71
+ "node": ">=20"
72
+ }
73
+ }
@@ -0,0 +1,12 @@
1
+ Run one teamwork pulse in this project.
2
+
3
+ 1. `python3 scripts/teamwork.py pulse --commit` and read the dispatch plan.
4
+ 2. For every assignment it reports, message that lane to start now.
5
+ 3. For every idle lane with no matching work, give it the highest-priority
6
+ unblocked task of its role, or fold the lane.
7
+ 4. Unblock anything stuck (blocked task, open dispute, stale claim).
8
+ 5. For every unclaimed deliverable in `teamwork.py review --queue`, aim a
9
+ different Reviewer lane at it and never stack the backlog on one lane.
10
+ 6. Report one short line: what moved, what is blocked, what is next.
11
+
12
+ Never stop the team while `teamwork.py loop` says CONTINUE.
@@ -0,0 +1,16 @@
1
+ Review one teamwork deliverable as an independent Reviewer.
2
+
3
+ Claim it with `python3 scripts/teamwork.py review <role> <T-id> --claim --by <lane>`,
4
+ then in at most 12 tool calls, without editing anything:
5
+
6
+ 1. Assert the revision: `git rev-parse --short <branch>` must equal the head you
7
+ were given; record it.
8
+ 2. Measure the gates yourself; never trust the author's numbers: tests, lint,
9
+ types, links, ledger, and the privacy gate exactly as the shipped target runs
10
+ it, with and without its allowlist.
11
+ 3. Read only the diff, with `grep -n` then a +/-30 line window.
12
+ 4. A claim that does not reproduce at that head is a finding with `file:line` and
13
+ the command that shows it.
14
+ 5. Record one verdict: `--result pass --evidence '<commands @sha -> results>'` or
15
+ `--result fail --findings '<defect + file:line + command>'`. A different
16
+ Reviewer merges; you never merge your own pass.