@kody-ade/kody-engine-lite 0.1.28 → 0.1.29
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 +74 -30
- package/dist/bin/cli.js +46 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,28 +2,93 @@
|
|
|
2
2
|
|
|
3
3
|
**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.
|
|
4
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
|
|
8
|
+
|
|
5
9
|
```
|
|
6
|
-
|
|
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
|
+
└─────────────────────────────────────────────────────────┘
|
|
7
72
|
```
|
|
8
73
|
|
|
9
|
-
|
|
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.
|
|
75
|
+
|
|
76
|
+
[Pipeline details →](docs/PIPELINE.md)
|
|
10
77
|
|
|
11
78
|
## Why Kody?
|
|
12
79
|
|
|
13
80
|
Most AI coding tools are **autocomplete** (Copilot) or **chat-based** (Cursor, Cline). You still drive. Kody is different: it's an **autonomous pipeline** that takes an issue and delivers a tested, reviewed PR — even for complex, multi-file features that single-agent tools choke on.
|
|
14
81
|
|
|
15
|
-
Single agents hit context limits on large tasks. Kody splits work into focused stages — each with a fresh context window but access to curated context from previous stages. A 27-minute auth system build (JWT, sessions, middleware, RBAC, 7 stages, 3 autofix retries) completes end-to-end without losing track.
|
|
16
|
-
|
|
17
82
|
| | Kody | Copilot Workspace | Devin | Cursor Agent |
|
|
18
83
|
|---|---|---|---|---|
|
|
19
84
|
| **Runs in CI** | GitHub Actions | GitHub Cloud | Devin Cloud | Local IDE |
|
|
20
85
|
| **Fire and forget** | Comment `@kody`, walk away | Must interact | Must interact | Must be open |
|
|
21
86
|
| **Quality gates** | typecheck + tests + lint + AI diagnosis + auto-retry | Basic | Runs tests | Runs tests |
|
|
22
|
-
| **Risk gate** | Pauses HIGH-risk
|
|
87
|
+
| **Risk gate** | Pauses HIGH-risk for human approval | No | No | No |
|
|
23
88
|
| **Model flexible** | Any LLM via LiteLLM | GitHub models only | Proprietary | Cursor models |
|
|
24
89
|
| **Open source** | MIT | Proprietary | Proprietary | Proprietary |
|
|
25
|
-
| **Accumulated context** | Curated context flows between stages | Single conversation | Single agent | Single agent |
|
|
26
|
-
| **Complex tasks** |
|
|
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 |
|
|
27
92
|
| **Cost** | Your API costs only | $10-39/month | $20-500/month | Subscription |
|
|
28
93
|
|
|
29
94
|
[Full comparison →](docs/COMPARISON.md)
|
|
@@ -50,27 +115,6 @@ kody-engine-lite init
|
|
|
50
115
|
|
|
51
116
|
**Prerequisites:** Node.js >= 22, [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code), [GitHub CLI](https://cli.github.com/), git
|
|
52
117
|
|
|
53
|
-
## Pipeline
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
@kody on issue
|
|
57
|
-
↓
|
|
58
|
-
1. taskify — classify task, detect complexity, ask questions → task.json
|
|
59
|
-
2. plan — TDD implementation plan (deep reasoning) → plan.md
|
|
60
|
-
↓ HIGH risk? pause for human approval
|
|
61
|
-
3. build — implement code via Claude Code tools → code changes
|
|
62
|
-
4. verify — typecheck + tests + lint (AI diagnosis + autofix) → verify.md
|
|
63
|
-
5. review — code review: PASS/FAIL + Critical/Major/Minor → review.md
|
|
64
|
-
6. review-fix — fix Critical and Major findings → code changes
|
|
65
|
-
7. ship — push branch + create PR with Closes #N → ship.md
|
|
66
|
-
↓
|
|
67
|
-
PR created
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Complexity auto-detected: **low** skips plan/review (4 stages), **medium** skips review-fix (6 stages), **high** runs all 7.
|
|
71
|
-
|
|
72
|
-
[Pipeline details →](docs/PIPELINE.md)
|
|
73
|
-
|
|
74
118
|
## Commands
|
|
75
119
|
|
|
76
120
|
### GitHub Comments
|
|
@@ -98,16 +142,16 @@ kody-engine-lite init [--force]
|
|
|
98
142
|
- **Risk Gate** — HIGH-risk tasks pause for human plan approval before building ([details](docs/FEATURES.md#risk-gate))
|
|
99
143
|
- **AI Failure Diagnosis** — classifies errors as fixable/infrastructure/pre-existing/abort before retry ([details](docs/FEATURES.md#ai-powered-failure-diagnosis))
|
|
100
144
|
- **Question Gates** — asks product/architecture questions when the task is unclear ([details](docs/FEATURES.md#question-gates))
|
|
145
|
+
- **Accumulated Context** — each stage passes curated context to the next — fresh window, shared knowledge ([details](docs/FEATURES.md#accumulated-context))
|
|
101
146
|
- **Retrospective** — analyzes each run, identifies patterns, suggests improvements ([details](docs/FEATURES.md#retrospective-system))
|
|
102
147
|
- **Auto-Learning** — extracts coding conventions from each successful run ([details](docs/FEATURES.md#auto-learning-memory))
|
|
103
|
-
- **Accumulated Context** — each stage passes curated context to the next — fresh window, shared knowledge ([details](docs/FEATURES.md#accumulated-context))
|
|
104
148
|
- **Any LLM** — route through LiteLLM to use MiniMax, GPT, Gemini, local models ([setup guide](docs/LITELLM.md))
|
|
105
149
|
|
|
106
150
|
## Documentation
|
|
107
151
|
|
|
108
152
|
| Doc | What's in it |
|
|
109
153
|
|-----|-------------|
|
|
110
|
-
| [Pipeline](docs/PIPELINE.md) | Stage details, complexity skipping,
|
|
154
|
+
| [Pipeline](docs/PIPELINE.md) | Stage details, complexity skipping, accumulated context, artifacts |
|
|
111
155
|
| [Features](docs/FEATURES.md) | Risk gate, diagnosis, retrospective, auto-learn, labels |
|
|
112
156
|
| [LiteLLM](docs/LITELLM.md) | Non-Anthropic model setup, auto-start, tested providers |
|
|
113
157
|
| [Configuration](docs/CONFIGURATION.md) | Full config reference, env vars, workflow setup |
|
package/dist/bin/cli.js
CHANGED
|
@@ -87,20 +87,22 @@ function checkCommand(command2, args2) {
|
|
|
87
87
|
function createClaudeCodeRunner() {
|
|
88
88
|
return {
|
|
89
89
|
async run(_stageName, prompt, model, timeout, _taskDir, options) {
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
const args2 = [
|
|
91
|
+
"--print",
|
|
92
|
+
"--model",
|
|
93
|
+
model,
|
|
94
|
+
"--dangerously-skip-permissions",
|
|
95
|
+
"--allowedTools",
|
|
96
|
+
"Bash,Edit,Read,Write,Glob,Grep"
|
|
97
|
+
];
|
|
98
|
+
if (options?.sessionId) {
|
|
99
|
+
if (options.resumeSession) {
|
|
100
|
+
args2.push("--resume", options.sessionId);
|
|
101
|
+
} else {
|
|
102
|
+
args2.push("--session-id", options.sessionId);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return runSubprocess("claude", args2, prompt, timeout, options);
|
|
104
106
|
},
|
|
105
107
|
async healthCheck() {
|
|
106
108
|
return checkCommand("claude", ["--version"]);
|
|
@@ -824,6 +826,17 @@ var init_runner_selection = __esm({
|
|
|
824
826
|
// src/stages/agent.ts
|
|
825
827
|
import * as fs5 from "fs";
|
|
826
828
|
import * as path5 from "path";
|
|
829
|
+
function getSessionInfo(stageName, sessions) {
|
|
830
|
+
const group = SESSION_GROUP[stageName];
|
|
831
|
+
if (!group) return void 0;
|
|
832
|
+
const existing = sessions[group];
|
|
833
|
+
if (existing) {
|
|
834
|
+
return { sessionId: existing, resumeSession: true };
|
|
835
|
+
}
|
|
836
|
+
const newId = crypto.randomUUID();
|
|
837
|
+
sessions[group] = newId;
|
|
838
|
+
return { sessionId: newId, resumeSession: false };
|
|
839
|
+
}
|
|
827
840
|
function validateStageOutput(stageName, content) {
|
|
828
841
|
switch (stageName) {
|
|
829
842
|
case "taskify":
|
|
@@ -850,10 +863,16 @@ async function executeAgentStage(ctx, def) {
|
|
|
850
863
|
if (config.agent.litellmUrl) {
|
|
851
864
|
extraEnv.ANTHROPIC_BASE_URL = config.agent.litellmUrl;
|
|
852
865
|
}
|
|
866
|
+
const sessions = ctx.sessions ?? {};
|
|
867
|
+
const sessionInfo = getSessionInfo(def.name, sessions);
|
|
868
|
+
if (sessionInfo) {
|
|
869
|
+
logger.info(` session: ${SESSION_GROUP[def.name]} (${sessionInfo.resumeSession ? "resume" : "new"})`);
|
|
870
|
+
}
|
|
853
871
|
const runner = getRunnerForStage(ctx, def.name);
|
|
854
872
|
const result = await runner.run(def.name, prompt, model, def.timeout, ctx.taskDir, {
|
|
855
873
|
cwd: ctx.projectDir,
|
|
856
|
-
env: extraEnv
|
|
874
|
+
env: extraEnv,
|
|
875
|
+
...sessionInfo
|
|
857
876
|
});
|
|
858
877
|
if (result.outcome !== "completed") {
|
|
859
878
|
return { outcome: result.outcome, error: result.error, retries: 0 };
|
|
@@ -924,6 +943,7 @@ ${summary}
|
|
|
924
943
|
`;
|
|
925
944
|
fs5.appendFileSync(contextPath, entry);
|
|
926
945
|
}
|
|
946
|
+
var SESSION_GROUP;
|
|
927
947
|
var init_agent = __esm({
|
|
928
948
|
"src/stages/agent.ts"() {
|
|
929
949
|
"use strict";
|
|
@@ -932,6 +952,14 @@ var init_agent = __esm({
|
|
|
932
952
|
init_config();
|
|
933
953
|
init_runner_selection();
|
|
934
954
|
init_logger();
|
|
955
|
+
SESSION_GROUP = {
|
|
956
|
+
taskify: "explore",
|
|
957
|
+
plan: "explore",
|
|
958
|
+
build: "build",
|
|
959
|
+
autofix: "build",
|
|
960
|
+
"review-fix": "build",
|
|
961
|
+
review: "review"
|
|
962
|
+
};
|
|
935
963
|
}
|
|
936
964
|
});
|
|
937
965
|
|
|
@@ -2072,6 +2100,7 @@ async function runPipelineInner(ctx) {
|
|
|
2072
2100
|
state = initState(ctx.taskId);
|
|
2073
2101
|
writeState(state, ctx.taskDir);
|
|
2074
2102
|
}
|
|
2103
|
+
ctx.sessions = state.sessions ?? {};
|
|
2075
2104
|
if (state.state !== "running") {
|
|
2076
2105
|
state.state = "running";
|
|
2077
2106
|
for (const stage of STAGES) {
|
|
@@ -2159,6 +2188,7 @@ async function runPipelineInner(ctx) {
|
|
|
2159
2188
|
error: isTimeout ? "Stage timed out" : result.error ?? "Stage failed"
|
|
2160
2189
|
};
|
|
2161
2190
|
state.state = "failed";
|
|
2191
|
+
state.sessions = ctx.sessions;
|
|
2162
2192
|
writeState(state, ctx.taskDir);
|
|
2163
2193
|
logger.error(`[${def.name}] ${isTimeout ? "\u23F1 timed out" : `\u2717 failed: ${result.error}`}`);
|
|
2164
2194
|
if (ctx.input.issueNumber && !ctx.input.local) {
|
|
@@ -2166,6 +2196,7 @@ async function runPipelineInner(ctx) {
|
|
|
2166
2196
|
}
|
|
2167
2197
|
break;
|
|
2168
2198
|
}
|
|
2199
|
+
state.sessions = ctx.sessions;
|
|
2169
2200
|
writeState(state, ctx.taskDir);
|
|
2170
2201
|
}
|
|
2171
2202
|
const allCompleted = STAGES.every((s) => state.stages[s.name].state === "completed");
|