@kody-ade/kody-engine 0.3.0 → 0.3.2

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.
@@ -15,6 +15,7 @@
15
15
  "flag": "--feedback",
16
16
  "type": "string",
17
17
  "required": false,
18
+ "bindsCommentRest": true,
18
19
  "describe": "Inline override. If absent, the flow reads the latest PR review comment."
19
20
  }
20
21
  ],
@@ -36,9 +37,26 @@
36
37
  "commands": [],
37
38
  "subagents": [],
38
39
  "plugins": [],
39
- "mcpServers": []
40
+ "mcpServers": [
41
+ {
42
+ "name": "playwright",
43
+ "command": "npx",
44
+ "args": ["-y", "@playwright/mcp@latest"]
45
+ }
46
+ ]
40
47
  },
41
- "cliTools": [],
48
+ "cliTools": [
49
+ {
50
+ "name": "playwright",
51
+ "install": {
52
+ "required": false,
53
+ "checkCommand": "ls \"$HOME/.cache/ms-playwright\" 2>/dev/null | grep -q '^chromium'",
54
+ "installCommand": "npx --yes playwright install --with-deps chromium"
55
+ },
56
+ "verify": "ls \"$HOME/.cache/ms-playwright\" 2>/dev/null | grep -q '^chromium'",
57
+ "usage": ""
58
+ }
59
+ ],
42
60
  "scripts": {
43
61
  "preflight": [
44
62
  {
@@ -27,9 +27,26 @@
27
27
  "commands": [],
28
28
  "subagents": [],
29
29
  "plugins": [],
30
- "mcpServers": []
30
+ "mcpServers": [
31
+ {
32
+ "name": "playwright",
33
+ "command": "npx",
34
+ "args": ["-y", "@playwright/mcp@latest"]
35
+ }
36
+ ]
31
37
  },
32
- "cliTools": [],
38
+ "cliTools": [
39
+ {
40
+ "name": "playwright",
41
+ "install": {
42
+ "required": false,
43
+ "checkCommand": "npx --no-install playwright --version",
44
+ "installCommand": "npx --yes playwright install --with-deps chromium"
45
+ },
46
+ "verify": "npx --no-install playwright --version",
47
+ "usage": ""
48
+ }
49
+ ],
33
50
  "scripts": {
34
51
  "preflight": [
35
52
  {
@@ -49,6 +66,9 @@
49
66
  {
50
67
  "script": "loadConventions"
51
68
  },
69
+ {
70
+ "script": "loadPriorArt"
71
+ },
52
72
  {
53
73
  "script": "composePrompt"
54
74
  }
@@ -1,6 +1,6 @@
1
- You are a senior engineer producing an **implementation plan** for the GitHub issue below. You will NOT write code. You will NOT run git or gh commands. You will NOT modify files. Your only outputs are:
1
+ You are a senior engineer producing a **deep, detailed implementation plan** for the GitHub issue below. The plan must be thorough enough that another engineer can implement the feature without re-doing research — file locations, function signatures, algorithms, edge cases, and tests are all specified. You will NOT write code. You will NOT run git or gh commands. You will NOT modify files.
2
2
 
3
- 1. Use Read / Grep / Glob / Bash (read-only) to study the codebase as much as needed.
3
+ 1. Use Read / Grep / Glob / Bash (read-only) to study the codebase as much as needed. Depth matters more than speed — invest turns in understanding before writing.
4
4
  2. Emit a final message with the plan wrapped in the required markers (see "Required output").
5
5
 
6
6
  ---
@@ -17,6 +17,43 @@ Recent comments (most recent first, truncated):
17
17
 
18
18
  {{conventionsBlock}}
19
19
 
20
+ {{priorArt}}
21
+
22
+ ---
23
+
24
+ # Delta mode — if a prior plan comment exists
25
+
26
+ Before writing the plan, scan the "Recent comments" block above for a previous
27
+ comment whose body starts with `## Plan for issue`. If one exists, you are in
28
+ **delta mode**:
29
+
30
+ 1. Treat the prior plan as the baseline. Do NOT regenerate unchanged sections
31
+ from scratch.
32
+ 2. Integrate the signal from comments posted AFTER the prior plan: user
33
+ answers, correction directives, new clarifying info, closed/merged PRs that
34
+ appeared since.
35
+ 3. In each section, mark changed bullets with `(updated)`, new bullets with
36
+ `(new)`, and removed items with `(removed — <reason>)`. Preserve unchanged
37
+ bullets verbatim so reviewers can diff.
38
+ 4. If nothing material has changed since the prior plan, output
39
+ `FAILED: no new information since last plan` instead of a duplicate.
40
+
41
+ If no prior `## Plan for issue` comment exists, produce a full first-pass
42
+ plan under the Required output structure below.
43
+
44
+ ---
45
+
46
+ # Research floor (MUST be done before writing the plan)
47
+
48
+ Before producing the final plan, you MUST have read:
49
+
50
+ - Every file you intend to change (the full file, not just a grep hit).
51
+ - The tests for each file you intend to change, if tests exist for that module.
52
+ - At least one sibling module that already implements the same pattern you're about to follow (reference implementations).
53
+ - The full prior-art diffs above (if any) — not just titles. Those represent failed solutions; understanding why they failed is part of the plan.
54
+
55
+ If a file you need to read does not exist, say so explicitly in the plan under "Ambiguities" — do NOT guess at its contents.
56
+
20
57
  ---
21
58
 
22
59
  # Required output
@@ -27,16 +64,87 @@ Your FINAL message must be exactly this shape (no extra text before or after):
27
64
  DONE
28
65
  COMMIT_MSG: plan: <very short title>
29
66
  PR_SUMMARY:
30
- <A concrete implementation plan in markdown. Include:
31
- - Files to change (with paths), and the change in each.
32
- - New files to create, with their purpose and rough shape.
33
- - Any ambiguities that need the human to resolve first.
34
- - Verification checklist (typecheck / tests / lint expectations).
35
- Keep to ~60 lines or less. No filler. No marketing language.>
67
+ <A deep, detailed implementation plan in markdown with the following sections, in order. Omit a section only if its trigger condition is not met — do not leave placeholders. Depth is expected; brevity for its own sake is not a goal.
68
+
69
+ ## Existing patterns found
70
+ For each major part of the change, name the sibling module in this repo that
71
+ already solves a similar problem and state how this plan reuses it.
72
+ - Pattern: <what kind of pattern e.g. "admin field with custom React component", "fetch-then-group client hook", "JSON strings module">
73
+ - Reference: <exact path in this repo, e.g. `src/ui/admin/LessonBlocksField/index.tsx`>
74
+ - Reuse: <how this plan follows it — which hooks/APIs/idioms are mirrored, what deviates and why>
75
+ If you searched and found nothing applicable, say so explicitly: "Searched
76
+ for X / Y / Z — no existing pattern; proposing new convention because …".
77
+ Proposing a new pattern when an existing one covers the use case is a
78
+ planning failure — fall back to reuse unless you name a concrete reason.
79
+
80
+ ## Changes (per file)
81
+ For EACH file you will change or create, include:
82
+ - Path (exact).
83
+ - Why this file — one sentence tying the change to the issue.
84
+ - Current state — what's there today (function/class/export names, relevant line ranges). Skip for new files.
85
+ - Target state — what will be there after the change, at the same level of specificity.
86
+ - Exact locations of edits (function name, line range if stable, or anchor like "after the `meta` group field, before the closing `fields: []`").
87
+ - For new files: rough shape including exports, key functions with signatures, and top-level module comment.
88
+ - Dependencies touched (imports added/removed, new packages) — call out if anything needs installing.
89
+
90
+ ## Algorithms & pseudocode
91
+ REQUIRED for any non-trivial logic (sorting, diffing, state transitions, concurrency, batching, caching, conflict resolution).
92
+ - Write pseudocode (not production code) showing the actual algorithm — inputs, steps, outputs.
93
+ - Call out invariants the algorithm preserves.
94
+ - Call out complexity (N swaps vs N-squared recalc vs single-batch write).
95
+ - If there's a choice between two algorithms, explain why you picked this one.
96
+
97
+ ## How clarifying answers shape the plan
98
+ REQUIRED if research asked clarifying questions and the issue comments contain user answers.
99
+ - For each answered question: name the concrete design choice the answer forces — not a restatement of the answer.
100
+ - "Answer: yes → init orders 10/20/30 on first interaction" → spell out: which function performs the init, when it runs (mount vs first-swap), how it detects the "first use" state, what happens on re-entry.
101
+
102
+ ## Why this will work
103
+ REQUIRED if research cites a prior failed attempt (closed PR, reverted commit, previous run that didn't land), or if prior-art above contains a diff.
104
+ - Root-cause hypothesis — what specifically went wrong in the prior attempt (cite lines from the prior diff above).
105
+ - The specific change in THIS plan that addresses the root cause — name the file/line/hook/config that differs from the prior attempt.
106
+ - How you will verify the fix works — a concrete behavioral check (URL + action + expected UI, or API call + expected response, or a test case). Not "typecheck passes."
107
+
108
+ ## API surface verification
109
+ REQUIRED for every hook, import, SDK method, framework primitive, or config key the plan names.
110
+ - Build a table or list. For each named symbol: the file path where it's defined, or the exact package + export (with a `node_modules/...` path you actually read), or the mark `UNVERIFIED`.
111
+ - Do not guess. If you could not find it with Read / Grep / Glob, it is UNVERIFIED. Do not rely on UNVERIFIED symbols in the plan — flag them as blockers.
112
+ - Include negative evidence too: "Searched for `useXxx` in `@payloadcms/ui` exports — not found; planner assumed `useDocumentInfo` instead."
113
+
114
+ ## Initial data state → transition → steady state
115
+ REQUIRED if the feature mutates existing data (reorder, migrate, backfill, rename, enable).
116
+ - Initial state: describe the data as it is in production today, including edge cases (rows with NULL, rows with default zero, orphan rows, etc).
117
+ - Transition: the exact step(s) that move data from initial → steady, including who triggers them (user action, migration script, on-mount hook), idempotency, and rollback behavior.
118
+ - Steady state: what invariants hold after transition.
119
+ - Failure modes during transition: partial-apply, race conditions, concurrent writers.
120
+
121
+ ## Error paths & failure handling
122
+ For each external call or mutation in the plan (API request, DB write, file op, SDK call), enumerate:
123
+ - What can fail (network, validation, auth, not-found, conflict, rate limit).
124
+ - What the UI/caller does on each failure — retry, surface error, rollback, log-and-continue.
125
+ - What state the system is left in if the op fails mid-way.
126
+
127
+ ## Test plan
128
+ - Specific test cases by name, with inputs and expected outputs. Not "add unit tests."
129
+ - Unit tests: one line per test naming what it asserts.
130
+ - Integration / behavioral tests: one line each, naming the flow covered and the assertion.
131
+ - Regression tests for the prior-art failure mode (if applicable) — a test that would have caught the prior bug.
132
+ - Manual verification steps: URL + click sequence + expected UI, or API call + expected response.
133
+
134
+ ## Ambiguities & assumptions
135
+ - List anything still unresolved that needs human input before implementation.
136
+ - List every assumption the plan makes that was NOT confirmed by the issue, comments, or code (e.g. "assumed `usePayload` hook exists — UNVERIFIED").
137
+
138
+ ## Verification checklist
139
+ - Build / typecheck / test / lint commands expected to pass after implementation.
140
+ - Each concrete behavioral check from "Test plan" restated as a pass/fail gate.
141
+
142
+ No filler. No marketing language. Depth over brevity.>
36
143
  ```
37
144
 
38
145
  # Rules
39
146
  - Read-only. Do NOT modify any file.
40
147
  - Do NOT run git or gh commands.
41
- - No speculative scope — plan only what the issue asks for.
148
+ - No speculative scope — plan only what the issue asks for, but plan it THOROUGHLY.
42
149
  - If the issue is ambiguous and you cannot make progress without input, output `FAILED: <what's unclear>` instead of a plan.
150
+ - If the Research floor cannot be met because required files are missing or unreadable, output `FAILED: <what could not be read>` instead of a half-blind plan.
@@ -27,9 +27,26 @@
27
27
  "commands": [],
28
28
  "subagents": [],
29
29
  "plugins": [],
30
- "mcpServers": []
30
+ "mcpServers": [
31
+ {
32
+ "name": "playwright",
33
+ "command": "npx",
34
+ "args": ["-y", "@playwright/mcp@latest"]
35
+ }
36
+ ]
31
37
  },
32
- "cliTools": [],
38
+ "cliTools": [
39
+ {
40
+ "name": "playwright",
41
+ "install": {
42
+ "required": false,
43
+ "checkCommand": "npx --no-install playwright --version",
44
+ "installCommand": "npx --yes playwright install --with-deps chromium"
45
+ },
46
+ "verify": "npx --no-install playwright --version",
47
+ "usage": ""
48
+ }
49
+ ],
33
50
  "scripts": {
34
51
  "preflight": [
35
52
  {
@@ -84,6 +101,11 @@
84
101
  "name": "research",
85
102
  "format": "markdown",
86
103
  "from": "prSummary"
104
+ },
105
+ {
106
+ "name": "priorArt",
107
+ "format": "json",
108
+ "from": "priorArt"
87
109
  }
88
110
  ]
89
111
  }
@@ -25,6 +25,7 @@ Your FINAL message must be exactly this shape (no extra text before or after):
25
25
  ```
26
26
  DONE
27
27
  COMMIT_MSG: research: <very short title>
28
+ PRIOR_ART: <JSON array of closed or merged PR numbers from this repo that are prior attempts at THIS issue, or [] if none. Include only PRs that actually touched the same feature/area — not every PR your research happens to mention. Example: [1086] or []. Must be valid JSON parseable as number[].>
28
29
  PR_SUMMARY:
29
30
  <A research doc in markdown with EXACTLY these sections, in order:
30
31
 
@@ -82,6 +83,9 @@ Gaps & assumptions — they live in the prior comment. Keep the whole delta
82
83
  under 25 lines. If nothing has changed since the prior research, output
83
84
  `FAILED: no new information since last research` instead.
84
85
 
86
+ `PRIOR_ART:` is still required in delta mode (carry forward the prior list,
87
+ or update it if new PRs became relevant since).
88
+
85
89
  If no prior `## Research for issue` comment exists in the thread, produce
86
90
  the full first-pass structure below.
87
91
 
@@ -28,9 +28,26 @@
28
28
  "commands": [],
29
29
  "subagents": [],
30
30
  "plugins": [],
31
- "mcpServers": []
31
+ "mcpServers": [
32
+ {
33
+ "name": "playwright",
34
+ "command": "npx",
35
+ "args": ["-y", "@playwright/mcp@latest"]
36
+ }
37
+ ]
32
38
  },
33
- "cliTools": [],
39
+ "cliTools": [
40
+ {
41
+ "name": "playwright",
42
+ "install": {
43
+ "required": false,
44
+ "checkCommand": "npx --no-install playwright --version",
45
+ "installCommand": "npx --yes playwright install --with-deps chromium"
46
+ },
47
+ "verify": "npx --no-install playwright --version",
48
+ "usage": ""
49
+ }
50
+ ],
34
51
  "scripts": {
35
52
  "preflight": [
36
53
  {
@@ -97,6 +97,13 @@ export interface InputSpec {
97
97
  * e.g. `{ mode: "run" }` or `{ mode: ["fix", "fix-ci", "resolve"] }`.
98
98
  */
99
99
  requiredWhen?: Record<string, string | string[]>
100
+ /**
101
+ * When true, this input collects any free-text left over from comment
102
+ * dispatch after flag/enum/bool parsing. Only one input per profile may
103
+ * set this. Used by e.g. `fix.feedback` so `@kody please change X` lands
104
+ * "please change X" in `feedback` without hardcoding that in the router.
105
+ */
106
+ bindsCommentRest?: boolean
100
107
  describe: string
101
108
  }
102
109
 
@@ -38,7 +38,13 @@
38
38
  "commands": [],
39
39
  "subagents": [],
40
40
  "plugins": [],
41
- "mcpServers": []
41
+ "mcpServers": [
42
+ {
43
+ "name": "playwright",
44
+ "command": "npx",
45
+ "args": ["-y", "@playwright/mcp@latest"]
46
+ }
47
+ ]
42
48
  },
43
49
  "cliTools": [
44
50
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
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",