@kody-ade/kody-engine-lite 0.1.29 → 0.1.31
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 +127 -94
- package/dist/bin/cli.js +25 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,130 +1,163 @@
|
|
|
1
1
|
# Kody Engine Lite
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Kody is a 7-stage autonomous SDLC pipeline that runs in GitHub Actions. It uses Claude Code (or any LLM via LiteLLM) to turn issues into production-ready PRs — with quality gates, AI-powered failure diagnosis, risk-based human approval, and self-improving memory.
|
|
6
|
-
|
|
7
|
-
## Pipeline
|
|
3
|
+
[](https://www.npmjs.com/package/@kody-ade/kody-engine-lite)
|
|
4
|
+
[](LICENSE)
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
┌─────────────────────────────────────────────────────────┐
|
|
11
|
-
│ @kody on issue │
|
|
12
|
-
└────────────────────────┬────────────────────────────────┘
|
|
13
|
-
│
|
|
14
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
15
|
-
│ ① TASKIFY │
|
|
16
|
-
│ Classify task, detect complexity, ask questions │
|
|
17
|
-
│ Model: haiku │ Output: task.json │
|
|
18
|
-
└────────────────────────┬────────────────────────────────┘
|
|
19
|
-
│
|
|
20
|
-
┌────────────▼────────────┐
|
|
21
|
-
│ LOW? skip to ④ │
|
|
22
|
-
│ MEDIUM? continue │
|
|
23
|
-
│ HIGH? continue │
|
|
24
|
-
└────────────┬────────────┘
|
|
25
|
-
│
|
|
26
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
27
|
-
│ ② PLAN │
|
|
28
|
-
│ TDD implementation plan (deep reasoning) │
|
|
29
|
-
│ Model: opus │ Output: plan.md │
|
|
30
|
-
└────────────────────────┬────────────────────────────────┘
|
|
31
|
-
│
|
|
32
|
-
┌────────────▼────────────┐
|
|
33
|
-
│ HIGH risk? │
|
|
34
|
-
│ 🛑 Pause for approval │──── @kody approve
|
|
35
|
-
└────────────┬────────────┘
|
|
36
|
-
│
|
|
37
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
38
|
-
│ ③ BUILD │
|
|
39
|
-
│ Implement code via Claude Code tools │
|
|
40
|
-
│ Model: sonnet │ Output: code changes + git commit │
|
|
41
|
-
└────────────────────────┬────────────────────────────────┘
|
|
42
|
-
│
|
|
43
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
44
|
-
│ ④ VERIFY │
|
|
45
|
-
│ typecheck + tests + lint │
|
|
46
|
-
│ ┌──────────────────────────────────────────────┐ │
|
|
47
|
-
│ │ Fail? → AI diagnosis → autofix → retry ×2 │ │
|
|
48
|
-
│ └──────────────────────────────────────────────┘ │
|
|
49
|
-
└────────────────────────┬────────────────────────────────┘
|
|
50
|
-
│
|
|
51
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
52
|
-
│ ⑤ REVIEW │
|
|
53
|
-
│ Code review: PASS/FAIL + Critical/Major/Minor │
|
|
54
|
-
│ Model: opus │ Output: review.md │
|
|
55
|
-
└────────────────────────┬────────────────────────────────┘
|
|
56
|
-
│
|
|
57
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
58
|
-
│ ⑥ REVIEW-FIX │
|
|
59
|
-
│ Fix Critical and Major findings │
|
|
60
|
-
│ Model: sonnet │ Output: code changes + git commit │
|
|
61
|
-
└────────────────────────┬────────────────────────────────┘
|
|
62
|
-
│
|
|
63
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
64
|
-
│ ⑦ SHIP │
|
|
65
|
-
│ Push branch + create PR with Closes #N │
|
|
66
|
-
│ Output: ship.md + PR link │
|
|
67
|
-
└────────────────────────┬────────────────────────────────┘
|
|
68
|
-
│
|
|
69
|
-
┌────────────────────────▼────────────────────────────────┐
|
|
70
|
-
│ ✅ PR created & ready for review │
|
|
71
|
-
└─────────────────────────────────────────────────────────┘
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Each stage runs in a **fresh context window** with **accumulated context** from previous stages — so complex tasks (auth systems, CRUD features, API clients) don't lose track of earlier decisions.
|
|
6
|
+
**Issue → PR in one command.** Comment `@kody` on a GitHub issue and Kody autonomously classifies, plans, builds, tests, reviews, fixes, and ships a pull request.
|
|
75
7
|
|
|
76
|
-
|
|
8
|
+
Kody is a 7-stage autonomous SDLC pipeline that runs in GitHub Actions. It uses Claude Code (or any LLM via LiteLLM) to turn issues into production-ready PRs — with quality gates, AI-powered failure diagnosis, risk-based human approval, and shared context between stages.
|
|
77
9
|
|
|
78
10
|
## Why Kody?
|
|
79
11
|
|
|
80
|
-
Most AI coding tools are **autocomplete** (Copilot) or **chat-based** (Cursor, Cline). You still drive. Kody is
|
|
12
|
+
Most AI coding tools are **autocomplete** (Copilot) or **chat-based** (Cursor, Cline). You still drive. Kody is an **autonomous pipeline** — comment `@kody`, walk away, come back to a PR.
|
|
81
13
|
|
|
82
14
|
| | Kody | Copilot Workspace | Devin | Cursor Agent |
|
|
83
15
|
|---|---|---|---|---|
|
|
84
16
|
| **Runs in CI** | GitHub Actions | GitHub Cloud | Devin Cloud | Local IDE |
|
|
85
|
-
| **Fire and forget** |
|
|
86
|
-
| **
|
|
17
|
+
| **Fire and forget** | Yes | No — interactive | Partially | No — IDE must be open |
|
|
18
|
+
| **Pipeline stages** | 7 stages with quality gates | Plan → implement | Single agent | Single agent |
|
|
19
|
+
| **Shared sessions** | Stages share Claude Code sessions (no cold starts) | Single conversation | Single conversation | Single conversation |
|
|
87
20
|
| **Risk gate** | Pauses HIGH-risk for human approval | No | No | No |
|
|
21
|
+
| **AI failure diagnosis** | Classifies errors before retry (fixable/infra/abort) | No | No | No |
|
|
88
22
|
| **Model flexible** | Any LLM via LiteLLM | GitHub models only | Proprietary | Cursor models |
|
|
89
23
|
| **Open source** | MIT | Proprietary | Proprietary | Proprietary |
|
|
90
|
-
| **Accumulated context** | Curated context flows between stages | Single bloated conversation | Single agent | Single agent |
|
|
91
|
-
| **Complex tasks** | Full auth system: 7 stages + 3 autofix retries | Struggles with large scope | Better | Struggles with large scope |
|
|
92
24
|
| **Cost** | Your API costs only | $10-39/month | $20-500/month | Subscription |
|
|
93
25
|
|
|
94
26
|
[Full comparison →](docs/COMPARISON.md)
|
|
95
27
|
|
|
28
|
+
## Pipeline
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
32
|
+
│ @kody on issue │
|
|
33
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
34
|
+
│
|
|
35
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
36
|
+
│ ① TASKIFY Tier: cheap │
|
|
37
|
+
│ Classify task, detect complexity, ask questions → task.json │
|
|
38
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
39
|
+
│
|
|
40
|
+
┌────────────▼────────────┐
|
|
41
|
+
│ LOW? skip to ④ │
|
|
42
|
+
│ MEDIUM? continue │
|
|
43
|
+
│ HIGH? continue │
|
|
44
|
+
└────────────┬────────────┘
|
|
45
|
+
│
|
|
46
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
47
|
+
│ ② PLAN Tier: strong │
|
|
48
|
+
│ TDD implementation plan (deep reasoning) → plan.md │
|
|
49
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
50
|
+
│
|
|
51
|
+
┌────────────▼────────────┐
|
|
52
|
+
│ HIGH risk? │
|
|
53
|
+
│ 🛑 Pause for approval │──── @kody approve
|
|
54
|
+
└────────────┬────────────┘
|
|
55
|
+
│
|
|
56
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
57
|
+
│ ③ BUILD Tier: mid │
|
|
58
|
+
│ Implement code via Claude Code tools → code + git commit│
|
|
59
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
60
|
+
│
|
|
61
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
62
|
+
│ ④ VERIFY (deterministic gate) │
|
|
63
|
+
│ typecheck + tests + lint │
|
|
64
|
+
│ ┌───────────────────────────────────────────────────┐ │
|
|
65
|
+
│ │ Fail? → AI diagnosis → autofix → retry (up to 2) │ │
|
|
66
|
+
│ └───────────────────────────────────────────────────┘ │
|
|
67
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
68
|
+
│
|
|
69
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
70
|
+
│ ⑤ REVIEW Tier: strong │
|
|
71
|
+
│ Code review: PASS/FAIL + Critical/Major/Minor → review.md │
|
|
72
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
73
|
+
│
|
|
74
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
75
|
+
│ ⑥ REVIEW-FIX Tier: mid │
|
|
76
|
+
│ Fix Critical and Major findings → code + commit│
|
|
77
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
78
|
+
│
|
|
79
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
80
|
+
│ ⑦ SHIP (deterministic) │
|
|
81
|
+
│ Push branch + create PR with Closes #N → ship.md + PR│
|
|
82
|
+
└──────────────────────────┬──────────────────────────────────┘
|
|
83
|
+
│
|
|
84
|
+
┌──────────────────────────▼──────────────────────────────────┐
|
|
85
|
+
│ ✅ PR created & ready for review │
|
|
86
|
+
└─────────────────────────────────────────────────────────────┘
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Tiers are configurable** — cheap/mid/strong map to any model via `modelMap` in config. Defaults: haiku/sonnet/opus. Route to MiniMax, GPT, Gemini, or local models via [LiteLLM](docs/LITELLM.md).
|
|
90
|
+
|
|
91
|
+
**Shared sessions** — stages in the same group share a Claude Code session: taskify+plan (explore), build+autofix+review-fix (implementation), review (fresh perspective). No cold-start re-exploration between stages.
|
|
92
|
+
|
|
93
|
+
[Pipeline details →](docs/PIPELINE.md)
|
|
94
|
+
|
|
96
95
|
## Quick Start
|
|
97
96
|
|
|
97
|
+
**Prerequisites:** Node.js >= 22, [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code), [GitHub CLI](https://cli.github.com/), git
|
|
98
|
+
|
|
99
|
+
### 1. Install
|
|
100
|
+
|
|
98
101
|
```bash
|
|
99
|
-
# 1. Install
|
|
100
102
|
npm install -g @kody-ade/kody-engine-lite
|
|
103
|
+
```
|
|
101
104
|
|
|
102
|
-
|
|
105
|
+
### 2. Set up GitHub
|
|
106
|
+
|
|
107
|
+
```bash
|
|
103
108
|
gh secret set ANTHROPIC_API_KEY --repo owner/repo
|
|
104
|
-
|
|
109
|
+
```
|
|
105
110
|
|
|
106
|
-
|
|
111
|
+
Then in GitHub: **Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests"**
|
|
112
|
+
|
|
113
|
+
### 3. Initialize
|
|
114
|
+
|
|
115
|
+
```bash
|
|
107
116
|
cd your-project
|
|
108
117
|
kody-engine-lite init
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This analyzes your project and generates workflow, config, memory, and labels — then commits and pushes.
|
|
121
|
+
|
|
122
|
+
### 4. Use
|
|
109
123
|
|
|
110
|
-
|
|
124
|
+
Comment on any GitHub issue:
|
|
125
|
+
|
|
126
|
+
```
|
|
111
127
|
@kody
|
|
112
128
|
```
|
|
113
129
|
|
|
114
|
-
|
|
130
|
+
### Switch to a different model (optional)
|
|
115
131
|
|
|
116
|
-
|
|
132
|
+
Add `litellm-config.yaml` to route all tiers through MiniMax (or any LLM):
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
# litellm-config.yaml
|
|
136
|
+
model_list:
|
|
137
|
+
- model_name: claude-haiku-4-5-20251001
|
|
138
|
+
litellm_params:
|
|
139
|
+
model: minimax/MiniMax-M2.7-highspeed
|
|
140
|
+
api_key: os.environ/MINIMAX_API_KEY
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
// kody.config.json — add litellmUrl
|
|
145
|
+
{ "agent": { "litellmUrl": "http://localhost:4000" } }
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Kody auto-starts the proxy and loads API keys from `.env`. [Full LiteLLM guide →](docs/LITELLM.md)
|
|
117
149
|
|
|
118
150
|
## Commands
|
|
119
151
|
|
|
120
152
|
### GitHub Comments
|
|
121
153
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
154
|
+
| Command | What it does |
|
|
155
|
+
|---------|-------------|
|
|
156
|
+
| `@kody` | Run full pipeline |
|
|
157
|
+
| `@kody approve` | Resume after questions or risk gate |
|
|
158
|
+
| `@kody fix` | Re-run from build stage. Write feedback in the comment body — it gets injected into the build prompt |
|
|
159
|
+
| `@kody rerun` | Resume from the failed or paused stage |
|
|
160
|
+
| `@kody rerun --from <stage>` | Resume from a specific stage |
|
|
128
161
|
|
|
129
162
|
### CLI
|
|
130
163
|
|
|
@@ -139,20 +172,20 @@ kody-engine-lite init [--force]
|
|
|
139
172
|
|
|
140
173
|
## Key Features
|
|
141
174
|
|
|
175
|
+
- **Shared Sessions** — stages in the same group share a Claude Code session, eliminating cold-start codebase re-exploration ([details](docs/FEATURES.md#shared-sessions))
|
|
142
176
|
- **Risk Gate** — HIGH-risk tasks pause for human plan approval before building ([details](docs/FEATURES.md#risk-gate))
|
|
143
177
|
- **AI Failure Diagnosis** — classifies errors as fixable/infrastructure/pre-existing/abort before retry ([details](docs/FEATURES.md#ai-powered-failure-diagnosis))
|
|
144
178
|
- **Question Gates** — asks product/architecture questions when the task is unclear ([details](docs/FEATURES.md#question-gates))
|
|
145
|
-
- **
|
|
179
|
+
- **Any LLM** — route through LiteLLM to use MiniMax, GPT, Gemini, local models ([setup guide](docs/LITELLM.md))
|
|
146
180
|
- **Retrospective** — analyzes each run, identifies patterns, suggests improvements ([details](docs/FEATURES.md#retrospective-system))
|
|
147
181
|
- **Auto-Learning** — extracts coding conventions from each successful run ([details](docs/FEATURES.md#auto-learning-memory))
|
|
148
|
-
- **Any LLM** — route through LiteLLM to use MiniMax, GPT, Gemini, local models ([setup guide](docs/LITELLM.md))
|
|
149
182
|
|
|
150
183
|
## Documentation
|
|
151
184
|
|
|
152
185
|
| Doc | What's in it |
|
|
153
186
|
|-----|-------------|
|
|
154
|
-
| [Pipeline](docs/PIPELINE.md) | Stage details,
|
|
155
|
-
| [Features](docs/FEATURES.md) | Risk gate, diagnosis, retrospective, auto-learn, labels |
|
|
187
|
+
| [Pipeline](docs/PIPELINE.md) | Stage details, shared sessions, complexity skipping, artifacts |
|
|
188
|
+
| [Features](docs/FEATURES.md) | Risk gate, diagnosis, sessions, retrospective, auto-learn, labels |
|
|
156
189
|
| [LiteLLM](docs/LITELLM.md) | Non-Anthropic model setup, auto-start, tested providers |
|
|
157
190
|
| [Configuration](docs/CONFIGURATION.md) | Full config reference, env vars, workflow setup |
|
|
158
191
|
| [Comparison](docs/COMPARISON.md) | vs Copilot, Devin, Cursor, Cline, SWE-agent, OpenHands |
|
package/dist/bin/cli.js
CHANGED
|
@@ -1034,6 +1034,7 @@ function runQualityGates(taskDir, projectRoot) {
|
|
|
1034
1034
|
const cwd = projectRoot ?? process.cwd();
|
|
1035
1035
|
const allErrors = [];
|
|
1036
1036
|
const allSummary = [];
|
|
1037
|
+
const rawOutputs = [];
|
|
1037
1038
|
let allPass = true;
|
|
1038
1039
|
const commands = [
|
|
1039
1040
|
{ name: "typecheck", cmd: config.quality.typecheck },
|
|
@@ -1055,10 +1056,11 @@ function runQualityGates(taskDir, projectRoot) {
|
|
|
1055
1056
|
allPass = false;
|
|
1056
1057
|
const errors = parseErrors(result.output);
|
|
1057
1058
|
allErrors.push(...errors.map((e) => `[${name}] ${e}`));
|
|
1059
|
+
rawOutputs.push({ name, output: result.output.slice(-3e3) });
|
|
1058
1060
|
}
|
|
1059
1061
|
allSummary.push(...extractSummary(result.output, name));
|
|
1060
1062
|
}
|
|
1061
|
-
return { pass: allPass, errors: allErrors, summary: allSummary };
|
|
1063
|
+
return { pass: allPass, errors: allErrors, summary: allSummary, rawOutputs };
|
|
1062
1064
|
}
|
|
1063
1065
|
var init_verify_runner = __esm({
|
|
1064
1066
|
"src/verify-runner.ts"() {
|
|
@@ -1190,6 +1192,18 @@ function executeGateStage(ctx, def) {
|
|
|
1190
1192
|
`);
|
|
1191
1193
|
for (const s of verifyResult.summary) {
|
|
1192
1194
|
lines.push(`- ${s}
|
|
1195
|
+
`);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
if (verifyResult.rawOutputs.length > 0) {
|
|
1199
|
+
lines.push(`
|
|
1200
|
+
## Raw Output
|
|
1201
|
+
`);
|
|
1202
|
+
for (const { name, output } of verifyResult.rawOutputs) {
|
|
1203
|
+
lines.push(`### ${name}
|
|
1204
|
+
\`\`\`
|
|
1205
|
+
${output}
|
|
1206
|
+
\`\`\`
|
|
1193
1207
|
`);
|
|
1194
1208
|
}
|
|
1195
1209
|
}
|
|
@@ -2393,21 +2407,26 @@ async function tryStartLitellm(url, projectDir) {
|
|
|
2393
2407
|
}
|
|
2394
2408
|
const portMatch = url.match(/:(\d+)/);
|
|
2395
2409
|
const port = portMatch ? portMatch[1] : "4000";
|
|
2410
|
+
let litellmFound = false;
|
|
2396
2411
|
try {
|
|
2397
|
-
execFileSync9("
|
|
2412
|
+
execFileSync9("which", ["litellm"], { timeout: 3e3, stdio: "pipe" });
|
|
2413
|
+
litellmFound = true;
|
|
2398
2414
|
} catch {
|
|
2399
2415
|
try {
|
|
2400
|
-
execFileSync9("python3", ["-
|
|
2416
|
+
execFileSync9("python3", ["-c", "import litellm"], { timeout: 1e4, stdio: "pipe" });
|
|
2417
|
+
litellmFound = true;
|
|
2401
2418
|
} catch {
|
|
2402
|
-
logger.warn("litellm not installed (pip install 'litellm[proxy]')");
|
|
2403
|
-
return null;
|
|
2404
2419
|
}
|
|
2405
2420
|
}
|
|
2421
|
+
if (!litellmFound) {
|
|
2422
|
+
logger.warn("litellm not installed (pip install 'litellm[proxy]')");
|
|
2423
|
+
return null;
|
|
2424
|
+
}
|
|
2406
2425
|
logger.info(`Starting LiteLLM proxy on port ${port}...`);
|
|
2407
2426
|
let cmd;
|
|
2408
2427
|
let args2;
|
|
2409
2428
|
try {
|
|
2410
|
-
execFileSync9("
|
|
2429
|
+
execFileSync9("which", ["litellm"], { timeout: 3e3, stdio: "pipe" });
|
|
2411
2430
|
cmd = "litellm";
|
|
2412
2431
|
args2 = ["--config", configPath, "--port", port];
|
|
2413
2432
|
} catch {
|