@kody-ade/kody-engine 0.1.7 → 0.2.1
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/LICENSE +21 -0
- package/README.md +28 -61
- package/dist/bin/kody2.js +2579 -0
- package/dist/executables/build/profile.json +83 -0
- package/dist/executables/build/prompts/fix-ci.md +42 -0
- package/dist/executables/build/prompts/fix.md +40 -0
- package/dist/executables/build/prompts/resolve.md +34 -0
- package/dist/executables/build/prompts/run.md +31 -0
- package/dist/executables/types.ts +154 -0
- package/kody.config.schema.json +406 -0
- package/package.json +23 -28
- package/templates/kody2.yml +56 -0
- package/dist/bin/cli.mjs +0 -10781
- package/dist/bin/cli.mjs.map +0 -1
- package/opencode/agents/admin-expert.md +0 -73
- package/opencode/agents/advisor.md +0 -128
- package/opencode/agents/architect.md +0 -193
- package/opencode/agents/autofix.md +0 -103
- package/opencode/agents/build-delegation-test.md +0 -93
- package/opencode/agents/build-delegation.md +0 -98
- package/opencode/agents/build-manager.md +0 -212
- package/opencode/agents/build.md +0 -266
- package/opencode/agents/clarify.md +0 -84
- package/opencode/agents/code-reviewer.md +0 -42
- package/opencode/agents/commit.md +0 -27
- package/opencode/agents/docs.md +0 -123
- package/opencode/agents/domain/admin-expert.md +0 -43
- package/opencode/agents/domain/llm-expert.md +0 -55
- package/opencode/agents/domain/payload-expert.md +0 -67
- package/opencode/agents/domain/security-auditor.md +0 -62
- package/opencode/agents/domain/ui-expert.md +0 -43
- package/opencode/agents/domain/web-expert.md +0 -45
- package/opencode/agents/e2e-test-writer.md +0 -156
- package/opencode/agents/fix.md +0 -158
- package/opencode/agents/gap.md +0 -206
- package/opencode/agents/kody-expert.md +0 -173
- package/opencode/agents/llm-expert.md +0 -90
- package/opencode/agents/neuron.md +0 -12
- package/opencode/agents/payload-expert.md +0 -32
- package/opencode/agents/plan-gap.md +0 -132
- package/opencode/agents/pr.md +0 -25
- package/opencode/agents/review.md +0 -163
- package/opencode/agents/security-auditor.md +0 -33
- package/opencode/agents/taskify.md +0 -344
- package/opencode/agents/test-writer.md +0 -261
- package/opencode/agents/test.md +0 -142
- package/opencode/agents/verify.md +0 -30
- package/opencode/agents/web-expert.md +0 -63
- package/opencode/docs/BROWSER_AUTOMATION.md +0 -64
- package/opencode/docs/PIPELINE.md +0 -210
- package/opencode/opencode.json +0 -98
- package/templates/kody.yml +0 -312
package/templates/kody.yml
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
# Kody Pipeline — powered by @kody-ade/kody-engine
|
|
2
|
-
# This workflow is managed by the kody-engine package. To update, run:
|
|
3
|
-
# npx @kody-ade/kody-engine init --force
|
|
4
|
-
#
|
|
5
|
-
# Required secrets:
|
|
6
|
-
# - MINIMAX_API_KEY (or other LLM provider keys)
|
|
7
|
-
# - GH_PAT (optional, for cross-repo operations)
|
|
8
|
-
#
|
|
9
|
-
# Optional secrets:
|
|
10
|
-
# - GEMINI_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GROQ_API_KEY
|
|
11
|
-
|
|
12
|
-
name: kody
|
|
13
|
-
|
|
14
|
-
on:
|
|
15
|
-
workflow_dispatch:
|
|
16
|
-
inputs:
|
|
17
|
-
task_id:
|
|
18
|
-
description: "Task ID to run"
|
|
19
|
-
required: true
|
|
20
|
-
type: string
|
|
21
|
-
mode:
|
|
22
|
-
description: "Pipeline mode: spec, impl, rerun, full, status"
|
|
23
|
-
required: false
|
|
24
|
-
type: string
|
|
25
|
-
default: "full"
|
|
26
|
-
clarify:
|
|
27
|
-
description: "Run clarify stage (opt-in Q&A loop, default: skip)"
|
|
28
|
-
required: false
|
|
29
|
-
type: boolean
|
|
30
|
-
default: false
|
|
31
|
-
dry_run:
|
|
32
|
-
description: "Dry run mode (no actual execution)"
|
|
33
|
-
required: false
|
|
34
|
-
type: boolean
|
|
35
|
-
default: false
|
|
36
|
-
feedback:
|
|
37
|
-
description: "Feedback for rerun mode"
|
|
38
|
-
required: false
|
|
39
|
-
type: string
|
|
40
|
-
default: ""
|
|
41
|
-
from_stage:
|
|
42
|
-
description: "Stage to restart from (for rerun)"
|
|
43
|
-
required: false
|
|
44
|
-
type: string
|
|
45
|
-
default: ""
|
|
46
|
-
issue_number:
|
|
47
|
-
description: "Issue number for the task"
|
|
48
|
-
required: false
|
|
49
|
-
type: string
|
|
50
|
-
default: ""
|
|
51
|
-
complexity:
|
|
52
|
-
description: "Override complexity score (1-100) for testing"
|
|
53
|
-
required: false
|
|
54
|
-
type: string
|
|
55
|
-
default: ""
|
|
56
|
-
|
|
57
|
-
issue_comment:
|
|
58
|
-
types: [created]
|
|
59
|
-
|
|
60
|
-
pull_request_review:
|
|
61
|
-
types: [submitted]
|
|
62
|
-
|
|
63
|
-
concurrency:
|
|
64
|
-
group: kody-${{ github.event.inputs.task_id || github.event.issue.number || github.event.pull_request.number || github.sha }}
|
|
65
|
-
cancel-in-progress: false
|
|
66
|
-
|
|
67
|
-
permissions:
|
|
68
|
-
issues: write
|
|
69
|
-
pull-requests: write
|
|
70
|
-
contents: write
|
|
71
|
-
|
|
72
|
-
jobs:
|
|
73
|
-
# Job 1: Parse trigger, validate inputs, gate execution
|
|
74
|
-
parse:
|
|
75
|
-
runs-on: ubuntu-latest
|
|
76
|
-
timeout-minutes: 5
|
|
77
|
-
if: >-
|
|
78
|
-
github.event_name == 'workflow_dispatch' ||
|
|
79
|
-
(github.event_name == 'issue_comment' &&
|
|
80
|
-
(contains(github.event.comment.body, '@kody') ||
|
|
81
|
-
contains(github.event.comment.body, '/kody'))) ||
|
|
82
|
-
(github.event_name == 'pull_request_review' &&
|
|
83
|
-
github.event.review.state == 'changes_requested')
|
|
84
|
-
env:
|
|
85
|
-
GH_TOKEN: ${{ github.token }}
|
|
86
|
-
outputs:
|
|
87
|
-
task_id: ${{ steps.parse.outputs.task_id }}
|
|
88
|
-
mode: ${{ steps.parse.outputs.mode }}
|
|
89
|
-
clarify: ${{ steps.parse.outputs.clarify }}
|
|
90
|
-
dry_run: ${{ steps.parse.outputs.dry_run }}
|
|
91
|
-
from_stage: ${{ steps.parse.outputs.from_stage }}
|
|
92
|
-
feedback: ${{ steps.parse.outputs.feedback }}
|
|
93
|
-
issue_number: ${{ steps.parse.outputs.issue_number }}
|
|
94
|
-
is_pull_request: ${{ steps.parse.outputs.is_pull_request }}
|
|
95
|
-
valid: ${{ steps.parse.outputs.valid }}
|
|
96
|
-
trigger_type: ${{ steps.parse.outputs.trigger_type }}
|
|
97
|
-
comment_body: ${{ steps.parse.outputs.comment_body }}
|
|
98
|
-
version: ${{ steps.parse.outputs.version }}
|
|
99
|
-
complexity: ${{ steps.parse.outputs.complexity }}
|
|
100
|
-
fresh: ${{ steps.parse.outputs.fresh }}
|
|
101
|
-
steps:
|
|
102
|
-
- name: Setup pnpm
|
|
103
|
-
uses: pnpm/action-setup@v4
|
|
104
|
-
with:
|
|
105
|
-
version: 9
|
|
106
|
-
|
|
107
|
-
- name: Setup Node.js
|
|
108
|
-
uses: actions/setup-node@v4
|
|
109
|
-
with:
|
|
110
|
-
node-version: "22"
|
|
111
|
-
|
|
112
|
-
- name: Install kody-engine
|
|
113
|
-
run: pnpm add -g @kody-ade/kody-engine
|
|
114
|
-
|
|
115
|
-
# For comments: validate safety filters before parsing
|
|
116
|
-
- name: Validate comment trigger safety
|
|
117
|
-
if: github.event_name == 'issue_comment'
|
|
118
|
-
id: safety
|
|
119
|
-
env:
|
|
120
|
-
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
121
|
-
AUTHOR: ${{ github.event.comment.user.login }}
|
|
122
|
-
ASSOCIATION: ${{ github.event.comment.author_association }}
|
|
123
|
-
run: kody-engine parse-safety
|
|
124
|
-
|
|
125
|
-
# Add reaction to acknowledge command
|
|
126
|
-
- name: Acknowledge command with reaction
|
|
127
|
-
if: github.event_name == 'issue_comment' && steps.safety.outputs.valid == 'true'
|
|
128
|
-
continue-on-error: true
|
|
129
|
-
env:
|
|
130
|
-
GH_TOKEN: ${{ github.token }}
|
|
131
|
-
run: |
|
|
132
|
-
gh api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
|
|
133
|
-
-X POST -f content=eyes || true
|
|
134
|
-
|
|
135
|
-
# Parse command inputs
|
|
136
|
-
- name: Parse command inputs
|
|
137
|
-
id: parse
|
|
138
|
-
env:
|
|
139
|
-
SAFETY_VALID: ${{ steps.safety.outputs.valid }}
|
|
140
|
-
SAFETY_REASON: ${{ steps.safety.outputs.reason }}
|
|
141
|
-
DISPATCH_TASK_ID: ${{ github.event.inputs.task_id }}
|
|
142
|
-
DISPATCH_MODE: ${{ github.event.inputs.mode }}
|
|
143
|
-
DISPATCH_DRY_RUN: ${{ github.event.inputs.dry_run }}
|
|
144
|
-
DISPATCH_FEEDBACK: ${{ github.event.inputs.feedback }}
|
|
145
|
-
DISPATCH_FROM_STAGE: ${{ github.event.inputs.from_stage }}
|
|
146
|
-
DISPATCH_CLARIFY: ${{ github.event.inputs.clarify }}
|
|
147
|
-
DISPATCH_COMPLEXITY: ${{ github.event.inputs.complexity }}
|
|
148
|
-
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
149
|
-
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
150
|
-
IS_PULL_REQUEST: ${{ github.event.issue.pull_request != null || github.event_name == 'pull_request_review' }}
|
|
151
|
-
PR_REVIEW_STATE: ${{ github.event.review.state || '' }}
|
|
152
|
-
PR_REVIEW_BODY: ${{ github.event.review.body || '' }}
|
|
153
|
-
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
|
|
154
|
-
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
155
|
-
run: kody-engine parse-inputs
|
|
156
|
-
|
|
157
|
-
# Job 1b: Notify on parse errors
|
|
158
|
-
notify-parse-error:
|
|
159
|
-
needs: parse
|
|
160
|
-
if: >-
|
|
161
|
-
needs.parse.outputs.valid == 'false' &&
|
|
162
|
-
needs.parse.outputs.issue_number != '' &&
|
|
163
|
-
github.event_name == 'issue_comment'
|
|
164
|
-
runs-on: ubuntu-latest
|
|
165
|
-
timeout-minutes: 2
|
|
166
|
-
steps:
|
|
167
|
-
- name: Post error comment
|
|
168
|
-
env:
|
|
169
|
-
GH_TOKEN: ${{ github.token }}
|
|
170
|
-
run: |
|
|
171
|
-
gh issue comment ${{ needs.parse.outputs.issue_number }} \
|
|
172
|
-
--body "⚠️ Invalid \`@kody\` command. Use: \`@kody [spec|impl|rerun|full|status] [task-id] [options]\`"
|
|
173
|
-
|
|
174
|
-
# Job 1c: Notify on orchestrate failures
|
|
175
|
-
notify-orchestrate-error:
|
|
176
|
-
needs: [parse, orchestrate]
|
|
177
|
-
if: >-
|
|
178
|
-
always() &&
|
|
179
|
-
needs.orchestrate.result == 'failure' &&
|
|
180
|
-
needs.parse.result == 'success' &&
|
|
181
|
-
needs.parse.outputs.issue_number != '' &&
|
|
182
|
-
github.event_name == 'issue_comment'
|
|
183
|
-
runs-on: ubuntu-latest
|
|
184
|
-
timeout-minutes: 2
|
|
185
|
-
steps:
|
|
186
|
-
- name: Post failure comment
|
|
187
|
-
env:
|
|
188
|
-
GH_TOKEN: ${{ github.token }}
|
|
189
|
-
run: |
|
|
190
|
-
gh issue comment ${{ needs.parse.outputs.issue_number }} \
|
|
191
|
-
--repo ${{ github.repository }} \
|
|
192
|
-
--body "⚠️ **Pipeline failed to start**
|
|
193
|
-
|
|
194
|
-
The workflow crashed before the pipeline could run (infrastructure error, not a code issue).
|
|
195
|
-
|
|
196
|
-
To retry, comment \`/kody\` on this issue.
|
|
197
|
-
|
|
198
|
-
[View CI logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
|
199
|
-
|
|
200
|
-
# Job 2: Orchestrate — run the pipeline
|
|
201
|
-
orchestrate:
|
|
202
|
-
needs: parse
|
|
203
|
-
if: needs.parse.outputs.valid == 'true'
|
|
204
|
-
runs-on: ubuntu-latest
|
|
205
|
-
timeout-minutes: 120
|
|
206
|
-
permissions:
|
|
207
|
-
id-token: write
|
|
208
|
-
contents: write
|
|
209
|
-
pull-requests: write
|
|
210
|
-
issues: write
|
|
211
|
-
steps:
|
|
212
|
-
- name: Checkout repository
|
|
213
|
-
uses: actions/checkout@v4
|
|
214
|
-
with:
|
|
215
|
-
persist-credentials: true
|
|
216
|
-
fetch-depth: 0
|
|
217
|
-
|
|
218
|
-
- name: Setup pnpm
|
|
219
|
-
uses: pnpm/action-setup@v4
|
|
220
|
-
with:
|
|
221
|
-
version: 9
|
|
222
|
-
|
|
223
|
-
- name: Setup Node.js
|
|
224
|
-
uses: actions/setup-node@v4
|
|
225
|
-
with:
|
|
226
|
-
node-version: "22"
|
|
227
|
-
|
|
228
|
-
- name: Install kody-engine
|
|
229
|
-
run: pnpm add -g @kody-ade/kody-engine
|
|
230
|
-
|
|
231
|
-
- name: Checkout feature branch if exists
|
|
232
|
-
if: needs.parse.outputs.task_id != '' || needs.parse.outputs.fresh == 'true'
|
|
233
|
-
env:
|
|
234
|
-
GH_TOKEN: ${{ github.token }}
|
|
235
|
-
TASK_ID: ${{ needs.parse.outputs.task_id }}
|
|
236
|
-
ISSUE_NUMBER: ${{ needs.parse.outputs.issue_number }}
|
|
237
|
-
FRESH: ${{ needs.parse.outputs.fresh }}
|
|
238
|
-
run: kody-engine checkout-branch
|
|
239
|
-
|
|
240
|
-
- name: Configure git identity
|
|
241
|
-
run: |
|
|
242
|
-
git config --global user.email "${GIT_USER_EMAIL:-41898282+github-actions[bot]@users.noreply.github.com}"
|
|
243
|
-
git config --global user.name "${GIT_USER_NAME:-github-actions[bot]}"
|
|
244
|
-
|
|
245
|
-
- name: Install OpenCode CLI
|
|
246
|
-
run: |
|
|
247
|
-
curl -fsSL https://opencode.ai/install | bash
|
|
248
|
-
echo "$HOME/.opencode/bin" >> $GITHUB_PATH
|
|
249
|
-
$HOME/.opencode/bin/opencode --version || echo "Warning: opencode install failed"
|
|
250
|
-
|
|
251
|
-
- name: Set LLM keys
|
|
252
|
-
run: |
|
|
253
|
-
echo "MINIMAX_API_KEY=${{ secrets.MINIMAX_API_KEY }}" >> $GITHUB_ENV
|
|
254
|
-
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> $GITHUB_ENV
|
|
255
|
-
echo "GOOGLE_GENERATIVE_AI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> $GITHUB_ENV
|
|
256
|
-
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
|
|
257
|
-
echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> $GITHUB_ENV
|
|
258
|
-
echo "GROQ_API_KEY=${{ secrets.GROQ_API_KEY }}" >> $GITHUB_ENV
|
|
259
|
-
|
|
260
|
-
- name: Run Kody
|
|
261
|
-
env:
|
|
262
|
-
GH_TOKEN: ${{ github.token }}
|
|
263
|
-
GITHUB_TOKEN: ${{ github.token }}
|
|
264
|
-
GH_PAT: ${{ secrets.GH_PAT }}
|
|
265
|
-
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
266
|
-
DATABASE_URL: ${{ secrets.DATABASE_URL || 'mongodb://localhost:27017/test' }}
|
|
267
|
-
TASK_ID: ${{ needs.parse.outputs.task_id }}
|
|
268
|
-
MODE: ${{ needs.parse.outputs.mode }}
|
|
269
|
-
CLARIFY: ${{ needs.parse.outputs.clarify }}
|
|
270
|
-
DRY_RUN: ${{ needs.parse.outputs.dry_run }}
|
|
271
|
-
FEEDBACK: ${{ needs.parse.outputs.feedback }}
|
|
272
|
-
FROM_STAGE: ${{ needs.parse.outputs.from_stage }}
|
|
273
|
-
ISSUE_NUMBER: ${{ needs.parse.outputs.issue_number }}
|
|
274
|
-
FRESH: ${{ needs.parse.outputs.fresh }}
|
|
275
|
-
TRIGGER_TYPE: ${{ needs.parse.outputs.trigger_type }}
|
|
276
|
-
COMMENT_BODY: ${{ needs.parse.outputs.comment_body }}
|
|
277
|
-
VERSION: ${{ needs.parse.outputs.version }}
|
|
278
|
-
COMPLEXITY: ${{ needs.parse.outputs.complexity }}
|
|
279
|
-
IS_PULL_REQUEST: ${{ needs.parse.outputs.is_pull_request }}
|
|
280
|
-
RUN_ID: ${{ github.run_id }}
|
|
281
|
-
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
282
|
-
GITHUB_ACTOR: ${{ github.event.comment.user.login || github.actor }}
|
|
283
|
-
ISSUE_CREATOR: ${{ github.event.issue.user.login || '' }}
|
|
284
|
-
run: kody-engine run
|
|
285
|
-
|
|
286
|
-
# Pipeline summary
|
|
287
|
-
- name: Pipeline summary
|
|
288
|
-
if: always() && needs.parse.outputs.task_id != ''
|
|
289
|
-
run: |
|
|
290
|
-
TASK_ID="${{ needs.parse.outputs.task_id }}"
|
|
291
|
-
STATUS_FILE=".tasks/${TASK_ID}/status.json"
|
|
292
|
-
echo "## 🤖 Kody Pipeline: \`${TASK_ID}\`" >> $GITHUB_STEP_SUMMARY
|
|
293
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
294
|
-
if [ -f "$STATUS_FILE" ]; then
|
|
295
|
-
STATE=$(jq -r '.state // "unknown"' "$STATUS_FILE")
|
|
296
|
-
echo "**Status**: ${STATE}" >> $GITHUB_STEP_SUMMARY
|
|
297
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
298
|
-
echo "| Stage | State | Duration |" >> $GITHUB_STEP_SUMMARY
|
|
299
|
-
echo "|-------|-------|----------|" >> $GITHUB_STEP_SUMMARY
|
|
300
|
-
jq -r '.stages | to_entries[] | "| \(.key) | \(.value.state) | \(.value.elapsed // "-")ms |"' "$STATUS_FILE" >> $GITHUB_STEP_SUMMARY || true
|
|
301
|
-
else
|
|
302
|
-
echo "No status file found." >> $GITHUB_STEP_SUMMARY
|
|
303
|
-
fi
|
|
304
|
-
|
|
305
|
-
- name: Upload artifacts
|
|
306
|
-
if: always() && needs.parse.outputs.task_id != ''
|
|
307
|
-
continue-on-error: true
|
|
308
|
-
uses: actions/upload-artifact@v4
|
|
309
|
-
with:
|
|
310
|
-
name: kody-${{ needs.parse.outputs.task_id }}-${{ github.run_id }}
|
|
311
|
-
path: .tasks/${{ needs.parse.outputs.task_id }}/
|
|
312
|
-
retention-days: 7
|