@corbat-tech/coco 1.0.2 β 1.2.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 +167 -376
- package/dist/cli/index.js +2524 -384
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +10136 -8313
- package/dist/index.js.map +1 -1
- package/package.json +38 -25
package/README.md
CHANGED
|
@@ -1,462 +1,253 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/badge/v1.2.0-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>
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
<h1 align="center">π₯₯ Corbat-Coco</h1>
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[](./)
|
|
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>
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Most AI coding assistants generate code and hope for the best. Coco is different:
|
|
15
|
-
|
|
16
|
-
1. **Generates** code with your favorite LLM (Claude, GPT-4, Gemini)
|
|
17
|
-
2. **Measures** quality with real metrics (coverage, security, complexity)
|
|
18
|
-
3. **Analyzes** test failures to find root causes
|
|
19
|
-
4. **Fixes** issues with targeted changes
|
|
20
|
-
5. **Repeats** until quality reaches 85+ (senior engineer level)
|
|
21
|
-
|
|
22
|
-
All autonomous. All verifiable. All open source.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## The Problem with AI Code Generation
|
|
27
|
-
|
|
28
|
-
Current AI assistants:
|
|
29
|
-
- Generate code that looks good but fails in production
|
|
30
|
-
- Don't run tests or validate output
|
|
31
|
-
- Make you iterate manually
|
|
32
|
-
- Can't coordinate complex tasks
|
|
33
|
-
|
|
34
|
-
**Result**: You spend hours debugging AI-generated code.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## How Coco Solves It
|
|
39
|
-
|
|
40
|
-
### 1. Real Quality Measurement
|
|
41
|
-
|
|
42
|
-
Coco measures 12 dimensions of code quality:
|
|
43
|
-
- **Test Coverage**: Runs your tests with c8/v8 instrumentation (not estimated)
|
|
44
|
-
- **Security**: Scans for vulnerabilities with npm audit + OWASP checks
|
|
45
|
-
- **Complexity**: Calculates cyclomatic complexity from AST
|
|
46
|
-
- **Correctness**: Validates tests pass + builds succeed
|
|
47
|
-
- **Maintainability**: Real metrics from code analysis
|
|
48
|
-
- ... and 7 more
|
|
49
|
-
|
|
50
|
-
**No fake scores. No hardcoded values. Real metrics.**
|
|
51
|
-
|
|
52
|
-
Current state: **58.3% real measurements** (up from 0%), with 41.7% still using safe defaults.
|
|
53
|
-
|
|
54
|
-
### 2. Smart Iteration Loop
|
|
55
|
-
|
|
56
|
-
When tests fail, Coco:
|
|
57
|
-
- Parses stack traces to find the error location
|
|
58
|
-
- Reads surrounding code for context
|
|
59
|
-
- Diagnoses root cause (not just symptoms)
|
|
60
|
-
- Generates targeted fix (not rewriting entire file)
|
|
61
|
-
- Re-validates and repeats if needed
|
|
62
|
-
|
|
63
|
-
**Target**: 70%+ of failures fixed in first iteration.
|
|
64
|
-
|
|
65
|
-
### 3. Multi-Agent Coordination
|
|
66
|
-
|
|
67
|
-
Complex tasks are decomposed and executed by specialized agents:
|
|
68
|
-
- **Researcher**: Explores codebase, finds patterns
|
|
69
|
-
- **Coder**: Writes production code
|
|
70
|
-
- **Tester**: Generates comprehensive tests
|
|
71
|
-
- **Reviewer**: Identifies issues
|
|
72
|
-
- **Optimizer**: Reduces complexity
|
|
73
|
-
|
|
74
|
-
Agents work in parallel where possible, coordinate when needed.
|
|
75
|
-
|
|
76
|
-
### 4. AST-Aware Validation
|
|
77
|
-
|
|
78
|
-
Before saving any file:
|
|
79
|
-
- Parses AST to validate syntax
|
|
80
|
-
- Checks TypeScript semantics
|
|
81
|
-
- Analyzes imports
|
|
82
|
-
- Verifies build succeeds
|
|
83
|
-
|
|
84
|
-
**Result**: Zero broken builds from AI edits.
|
|
85
|
-
|
|
86
|
-
### 5. Production Hardening
|
|
87
|
-
|
|
88
|
-
- **Error Recovery**: Auto-recovers from 8 error types (syntax, timeout, dependencies, etc.)
|
|
89
|
-
- **Checkpoint/Resume**: Ctrl+C saves state, resume anytime
|
|
90
|
-
- **Resource Limits**: Prevents runaway costs with configurable quotas
|
|
91
|
-
- **Streaming Output**: Real-time feedback as code generates
|
|
15
|
+
<p align="center">
|
|
16
|
+
<em>Generate β Test β Measure β Fix β Repeat β autonomously.</em>
|
|
17
|
+
</p>
|
|
92
18
|
|
|
93
19
|
---
|
|
94
20
|
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
### COCO Methodology (4 Phases)
|
|
21
|
+
## Why Coco?
|
|
98
22
|
|
|
99
|
-
|
|
100
|
-
2. **Orchestrate**: Design architecture, create task backlog
|
|
101
|
-
3. **Complete**: Execute tasks with quality iteration
|
|
102
|
-
4. **Output**: Generate CI/CD, docs, deployment config
|
|
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.
|
|
103
24
|
|
|
104
|
-
|
|
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.
|
|
105
26
|
|
|
106
27
|
```
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
28
|
+
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
|
|
29
|
+
β Generate β βββΊ β Test β βββΊ β Measure β βββΊ β Fix β
|
|
30
|
+
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
|
|
31
|
+
β
|
|
32
|
+
Score < 85? β βββΊ Loop back
|
|
33
|
+
Score β₯ 85? β βββΊ Done β
|
|
110
34
|
```
|
|
111
35
|
|
|
112
|
-
|
|
113
|
-
- Quality β₯ 85/100 (minimum)
|
|
114
|
-
- Score stable for 2+ iterations
|
|
115
|
-
- Tests all passing
|
|
116
|
-
- Or max 10 iterations reached
|
|
117
|
-
|
|
118
|
-
### Real Analyzers
|
|
119
|
-
|
|
120
|
-
| Analyzer | What It Measures | Data Source |
|
|
121
|
-
|----------|------------------|-------------|
|
|
122
|
-
| Coverage | Lines, branches, functions, statements | c8/v8 instrumentation |
|
|
123
|
-
| Security | Vulnerabilities, dangerous patterns | npm audit + static analysis |
|
|
124
|
-
| Complexity | Cyclomatic complexity, maintainability | AST traversal |
|
|
125
|
-
| Duplication | Code similarity, redundancy | Token-based comparison |
|
|
126
|
-
| Build | Compilation success | tsc/build execution |
|
|
127
|
-
| Import | Missing dependencies, circular deps | AST + package.json |
|
|
36
|
+
This is the **Quality Convergence Loop** β Coco's core differentiator.
|
|
128
37
|
|
|
129
38
|
---
|
|
130
39
|
|
|
131
40
|
## Quick Start
|
|
132
41
|
|
|
133
|
-
### Installation
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
npm install -g corbat-coco
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Configuration
|
|
140
|
-
|
|
141
42
|
```bash
|
|
142
|
-
coco
|
|
43
|
+
npm install -g @corbat-tech/coco
|
|
44
|
+
coco # Opens interactive REPL β guided setup on first run
|
|
143
45
|
```
|
|
144
46
|
|
|
145
|
-
|
|
146
|
-
- AI Provider (Anthropic, OpenAI, Google)
|
|
147
|
-
- API Key
|
|
148
|
-
- Project preferences
|
|
149
|
-
|
|
150
|
-
### Basic Usage
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
coco "Build a REST API with JWT authentication"
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
That's it. Coco will:
|
|
157
|
-
1. Ask clarifying questions
|
|
158
|
-
2. Design architecture
|
|
159
|
-
3. Generate code + tests
|
|
160
|
-
4. Iterate until quality β₯ 85
|
|
161
|
-
5. Generate CI/CD + docs
|
|
162
|
-
|
|
163
|
-
### Resume Interrupted Session
|
|
47
|
+
That's it. Coco walks you through provider configuration on first launch.
|
|
164
48
|
|
|
165
49
|
```bash
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
### Check Quality of Existing Code
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
coco quality ./src
|
|
50
|
+
# Or use it directly:
|
|
51
|
+
coco "Add a REST API endpoint for user authentication with tests"
|
|
173
52
|
```
|
|
174
53
|
|
|
175
54
|
---
|
|
176
55
|
|
|
177
|
-
##
|
|
56
|
+
## What Coco Does Well
|
|
178
57
|
|
|
179
|
-
###
|
|
58
|
+
### Quality Convergence Loop
|
|
180
59
|
|
|
181
|
-
|
|
60
|
+
Coco doesn't just generate code β it iterates until quality converges:
|
|
182
61
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
62
|
+
| Iteration | Score | What happened |
|
|
63
|
+
|:---------:|:-----:|---------------|
|
|
64
|
+
| 1 | 52 | Code generated β 3 tests failing, no error handling |
|
|
65
|
+
| 2 | 71 | Tests fixed, security vulnerability found |
|
|
66
|
+
| 3 | 84 | Security patched, coverage improved to 82% |
|
|
67
|
+
| 4 | 91 | All green β quality converged β
|
|
|
188
68
|
|
|
189
|
-
|
|
190
|
-
```javascript
|
|
191
|
-
// All hardcoded π±
|
|
192
|
-
dimensions: {
|
|
193
|
-
testCoverage: 80, // Fake
|
|
194
|
-
security: 100, // Fake
|
|
195
|
-
complexity: 90, // Fake
|
|
196
|
-
// ... all fake
|
|
197
|
-
}
|
|
198
|
-
```
|
|
69
|
+
The loop is configurable: target score, max iterations, convergence threshold, security requirements. You control the bar.
|
|
199
70
|
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
// Real measurements β
|
|
203
|
-
const coverage = await this.coverageAnalyzer.analyze(files);
|
|
204
|
-
const security = await this.securityScanner.scan(files);
|
|
205
|
-
const complexity = await this.complexityAnalyzer.analyze(files);
|
|
206
|
-
|
|
207
|
-
dimensions: {
|
|
208
|
-
testCoverage: coverage.lines.percentage, // REAL
|
|
209
|
-
security: security.score, // REAL
|
|
210
|
-
complexity: complexity.score, // REAL
|
|
211
|
-
// ... 7 more real metrics
|
|
212
|
-
}
|
|
213
|
-
```
|
|
71
|
+
### 12-Dimension Quality Scoring
|
|
214
72
|
|
|
215
|
-
|
|
73
|
+
Every iteration measures your code across 12 dimensions using real static analysis:
|
|
216
74
|
|
|
217
|
-
|
|
75
|
+
| Dimension | How it's measured |
|
|
76
|
+
|-----------|-------------------|
|
|
77
|
+
| Test Coverage | c8/v8 instrumentation |
|
|
78
|
+
| Security | Pattern matching + optional Snyk |
|
|
79
|
+
| Complexity | Cyclomatic complexity via AST parsing |
|
|
80
|
+
| Duplication | Line-based similarity detection |
|
|
81
|
+
| Correctness | Test pass rate + build verification |
|
|
82
|
+
| Style | oxlint / eslint / biome integration |
|
|
83
|
+
| Documentation | JSDoc coverage analysis |
|
|
84
|
+
| Readability | AST: naming quality, function length, nesting |
|
|
85
|
+
| Maintainability | AST: file size, coupling, function count |
|
|
86
|
+
| Test Quality | Assertion density, edge case coverage |
|
|
87
|
+
| Completeness | Export density + test file coverage |
|
|
88
|
+
| Robustness | Error handling pattern detection |
|
|
218
89
|
|
|
219
|
-
|
|
220
|
-
β±οΈ Duration: 19.8s
|
|
221
|
-
π Overall Score: 60/100
|
|
222
|
-
π Real Metrics: 7/12 (58.3%)
|
|
223
|
-
π‘οΈ Security: 0 critical issues
|
|
224
|
-
π Complexity: 100/100 (low)
|
|
225
|
-
π Duplication: 72.5/100 (27.5% duplication)
|
|
226
|
-
π Issues Found: 311
|
|
227
|
-
π‘ Suggestions: 3
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
**Validation**: β
Target met (β€42% hardcoded)
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Development Roadmap
|
|
90
|
+
> **Transparency note**: 7 dimensions use instrumented measurements. 5 use heuristic-based static analysis. We label which is which β no black boxes.
|
|
235
91
|
|
|
236
|
-
###
|
|
92
|
+
### Multi-Provider Support
|
|
237
93
|
|
|
238
|
-
|
|
239
|
-
- [x] AST-aware generation pipeline
|
|
240
|
-
- [x] Smart iteration loop
|
|
241
|
-
- [x] Test failure analyzer
|
|
242
|
-
- [x] Build verifier
|
|
243
|
-
- [x] Import analyzer
|
|
94
|
+
Bring your own API keys. Coco works with:
|
|
244
95
|
|
|
245
|
-
|
|
96
|
+
| Provider | Auth | Models |
|
|
97
|
+
|----------|------|--------|
|
|
98
|
+
| **Anthropic** | API key / OAuth PKCE | Claude Opus, Sonnet, Haiku |
|
|
99
|
+
| **OpenAI** | API key | GPT-4o, o1, o3 |
|
|
100
|
+
| **Google** | API key / gcloud ADC | Gemini Pro, Flash |
|
|
101
|
+
| **Ollama** | Local | Any local model |
|
|
102
|
+
| **LM Studio** | Local | Any GGUF model |
|
|
103
|
+
| **Moonshot** | API key | Kimi models |
|
|
246
104
|
|
|
247
|
-
###
|
|
105
|
+
### Multi-Agent Architecture
|
|
248
106
|
|
|
249
|
-
|
|
250
|
-
- [x] Parallel agent coordinator
|
|
251
|
-
- [ ] Agent communication protocol
|
|
252
|
-
- [ ] Semantic code search
|
|
253
|
-
- [ ] Codebase knowledge graph
|
|
254
|
-
- [ ] Smart task decomposition
|
|
255
|
-
- [ ] Adaptive planning
|
|
256
|
-
|
|
257
|
-
**Target Score**: 8.5/10
|
|
258
|
-
|
|
259
|
-
### Phase 3: Excellence (Weeks 9-12) - IN PROGRESS
|
|
260
|
-
|
|
261
|
-
- [x] Error recovery system
|
|
262
|
-
- [x] Progress tracking & interruption
|
|
263
|
-
- [ ] Resource limits & quotas
|
|
264
|
-
- [ ] Multi-language AST support
|
|
265
|
-
- [ ] Framework detection
|
|
266
|
-
- [ ] Interactive dashboard
|
|
267
|
-
- [ ] Streaming output
|
|
268
|
-
- [ ] Performance optimization
|
|
269
|
-
|
|
270
|
-
**Target Score**: 9.0+/10
|
|
271
|
-
|
|
272
|
-
---
|
|
107
|
+
Six specialized agents with weighted-scoring routing:
|
|
273
108
|
|
|
274
|
-
|
|
109
|
+
- **Researcher** β Explores, analyzes, maps the codebase
|
|
110
|
+
- **Coder** β Writes and edits code (default route)
|
|
111
|
+
- **Tester** β Generates tests, improves coverage
|
|
112
|
+
- **Reviewer** β Code review, quality auditing
|
|
113
|
+
- **Optimizer** β Refactoring and performance
|
|
114
|
+
- **Planner** β Architecture design, task decomposition
|
|
275
115
|
|
|
276
|
-
|
|
277
|
-
|---------|--------|-------|------|-------|----------|
|
|
278
|
-
| IDE Integration | β
| β | β
| β | π (planned Q2) |
|
|
279
|
-
| Real Quality Metrics | β | β | β | β
| β
(58% real) |
|
|
280
|
-
| Root Cause Analysis | β | β | β | β
| β
|
|
|
281
|
-
| Multi-Agent | β | β | β | β
| β
|
|
|
282
|
-
| AST Validation | β | β | β | β
| β
|
|
|
283
|
-
| Error Recovery | β | β | β | β
| β
|
|
|
284
|
-
| Checkpoint/Resume | β | β | β | β
| β
|
|
|
285
|
-
| Open Source | β | β
| β | β | β
|
|
|
286
|
-
| Price | $20/mo | Free | $9/mo | $500/mo | **Free** |
|
|
116
|
+
Coco picks the right agent for each task automatically. When confidence is low, it defaults to the coder β no guessing games.
|
|
287
117
|
|
|
288
|
-
|
|
118
|
+
### Interactive REPL
|
|
289
119
|
|
|
290
|
-
|
|
120
|
+
A terminal-first experience with:
|
|
291
121
|
|
|
292
|
-
|
|
122
|
+
- **Ghost-text completion** β Tab to accept inline suggestions
|
|
123
|
+
- **Slash commands** β `/coco`, `/plan`, `/build`, `/diff`, `/commit`, `/help`
|
|
124
|
+
- **Image paste** β `Ctrl+V` to paste screenshots for visual context
|
|
125
|
+
- **Intent recognition** β Natural language mapped to commands
|
|
126
|
+
- **Context management** β Automatic compaction when context grows large
|
|
293
127
|
|
|
294
|
-
|
|
128
|
+
### Production Hardening
|
|
295
129
|
|
|
296
|
-
- **
|
|
297
|
-
- **
|
|
298
|
-
- **
|
|
299
|
-
- **
|
|
300
|
-
- **
|
|
301
|
-
- **Speed**: Iteration takes time. Not for quick edits (use Cursor for that).
|
|
302
|
-
- **Multi-Agent**: Implemented but not yet battle-tested at scale.
|
|
130
|
+
- **Error recovery** with typed error strategies and exponential backoff
|
|
131
|
+
- **Checkpoint/Resume** β `Ctrl+C` saves state, `coco resume` picks up where you left off
|
|
132
|
+
- **AST validation** β Syntax-checks generated code before saving
|
|
133
|
+
- **Convergence analysis** β Detects oscillation, diminishing returns, and stuck patterns
|
|
134
|
+
- **Path sandboxing** β Tools can only access files within the project
|
|
303
135
|
|
|
304
136
|
---
|
|
305
137
|
|
|
306
|
-
##
|
|
307
|
-
|
|
308
|
-
### Stack
|
|
309
|
-
|
|
310
|
-
- **Language**: TypeScript (ESM, strict mode)
|
|
311
|
-
- **Runtime**: Node.js 22+
|
|
312
|
-
- **Package Manager**: pnpm
|
|
313
|
-
- **Testing**: Vitest (3,909 tests)
|
|
314
|
-
- **Linting**: oxlint (fast, minimal config)
|
|
315
|
-
- **Formatting**: oxfmt
|
|
316
|
-
- **Build**: tsup (fast ESM bundler)
|
|
138
|
+
## COCO Methodology
|
|
317
139
|
|
|
318
|
-
|
|
140
|
+
Four phases, each with a dedicated executor:
|
|
319
141
|
|
|
320
142
|
```
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
β
|
|
324
|
-
β
|
|
325
|
-
β
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
β
|
|
330
|
-
β
|
|
331
|
-
|
|
332
|
-
βββ test/
|
|
333
|
-
β βββ e2e/ # End-to-end tests
|
|
334
|
-
β βββ benchmarks/ # Performance benchmarks
|
|
335
|
-
βββ docs/ # Documentation
|
|
143
|
+
CONVERGE ORCHESTRATE COMPLETE OUTPUT
|
|
144
|
+
ββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββ
|
|
145
|
+
β Gather β β Design β β Execute with β β Generate β
|
|
146
|
+
β reqs β βββΊ β architecture ββββΊβ quality ββββΊβ CI/CD, β
|
|
147
|
+
β + spec β β + backlog β β convergence β β docs β
|
|
148
|
+
ββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββ
|
|
149
|
+
β β
|
|
150
|
+
βββββββββββββββ
|
|
151
|
+
β Convergence β
|
|
152
|
+
β Loop β
|
|
153
|
+
βββββββββββββββ
|
|
336
154
|
```
|
|
337
155
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
- **Test Coverage**: 80%+ required
|
|
343
|
-
- **Security**: 100/100 (zero tolerance)
|
|
344
|
-
- **Max Iterations**: 10 per task
|
|
345
|
-
- **Convergence**: Delta < 2 between iterations
|
|
156
|
+
1. **Converge** β Understand what needs to be built. Gather requirements, produce a spec.
|
|
157
|
+
2. **Orchestrate** β Design the architecture, decompose into a task backlog.
|
|
158
|
+
3. **Complete** β Execute each task with the quality convergence loop.
|
|
159
|
+
4. **Output** β Generate CI/CD pipelines, documentation, and deployment config.
|
|
346
160
|
|
|
347
161
|
---
|
|
348
162
|
|
|
349
|
-
##
|
|
163
|
+
## Use Cases
|
|
350
164
|
|
|
351
|
-
Coco is
|
|
352
|
-
|
|
353
|
-
- Feature
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
-
|
|
165
|
+
Coco is designed for developers who want AI assistance with **accountability**:
|
|
166
|
+
|
|
167
|
+
- **Feature development** β Describe what you want, get tested and reviewed code
|
|
168
|
+
- **Vibe coding** β Explore ideas interactively; Coco handles the quality checks
|
|
169
|
+
- **Refactoring** β Point at code and say "make this better" β Coco iterates until metrics improve
|
|
170
|
+
- **Test generation** β Improve coverage with meaningful tests, not boilerplate
|
|
171
|
+
- **Code review** β Get multi-dimensional quality feedback on existing code
|
|
172
|
+
- **Learning** β See how code quality improves across iterations
|
|
357
173
|
|
|
358
|
-
|
|
174
|
+
---
|
|
359
175
|
|
|
360
|
-
|
|
176
|
+
## Development
|
|
361
177
|
|
|
362
178
|
```bash
|
|
363
|
-
# Clone repo
|
|
364
179
|
git clone https://github.com/corbat/corbat-coco
|
|
365
180
|
cd corbat-coco
|
|
366
|
-
|
|
367
|
-
# Install dependencies
|
|
368
181
|
pnpm install
|
|
369
|
-
|
|
370
|
-
#
|
|
371
|
-
pnpm
|
|
372
|
-
|
|
373
|
-
# Run tests
|
|
374
|
-
pnpm test
|
|
375
|
-
|
|
376
|
-
# Run quality benchmark
|
|
377
|
-
pnpm benchmark
|
|
378
|
-
|
|
379
|
-
# Full check (typecheck + lint + test)
|
|
380
|
-
pnpm check
|
|
182
|
+
pnpm dev # Run in dev mode (tsx)
|
|
183
|
+
pnpm test # 4,350+ tests via Vitest
|
|
184
|
+
pnpm check # typecheck + lint + test
|
|
185
|
+
pnpm build # Production build (tsup)
|
|
381
186
|
```
|
|
382
187
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
## FAQ
|
|
386
|
-
|
|
387
|
-
### Q: Is Coco production-ready?
|
|
388
|
-
|
|
389
|
-
**A**: Partially. The quality scoring system (Week 1) is production-ready and thoroughly tested. Multi-agent coordination (Week 5-8) is implemented but needs more real-world validation. Use for internal projects first.
|
|
390
|
-
|
|
391
|
-
### Q: How does Coco compare to Devin?
|
|
392
|
-
|
|
393
|
-
**A**: Similar approach (autonomous iteration, quality metrics, multi-agent), but Coco is:
|
|
394
|
-
- **Open source** (vs closed)
|
|
395
|
-
- **Bring your own API keys** (vs $500/mo subscription)
|
|
396
|
-
- **More transparent** (you can inspect every metric)
|
|
397
|
-
- **Earlier stage** (Devin has 2+ years of production usage)
|
|
398
|
-
|
|
399
|
-
### Q: Why are 41.7% of metrics still hardcoded?
|
|
400
|
-
|
|
401
|
-
**A**: These are **safe defaults**, not fake metrics:
|
|
402
|
-
- `style: 100` when no linter is configured (legitimate default)
|
|
403
|
-
- `correctness`, `completeness`, `robustness`, `testQuality`, `documentation` are pending Week 2-4 implementations
|
|
404
|
-
|
|
405
|
-
We're committed to reaching **0% hardcoded** by end of Phase 1 (Week 4).
|
|
406
|
-
|
|
407
|
-
### Q: Can I use this with my company's code?
|
|
408
|
-
|
|
409
|
-
**A**: Yes, but:
|
|
410
|
-
- Code stays on your machine (not sent to third parties)
|
|
411
|
-
- LLM calls go to your chosen provider (Anthropic/OpenAI/Google)
|
|
412
|
-
- Review generated code before committing
|
|
413
|
-
- Start with non-critical projects
|
|
414
|
-
|
|
415
|
-
### Q: Does Coco replace human developers?
|
|
188
|
+
### Project Structure
|
|
416
189
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
-
|
|
420
|
-
|
|
421
|
-
|
|
190
|
+
```
|
|
191
|
+
src/
|
|
192
|
+
βββ agents/ # Multi-agent coordination + weighted routing
|
|
193
|
+
βββ cli/ # REPL, commands, input handling, output rendering
|
|
194
|
+
βββ orchestrator/ # Phase coordinator + state recovery
|
|
195
|
+
βββ phases/ # COCO phases (converge/orchestrate/complete/output)
|
|
196
|
+
βββ quality/ # 12 quality analyzers + convergence engine
|
|
197
|
+
βββ providers/ # 6 LLM providers + OAuth flows
|
|
198
|
+
βββ tools/ # 20+ tool implementations
|
|
199
|
+
βββ hooks/ # Lifecycle hooks (safety, lint, format, audit)
|
|
200
|
+
βββ mcp/ # MCP server for external integration
|
|
201
|
+
βββ config/ # Zod-validated configuration system
|
|
202
|
+
```
|
|
422
203
|
|
|
423
|
-
###
|
|
204
|
+
### Technology Stack
|
|
424
205
|
|
|
425
|
-
|
|
206
|
+
| Component | Technology |
|
|
207
|
+
|-----------|-----------|
|
|
208
|
+
| Language | TypeScript (ESM, strict mode) |
|
|
209
|
+
| Runtime | Node.js 22+ |
|
|
210
|
+
| Testing | Vitest (4,350+ tests) |
|
|
211
|
+
| Linting | oxlint |
|
|
212
|
+
| Formatting | oxfmt |
|
|
213
|
+
| Build | tsup |
|
|
214
|
+
| Schema validation | Zod |
|
|
426
215
|
|
|
427
216
|
---
|
|
428
217
|
|
|
429
|
-
##
|
|
218
|
+
## Known Limitations
|
|
430
219
|
|
|
431
|
-
|
|
220
|
+
We'd rather you know upfront:
|
|
432
221
|
|
|
433
|
-
|
|
222
|
+
- **TypeScript/JavaScript first** β Other languages have basic support but fewer analyzers
|
|
223
|
+
- **CLI-only** β No IDE extension yet (VS Code integration is planned)
|
|
224
|
+
- **Iteration takes time** β The convergence loop adds 2-5 minutes per task. For quick one-line fixes, a simpler tool may be faster
|
|
225
|
+
- **Heuristic analyzers** β 5 of 12 quality dimensions use pattern-based heuristics, not deep semantic analysis
|
|
226
|
+
- **LLM-dependent** β Output quality depends on the model you connect. Larger models produce better results
|
|
227
|
+
- **Early stage** β Actively developed. Not yet battle-tested at large enterprise scale
|
|
434
228
|
|
|
435
|
-
|
|
229
|
+
---
|
|
436
230
|
|
|
437
|
-
|
|
438
|
-
- TypeScript + Node.js
|
|
439
|
-
- Anthropic Claude, OpenAI GPT-4, Google Gemini
|
|
440
|
-
- Vitest, oxc, tree-sitter, c8
|
|
231
|
+
## Contributing
|
|
441
232
|
|
|
442
|
-
|
|
233
|
+
We welcome contributions of all kinds:
|
|
443
234
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
235
|
+
- Bug reports and feature requests
|
|
236
|
+
- New quality analyzers
|
|
237
|
+
- Additional LLM provider integrations
|
|
238
|
+
- Documentation and examples
|
|
239
|
+
- Real-world usage feedback
|
|
447
240
|
|
|
448
|
-
|
|
449
|
-
- **Documentation**: [docs.corbat.dev](https://docs.corbat.dev)
|
|
450
|
-
- **Roadmap**: [IMPROVEMENT_ROADMAP_2026.md](./IMPROVEMENT_ROADMAP_2026.md)
|
|
451
|
-
- **Week 1 Report**: [WEEK_1_COMPLETE.md](./WEEK_1_COMPLETE.md)
|
|
452
|
-
- **Discord**: [discord.gg/corbat](https://discord.gg/corbat) (coming soon)
|
|
241
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
453
242
|
|
|
454
243
|
---
|
|
455
244
|
|
|
456
|
-
|
|
245
|
+
## About
|
|
457
246
|
|
|
458
|
-
|
|
247
|
+
Corbat-Coco is built by [Corbat](https://corbat.tech), a technology consultancy that believes AI coding tools should be transparent, measurable, and open source.
|
|
459
248
|
|
|
460
|
-
|
|
249
|
+
<p align="center">
|
|
250
|
+
<a href="https://github.com/corbat/corbat-coco">GitHub</a> Β· <a href="https://corbat.tech">corbat.tech</a>
|
|
251
|
+
</p>
|
|
461
252
|
|
|
462
|
-
|
|
253
|
+
<p align="center"><strong>MIT License</strong> Β· Made by developers who measure before they ship. π₯₯</p>
|