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.
- package/README.md +248 -677
- package/agentainer +16 -18
- package/agentainer.example.yaml +86 -0
- package/bin/agentainer.js +9 -8
- package/examples/brainstorm.yaml +27 -128
- package/examples/bug-hunt.yaml +51 -96
- package/examples/code-review.yaml +73 -0
- package/examples/debate.yaml +16 -90
- package/examples/incident-response.yaml +52 -109
- package/examples/localization.yaml +56 -123
- package/examples/quickstart.yaml +48 -0
- package/examples/research.yaml +25 -0
- package/examples/software-company.yaml +71 -128
- package/examples/tdd-pingpong.yaml +36 -68
- package/examples/writers-room.yaml +49 -111
- package/hooks/claude_stop.sh +5 -3
- package/hooks/codex_notify.sh +4 -3
- package/lib/cli.py +929 -0
- package/lib/config.py +247 -305
- package/lib/hooks.py +246 -0
- package/lib/lock.py +75 -0
- package/lib/log.py +64 -0
- package/lib/mail.py +634 -0
- package/lib/minyaml.py +1 -39
- package/lib/reconcile.py +473 -0
- package/lib/sessions.py +223 -0
- package/lib/supervisor.py +216 -0
- package/lib/telegram.py +372 -0
- package/lib/tmux.py +355 -0
- package/lib/turn.py +159 -0
- package/lib/ui.py +1020 -0
- package/llms.txt +145 -429
- package/package.json +9 -7
- package/scripts/check-deps.js +18 -61
- package/ui/app.js +869 -0
- package/ui/index.html +348 -0
- package/agents.example.yaml +0 -257
- package/examples/code-review-broadcast.yaml +0 -109
- package/examples/existing-repo.yaml +0 -74
- package/examples/multi-language-broadcast.yaml +0 -127
- package/examples/ping-pong.yaml +0 -89
- package/examples/red-team.yaml +0 -117
- package/examples/research-swarm.yaml +0 -129
- package/lib/swarm.py +0 -2461
|
@@ -1,167 +1,110 @@
|
|
|
1
1
|
# =============================================================================
|
|
2
|
-
# Software company -- a product team with a CTO, an architect, two
|
|
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
|
-
#
|
|
6
|
-
# agentainer
|
|
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
|
|
9
|
-
#
|
|
10
|
-
#
|
|
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
|
-
#
|
|
23
|
-
# to
|
|
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
|
-
|
|
36
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
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,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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 --
|
|
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
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
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:
|
|
10
|
-
#
|
|
11
|
-
#
|
|
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
|
-
#
|
|
14
|
+
# red <----> green
|
|
15
15
|
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
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:
|
|
23
|
-
root: ./tdd-
|
|
24
|
-
session_prefix: "tdd-"
|
|
25
|
-
create_workdirs: false
|
|
21
|
+
name: tdd-pingpong
|
|
22
|
+
root: ./tdd-workspace
|
|
26
23
|
|
|
27
24
|
defaults:
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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 --
|
|
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
|
-
#
|
|
5
|
-
# agentainer
|
|
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:
|
|
8
|
-
#
|
|
9
|
-
#
|
|
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
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
14
|
+
# writer-1 \ / editor
|
|
15
|
+
# writer-2 > (all talk only to the editor) <
|
|
16
|
+
# writer-3 /
|
|
15
17
|
#
|
|
16
|
-
#
|
|
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:
|
|
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
|
-
|
|
26
|
+
capture: none
|
|
27
|
+
can_talk_to: []
|
|
34
28
|
|
|
35
29
|
agents:
|
|
36
|
-
|
|
37
30
|
- name: editor
|
|
38
31
|
type: claude
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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.
|
package/hooks/claude_stop.sh
CHANGED
|
@@ -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
|
|
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 "${
|
|
13
|
-
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
|
package/hooks/codex_notify.sh
CHANGED
|
@@ -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 `
|
|
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 "${
|
|
12
|
-
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
|