claude-comms 1.0.35 → 1.0.36
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/.agents/AGENTS.md +6 -6
- package/.agents/repo.md +10 -2
- package/.agents/tools/agent-job/README.md +208 -0
- package/.agents/tools/agent-job/agent_job.py +858 -0
- package/.agents/tools/agent-job/agent_monitor.py +575 -0
- package/{.claude/agents/core/consultant.md → .agents/tools/agent-job/consultant_template.txt} +14 -72
- package/.claude/agents/core/consultants/codex.md +39 -0
- package/.claude/agents/core/consultants/gemini.md +39 -0
- package/.claude/agents/core/designer.md +1 -1
- package/.claude/agents/core/engineer.md +1 -1
- package/.claude/agents/core/uat.md +1 -1
- package/.claude/commands/analyse-document.md +1 -1
- package/.claude/commands/cook.md +8 -10
- package/.claude/commands/install-feedback-widget.md +74 -42
- package/.claude/commands/learn.md +1 -1
- package/CLAUDE.md +9 -11
- package/package.json +1 -1
package/.agents/AGENTS.md
CHANGED
|
@@ -43,11 +43,11 @@ Evaluate the Change for a given Assignment/Task against the following criteria:
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
[VALIDATE]
|
|
46
|
-
Run required commands — all must pass without warnings or errors:
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
46
|
+
Run required commands from `.agents/repo.md` — all must pass without warnings or errors:
|
|
47
|
+
- lint
|
|
48
|
+
- typecheck
|
|
49
|
+
- build
|
|
50
|
+
- test
|
|
51
51
|
|
|
52
52
|
[UAT]
|
|
53
53
|
Perform manual QA:
|
|
@@ -58,4 +58,4 @@ Perform manual QA:
|
|
|
58
58
|
|
|
59
59
|
[/AGENT OPERATING PROCEDURES]
|
|
60
60
|
|
|
61
|
-
# Repository Guidelines:
|
|
61
|
+
# Adhere to the Repository Guidelines: `.agents/repo.md`
|
package/.agents/repo.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
# Repository Guidelines
|
|
3
|
-
|
|
3
|
+
VALIDATE by Running required commands — all must pass without warnings or errors:
|
|
4
4
|
- `pnpm lint`
|
|
5
5
|
- `pnpm ts:check`
|
|
6
6
|
- `pnpm test:all`
|
|
7
|
-
- `pnpm build`
|
|
7
|
+
- `pnpm build`
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Dev server
|
|
11
|
+
`pnpm dev | tee -a dev.log` is already running in the background. check the `dev.log` file. Avoid starting up a new instance as it will bump the port.
|
|
12
|
+
you can access the client on `http://localhost:3000/` using the UAT toolkit
|
|
13
|
+
|
|
14
|
+
## Documentation Protocol
|
|
15
|
+
Guard the doc hierarchy: specs in `docs/project/spec/` remain the source of truth (Businesslogic, data dictionary, data flows, tech guide, industry references); guides in `docs/project/guides/` capture evolving process; phase folders (`docs/project/phases/XX-Name/`) store live work packages and notes. Update whichever doc you rely on as soon as the code diverges.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Agent Job Adapter
|
|
2
|
+
|
|
3
|
+
Self-contained `uv` Python scripts that turn verbose CLI agent runs (Codex, Gemini CLI) into **file-backed jobs** with stable IDs and cheap status checks.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Spawn a new job (returns immediately)
|
|
9
|
+
uv run agent_job.py spawn --harness codex -- "your assignment here"
|
|
10
|
+
# Output: Agent running. Check status with: `uv run agent_job.py status <job_id>`
|
|
11
|
+
|
|
12
|
+
# Check job status
|
|
13
|
+
uv run agent_job.py status <job_id>
|
|
14
|
+
|
|
15
|
+
# List all jobs
|
|
16
|
+
uv run agent_job.py list
|
|
17
|
+
|
|
18
|
+
# Monitor jobs with TUI
|
|
19
|
+
uv run agent_monitor.py
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
### `spawn`
|
|
25
|
+
|
|
26
|
+
Starts a new agent job with the specified harness. Returns immediately after initialization.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv run agent_job.py spawn --harness <gemini|codex> -- "<assignment>"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Output:**
|
|
33
|
+
```
|
|
34
|
+
Agent running. Check status with: `uv run agent_job.py status 019abd9d-8cb2-7e81-bae9-2a8fe5be04fa`
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### `status`
|
|
38
|
+
|
|
39
|
+
Get current status of a job with computed runtime metrics.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv run agent_job.py status <job_id>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Running job output:**
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"job_id": "019abd9d-8cb2-7e81-bae9-2a8fe5be04fa",
|
|
49
|
+
"harness": "codex",
|
|
50
|
+
"pid": 12345,
|
|
51
|
+
"logs": "/path/to/agent.log",
|
|
52
|
+
"status": "running",
|
|
53
|
+
"status_reason": "command_execution",
|
|
54
|
+
"start_time": "2025-11-25T08:10:06.262Z",
|
|
55
|
+
"last_event_time": "2025-11-25T08:10:29.337Z",
|
|
56
|
+
"runtime_sec": 23.1,
|
|
57
|
+
"idle_sec": 4.0,
|
|
58
|
+
"operations": 18
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Completed job output:**
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"job_id": "019abd9d-8cb2-7e81-bae9-2a8fe5be04fa",
|
|
66
|
+
"harness": "codex",
|
|
67
|
+
"pid": 12345,
|
|
68
|
+
"logs": "/path/to/agent.log",
|
|
69
|
+
"status": "complete",
|
|
70
|
+
"status_reason": "completed",
|
|
71
|
+
"start_time": "2025-11-25T08:10:06.262Z",
|
|
72
|
+
"last_event_time": "2025-11-25T08:10:29.337Z",
|
|
73
|
+
"runtime_sec": 23.1,
|
|
74
|
+
"operations": 18,
|
|
75
|
+
"end_time": "2025-11-25T08:10:29.340Z",
|
|
76
|
+
"completion": {
|
|
77
|
+
"messages": ["Task completed successfully."],
|
|
78
|
+
"tokens": { "input": 7288, "output": 84, "total": 7372 },
|
|
79
|
+
"duration_ms": 13845
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### `list`
|
|
85
|
+
|
|
86
|
+
List all jobs with full status information.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
uv run agent_job.py list
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Monitor TUI
|
|
93
|
+
|
|
94
|
+
Real-time terminal UI for monitoring agent jobs, similar to `top`.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
uv run agent_monitor.py # Default 2s refresh
|
|
98
|
+
uv run agent_monitor.py --interval 5 # Custom refresh interval
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Features:**
|
|
102
|
+
- Color-coded status indicators:
|
|
103
|
+
- `●` Yellow = running
|
|
104
|
+
- `✓` Green = complete
|
|
105
|
+
- `✗` Red = error
|
|
106
|
+
- `⏱` Red = timeout
|
|
107
|
+
- Columns: Status, Harness, Job ID, Status Reason, Started, Runtime, Operations
|
|
108
|
+
- Scrollable log viewer
|
|
109
|
+
|
|
110
|
+
**Keyboard Controls:**
|
|
111
|
+
|
|
112
|
+
| Key | Action |
|
|
113
|
+
|-----|--------|
|
|
114
|
+
| `↑/↓` or `j/k` | Navigate job list |
|
|
115
|
+
| `Enter` | View job log |
|
|
116
|
+
| `r` | Refresh / reload log |
|
|
117
|
+
| `q` | Quit |
|
|
118
|
+
|
|
119
|
+
**Log View Controls:**
|
|
120
|
+
|
|
121
|
+
| Key | Action |
|
|
122
|
+
|-----|--------|
|
|
123
|
+
| `↑/↓` or `j/k` | Scroll line by line |
|
|
124
|
+
| `PgUp/PgDn` | Scroll by page |
|
|
125
|
+
| `Home/End` | Jump to start/end |
|
|
126
|
+
| `r` | Reload log file |
|
|
127
|
+
| `ESC` | Back to job list |
|
|
128
|
+
|
|
129
|
+
## Job Status
|
|
130
|
+
|
|
131
|
+
| Status | Description |
|
|
132
|
+
|--------|-------------|
|
|
133
|
+
| `running` | Job is currently executing |
|
|
134
|
+
| `complete` | Job finished successfully |
|
|
135
|
+
| `error` | Job failed (see `status_reason`) |
|
|
136
|
+
| `timeout` | Job killed due to idle timeout |
|
|
137
|
+
|
|
138
|
+
## Status Reason
|
|
139
|
+
|
|
140
|
+
The `status_reason` field shows current activity while running:
|
|
141
|
+
|
|
142
|
+
**Codex:**
|
|
143
|
+
- `initializing` - Job starting up
|
|
144
|
+
- `thinking` - Turn started
|
|
145
|
+
- `reasoning` - Agent reasoning
|
|
146
|
+
- `command_execution` - Running shell command
|
|
147
|
+
- `todo_list` - Managing todos
|
|
148
|
+
- `agent_message` - Generating response
|
|
149
|
+
- `completed` - Finished
|
|
150
|
+
|
|
151
|
+
**Gemini:**
|
|
152
|
+
- `initializing` - Job starting up
|
|
153
|
+
- `run_shell_command` - Running command
|
|
154
|
+
- `write_file` / `read_file` - File operations
|
|
155
|
+
- `write_todos` - Managing todos
|
|
156
|
+
- `responding` - Generating response
|
|
157
|
+
- `completed` - Finished
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
| Environment Variable | Default | Description |
|
|
162
|
+
|---------------------|---------|-------------|
|
|
163
|
+
| `AGENT_JOBS_ROOT` | `$TMPDIR/agent_jobs/$USER` | Root directory for job files |
|
|
164
|
+
| `IDLE_TIMEOUT_SEC` | `300` | Seconds of inactivity before killing job |
|
|
165
|
+
|
|
166
|
+
## File Structure
|
|
167
|
+
|
|
168
|
+
Each job creates a directory under `AGENT_JOBS_ROOT`:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
<jobs_root>/<job_id>/
|
|
172
|
+
status.json # Current job state (updated on each event)
|
|
173
|
+
agent.log # Raw harness output (appended in real-time)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Supported Harnesses
|
|
177
|
+
|
|
178
|
+
### Codex
|
|
179
|
+
|
|
180
|
+
Uses `codex --yolo e "<assignment>" --json`
|
|
181
|
+
|
|
182
|
+
Events handled:
|
|
183
|
+
- `thread.started` - Extracts job ID (thread_id)
|
|
184
|
+
- `turn.started` - Sets status_reason to "thinking"
|
|
185
|
+
- `item.started/completed` - Updates status_reason with item type
|
|
186
|
+
- `turn.completed` - Extracts token usage
|
|
187
|
+
|
|
188
|
+
### Gemini CLI
|
|
189
|
+
|
|
190
|
+
Uses `gemini --yolo -s -m gemini-3-pro-preview --output-format stream-json "<assignment>"`
|
|
191
|
+
|
|
192
|
+
Events handled:
|
|
193
|
+
- `init` - Extracts session ID as job ID
|
|
194
|
+
- `tool_use` - Updates status_reason with tool name
|
|
195
|
+
- `message` (assistant) - Accumulates response text
|
|
196
|
+
- `result` - Extracts token stats and duration
|
|
197
|
+
|
|
198
|
+
## Babysitter Pattern
|
|
199
|
+
|
|
200
|
+
For autonomous monitoring:
|
|
201
|
+
|
|
202
|
+
1. **Spawn** the job - returns immediately with job ID
|
|
203
|
+
2. **Poll** status periodically
|
|
204
|
+
3. **React** based on status:
|
|
205
|
+
- `running` - Check `idle_sec`, continue monitoring
|
|
206
|
+
- `complete` - Read `completion.messages`
|
|
207
|
+
- `timeout` - Report idle timeout exceeded
|
|
208
|
+
- `error` - Check `status_reason` and logs
|