Skip to content

Commit 96864e2

Browse files
jiunbaeclaude
andcommitted
docs: update README with epic-based architecture and analyze command
- Add oac analyze command to commands table - Update "How It Works" flow to show context-first epic pipeline - Add epic vs per-task comparison table - Replace monorepo packages section with single-package modules - Update config example to use defineConfig with analyze options - Update demo output to show epic-based execution - Update Node.js requirement to >=24 - Update roadmap with context-first architecture milestone Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b1983cc commit 96864e2

1 file changed

Lines changed: 99 additions & 68 deletions

File tree

‎README.md‎

Lines changed: 99 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,25 @@ npx @open330/oac run --repo facebook/react --tokens unlimited
5050
```
5151

5252
```
53-
Scanning facebook/react...
54-
Found 23 tasks (12 lint fixes, 6 TODOs, 5 test gaps)
55-
56-
Budget: 50,000 tokens
57-
Selected: 8 tasks (est. 42,300 tokens)
58-
Reserve: 5,000 tokens (10%)
59-
60-
[Claude] ████████░░ 4/8 tasks completed
61-
[Claude] ✔ PR #1847: Fix unused imports in scheduler
62-
[Claude] ✔ PR #1848: Add tests for reconciler edge case
63-
[Claude] ⠋ Resolving TODO in ReactFiberHooks.js...
64-
65-
─────────────────────────────────────
66-
Done! 7/8 tasks succeeded
67-
PRs created: 7
68-
Tokens used: 38,420 / 50,000
69-
Contribution logged to .oac/contributions/
53+
✔ Resolved facebook/react
54+
✔ Repository ready at ~/.oac/cache/repos/facebook/react
55+
✔ Analyzed 12 modules, 847 files, 23 findings
56+
✔ Created 4 epic(s)
57+
✔ Epic token estimation completed
58+
[oac] Selected 3 epic(s) for execution, 1 deferred.
59+
60+
✔ Improve test coverage for reconciler (1/3)
61+
PR #1847: https://github.com/facebook/react/pull/1847
62+
✔ Fix lint warnings in scheduler (2/3)
63+
PR #1848: https://github.com/facebook/react/pull/1848
64+
✔ Address TODO comments (3/3)
65+
PR #1849: https://github.com/facebook/react/pull/1849
66+
67+
Run Summary (Epic Mode)
68+
Epics completed: 3/3
69+
PRs created: 3
70+
Tokens used: 38,420 / 50,000
71+
Duration: 8m 42s
7072
```
7173

7274
---
@@ -88,7 +90,7 @@ npx @open330/oac run --repo facebook/react --tokens unlimited
8890

8991
### Prerequisites
9092

91-
- **Node.js** >= 22
93+
- **Node.js** >= 24
9294
- **git** installed
9395
- At least one AI agent CLI: [Claude Code](https://claude.ai/code), [Codex](https://github.com/openai/codex), or [OpenCode](https://github.com/opencode-ai/opencode)
9496

@@ -160,30 +162,40 @@ oac doctor
160162
|---------|-------------|
161163
| `oac init` | Interactive setup wizard — creates `oac.config.ts` |
162164
| `oac doctor` | Verify environment (Node, git, agents, auth) |
163-
| `oac scan` | Discover tasks in a repo without executing |
165+
| `oac analyze` | Deep codebase analysis — builds context, groups findings into epics |
166+
| `oac scan` | Quick task discovery without grouping or context |
164167
| `oac plan` | Show execution plan with token budget breakdown |
165-
| `oac run` | Full pipeline: scan → estimate → execute → PR → track |
168+
| `oac run` | Full pipeline: analyze → group epics → execute → PR → track |
166169
| `oac status` | Show running/recent job status |
167170
| `oac log` | View contribution history |
168171
| `oac leaderboard` | Show contribution rankings |
169-
| `oac dashboard` | Launch localhost web dashboard |
172+
173+
### `oac analyze` — Deep Codebase Analysis
174+
175+
```bash
176+
oac analyze --repo owner/repo [--force] [--format table|json]
177+
```
178+
179+
Builds a full codebase map (modules, files, exports, dependencies), runs all scanners, groups findings into epics, and persists everything to `.oac/context/`. The analysis is cached — subsequent runs only re-analyze changed files (incremental via `git diff`).
170180

171181
### `oac run` — The Main Event
172182

173183
```bash
174184
oac run \
175185
--repo owner/repo \ # Target repository
176186
--tokens 50000 \ # Token budget (or "unlimited")
177-
--provider claude-code \ # AI agent to use
187+
--provider claude-code \ # AI agent to use (claude-code or codex)
178188
--concurrency 2 \ # Parallel agents (default: 2)
179189
--mode new-pr \ # Create PRs (or: direct-commit)
180190
--dry-run # Preview without executing
181191

182-
# Run with unlimited budget (keeps going until rate-limited)
183-
oac run --repo owner/repo --tokens unlimited --concurrency 3
192+
# Run with unlimited budget
193+
oac run --repo owner/repo --tokens unlimited --provider codex
194+
195+
# Auto-analyzes if no context exists (or use --force to re-analyze)
184196
```
185197

186-
### `oac scan` — See What's Out There
198+
### `oac scan` — Quick Task Discovery
187199

188200
```bash
189201
oac scan --repo owner/repo --format table
@@ -210,36 +222,33 @@ OAC uses a TypeScript config file:
210222

211223
```typescript
212224
// oac.config.ts
213-
export default {
214-
repos: ['facebook/react', 'vercel/next.js'],
225+
import { defineConfig } from "@open330/oac";
215226

216-
provider: {
217-
id: 'claude-code',
218-
options: { model: 'opus' },
219-
},
227+
export default defineConfig({
228+
repos: ["facebook/react", "vercel/next.js"],
220229

221-
budget: {
222-
totalTokens: 100_000,
223-
reservePercent: 0.10,
230+
execution: {
231+
provider: "claude-code", // or "codex"
232+
concurrency: 2,
233+
mode: "new-pr",
234+
taskTimeout: 300,
235+
tokenBudget: 100_000, // or "unlimited"
224236
},
225237

226238
discovery: {
227239
scanners: {
228240
lint: true,
229241
todo: true,
230242
testGap: true,
231-
deadCode: false,
232-
githubIssues: true,
233243
},
234-
issueLabels: ['good-first-issue', 'help-wanted', 'bug'],
244+
issueLabels: ["good-first-issue", "help-wanted", "bug"],
235245
},
236246

237-
execution: {
238-
concurrency: 2,
239-
mode: 'new-pr',
240-
taskTimeout: 300,
247+
analyze: {
248+
autoAnalyze: true, // auto-analyze before run
249+
staleAfterMs: 86_400_000, // re-analyze after 24h
241250
},
242-
};
251+
});
243252
```
244253

245254
---
@@ -274,28 +283,27 @@ export default {
274283
└───────────────────┘
275284
```
276285

277-
### Packages
286+
### Modules
278287

279-
All packages are published under the `@open330` scope on npm:
288+
Published as a single package `@open330/oac`:
280289

281-
| Package | npm | Description |
282-
|---------|-----|-------------|
283-
| [`@open330/oac`](packages/cli) | [![npm](https://img.shields.io/npm/v/@open330/oac?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac) | CLI — the main entry point |
284-
| [`@open330/oac-core`](packages/core) | [![npm](https://img.shields.io/npm/v/@open330/oac-core?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-core) | Event bus, config, types, errors |
285-
| [`@open330/oac-repo`](packages/repo) | [![npm](https://img.shields.io/npm/v/@open330/oac-repo?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-repo) | GitHub repo resolution, cloning, metadata |
286-
| [`@open330/oac-discovery`](packages/discovery) | [![npm](https://img.shields.io/npm/v/@open330/oac-discovery?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-discovery) | Task scanners (lint, TODO, test-gap, issues) |
287-
| [`@open330/oac-budget`](packages/budget) | [![npm](https://img.shields.io/npm/v/@open330/oac-budget?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-budget) | Token estimation, complexity analysis, planning |
288-
| [`@open330/oac-execution`](packages/execution) | [![npm](https://img.shields.io/npm/v/@open330/oac-execution?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-execution) | Agent pool, job queue, worktree sandbox |
289-
| [`@open330/oac-completion`](packages/completion) | [![npm](https://img.shields.io/npm/v/@open330/oac-completion?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-completion) | PR creation, issue linking |
290-
| [`@open330/oac-tracking`](packages/tracking) | [![npm](https://img.shields.io/npm/v/@open330/oac-tracking?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-tracking) | Contribution logs, leaderboard |
291-
| [`@open330/oac-dashboard`](packages/dashboard) | [![npm](https://img.shields.io/npm/v/@open330/oac-dashboard?label=&color=CB3837)](https://www.npmjs.com/package/@open330/oac-dashboard) | Fastify web dashboard with SSE streaming |
290+
| Module | Path | Description |
291+
|--------|------|-------------|
292+
| Core | `src/core/` | Event bus, config (Zod), types, errors |
293+
| Repo | `src/repo/` | GitHub repo resolution, shallow cloning, metadata cache |
294+
| Discovery | `src/discovery/` | Codebase analyzer, epic grouper, backlog, scanners (lint, TODO, test-gap, GitHub issues) |
295+
| Budget | `src/budget/` | Token estimation (tiktoken), complexity analysis, execution planner |
296+
| Execution | `src/execution/` | Agent adapters (Claude Code, Codex), worktree sandbox, worker |
297+
| Completion | `src/completion/` | PR creation (Octokit), diff validation, issue linking |
298+
| Tracking | `src/tracking/` | Contribution logs, leaderboard, JSON schema |
299+
| CLI | `src/cli/` | Commander.js commands: init, doctor, analyze, scan, plan, run, status, log, leaderboard |
292300

293301
### Tech Stack
294302

295303
| Layer | Technology |
296304
|-------|-----------|
297-
| Runtime | Node.js 22+, TypeScript 5.7+, ESM |
298-
| Build | pnpm workspaces, Turborepo, tsup |
305+
| Runtime | Node.js 24+, TypeScript 5.7+, ESM |
306+
| Build | pnpm, tsup |
299307
| CLI | Commander.js, chalk, ora, cli-table3 |
300308
| Git | simple-git, git worktrees for isolation |
301309
| GitHub | @octokit/rest |
@@ -336,6 +344,8 @@ oac leaderboard
336344

337345
## How It Works
338346

347+
OAC uses a **context-first architecture**: it first deeply analyzes the codebase, then groups related findings into coherent **epics** (not tiny per-file tasks), and executes each epic as a single unit with full module context.
348+
339349
```
340350
You run `oac run`
341351
│
@@ -346,18 +356,28 @@ You run `oac run`
346356
└────┬─────┘ │
347357
│ │
348358
▼ ▼
349-
┌─────────┐ TODO, lint, test-gap, ┌──────────┐
350-
│ Scan │──── GitHub issues ──────────▶│ Tasks │
359+
┌─────────┐ Auto-detect src dir, ┌──────────┐
360+
│ Analyze │──── module map, exports, ────▶│ Context │
361+
└────┬────┘ LOC, dependencies │ .oac/ │
362+
│ └────┬─────┘
363+
▼ │
364+
┌─────────┐ TODO, lint, test-gap, ┌────▼─────┐
365+
│ Scan │──── GitHub issues ──────────▶│ Findings │
351366
└────┬────┘ └────┬─────┘
352367
│ │
353368
▼ ▼
354-
┌─────────┐ tiktoken counting, ┌──────────┐
355-
│ Budget │──── knapsack selection ─────▶│ Plan │
356-
└────┬────┘ (10% reserve) └────┬─────┘
369+
┌─────────┐ Group by module+type, ┌──────────┐
370+
│ Group │──── create coherent units ──▶│ Epics │
371+
└────┬────┘ (1 PR per epic) └────┬─────┘
357372
│ │
358373
▼ ▼
359-
┌─────────┐ git worktree per agent ┌──────────┐
360-
│Execute │──── parallel sandboxes ─────▶│ Results │
374+
┌─────────┐ Per-epic estimation, ┌──────────┐
375+
│ Budget │──── priority-based select ──▶│ Plan │
376+
└────┬────┘ └────┬─────┘
377+
│ │
378+
▼ ▼
379+
┌─────────┐ git worktree per epic ┌──────────┐
380+
│Execute │──── with module context ────▶│ Results │
361381
└────┬────┘ └────┬─────┘
362382
│ │
363383
▼ ▼
@@ -368,9 +388,19 @@ You run `oac run`
368388
▼ ▼
369389
┌─────────┐ .oac/contributions/ ┌──────────┐
370390
│ Track │──── JSON audit log ─────────▶│ Done! │
371-
└─────────┘ └──────────┘
391+
└─────────┘ update backlog └──────────┘
372392
```
373393

394+
### Epic-Based Execution vs Per-Task
395+
396+
| | Old (per-task) | New (epic-based) |
397+
|---|---|---|
398+
| Unit | 1 task = 1 file change | 1 epic = N related changes |
399+
| Context | Agent sees only target file | Agent sees full module context |
400+
| PR | 1 PR per file | 1 PR per epic (multi-file) |
401+
| Persistence | None — re-scans every run | Backlog persisted in `.oac/context/` |
402+
| Incremental | Full re-scan | Only re-analyzes git-changed files |
403+
374404
---
375405

376406
## Supported AI Agents
@@ -402,9 +432,10 @@ export class MyAgentAdapter implements AgentProvider {
402432

403433
## Roadmap
404434

405-
- [x] **2026.2.17** — Core engine, CLI, 5 scanners, parallel execution, dashboard, npm publish
406-
- [x] **2026.3.x** — Claude Code + Codex CLI adapters (both supported)
407-
- [ ] **Next** — OpenCode adapter, multi-agent routing (run multiple agents simultaneously)
435+
- [x] **2026.2.17** — Core engine, CLI, 5 scanners, parallel execution, npm publish
436+
- [x] **2026.2.18** — Context-first architecture: codebase analyzer, epic grouper, incremental analysis, backlog persistence, enhanced prompts with module context
437+
- [x] **2026.4.x** — Claude Code + Codex CLI adapters, token usage reporting, auto-detect sourceDir
438+
- [ ] **Next** — OpenCode adapter, multi-agent routing, localhost dashboard
408439
- [ ] **Future** — Linear/Jira webhooks, plugin system, sparse checkout for monorepos
409440

410441
---

0 commit comments

Comments
 (0)