You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ pnpm monorepo with two packages: root (backend) and `web/` (frontend).
17
17
18
18
### Backend: 4-Agent Pipeline
19
19
20
-
The system generates interactive documentation for any code repository using a pipeline of 4 Codex agents orchestrated by the **Arranger** state machine:
20
+
The system generates interactive documentation for any code repository using a pipeline of 4 agent roles orchestrated by the **Arranger** state machine:
- **Writer**: Generates Markdown documentation for leaf `page` nodes
29
29
- **Checker**: Validates graph structures from Scaffold and Decomposer (not Writer output); failures trigger retry via `agent.continue()`
30
30
31
-
Each agent has both a Codex and Codex backend implementation, located in `src/agents/tsukai/` (e.g. `claudescaffold.ts` / `codexscaffold.ts`). All share identical interface: `run(prompt, workpath)`, `continue(prompt)`, `restore(sessionId, workpath)`, `getSessionId()`. A barrel file `src/agents/tsukai/index.ts` re-exports all classes.
31
+
Each agent has both a Claude Code and Codex backend implementation, located in `src/agents/tsukai/` (e.g. `claudescaffold.ts` / `codexscaffold.ts`). All share identical interface: `run(prompt, workpath)`, `continue(prompt)`, `restore(sessionId, workpath)`, `getSessionId()`. A barrel file `src/agents/tsukai/index.ts` re-exports all classes.
32
32
33
33
### Arranger (`src/workflow/arranger.ts`)
34
34
@@ -45,7 +45,7 @@ All data structures use Zod schemas. The `Graph` type includes `decomposerSessio
After initial generation, per-PR documentation updates are handled by the **PrUpdater** agent (Codex or Codex backend, `src/agents/tsukai/claudeprupdater.ts` / `codexprupdater.ts`). The orchestrator:
48
+
After initial generation, per-PR documentation updates are handled by the **PrUpdater** agent (Claude Code or Codex backend, `src/agents/tsukai/claudeprupdater.ts` / `codexprupdater.ts`). The orchestrator:
49
49
50
50
1. Discovers new merged PRs via `gh pr list` (fallback: `git log --first-parent`), sorted oldest-first by `mergedAt`
51
51
2. Queues them as `TaskItem`s and processes sequentially under a per-project lock
@@ -63,10 +63,10 @@ API endpoints: `POST /api/update/{start,continue,skip,cancel}`, `POST /api/updat
63
63
64
64
The `autodoc` MCP server exposes tools for agents to read/write doc artifacts:
All write tools enforce optimistic locking via `baseVersion` (must match current `version` from read tools). The doc-drill skill template at `src/skill-template/SKILL.md` documents these tools for agent consumption.
69
+
All write tools share the project-level document lock and only dirty the documentation working tree. Users commit accumulated doc changes manually through `/api/doc-git/commit`; blame data comes from `/api/doc-git/blame`. The doc-drill skill template at `src/skill-template/SKILL.md` documents the MCP tools for agent consumption.
All write tools enforce optimistic locking via `baseVersion` (must match current `version` from read tools). The doc-drill skill template at `src/skill-template/SKILL.md` documents these tools for agent consumption.
69
+
All write tools share the project-level document lock and only dirty the documentation working tree. Users commit accumulated doc changes manually through `/api/doc-git/commit`; blame data comes from `/api/doc-git/blame`. The doc-drill skill template at `src/skill-template/SKILL.md` documents the MCP tools for agent consumption.
Copy file name to clipboardExpand all lines: README.en.md
+32-21Lines changed: 32 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Paste a git URL in the frontend and generation begins. **For the full onboarding
73
73
74
74
### Codex Profile Configuration
75
75
76
-
The Codex backend uses [profiles](https://developers.openai.com/codex/config-reference) per Agent role to isolate model parameters. Add one profile per role to `~/.codex/config.toml`. Names must be exactly `scaffold`, `decomposer`, `writer`, `checker`, `flowanalyzer`, `updater`:
76
+
The Codex backend uses [profiles](https://developers.openai.com/codex/config-reference) per Agent role to isolate model parameters. Add one profile per role to `~/.codex/config.toml`. Names must be exactly `scaffold`, `decomposer`, `writer`, `checker`, `flowanalyzer`, `prupdater`, `knowledge`:
Replace models or tweak `model_reasoning_effort` / `service_tier` as needed. See the official [Config Reference](https://developers.openai.com/codex/config-reference) for all keys.
@@ -185,7 +189,7 @@ Each Agent role independently uses **Claude** (Claude Agent SDK) or **Codex** (O
185
189
-**🔗 One-step git URL ingestion** — paste an SSH/HTTPS git URL; backend auto-clones, tracks the main branch head, keeps everything under `src/souko/`
186
190
-**🔁 Per-PR incremental updates** — discovers all newly merged PRs via `gh pr list` (or `git log` fallback) and PrUpdater Agent navigates docs via MCP tools for targeted edits. Auto mode runs hands-free; Manual mode adds a review gate with session continuation for iterative refinement
187
191
-**🛰️ HTTP MCP server** — same-process `/mcp` endpoint (Streamable HTTP) exposes the full query + mutate toolset for direct Code Agent access
188
-
-**📜 Document version control** — every write carries optimistic locking (`baseVersion`) and snapshots to `.history/{file}.v{n}`; `revert` restores any historical version
192
+
-**📜 Manual Git commits and blame** — doc writes only create uncommitted changes; the Git panel shows dirty status, commits manually, and surfaces Git blame in preview/editing views
-**🔍 Progressive disclosure** — start at the top-level overview, drill into nodes down to leaf Markdown
191
195
-**🔄 Interaction flow diagrams** — cross-module business flows auto-extracted and rendered as sequence diagrams with participants, steps, and code references
@@ -199,7 +203,7 @@ Each Agent role independently uses **Claude** (Claude Agent SDK) or **Codex** (O
199
203
200
204
The backend exposes an MCP server named `autodoc` at `http://localhost:3100/mcp` as a stateless Streamable HTTP transport. All tools operate on real files under `src/souko/doc/{project}/`.
201
205
202
-
### Wire it up in Claude Code
206
+
### Wire it up in Claude Code / Codex
203
207
204
208
Drop an `.mcp.json` into the target repo root:
205
209
@@ -214,6 +218,14 @@ Drop an `.mcp.json` into the target repo root:
214
218
}
215
219
```
216
220
221
+
Codex uses project-scoped `.codex/config.toml`; autoDoc writes the equivalent config when assembling the skill:
The matching [doc-drill skill](src/skill-template/SKILL.md) is a thin instruction set that only describes **how to call the MCP tools**, and ships with autoDoc.
218
230
219
231
### Tool list
@@ -222,15 +234,15 @@ The matching [doc-drill skill](src/skill-template/SKILL.md) is a thin instructio
222
234
223
235
| Tool | Purpose |
224
236
|---|---|
225
-
|`list_projects`| List all registered projects (with sourceUrl / head / lastUpdated) |
226
-
|`get_top`| Read a project's top.json (with `version`) |
227
-
|`get_graph`| Read a sub-graph (with `version`and the `pageVersions` map)|
228
-
|`get_page`| Read a leaf Markdown page (with its `version`) |
237
+
|`list_projects`| List available doc projects (name / description) |
238
+
|`get_top`| Read a project's top.json |
239
+
|`get_graph`| Read a sub-graph with `codeScope`, `nodes`, and `description`|
240
+
|`get_page`| Read a leaf Markdown page |
229
241
|`search_nodes`| Search node names/descriptions across all levels |
230
-
|`list_history`| List all historical versions of a file|
231
-
|`get_history`| Read a specific historical version|
242
+
|`list_source_files` / `read_source_files`| Locate and read source files by regex|
243
+
|`list_docs` / `read_docs`| Batch-list/read raw docs by nodeId|
232
244
233
-
#### Mutate (optimistic lock via `baseVersion`)
245
+
#### Mutate (serialized by project lock)
234
246
235
247
| Tool | Purpose |
236
248
|---|---|
@@ -240,10 +252,9 @@ The matching [doc-drill skill](src/skill-template/SKILL.md) is a thin instructio
240
252
|`update_node`| Update a node's name / description / codeScope / edges in its parent graph |
241
253
|`delete_node`| Remove a node from its parent graph (page deletes the md; graph recursively deletes its subtree) |
242
254
|`patch_page`| Targeted string-match-and-replace edits to a leaf md, more efficient and safer than update_page |
243
-
|`update_page`| Overwrite a leaf md; uses `pageVersions[ref]` as baseVersion |
244
-
|`revert`| Write a historical version back as a new version, keeping intermediate versions intact |
255
+
|`update_page`| Overwrite a leaf md |
245
256
246
-
Write flow: **read → obtain version → write with baseVersion → server snapshots the old version to `.history/` → version+1 → persist**. A version mismatch returns `VersionMismatch` so the client re-reads and retries.
257
+
Write flow: **read → mutate tools dirty the working tree → review dirty status in the frontend Git panel → user commits manually**. Mutate tools no longer accept `baseVersion` and never auto-commit; concurrent writes are serialized by the project-level lock.
247
258
248
259
> ⚠️ `/mcp` is unauthenticated and CORS-open by default. Add access control or bind to loopback before production use.
249
260
@@ -263,7 +274,6 @@ src/souko/
263
274
│ ├── flows.json
264
275
│ ├── {Module}/
265
276
│ │ ├── {Module}.json
266
-
│ │ ├── .history/ # Historical snapshots
267
277
│ │ ├── {Leaf}.md
268
278
│ │ └── {SubModule}/...
269
279
│ └── ...
@@ -274,19 +284,19 @@ src/souko/
274
284
275
285
Each module's documentation is a self-contained unit. Three ways to edit it:
276
286
277
-
-**Via MCP tools** (recommended): `update_node` / `update_page` / `create_node` / `delete_node` — automatic version tracking and history snapshots; ideal for Code Agents
278
-
-**Direct file edits**: edit `.md` / `.json` under `src/souko/doc/{project}/`; restart the server to pick it up (bypasses version control)
287
+
-**Via MCP tools** (recommended): `update_node` / `update_page` / `create_node` / `delete_node` — writes dirty the doc working tree and wait for a manual commit in the frontend Git panel
288
+
-**Direct file edits**: edit `.md` / `.json` under `src/souko/doc/{project}/`; refresh to pick it up and show it as uncommitted
279
289
-**Trigger an incremental update**: click the Update button on the home page; PrUpdater Agent automatically discovers all newly merged PRs and processes them one by one. Manual mode gates each PR behind a review confirmation
280
290
281
291
## doc-drill: Native Code Agent Integration
282
292
283
-
autoDoc installs the thin [doc-drill](src/skill-template/SKILL.md) skill into the target repo's `.claude/skills/doc-drill/` and writes an `.mcp.json`pointing at the local MCP server. Any Code Agent can then:
293
+
autoDoc installs the thin [doc-drill](src/skill-template/SKILL.md) skill into the target repo's `.claude/skills/doc-drill/`, then writes Claude Code's `.mcp.json`and Codex's `.codex/config.toml` to point at the local HTTP MCP server. Any Code Agent can then:
0 commit comments