/kunglao-agent:upgrade <workspace> [--dry-run] — no args → guided workspace promptfrom kunglao-agent
Migrates a kunglao-agent workspace's framework scaffold to the current release. Handles hooks, templates, toolchain manifests, and event vocabulary without touching user data. Includes dry-run mode and rollback on failure.
Ships in kunglao-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Promotes a legacy workspace forward through the migration registry until its stamp matches the current skill package. The seven user-data directories are hashed (stamp-line-normalized) before/after; any byte difference aborts and keeps the pre-upgrade snapshot on disk for forensics.
Every real run executes seven steps in order; any failure in steps 2-5 rolls the workspace back byte-identical to the snapshot:
git init + the snapshot; a dirty repo's state IS the
snapshot) before any mutation..claude/ hooks, agents, references, templates, tools, scripts) is
deleted outright; the snapshot is the safety net, so there is no backup
step (git restores anything the scan got wrong).deploy_workspace_copy; fail-loud on an unreadable
manifest or an env-import gap).hooks_selfcheck runs as the transaction's test face:
repairs are attempted first, then the hook-chain verdict gates the run.
A red chain after the repair face rolls everything back (RC 7). The
wider operational rows (MCP supply, oracle registration) ride the
report without gating the migration./reload-plugins.reset --hard + a scoped clean); the stderr trail names the failed
step.The sub-command faces keep their names and declare their coverage:
hook_activation.py --wire-up covers the config/wiring faces only;
--deploy-local covers copy + register only — neither takes the snapshot,
runs the prune, or gates on the selfcheck. The full transaction is this
skill.
Print a guided workspace prompt — cwd is a candidate only with explicit
confirm, never guess, never a bare argparse error. The user must point at the
workspace to migrate. A workspace with no version stamp (RC_UNKNOWN_ORIGIN=3)
must be initialized first with /kunglao-agent:init.
| RC | Meaning | Skill UX |
|---|---|---|
0 | migrated / already at target / dry-run plan printed | "done" |
3 | workspace has no version stamp | "refused, run init first" |
4 | iron-rule violation — user data drifted | "user-data drift detected, snapshot at <workspace>/.kunglao-upgrade-pre-snapshot/ kept on disk; restore from snapshot" |
6 | dirty owned-repo — migration needs a clean rollback anchor | "refused: commit or stash first (commands on stderr), then re-run" |
7 | incomplete — a transaction step failed or the finish sequence aborted; the tree was rolled back to the pre-migration snapshot | "warning: fix the cause named on stderr (deploy face, prune, or the selfcheck hook-chain verdict) and re-run /kunglao-agent:upgrade" |
8 | anchors pending — the required intake answers (goal_verbatim / success_criterion / verification_method) are missing from task_spec.yaml; the interview rode stdout as pending-decision JSON (flow kunglao-upgrade), collect via AskUserQuestion and re-run with --resolve <answers.json> | "collect the three anchors, re-run with --resolve" |
The upgrade completion report states anchor status explicitly: anchors: complete (nothing asked, gates will pass) or anchors: backfilled via interview (the answers were collected and written this run) — so the user
knows the analysis-entry and resume gates will pass before they start. The
interview is the FIRST face of every upgrade run: on a workspace with
missing anchors the pending exit 8 stops the run before any migration item
is applied or the stamp is refreshed. A
legacy workspace (initialized before the anchors existed) is backfilled
here instead of deadlocking: analysis entry and resume both refuse on
missing anchors, and a full re-init would destroy analysis state — the
upgrade interview is the sanctioned repair. Only the missing fields are
written; existing answers are never clobbered.
uv run --project . kunglao upgrade <workspace> # migrate
uv run --project . kunglao upgrade <workspace> --dry-run # print plan only
uv run --project . kunglao upgrade <workspace> --resolve <answers.json>
# anchor interview re-entry (after exit 8)
JSON envelope (when --json lands in a future commit):
{
"status": "ok" | "dry-run" | "already-current" | "refused"
| "refused-dirty" | "iron-rule-violation" | "incomplete"
| "anchors-pending",
"rc": 0 | 3 | 4 | 6 | 7 | 8,
"items": [{"name": "hooks_rewire", "action": "applied" | "noop" | "skipped", "detail": "..."}],
"iron_rule_hash": {"pre": "...", "post": "..."},
"started_at": "ISO-8601",
"ended_at": "ISO-8601"
}
The seven user-data directories (claims/, facts/, runs/, hypotheses/,
notes/, evidence/, oracle/) are read-only during the migration. Carriers
whose framework stamp rides ON data files (comment form) have the stamp
line normalized away before hashing, so a sanctioned stamp refresh never
trips the rule.
Currency is keyed on the update IDENTITY, not the version string. The
executing source tree's git head hash is recorded in the workspace's
deployment carrier (<ws>/.claude/deployed-manifest.json, field
source_head; the version stays there as human metadata, source_version),
and a workspace carrying deployed copies is refreshed whenever the head
hash differs — even at an equal version string, the re-cut release batch
case. The refresh reports the explicit <old> -> <new> hash change;
already at version ... (source head <hash> — current) is reported only
when the head hash matches. On non-git installs (plugin/zip copies) the
deploy-manifest digest carries the same identity, so a same-content install
still reports current.
/kunglao-agent:init.kunglao upgrade is forward-only; downgrading is not in scope.skills/subcommands.yaml (the
subcommand UX single source) — keep the frontmatter argument-hint in
sync with the registry.The 0.1.4 migration completes the deployment surface so an older
workspace reaches parity with the current install. Every item is idempotent
and WARN-only (a degraded item never flips the exit code):
| Item | Behavior |
|---|---|
agents_refresh | ws .claude/agents/*.md re-copied byte-exact from the executing install when md5s differ (semantics) |
claudemd_merge | collect-and-merge: frame rebuilt from the CURRENT template; task_spec constraint block + out-of-frame sections stay byte-exact; unplaceable legacy bodies are skipped untouched |
mcp_refresh | missing .mcp.json -> init-parity scaffold; existing files are never clobbered |
env_manifest_refresh | missing env-manifest.yaml ledger backfilled via channel resolution (defaulted-local WARNs); existing ledgers get only the kunglao_version bump |
toolchain_manifest | code-reality face: runs/.init-report.json skill_version refreshed; absence reports toward re-init, never fabricates state |
uv_sync | uv sync --locked --project <install root>, timeout-bounded; all failures are WARN faces |
skill_staleness | detect-only install lag report (below) |
skill_install_staleness)Read-only comparison of the executing install's HEAD against its remote
ref (upstream when set, else origin/<branch> — no network fetch). The
stderr trail carries the verdict:
[event] name=skill_install_staleness status=warn install=... behind=N
[event] name=skill_install_staleness status=ok install=... behind=0
[event] name=skill_install_staleness status=skip (not a git clone)
behind=N means the running scaffold itself is older than upstream:
update the skill package (git -C <install> pull / plugin update) and
re-run /kunglao-agent:upgrade afterwards. Upgrade never self-updates.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (amd2g2zz/kunglao-agent) — no native marketplace selected
npx claudepluginhub p/amd2g2zz-kunglao-agent6 skills in this plugin
/analysiskunglao-agent:analysisEnter the kunglao-agent convergence loop on an initialized workspace: dispatch specialist workers, verify evidence byte-by-byte, and drive the fact base to PROVEN convergence. The workspace must already be initialized (see /kunglao-agent:init)./helpkunglao-agent:helpPrint the kunglao-agent subcommand usage list: the commands, their arguments, and an example invocation for each. Also shown automatically when /kunglao-agent runs with no arguments./initkunglao-agent:initInitialize a kunglao-agent analysis workspace. Intakes task_spec.yaml FIRST (needs-first: the environment derives from the task), aligns the analysis lane + target + project type, scaffolds the directory skeleton, writes the workspace CLAUDE.md, mounts the material (a binary sample only on the malware lane), probes the toolchain, and deploys hooks. One fresh workspace per engagement — a lane, not necessarily a sample./kunglao-agentUse when the user runs, starts, dispatches, or continues kunglao-agent (/kunglao-agent), or when a reverse-engineering target needs deep analysis with unresolved claims. Also auto-triggers on the user's problem phrases — Chinese OR English: "kunglao-agent 笨了", "傻等", "空转", "不收敛", "方法错了", "分析办法有问题", "失败归因", "实际进度和计划不匹配", "kunglao-agent stuck / not moving", "plan doesn't match reality", "worker reports problem / 卡住", "VM 网络不通", "should just ping". Convergence-driven RE orchestrator: dispatches specialist workers, verifies evidence byte-by-byte, refuses to conclude NEGATIVE from a failed method (forces failure_analysis first). NOT for: report writing, single quick questions, re-running CTI that already produced artifacts. Convergence loop, failure gate, and reference protocols are loaded on demand from references/./resumekunglao-agent:resumeCrash/reboot breakpoint recovery for a kunglao-agent workspace: a READ-ONLY brief of where the analysis stood (health, open claims, partial facts, in-flight workers, breakpoint timeline) plus the next action taken from convergence_check. Use after a system reboot, a crashed session, or any "where was this analysis?" moment. The CLI never writes; the command renews an expired activation TTL and then executes the decision's next step after the documented preconditions.Other plugins' skills for the same job