@kody-ade/kody-engine 0.4.224 → 0.4.226

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.
Files changed (114) hide show
  1. package/README.md +2 -2
  2. package/dist/bin/kody.js +825 -832
  3. package/dist/executables/run/profile.json +1 -1
  4. package/dist/executables/types.ts +3 -1
  5. package/package.json +1 -1
  6. package/dist/duties/duty-scheduler/duty.md +0 -3
  7. package/dist/duties/duty-scheduler/profile.json +0 -6
  8. package/dist/duties/duty-tick/duty.md +0 -3
  9. package/dist/duties/duty-tick/profile.json +0 -6
  10. package/dist/duties/duty-tick-scripted/duty.md +0 -3
  11. package/dist/duties/duty-tick-scripted/profile.json +0 -6
  12. package/dist/duties/fix/duty.md +0 -10
  13. package/dist/duties/fix/profile.json +0 -6
  14. package/dist/duties/fix-ci/duty.md +0 -10
  15. package/dist/duties/fix-ci/profile.json +0 -6
  16. package/dist/duties/goal-scheduler/duty.md +0 -3
  17. package/dist/duties/goal-scheduler/profile.json +0 -6
  18. package/dist/duties/goal-tick/duty.md +0 -3
  19. package/dist/duties/goal-tick/profile.json +0 -6
  20. package/dist/duties/init/duty.md +0 -10
  21. package/dist/duties/init/profile.json +0 -6
  22. package/dist/duties/job-live-verify/duty.md +0 -3
  23. package/dist/duties/job-live-verify/profile.json +0 -6
  24. package/dist/duties/merge/duty.md +0 -10
  25. package/dist/duties/merge/profile.json +0 -6
  26. package/dist/duties/npm-publish/duty.md +0 -17
  27. package/dist/duties/npm-publish/profile.json +0 -6
  28. package/dist/duties/plan-verify/duty.md +0 -3
  29. package/dist/duties/plan-verify/profile.json +0 -6
  30. package/dist/duties/preview-build/duty.md +0 -10
  31. package/dist/duties/preview-build/profile.json +0 -6
  32. package/dist/duties/probe-skill/duty.md +0 -3
  33. package/dist/duties/probe-skill/profile.json +0 -6
  34. package/dist/duties/qa-goal/duty.md +0 -3
  35. package/dist/duties/qa-goal/profile.json +0 -6
  36. package/dist/duties/release/duty.md +0 -10
  37. package/dist/duties/release/profile.json +0 -6
  38. package/dist/duties/release-deploy/duty.md +0 -10
  39. package/dist/duties/release-deploy/profile.json +0 -6
  40. package/dist/duties/release-prepare/duty.md +0 -10
  41. package/dist/duties/release-prepare/profile.json +0 -6
  42. package/dist/duties/release-publish/duty.md +0 -10
  43. package/dist/duties/release-publish/profile.json +0 -6
  44. package/dist/duties/resolve/duty.md +0 -10
  45. package/dist/duties/resolve/profile.json +0 -6
  46. package/dist/duties/revert/duty.md +0 -10
  47. package/dist/duties/revert/profile.json +0 -6
  48. package/dist/duties/sync/duty.md +0 -10
  49. package/dist/duties/sync/profile.json +0 -6
  50. package/dist/duties/task-job-fail-once/duty.md +0 -3
  51. package/dist/duties/task-job-fail-once/profile.json +0 -6
  52. package/dist/duties/task-job-pass-a/duty.md +0 -3
  53. package/dist/duties/task-job-pass-a/profile.json +0 -6
  54. package/dist/duties/task-job-pass-b/duty.md +0 -3
  55. package/dist/duties/task-job-pass-b/profile.json +0 -6
  56. package/dist/duties/task-jobs/duty.md +0 -3
  57. package/dist/duties/task-jobs/profile.json +0 -6
  58. package/dist/duties/worker-ask/duty.md +0 -10
  59. package/dist/duties/worker-ask/profile.json +0 -6
  60. package/dist/executables/duty-scheduler/profile.json +0 -57
  61. package/dist/executables/duty-tick/profile.json +0 -78
  62. package/dist/executables/duty-tick/prompt.md +0 -77
  63. package/dist/executables/duty-tick/prompts/locked.md +0 -50
  64. package/dist/executables/duty-tick-scripted/profile.json +0 -72
  65. package/dist/executables/fix/profile.json +0 -91
  66. package/dist/executables/fix/prompt.md +0 -90
  67. package/dist/executables/fix-ci/profile.json +0 -71
  68. package/dist/executables/fix-ci/prompt.md +0 -78
  69. package/dist/executables/goal-scheduler/profile.json +0 -53
  70. package/dist/executables/goal-scheduler/scheduler.sh +0 -82
  71. package/dist/executables/goal-tick/profile.json +0 -69
  72. package/dist/executables/init/profile.json +0 -36
  73. package/dist/executables/job-live-verify/profile.json +0 -36
  74. package/dist/executables/job-live-verify/prompt.md +0 -42
  75. package/dist/executables/merge/profile.json +0 -54
  76. package/dist/executables/npm-publish/profile.json +0 -73
  77. package/dist/executables/npm-publish/publish.sh +0 -93
  78. package/dist/executables/plan-verify/profile.json +0 -38
  79. package/dist/executables/plan-verify/prompt.md +0 -72
  80. package/dist/executables/preview-build/profile.json +0 -61
  81. package/dist/executables/preview-health/profile.json +0 -48
  82. package/dist/executables/preview-health/tick.sh +0 -319
  83. package/dist/executables/probe-skill/profile.json +0 -35
  84. package/dist/executables/probe-skill/prompt.md +0 -31
  85. package/dist/executables/probe-skill/skills/probe-skill-marker/SKILL.md +0 -18
  86. package/dist/executables/qa-goal/profile.json +0 -65
  87. package/dist/executables/release/deploy.sh +0 -157
  88. package/dist/executables/release/prepare.sh +0 -353
  89. package/dist/executables/release/profile.json +0 -95
  90. package/dist/executables/release/publish.sh +0 -88
  91. package/dist/executables/release/release.sh +0 -230
  92. package/dist/executables/release/wait.sh +0 -88
  93. package/dist/executables/release-deploy/deploy.sh +0 -222
  94. package/dist/executables/release-deploy/profile.json +0 -53
  95. package/dist/executables/release-prepare/prepare.sh +0 -368
  96. package/dist/executables/release-prepare/profile.json +0 -70
  97. package/dist/executables/release-publish/profile.json +0 -53
  98. package/dist/executables/release-publish/publish.sh +0 -137
  99. package/dist/executables/resolve/apply-prefer.sh +0 -54
  100. package/dist/executables/resolve/profile.json +0 -107
  101. package/dist/executables/resolve/prompt.md +0 -51
  102. package/dist/executables/revert/profile.json +0 -82
  103. package/dist/executables/revert/revert.sh +0 -33
  104. package/dist/executables/sync/profile.json +0 -48
  105. package/dist/executables/task-job-fail-once/profile.json +0 -44
  106. package/dist/executables/task-job-fail-once/prompt.md +0 -1
  107. package/dist/executables/task-job-pass-a/profile.json +0 -43
  108. package/dist/executables/task-job-pass-a/prompt.md +0 -1
  109. package/dist/executables/task-job-pass-b/profile.json +0 -43
  110. package/dist/executables/task-job-pass-b/prompt.md +0 -1
  111. package/dist/executables/task-jobs/profile.json +0 -41
  112. package/dist/executables/task-jobs/prompt.md +0 -1
  113. package/dist/executables/worker-ask/profile.json +0 -70
  114. package/dist/executables/worker-ask/prompt.md +0 -60
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # goal-scheduler: enumerate every goal state file under .kody/goals/ and
4
- # dispatch goal-tick once for each whose state == "active". Runs as a
5
- # scheduled executable (cron `*/5 * * * *`). No agent.
6
- #
7
- # A failed individual tick logs and continues — one stuck goal must not
8
- # starve the rest.
9
-
10
- set -euo pipefail
11
-
12
- goals_dir=".kody/goals"
13
-
14
- # python3 parses each goal's state.json below. It is declared as a required
15
- # cliTool in profile.json, but guard here too: without this check a missing
16
- # interpreter silently makes EVERY goal read state="" → treated as inactive →
17
- # nothing ticks, reported as a misleading success. Fail loud instead.
18
- if ! command -v python3 >/dev/null 2>&1; then
19
- echo "[goal-scheduler] FATAL: python3 not found on PATH (required to read goal state)" >&2
20
- exit 1
21
- fi
22
-
23
- # Goal state lives on the dedicated `kody-state` branch, not the default branch
24
- # (keeps `chore(goals): …` churn out of code history). Materialize it into the
25
- # working tree so the glob below sees current state. Best-effort: `kody-state`
26
- # may not exist yet, or carry no goals — both fall through to the checks below.
27
- git fetch origin kody-state --quiet 2>/dev/null || true
28
- git checkout origin/kody-state -- "$goals_dir" 2>/dev/null || true
29
-
30
- if [ ! -d "$goals_dir" ]; then
31
- echo "[goal-scheduler] no $goals_dir — nothing to schedule"
32
- echo "KODY_SKIP_AGENT=true"
33
- exit 0
34
- fi
35
-
36
- shopt -s nullglob
37
- state_files=("$goals_dir"/*/state.json)
38
- shopt -u nullglob
39
-
40
- if [ "${#state_files[@]}" = "0" ]; then
41
- echo "[goal-scheduler] no goal state files yet"
42
- echo "KODY_SKIP_AGENT=true"
43
- exit 0
44
- fi
45
-
46
- active=0
47
- for state_file in "${state_files[@]}"; do
48
- [ -f "$state_file" ] || continue
49
- goal_id=$(basename "$(dirname "$state_file")")
50
-
51
- state=$(python3 -c "import json,sys; print(json.load(open(sys.argv[1])).get('state',''))" "$state_file" 2>/dev/null || echo "")
52
-
53
- if [ "$state" != "active" ]; then
54
- continue
55
- fi
56
-
57
- active=$((active + 1))
58
- echo "[goal-scheduler] → tick $goal_id"
59
-
60
- # NOTE: the shared goal branch is created lazily by goal-tick at the moment
61
- # it's about to dispatch the first task. Goals whose ticks never dispatch
62
- # (e.g. all tasks closed as won't-fix, or every task carries goal-runner:failed)
63
- # never spawn an orphan goal-<id> ref on origin. The trade-off vs. the prior
64
- # eager creation: the goal branch's base is "origin/<defaultBranch> at first
65
- # dispatch" rather than "origin/<defaultBranch> at goal activation", which
66
- # is better for short-lived QA-style goals where main may have moved on.
67
-
68
- # Run the tick. The published CLI bin is `kody-engine` (see package.json
69
- # "bin") — NOT `kody`. Calling bare `kody` here failed with
70
- # `kody: command not found`, so every active goal silently failed to
71
- # advance. `kody-engine` is on PATH because the workflow invokes the
72
- # engine via `npx -p @kody-ade/kody-engine ... kody-engine`, and child
73
- # processes inherit that PATH. A non-zero exit logs and continues so one
74
- # stuck goal doesn't starve the rest of the schedule.
75
- if ! kody-engine goal-tick --goal "$goal_id"; then
76
- echo "[goal-scheduler] tick $goal_id failed (continuing)"
77
- fi
78
- done
79
-
80
- echo "[goal-scheduler] ticked $active active goal(s) of ${#state_files[@]} total"
81
- echo "KODY_SKIP_AGENT=true"
82
- exit 0
@@ -1,69 +0,0 @@
1
- {
2
- "name": "goal-tick",
3
- "role": "primitive",
4
- "describe": "One deterministic tick for one goal in the stacked-PR model: read .kody/goals/<id>/state.json, dispatch @kody on the next ready task (stacked on the leaf PR), or — when all tasks are done — finalize by preparing the leaf as a single review-ready PR (retarget to default branch, mark ready, close intermediate PRs/issues) and leave it OPEN for a human to merge. The engine never auto-merges. No agent.",
5
- "kind": "oneshot",
6
- "inputs": [
7
- {
8
- "name": "goal",
9
- "flag": "--goal",
10
- "type": "string",
11
- "required": true,
12
- "describe": "Goal id — directory name under .kody/goals/."
13
- }
14
- ],
15
- "claudeCode": {
16
- "model": "inherit",
17
- "permissionMode": "default",
18
- "maxTurns": 0,
19
- "maxThinkingTokens": null,
20
- "systemPromptAppend": null,
21
- "tools": [],
22
- "hooks": [],
23
- "skills": [],
24
- "commands": [],
25
- "subagents": [],
26
- "plugins": [],
27
- "mcpServers": []
28
- },
29
- "cliTools": [
30
- {
31
- "name": "gh",
32
- "install": {
33
- "required": true,
34
- "checkCommand": "command -v gh"
35
- },
36
- "verify": "gh auth status",
37
- "usage": "Read goal-labelled tasks, list stacked PRs, dispatch @kody, and squash-merge the leaf on finalize.",
38
- "allowedUses": ["issue", "pr", "api"]
39
- }
40
- ],
41
- "inputArtifacts": [],
42
- "outputArtifacts": [],
43
- "scripts": {
44
- "preflight": [
45
- { "script": "loadGoalState" },
46
- {
47
- "script": "handleAbandonedGoal",
48
- "runWhen": { "data.goal.state": "abandoned" }
49
- },
50
- {
51
- "script": "deriveGoalPhase",
52
- "runWhen": { "data.goal.state": "active" }
53
- },
54
- {
55
- "script": "finalizeGoal",
56
- "runWhen": { "data.goal.phase": "all-done" }
57
- },
58
- {
59
- "script": "dispatchNextTask",
60
- "runWhen": { "data.goal.phase": "ready-to-dispatch" }
61
- },
62
- { "script": "saveGoalState" },
63
- { "script": "skipAgent" }
64
- ],
65
- "postflight": [
66
- { "script": "commitGoalState" }
67
- ]
68
- }
69
- }
@@ -1,36 +0,0 @@
1
- {
2
- "name": "init",
3
- "role": "utility",
4
- "describe": "Scaffold a consumer repo with kody.config.json and the @kody workflow. No agent.",
5
- "inputs": [
6
- {
7
- "name": "force",
8
- "flag": "--force",
9
- "type": "bool",
10
- "required": false,
11
- "describe": "Overwrite existing files instead of skipping them."
12
- }
13
- ],
14
- "claudeCode": {
15
- "model": "inherit",
16
- "permissionMode": "acceptEdits",
17
- "maxTurns": null,
18
- "systemPromptAppend": null,
19
- "tools": [],
20
- "hooks": [],
21
- "skills": [],
22
- "commands": [],
23
- "subagents": [],
24
- "plugins": [],
25
- "mcpServers": []
26
- },
27
- "cliTools": [],
28
- "scripts": {
29
- "preflight": [
30
- {
31
- "script": "initFlow"
32
- }
33
- ],
34
- "postflight": []
35
- }
36
- }
@@ -1,36 +0,0 @@
1
- {
2
- "name": "job-live-verify",
3
- "role": "primitive",
4
- "describe": "Live-test executable that verifies job reference injection, staff persona injection, synthetic skill loading, locked duty tools, and state postflight.",
5
- "kind": "oneshot",
6
- "dutyTools": ["ensure_issue", "ensure_comment"],
7
- "inputs": [],
8
- "claudeCode": {
9
- "model": "inherit",
10
- "permissionMode": "default",
11
- "maxTurns": 20,
12
- "maxThinkingTokens": null,
13
- "maxTurnTimeoutSec": 180,
14
- "systemPromptAppend": "You are running Kody's job-wiring live verification. Use the requested tools, then submit state exactly once.",
15
- "enableSubmitTool": true,
16
- "tools": ["Read"],
17
- "hooks": [],
18
- "skills": ["kody-live-marker"],
19
- "commands": [],
20
- "subagents": [],
21
- "plugins": [],
22
- "mcpServers": []
23
- },
24
- "cliTools": [],
25
- "scripts": {
26
- "preflight": [
27
- { "script": "loadDutyState" },
28
- { "script": "buildSyntheticPlugin" },
29
- { "script": "composePrompt" }
30
- ],
31
- "postflight": [
32
- { "script": "parseJobStateFromAgentResult", "with": { "fenceLabel": "kody-job-next-state" } },
33
- { "script": "writeJobStateFile" }
34
- ]
35
- }
36
- }
@@ -1,42 +0,0 @@
1
- You are Kody's live job-wiring verification agent.
2
-
3
- Your only job is to prove that this model session received the job reference, the staff persona, the duty, the executable, the loaded skill, and the locked duty tools.
4
-
5
- ## Evidence to collect
6
-
7
- 1. Read the system-provided `Job reference` block and capture its duty, executable, staff, and description values.
8
- 2. Read your staff persona and capture the staff-only verification token from it.
9
- 3. Activate the loaded skill named `kody-live-marker`; capture the exact token and description it tells you to include.
10
- 4. Use `ensure_issue` with:
11
- - `key`: `live-job-wiring-proof-2026-06-06`
12
- - `title`: `Kody live job wiring proof`
13
- - `body`: a short markdown note that includes the duty, executable, staff, description, staff-only token, and skill token you observed.
14
- 5. Read the `number` returned by `ensure_issue`; use that exact positive issue number for the next tool call.
15
- 6. Use `ensure_comment` on that issue with:
16
- - `key`: `live-job-wiring-proof-comment-2026-06-06`
17
- - `body`: one markdown line beginning `live job wiring proof:` and including the same observed values.
18
- 7. Call `submit_state` exactly once, as your final action.
19
-
20
- ## State to submit
21
-
22
- Submit:
23
-
24
- - `cursor`: `verified`
25
- - `done`: `true`
26
- - `data`: an object containing:
27
- - `duty`
28
- - `executable`
29
- - `staff`
30
- - `description`
31
- - `staffToken`
32
- - `skillToken`
33
- - `skillDescription`
34
- - `issueNumber`
35
- - `commentStatus`: `posted` when `ensure_comment` returns `posted: true`, or `already-existed` when it returns `posted: false`
36
- - `toolsUsed`, exactly `["ensure_issue", "ensure_comment", "submit_state"]`
37
-
38
- ## Rules
39
-
40
- - Do not use shell, git, or file editing.
41
- - If a value is missing, write `MISSING` for that value and still submit state.
42
- - The proof is the tool calls plus submitted state; no prose summary is needed after `submit_state`.
@@ -1,54 +0,0 @@
1
- {
2
- "name": "merge",
3
- "role": "primitive",
4
- "kind": "oneshot",
5
- "describe": "Self-gating squash-merge of an open PR into its base. Deterministic, no agent: merges only when GitHub reports the PR CLEAN (mergeable + required checks/reviews satisfied); otherwise refuses and comments why. Used by the CTO qa-merge duty once a QA-goal PR has graduated.",
6
- "inputs": [
7
- {
8
- "name": "pr",
9
- "flag": "--pr",
10
- "type": "int",
11
- "required": true,
12
- "describe": "GitHub PR number to merge. No-op (MERGE_SKIPPED) if already closed/merged; refuses (MERGE_BLOCKED) if draft, conflicting, or not yet CLEAN."
13
- }
14
- ],
15
- "claudeCode": {
16
- "model": "inherit",
17
- "permissionMode": "default",
18
- "maxTurns": null,
19
- "maxThinkingTokens": null,
20
- "systemPromptAppend": null,
21
- "tools": [],
22
- "hooks": [],
23
- "skills": [],
24
- "commands": [],
25
- "subagents": [],
26
- "plugins": [],
27
- "mcpServers": []
28
- },
29
- "cliTools": [
30
- {
31
- "name": "gh",
32
- "install": {
33
- "required": true,
34
- "checkCommand": "command -v gh"
35
- },
36
- "verify": "gh auth status",
37
- "usage": "Reads PR mergeability (`gh pr view --json`) and merges (`gh pr merge --squash --delete-branch`).",
38
- "allowedUses": ["pr", "api"]
39
- }
40
- ],
41
- "inputArtifacts": [],
42
- "outputArtifacts": [],
43
- "scripts": {
44
- "preflight": [
45
- {
46
- "script": "mergeFlow"
47
- }
48
- ],
49
- "postflight": []
50
- },
51
- "output": {
52
- "actionTypes": ["MERGE_COMPLETED", "MERGE_BLOCKED", "MERGE_SKIPPED"]
53
- }
54
- }
@@ -1,73 +0,0 @@
1
- {
2
- "name": "npm-publish",
3
- "role": "utility",
4
- "phase": "shipped",
5
- "describe": "Publish the current package.json version to npm using NPM_TOKEN. No agent.",
6
- "inputs": [
7
- {
8
- "name": "dry-run",
9
- "flag": "--dry-run",
10
- "type": "bool",
11
- "required": false,
12
- "describe": "Print the publish plan without requiring NPM_TOKEN or publishing."
13
- },
14
- {
15
- "name": "tag",
16
- "flag": "--tag",
17
- "type": "string",
18
- "required": false,
19
- "describe": "npm dist-tag to publish under. Defaults to latest."
20
- },
21
- {
22
- "name": "access",
23
- "flag": "--access",
24
- "type": "enum",
25
- "values": ["public", "restricted"],
26
- "required": false,
27
- "describe": "npm package access. Defaults to public."
28
- },
29
- {
30
- "name": "issue",
31
- "flag": "--issue",
32
- "type": "int",
33
- "required": false,
34
- "describe": "Issue/PR number to post terminal notice on."
35
- }
36
- ],
37
- "claudeCode": {
38
- "model": "inherit",
39
- "permissionMode": "acceptEdits",
40
- "maxTurns": 0,
41
- "maxThinkingTokens": null,
42
- "systemPromptAppend": null,
43
- "tools": [],
44
- "hooks": [],
45
- "skills": [],
46
- "commands": [],
47
- "subagents": [],
48
- "plugins": [],
49
- "mcpServers": []
50
- },
51
- "cliTools": [],
52
- "inputArtifacts": [],
53
- "outputArtifacts": [],
54
- "scripts": {
55
- "preflight": [
56
- { "script": "setCommentTarget", "with": { "type": "issue" } },
57
- { "script": "loadTaskState" },
58
- { "shell": "publish.sh", "timeoutSec": 900 },
59
- { "script": "skipAgent" }
60
- ],
61
- "postflight": [
62
- { "script": "recordOutcome" },
63
- { "script": "saveTaskState" },
64
- { "script": "notifyTerminal", "with": { "label": "npm publish" } }
65
- ]
66
- },
67
- "output": {
68
- "actionTypes": [
69
- "NPM_PUBLISH_COMPLETED",
70
- "NPM_PUBLISH_FAILED"
71
- ]
72
- }
73
- }
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # npm-publish: publish the current package.json version to npm.
4
- #
5
- # Secrets:
6
- # - NPM_TOKEN must be present in the environment.
7
- # Kody loads secrets before executables run; this script must not read or
8
- # decrypt .kody/secrets.enc directly.
9
- #
10
- # Inputs:
11
- # - KODY_ARG_DRY_RUN true|false
12
- # - KODY_ARG_TAG npm dist-tag, default latest
13
- # - KODY_ARG_ACCESS public|restricted, default public
14
- #
15
- # Stdout markers:
16
- # - KODY_REASON=<text>
17
- # - KODY_SKIP_AGENT=true
18
-
19
- set -euo pipefail
20
-
21
- dry_run="${KODY_ARG_DRY_RUN:-false}"
22
- tag="${KODY_ARG_TAG:-latest}"
23
- access="${KODY_ARG_ACCESS:-public}"
24
- registry="${NPM_CONFIG_REGISTRY:-https://registry.npmjs.org/}"
25
-
26
- fail() {
27
- echo "KODY_REASON=$1"
28
- echo "KODY_SKIP_AGENT=true"
29
- exit "${2:-1}"
30
- }
31
-
32
- json_eval() {
33
- node -e "$1"
34
- }
35
-
36
- [[ -f package.json ]] || fail "npm publish: package.json not found" 99
37
-
38
- pkg_name="$(json_eval "const p=require('./package.json'); if(!p.name) process.exit(1); console.log(p.name)")" \
39
- || fail "npm publish: package.json missing name" 99
40
- pkg_version="$(json_eval "const p=require('./package.json'); if(!p.version) process.exit(1); console.log(p.version)")" \
41
- || fail "npm publish: package.json missing version" 99
42
-
43
- if [[ "$access" != "public" && "$access" != "restricted" ]]; then
44
- fail "npm publish: --access must be public or restricted" 64
45
- fi
46
-
47
- echo "→ npm publish: ${pkg_name}@${pkg_version} tag=${tag} access=${access}"
48
-
49
- if [[ "$dry_run" == "true" ]]; then
50
- echo "KODY_REASON=dry-run — would publish ${pkg_name}@${pkg_version} to npm with tag ${tag}"
51
- echo "KODY_SKIP_AGENT=true"
52
- exit 0
53
- fi
54
-
55
- [[ -n "${NPM_TOKEN:-}" ]] || fail "npm publish: missing NPM_TOKEN secret" 64
56
-
57
- tmp_npmrc="$(mktemp)"
58
- auth_host="${registry#http://}"
59
- auth_host="${auth_host#https://}"
60
- auth_host="${auth_host%/}"
61
- cleanup() {
62
- rm -f "$tmp_npmrc"
63
- }
64
- trap cleanup EXIT
65
-
66
- chmod 600 "$tmp_npmrc"
67
- printf '%s\n' "registry=${registry}" >"$tmp_npmrc"
68
- printf '%s\n' "//${auth_host}/:_authToken=${NPM_TOKEN}" >>"$tmp_npmrc"
69
-
70
- export NODE_AUTH_TOKEN="$NPM_TOKEN"
71
- export NPM_CONFIG_USERCONFIG="$tmp_npmrc"
72
- export HUSKY=0
73
- export SKIP_HOOKS=1
74
- export CI="${CI:-1}"
75
-
76
- if npm view "${pkg_name}@${pkg_version}" version --registry "$registry" >/dev/null 2>&1; then
77
- echo "KODY_REASON=${pkg_name}@${pkg_version} is already published"
78
- echo "KODY_SKIP_AGENT=true"
79
- exit 0
80
- fi
81
-
82
- publish_args=(publish --access "$access" --tag "$tag" --registry "$registry")
83
-
84
- if [[ -f pnpm-lock.yaml && -x "$(command -v pnpm)" ]]; then
85
- echo " publish: pnpm ${publish_args[*]}"
86
- pnpm "${publish_args[@]}"
87
- else
88
- echo " publish: npm ${publish_args[*]}"
89
- npm "${publish_args[@]}"
90
- fi
91
-
92
- echo "KODY_REASON=published ${pkg_name}@${pkg_version} to npm with tag ${tag}"
93
- echo "KODY_SKIP_AGENT=true"
@@ -1,38 +0,0 @@
1
- {
2
- "name": "plan-verify",
3
- "role": "utility",
4
- "describe": "Live-test executable. Loads kody-live-marker skill, /kody-live-probe command, kody-live-trace hook, and the bundled test-plugin. Asks the agent to emit confirmation tokens for each feature so Kody can validate plugin wiring end-to-end.",
5
- "inputs": [
6
- { "name": "issue", "flag": "--issue", "type": "int", "required": true, "describe": "GitHub issue number to verify against." }
7
- ],
8
- "claudeCode": {
9
- "model": "inherit",
10
- "permissionMode": "default",
11
- "maxTurns": 15,
12
- "systemPromptAppend": "You are running Kody's plugin-wiring live verification. Emit confirmation tokens exactly as the prompt instructs.",
13
- "tools": ["Read", "Grep", "Glob", "Bash"],
14
- "hooks": ["kody-live-trace"],
15
- "skills": ["kody-live-marker"],
16
- "commands": ["kody-live-probe"],
17
- "subagents": [],
18
- "plugins": ["../../plugins/test-plugin"],
19
- "mcpServers": []
20
- },
21
- "cliTools": [],
22
- "scripts": {
23
- "preflight": [
24
- { "script": "loadIssueContext" },
25
- { "script": "loadTaskState" },
26
- { "script": "buildSyntheticPlugin" },
27
- { "script": "composePrompt" }
28
- ],
29
- "postflight": [
30
- { "script": "parseAgentResult" },
31
- { "script": "writeRunSummary" },
32
- { "script": "saveTaskState" }
33
- ]
34
- },
35
- "output": {
36
- "actionTypes": ["VERIFY_COMPLETED", "VERIFY_FAILED"]
37
- }
38
- }
@@ -1,72 +0,0 @@
1
- You are Kody's plugin-wiring live verification agent. Your ONLY job is to prove that each of the four extension mechanisms (plugins, skills, commands, hooks) is successfully loaded into your session. Do NOT address the issue's actual work.
2
-
3
- Issue #{{issue.number}}: {{issue.title}}
4
-
5
- ---
6
-
7
- # What to do, in order
8
-
9
- Perform these four checks, then emit the final report.
10
-
11
- ## Check 1 — Plugin
12
-
13
- Look at your available skills. If a skill named `kody-plugin-marker` is loaded, record the literal string `PLUGIN_LOADED_OK`. Otherwise record `MISSING`.
14
-
15
- ## Check 2 — Skill
16
-
17
- Look at your available skills. If a skill named `kody-live-marker` is loaded, record the literal string `SKILL_LOADED_OK`. Otherwise record `MISSING`.
18
-
19
- ## Check 3 — Command
20
-
21
- Look at your available slash commands. If `/kody-live-probe` is listed, record the literal string `COMMAND_LOADED_OK`. Otherwise record `MISSING`.
22
-
23
- ## Check 4 — Hook
24
-
25
- Run these Bash steps, in order:
26
-
27
- 1. `rm -f /tmp/kody-hook-signal.txt`
28
- 2. Use the Read tool to read `README.md` (or any file). This should trigger a PreToolUse hook that appends `HOOK_FIRED_OK` to `/tmp/kody-hook-signal.txt`.
29
- 3. `cat /tmp/kody-hook-signal.txt`
30
-
31
- If step 3 prints a line containing `HOOK_FIRED_OK`, record `HOOK_FIRED_OK`. Otherwise record `MISSING`.
32
-
33
- ---
34
-
35
- # Output
36
-
37
- Your FINAL message must use this exact structure. Replace each `<...>` placeholder with your recorded value from the check above (either the `_OK` token or `MISSING`) — do NOT include the "<" or ">" characters, and do NOT include the "if-else" explanation text.
38
-
39
- ```
40
- DONE
41
- COMMIT_MSG: verify: plugin-wiring live check for #{{issue.number}}
42
- PR_SUMMARY:
43
- # Plugin-Wiring Verification Report
44
-
45
- - Plugin: <check-1-value>
46
- - Skill: <check-2-value>
47
- - Command: <check-3-value>
48
- - Hook: <check-4-value>
49
- ```
50
-
51
- Example of a valid filled-in output (if all four worked):
52
-
53
- ```
54
- DONE
55
- COMMIT_MSG: verify: plugin-wiring live check for #{{issue.number}}
56
- PR_SUMMARY:
57
- # Plugin-Wiring Verification Report
58
-
59
- - Plugin: PLUGIN_LOADED_OK
60
- - Skill: SKILL_LOADED_OK
61
- - Command: COMMAND_LOADED_OK
62
- - Hook: HOOK_FIRED_OK
63
- ```
64
-
65
- ---
66
-
67
- # Rules
68
-
69
- - Read-only. Do NOT modify any file.
70
- - Do NOT run git or gh.
71
- - Do NOT perform the issue's actual work.
72
- - Emit the final report even if some checks report `MISSING` — the whole point is to learn which mechanisms work.
@@ -1,61 +0,0 @@
1
- {
2
- "name": "preview-build",
3
- "role": "utility",
4
- "describe": "Build a per-PR preview image on the GHA runner, push to Fly's registry, spin up a per-PR Fly Machine, post the preview URL on the PR. Scripted (no agent) — fast and deterministic.",
5
- "kind": "oneshot",
6
- "inputs": [
7
- {
8
- "name": "pr",
9
- "flag": "--pr",
10
- "type": "int",
11
- "required": true,
12
- "describe": "PR number to build a preview for."
13
- }
14
- ],
15
- "claudeCode": {
16
- "model": "inherit",
17
- "permissionMode": "default",
18
- "maxTurns": null,
19
- "maxThinkingTokens": null,
20
- "systemPromptAppend": null,
21
- "tools": [],
22
- "hooks": [],
23
- "skills": [],
24
- "commands": [],
25
- "subagents": [],
26
- "plugins": [],
27
- "mcpServers": []
28
- },
29
- "cliTools": [
30
- {
31
- "name": "docker",
32
- "install": {
33
- "required": true,
34
- "checkCommand": "command -v docker"
35
- },
36
- "verify": "docker info",
37
- "usage": "Builds the per-PR preview image and pushes it to Fly's registry. Available by default on ubuntu-latest GHA runners.",
38
- "allowedUses": ["build", "push", "login"]
39
- },
40
- {
41
- "name": "gh",
42
- "install": {
43
- "required": true,
44
- "checkCommand": "command -v gh"
45
- },
46
- "verify": "gh auth status",
47
- "usage": "Posts the preview-ready comment on the PR.",
48
- "allowedUses": ["pr", "api"]
49
- }
50
- ],
51
- "inputArtifacts": [],
52
- "outputArtifacts": [],
53
- "scripts": {
54
- "preflight": [
55
- {
56
- "script": "runPreviewBuild"
57
- }
58
- ],
59
- "postflight": []
60
- }
61
- }