agentainer 0.1.6 → 2.0.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 (44) hide show
  1. package/README.md +248 -677
  2. package/agentainer +16 -18
  3. package/agentainer.example.yaml +86 -0
  4. package/bin/agentainer.js +9 -8
  5. package/examples/brainstorm.yaml +27 -128
  6. package/examples/bug-hunt.yaml +51 -96
  7. package/examples/code-review.yaml +73 -0
  8. package/examples/debate.yaml +16 -90
  9. package/examples/incident-response.yaml +52 -109
  10. package/examples/localization.yaml +56 -123
  11. package/examples/quickstart.yaml +48 -0
  12. package/examples/research.yaml +25 -0
  13. package/examples/software-company.yaml +71 -128
  14. package/examples/tdd-pingpong.yaml +36 -68
  15. package/examples/writers-room.yaml +49 -111
  16. package/hooks/claude_stop.sh +5 -3
  17. package/hooks/codex_notify.sh +4 -3
  18. package/lib/cli.py +929 -0
  19. package/lib/config.py +247 -305
  20. package/lib/hooks.py +246 -0
  21. package/lib/lock.py +75 -0
  22. package/lib/log.py +64 -0
  23. package/lib/mail.py +634 -0
  24. package/lib/minyaml.py +1 -39
  25. package/lib/reconcile.py +473 -0
  26. package/lib/sessions.py +223 -0
  27. package/lib/supervisor.py +216 -0
  28. package/lib/telegram.py +372 -0
  29. package/lib/tmux.py +355 -0
  30. package/lib/turn.py +159 -0
  31. package/lib/ui.py +1020 -0
  32. package/llms.txt +145 -429
  33. package/package.json +9 -7
  34. package/scripts/check-deps.js +18 -61
  35. package/ui/app.js +869 -0
  36. package/ui/index.html +348 -0
  37. package/agents.example.yaml +0 -257
  38. package/examples/code-review-broadcast.yaml +0 -109
  39. package/examples/existing-repo.yaml +0 -74
  40. package/examples/multi-language-broadcast.yaml +0 -127
  41. package/examples/ping-pong.yaml +0 -89
  42. package/examples/red-team.yaml +0 -117
  43. package/examples/research-swarm.yaml +0 -129
  44. package/lib/swarm.py +0 -2461
@@ -1,167 +1,110 @@
1
1
  # =============================================================================
2
- # Software company -- a product team with a CTO, an architect, two developers,
3
- # a QA reviewer and a technical writer.
2
+ # 🏢 Software company -- a product team with a CTO hub, an architect, two
3
+ # developers, a QA reviewer and a technical writer.
4
4
  #
5
- # agentainer up -c examples/software-company.yaml
6
- # agentainer send --to cto "Build a URL shortener with an API and a web UI."
5
+ # cp examples/software-company.yaml my-team.yaml
6
+ # agentainer up -c my-team.yaml
7
+ # agentainer send -c my-team.yaml --to cto "Build a URL shortener with an API + web UI."
8
+ # agentainer down -c my-team.yaml
7
9
  #
8
- # The communication graph is deliberately not a free-for-all: developers talk to
9
- # their architect and to QA, but not to each other, so design decisions go
10
- # through one place instead of being negotiated twice.
11
- #
12
- # cto <--> everyone (the hub: architect, backend, frontend, qa, docs)
13
- #
14
- # On the dev side the four form a diamond -- every link two-way:
10
+ # The communication graph is NOT a free-for-all: developers talk to their
11
+ # architect and to QA, but not to each other, so design decisions go through
12
+ # one place instead of being negotiated twice.
15
13
  #
14
+ # cto <--> everyone (the hub: architect, backend, frontend, qa, docs)
16
15
  # architect
17
16
  # / \
18
17
  # backend frontend
19
18
  # \ /
20
19
  # qa
20
+ # ...but backend/frontend never talk to each other, and docs talks only to cto.
21
21
  #
22
- # ...but backend and frontend never talk to each other, and docs talks only
23
- # to the cto.
22
+ # Key-free: every `command` is a bash loop, so the swarm comes up and routes
23
+ # mail with NO API keys. Swap each `command` for a real CLI to run real agents.
24
24
  # =============================================================================
25
25
 
26
26
  swarm:
27
27
  name: acme
28
- root: ./acme
29
- session_prefix: "acme-"
30
-
31
- # Six agents on one machine talk a lot. Keep the auto-forward guard tight.
32
- max_forward_hops: 2
28
+ root: ./acme-workspace
33
29
 
34
30
  defaults:
35
- type: claude
36
- append_agents_that_you_can_talk_to_prompt: true
31
+ capture: none # mock agents don't fire a turn-completion hook
32
+ can_talk_to: [] # tightened per agent below
37
33
 
38
34
  agents:
39
-
40
35
  - name: cto
41
36
  type: claude
42
- command: "claude --dangerously-skip-permissions --model opus"
43
- can_talk_to: ["architect", "backend", "frontend", "qa", "docs"]
44
- in_first_prompt_append_your_task_will_be_sent_in_the_next_prompt: true
45
-
46
- first_prompt: |
47
- You are the CTO of a small product team.
48
-
49
- You translate what the customer asked for into what the team builds. You
50
- do not write code. You decide scope, sequence the work, and are the only
51
- person who may change the definition of done.
52
-
53
- Your team:
54
- - architect: system design, interfaces, data model
55
- - backend: services, storage, API implementation
56
- - frontend: UI and client-side code
57
- - qa: reviews diffs, hunts for real bugs
58
- - docs: keeps README and CHANGELOG honest
59
-
60
- Run it like this:
61
- 1. Restate the goal as a one-paragraph spec and a short list of
62
- acceptance criteria. Send both to the architect first.
63
- 2. Once the architect has settled the interfaces, brief backend and
64
- frontend separately. Each should know exactly what contract to build
65
- against, so they never need to negotiate with each other directly.
66
- 3. Require QA sign-off before you call anything done.
67
- 4. Cut scope rather than slip quality. Say out loud what you cut.
37
+ can_talk_to: [architect, backend, frontend, qa, docs]
38
+ command: "claude --dangerously-skip-permissions"
39
+ role: |
40
+ You are the CTO of a small product team. You translate what the customer
41
+ asked for into what the team builds. You do not write code; you decide
42
+ scope, sequence the work, and are the only person who may change the
43
+ definition of done.
44
+ Your team: architect (design), backend (services/API), frontend (UI),
45
+ qa (reviews diffs), docs (keeps README/CHANGELOG honest).
46
+ Run it like this: (1) restate the goal as a one-paragraph spec + a short
47
+ acceptance list, send both to the architect first; (2) once the architect
48
+ settles the interfaces, brief backend and frontend separately; (3) require
49
+ QA sign-off before anything is done; (4) cut scope rather than slip
50
+ quality.
51
+ MAILBOX: when a message lands in your inbox/, read it and act; when done,
52
+ move it to read/. To send, write a file into outbox/<name>/ (read
53
+ outbox/<name>/about.md first) and finish your turn. You may message the
54
+ agents in your can_talk_to.
68
55
 
69
56
  - name: architect
70
57
  type: claude
58
+ can_talk_to: [cto, backend, frontend]
71
59
  command: "claude --dangerously-skip-permissions"
72
- can_talk_to: ["cto", "backend", "frontend"]
73
-
74
- first_prompt: |
75
- You are the ARCHITECT.
76
-
77
- Given a spec, you produce the smallest design that satisfies it: the
78
- module boundaries, the data model, and the exact interfaces the backend
79
- and frontend will build against. Write them down in DESIGN.md.
80
-
81
- Be concrete. "A service layer" is not a design; a function signature is.
82
- Specify the API contract precisely enough that two people who never speak
83
- to each other can implement both sides of it.
84
-
85
- Prefer boring technology. Justify every dependency you add. When the CTO's
86
- spec is ambiguous, ask -- do not invent requirements.
60
+ role: |
61
+ You are the ARCHITECT. Given a spec, produce the smallest design that
62
+ satisfies it: module boundaries, data model, and the exact interfaces
63
+ backend and frontend build against. Write them in DESIGN.md. Be concrete --
64
+ "a service layer" is not a design; a function signature is. If the CTO's
65
+ spec is ambiguous, ask; do not invent requirements.
87
66
 
88
67
  - name: backend
89
68
  type: codex
69
+ can_talk_to: [architect, qa, cto]
90
70
  command: "codex --yolo"
91
- can_talk_to: ["architect", "qa", "cto"]
92
- env:
93
- GIT_AUTHOR_NAME: "acme-backend"
94
-
95
- first_prompt: |
96
- You are the BACKEND DEVELOPER.
97
-
98
- You implement the services, storage and API described in the architect's
99
- DESIGN.md, in your own working directory. Real, runnable code with tests.
100
-
101
- Working agreement:
102
- - Build exactly the contract the architect specified. If it is wrong,
103
- argue with the architect -- do not quietly change it.
104
- - Tests must actually exercise behaviour, not assert that mocks were
105
- called.
106
- - When a unit of work is done, send qa a short summary: what changed,
107
- why, and what you are unsure about. Ask for review.
108
- - If you are blocked for a reason the CTO should know about, say so.
71
+ role: |
72
+ You are the BACKEND DEVELOPER. Implement the services, storage and API
73
+ described in the architect's DESIGN.md, in your own working directory.
74
+ Build exactly the contract specified; if it is wrong, argue with the
75
+ architect, do not quietly change it. When a unit of work is done, write a
76
+ short summary to outbox/qa/ (what changed, why, what you are unsure
77
+ about) and ask for review.
109
78
 
110
79
  - name: frontend
111
80
  type: codex
81
+ can_talk_to: [architect, qa, cto]
112
82
  command: "codex --yolo"
113
- can_talk_to: ["architect", "qa", "cto"]
114
- env:
115
- GIT_AUTHOR_NAME: "acme-frontend"
116
-
117
- first_prompt: |
118
- You are the FRONTEND DEVELOPER.
119
-
120
- You build the UI against the API contract in the architect's DESIGN.md,
121
- in your own working directory. You never call an endpoint that is not in
122
- the contract; if you need one, ask the architect for it.
123
-
124
- Working agreement:
125
- - Handle the loading, empty and error states. Not just the happy path.
126
- - Keep the UI usable by keyboard, and readable at 200% zoom.
127
- - When a unit of work is done, send qa a summary and ask for review.
83
+ role: |
84
+ You are the FRONTEND DEVELOPER. Build the UI against the API contract in
85
+ the architect's DESIGN.md. You never call an endpoint not in the contract;
86
+ if you need one, ask the architect. Handle loading, empty and error
87
+ states. When a unit of work is done, write a summary to outbox/qa/ and ask
88
+ for review.
128
89
 
129
90
  - name: qa
130
91
  type: claude
92
+ can_talk_to: [backend, frontend, cto]
131
93
  command: "claude --dangerously-skip-permissions"
132
- can_talk_to: ["backend", "frontend", "cto"]
133
-
134
- first_prompt: |
135
- You are QA.
136
-
137
- You review the developers' work and hunt for defects that would actually
94
+ role: |
95
+ You are QA. Review the developers' work and hunt for defects that would
138
96
  bite a user: wrong logic, unhandled errors, race conditions, data loss,
139
- auth holes, broken edge cases.
140
-
141
- How to review:
142
- - Read the code, then try to break it. Prefer a failing reproduction
143
- over an opinion.
144
- - Cite file:line. Explain the input that triggers the bug and the
145
- wrong output it produces.
146
- - If the code is fine, say so in one line. Do not invent nitpicks to
147
- look thorough.
148
- - Report your verdict to the developer who wrote it. Escalate to the
149
- cto only when something threatens the acceptance criteria.
97
+ auth holes. Read the code, then try to break it; prefer a failing
98
+ reproduction over an opinion. Cite file:line. Report your verdict to the
99
+ developer who wrote it; escalate to the cto only when something threatens
100
+ the acceptance criteria.
150
101
 
151
102
  - name: docs
152
- type: hermes
153
- command: "hermes"
154
- can_talk_to: ["cto"]
155
- capture: none
156
-
157
- first_prompt: |
158
- You are the TECHNICAL WRITER.
159
-
160
- You keep README.md and CHANGELOG.md true. Document what the software
161
- actually does today, not what it is supposed to do eventually.
162
-
163
- Every entry answers: what changed, and what should a user do differently
164
- because of it. No marketing language. When you need to know why something
165
- changed, ask the cto from your shell (your replies are not auto-captured,
166
- so a tagged block would not be delivered):
167
- swarm send --to cto "..."
103
+ type: claude
104
+ can_talk_to: [cto]
105
+ command: "claude --dangerously-skip-permissions"
106
+ role: |
107
+ You are the TECHNICAL WRITER. Keep README.md and CHANGELOG.md true.
108
+ Document what the software actually does today. Every entry answers: what
109
+ changed, and what should a user do differently because of it. If you need
110
+ to know why something changed, ask the cto by writing to outbox/cto/.
@@ -1,82 +1,50 @@
1
1
  # =============================================================================
2
- # TDD ping-pong -- two agents grow a feature test-first, one test at a time.
2
+ # 🔴🟢 TDD ping-pong -- the classic red/green pair, but the two roles live in
3
+ # separate agents that pass a test file back and forth via the mail model.
3
4
  #
4
- # 1. Point `workdir` below at the repo you want to build in.
5
- # 2. agentainer validate -c examples/tdd-pingpong.yaml
6
- # 3. agentainer up -c examples/tdd-pingpong.yaml
7
- # 4. agentainer send --to tester "Build a rate limiter: N requests per window."
5
+ # cp examples/tdd-pingpong.yaml my-tdd.yaml
6
+ # agentainer up -c my-tdd.yaml
7
+ # agentainer send -c my-tdd.yaml --to red "Write a failing test for add(a,b)."
8
+ # agentainer down -c my-tdd.yaml
8
9
  #
9
- # Shape: a tight two-agent loop with a strict protocol. The TESTER writes ONE
10
- # failing test; the CODER writes the least code to pass it and hands back; the
11
- # tester writes the next test. Nobody auto-forwards -- each handoff is a
12
- # deliberate `<swarm-send>`, which keeps the red/green rhythm explicit.
10
+ # Shape: RED <--> GREEN, two-way and that's it. RED writes a failing test
11
+ # and hands it to GREEN; GREEN makes it pass and hands it back. Neither
12
+ # talks to anyone else. The human (user) can drop a new requirement in.
13
13
  #
14
- # tester <--> coder
14
+ # red <----> green
15
15
  #
16
- # They share ONE checkout on purpose (that is the whole game), so `validate`
17
- # will warn about the shared workdir -- expected here. The protocol, not a
18
- # folder boundary, keeps them from colliding: only one holds the ball at a time.
16
+ # Key-free: commands are bash loops. Swap for real CLIs to actually drive a
17
+ # test runner.
19
18
  # =============================================================================
20
19
 
21
20
  swarm:
22
- name: tddpp
23
- root: ./tdd-runtime # only holds logs, inboxes and swarm state
24
- session_prefix: "tdd-"
25
- create_workdirs: false
21
+ name: tdd-pingpong
22
+ root: ./tdd-workspace
26
23
 
27
24
  defaults:
28
- # Both agents build in the same tree. >>> EDIT ME <<<
29
- workdir: ~/projects/scratch-lib
25
+ capture: none
26
+ can_talk_to: []
30
27
 
31
28
  agents:
32
-
33
- - name: tester
29
+ - name: red
34
30
  type: claude
31
+ can_talk_to: [green, user]
35
32
  command: "claude --dangerously-skip-permissions"
36
- can_talk_to: ["coder"]
37
-
38
- # The human hands the feature to the tester, who starts the loop.
39
- in_first_prompt_append_your_task_will_be_sent_in_the_next_prompt: true
40
-
41
- first_prompt: |
42
- You are the TESTER in a TDD ping-pong. You own the RED step.
43
-
44
- The protocol, one turn at a time:
45
- 1. Write exactly ONE new failing test that pushes the feature one small
46
- step forward -- the simplest behaviour not yet implemented.
47
- 2. Run it. Confirm it fails, and fails for the right reason (not a typo,
48
- import error, or missing file).
49
- 3. Hand off to the coder: the test's name, what behaviour it pins down,
50
- and the failure output you saw. Then stop and wait.
51
-
52
- Rules:
53
- - One test per turn. Never write two steps ahead.
54
- - Test behaviour through the public interface, not private internals.
55
- - Do NOT write production code -- that is the coder's job. If the design
56
- the coder chose makes the next test awkward, say so and let them
57
- refactor on their green turn.
58
- - When the feature is fully covered and you have no next test, say the
59
- feature is DONE instead of inventing busywork.
60
-
61
- - name: coder
62
- type: codex
63
- command: "codex --yolo"
64
- can_talk_to: ["tester"]
65
-
66
- first_prompt: |
67
- You are the CODER in a TDD ping-pong. You own the GREEN and REFACTOR steps.
68
-
69
- When the tester hands you a failing test:
70
- 1. Write the LEAST code that makes it pass -- honestly the least, even if
71
- it looks too simple. Do not implement behaviour no test demands yet.
72
- 2. Run the whole suite. Everything must be green, not just the new test.
73
- 3. Refactor only now, with tests green: remove duplication, improve names.
74
- Re-run the suite after refactoring.
75
- 4. Hand back to the tester: what you did, the passing suite output, and
76
- anything about the design they should know before the next test.
77
-
78
- Rules:
79
- - Do not add tests, and do not edit the tester's tests to make them pass.
80
- If a test seems wrong, argue for it -- do not quietly change it.
81
- - Resist gold-plating. YAGNI: the tests define the spec.
82
- - If a test cannot be made to pass as written, explain why and hand back.
33
+ role: |
34
+ You are RED. You write a failing test that pins the behaviour the human
35
+ asked for, then hand it to GREEN (write a file into outbox/green/ with
36
+ the test and a one-line note on what it should prove). Do not implement the
37
+ code -- only the test. When GREEN hands a now-passing test back, write the
38
+ next failing test. If the human (user) writes to you, pick up their
39
+ requirement.
40
+
41
+ - name: green
42
+ type: claude
43
+ can_talk_to: [red, user]
44
+ command: "claude --dangerously-skip-permissions"
45
+ role: |
46
+ You are GREEN. You receive a failing test from RED (mail in your inbox/),
47
+ implement the smallest code that makes it pass, then hand it back (write a
48
+ file into outbox/red/ with the passing code and a note). Do not add
49
+ behaviour the test does not require. When RED sends the next failing test,
50
+ repeat. If the human (user) writes to you, answer them.
@@ -1,129 +1,67 @@
1
1
  # =============================================================================
2
- # Writers' room -- take a rough idea to a finished, fact-checked article.
2
+ # ✍️ Writers' room -- a single editor coordinates a small stable of writers who
3
+ # draft sections of a document and hand them back for assembly.
3
4
  #
4
- # agentainer up -c examples/writers-room.yaml
5
- # agentainer send --to editor "Explain how TLS 1.3 speeds up the handshake."
5
+ # cp examples/writers-room.yaml my-doc.yaml
6
+ # agentainer up -c my-doc.yaml
7
+ # agentainer send -c my-doc.yaml --to editor "Draft a launch post for v2."
8
+ # agentainer down -c my-doc.yaml
6
9
  #
7
- # Shape: hub with a review cycle. The editor commissions and owns the piece; the
8
- # writer drafts it; the fact-checker verifies every claim and the critic tears
9
- # into the prose. Writer, checker and critic all report to the editor, who
10
- # decides what to revise -- so the draft goes through one owner, not a committee.
10
+ # Shape: many-to-one. The editor is the only hub; writers never talk to each
11
+ # other (no cross-contamination of voice). Each writer drafts one slice and
12
+ # returns it to the editor, who assembles.
11
13
  #
12
- # writer
13
- # |
14
- # factchecker --- editor --- critic
14
+ # writer-1 \ / editor
15
+ # writer-2 > (all talk only to the editor) <
16
+ # writer-3 /
15
17
  #
16
- # Every link is two-way, but writer, factchecker and critic each report
17
- # only to the editor -- never to each other.
18
- #
19
- # The article lands in a predictable place (`./writers-room-output/DRAFT.md`),
20
- # not in a scratch folder, via a custom `workdir` on the writer.
18
+ # Real agents: commands launch the actual CLIs (claude / codex / gemini / hermes). For a key-free demo, swap each `command` for a mock bash loop.
21
19
  # =============================================================================
22
20
 
23
21
  swarm:
24
- name: writersroom
25
- root: ./writers-room
26
- session_prefix: "wr-"
27
-
28
- # Editor -> writer -> editor -> checker/critic. Keep the auto-forward guard low;
29
- # here nobody auto-forwards anyway, so this is just belt-and-braces.
30
- max_forward_hops: 2
22
+ name: writers-room
23
+ root: ./writers-room-workspace
31
24
 
32
25
  defaults:
33
- type: claude
26
+ capture: none
27
+ can_talk_to: []
34
28
 
35
29
  agents:
36
-
37
30
  - name: editor
38
31
  type: claude
39
- command: "claude --dangerously-skip-permissions --model opus"
40
- can_talk_to: ["writer", "factchecker", "critic"]
41
-
42
- # Waits for the human to hand over the topic and the audience.
43
- in_first_prompt_append_your_task_will_be_sent_in_the_next_prompt: true
44
-
45
- first_prompt: |
46
- You are the EDITOR. You own the piece from brief to publish.
47
-
48
- You do not write the prose yourself. You commission it, hold the standard,
49
- and decide when it is done.
50
-
51
- Your room:
52
- - writer: drafts and revises the article
53
- - factchecker: verifies every factual claim against a source
54
- - critic: attacks the prose: clarity, structure, honesty
55
-
56
- How to run it:
57
- 1. Turn the human's request into a one-paragraph brief: the single idea,
58
- the reader, the length, and what the piece must NOT become.
59
- 2. Send the brief to the writer. When a draft comes back, send it to BOTH
60
- the factchecker and the critic.
61
- 3. Merge their notes into one revision list, ordered by what matters, and
62
- send it back to the writer. Drop nitpicks that do not serve the reader.
63
- 4. Repeat until a checked, clear draft exists. Then deliver the final
64
- piece to the human and say where it is.
65
-
66
- Protect the reader's time above the writer's feelings. Cut anything that
67
- does not earn its place.
68
-
69
- - name: writer
32
+ can_talk_to: [writer_1, writer_2, writer_3, user]
33
+ command: "claude --dangerously-skip-permissions"
34
+ role: |
35
+ You are the EDITOR. You receive the assignment in your inbox/ and break it
36
+ into section briefs -- one per writer -- each with a tight word count, an
37
+ angle, and the voice to use. Collect the drafts, line-edit them into one
38
+ consistent piece, and return the assembled draft. Keep every writer on the
39
+ same voice; flag contradictions rather than silently smoothing them.
40
+
41
+ - name: writer_1
70
42
  type: claude
43
+ can_talk_to: [editor]
71
44
  command: "claude --dangerously-skip-permissions"
72
- can_talk_to: ["editor"]
73
-
74
- # The draft lands somewhere predictable, outside the scratch directories.
75
- workdir: ./writers-room-output
76
-
77
- first_prompt: |
78
- You are the WRITER. You turn the editor's brief into DRAFT.md.
79
-
80
- Write for the reader in the brief, not for other experts. Lead with the
81
- single idea, make each paragraph earn the next, and prefer a concrete
82
- example over an abstraction. No filler, no "in today's fast-paced world",
83
- no restating the question back at the reader.
84
-
85
- When you get revision notes from the editor, apply them, and where you
86
- disagree, make your case briefly rather than silently ignoring the note.
87
- Mark any claim you are unsure of so the factchecker can find it.
88
-
89
- Tell the editor where the draft is when a version is ready for review.
90
-
91
- - name: factchecker
45
+ role: |
46
+ You are WRITER 1 (technical lead). Draft exactly the brief the editor
47
+ sends you, in their voice, within their word count. Return it as mail to
48
+ the editor. Do not invent facts you cannot support.
49
+
50
+ - name: writer_2
51
+ type: gemini
52
+ can_talk_to: [editor]
53
+ capture: pane
54
+ command: "gemini --yolo"
55
+ role: |
56
+ You are WRITER 2 (the story). Draft exactly the brief the editor sends
57
+ you -- a human narrative arc -- in their voice, within their word count.
58
+ Return it as mail to the editor.
59
+
60
+ - name: writer_3
92
61
  type: codex
62
+ can_talk_to: [editor]
93
63
  command: "codex --yolo"
94
- can_talk_to: ["editor"]
95
-
96
- first_prompt: |
97
- You are the FACT-CHECKER. You verify, you do not rewrite.
98
-
99
- Go through the draft claim by claim. For each factual assertion, decide:
100
- supported, wrong, or unverifiable -- and show why.
101
-
102
- Report to the editor:
103
- - the claim, quoted, with where it appears
104
- - your verdict, and the source or check behind it
105
- - for anything wrong, the correct version
106
-
107
- Where a claim can be tested with code or a quick command, test it and paste
108
- what you actually observed. Distinguish "I verified this" from "this looks
109
- plausible but I could not confirm it". Do not touch the prose -- that is the
110
- writer's job and the critic's beat.
111
-
112
- - name: critic
113
- type: claude
114
- command: "claude --dangerously-skip-permissions"
115
- can_talk_to: ["editor"]
116
-
117
- first_prompt: |
118
- You are the CRITIC. You attack the writing so the reader does not have to.
119
-
120
- Read the draft as a smart, busy reader who will bail the moment they are
121
- bored or confused. Report to the editor:
122
- - where you lost the thread, and why
123
- - claims that sound impressive but say nothing
124
- - structure that buries the point, or an opening that does not earn attention
125
- - a stronger cut: what to remove so the rest lands harder
126
-
127
- Be specific -- quote the sentence and propose the fix. Praise only what is
128
- genuinely working, and briefly. Your job is the next draft, not the writer's
129
- morale.
64
+ role: |
65
+ You are WRITER 3 (the example/code). Draft exactly the brief the editor
66
+ sends you -- runnable snippets with commentary -- in their voice, within
67
+ their word count. Return it as mail to the editor.
@@ -1,16 +1,18 @@
1
1
  #!/usr/bin/env bash
2
2
  # Claude Code `Stop` hook: fires when Claude finishes responding.
3
3
  # Claude passes a JSON payload on stdin containing `transcript_path`.
4
- # Installed automatically into <agent-workdir>/.claude/settings.json by `agentainer up`.
4
+ # Installed automatically into <agent-workdir>/.claude/settings.json by
5
+ # `agentainer up`.
5
6
  #
6
7
  # A hook must never break the agent it is attached to, so every failure here is
7
8
  # swallowed and the script always exits 0.
9
+ set -uo pipefail
8
10
 
9
11
  HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
12
 
11
13
  log="/dev/null"
12
- if [[ -n "${SWARM_ROOT:-}" ]] && mkdir -p "$SWARM_ROOT/.swarm/logs" 2>/dev/null; then
13
- log="$SWARM_ROOT/.swarm/logs/hooks.log"
14
+ if [[ -n "${AGENTAINER_ROOT:-}" ]] && mkdir -p "$AGENTAINER_ROOT/.agentainer/logs" 2>/dev/null; then
15
+ log="$AGENTAINER_ROOT/.agentainer/logs/hooks.log"
14
16
  fi
15
17
 
16
18
  "$HERE/agentainer" hook claude >>"$log" 2>&1
@@ -1,15 +1,16 @@
1
1
  #!/usr/bin/env bash
2
2
  # Codex `notify` program: codex invokes it with a JSON payload as $1 whenever a
3
3
  # turn completes (payload type: "agent-turn-complete", with last-assistant-message).
4
- # Wired up via <agent-workdir>/.codex/config.toml + CODEX_HOME by `swarm up`.
4
+ # Wired up via <agent-workdir>/.codex/config.toml + CODEX_HOME by `agentainer up`.
5
5
  #
6
6
  # Always exits 0 so a hook failure can never disturb the agent.
7
+ set -uo pipefail
7
8
 
8
9
  HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
10
 
10
11
  log="/dev/null"
11
- if [[ -n "${SWARM_ROOT:-}" ]] && mkdir -p "$SWARM_ROOT/.swarm/logs" 2>/dev/null; then
12
- log="$SWARM_ROOT/.swarm/logs/hooks.log"
12
+ if [[ -n "${AGENTAINER_ROOT:-}" ]] && mkdir -p "$AGENTAINER_ROOT/.agentainer/logs" 2>/dev/null; then
13
+ log="$AGENTAINER_ROOT/.agentainer/logs/hooks.log"
13
14
  fi
14
15
 
15
16
  "$HERE/agentainer" hook codex "${1:-}" >>"$log" 2>&1