AgentKit
DocsKitsCLI ReferenceDesktop App

ak skill

ak skill repair

Repair a verified corrupt skill runtime with a per-skill lock and explicit shared-cache recovery limits.

Use ak skill repair only after ak skill verify reports corrupt.

Usage

ak skill repair <kit>/<skill>
FlagDefaultDescription
--kits-dir <dir>AGENTKIT_KITS_DIR or ./kitsSelect the local skill declaration.

What repair does

The command takes a non-blocking lock at ~/.agentkit/skills/<kit>/<skill>.lock, verifies the environment, and acts only for corrupt:

Verified stateBehavior
corruptRemove the per-skill record, then run the install primitive.
okNo-op.
missingNo-op; use ak skill install.
unknownNo-op, including when AGENTKIT_SKILL_RUNTIME=0.

Every successful path prints repair complete, so verify again to distinguish a repair from a no-op.

Repair does not delete the content-addressed cache, make a snapshot, or roll back the removed record if reinstall fails. It can fix a bad manifest by pointing the record at a ready cache. A damaged cache directory is preserved and can cause the reinstall to fail; there is no cache-prune command in this family. Before moving any reported cache hash aside, check that no other manifest references it.

Prompts, output, and exits

The command never prompts and has no dry-run or force mode. Success writes [OK] <kit>/<skill> repair complete to stderr; --json still has no success object and --quiet does not hide the line.

ExitMeaning
0Repair completed or the verified state required no action.
1The lock was busy, verification failed, or remove/reinstall failed. Missing uv or pnpm during reinstall also uses 1.
2The reference or flags were invalid.
4The source skill has no runtime block.
5The source kit or skill was not found.

JSON errors are structured on stderr. A busy repair also writes a human [!] line before the error envelope. Missing or extra positional arguments currently exit 1 through Cobra's pre-command path.

Verify after repair

ak skill verify <kit>/<skill>