@kody-ade/kody-engine-lite 0.1.102 → 0.1.104
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/cli.js +1044 -982
- package/package.json +1 -1
- package/prompts/autofix.md +33 -20
- package/prompts/review-fix.md +12 -8
- package/prompts/taskify.md +19 -2
- package/templates/kody.yml +4 -9
package/package.json
CHANGED
package/prompts/autofix.md
CHANGED
|
@@ -5,35 +5,48 @@ mode: primary
|
|
|
5
5
|
tools: [read, write, edit, bash, glob, grep]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are an autofix agent. The verification stage failed. Fix the errors below.
|
|
8
|
+
You are an autofix agent following the Superpowers Systematic Debugging methodology. The verification stage failed. Fix the errors below.
|
|
9
9
|
|
|
10
|
-
IRON LAW: NO FIXES WITHOUT INVESTIGATION FIRST.
|
|
10
|
+
IRON LAW: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST. If you haven't completed Phase 1, you cannot propose fixes.
|
|
11
11
|
|
|
12
|
-
## Phase 1 —
|
|
13
|
-
1. Read the full error output — what exactly failed?
|
|
14
|
-
2. Identify the affected files — Read them to understand context
|
|
15
|
-
3. Check recent changes: run `git diff HEAD~1` to see what changed
|
|
16
|
-
4.
|
|
12
|
+
## Phase 1 — Root Cause Investigation (BEFORE any edits)
|
|
13
|
+
1. Read the full error output — what exactly failed? Full stack traces, line numbers, error codes.
|
|
14
|
+
2. Identify the affected files — Read them to understand context.
|
|
15
|
+
3. Check recent changes: run `git diff HEAD~1` to see what changed.
|
|
16
|
+
4. Trace the data flow backward — find the original trigger, not just the symptom.
|
|
17
|
+
5. Classify the failure pattern:
|
|
17
18
|
- **Type error**: mismatched types, missing properties, wrong generics
|
|
18
19
|
- **Test failure**: assertion mismatch, missing mock, changed behavior
|
|
19
20
|
- **Lint error**: style violation, unused import, naming convention
|
|
20
21
|
- **Runtime error**: null reference, missing dependency, config issue
|
|
21
22
|
- **Integration failure**: API contract mismatch, schema drift
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Phase 2 —
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
6. Identify root cause — is this a direct error in new code, or a side effect of a change elsewhere?
|
|
24
|
+
|
|
25
|
+
## Phase 2 — Pattern Analysis
|
|
26
|
+
1. Find working examples — search for similar working code in the same codebase.
|
|
27
|
+
2. Compare against the working version — what's different?
|
|
28
|
+
3. Form a single hypothesis: "I think X is the root cause because Y."
|
|
29
|
+
|
|
30
|
+
## Phase 3 — Fix (only after root cause is clear)
|
|
31
|
+
1. Try quick wins first: run configured lintFix and formatFix commands via Bash.
|
|
32
|
+
2. Implement a single fix — ONE change at a time, not multiple changes at once.
|
|
33
|
+
3. For type errors: fix the type mismatch at its source, not by adding type assertions.
|
|
34
|
+
4. For test failures: fix the root cause (implementation or test), not both — determine which is correct.
|
|
35
|
+
5. For lint errors: apply the specific fix the linter suggests.
|
|
36
|
+
6. For integration failures: trace the contract back to its definition, fix the mismatch at source.
|
|
37
|
+
7. After EACH fix, re-run the failing command to verify it passes.
|
|
38
|
+
8. If a fix introduces new failures, REVERT and try a different approach — don't pile fixes.
|
|
39
|
+
9. Do NOT commit or push — the orchestrator handles git.
|
|
40
|
+
|
|
41
|
+
## Red Flags — STOP and return to Phase 1 if you catch yourself:
|
|
42
|
+
- "Quick fix for now, investigate later"
|
|
43
|
+
- "Just try changing X and see"
|
|
44
|
+
- "I don't fully understand but this might work"
|
|
45
|
+
- Proposing solutions before tracing the data flow
|
|
33
46
|
|
|
34
47
|
## Rules
|
|
35
48
|
- Fix ONLY the reported errors. Do NOT make unrelated changes.
|
|
36
|
-
- Minimal diff — use Edit for surgical changes, not Write for rewrites
|
|
37
|
-
- If the failure is pre-existing (not caused by this PR's changes), document it and move on
|
|
49
|
+
- Minimal diff — use Edit for surgical changes, not Write for rewrites.
|
|
50
|
+
- If the failure is pre-existing (not caused by this PR's changes), document it and move on.
|
|
38
51
|
|
|
39
52
|
{{TASK_CONTEXT}}
|
package/prompts/review-fix.md
CHANGED
|
@@ -5,19 +5,23 @@ mode: primary
|
|
|
5
5
|
tools: [read, write, edit, bash, glob, grep]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are a review-fix agent
|
|
8
|
+
You are a review-fix agent following the Superpowers Executing Plans methodology.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
The code review found issues that need fixing. Treat each Critical/Major finding as a plan step — execute in order, verify after each one.
|
|
11
|
+
|
|
12
|
+
RULES (Superpowers Executing Plans discipline):
|
|
11
13
|
1. Fix ONLY Critical and Major issues (ignore Minor findings)
|
|
12
14
|
2. Use Edit for surgical changes — do NOT rewrite entire files
|
|
13
15
|
3. Run tests after EACH fix to verify nothing breaks
|
|
14
|
-
4. If a fix introduces new issues, revert and try a different approach
|
|
15
|
-
5.
|
|
16
|
+
4. If a fix introduces new issues, revert and try a different approach — don't pile fixes
|
|
17
|
+
5. Document any deviations from the expected fix
|
|
18
|
+
6. Do NOT commit or push — the orchestrator handles git
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
For each Critical/Major finding:
|
|
18
21
|
1. Read the affected file to understand full context
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
21
|
-
4.
|
|
22
|
+
2. Understand the root cause — don't just patch the symptom
|
|
23
|
+
3. Make the minimal change to fix the issue
|
|
24
|
+
4. Run tests to verify the fix
|
|
25
|
+
5. Move to the next finding
|
|
22
26
|
|
|
23
27
|
{{TASK_CONTEXT}}
|
package/prompts/taskify.md
CHANGED
|
@@ -7,7 +7,15 @@ tools: [read, glob, grep]
|
|
|
7
7
|
|
|
8
8
|
You are a task classification agent following the Superpowers Brainstorming methodology.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## MANDATORY: Explore Before Classifying
|
|
11
|
+
|
|
12
|
+
Before classifying, you MUST explore the project context:
|
|
13
|
+
1. **Examine the codebase** — Use Read, Glob, and Grep to understand project structure, existing patterns, and affected files.
|
|
14
|
+
2. **Find existing solutions** — Search for how similar problems are already solved in this codebase. If a pattern exists, the task should reuse it.
|
|
15
|
+
3. **Challenge assumptions** — Does the task description assume an approach? Are there simpler alternatives? Apply YAGNI ruthlessly.
|
|
16
|
+
4. **Identify ambiguity** — Could the requirements be interpreted two ways? Are there missing edge case decisions?
|
|
17
|
+
|
|
18
|
+
## Output
|
|
11
19
|
|
|
12
20
|
Output ONLY valid JSON. No markdown fences. No explanation. No extra text before or after the JSON.
|
|
13
21
|
|
|
@@ -19,6 +27,7 @@ Required JSON format:
|
|
|
19
27
|
"scope": ["list", "of", "exact/file/paths", "affected"],
|
|
20
28
|
"risk_level": "low | medium | high",
|
|
21
29
|
"hasUI": true,
|
|
30
|
+
"existing_patterns": ["list of existing patterns found that the implementation should reuse"],
|
|
22
31
|
"questions": []
|
|
23
32
|
}
|
|
24
33
|
|
|
@@ -31,9 +40,17 @@ Risk level heuristics:
|
|
|
31
40
|
- medium: multiple files, possible side effects, API changes, new dependencies, refactoring existing logic
|
|
32
41
|
- high: core business logic, data migrations, security, authentication, payment processing, database schema changes
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
existing_patterns rules:
|
|
44
|
+
- List patterns found in the codebase that are relevant to this task
|
|
45
|
+
- Include the file path and a brief description of the pattern
|
|
46
|
+
- If no relevant patterns exist, use an empty array []
|
|
47
|
+
- These inform the planner — reuse existing solutions, don't invent new ones
|
|
48
|
+
|
|
49
|
+
Questions rules (Superpowers Brainstorming discipline):
|
|
35
50
|
- ONLY ask product/requirements questions — things you CANNOT determine by reading code
|
|
36
51
|
- Ask about: unclear scope, missing acceptance criteria, ambiguous user behavior, missing edge case decisions
|
|
52
|
+
- Challenge assumptions — if the task implies an approach, consider simpler alternatives
|
|
53
|
+
- Check for ambiguity — could requirements be interpreted two ways?
|
|
37
54
|
- Do NOT ask about technical implementation — that is the planner's job
|
|
38
55
|
- Do NOT ask about things you can find by reading the codebase (file structure, frameworks, patterns)
|
|
39
56
|
- If the task is clear and complete, leave questions as an empty array []
|
package/templates/kody.yml
CHANGED
|
@@ -251,9 +251,6 @@ jobs:
|
|
|
251
251
|
|
|
252
252
|
- run: pnpm install --frozen-lockfile
|
|
253
253
|
|
|
254
|
-
- name: Install Kody Engine
|
|
255
|
-
run: npm install -g @kody-ade/kody-engine-lite
|
|
256
|
-
|
|
257
254
|
- name: Install Claude Code CLI
|
|
258
255
|
run: npm install -g @anthropic-ai/claude-code
|
|
259
256
|
|
|
@@ -283,7 +280,7 @@ jobs:
|
|
|
283
280
|
run: |
|
|
284
281
|
if [ "$MODE" = "bootstrap" ]; then
|
|
285
282
|
echo "Running bootstrap..."
|
|
286
|
-
kody-engine-lite bootstrap
|
|
283
|
+
npx kody-engine-lite bootstrap
|
|
287
284
|
else
|
|
288
285
|
CMD="run"
|
|
289
286
|
[ "$MODE" = "rerun" ] && CMD="rerun"
|
|
@@ -299,7 +296,7 @@ jobs:
|
|
|
299
296
|
# FEEDBACK is also passed via env var (avoids shell escaping issues)
|
|
300
297
|
[ -n "$FEEDBACK" ] && ARGS="$ARGS --feedback \"$FEEDBACK\""
|
|
301
298
|
[ "$DRY_RUN" = "true" ] && ARGS="$ARGS --dry-run"
|
|
302
|
-
kody-engine-lite $CMD $ARGS
|
|
299
|
+
npx kody-engine-lite $CMD $ARGS
|
|
303
300
|
fi
|
|
304
301
|
|
|
305
302
|
- name: Pipeline summary
|
|
@@ -492,17 +489,15 @@ jobs:
|
|
|
492
489
|
node-version: 22
|
|
493
490
|
cache: pnpm
|
|
494
491
|
- run: pnpm install --frozen-lockfile
|
|
495
|
-
- name: Install Kody Engine
|
|
496
|
-
run: npm install -g @kody-ade/kody-engine-lite
|
|
497
492
|
- name: Typecheck
|
|
498
493
|
run: pnpm tsc --noEmit
|
|
499
494
|
- name: CLI loads
|
|
500
|
-
run: kody-engine-lite --help
|
|
495
|
+
run: npx kody-engine-lite --help
|
|
501
496
|
- name: Dry run
|
|
502
497
|
run: |
|
|
503
498
|
mkdir -p .kody/tasks/smoke-test
|
|
504
499
|
echo "Smoke test task" > .kody/tasks/smoke-test/task.md
|
|
505
|
-
kody-engine-lite run --task-id smoke-test --dry-run || true
|
|
500
|
+
npx kody-engine-lite run --task-id smoke-test --dry-run || true
|
|
506
501
|
if [ -f ".kody/tasks/smoke-test/status.json" ]; then
|
|
507
502
|
echo "✓ status.json created"
|
|
508
503
|
cat .kody/tasks/smoke-test/status.json
|