@corbat-tech/coco 1.3.0 β 1.4.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 +176 -201
- package/README.old.md +310 -0
- package/dist/cli/index.js +1141 -977
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/README.old.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/badge/v1.2.3-stable-blueviolet?style=for-the-badge" alt="Version">
|
|
3
|
+
<img src="https://img.shields.io/badge/TypeScript-5.7-3178c6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript">
|
|
4
|
+
<img src="https://img.shields.io/badge/Node.js-22+-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="Node.js">
|
|
5
|
+
<img src="https://img.shields.io/badge/License-MIT-f5c542?style=for-the-badge" alt="MIT License">
|
|
6
|
+
<img src="https://img.shields.io/badge/Tests-4350%2B_passing-22c55e?style=for-the-badge" alt="Tests">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<h1 align="center">π₯₯ Corbat-Coco</h1>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>The open-source coding agent that iterates on your code until it's actually production-ready.</strong>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<em>Generate β Test β Measure β Fix β Repeat β autonomously.</em>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Why Coco?
|
|
22
|
+
|
|
23
|
+
Most AI coding tools generate code and hand it to you. If something breaks β tests fail, types don't match, a security issue slips in β that's your problem.
|
|
24
|
+
|
|
25
|
+
Coco takes a different approach. After generating code, it **runs your tests, measures quality across 12 dimensions, diagnoses what's wrong, and fixes it** β in a loop, autonomously β until the code actually meets a quality bar you define.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
|
|
29
|
+
β Generate β βββΊ β Test β βββΊ β Measure β βββΊ β Fix β
|
|
30
|
+
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
|
|
31
|
+
β
|
|
32
|
+
Score < 85? β βββΊ Loop back
|
|
33
|
+
Score β₯ 85? β βββΊ Done β
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This is the **Quality Convergence Loop** β Coco's core differentiator.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @corbat-tech/coco
|
|
44
|
+
coco # Opens interactive REPL β guided setup on first run
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That's it. Coco walks you through provider configuration on first launch.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Or use it directly:
|
|
51
|
+
coco "Add a REST API endpoint for user authentication with tests"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## What You Can Do
|
|
57
|
+
|
|
58
|
+
Coco works from the interactive REPL (`coco`). You can use **slash commands** or just **talk naturally** β Coco understands both.
|
|
59
|
+
|
|
60
|
+
### Slash Commands
|
|
61
|
+
|
|
62
|
+
| Command | What it does | Example |
|
|
63
|
+
|---------|-------------|---------|
|
|
64
|
+
| `/help` | Show available commands and usage | `/help review` |
|
|
65
|
+
| `/status` | Project status, git info, session stats | `/status` |
|
|
66
|
+
| `/review` | Code review with severity-rated findings | `/review --base main` |
|
|
67
|
+
| `/diff` | Visual diff with syntax highlighting | `/diff --staged` |
|
|
68
|
+
| `/ship` | Full release pipeline: review β test β lint β branch β version β commit β PR β CI β merge | `/ship --minor` |
|
|
69
|
+
| `/compact` | Reduce context when conversation gets long | `/compact` |
|
|
70
|
+
| `/clear` | Clear conversation history | `/clear` |
|
|
71
|
+
|
|
72
|
+
### Natural Language
|
|
73
|
+
|
|
74
|
+
You don't need to memorize commands. Just describe what you want:
|
|
75
|
+
|
|
76
|
+
| What you say | What happens |
|
|
77
|
+
|-------------|-------------|
|
|
78
|
+
| "review the code" / "revisa el cΓ³digo" | Runs `/review` |
|
|
79
|
+
| "let's ship it" / "publica los cambios" | Runs `/ship` |
|
|
80
|
+
| "how are we doing?" / "cΓ³mo va?" | Runs `/status` |
|
|
81
|
+
| "create a PR" / "crea un pull request" | Runs `/ship` |
|
|
82
|
+
| "show me the diff" / "muΓ©strame los cambios" | Runs `/diff` |
|
|
83
|
+
| "help" / "ayuda" | Runs `/help` |
|
|
84
|
+
|
|
85
|
+
### `/ship` β Release Pipeline
|
|
86
|
+
|
|
87
|
+
The most powerful command. Orchestrates the entire release flow in one step:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
/ship # Full pipeline (10 steps)
|
|
91
|
+
/ship --skip-tests # Skip test step
|
|
92
|
+
/ship --draft # Create draft PR
|
|
93
|
+
/ship --patch # Force patch version bump
|
|
94
|
+
/ship --minor # Force minor version bump
|
|
95
|
+
/ship --major # Force major version bump
|
|
96
|
+
/ship --no-version # Skip version bumping
|
|
97
|
+
/ship -m "feat: add auth" # Pre-set commit message
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Pipeline: **Preflight β Review β Tests β Lint β Branch β Version β Commit β PR β CI β Merge & Release**
|
|
101
|
+
|
|
102
|
+
Each step is interactive β Coco asks before proceeding when decisions are needed. Press `Ctrl+C` at any point to cancel safely.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## What Coco Does Well
|
|
107
|
+
|
|
108
|
+
### Quality Convergence Loop
|
|
109
|
+
|
|
110
|
+
Coco doesn't just generate code β it iterates until quality converges:
|
|
111
|
+
|
|
112
|
+
| Iteration | Score | What happened |
|
|
113
|
+
|:---------:|:-----:|---------------|
|
|
114
|
+
| 1 | 52 | Code generated β 3 tests failing, no error handling |
|
|
115
|
+
| 2 | 71 | Tests fixed, security vulnerability found |
|
|
116
|
+
| 3 | 84 | Security patched, coverage improved to 82% |
|
|
117
|
+
| 4 | 91 | All green β quality converged β
|
|
|
118
|
+
|
|
119
|
+
The quality bar is yours to set:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
coco build --min-quality 90 # Per-run override
|
|
123
|
+
coco config set quality.minScore 90 # Persist in project config
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Default is **85** (senior-level). You can also configure max iterations, convergence threshold, coverage targets, and security requirements β see `coco config init`.
|
|
127
|
+
|
|
128
|
+
### 12-Dimension Quality Scoring
|
|
129
|
+
|
|
130
|
+
Every iteration measures your code across 12 dimensions using real static analysis:
|
|
131
|
+
|
|
132
|
+
| Dimension | How it's measured |
|
|
133
|
+
|-----------|-------------------|
|
|
134
|
+
| Test Coverage | c8/v8 instrumentation |
|
|
135
|
+
| Security | Pattern matching + optional Snyk |
|
|
136
|
+
| Complexity | Cyclomatic complexity via AST parsing |
|
|
137
|
+
| Duplication | Line-based similarity detection |
|
|
138
|
+
| Correctness | Test pass rate + build verification |
|
|
139
|
+
| Style | oxlint / eslint / biome integration |
|
|
140
|
+
| Documentation | JSDoc coverage analysis |
|
|
141
|
+
| Readability | AST: naming quality, function length, nesting |
|
|
142
|
+
| Maintainability | AST: file size, coupling, function count |
|
|
143
|
+
| Test Quality | Assertion density, edge case coverage |
|
|
144
|
+
| Completeness | Export density + test file coverage |
|
|
145
|
+
| Robustness | Error handling pattern detection |
|
|
146
|
+
|
|
147
|
+
> **Transparency note**: 7 dimensions use instrumented measurements. 5 use heuristic-based static analysis. We label which is which β no black boxes.
|
|
148
|
+
|
|
149
|
+
### Multi-Provider Support
|
|
150
|
+
|
|
151
|
+
Bring your own API keys. Coco works with:
|
|
152
|
+
|
|
153
|
+
| Provider | Auth | Models |
|
|
154
|
+
|----------|------|--------|
|
|
155
|
+
| **Anthropic** | API key / OAuth PKCE | Claude Opus, Sonnet, Haiku |
|
|
156
|
+
| **OpenAI** | API key | GPT-5.3 Codex, GPT-4.1, o4-mini |
|
|
157
|
+
| **Google** | API key / gcloud ADC | Gemini 3, 2.5 Pro/Flash |
|
|
158
|
+
| **Ollama** | Local | Any local model (8-24GB RAM) |
|
|
159
|
+
| **LM Studio** | Local | Any GGUF model (8-32GB RAM) |
|
|
160
|
+
| **Moonshot** | API key | Kimi models |
|
|
161
|
+
|
|
162
|
+
### Multi-Agent Architecture
|
|
163
|
+
|
|
164
|
+
Six specialized agents with weighted-scoring routing:
|
|
165
|
+
|
|
166
|
+
- **Researcher** β Explores, analyzes, maps the codebase
|
|
167
|
+
- **Coder** β Writes and edits code (default route)
|
|
168
|
+
- **Tester** β Generates tests, improves coverage
|
|
169
|
+
- **Reviewer** β Code review, quality auditing
|
|
170
|
+
- **Optimizer** β Refactoring and performance
|
|
171
|
+
- **Planner** β Architecture design, task decomposition
|
|
172
|
+
|
|
173
|
+
Coco picks the right agent for each task automatically. When confidence is low, it defaults to the coder β no guessing games.
|
|
174
|
+
|
|
175
|
+
### Interactive REPL
|
|
176
|
+
|
|
177
|
+
A terminal-first experience with:
|
|
178
|
+
|
|
179
|
+
- **Ghost-text completion** β Tab to accept inline suggestions
|
|
180
|
+
- **Slash commands** β `/ship`, `/review`, `/diff`, `/status`, `/help`, `/compact`, `/clear`
|
|
181
|
+
- **Image paste** β `Ctrl+V` to paste screenshots for visual context
|
|
182
|
+
- **Intent recognition** β Natural language mapped to commands
|
|
183
|
+
- **Context management** β Automatic compaction when context grows large
|
|
184
|
+
|
|
185
|
+
### Production Hardening
|
|
186
|
+
|
|
187
|
+
- **Error recovery** with typed error strategies and exponential backoff
|
|
188
|
+
- **Checkpoint/Resume** β `Ctrl+C` saves state, `coco resume` picks up where you left off
|
|
189
|
+
- **AST validation** β Syntax-checks generated code before saving
|
|
190
|
+
- **Convergence analysis** β Detects oscillation, diminishing returns, and stuck patterns
|
|
191
|
+
- **Path sandboxing** β Tools can only access files within the project
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## COCO Methodology
|
|
196
|
+
|
|
197
|
+
Four phases, each with a dedicated executor:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
CONVERGE ORCHESTRATE COMPLETE OUTPUT
|
|
201
|
+
ββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββ
|
|
202
|
+
β Gather β β Design β β Execute with β β Generate β
|
|
203
|
+
β reqs β βββΊ β architecture ββββΊβ quality ββββΊβ CI/CD, β
|
|
204
|
+
β + spec β β + backlog β β convergence β β docs β
|
|
205
|
+
ββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββ
|
|
206
|
+
β β
|
|
207
|
+
βββββββββββββββ
|
|
208
|
+
β Convergence β
|
|
209
|
+
β Loop β
|
|
210
|
+
βββββββββββββββ
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
1. **Converge** β Understand what needs to be built. Gather requirements, produce a spec.
|
|
214
|
+
2. **Orchestrate** β Design the architecture, decompose into a task backlog.
|
|
215
|
+
3. **Complete** β Execute each task with the quality convergence loop.
|
|
216
|
+
4. **Output** β Generate CI/CD pipelines, documentation, and deployment config.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Use Cases
|
|
221
|
+
|
|
222
|
+
Coco is designed for developers who want AI assistance with **accountability**:
|
|
223
|
+
|
|
224
|
+
- **Feature development** β Describe what you want, get tested and reviewed code
|
|
225
|
+
- **Vibe coding** β Explore ideas interactively; Coco handles the quality checks
|
|
226
|
+
- **Refactoring** β Point at code and say "make this better" β Coco iterates until metrics improve
|
|
227
|
+
- **Test generation** β Improve coverage with meaningful tests, not boilerplate
|
|
228
|
+
- **Code review** β Get multi-dimensional quality feedback on existing code
|
|
229
|
+
- **Learning** β See how code quality improves across iterations
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Development
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git clone https://github.com/corbat/corbat-coco
|
|
237
|
+
cd corbat-coco
|
|
238
|
+
pnpm install
|
|
239
|
+
pnpm dev # Run in dev mode (tsx)
|
|
240
|
+
pnpm test # 4,350+ tests via Vitest
|
|
241
|
+
pnpm check # typecheck + lint + test
|
|
242
|
+
pnpm build # Production build (tsup)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Project Structure
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
src/
|
|
249
|
+
βββ agents/ # Multi-agent coordination + weighted routing
|
|
250
|
+
βββ cli/ # REPL, commands, input handling, output rendering
|
|
251
|
+
βββ orchestrator/ # Phase coordinator + state recovery
|
|
252
|
+
βββ phases/ # COCO phases (converge/orchestrate/complete/output)
|
|
253
|
+
βββ quality/ # 12 quality analyzers + convergence engine
|
|
254
|
+
βββ providers/ # 7 LLM providers + OAuth flows
|
|
255
|
+
βββ tools/ # 20+ tool implementations
|
|
256
|
+
βββ hooks/ # Lifecycle hooks (safety, lint, format, audit)
|
|
257
|
+
βββ mcp/ # MCP server for external integration
|
|
258
|
+
βββ config/ # Zod-validated configuration system
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Technology Stack
|
|
262
|
+
|
|
263
|
+
| Component | Technology |
|
|
264
|
+
|-----------|-----------|
|
|
265
|
+
| Language | TypeScript (ESM, strict mode) |
|
|
266
|
+
| Runtime | Node.js 22+ |
|
|
267
|
+
| Testing | Vitest (4,350+ tests) |
|
|
268
|
+
| Linting | oxlint |
|
|
269
|
+
| Formatting | oxfmt |
|
|
270
|
+
| Build | tsup |
|
|
271
|
+
| Schema validation | Zod |
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Known Limitations
|
|
276
|
+
|
|
277
|
+
We'd rather you know upfront:
|
|
278
|
+
|
|
279
|
+
- **TypeScript/JavaScript first** β Other languages have basic support but fewer analyzers
|
|
280
|
+
- **CLI-only** β No IDE extension yet (VS Code integration is planned)
|
|
281
|
+
- **Iteration takes time** β The convergence loop adds 2-5 minutes per task. For quick one-line fixes, a simpler tool may be faster
|
|
282
|
+
- **Heuristic analyzers** β 5 of 12 quality dimensions use pattern-based heuristics, not deep semantic analysis
|
|
283
|
+
- **LLM-dependent** β Output quality depends on the model you connect. Larger models produce better results
|
|
284
|
+
- **Early stage** β Actively developed. Not yet battle-tested at large enterprise scale
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Contributing
|
|
289
|
+
|
|
290
|
+
We welcome contributions of all kinds:
|
|
291
|
+
|
|
292
|
+
- Bug reports and feature requests
|
|
293
|
+
- New quality analyzers
|
|
294
|
+
- Additional LLM provider integrations
|
|
295
|
+
- Documentation and examples
|
|
296
|
+
- Real-world usage feedback
|
|
297
|
+
|
|
298
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## About
|
|
303
|
+
|
|
304
|
+
Corbat-Coco is built by [Corbat](https://corbat.tech), a technology consultancy that believes AI coding tools should be transparent, measurable, and open source.
|
|
305
|
+
|
|
306
|
+
<p align="center">
|
|
307
|
+
<a href="https://github.com/corbat/corbat-coco">GitHub</a> Β· <a href="https://corbat.tech">corbat.tech</a>
|
|
308
|
+
</p>
|
|
309
|
+
|
|
310
|
+
<p align="center"><strong>MIT License</strong> Β· Made by developers who measure before they ship. π₯₯</p>
|