@kody-ade/kody-engine 0.4.224 → 0.4.225
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 +2 -2
- package/dist/bin/kody.js +779 -831
- package/dist/executables/run/profile.json +1 -1
- package/dist/executables/types.ts +3 -1
- package/package.json +1 -1
- package/dist/duties/duty-scheduler/duty.md +0 -3
- package/dist/duties/duty-scheduler/profile.json +0 -6
- package/dist/duties/duty-tick/duty.md +0 -3
- package/dist/duties/duty-tick/profile.json +0 -6
- package/dist/duties/duty-tick-scripted/duty.md +0 -3
- package/dist/duties/duty-tick-scripted/profile.json +0 -6
- package/dist/duties/fix/duty.md +0 -10
- package/dist/duties/fix/profile.json +0 -6
- package/dist/duties/fix-ci/duty.md +0 -10
- package/dist/duties/fix-ci/profile.json +0 -6
- package/dist/duties/goal-scheduler/duty.md +0 -3
- package/dist/duties/goal-scheduler/profile.json +0 -6
- package/dist/duties/goal-tick/duty.md +0 -3
- package/dist/duties/goal-tick/profile.json +0 -6
- package/dist/duties/init/duty.md +0 -10
- package/dist/duties/init/profile.json +0 -6
- package/dist/duties/job-live-verify/duty.md +0 -3
- package/dist/duties/job-live-verify/profile.json +0 -6
- package/dist/duties/merge/duty.md +0 -10
- package/dist/duties/merge/profile.json +0 -6
- package/dist/duties/npm-publish/duty.md +0 -17
- package/dist/duties/npm-publish/profile.json +0 -6
- package/dist/duties/plan-verify/duty.md +0 -3
- package/dist/duties/plan-verify/profile.json +0 -6
- package/dist/duties/preview-build/duty.md +0 -10
- package/dist/duties/preview-build/profile.json +0 -6
- package/dist/duties/probe-skill/duty.md +0 -3
- package/dist/duties/probe-skill/profile.json +0 -6
- package/dist/duties/qa-goal/duty.md +0 -3
- package/dist/duties/qa-goal/profile.json +0 -6
- package/dist/duties/release/duty.md +0 -10
- package/dist/duties/release/profile.json +0 -6
- package/dist/duties/release-deploy/duty.md +0 -10
- package/dist/duties/release-deploy/profile.json +0 -6
- package/dist/duties/release-prepare/duty.md +0 -10
- package/dist/duties/release-prepare/profile.json +0 -6
- package/dist/duties/release-publish/duty.md +0 -10
- package/dist/duties/release-publish/profile.json +0 -6
- package/dist/duties/resolve/duty.md +0 -10
- package/dist/duties/resolve/profile.json +0 -6
- package/dist/duties/revert/duty.md +0 -10
- package/dist/duties/revert/profile.json +0 -6
- package/dist/duties/sync/duty.md +0 -10
- package/dist/duties/sync/profile.json +0 -6
- package/dist/duties/task-job-fail-once/duty.md +0 -3
- package/dist/duties/task-job-fail-once/profile.json +0 -6
- package/dist/duties/task-job-pass-a/duty.md +0 -3
- package/dist/duties/task-job-pass-a/profile.json +0 -6
- package/dist/duties/task-job-pass-b/duty.md +0 -3
- package/dist/duties/task-job-pass-b/profile.json +0 -6
- package/dist/duties/task-jobs/duty.md +0 -3
- package/dist/duties/task-jobs/profile.json +0 -6
- package/dist/duties/worker-ask/duty.md +0 -10
- package/dist/duties/worker-ask/profile.json +0 -6
- package/dist/executables/duty-scheduler/profile.json +0 -57
- package/dist/executables/duty-tick/profile.json +0 -78
- package/dist/executables/duty-tick/prompt.md +0 -77
- package/dist/executables/duty-tick/prompts/locked.md +0 -50
- package/dist/executables/duty-tick-scripted/profile.json +0 -72
- package/dist/executables/fix/profile.json +0 -91
- package/dist/executables/fix/prompt.md +0 -90
- package/dist/executables/fix-ci/profile.json +0 -71
- package/dist/executables/fix-ci/prompt.md +0 -78
- package/dist/executables/goal-scheduler/profile.json +0 -53
- package/dist/executables/goal-scheduler/scheduler.sh +0 -82
- package/dist/executables/goal-tick/profile.json +0 -69
- package/dist/executables/init/profile.json +0 -36
- package/dist/executables/job-live-verify/profile.json +0 -36
- package/dist/executables/job-live-verify/prompt.md +0 -42
- package/dist/executables/merge/profile.json +0 -54
- package/dist/executables/npm-publish/profile.json +0 -73
- package/dist/executables/npm-publish/publish.sh +0 -93
- package/dist/executables/plan-verify/profile.json +0 -38
- package/dist/executables/plan-verify/prompt.md +0 -72
- package/dist/executables/preview-build/profile.json +0 -61
- package/dist/executables/preview-health/profile.json +0 -48
- package/dist/executables/preview-health/tick.sh +0 -319
- package/dist/executables/probe-skill/profile.json +0 -35
- package/dist/executables/probe-skill/prompt.md +0 -31
- package/dist/executables/probe-skill/skills/probe-skill-marker/SKILL.md +0 -18
- package/dist/executables/qa-goal/profile.json +0 -65
- package/dist/executables/release/deploy.sh +0 -157
- package/dist/executables/release/prepare.sh +0 -353
- package/dist/executables/release/profile.json +0 -95
- package/dist/executables/release/publish.sh +0 -88
- package/dist/executables/release/release.sh +0 -230
- package/dist/executables/release/wait.sh +0 -88
- package/dist/executables/release-deploy/deploy.sh +0 -222
- package/dist/executables/release-deploy/profile.json +0 -53
- package/dist/executables/release-prepare/prepare.sh +0 -368
- package/dist/executables/release-prepare/profile.json +0 -70
- package/dist/executables/release-publish/profile.json +0 -53
- package/dist/executables/release-publish/publish.sh +0 -137
- package/dist/executables/resolve/apply-prefer.sh +0 -54
- package/dist/executables/resolve/profile.json +0 -107
- package/dist/executables/resolve/prompt.md +0 -51
- package/dist/executables/revert/profile.json +0 -82
- package/dist/executables/revert/revert.sh +0 -33
- package/dist/executables/sync/profile.json +0 -48
- package/dist/executables/task-job-fail-once/profile.json +0 -44
- package/dist/executables/task-job-fail-once/prompt.md +0 -1
- package/dist/executables/task-job-pass-a/profile.json +0 -43
- package/dist/executables/task-job-pass-a/prompt.md +0 -1
- package/dist/executables/task-job-pass-b/profile.json +0 -43
- package/dist/executables/task-job-pass-b/prompt.md +0 -1
- package/dist/executables/task-jobs/profile.json +0 -41
- package/dist/executables/task-jobs/prompt.md +0 -1
- package/dist/executables/worker-ask/profile.json +0 -70
- package/dist/executables/worker-ask/prompt.md +0 -60
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{{dutyReference}}
|
|
2
|
-
|
|
3
|
-
You are **{{staffTitle}}** (staff `{{staffSlug}}`), running through **kody duty-tick** — the coordinator for one file-based duty. You do **not** touch code, do **not** commit, and do **not** edit files. You coordinate by inspecting GitHub state and issuing Kody commands as PR comments.
|
|
4
|
-
|
|
5
|
-
## Who you are — staff persona (authoritative identity)
|
|
6
|
-
|
|
7
|
-
The duty below assigns you, staff **`{{staffSlug}}`**, as its executor. This persona defines *who* runs the duty: your authority, doctrine, voice, and hard limits. Where the persona's restrictions are stricter than the duty body, **the persona wins** — a duty can never grant you authority your staff persona withholds.
|
|
8
|
-
|
|
9
|
-
{{workerPersona}}
|
|
10
|
-
|
|
11
|
-
## The duty
|
|
12
|
-
|
|
13
|
-
Slug **`{{dutySlug}}`** — *{{dutyTitle}}*, assigned to staff **`{{staffSlug}}`**, running on executable **`{{executableSlug}}`**. The duty body below is authoritative for *what* to do, *when* (cadence), allowed commands, and state schema. It is human-edited — re-read it every tick. Execute it **as** the persona above.
|
|
14
|
-
|
|
15
|
-
**Addressing the operator.** When the duty body tells you to @-mention the operator (e.g. the first line of an inbox recommendation), the exact handle(s) to use are: {{mentions}}. Copy that string **verbatim** — never invent, abbreviate, guess, or retype a GitHub username. A wrong handle silently fails to route to the operator's inbox, so the recommendation is lost. If the line above is blank, the duty declared no operator; post without a mention.
|
|
16
|
-
|
|
17
|
-
### Duty body
|
|
18
|
-
|
|
19
|
-
{{jobIntent}}
|
|
20
|
-
|
|
21
|
-
## Current state
|
|
22
|
-
|
|
23
|
-
This is the state you wrote at the end of the previous tick (or `null` if this is the first tick):
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{{jobStateJson}}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
`cursor` is *your* enum — pick whatever labels map cleanly to your duty's phases. `data` is where you stash anything you need on the next tick (per-PR attempt counters, last-seen SHAs, etc). `done: true` is how you signal that the duty is permanently over — for evergreen duties this should always remain `false`.
|
|
30
|
-
|
|
31
|
-
## What to do on this tick
|
|
32
|
-
|
|
33
|
-
`forceRun = {{args.force}}` — set to `true` when an operator clicked "Run now" on the dashboard. When `forceRun` is `true`, ignore the duty body's `**Cadence guard.**` paragraph (or any equivalent "skip if last run was within X" rule) and execute the work as if the guard had passed. All other body rules — allowed commands, restrictions, state schema — still apply. Force only overrides cadence.
|
|
34
|
-
|
|
35
|
-
1. **Check `done`.** If the prior state has `done: true`, emit the same state back unchanged and exit without any action.
|
|
36
|
-
2. **Re-read the duty body.** It may have changed since the last tick.
|
|
37
|
-
3. **Execute exactly the work the body's `## Duty` section describes**, subject to its `## Allowed Commands` and `## Restrictions`. Use the `## State` section to interpret and update `data`.
|
|
38
|
-
4. **Optionally post a short narration** wherever the duty tells you to (typically a PR comment alongside the action). Keep it terse.
|
|
39
|
-
5. **Submit the new state** by calling the `submit_state` tool (see contract below). Do not include `version` or `rev` — the postflight script manages those.
|
|
40
|
-
|
|
41
|
-
## Output contract (MANDATORY, exactly once, at the end)
|
|
42
|
-
|
|
43
|
-
Call the **`submit_state`** tool exactly once, as the final step, with your next state:
|
|
44
|
-
|
|
45
|
-
- `cursor` — your next cursor (string, e.g. `"idle"`).
|
|
46
|
-
- `data` — your next `data` object. Carry forward prior `data` and mutate only what you acted on this tick.
|
|
47
|
-
- `done` — `true` only if the duty is permanently finished; evergreen duties stay `false`.
|
|
48
|
-
|
|
49
|
-
This is the ONLY way your decision is saved. If you don't call it, the tick fails and the state is NOT updated — on the next wake you'll see the same prior state and can retry.
|
|
50
|
-
|
|
51
|
-
> Backstop (legacy): if the `submit_state` tool is unavailable, end your reply with the same JSON in a single fenced block tagged `kody-job-next-state` (or the new `kody-duty-next-state` alias) instead:
|
|
52
|
-
>
|
|
53
|
-
> ````
|
|
54
|
-
> ```kody-job-next-state
|
|
55
|
-
> { "cursor": "<next>", "data": { ... }, "done": <true|false> }
|
|
56
|
-
> ```
|
|
57
|
-
> ````
|
|
58
|
-
|
|
59
|
-
## Rules
|
|
60
|
-
|
|
61
|
-
- Never edit, create, or delete files in the working tree.
|
|
62
|
-
- Never commit or push via `git`. The only permitted commit path is `gh api -X PUT` against the report file (see exception below).
|
|
63
|
-
- Only shell calls allowed: `gh`. Everything must go through it.
|
|
64
|
-
- Keep each tick focused: do one action per candidate per wake. The cron will call you again.
|
|
65
|
-
- If state says you're waiting on something, just check and re-emit — don't spawn a duplicate.
|
|
66
|
-
- Honour the duty body's `## Restrictions` over any inferred shortcut.
|
|
67
|
-
|
|
68
|
-
### Single permitted write: the duty's report file
|
|
69
|
-
|
|
70
|
-
A duty MAY (optionally — only if its body asks for it) write a single
|
|
71
|
-
markdown report file at the canonical path:
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
.kody/reports/{{dutySlug}}.md
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Only that exact path. Only via `gh api -X PUT /repos/<owner>/<repo>/contents/.kody/reports/{{dutySlug}}.md` (with base64 content + `sha` of the existing file when updating). All other writes — code files, other report paths, other slugs — remain forbidden. The dashboard's `/reports` page surfaces these files automatically; this is the canonical channel for a duty's diagnostic output when an issue comment isn't expressive enough.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{{dutyReference}}
|
|
2
|
-
|
|
3
|
-
You are **{{staffTitle}}** (staff `{{staffSlug}}`), running duty **`{{dutySlug}}`** — *{{dutyTitle}}* — in **locked-toolbox mode**.
|
|
4
|
-
|
|
5
|
-
You have NO shell. You cannot run `gh`, edit files, or post raw comments. The only actions you can take this tick are the typed tools listed below, plus `submit_state` at the end. The duty body tells you *when* to use each tool; the tools themselves do the work.
|
|
6
|
-
|
|
7
|
-
## Tools available this tick
|
|
8
|
-
|
|
9
|
-
{{dutyToolsList}}
|
|
10
|
-
- `submit_state` (always — call exactly once at the end)
|
|
11
|
-
|
|
12
|
-
Anything not in that list does not exist for this tick. If the duty body asks for an action whose tool isn't listed, skip it and note the gap in your reasoning.
|
|
13
|
-
|
|
14
|
-
## Who you are — staff persona (authoritative identity)
|
|
15
|
-
|
|
16
|
-
{{workerPersona}}
|
|
17
|
-
|
|
18
|
-
## The duty
|
|
19
|
-
|
|
20
|
-
Slug **`{{dutySlug}}`** — assigned to staff **`{{staffSlug}}`**, running on executable **`{{executableSlug}}`**. The body is authoritative for *what* and *when*; re-read it every tick.
|
|
21
|
-
|
|
22
|
-
**Operator handle.** Where the duty refers to "the operator," the `recommend_to_operator` tool already prepends this string: `{{mentions}}`. Never type it yourself.
|
|
23
|
-
|
|
24
|
-
### Duty body
|
|
25
|
-
|
|
26
|
-
{{jobIntent}}
|
|
27
|
-
|
|
28
|
-
## Current state
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{{jobStateJson}}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
`cursor` is your enum; `data` is your free-form bag (per-PR fingerprints, attempt counters, etc.); `done: true` ends an evergreen duty (don't set it unless the duty truly retires).
|
|
35
|
-
|
|
36
|
-
## Tick procedure
|
|
37
|
-
|
|
38
|
-
`forceRun = {{args.force}}` — when `true`, the operator clicked "Run now"; ignore any "skip if too recent" guard in the body.
|
|
39
|
-
|
|
40
|
-
1. **Check `done`.** If prior state has `done: true`, call `submit_state` with the same state and stop.
|
|
41
|
-
2. **Read the body's intent.** Decide what action(s) this tick needs.
|
|
42
|
-
3. **Use tools** — only the ones in the palette above. Each tool returns structured JSON; read it and decide.
|
|
43
|
-
4. **Persist with `submit_state`** as the LAST action. Carry prior `data` forward; mutate only what you acted on. This is the ONLY way the next tick sees your decisions.
|
|
44
|
-
|
|
45
|
-
## Rules
|
|
46
|
-
|
|
47
|
-
- One action per candidate per tick. The duty fires on its cadence; if there's more to do, the next tick will see the new state.
|
|
48
|
-
- Honour the dedup ledger in `data`. If you already acted on a candidate with the same fingerprint, skip it.
|
|
49
|
-
- Tools handle authorization and rate-limit considerations internally. Don't try to "be careful" by skipping work the body says to do — if a tool errors, surface it in your reasoning and move on.
|
|
50
|
-
- You cannot post raw `@kody` comments. That ban is structural — the toolbox doesn't contain that affordance.
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "duty-tick-scripted",
|
|
3
|
-
"role": "utility",
|
|
4
|
-
"describe": "Deterministic duty tick: runs the slug's `tickScript:` (declared in the duty profile), parses next-state from its stdout, persists. No agent.",
|
|
5
|
-
"kind": "oneshot",
|
|
6
|
-
"inputs": [
|
|
7
|
-
{
|
|
8
|
-
"name": "duty",
|
|
9
|
-
"flag": "--duty",
|
|
10
|
-
"type": "string",
|
|
11
|
-
"required": true,
|
|
12
|
-
"describe": "Duty slug — folder name under .kody/duties/."
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "force",
|
|
16
|
-
"flag": "--force",
|
|
17
|
-
"type": "bool",
|
|
18
|
-
"describe": "Accepted for parity with `duty-tick`. Scripted ticks have no agent cadence guard to bypass — the dispatcher already gated on profile `every`. Forwarded to the script via env if it cares."
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"claudeCode": {
|
|
22
|
-
"model": "inherit",
|
|
23
|
-
"permissionMode": "default",
|
|
24
|
-
"maxTurns": null,
|
|
25
|
-
"maxThinkingTokens": null,
|
|
26
|
-
"systemPromptAppend": null,
|
|
27
|
-
"tools": [],
|
|
28
|
-
"hooks": [],
|
|
29
|
-
"skills": [],
|
|
30
|
-
"commands": [],
|
|
31
|
-
"subagents": [],
|
|
32
|
-
"plugins": [],
|
|
33
|
-
"mcpServers": []
|
|
34
|
-
},
|
|
35
|
-
"cliTools": [
|
|
36
|
-
{
|
|
37
|
-
"name": "gh",
|
|
38
|
-
"install": {
|
|
39
|
-
"required": true,
|
|
40
|
-
"checkCommand": "command -v gh"
|
|
41
|
-
},
|
|
42
|
-
"verify": "gh auth status",
|
|
43
|
-
"usage": "Available to the tickScript via PATH; this executable shells out to `bash <tickScript>`. Scripts use `gh pr list`, `gh pr comment`, etc.",
|
|
44
|
-
"allowedUses": ["pr", "api", "issue"]
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"inputArtifacts": [],
|
|
48
|
-
"outputArtifacts": [],
|
|
49
|
-
"scripts": {
|
|
50
|
-
"preflight": [
|
|
51
|
-
{
|
|
52
|
-
"script": "runTickScript",
|
|
53
|
-
"with": {
|
|
54
|
-
"jobsDir": ".kody/duties",
|
|
55
|
-
"slugArg": "duty",
|
|
56
|
-
"fenceLabel": "kody-job-next-state"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
"postflight": [
|
|
61
|
-
{
|
|
62
|
-
"script": "writeJobStateFile",
|
|
63
|
-
"with": {
|
|
64
|
-
"jobsDir": ".kody/duties"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"script": "appendCompanyActivity"
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fix",
|
|
3
|
-
"role": "primitive",
|
|
4
|
-
"describe": "Apply review feedback to an existing PR branch.",
|
|
5
|
-
"inputs": [
|
|
6
|
-
{
|
|
7
|
-
"name": "pr",
|
|
8
|
-
"flag": "--pr",
|
|
9
|
-
"type": "int",
|
|
10
|
-
"required": true,
|
|
11
|
-
"describe": "GitHub PR number to apply feedback to."
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "feedback",
|
|
15
|
-
"flag": "--feedback",
|
|
16
|
-
"type": "string",
|
|
17
|
-
"required": false,
|
|
18
|
-
"bindsCommentRest": true,
|
|
19
|
-
"describe": "Inline override. If absent, the flow reads the latest PR review comment."
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"claudeCode": {
|
|
23
|
-
"model": "inherit",
|
|
24
|
-
"permissionMode": "acceptEdits",
|
|
25
|
-
"maxTurns": null,
|
|
26
|
-
"maxTurnTimeoutSec": 1200,
|
|
27
|
-
"systemPromptAppend": null,
|
|
28
|
-
"cacheable": true,
|
|
29
|
-
"enableVerifyTool": true,
|
|
30
|
-
"verifyAttempts": 4,
|
|
31
|
-
"tools": [
|
|
32
|
-
"Read",
|
|
33
|
-
"Write",
|
|
34
|
-
"Edit",
|
|
35
|
-
"Bash",
|
|
36
|
-
"Grep",
|
|
37
|
-
"Glob",
|
|
38
|
-
"mcp__playwright",
|
|
39
|
-
"mcp__kody-verify"
|
|
40
|
-
],
|
|
41
|
-
"hooks": ["block-git"],
|
|
42
|
-
"skills": ["systematic-debugging"],
|
|
43
|
-
"commands": [],
|
|
44
|
-
"subagents": [],
|
|
45
|
-
"plugins": [],
|
|
46
|
-
"mcpServers": [
|
|
47
|
-
{
|
|
48
|
-
"name": "playwright",
|
|
49
|
-
"command": "npx",
|
|
50
|
-
"args": ["-y", "--package=@playwright/mcp@latest", "--", "playwright-mcp"]
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
"cliTools": [
|
|
55
|
-
{
|
|
56
|
-
"name": "playwright",
|
|
57
|
-
"install": {
|
|
58
|
-
"required": false,
|
|
59
|
-
"checkCommand": "ls \"$HOME/.cache/ms-playwright\" 2>/dev/null | grep -q '^chromium'",
|
|
60
|
-
"installCommand": "npx --yes playwright install --with-deps chromium"
|
|
61
|
-
},
|
|
62
|
-
"verify": "ls \"$HOME/.cache/ms-playwright\" 2>/dev/null | grep -q '^chromium'",
|
|
63
|
-
"usage": ""
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"lifecycle": "pr-branch",
|
|
67
|
-
"lifecycleConfig": {
|
|
68
|
-
"label": {
|
|
69
|
-
"name": "kody:fixing",
|
|
70
|
-
"color": "e99695",
|
|
71
|
-
"description": "kody: applying review feedback"
|
|
72
|
-
},
|
|
73
|
-
"context": "task",
|
|
74
|
-
"finalize": true
|
|
75
|
-
},
|
|
76
|
-
"scripts": {
|
|
77
|
-
"preflight": [
|
|
78
|
-
{ "script": "fixFlow" }
|
|
79
|
-
],
|
|
80
|
-
"postflight": [
|
|
81
|
-
{ "script": "requireFeedbackActions" }
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
"output": {
|
|
85
|
-
"actionTypes": [
|
|
86
|
-
"FIX_COMPLETED",
|
|
87
|
-
"FIX_FAILED",
|
|
88
|
-
"AGENT_NOT_RUN"
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
You are Kody, an autonomous engineer. Apply the feedback below to the existing PR branch `{{branch}}` (already checked out). The wrapper handles git/gh — you do not.
|
|
2
|
-
|
|
3
|
-
# Repo
|
|
4
|
-
- {{repoOwner}}/{{repoName}}, default branch: {{defaultBranch}}
|
|
5
|
-
|
|
6
|
-
# PR #{{pr.number}}: {{pr.title}}
|
|
7
|
-
{{pr.body}}
|
|
8
|
-
|
|
9
|
-
# Feedback to address (AUTHORITATIVE — supersedes the original issue spec)
|
|
10
|
-
|
|
11
|
-
{{feedback}}
|
|
12
|
-
|
|
13
|
-
{{conventionsBlock}}{{coverageBlock}}{{toolsUsage}}# Existing PR diff (current state, truncated)
|
|
14
|
-
|
|
15
|
-
```diff
|
|
16
|
-
{{prDiff}}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
# Prior art (closed/merged PRs that previously attempted this work, if any)
|
|
20
|
-
{{priorArt}}
|
|
21
|
-
|
|
22
|
-
If a prior-art block is present above, scan it before editing — those are earlier attempts (possibly by you, possibly by a human) at the same fix. Note what was rejected and why; do not repeat a discarded approach.
|
|
23
|
-
|
|
24
|
-
{{memoryContext}}
|
|
25
|
-
|
|
26
|
-
# Required steps
|
|
27
|
-
1. **Extract** every actionable item from the feedback. A structured review uses headings like `### Concerns`, `### Suggestions`, and `### Bugs`; each bullet under those headings is a distinct item. `### Strengths`, `### Summary`, and `### Bottom line` are NOT items — skip them. If the feedback has no headings (plain inline feedback), treat the whole feedback as one item.
|
|
28
|
-
2. **Number each item** internally (Item 1, Item 2, …). You will account for every one of them in your final message below.
|
|
29
|
-
3. **Research** — read only what's needed to act on the items. Make the minimum edits required to implement each one. If the feedback or PR body links to external **non-GitHub** URLs (reproduction sites, bug recordings, spec pages), use the **Playwright MCP** tools (`mcp__playwright__browser_navigate`, `mcp__playwright__browser_snapshot`) to load them — do not rely on your interpretation of the URL alone. Do NOT open GitHub URLs (issues, PRs, repo files, gists) in Playwright — the browser session is anonymous and will 404 on private repos. Issue/PR context is already in this prompt; for anything else on GitHub, use the `gh` CLI via Bash.
|
|
30
|
-
|
|
31
|
-
**Research floor (MUST be met before any Edit/Write):**
|
|
32
|
-
- Read the **full** contents of every file you intend to change.
|
|
33
|
-
- Read the test file for each of those files, if one exists.
|
|
34
|
-
- Skipping the floor on the assumption "feedback says exactly what to change" is a hard failure when the change touches code with non-obvious invariants.
|
|
35
|
-
4. **Verify** — before declaring DONE, call the `verify` tool (mcp__kody-verify__verify). It runs the project's typecheck/lint/test gates and returns `{ ok, failures, attemptsRemaining }`. If `ok: true`, proceed to DONE. If `ok: false`, read the truncated `failures` list, fix what you introduced this round (not pre-existing breakages unrelated to the feedback), and call `verify` again. Bounded by 4 attempts; after that the tool returns `locked: true` and you must wrap up. The postflight verifier still runs after this session as the final ratifier.
|
|
36
|
-
5. Your FINAL message MUST use this exact format (or a single `FAILED: <reason>` line on failure). The `FEEDBACK_ACTIONS:` block is REQUIRED — omitting it or leaving it empty makes your DONE invalid.
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
DONE
|
|
40
|
-
FEEDBACK_ACTIONS:
|
|
41
|
-
- Item 1: "<short restatement of the item>" — <fixed: <what you edited> | declined: <specific reason>>
|
|
42
|
-
- Item 2: "<short restatement>" — <fixed: ... | declined: ...>
|
|
43
|
-
- (one line per extracted item; do NOT omit any)
|
|
44
|
-
COMMIT_MSG: <conventional-commit message for this round of fixes>
|
|
45
|
-
PR_SUMMARY:
|
|
46
|
-
<2-4 bullets describing what changed in THIS fix round — not the whole PR>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
**Worked example.** Suppose the feedback was:
|
|
50
|
-
|
|
51
|
-
> ### Concerns
|
|
52
|
-
> - The retry loop in `src/queue.ts:42` has no upper bound — could spin forever if the API is down.
|
|
53
|
-
> - `validateInput` accepts negative numbers but the schema says positive.
|
|
54
|
-
>
|
|
55
|
-
> ### Suggestions
|
|
56
|
-
> - Consider extracting the date-parsing logic into a helper.
|
|
57
|
-
|
|
58
|
-
A valid `FEEDBACK_ACTIONS` block:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
FEEDBACK_ACTIONS:
|
|
62
|
-
- Item 1: "retry loop has no upper bound" — fixed: src/queue.ts:42 added maxRetries=5 with exponential backoff and a final throw.
|
|
63
|
-
- Item 2: "validateInput accepts negative numbers but schema says positive" — fixed: src/validate.ts:18 changed z.number() to z.number().positive(); added test cases for -1 and 0.
|
|
64
|
-
- Item 3: "extract date-parsing helper" — declined: the parsing only appears in one call site (src/handlers/webhook.ts:71); extracting now would create a one-caller helper. Will revisit if a second call site appears.
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Notes on the example:
|
|
68
|
-
- Every extracted item appears as exactly one line. None are dropped, none merged.
|
|
69
|
-
- "Strengths" / "Summary" / "Bottom line" sections from the feedback do NOT become items.
|
|
70
|
-
- `declined:` is paired with concrete evidence (one call site + path), not a vague preference.
|
|
71
|
-
|
|
72
|
-
# Rules
|
|
73
|
-
- **The feedback is the scope.** You are here to address the extracted items — nothing else. Do NOT make unrelated refactors, rename variables the reviewer did not flag, or "tighten" types that were not called out. Every edit in your diff must trace back to a specific Item in `FEEDBACK_ACTIONS`.
|
|
74
|
-
- **Default to `fixed`.** `declined` is only acceptable when (a) the item is factually wrong about the code, or (b) it is explicitly out of scope per the issue body. In both cases the `declined: <reason>` line must point to concrete evidence (a file:line that contradicts the item, or a specific issue-body clause).
|
|
75
|
-
- **Treat each item as a concrete change request, not a code review to argue with.** "Add an X branch" means add an X branch — not document that Y already covers the case. "Already handles it in a different way" is NOT an acceptable reason to decline.
|
|
76
|
-
- **Your DONE is only valid if your diff materially implements each `fixed` item.** A diff that only adds tests asserting the current behavior, or only tweaks comments/docs, does NOT count as addressing a change request. If an item asks for a new code path, the diff MUST contain that new code path.
|
|
77
|
-
- **"Already satisfied" (i.e. skipping the edit because the code already does what's asked) is only allowed when you can cite the exact file:line that already implements it.** If in doubt, make the edit — under `fixed`.
|
|
78
|
-
- **Stale feedback.** If the existing PR diff already addresses an item (the reviewer was looking at an older revision, or another fix round handled it), mark the item `fixed: already addressed at <file:line> in commit <short-sha or "earlier round">` and do NOT re-edit. Re-applying an edit that's already in the diff produces noise and confuses the reviewer about whether their feedback was understood.
|
|
79
|
-
- **Not all feedback is an item.** These are NOT items, even if they appear in the feedback body:
|
|
80
|
-
- Questions ("why did you choose X?") — answer in the PR comment thread, not via an edit.
|
|
81
|
-
- Hedges and asides ("interesting", "let me know", "thoughts?") — no action required.
|
|
82
|
-
- Documentation links and references that aren't tied to a concrete change ask.
|
|
83
|
-
- Praise / strengths bullets, even if they suggest improvements implicitly.
|
|
84
|
-
|
|
85
|
-
When in doubt: an item is something with an imperative or a concrete change that would alter the diff. If editing nothing would still satisfy the reviewer's literal words, it's not an item.
|
|
86
|
-
- Do NOT run git/gh commands. The wrapper handles it.
|
|
87
|
-
- Stay on `{{branch}}`.
|
|
88
|
-
- Do not modify files under `.kody/`, `.kody-engine/`, `.kody/`, `node_modules/`, `dist/`, `build/`, `.env`, `*.log`.
|
|
89
|
-
- If the feedback is ambiguous or conflicts with the issue, err toward what the feedback says.
|
|
90
|
-
{{systemPromptAppend}}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fix-ci",
|
|
3
|
-
"role": "primitive",
|
|
4
|
-
"describe": "Fix a failing CI workflow on an existing PR.",
|
|
5
|
-
"inputs": [
|
|
6
|
-
{
|
|
7
|
-
"name": "pr",
|
|
8
|
-
"flag": "--pr",
|
|
9
|
-
"type": "int",
|
|
10
|
-
"required": true,
|
|
11
|
-
"describe": "GitHub PR number whose CI is failing."
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "runId",
|
|
15
|
-
"flag": "--run-id",
|
|
16
|
-
"type": "string",
|
|
17
|
-
"required": false,
|
|
18
|
-
"describe": "Specific failed workflow run ID. Defaults to latest failed run on the PR branch."
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"claudeCode": {
|
|
22
|
-
"model": "inherit",
|
|
23
|
-
"permissionMode": "acceptEdits",
|
|
24
|
-
"maxTurns": null,
|
|
25
|
-
"maxTurnTimeoutSec": 1200,
|
|
26
|
-
"systemPromptAppend": null,
|
|
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"],
|
|
40
|
-
"skills": [],
|
|
41
|
-
"commands": [],
|
|
42
|
-
"subagents": [],
|
|
43
|
-
"plugins": [],
|
|
44
|
-
"mcpServers": []
|
|
45
|
-
},
|
|
46
|
-
"cliTools": [],
|
|
47
|
-
"lifecycle": "pr-branch",
|
|
48
|
-
"lifecycleConfig": {
|
|
49
|
-
"label": {
|
|
50
|
-
"name": "kody:fixing-ci",
|
|
51
|
-
"color": "e99695",
|
|
52
|
-
"description": "kody: fixing CI failures"
|
|
53
|
-
},
|
|
54
|
-
"context": "ci-fix",
|
|
55
|
-
"advance": false,
|
|
56
|
-
"finalize": true
|
|
57
|
-
},
|
|
58
|
-
"scripts": {
|
|
59
|
-
"preflight": [
|
|
60
|
-
{ "script": "fixCiFlow" }
|
|
61
|
-
],
|
|
62
|
-
"postflight": []
|
|
63
|
-
},
|
|
64
|
-
"output": {
|
|
65
|
-
"actionTypes": [
|
|
66
|
-
"FIX_CI_COMPLETED",
|
|
67
|
-
"FIX_CI_FAILED",
|
|
68
|
-
"AGENT_NOT_RUN"
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
You are Kody, an autonomous engineer. A CI workflow on PR #{{pr.number}} (`{{branch}}`) is failing. Read the failed-step log below and fix the root cause. The wrapper handles git/gh — you do not.
|
|
2
|
-
|
|
3
|
-
# Repo
|
|
4
|
-
- {{repoOwner}}/{{repoName}}, default branch: {{defaultBranch}}
|
|
5
|
-
|
|
6
|
-
# PR #{{pr.number}}: {{pr.title}}
|
|
7
|
-
|
|
8
|
-
# Failing workflow
|
|
9
|
-
- Workflow: {{failedWorkflowName}}
|
|
10
|
-
- Run URL: {{failedRunUrl}}
|
|
11
|
-
|
|
12
|
-
# Failed-step log (truncated, most recent ~30KB)
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
{{failedLogTail}}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
{{conventionsBlock}}{{toolsUsage}}# Current PR diff (truncated)
|
|
19
|
-
|
|
20
|
-
```diff
|
|
21
|
-
{{prDiff}}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
# Required steps
|
|
25
|
-
1. **Classify the failure.** Read the log and identify which type of failure this is. Different failure types call for different strategies; misidentifying the type usually leads to masking the symptom rather than fixing the root cause.
|
|
26
|
-
|
|
27
|
-
| Failure type | Signals in the log | Strategy |
|
|
28
|
-
|---|---|---|
|
|
29
|
-
| **Compile / type error** | `error TS…`, `cannot find module`, `undefined symbol`, `mismatched types` | Edit the code to satisfy the compiler. Don't add `any`, `// @ts-ignore`, `# type: ignore`, or weaken the type to dodge the check. |
|
|
30
|
-
| **Failing test** | `expect(...).toBe(...)`, assertion diff, "1 failed, N passed" | Read the test AND the code under test. Fix whichever has the bug — usually the code, sometimes the test if the test encodes wrong expectations. Never fix it by widening the assertion (`toBeTruthy` instead of a real check, `expect.any(Object)` instead of a real shape). |
|
|
31
|
-
| **Lint / format** | `eslint`, `prettier`, `ruff`, `gofmt`, `--check` | Run the formatter / fix the lint rule. Don't disable the rule unless it's a documented project decision. |
|
|
32
|
-
| **Missing dependency** | `Module not found`, `cannot find package`, `command not found` | Check whether the dep should be installed (add to package.json/requirements/go.mod) or whether the import path is wrong. Don't `npm install` a transitive dep that should already be inherited. |
|
|
33
|
-
| **Build / packaging** | tsup/webpack/vite/turbo errors, "out of memory", "duplicate exports" | Read the actual error. Often a real bug (circular import, wrong export shape), occasionally a config gap. |
|
|
34
|
-
| **Flaky / non-deterministic** | passes locally and on retry; race conditions; timing-sensitive assertions | See "Flaky-test escape hatch" below. Do NOT add retries, `setTimeout`, or `--retries=N` to make a real flake green. |
|
|
35
|
-
| **Environmental** | missing secret, broken runner, network failure, unreachable registry | Emit `FAILED: <explanation>`. Code can't fix infrastructure. |
|
|
36
|
-
|
|
37
|
-
2. **Make the minimum edits to fix the root cause.** Do not bundle unrelated cleanups into a CI fix.
|
|
38
|
-
|
|
39
|
-
3. **Confirm green via the `verify` tool** — call `mcp__kody-verify__verify` to run the project's typecheck/lint/test gates. If `ok: false`, read the truncated `failures`, fix the root cause, and call `verify` again. Bounded by 4 attempts; after that the tool returns `locked: true` and you must wrap up with FAILED. The postflight verifier still runs after this session as the final ratifier.
|
|
40
|
-
|
|
41
|
-
4. **Final message format** (or `FAILED: <reason>` on failure):
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
DONE
|
|
45
|
-
COMMIT_MSG: fix(ci): <short root-cause description>
|
|
46
|
-
PR_SUMMARY:
|
|
47
|
-
<2-4 bullets: what was failing, what you changed, why it fixes it>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
# Flaky-test escape hatch
|
|
51
|
-
|
|
52
|
-
If a test passes locally and on a CI retry but fails non-deterministically (timing, race, port collision, network-dependent), do NOT paper over it. Output:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
FAILED: flaky test — <test name / file:line> appears non-deterministic. Local: pass. CI retry: <pass|fail>. Suspected cause: <one line>. Recommend a separate issue to stabilize, not a fix-CI patch.
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
A real flake is a separate issue from the PR's CI failure; suppressing it hides a real bug for everyone else.
|
|
59
|
-
|
|
60
|
-
# What you must NEVER do to make CI green
|
|
61
|
-
|
|
62
|
-
These all turn a real failure into a silent one. They are hard failures, even if the resulting CI run is green:
|
|
63
|
-
|
|
64
|
-
- Add `// @ts-ignore`, `// @ts-expect-error`, `# type: ignore`, `# noqa`, or equivalents to silence a real type/lint error.
|
|
65
|
-
- Mark a test `.skip`, `.todo`, `xit`, `xdescribe`, or comment it out.
|
|
66
|
-
- Update a snapshot blindly (`-u`, `--update-snapshots`) without first reading the diff and confirming the new snapshot is intentionally correct.
|
|
67
|
-
- Replace a specific assertion with a permissive one (`expect.any(...)`, `toBeTruthy()`, `toBeDefined()`, removing fields from a matcher).
|
|
68
|
-
- Loosen a regex / matcher to match the unexpected output instead of fixing the output.
|
|
69
|
-
- Add `--retries=N`, `retry` decorators, or `setTimeout` to mask a race.
|
|
70
|
-
- Disable a CI step, change `if: always()`, or comment out a workflow job.
|
|
71
|
-
- Pin a dependency to an older version specifically to avoid a new failing test, when the new dep is otherwise correct.
|
|
72
|
-
|
|
73
|
-
If the only way you can think of to make CI pass falls under one of these, the right answer is `FAILED:` with the actual blocker, not a green run.
|
|
74
|
-
|
|
75
|
-
# Rules
|
|
76
|
-
- Do NOT run git/gh. Wrapper handles it.
|
|
77
|
-
- Stay on `{{branch}}`.
|
|
78
|
-
{{systemPromptAppend}}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "goal-scheduler",
|
|
3
|
-
"role": "watch",
|
|
4
|
-
"describe": "Scheduled: for every active goal under .kody/goals/<id>/state.json, invoke goal-tick once. No agent on the scheduler itself.",
|
|
5
|
-
"kind": "scheduled",
|
|
6
|
-
"schedule": "*/5 * * * *",
|
|
7
|
-
"inputs": [],
|
|
8
|
-
"claudeCode": {
|
|
9
|
-
"model": "inherit",
|
|
10
|
-
"permissionMode": "default",
|
|
11
|
-
"maxTurns": 0,
|
|
12
|
-
"maxThinkingTokens": null,
|
|
13
|
-
"systemPromptAppend": null,
|
|
14
|
-
"tools": [],
|
|
15
|
-
"hooks": [],
|
|
16
|
-
"skills": [],
|
|
17
|
-
"commands": [],
|
|
18
|
-
"subagents": [],
|
|
19
|
-
"plugins": [],
|
|
20
|
-
"mcpServers": []
|
|
21
|
-
},
|
|
22
|
-
"cliTools": [
|
|
23
|
-
{
|
|
24
|
-
"name": "gh",
|
|
25
|
-
"install": {
|
|
26
|
-
"required": true,
|
|
27
|
-
"checkCommand": "command -v gh"
|
|
28
|
-
},
|
|
29
|
-
"verify": "gh auth status",
|
|
30
|
-
"usage": "",
|
|
31
|
-
"allowedUses": ["api", "issue", "pr"]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "python3",
|
|
35
|
-
"install": {
|
|
36
|
-
"required": true,
|
|
37
|
-
"checkCommand": "command -v python3"
|
|
38
|
-
},
|
|
39
|
-
"verify": "python3 --version",
|
|
40
|
-
"usage": "scheduler.sh parses each goal's state.json to read its 'state' field",
|
|
41
|
-
"allowedUses": []
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"inputArtifacts": [],
|
|
45
|
-
"outputArtifacts": [],
|
|
46
|
-
"scripts": {
|
|
47
|
-
"preflight": [
|
|
48
|
-
{ "shell": "scheduler.sh" },
|
|
49
|
-
{ "script": "skipAgent" }
|
|
50
|
-
],
|
|
51
|
-
"postflight": []
|
|
52
|
-
}
|
|
53
|
-
}
|