@open330/oac 2026.2.5

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 (56) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/LICENSE +21 -0
  3. package/README.md +597 -0
  4. package/dist/budget/index.d.ts +117 -0
  5. package/dist/budget/index.js +23 -0
  6. package/dist/budget/index.js.map +1 -0
  7. package/dist/chunk-4IUL7ECC.js +3152 -0
  8. package/dist/chunk-4IUL7ECC.js.map +1 -0
  9. package/dist/chunk-5GAUWC3L.js +469 -0
  10. package/dist/chunk-5GAUWC3L.js.map +1 -0
  11. package/dist/chunk-6A37SKAJ.js +58 -0
  12. package/dist/chunk-6A37SKAJ.js.map +1 -0
  13. package/dist/chunk-7C7SC4TZ.js +358 -0
  14. package/dist/chunk-7C7SC4TZ.js.map +1 -0
  15. package/dist/chunk-CJAJ4MBO.js +475 -0
  16. package/dist/chunk-CJAJ4MBO.js.map +1 -0
  17. package/dist/chunk-LQC5DLT7.js +317 -0
  18. package/dist/chunk-LQC5DLT7.js.map +1 -0
  19. package/dist/chunk-OTPXGXO7.js +2368 -0
  20. package/dist/chunk-OTPXGXO7.js.map +1 -0
  21. package/dist/chunk-QPVNC7S4.js +1833 -0
  22. package/dist/chunk-QPVNC7S4.js.map +1 -0
  23. package/dist/cli/cli.d.ts +13 -0
  24. package/dist/cli/cli.js +16 -0
  25. package/dist/cli/cli.js.map +1 -0
  26. package/dist/cli/index.d.ts +1 -0
  27. package/dist/cli/index.js +22 -0
  28. package/dist/cli/index.js.map +1 -0
  29. package/dist/completion/index.d.ts +91 -0
  30. package/dist/completion/index.js +587 -0
  31. package/dist/completion/index.js.map +1 -0
  32. package/dist/config-DequKoFA.d.ts +1468 -0
  33. package/dist/core/index.d.ts +64 -0
  34. package/dist/core/index.js +87 -0
  35. package/dist/core/index.js.map +1 -0
  36. package/dist/dashboard/index.d.ts +14 -0
  37. package/dist/dashboard/index.js +1253 -0
  38. package/dist/dashboard/index.js.map +1 -0
  39. package/dist/discovery/index.d.ts +285 -0
  40. package/dist/discovery/index.js +50 -0
  41. package/dist/discovery/index.js.map +1 -0
  42. package/dist/event-bus-KiuR6e3P.d.ts +91 -0
  43. package/dist/execution/index.d.ts +215 -0
  44. package/dist/execution/index.js +27 -0
  45. package/dist/execution/index.js.map +1 -0
  46. package/dist/repo/index.d.ts +33 -0
  47. package/dist/repo/index.js +19 -0
  48. package/dist/repo/index.js.map +1 -0
  49. package/dist/tracking/index.d.ts +357 -0
  50. package/dist/tracking/index.js +15 -0
  51. package/dist/tracking/index.js.map +1 -0
  52. package/dist/types-CYCwgojB.d.ts +34 -0
  53. package/dist/types-Ck7IucqK.d.ts +195 -0
  54. package/docs/config-reference.md +271 -0
  55. package/docs/multi-agent-support-technical-spec.md +312 -0
  56. package/package.json +82 -0
package/README.md ADDED
@@ -0,0 +1,597 @@
1
+ <div align="center">
2
+
3
+ ```
4
+ ___ _ ____
5
+ / _ \ / \ / ___|
6
+ | | | |/ _ \| |
7
+ | |_| / ___ \ |___
8
+ \___/_/ \_\____|
9
+
10
+ O P E N A G E N T C O N T R I B U T I O N
11
+ ```
12
+
13
+ **Put your spare AI tokens to work. Contribute to open source — automatically.**
14
+
15
+ [![npm](https://img.shields.io/npm/v/@open330/oac?label=npm&color=CB3837&logo=npm)](https://www.npmjs.com/package/@open330/oac)
16
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
17
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D20-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
18
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.7+-3178C6?logo=typescript&logoColor=white)](https://typescriptlang.org/)
19
+
20
+ [Getting Started](#-getting-started) · [How It Works](#-how-it-works) · [Commands](#commands) · [Configuration](#configuration) · [Architecture](#architecture) · [Contributing](#contributing)
21
+
22
+ </div>
23
+
24
+ ---
25
+
26
+ ## The Problem
27
+
28
+ You pay for AI agent tokens every month. Claude Code, Codex, OpenCode — they all come with token budgets. But most days, you don't use them all. Those leftover tokens? **Wasted.**
29
+
30
+ Meanwhile, thousands of open source repos have TODOs nobody finishes, lint warnings nobody fixes, tests nobody writes, and issues nobody picks up.
31
+
32
+ ## The Solution
33
+
34
+ **OAC** bridges the gap. Point it at a repo, and it will:
35
+
36
+ 1. **Scan** the codebase for actionable tasks (TODOs, lint issues, missing tests, open GitHub issues)
37
+ 2. **Estimate** token costs and pick tasks that fit your remaining budget
38
+ 3. **Execute** the work using your AI agent of choice — in parallel, sandboxed environments
39
+ 4. **Submit** pull requests, link issues, and track every contribution
40
+
41
+ ```bash
42
+ # Install globally
43
+ npm install -g @open330/oac
44
+
45
+ # That's it. One command.
46
+ oac run --repo facebook/react --tokens 50000
47
+
48
+ # Or run without installing
49
+ npx @open330/oac run --repo facebook/react --tokens unlimited
50
+ ```
51
+
52
+ ```
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
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Features
77
+
78
+ | | Feature | Description |
79
+ |---|---------|-------------|
80
+ | **Scan** | Task Discovery | Finds TODOs, lint issues, test gaps, dead code, and open GitHub issues |
81
+ | **Budget** | Token Estimation | Per-provider token counting with knapsack-optimized task selection |
82
+ | **Run** | Parallel Execution | Run 2-3 agents simultaneously in isolated git worktrees |
83
+ | **Retry** | Resume Failed | `--retry-failed` re-runs only tasks that failed in the previous run |
84
+ | **Ship** | PR Automation | Creates PRs with timeout protection, links issues, notifies webhooks |
85
+ | **Track** | Contribution Logs | Git-native audit trail in `.oac/` — who contributed what, with how many tokens |
86
+ | **Rank** | Leaderboard | See who's recycling the most tokens across your team |
87
+ | **Explain** | Task Inspector | `oac explain <id>` shows why a task was selected and what the agent will do |
88
+ | **Complete** | Shell Integration | Tab-completion for bash, zsh, and fish shells |
89
+
90
+ ---
91
+
92
+ ## Quick Start
93
+
94
+ ### Prerequisites
95
+
96
+ - **Node.js** >= 20 (see `engines` in package.json)
97
+ - **git** installed
98
+ - 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)
99
+
100
+ ### Install
101
+
102
+ ```bash
103
+ # From npm (recommended)
104
+ npm install -g @open330/oac
105
+
106
+ # Or use without installing
107
+ npx @open330/oac --help
108
+
109
+ # From source (for contributors)
110
+ git clone https://github.com/Open330/open-agent-contribution.git
111
+ cd open-agent-contribution
112
+ pnpm install
113
+ pnpm build
114
+ ```
115
+
116
+ ### Setup
117
+
118
+ ```bash
119
+ # Interactive setup wizard
120
+ oac init
121
+
122
+ # Or quick start without wizard
123
+ oac init --minimal --repo owner/repo
124
+ ```
125
+
126
+ ```
127
+ ___ _ ____
128
+ / _ \ / \ / ___|
129
+ | | | |/ _ \| |
130
+ | |_| / ___ \ |___
131
+ \___/_/ \_\____|
132
+
133
+ Welcome to Open Agent Contribution.
134
+ Let's put your spare tokens to work.
135
+
136
+ ? Select your AI providers: › Claude Code, Codex CLI
137
+ ? Monthly token budget for OAC: › 100000
138
+ ? Add your first repo (owner/repo): › facebook/react
139
+
140
+ ✔ Config written to oac.config.ts
141
+ ✔ Created .oac/ tracking directory
142
+ Ready! Run 'oac doctor' to verify or 'oac run' to start.
143
+ ```
144
+
145
+ ### Verify
146
+
147
+ ```bash
148
+ oac doctor
149
+ ```
150
+
151
+ ```
152
+ Environment Check
153
+ ─────────────────
154
+ [✔] Node.js v24.0.0
155
+ [✔] git v2.43.0
156
+ [✔] GitHub Auth gh authenticated as @jiun
157
+ [✔] Claude CLI v1.0.16
158
+ [✘] Codex CLI not found
159
+
160
+ 4/5 checks passed
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Commands
166
+
167
+ | Command | Description |
168
+ |---------|-------------|
169
+ | `oac init` | Interactive setup wizard — creates `oac.config.ts` (`--minimal` for quick start) |
170
+ | `oac doctor` | Verify environment (Node, git, agents, auth) |
171
+ | `oac analyze` | Deep codebase analysis — builds module context, groups findings into epics |
172
+ | `oac scan` | Quick task discovery — finds actionable items without building full context |
173
+ | `oac plan` | Show execution plan with token budget breakdown |
174
+ | `oac run` (alias: `oac r`) | **Primary command.** Full pipeline: analyze → plan → execute → PR → track |
175
+ | `oac status` | Show running/recent job status |
176
+ | `oac log` | View contribution history |
177
+ | `oac leaderboard` | Show contribution rankings |
178
+ | `oac completion` | Generate shell tab-completion scripts (bash/zsh/fish) |
179
+ | `oac explain <id>` | Show why a task/epic was selected and what the agent will do |
180
+
181
+ ### `oac analyze` — Deep Codebase Analysis
182
+
183
+ ```bash
184
+ oac analyze --repo owner/repo [--force] [--format table|json]
185
+ ```
186
+
187
+ 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`).
188
+
189
+ ### `oac run` — The Main Event
190
+
191
+ ```bash
192
+ oac run \
193
+ --repo owner/repo \ # Target repository
194
+ --tokens 50000 \ # Token budget (or "unlimited")
195
+ --provider claude-code \ # AI agent to use (claude-code or codex)
196
+ --concurrency 2 \ # Parallel agents (default: 2)
197
+ --mode new-pr \ # Create PRs (or: direct-commit)
198
+ --dry-run \ # Preview without executing (with colored diff)
199
+ --quiet \ # Suppress spinner/progress output (for CI)
200
+ --retry-failed # Re-run only previously failed tasks
201
+
202
+ # Run with unlimited budget
203
+ oac run --repo owner/repo --tokens unlimited --provider codex
204
+
205
+ # Auto-analyzes if no context exists (or use --force to re-analyze)
206
+ # Shorthand alias: oac r
207
+ ```
208
+
209
+ **Exit Codes:**
210
+
211
+ | Code | Meaning |
212
+ |------|---------|
213
+ | `0` | All tasks/epics completed successfully (or dry-run) |
214
+ | `1` | Unexpected / unhandled error |
215
+ | `2` | Configuration or validation error |
216
+ | `3` | All selected tasks/epics failed |
217
+ | `4` | Partial success — some tasks succeeded, others failed |
218
+
219
+ ### `oac scan` — Quick Task Discovery
220
+
221
+ ```bash
222
+ oac scan --repo owner/repo --format table
223
+ ```
224
+
225
+ ```
226
+ ┌─────────┬──────────────────────────────────┬────────┬──────────┬────────────┐
227
+ │ ID │ Title │ Source │ Priority │ Complexity │
228
+ ├─────────┼──────────────────────────────────┼────────┼──────────┼────────────┤
229
+ │ a1b2c3 │ Fix unused import in utils.ts │ lint │ 85 │ trivial │
230
+ │ d4e5f6 │ TODO: Add input validation │ todo │ 72 │ simple │
231
+ │ g7h8i9 │ Missing tests for Parser class │ test │ 68 │ moderate │
232
+ │ j0k1l2 │ Remove dead code in legacy/ │ dead │ 45 │ simple │
233
+ │ #142 │ Fix date formatting bug │ issue │ 91 │ moderate │
234
+ └─────────┴──────────────────────────────────┴────────┴──────────┴────────────┘
235
+ 5 tasks discovered
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Configuration
241
+
242
+ OAC uses a TypeScript config file:
243
+
244
+ ```typescript
245
+ // oac.config.ts
246
+ import { defineConfig } from "@open330/oac";
247
+
248
+ export default defineConfig({
249
+ repos: ["facebook/react", "vercel/next.js"],
250
+
251
+ execution: {
252
+ provider: "claude-code", // or "codex"
253
+ concurrency: 2,
254
+ mode: "new-pr",
255
+ taskTimeout: 300,
256
+ tokenBudget: 100_000, // or "unlimited"
257
+ },
258
+
259
+ discovery: {
260
+ scanners: {
261
+ lint: true,
262
+ todo: true,
263
+ testGap: true,
264
+ },
265
+ issueLabels: ["good-first-issue", "help-wanted", "bug"],
266
+ },
267
+
268
+ analyze: {
269
+ autoAnalyze: true, // auto-analyze before run
270
+ staleAfterMs: 86_400_000, // re-analyze after 24h
271
+ },
272
+ });
273
+ ```
274
+
275
+ > 📖 **Full reference**: See [docs/config-reference.md](docs/config-reference.md) for every option, type, default, and constraint — auto-generated from the Zod schema.
276
+
277
+ ---
278
+
279
+ ## Architecture
280
+
281
+ ```
282
+ ┌─────────────────────────────────────────────────────┐
283
+ │ oac CLI / Dashboard │
284
+ └────────────────────────┬────────────────────────────┘
285
+
286
+ ┌──────────▼──────────┐
287
+ │ Core Engine │
288
+ │ (Event Bus + Config)│
289
+ └──┬──┬──┬──┬──┬──┬──┘
290
+ │ │ │ │ │ │
291
+ ┌────────────┘ │ │ │ │ └────────────┐
292
+ │ │ │ │ │ │
293
+ ┌───▼───┐ ┌───────▼──▼──▼───────┐ ┌───────▼───────┐
294
+ │ Repo │ │ Discovery → Budget │ │ Tracking │
295
+ │Select │ │ → Execution │ │ (.oac/ logs) │
296
+ └───────┘ └─────────┬───────────┘ └───────────────┘
297
+
298
+ ┌──────▼──────┐
299
+ │ Completion │
300
+ │ (PR + Issue) │
301
+ └──────┬──────┘
302
+
303
+ ┌─────────▼─────────┐
304
+ │ GitHub / Linear │
305
+ │ / Jira │
306
+ └───────────────────┘
307
+ ```
308
+
309
+ ### Modules
310
+
311
+ Published as a single package `@open330/oac`:
312
+
313
+ | Module | Path | Description |
314
+ |--------|------|-------------|
315
+ | Core | `src/core/` | Event bus, config (Zod), types, errors, memory pressure monitoring |
316
+ | Repo | `src/repo/` | GitHub repo resolution, shallow cloning, metadata cache |
317
+ | Discovery | `src/discovery/` | Codebase analyzer (streaming for large files), epic grouper, backlog, scanners (lint, TODO, test-gap, GitHub issues) |
318
+ | Budget | `src/budget/` | Token estimation (tiktoken), complexity analysis, execution planner, resettable counters |
319
+ | Execution | `src/execution/` | Agent adapters (Claude Code, Codex), worktree sandbox, worker |
320
+ | Completion | `src/completion/` | PR creation (Octokit) with timeout protection, diff validation, issue linking |
321
+ | Tracking | `src/tracking/` | Contribution logs, leaderboard, JSON schema |
322
+ | CLI | `src/cli/` | 11 commands: init, doctor, analyze, scan, plan, run, status, log, leaderboard, completion, explain. Run module decomposed into 8 focused sub-modules |
323
+
324
+ ### Tech Stack
325
+
326
+ | Layer | Technology |
327
+ |-------|-----------|
328
+ | Runtime | Node.js 24+, TypeScript 5.7+, ESM |
329
+ | Build | pnpm, tsup |
330
+ | CLI | Commander.js, chalk, ora, cli-table3 |
331
+ | Concurrency | p-queue for bounded parallelism, memory pressure monitoring |
332
+ | Process | execa for child process management |
333
+ | Git | simple-git, git worktrees for isolation |
334
+ | GitHub | @octokit/rest |
335
+ | AI Agents | Claude Code (`claude-code`), Codex CLI (`codex`) — pluggable via `AgentProvider` |
336
+ | Dashboard | Fastify + embedded SPA with SSE streaming |
337
+ | Quality | Vitest, Biome |
338
+
339
+ ---
340
+
341
+ ## Contribution Tracking
342
+
343
+ Every run creates a JSON log in `.oac/contributions/`:
344
+
345
+ ```
346
+ .oac/
347
+ ├── contributions/
348
+ │ ├── 2026-02-17-143052-jiun.json
349
+ │ ├── 2026-02-17-151023-jiun.json
350
+ │ └── 2026-02-18-091500-alice.json
351
+ └── leaderboard.json
352
+ ```
353
+
354
+ Each log records: who contributed, which tasks, tokens used, PRs created, and execution metrics. The leaderboard aggregates across all contributors.
355
+
356
+ ```bash
357
+ oac leaderboard
358
+ ```
359
+
360
+ ```
361
+ Contribution Leaderboard
362
+ ────────────────────────
363
+ #1 jiun 42 tasks 284,000 tokens 38 PRs merged
364
+ #2 alice 31 tasks 195,000 tokens 27 PRs merged
365
+ #3 bob 18 tasks 122,000 tokens 15 PRs merged
366
+ ```
367
+
368
+ ---
369
+
370
+ ## How It Works
371
+
372
+ 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.
373
+
374
+ ```
375
+ You run `oac run`
376
+
377
+
378
+ ┌─────────┐ Shallow clone, cache metadata
379
+ │ Repo │────────────────────────────────────┐
380
+ │ Select │ │
381
+ └────┬─────┘ │
382
+ │ │
383
+ ▼ ▼
384
+ ┌─────────┐ Auto-detect src dir, ┌──────────┐
385
+ │ Analyze │──── module map, exports, ────▶│ Context │
386
+ └────┬────┘ LOC, dependencies │ .oac/ │
387
+ │ └────┬─────┘
388
+ ▼ │
389
+ ┌─────────┐ TODO, lint, test-gap, ┌────▼─────┐
390
+ │ Scan │──── GitHub issues ──────────▶│ Findings │
391
+ └────┬────┘ └────┬─────┘
392
+ │ │
393
+ ▼ ▼
394
+ ┌─────────┐ Group by module+type, ┌──────────┐
395
+ │ Group │──── create coherent units ──▶│ Epics │
396
+ └────┬────┘ (1 PR per epic) └────┬─────┘
397
+ │ │
398
+ ▼ ▼
399
+ ┌─────────┐ Per-epic estimation, ┌──────────┐
400
+ │ Budget │──── priority-based select ──▶│ Plan │
401
+ └────┬────┘ └────┬─────┘
402
+ │ │
403
+ ▼ ▼
404
+ ┌─────────┐ git worktree per epic ┌──────────┐
405
+ │Execute │──── with module context ────▶│ Results │
406
+ └────┬────┘ └────┬─────┘
407
+ │ │
408
+ ▼ ▼
409
+ ┌─────────┐ Validate diff, ┌──────────┐
410
+ │Complete │──── create PR, link issue ──▶│ PRs │
411
+ └────┬────┘ └────┬─────┘
412
+ │ │
413
+ ▼ ▼
414
+ ┌─────────┐ .oac/contributions/ ┌──────────┐
415
+ │ Track │──── JSON audit log ─────────▶│ Done! │
416
+ └─────────┘ update backlog └──────────┘
417
+ ```
418
+
419
+ ### Epic-Based Execution vs Per-Task
420
+
421
+ | | Old (per-task) | New (epic-based) |
422
+ |---|---|---|
423
+ | Unit | 1 task = 1 file change | 1 epic = N related changes |
424
+ | Context | Agent sees only target file | Agent sees full module context |
425
+ | PR | 1 PR per file | 1 PR per epic (multi-file) |
426
+ | Persistence | None — re-scans every run | Backlog persisted in `.oac/context/` |
427
+ | Incremental | Full re-scan | Only re-analyzes git-changed files |
428
+
429
+ ---
430
+
431
+ ## Supported AI Agents
432
+
433
+ | Agent | Status | Provider ID |
434
+ |-------|--------|-------------|
435
+ | [Claude Code](https://claude.ai/code) | Supported | `claude-code` |
436
+ | [Codex CLI](https://github.com/openai/codex) | Supported | `codex` |
437
+ | [OpenCode](https://github.com/opencode-ai/opencode) | Planned | `opencode` |
438
+ | Custom | Implement `AgentProvider` interface | any string |
439
+
440
+ ### Adding a Custom Agent
441
+
442
+ ```typescript
443
+ import type { AgentProvider } from '@open330/oac-execution';
444
+
445
+ export class MyAgentAdapter implements AgentProvider {
446
+ readonly id = 'my-agent';
447
+ readonly name = 'My Custom Agent';
448
+
449
+ async checkAvailability() { /* ... */ }
450
+ execute(params) { /* ... */ }
451
+ async estimateTokens(params) { /* ... */ }
452
+ async abort(executionId) { /* ... */ }
453
+ }
454
+ ```
455
+
456
+ ---
457
+
458
+ ## Roadmap
459
+
460
+ - [x] **2026.2.17** — Core engine, CLI, 5 scanners, parallel execution, npm publish
461
+ - [x] **2026.2.18** — Context-first architecture: codebase analyzer, epic grouper, incremental analysis, backlog persistence, enhanced prompts with module context
462
+ - [x] **2026.4.x** — Claude Code + Codex CLI adapters, token usage reporting, auto-detect sourceDir
463
+ - [x] **2026.4.x** — 9-wave quality cycle: performance fixes, UX polish, run module decomposition, shell completion, retry, exit codes, memory monitoring, streaming analysis, config reference docs
464
+ - [ ] **Next** — OpenCode adapter, multi-agent routing, localhost dashboard, daemon mode
465
+ - [ ] **Future** — Linear/Jira webhooks, plugin system, sparse checkout for monorepos
466
+
467
+ ---
468
+
469
+ ## Contributing
470
+
471
+ We welcome contributions! OAC is designed to contribute to repos — and it can contribute to itself too.
472
+
473
+ ```bash
474
+ # Clone and setup
475
+ git clone https://github.com/Open330/open-agent-contribution.git
476
+ cd open-agent-contribution
477
+ pnpm install
478
+ pnpm build
479
+
480
+ # Run tests
481
+ pnpm test
482
+
483
+ # Lint and format
484
+ pnpm lint
485
+ pnpm format
486
+
487
+ # Or just let OAC contribute to itself
488
+ npx @open330/oac run --repo Open330/open-agent-contribution --tokens unlimited
489
+ ```
490
+
491
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
492
+
493
+ ---
494
+
495
+ ## Troubleshooting
496
+
497
+ <details>
498
+ <summary><strong>Agent not found / command not found</strong></summary>
499
+
500
+ OAC dispatches work to external agents (`claude`, `codex`). Make sure the agent CLI is installed and on your `PATH`:
501
+
502
+ ```bash
503
+ # Verify agents are reachable
504
+ oac doctor
505
+
506
+ # Check individual agents
507
+ which claude # Claude Code
508
+ which codex # Codex CLI
509
+ ```
510
+
511
+ If `oac doctor` reports a missing agent, install it following the agent's own documentation, then re-run `oac doctor`.
512
+ </details>
513
+
514
+ <details>
515
+ <summary><strong>Token budget exceeded / nothing was executed</strong></summary>
516
+
517
+ The planner reserves 10% of your budget as a safety margin. If every discovered task exceeds the effective budget, nothing will be selected.
518
+
519
+ ```bash
520
+ # Check what would be selected
521
+ oac run --dry-run --repo owner/repo
522
+
523
+ # Increase the budget
524
+ oac run --tokens 200000 --repo owner/repo
525
+
526
+ # Or set it in oac.config.ts
527
+ export default defineConfig({
528
+ budget: { totalTokens: 200_000 },
529
+ });
530
+ ```
531
+ </details>
532
+
533
+ <details>
534
+ <summary><strong>Config file errors</strong></summary>
535
+
536
+ ```bash
537
+ # Validate your config
538
+ oac doctor
539
+
540
+ # Regenerate a minimal config
541
+ oac init --minimal --repo owner/repo
542
+ ```
543
+
544
+ Common issues:
545
+ - Missing `repos` array — at least one repo is required.
546
+ - Invalid provider ID — must be `"claude-code"` or `"codex"`.
547
+ - `budget.totalTokens` must be a positive number.
548
+
549
+ See [docs/config-reference.md](docs/config-reference.md) for all options.
550
+ </details>
551
+
552
+ <details>
553
+ <summary><strong>Permission denied / GitHub auth errors</strong></summary>
554
+
555
+ OAC uses `gh` (GitHub CLI) for PR creation and issue access. Make sure you're authenticated:
556
+
557
+ ```bash
558
+ gh auth status
559
+ gh auth login # if not authenticated
560
+ ```
561
+
562
+ For private repos, ensure your token has `repo` scope.
563
+ </details>
564
+
565
+ <details>
566
+ <summary><strong>Sandbox / worktree errors</strong></summary>
567
+
568
+ OAC creates git worktrees in a temporary directory for each task. If a previous run crashed, stale worktrees may remain:
569
+
570
+ ```bash
571
+ # List worktrees
572
+ git worktree list
573
+
574
+ # Clean up stale entries
575
+ git worktree prune
576
+ ```
577
+ </details>
578
+
579
+ ---
580
+
581
+ ## Philosophy
582
+
583
+ > **"Don't let your tokens go to waste."**
584
+
585
+ Every month, developers around the world leave millions of AI tokens on the table. OAC turns that idle capacity into real open source contributions — automatically, safely, and transparently.
586
+
587
+ No hosted services. No data collection. No lock-in. Just your machine, your tokens, and your repos.
588
+
589
+ ---
590
+
591
+ <div align="center">
592
+
593
+ **Built with spare tokens by the [Open330](https://github.com/Open330) community.**
594
+
595
+ [Report Bug](https://github.com/Open330/open-agent-contribution/issues) · [Request Feature](https://github.com/Open330/open-agent-contribution/issues) · [Discussions](https://github.com/Open330/open-agent-contribution/discussions)
596
+
597
+ </div>