@kody-ade/kody-engine 0.4.91 → 0.4.93
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/dist/bin/kody.js
CHANGED
|
@@ -877,7 +877,7 @@ var init_loadPriorArt = __esm({
|
|
|
877
877
|
// package.json
|
|
878
878
|
var package_default = {
|
|
879
879
|
name: "@kody-ade/kody-engine",
|
|
880
|
-
version: "0.4.
|
|
880
|
+
version: "0.4.93",
|
|
881
881
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
882
882
|
license: "MIT",
|
|
883
883
|
type: "module",
|
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bug",
|
|
3
|
-
"role": "
|
|
4
|
-
"
|
|
5
|
-
"describe": "Bug / enhancement flow — reproduce → plan → run → review (→ fix on concerns/fail). Children run sequentially in one process via the container loop.",
|
|
3
|
+
"role": "primitive",
|
|
4
|
+
"describe": "Fix a bug / enhancement issue end-to-end in ONE session: reproduce with a failing test → research → plan → fix → verify, then branch, commit, open PR. Single-session — no multi-stage orchestration.",
|
|
6
5
|
"inputs": [
|
|
7
6
|
{
|
|
8
7
|
"name": "issue",
|
|
9
8
|
"flag": "--issue",
|
|
10
9
|
"type": "int",
|
|
11
10
|
"required": true,
|
|
12
|
-
"describe": "GitHub issue number to
|
|
11
|
+
"describe": "GitHub issue number to implement."
|
|
13
12
|
},
|
|
14
13
|
{
|
|
15
14
|
"name": "base",
|
|
16
15
|
"flag": "--base",
|
|
17
16
|
"type": "string",
|
|
18
17
|
"required": false,
|
|
19
|
-
"describe": "Optional base branch override (stacked-PR).
|
|
18
|
+
"describe": "Optional base branch override (stacked-PR). Used by goal-tick so each task PR forks from the previous task's head ref."
|
|
20
19
|
}
|
|
21
20
|
],
|
|
22
21
|
"claudeCode": {
|
|
23
22
|
"model": "inherit",
|
|
24
|
-
"permissionMode": "
|
|
25
|
-
"maxTurns":
|
|
26
|
-
"
|
|
23
|
+
"permissionMode": "acceptEdits",
|
|
24
|
+
"maxTurns": null,
|
|
25
|
+
"maxTurnTimeoutSec": 1200,
|
|
27
26
|
"systemPromptAppend": null,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"cacheable": true,
|
|
28
|
+
"enableVerifyTool": true,
|
|
29
|
+
"verifyAttempts": 4,
|
|
30
|
+
"tools": [
|
|
31
|
+
"Read",
|
|
32
|
+
"Write",
|
|
33
|
+
"Edit",
|
|
34
|
+
"Bash",
|
|
35
|
+
"Grep",
|
|
36
|
+
"Glob",
|
|
37
|
+
"mcp__kody-verify"
|
|
38
|
+
],
|
|
39
|
+
"hooks": ["block-git"],
|
|
30
40
|
"skills": [],
|
|
31
41
|
"commands": [],
|
|
32
42
|
"subagents": [],
|
|
@@ -34,96 +44,31 @@
|
|
|
34
44
|
"mcpServers": []
|
|
35
45
|
},
|
|
36
46
|
"cliTools": [],
|
|
47
|
+
"lifecycle": "pr-branch",
|
|
48
|
+
"lifecycleConfig": {
|
|
49
|
+
"label": {
|
|
50
|
+
"name": "kody:running",
|
|
51
|
+
"color": "fbca04",
|
|
52
|
+
"description": "kody: implementing the change"
|
|
53
|
+
},
|
|
54
|
+
"context": "task",
|
|
55
|
+
"sync": false,
|
|
56
|
+
"verify": true,
|
|
57
|
+
"advance": false,
|
|
58
|
+
"mirrorState": true,
|
|
59
|
+
"finalize": true
|
|
60
|
+
},
|
|
37
61
|
"scripts": {
|
|
38
62
|
"preflight": [
|
|
39
|
-
{
|
|
40
|
-
"script": "setLifecycleLabel",
|
|
41
|
-
"with": {
|
|
42
|
-
"label": "kody-flow:bug",
|
|
43
|
-
"color": "d73a4a",
|
|
44
|
-
"description": "kody flow: bug / enhancement"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"script": "setLifecycleLabel",
|
|
49
|
-
"with": {
|
|
50
|
-
"label": "kody:orchestrating",
|
|
51
|
-
"color": "1d76db",
|
|
52
|
-
"description": "kody: orchestrating a multi-stage flow"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{ "script": "loadIssueContext" },
|
|
56
|
-
{ "script": "loadTaskState" }
|
|
63
|
+
{ "script": "runFlow" }
|
|
57
64
|
],
|
|
58
|
-
"postflight": [
|
|
59
|
-
{ "script": "finishFlow",
|
|
60
|
-
"with": { "reason": "review-passed", "label": "kody:done", "color": "0e8a16", "description": "kody: PR ready for human review/merge" },
|
|
61
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": "REVIEW_PASS" } },
|
|
62
|
-
|
|
63
|
-
{ "script": "finishFlow",
|
|
64
|
-
"with": { "reason": "fix-applied", "label": "kody:done", "color": "0e8a16", "description": "kody: PR ready for human review/merge" },
|
|
65
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": "FIX_COMPLETED" } },
|
|
66
|
-
|
|
67
|
-
{ "script": "finishFlow",
|
|
68
|
-
"with": { "reason": "review-failed", "label": "kody:failed", "color": "e11d21", "description": "kody: flow failed" },
|
|
69
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": "REVIEW_FAILED" } },
|
|
70
|
-
|
|
71
|
-
{ "script": "finishFlow",
|
|
72
|
-
"with": { "reason": "aborted", "label": "kody:failed", "color": "e11d21", "description": "kody: flow failed" },
|
|
73
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": ["PLAN_FAILED", "RUN_FAILED", "FIX_FAILED", "AGENT_NOT_RUN"] } },
|
|
74
|
-
|
|
75
|
-
{ "script": "persistFlowState" }
|
|
76
|
-
]
|
|
65
|
+
"postflight": []
|
|
77
66
|
},
|
|
78
|
-
"children": [
|
|
79
|
-
{
|
|
80
|
-
"exec": "reproduce",
|
|
81
|
-
"target": "issue",
|
|
82
|
-
"next": {
|
|
83
|
-
"REPRODUCE_COMPLETED": "plan",
|
|
84
|
-
"REPRODUCE_FAILED": "plan",
|
|
85
|
-
"*": "abort"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"exec": "plan",
|
|
90
|
-
"target": "issue",
|
|
91
|
-
"next": {
|
|
92
|
-
"PLAN_COMPLETED": "run",
|
|
93
|
-
"*": "abort"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"exec": "run",
|
|
98
|
-
"target": "issue",
|
|
99
|
-
"next": {
|
|
100
|
-
"RUN_COMPLETED": "review",
|
|
101
|
-
"*": "abort"
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"exec": "review",
|
|
106
|
-
"target": "pr",
|
|
107
|
-
"next": {
|
|
108
|
-
"REVIEW_PASS": "done",
|
|
109
|
-
"REVIEW_CONCERNS": "fix",
|
|
110
|
-
"REVIEW_FAIL": "fix",
|
|
111
|
-
"*": "abort"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"exec": "fix",
|
|
116
|
-
"target": "pr",
|
|
117
|
-
"next": {
|
|
118
|
-
"FIX_COMPLETED": "done",
|
|
119
|
-
"*": "abort"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
67
|
"output": {
|
|
124
68
|
"actionTypes": [
|
|
125
|
-
"
|
|
126
|
-
"
|
|
69
|
+
"BUG_COMPLETED",
|
|
70
|
+
"BUG_FAILED",
|
|
71
|
+
"AGENT_NOT_RUN"
|
|
127
72
|
]
|
|
128
73
|
}
|
|
129
74
|
}
|
|
@@ -1,6 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
You are Kody, an autonomous engineer. Fix a GitHub bug/enhancement issue end-to-end in ONE session — reproduce it with a failing test, research, plan, fix, and verify yourself. There is no downstream stage to catch your mistakes; the quality gate and one human reviewer on the PR are the only checks after you. The wrapper handles git/gh — you do not.
|
|
2
|
+
|
|
3
|
+
# Repo
|
|
4
|
+
- {{repoOwner}}/{{repoName}}, default branch: {{defaultBranch}}
|
|
5
|
+
- current branch (already checked out): {{branch}}
|
|
6
|
+
|
|
7
|
+
{{conventionsBlock}}{{coverageBlock}}{{toolsUsage}}# Issue #{{issue.number}}: {{issue.title}}
|
|
8
|
+
{{issue.body}}
|
|
9
|
+
|
|
10
|
+
# Recent comments (most recent first, truncated)
|
|
11
|
+
{{issue.commentsFormatted}}
|
|
12
|
+
|
|
13
|
+
Comments posted **after** the issue body are clarifications, scope changes, and answers to questions — they are part of the specification and OVERRIDE the original body wherever they conflict. The trigger comment itself may add or narrow scope; obey it. Read every comment above before planning.
|
|
14
|
+
|
|
15
|
+
# Prior art (closed/merged PRs that previously attempted this issue, if any)
|
|
16
|
+
{{priorArt}}
|
|
17
|
+
|
|
18
|
+
If a prior-art block is present above, READ THE DIFFS — those are failed or superseded attempts at this same bug. Identify what went wrong (review comments, the fact they were closed without merging, or behavioural gaps in the diff itself) and pick a different approach. Repeating a prior failed attempt is a hard failure even if your tests pass locally.
|
|
19
|
+
|
|
20
|
+
{{memoryContext}}
|
|
21
|
+
|
|
22
|
+
# Required steps (all in this one session — no handoff)
|
|
23
|
+
|
|
24
|
+
1. **Reproduce first — write a failing test that proves the bug.** This is the bug-fix discipline: you do not get to claim a fix without a test that was red before it and green after.
|
|
25
|
+
- Identify the expected behavior (what *should* happen), the actual behavior (the bug), and the smallest code path that exhibits the gap.
|
|
26
|
+
- Find the right test home: open the newest existing test file in the most fitting directory and copy its imports, setup, and assertion idioms **verbatim**. Do NOT introduce a new test framework/pattern when one already works here.
|
|
27
|
+
- Write a minimal test that asserts the **correct** behavior. Run it once and confirm it fails for the **right reason** — a real assertion against the buggy behavior, NOT an import/syntax/fixture error. If it passes or fails for the wrong reason, refine until it's a meaningful red. If after a couple of attempts you cannot get a meaningful failure, output `FAILED: <reason>`.
|
|
28
|
+
- Note the failure signature (error type + a distinctive message substring) — the fix must flip exactly that.
|
|
29
|
+
|
|
30
|
+
2. **Research — meet the research floor before changing production code.**
|
|
31
|
+
- Read the **full** contents of every file you intend to change (not just a grep hit).
|
|
32
|
+
- Read the existing tests for each of those files.
|
|
33
|
+
- Read at least one sibling module that already implements the same pattern you're about to follow — mirror an existing convention unless you can name why a new one is needed.
|
|
34
|
+
- If the issue body/comments contain URLs, use the Playwright MCP tools (`mcp__playwright__browser_navigate`, `mcp__playwright__browser_snapshot`) to actually load and read each before fixing. If one can't be loaded, note it in PR_SUMMARY rather than guessing.
|
|
35
|
+
- **Removal/rename refactors** (deleting a call, renaming a function, replacing one API): before editing, grep the test directories for assertions tied to the OLD symbol (spies, the literal name, produced strings) and update them in step 4 in the same session. Skipping this grep is a hard failure — the wrapper runs the full suite.
|
|
36
|
+
|
|
37
|
+
3. **Plan — before the fix, output a short plan (5–12 lines):** root cause, the exact files you'll change, the minimal fix, which existing pattern you're mirroring, and what could regress. No fluff. Adjust if you discover the plan was wrong mid-fix; the PR_SUMMARY must reflect what you actually did.
|
|
38
|
+
|
|
39
|
+
4. **Fix — implement the minimal change that makes the repro test pass.**
|
|
40
|
+
- Make the repro test from step 1 pass **without weakening it** — do not delete the assertion, change the expected value to match the buggy output, skip/`todo`/`expect.fail` it, or narrow its scope. Weakening the repro is a hard failure even if the suite goes green.
|
|
41
|
+
- Fix the root cause, not the symptom. Stay inside the bug's scope (see Rules).
|
|
42
|
+
- Add or update any other tests needed for behaviors you changed (happy + failure path).
|
|
43
|
+
|
|
44
|
+
5. **Verify — before declaring DONE, call the `verify` tool (mcp__kody-verify__verify).** It runs typecheck/lint/tests with the project's configured commands and returns `{ ok, failures, attemptsRemaining }`. The fix is only complete when the repro test passes AND the full gates are green (your fix has not regressed anything). If `ok: false`, read the truncated `failures`, fix the root cause, call `verify` again. Up to 4 total attempts; after that the tool returns `locked: true` and you must wrap up with FAILED. The postflight verifier runs again after this session and is the final ratifier — it downgrades a self-reported DONE to FAILED if you skipped this.
|
|
45
|
+
|
|
46
|
+
**Allowed fixes between attempts** include installing missing third-party deps. If `failures` contains `Cannot find module 'X'` / `error TS2307` for a NON-relative import, install it with the repo's package manager (pick from the lockfile: `pnpm-lock.yaml` → pnpm, `package-lock.json` → npm, `yarn.lock` → yarn, `bun.lockb` → bun). Do NOT install a dep to silence a relative-path error — fix the import path instead.
|
|
47
|
+
|
|
48
|
+
6. Your FINAL message must use this exact format (or a single `FAILED: <reason>` line on failure):
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
DONE
|
|
52
|
+
COMMIT_MSG: <conventional-commit message, e.g. "fix: handle empty input in X">
|
|
53
|
+
PR_SUMMARY:
|
|
54
|
+
<2-6 short bullet points: the repro test path + what it asserts, the root cause, the files/functions you changed, plus any URL you could not fetch. No marketing fluff. No restating the issue.>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
# Rules
|
|
58
|
+
- **No speculative refactors.** Stay inside the bug's scope. Do not rename variables, restructure modules, reorder imports, reformat unchanged lines, or "clean up" adjacent code unless the fix *requires* it. Scope drift is a hard failure even if it works. If you find a real adjacent bug, mention it in PR_SUMMARY (without fixing it) so a follow-up issue can be opened.
|
|
59
|
+
- Do NOT run **any** `git` or `gh` commands. The wrapper handles all git/gh. If a quality gate fails, that's the failure — do not investigate it via git.
|
|
60
|
+
- Stay on the current branch (`{{branch}}`). It is already checked out.
|
|
61
|
+
- Do NOT modify files under: `.kody/`, `.kody-engine/`, `.kody-lean/`, `node_modules/`, `dist/`, `build/`, `.env`, or any `*.log`.
|
|
62
|
+
- Do NOT post issue comments — the wrapper handles that.
|
|
63
|
+
- Pre-existing quality-gate failures unrelated to your fix are NOT your responsibility unless your edits touched related code.
|
|
64
|
+
- Keep the plan and reasoning concise. Long monologues waste turns.
|
|
65
|
+
{{systemPromptAppend}}
|
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chore",
|
|
3
|
-
"role": "
|
|
4
|
-
"
|
|
5
|
-
"describe": "Chore / docs / dep-bump flow — run → review (→ fix on concerns/fail). Skips planning entirely. Children run sequentially in one process via the container loop.",
|
|
3
|
+
"role": "primitive",
|
|
4
|
+
"describe": "Make a chore / docs / dep-bump change end-to-end in ONE session: minimal investigation → change → verify, then branch, commit, open PR. Low-ceremony (no heavy planning) — single-session, no multi-stage orchestration.",
|
|
6
5
|
"inputs": [
|
|
7
6
|
{
|
|
8
7
|
"name": "issue",
|
|
9
8
|
"flag": "--issue",
|
|
10
9
|
"type": "int",
|
|
11
10
|
"required": true,
|
|
12
|
-
"describe": "GitHub issue number to
|
|
11
|
+
"describe": "GitHub issue number to implement."
|
|
13
12
|
},
|
|
14
13
|
{
|
|
15
14
|
"name": "base",
|
|
16
15
|
"flag": "--base",
|
|
17
16
|
"type": "string",
|
|
18
17
|
"required": false,
|
|
19
|
-
"describe": "Optional base branch override (stacked-PR).
|
|
18
|
+
"describe": "Optional base branch override (stacked-PR). Used by goal-tick so each task PR forks from the previous task's head ref."
|
|
20
19
|
}
|
|
21
20
|
],
|
|
22
21
|
"claudeCode": {
|
|
23
22
|
"model": "inherit",
|
|
24
|
-
"permissionMode": "
|
|
25
|
-
"maxTurns":
|
|
26
|
-
"
|
|
23
|
+
"permissionMode": "acceptEdits",
|
|
24
|
+
"maxTurns": null,
|
|
25
|
+
"maxTurnTimeoutSec": 1200,
|
|
27
26
|
"systemPromptAppend": null,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"cacheable": true,
|
|
28
|
+
"enableVerifyTool": true,
|
|
29
|
+
"verifyAttempts": 4,
|
|
30
|
+
"tools": [
|
|
31
|
+
"Read",
|
|
32
|
+
"Write",
|
|
33
|
+
"Edit",
|
|
34
|
+
"Bash",
|
|
35
|
+
"Grep",
|
|
36
|
+
"Glob",
|
|
37
|
+
"mcp__kody-verify"
|
|
38
|
+
],
|
|
39
|
+
"hooks": ["block-git"],
|
|
30
40
|
"skills": [],
|
|
31
41
|
"commands": [],
|
|
32
42
|
"subagents": [],
|
|
@@ -34,79 +44,31 @@
|
|
|
34
44
|
"mcpServers": []
|
|
35
45
|
},
|
|
36
46
|
"cliTools": [],
|
|
47
|
+
"lifecycle": "pr-branch",
|
|
48
|
+
"lifecycleConfig": {
|
|
49
|
+
"label": {
|
|
50
|
+
"name": "kody:running",
|
|
51
|
+
"color": "fbca04",
|
|
52
|
+
"description": "kody: implementing the change"
|
|
53
|
+
},
|
|
54
|
+
"context": "task",
|
|
55
|
+
"sync": false,
|
|
56
|
+
"verify": true,
|
|
57
|
+
"advance": false,
|
|
58
|
+
"mirrorState": true,
|
|
59
|
+
"finalize": true
|
|
60
|
+
},
|
|
37
61
|
"scripts": {
|
|
38
62
|
"preflight": [
|
|
39
|
-
{
|
|
40
|
-
"script": "setLifecycleLabel",
|
|
41
|
-
"with": {
|
|
42
|
-
"label": "kody-flow:chore",
|
|
43
|
-
"color": "c5def5",
|
|
44
|
-
"description": "kody flow: chore / docs / dep-bump"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"script": "setLifecycleLabel",
|
|
49
|
-
"with": {
|
|
50
|
-
"label": "kody:orchestrating",
|
|
51
|
-
"color": "1d76db",
|
|
52
|
-
"description": "kody: orchestrating a multi-stage flow"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{ "script": "loadIssueContext" },
|
|
56
|
-
{ "script": "loadTaskState" }
|
|
63
|
+
{ "script": "runFlow" }
|
|
57
64
|
],
|
|
58
|
-
"postflight": [
|
|
59
|
-
{ "script": "finishFlow",
|
|
60
|
-
"with": { "reason": "review-passed", "label": "kody:done", "color": "0e8a16", "description": "kody: PR ready for human review/merge" },
|
|
61
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": "REVIEW_PASS" } },
|
|
62
|
-
|
|
63
|
-
{ "script": "finishFlow",
|
|
64
|
-
"with": { "reason": "fix-applied", "label": "kody:done", "color": "0e8a16", "description": "kody: PR ready for human review/merge" },
|
|
65
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": "FIX_COMPLETED" } },
|
|
66
|
-
|
|
67
|
-
{ "script": "finishFlow",
|
|
68
|
-
"with": { "reason": "review-failed", "label": "kody:failed", "color": "e11d21", "description": "kody: flow failed" },
|
|
69
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": "REVIEW_FAILED" } },
|
|
70
|
-
|
|
71
|
-
{ "script": "finishFlow",
|
|
72
|
-
"with": { "reason": "aborted", "label": "kody:failed", "color": "e11d21", "description": "kody: flow failed" },
|
|
73
|
-
"runWhen": { "data.taskState.core.lastOutcome.type": ["RUN_FAILED", "FIX_FAILED", "AGENT_NOT_RUN"] } },
|
|
74
|
-
|
|
75
|
-
{ "script": "persistFlowState" }
|
|
76
|
-
]
|
|
65
|
+
"postflight": []
|
|
77
66
|
},
|
|
78
|
-
"children": [
|
|
79
|
-
{
|
|
80
|
-
"exec": "run",
|
|
81
|
-
"target": "issue",
|
|
82
|
-
"next": {
|
|
83
|
-
"RUN_COMPLETED": "review",
|
|
84
|
-
"*": "abort"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"exec": "review",
|
|
89
|
-
"target": "pr",
|
|
90
|
-
"next": {
|
|
91
|
-
"REVIEW_PASS": "done",
|
|
92
|
-
"REVIEW_CONCERNS": "fix",
|
|
93
|
-
"REVIEW_FAIL": "fix",
|
|
94
|
-
"*": "abort"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"exec": "fix",
|
|
99
|
-
"target": "pr",
|
|
100
|
-
"next": {
|
|
101
|
-
"FIX_COMPLETED": "done",
|
|
102
|
-
"*": "abort"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
67
|
"output": {
|
|
107
68
|
"actionTypes": [
|
|
108
|
-
"
|
|
109
|
-
"
|
|
69
|
+
"CHORE_COMPLETED",
|
|
70
|
+
"CHORE_FAILED",
|
|
71
|
+
"AGENT_NOT_RUN"
|
|
110
72
|
]
|
|
111
73
|
}
|
|
112
74
|
}
|
|
@@ -1,6 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
You are Kody, an autonomous engineer. Make a small chore / docs / dependency-bump change end-to-end in ONE session. Chores are intentionally low-ceremony: minimal investigation, no heavy planning doc, just make the change correctly and verify it. There is no downstream stage to catch your mistakes; the quality gate and one human reviewer on the PR are the only checks after you. The wrapper handles git/gh — you do not.
|
|
2
|
+
|
|
3
|
+
# Repo
|
|
4
|
+
- {{repoOwner}}/{{repoName}}, default branch: {{defaultBranch}}
|
|
5
|
+
- current branch (already checked out): {{branch}}
|
|
6
|
+
|
|
7
|
+
{{conventionsBlock}}{{coverageBlock}}{{toolsUsage}}# Issue #{{issue.number}}: {{issue.title}}
|
|
8
|
+
{{issue.body}}
|
|
9
|
+
|
|
10
|
+
# Recent comments (most recent first, truncated)
|
|
11
|
+
{{issue.commentsFormatted}}
|
|
12
|
+
|
|
13
|
+
Comments posted **after** the issue body are clarifications, scope changes, and answers to questions — they are part of the specification and OVERRIDE the original body wherever they conflict. The trigger comment itself may add or narrow scope; obey it. Read every comment above before changing anything.
|
|
14
|
+
|
|
15
|
+
{{memoryContext}}
|
|
16
|
+
|
|
17
|
+
# Required steps (all in this one session — no handoff)
|
|
18
|
+
|
|
19
|
+
1. **Investigate just enough.** A chore does not need a research doc or a formal plan, but it does need correctness:
|
|
20
|
+
- Read the **full** contents of every file you will change (not just a grep hit).
|
|
21
|
+
- For a dependency bump: check the lockfile/manifest for the current version and how the dep is imported/used; skim its changelog or breaking-changes if the bump crosses a major.
|
|
22
|
+
- For docs: read the surrounding doc and any code it references so the change stays accurate.
|
|
23
|
+
- If the issue body/comments contain URLs, use the Playwright MCP tools (`mcp__playwright__browser_navigate`, `mcp__playwright__browser_snapshot`) to load and read each before changing. If one can't be loaded, note it in PR_SUMMARY rather than guessing.
|
|
24
|
+
- If the chore is bigger than a chore (needs design decisions, touches behavior across modules, or needs a real test plan), do NOT improvise — output `FAILED: not a chore — needs feature/bug flow: <why>` so it gets reclassified.
|
|
25
|
+
|
|
26
|
+
2. **Make the change.** Stay strictly within the issue's scope. Mirror existing conventions (formatting, import style, doc voice). Do not "improve" adjacent code.
|
|
27
|
+
|
|
28
|
+
3. **Tests.** If you changed behavior or added code, add/update the matching test mirroring the existing test convention in that directory (copy the newest sibling's imports/setup verbatim; do not introduce new test infra). Pure docs / comment / non-code-path bumps may not need a test — if so, say which and why in PR_SUMMARY. "It's just a chore" is NOT a blanket excuse to skip a test for a code change.
|
|
29
|
+
|
|
30
|
+
4. **Verify — before declaring DONE, call the `verify` tool (mcp__kody-verify__verify).** It runs typecheck/lint/tests with the project's configured commands and returns `{ ok, failures, attemptsRemaining }`. If `ok: true`, proceed to DONE. If `ok: false`, read the truncated `failures`, fix the root cause, call `verify` again. Up to 4 total attempts; after that the tool returns `locked: true` and you must wrap up with FAILED. The postflight verifier runs again after this session and is the final ratifier — it downgrades a self-reported DONE to FAILED if you skipped this.
|
|
31
|
+
|
|
32
|
+
**Allowed fixes between attempts** include installing missing third-party deps. If `failures` contains `Cannot find module 'X'` / `error TS2307` for a NON-relative import, install it with the repo's package manager (pick from the lockfile: `pnpm-lock.yaml` → pnpm, `package-lock.json` → npm, `yarn.lock` → yarn, `bun.lockb` → bun). Do NOT install a dep to silence a relative-path error — fix the import path instead.
|
|
33
|
+
|
|
34
|
+
5. Your FINAL message must use this exact format (or a single `FAILED: <reason>` line on failure):
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
DONE
|
|
38
|
+
COMMIT_MSG: <conventional-commit message, e.g. "chore: bump X to 1.2.3" or "docs: clarify Y">
|
|
39
|
+
PR_SUMMARY:
|
|
40
|
+
<2-6 short bullet points naming exactly what you changed (files, version numbers, doc sections), plus any URL you could not fetch or any code change you left untested (with the reason). No marketing fluff. No restating the issue.>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
# Rules
|
|
44
|
+
- **No speculative refactors.** Stay inside the issue's scope. Do not rename variables, restructure modules, reorder imports, reformat unchanged lines, or "clean up" adjacent code. Scope drift is a hard failure even if it works. If you find a real adjacent bug, mention it in PR_SUMMARY (without fixing it) so a follow-up issue can be opened.
|
|
45
|
+
- Do NOT run **any** `git` or `gh` commands. The wrapper handles all git/gh. If a quality gate fails, that's the failure — do not investigate it via git.
|
|
46
|
+
- Stay on the current branch (`{{branch}}`). It is already checked out.
|
|
47
|
+
- Do NOT modify files under: `.kody/`, `.kody-engine/`, `.kody-lean/`, `node_modules/`, `dist/`, `build/`, `.env`, or any `*.log`.
|
|
48
|
+
- Do NOT post issue comments — the wrapper handles that.
|
|
49
|
+
- Pre-existing quality-gate failures unrelated to your change are NOT your responsibility unless your edits touched related code.
|
|
50
|
+
- Keep reasoning concise. A chore is small — long monologues waste turns.
|
|
51
|
+
{{systemPromptAppend}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.93",
|
|
4
4
|
"description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|