corbat-coco 0.1.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/LICENSE +21 -0
- package/README.md +381 -0
- package/dist/cli/index.js +4887 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +3185 -0
- package/dist/index.js +8663 -0
- package/dist/index.js.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Corbat
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/assets/logo.svg" alt="Corbat-Coco Logo" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Corbat-Coco</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Autonomous Coding Agent with Self-Review, Quality Convergence, and Production-Ready Output</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://github.com/corbat/corbat-coco/actions/workflows/ci.yml"><img src="https://github.com/corbat/corbat-coco/actions/workflows/ci.yml/badge.svg" alt="CI Status" /></a>
|
|
13
|
+
<a href="https://codecov.io/gh/corbat/corbat-coco"><img src="https://codecov.io/gh/corbat/corbat-coco/branch/main/graph/badge.svg" alt="Coverage" /></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/corbat-coco"><img src="https://img.shields.io/npm/v/corbat-coco.svg" alt="npm version" /></a>
|
|
15
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
|
|
16
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen" alt="Node.js Version" /></a>
|
|
17
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.7+-blue.svg" alt="TypeScript" /></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="#quick-start">Quick Start</a> •
|
|
22
|
+
<a href="#features">Features</a> •
|
|
23
|
+
<a href="#the-coco-methodology">Methodology</a> •
|
|
24
|
+
<a href="#examples">Examples</a> •
|
|
25
|
+
<a href="#documentation">Docs</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What is Corbat-Coco?
|
|
31
|
+
|
|
32
|
+
Corbat-Coco is an **autonomous coding agent** that transforms natural language requirements into production-ready code. Unlike other AI coding tools, it **iteratively improves code until it meets senior-level quality standards**.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
"Every line of code must be worthy of a senior engineer's signature."
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Why Corbat-Coco?
|
|
39
|
+
|
|
40
|
+
| Feature | Cursor/Copilot | Claude Code | **Corbat-Coco** |
|
|
41
|
+
|---------|:--------------:|:-----------:|:---------------:|
|
|
42
|
+
| Generate code | ✅ | ✅ | ✅ |
|
|
43
|
+
| Self-review loops | ❌ | ❌ | ✅ |
|
|
44
|
+
| Quality scoring | ❌ | ❌ | ✅ (11 dimensions) |
|
|
45
|
+
| Architecture planning | Basic | Basic | ✅ Full ADR system |
|
|
46
|
+
| Progress persistence | ❌ | Session | ✅ Checkpoints |
|
|
47
|
+
| Production deployment | ❌ | ❌ | ✅ CI/CD generation |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
### Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Using npm
|
|
57
|
+
npm install -g corbat-coco
|
|
58
|
+
|
|
59
|
+
# Using pnpm (recommended)
|
|
60
|
+
pnpm add -g corbat-coco
|
|
61
|
+
|
|
62
|
+
# Verify installation
|
|
63
|
+
coco --version
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### TL;DR (3 commands)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
coco init my-project # Initialize & describe what you want
|
|
70
|
+
coco plan # Generate architecture & backlog
|
|
71
|
+
coco build # Build with quality iteration
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Example Session
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
$ coco init my-api
|
|
78
|
+
|
|
79
|
+
🚀 Welcome to Corbat-Coco!
|
|
80
|
+
|
|
81
|
+
? What would you like to build?
|
|
82
|
+
> A REST API for task management with user authentication
|
|
83
|
+
|
|
84
|
+
? Tech stack preferences?
|
|
85
|
+
> TypeScript, Express, PostgreSQL, JWT auth
|
|
86
|
+
|
|
87
|
+
📋 Specification generated!
|
|
88
|
+
|
|
89
|
+
$ coco plan
|
|
90
|
+
|
|
91
|
+
📐 Designing architecture...
|
|
92
|
+
✓ ADR-001: Express.js framework
|
|
93
|
+
✓ ADR-002: JWT authentication
|
|
94
|
+
✓ ADR-003: PostgreSQL with Prisma
|
|
95
|
+
|
|
96
|
+
📝 Backlog: 2 epics, 8 stories, 24 tasks
|
|
97
|
+
|
|
98
|
+
$ coco build
|
|
99
|
+
|
|
100
|
+
🔨 Building Sprint 0...
|
|
101
|
+
|
|
102
|
+
Task 1/6: User entity ✓ (3 iterations, score: 92/100)
|
|
103
|
+
Task 2/6: Auth service ✓ (4 iterations, score: 89/100)
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
📊 Sprint Complete!
|
|
107
|
+
├─ Average quality: 90/100
|
|
108
|
+
├─ Test coverage: 87%
|
|
109
|
+
└─ Security issues: 0
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Features
|
|
115
|
+
|
|
116
|
+
### 🔄 Iterative Quality Improvement
|
|
117
|
+
|
|
118
|
+
Code is automatically reviewed and improved until it meets quality standards:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Generate → Test → Review → Improve → Repeat until excellent
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 📊 Multi-Dimensional Quality Scoring
|
|
125
|
+
|
|
126
|
+
11 dimensions measured on every iteration:
|
|
127
|
+
|
|
128
|
+
| Dimension | Weight | Description |
|
|
129
|
+
|-----------|:------:|-------------|
|
|
130
|
+
| Correctness | 15% | Tests pass, logic correct |
|
|
131
|
+
| Completeness | 10% | All requirements met |
|
|
132
|
+
| Robustness | 10% | Edge cases handled |
|
|
133
|
+
| Readability | 10% | Code clarity |
|
|
134
|
+
| Maintainability | 10% | Easy to modify |
|
|
135
|
+
| Complexity | 8% | Cyclomatic complexity |
|
|
136
|
+
| Duplication | 7% | DRY score |
|
|
137
|
+
| Test Coverage | 10% | Line/branch coverage |
|
|
138
|
+
| Test Quality | 5% | Test meaningfulness |
|
|
139
|
+
| Security | 8% | No vulnerabilities |
|
|
140
|
+
| Documentation | 4% | Doc coverage |
|
|
141
|
+
| Style | 3% | Linting compliance |
|
|
142
|
+
|
|
143
|
+
### 💾 Checkpoint & Recovery
|
|
144
|
+
|
|
145
|
+
Never lose progress:
|
|
146
|
+
|
|
147
|
+
- Automatic checkpoints every 5 minutes
|
|
148
|
+
- Resume from any interruption
|
|
149
|
+
- Full version history per task
|
|
150
|
+
- Rollback capability
|
|
151
|
+
|
|
152
|
+
### 🏗️ Architecture Documentation
|
|
153
|
+
|
|
154
|
+
Generated automatically:
|
|
155
|
+
|
|
156
|
+
- Architecture Decision Records (ADRs)
|
|
157
|
+
- System diagrams (C4 model)
|
|
158
|
+
- Backlog with epics, stories, tasks
|
|
159
|
+
- Sprint planning
|
|
160
|
+
|
|
161
|
+
### 🚀 Production Ready
|
|
162
|
+
|
|
163
|
+
Outputs ready for deployment:
|
|
164
|
+
|
|
165
|
+
- Dockerfile & docker-compose.yml
|
|
166
|
+
- GitHub Actions workflows
|
|
167
|
+
- README & API documentation
|
|
168
|
+
- Deployment guides
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## The COCO Methodology
|
|
173
|
+
|
|
174
|
+
Four phases from idea to deployment:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
┌──────────┐ ┌────────────┐ ┌──────────┐ ┌────────┐
|
|
178
|
+
│ CONVERGE │ → │ ORCHESTRATE│ → │ COMPLETE │ → │ OUTPUT │
|
|
179
|
+
└──────────┘ └────────────┘ └──────────┘ └────────┘
|
|
180
|
+
│ │ │ │
|
|
181
|
+
Understand Plan & Execute & Deploy &
|
|
182
|
+
Requirements Design Iterate Document
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
| Phase | Purpose | Output |
|
|
186
|
+
|-------|---------|--------|
|
|
187
|
+
| **Converge** | Understand requirements through Q&A | Specification document |
|
|
188
|
+
| **Orchestrate** | Design architecture, create plan | ADRs, Backlog, Standards |
|
|
189
|
+
| **Complete** | Build with quality iteration | Quality code + tests |
|
|
190
|
+
| **Output** | Prepare for production | CI/CD, Docs, Deployment |
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Commands
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
coco init [path] # Initialize new project
|
|
198
|
+
coco plan # Run discovery and planning
|
|
199
|
+
coco build # Execute tasks with quality iteration
|
|
200
|
+
coco build --sprint=N # Build specific sprint
|
|
201
|
+
coco status # Show current progress
|
|
202
|
+
coco status --verbose # Detailed status
|
|
203
|
+
coco resume # Resume from checkpoint
|
|
204
|
+
coco config set <key> <value> # Configure settings
|
|
205
|
+
coco config get <key> # Get configuration value
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Configuration
|
|
211
|
+
|
|
212
|
+
Configuration is stored in `.coco/config.json`:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"project": {
|
|
217
|
+
"name": "my-project",
|
|
218
|
+
"version": "0.1.0"
|
|
219
|
+
},
|
|
220
|
+
"provider": {
|
|
221
|
+
"type": "anthropic",
|
|
222
|
+
"model": "claude-sonnet-4-20250514"
|
|
223
|
+
},
|
|
224
|
+
"quality": {
|
|
225
|
+
"minScore": 85,
|
|
226
|
+
"minCoverage": 80,
|
|
227
|
+
"maxIterations": 10,
|
|
228
|
+
"convergenceThreshold": 2
|
|
229
|
+
},
|
|
230
|
+
"persistence": {
|
|
231
|
+
"checkpointInterval": 300000,
|
|
232
|
+
"maxCheckpoints": 50
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Quality Thresholds
|
|
238
|
+
|
|
239
|
+
| Setting | Default | Description |
|
|
240
|
+
|---------|:-------:|-------------|
|
|
241
|
+
| `minScore` | 85 | Minimum quality score (0-100) |
|
|
242
|
+
| `minCoverage` | 80 | Minimum test coverage (%) |
|
|
243
|
+
| `maxIterations` | 10 | Max iterations per task |
|
|
244
|
+
| `convergenceThreshold` | 2 | Score delta to consider converged |
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Examples
|
|
249
|
+
|
|
250
|
+
See the [examples/](examples/) directory for complete examples:
|
|
251
|
+
|
|
252
|
+
| Example | Description | Time |
|
|
253
|
+
|---------|-------------|:----:|
|
|
254
|
+
| [REST API (TypeScript)](examples/01-rest-api-typescript/) | Task management API with auth | ~30 min |
|
|
255
|
+
| [CLI Tool](examples/02-cli-tool/) | Image processing CLI | ~25 min |
|
|
256
|
+
| [Spring Boot (Java)](examples/03-java-spring-boot/) | Order management microservice | ~40 min |
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Requirements
|
|
261
|
+
|
|
262
|
+
- **Node.js**: 22.0.0 or higher
|
|
263
|
+
- **Anthropic API Key**: For Claude models
|
|
264
|
+
- **Git**: For version control features
|
|
265
|
+
|
|
266
|
+
### Environment Variables
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
export ANTHROPIC_API_KEY="sk-ant-..." # Required
|
|
270
|
+
export COCO_CONFIG_PATH="..." # Optional: custom config path
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Documentation
|
|
276
|
+
|
|
277
|
+
### Guides
|
|
278
|
+
- [Quick Start Guide](docs/guides/QUICK_START.md) - Get started in 5 minutes
|
|
279
|
+
- [Configuration Guide](docs/guides/CONFIGURATION.md) - Complete configuration reference
|
|
280
|
+
- [Tutorial](docs/guides/AGENT_EVALUATION_AND_TUTORIAL.md) - Detailed tutorial with examples
|
|
281
|
+
- [Troubleshooting](docs/guides/TROUBLESHOOTING.md) - Common issues and solutions
|
|
282
|
+
|
|
283
|
+
### Technical
|
|
284
|
+
- [API Reference](docs/API.md) - Use Corbat-Coco as a library
|
|
285
|
+
- [Architecture](docs/architecture/ARCHITECTURE.md) - System design & C4 diagrams
|
|
286
|
+
- [ADRs](docs/architecture/adrs/) - Architecture Decision Records
|
|
287
|
+
- [Production Readiness](docs/PRODUCTION_READINESS_ASSESSMENT.md) - Assessment & roadmap
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Development
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
# Clone the repository
|
|
295
|
+
git clone https://github.com/corbat/corbat-coco.git
|
|
296
|
+
cd corbat-coco
|
|
297
|
+
|
|
298
|
+
# Install dependencies
|
|
299
|
+
pnpm install
|
|
300
|
+
|
|
301
|
+
# Run in development
|
|
302
|
+
pnpm dev --help
|
|
303
|
+
|
|
304
|
+
# Run tests
|
|
305
|
+
pnpm test
|
|
306
|
+
|
|
307
|
+
# Run all checks
|
|
308
|
+
pnpm check # typecheck + lint + test
|
|
309
|
+
|
|
310
|
+
# Build
|
|
311
|
+
pnpm build
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Contributing
|
|
317
|
+
|
|
318
|
+
Contributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md) first.
|
|
319
|
+
|
|
320
|
+
### Quick Contribution Steps
|
|
321
|
+
|
|
322
|
+
1. Fork the repository
|
|
323
|
+
2. Create a feature branch (`git checkout -b feat/amazing-feature`)
|
|
324
|
+
3. Write tests (80% coverage minimum)
|
|
325
|
+
4. Run checks (`pnpm check`)
|
|
326
|
+
5. Commit with conventional commits
|
|
327
|
+
6. Open a Pull Request
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Troubleshooting
|
|
332
|
+
|
|
333
|
+
### "API key not found"
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### "Quality score not improving"
|
|
340
|
+
|
|
341
|
+
- Check the quality report for specific issues
|
|
342
|
+
- Review suggestions in `.coco/versions/task-XXX/`
|
|
343
|
+
- Consider adjusting `maxIterations`
|
|
344
|
+
|
|
345
|
+
### "Checkpoint recovery failed"
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
coco resume --from-checkpoint=<id>
|
|
349
|
+
# Or start fresh:
|
|
350
|
+
coco build --restart
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
For more help, see [Issues](https://github.com/corbat/corbat-coco/issues).
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Roadmap
|
|
358
|
+
|
|
359
|
+
- [ ] OpenAI provider support
|
|
360
|
+
- [ ] Local model support (Ollama)
|
|
361
|
+
- [ ] VS Code extension
|
|
362
|
+
- [ ] Web dashboard
|
|
363
|
+
- [ ] Team collaboration features
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## License
|
|
368
|
+
|
|
369
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
<p align="center">
|
|
374
|
+
<strong>Built with ❤️ by Corbat</strong>
|
|
375
|
+
</p>
|
|
376
|
+
|
|
377
|
+
<p align="center">
|
|
378
|
+
<a href="https://github.com/corbat/corbat-coco">GitHub</a> •
|
|
379
|
+
<a href="https://github.com/corbat/corbat-coco/issues">Issues</a> •
|
|
380
|
+
<a href="CHANGELOG.md">Changelog</a>
|
|
381
|
+
</p>
|