Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

feat: restore KrillinAI agent skills

wulienc0b77936b133
diff --git a/skills/krillinai-cli/SKILL.md b/skills/krillinai-cli/SKILL.md
new file mode 100644
index 00000000..15967394
--- /dev/null
+++ b/skills/krillinai-cli/SKILL.md
@@ -0,0 +1,79 @@
+---
+name: krillinai-cli
+description: Use when an agent needs to build or operate the embedded KrillinAI CLI, choose a supported command, or interpret its JSON, manifest, subtitle, dubbing, render, cover, speech, and voice outputs.
+---
+
+# KrillinAI CLI
+
+Use this as the top-level routing skill for KrillinAI command-line work.
+
+## Build And Locate The Binary
+
+Build both KrillinAI binaries through the repository script:
+
+```bash
+pnpm krillinai:build
+```
+
+For the current machine, locate the CLI without assuming a platform or architecture:
+
+```bash
+TARGET="$(node -p "process.platform + '-' + process.arch")"
+SUFFIX="$(node -p "process.platform === 'win32' ? '.exe' : ''")"
+KRILLINAI_CLI="$PWD/.runtime/build/krillinai/$TARGET/bin/krillinai-cli$SUFFIX"
+test -f "$KRILLINAI_CLI"
+```
+
+The CLI loads `config/config.toml` relative to its process working directory. For real runs from a source checkout, use `runtime/krillinai` as the process working directory and create its ignored `config/config.toml` from `config/config-example.toml` without overwriting an existing file. A release archive should be run from its unpacked package root.
+
+For build layout, configuration, JSON, manifest, output, and error details, read:
+
+```text
+skills/krillinai-cli/references/cli-contract.md
+```
+
+## Choose The Command
+
+| User intent | Command / skill |
+|---|---|
+| Generate source, target, bilingual, and short vertical subtitles | `subtitle`; use `krillinai-subtitle` |
+| Generate target-language dubbing from subtitles | `tts`; use `krillinai-tts` |
+| Create landscape videos | `render-horizontal`; use `krillinai-render-horizontal` |
+| Create portrait/short-form videos | `render-vertical`; use `krillinai-render-vertical` |
+| Generate a cover from a complete image prompt | `cover`; use `krillinai-cover` |
+| Generate speech from plain text | `speech` |
+| List provider voice codes for Aliyun, OpenAI, or MiniMax | `voices` |
+| Validate a requested multi-stage output plan | `pipeline --dry-run`; use `krillinai-pipeline` |
+
+`pipeline` only validates plans in dry-run mode; non-dry-run execution returns `unsupported_command`. `status` is reserved and unsupported.
+
+## Operating Rules For Agents
+
+- Use a dedicated `--workdir`; do not scatter outputs in the repo root.
+- Use `--dry-run` for command-shape validation before external calls.
+- Parse stdout as JSON lines. The terminal response is the object containing `ok`; OpenCreator mode may emit progress frames first.
+- Treat `krillinai_manifest.json` and actual output files as the source of truth after a real stage.
+- Reuse manifest outputs for later stages instead of guessing filenames.
+- If a command fails, classify by `error.kind`: `usage`, `retryable`, `dependency`, or `internal`.
+- Avoid rerunning expensive stages if the manifest already has valid upstream outputs.
+- Do not claim that `cover` consumed a reference image: the current CLI accepts a complete text prompt and size only.
+- Do not request an Edge TTS voice catalog: `voices` currently supports `aliyun`, `openai`, and `minimax`.
+
+## Minimal Workflow
+
+```bash
+REPO_ROOT="$PWD"
+WORKDIR="$REPO_ROOT/tasks/demo"
+mkdir -p "$WORKDIR"
+
+(cd "$REPO_ROOT/runtime/krillinai" && "$KRILLINAI_CLI" subtitle \
+ "https://www.youtube.com/watch?v=VIDEO_ID" \
+ --origin-lang en \
+ --target-lang zh_cn \
+ --workdir "$WORKDIR" \
+ --caption-source any \
+ --prepare-video)
+
+(cd "$REPO_ROOT/runtime/krillinai" && "$KRILLINAI_CLI" render-vertical \
+ --workdir "$WORKDIR")
+```
diff --git a/skills/krillinai-cli/references/cli-contract.md b/skills/krillinai-cli/references/cli-contract.md
new file mode 100644
index 00000000..1a1c2cdb
--- /dev/null
+++ b/skills/krillinai-cli/references/cli-contract.md
@@ -0,0 +1,158 @@
+# KrillinAI CLI Contract
+
+## Build And Binary
+
+Use the repository build script from the OpenCreator root:
+
+```bash
+pnpm krillinai:build
+```
+
+It builds `runtime/krillinai/cmd/cli` and `runtime/krillinai/cmd/server`. Native binaries and a manifest are written under:
+
+```text
+.runtime/build/krillinai/<platform>-<arch>/
+├── bin/krillinai-cli[.exe]
+├── bin/krillinai-server[.exe]
+└── manifest.json
+```
+
+Set reusable absolute paths from the repository root:
+
+```bash
+REPO_ROOT="$PWD"
+TARGET="$(node -p "process.platform + '-' + process.arch")"
+SUFFIX="$(node -p "process.platform === 'win32' ? '.exe' : ''")"
+KRILLINAI_CLI="$REPO_ROOT/.runtime/build/krillinai/$TARGET/bin/krillinai-cli$SUFFIX"
+KRILLINAI_CWD="$REPO_ROOT/runtime/krillinai"
+WORKDIR="$REPO_ROOT/tasks/demo"
+test -f "$KRILLINAI_CLI"
+mkdir -p "$WORKDIR"
+```
+
+## Execution Working Directory
+
+The CLI loads `config/config.toml` relative to the process working directory.
+
+- Source checkout: run real commands with `runtime/krillinai` as the working directory. Create the ignored `runtime/krillinai/config/config.toml` from `config-example.toml` and configure only the providers needed by the requested stage.
+- Release archive: run from the unpacked package root after creating `config/config.toml` from `config/config-example.toml`.
+- OpenCreator: the Daemon prepares an isolated launcher directory and configuration automatically; do not replace that flow with a source-tree config.
+
+Use absolute `--workdir`, input, subtitle, audio, and output paths when changing the process working directory.
+
+## Commands
+
+| Command | Purpose |
+|---|---|
+| `subtitle` | Generate source-language, target-language, bilingual, and short vertical subtitles |
+| `tts` | Generate TTS audio and optional dubbed video |
+| `speech` | Generate one audio file from text or a UTF-8 text file |
+| `render-horizontal` | Render landscape subtitle/dubbed videos |
+| `render-vertical` | Render portrait subtitle/dubbed videos |
+| `cover` | Generate a cover image from a complete text prompt |
+| `voices` | List voice codes for `aliyun`, `openai`, or `minimax`; Edge TTS has no CLI voice catalog |
+| `pipeline` | Validate output plans with `--dry-run`; non-dry-run execution is unsupported |
+| `status` | Reserved and unsupported |
+
+## Manifest
+
+Every working directory should contain:
+
+```text
+krillinai_manifest.json
+```
+
+Read this file to locate stage outputs. Important default paths:
+
+| Output key | Default path |
+|---|---|
+| `origin_video` | `<workdir>/origin_video.mp4` |
+| `origin_audio` | `<workdir>/origin_audio.mp3` |
+| `origin_srt` | `<workdir>/origin_language_srt.srt` |
+| `target_srt` | `<workdir>/target_language_srt.srt` |
+| `bilingual_srt` | `<workdir>/bilingual_srt.srt` |
+| `short_origin_mixed_srt` | `<workdir>/short_origin_mixed_srt.srt` |
+| `tts_audio` | `<workdir>/tts_final_audio.wav` |
+| `video_with_tts` | `<workdir>/video_with_tts.mp4` |
+| `horizontal_video` | `<workdir>/horizontal_bilingual.mp4` |
+| `vertical_video` | `<workdir>/vertical_bilingual.mp4` |
+| `transferred_vertical_video` | `<workdir>/transferred_vertical_video.mp4` |
+| `origin_cover` | `<workdir>/origin_cover.jpg` |
+| `generated_cover` | `<workdir>/generated_cover.png` |
+| `cover_prompt` | `<workdir>/cover_prompt.final.txt` |
+
+Horizontal and vertical dubbed variants use `horizontal_dubbed.mp4` and `vertical_dubbed.mp4`; their manifest keys remain `horizontal_video` and `vertical_video`.
+
+## JSON Lines
+
+Parse stdout one line at a time as JSON. The terminal response is the object containing `ok`.
+
+When `OPENCREATOR_KRILLINAI_CLI=1`, `subtitle` and `tts` can emit progress frames before the terminal response:
+
+```json
+{"type":"progress","phase":"translating_subtitles","percent":50,"message":"正在翻译字幕"}
+```
+
+Success shape:
+
+```json
+{
+ "ok": true,
+ "stage": "subtitle",
+ "workdir": "tasks/demo",
+ "task_id": "demo",
+ "outputs": {}
+}
+```
+
+Failure shape:
+
+```json
+{
+ "ok": false,
+ "error": {
+ "kind": "retryable",
+ "code": "audio_transcription_failed",
+ "message": "connection timeout",
+ "retryable": true
+ }
+}
+```
+
+## Exit Codes
+
+| Code | Meaning |
+|---|---|
+| `0` | Success |
+| `1` | Usage error |
+| `2` | Retryable error |
+| `3` | Dependency error |
+
+Internal errors currently also exit with code `1`, so use `error.kind` rather than the exit code alone for classification.
+
+## Error Handling
+
+- `usage`: fix flags or missing input.
+- `retryable`: retry after delay or switch provider/source.
+- `dependency`: install or expose `ffmpeg`, `ffprobe`, or `yt-dlp`.
+- `internal`: inspect logs and generated files.
+
+## Dry Run
+
+- `subtitle`, `render-horizontal`, `render-vertical`, `speech`, and `pipeline` validate without writing a task manifest.
+- `tts` and `cover` dry-runs apply default outputs and write `krillinai_manifest.json`, but do not produce media.
+- `voices --dry-run` returns the same local voice list without an external provider call; use `aliyun`, `openai`, or `minimax`.
+
+## Command-Shape Verification
+
+This check does not need provider credentials or media dependencies:
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" subtitle local:demo.mp4 \
+ --origin-lang en \
+ --target-lang zh_cn \
+ --workdir "$WORKDIR" \
+ --dry-run)
+```
+
+For rendered media, inspect the output file and optionally extract preview frames with `ffmpeg`.
diff --git a/skills/krillinai-cover/SKILL.md b/skills/krillinai-cover/SKILL.md
new file mode 100644
index 00000000..18668fc0
--- /dev/null
+++ b/skills/krillinai-cover/SKILL.md
@@ -0,0 +1,44 @@
+---
+name: krillinai-cover
+description: Use when generating a cover image with the KrillinAI CLI from a complete image prompt, including validating image-provider configuration and inspecting the generated image and saved prompt.
+---
+
+# KrillinAI Cover
+
+Use this skill for the implemented `cover` command. Read `skills/krillinai-cli/references/cli-contract.md` first for binary location, execution working directory, configuration, and JSON behavior.
+
+## Command
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" cover \
+ --workdir "$WORKDIR" \
+ --prompt "$COVER_PROMPT" \
+ --size 1536x1024)
+```
+
+The prompt must already contain the desired title text, language, composition, visual style, and any useful source-video context. The current CLI does not expose a reference-image argument and does not automatically send `origin_cover.jpg` to the image model.
+
+## Inputs
+
+- `--workdir`: an existing or new task directory.
+- `--prompt`: required final prompt sent to the configured image model.
+- `--size`: optional image size; the default is `1024x1024`.
+- `[image]` configuration in `<execution-cwd>/config/config.toml`.
+
+## Outputs
+
+- `generated_cover.png`
+- `cover_prompt.final.txt`
+- `krillinai_manifest.json`
+
+## Dry Run
+
+`cover --dry-run` validates the command and writes a manifest, but it does not call the image model or create `generated_cover.png`.
+
+## Verification
+
+- Require terminal JSON with `"ok": true`.
+- Read output paths from the terminal response or manifest.
+- Confirm `generated_cover.png` is non-empty and decodable as an image.
+- Confirm `cover_prompt.final.txt` exactly records the submitted prompt.
+- If provider configuration is missing or generation fails, report the returned error rather than treating the manifest alone as success.
diff --git a/skills/krillinai-pipeline/SKILL.md b/skills/krillinai-pipeline/SKILL.md
new file mode 100644
index 00000000..fd4c897b
--- /dev/null
+++ b/skills/krillinai-pipeline/SKILL.md
@@ -0,0 +1,48 @@
+---
+name: krillinai-pipeline
+description: Use when validating or documenting a multi-stage KrillinAI CLI output plan; the current pipeline command supports dry-run planning only, not end-to-end execution.
+---
+
+# KrillinAI Pipeline
+
+Use this skill to validate a requested stage plan. Run real work through the individual stage commands because non-dry-run `pipeline` execution returns `unsupported_command`.
+
+## Plan Validation
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" pipeline \
+ --outputs "subtitle,tts,vertical-bilingual" \
+ --dry-run)
+```
+
+## Outputs Values
+
+| Output | Stage |
+|---|---|
+| `subtitle` | Generate subtitle files |
+| `tts` | Generate dubbing |
+| `horizontal-bilingual` | Render landscape bilingual video |
+| `horizontal-dubbed` | Render landscape dubbed video |
+| `vertical-bilingual` | Render portrait bilingual video |
+| `vertical-dubbed` | Render portrait dubbed video |
+| `cover` | Generate cover |
+
+The dry-run validates output names and returns a successful pipeline-stage JSON response. It does not execute stages or write a task manifest.
+
+## Execute The Plan
+
+Map the validated outputs to `subtitle`, `tts`, `render-horizontal`, `render-vertical`, and `cover`. Run each required command independently and use the same absolute `--workdir`.
+
+## Recovery Strategy
+
+- If `subtitle` succeeds and render fails, rerun only render with the same `--workdir`.
+- If TTS fails, keep subtitle outputs and rerun `tts` after fixing provider config.
+- Read `krillinai_manifest.json` before rerunning to avoid repeating expensive work.
+
+## Verification
+
+- Require terminal JSON with `"ok": true` for dry-run validation.
+- For real work, confirm every independently executed stage succeeded.
+- Confirm manifest stages and requested output files, not just the plan response.
+- Inspect final requested media/cover files, not only intermediate outputs.
+- For shared CLI details, read `skills/krillinai-cli/references/cli-contract.md`.
diff --git a/skills/krillinai-render-horizontal/SKILL.md b/skills/krillinai-render-horizontal/SKILL.md
new file mode 100644
index 00000000..84bd9c5b
--- /dev/null
+++ b/skills/krillinai-render-horizontal/SKILL.md
@@ -0,0 +1,48 @@
+---
+name: krillinai-render-horizontal
+description: Use when rendering landscape videos with KrillinAI CLI, including original video plus bilingual subtitles or dubbed video plus target-language subtitles.
+---
+
+# KrillinAI Render Horizontal
+
+Use this skill for `render-horizontal`. Read `skills/krillinai-cli/references/cli-contract.md` first for binary location, execution working directory, configuration, and JSON behavior.
+
+## Bilingual Subtitle Video
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" render-horizontal \
+ --workdir "$WORKDIR" \
+ --video "$WORKDIR/origin_video.mp4" \
+ --subtitle "$WORKDIR/bilingual_srt.srt")
+```
+
+## Dubbed Video
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" render-horizontal \
+ --workdir "$WORKDIR" \
+ --video "$WORKDIR/video_with_tts.mp4" \
+ --subtitle "$WORKDIR/target_language_srt.srt" \
+ --dubbed)
+```
+
+## Inputs
+
+- `--video`: source video, or omit when manifest has the correct input.
+- `--audio`: optional replacement audio.
+- `--subtitle`: usually `bilingual_srt.srt` for bilingual, `target_language_srt.srt` for dubbed.
+- `--workdir`: directory containing `krillinai_manifest.json`.
+- `--subtitle-style-file`: optional JSON override merged with the default subtitle style.
+
+## Outputs
+
+- `horizontal_bilingual.mp4` for the default variant.
+- `horizontal_dubbed.mp4` with `--dubbed`.
+- Both variants are reported through the manifest key `horizontal_video`.
+
+## Verification
+
+- Require terminal JSON with `"ok": true`.
+- Confirm output video exists and has video/audio streams.
+- Extract a preview frame when checking subtitle placement.
+- For manifest and error handling, read `skills/krillinai-cli/references/cli-contract.md`.
diff --git a/skills/krillinai-render-vertical/SKILL.md b/skills/krillinai-render-vertical/SKILL.md
new file mode 100644
index 00000000..3e6e43e0
--- /dev/null
+++ b/skills/krillinai-render-vertical/SKILL.md
@@ -0,0 +1,59 @@
+---
+name: krillinai-render-vertical
+description: Use when rendering portrait videos with KrillinAI CLI, including converting source video to vertical format, adding short bilingual subtitles, rendering dubbed vertical videos, and checking vertical subtitle readability.
+---
+
+# KrillinAI Render Vertical
+
+Use this skill for `render-vertical`. Read `skills/krillinai-cli/references/cli-contract.md` first for binary location, execution working directory, configuration, and JSON behavior.
+
+## Bilingual Short-Subtitle Video
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" render-vertical \
+ --workdir "$WORKDIR" \
+ --video "$WORKDIR/origin_video.mp4" \
+ --subtitle "$WORKDIR/short_origin_mixed_srt.srt" \
+ --major-title "今日话题" \
+ --minor-title "AI Video")
+```
+
+## Dubbed Vertical Video
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" render-vertical \
+ --workdir "$WORKDIR" \
+ --video "$WORKDIR/video_with_tts.mp4" \
+ --subtitle "$WORKDIR/target_language_srt.srt" \
+ --dubbed \
+ --major-title "今日话题" \
+ --minor-title "AI Video")
+```
+
+## Subtitle Behavior
+
+The Go renderer follows the good behavior from `vertical_srt.py`:
+
+- Chinese uses word segmentation before line decisions.
+- Display width is used for line splitting: Chinese counts as width 2, other text as width 1.
+- Long Chinese subtitles are split across time into multiple `Dialogue` entries instead of stacked with `\N`.
+- The goal is to keep the screen to one English line plus one Chinese line when possible.
+
+## Outputs
+
+- `transferred_vertical_video.mp4`: source converted to portrait format.
+- `vertical_bilingual.mp4`: default final vertical video.
+- `vertical_dubbed.mp4`: final video with `--dubbed`.
+- Final variants are reported through the manifest key `vertical_video`.
+
+## Verification
+
+Use text and visual checks:
+
+```bash
+rg -n -F '\\N' "$WORKDIR/formatted_vertical_bilingual.ass"
+ffmpeg -y -ss 00:00:01 -i "$WORKDIR/vertical_bilingual.mp4" \
+ -frames:v 1 "$WORKDIR/vertical_preview_%03d.jpg"
+```
+
+Also require terminal JSON with `"ok": true`, valid video/audio streams, readable subtitles, and non-garbled titles.
diff --git a/skills/krillinai-subtitle/SKILL.md b/skills/krillinai-subtitle/SKILL.md
new file mode 100644
index 00000000..a7012b23
--- /dev/null
+++ b/skills/krillinai-subtitle/SKILL.md
@@ -0,0 +1,60 @@
+---
+name: krillinai-subtitle
+description: Use when generating subtitles with KrillinAI CLI from a YouTube link, Bilibili/local video, or existing media, including platform caption download, Whisper fallback, translation, bilingual SRT, and short vertical subtitle output.
+---
+
+# KrillinAI Subtitle
+
+Use this skill for the `subtitle` stage. Read `skills/krillinai-cli/references/cli-contract.md` first for binary location, execution working directory, configuration, and JSON behavior.
+
+## Command
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" subtitle "<input>" \
+ --origin-lang en \
+ --target-lang zh_cn \
+ --workdir "$WORKDIR" \
+ --caption-source any \
+ --prepare-video)
+```
+
+## Inputs
+
+- YouTube URL: prefer `--caption-source any`; platform captions are used first, then Whisper fallback.
+- Local file: use `local:/abs/path/video.mp4` or a path accepted by the CLI.
+- Bilibili or other yt-dlp supported links: use when media download works; platform caption behavior may differ, so expect transcription fallback.
+
+## Important Flags
+
+| Flag | Use |
+|---|---|
+| `--origin-lang` | Source language, such as `en`, `zh`, `ja` |
+| `--target-lang` | Target language, such as `zh_cn` |
+| `--workdir` | Dedicated task directory |
+| `--caption-source any` | Prefer platform captions, fallback to transcription |
+| `--caption-source whisper` | Force transcription |
+| `--prepare-video` | Require the original video for later render stages |
+| `--bilingual-top=true` | Put target language on top in bilingual SRT |
+| `--subtitle-style-file` | Merge a JSON subtitle-style override |
+| `--dry-run` | Validate without downloads or AI calls |
+
+## Outputs
+
+After a real run, read paths from `krillinai_manifest.json`. Main files:
+
+- `origin_language_srt.srt`
+- `target_language_srt.srt`
+- `bilingual_srt.srt`
+- `short_origin_mixed_srt.srt`
+- `origin_video.mp4` when media preparation produced or required video
+- `origin_audio.mp3` when transcription preparation produced audio
+
+`subtitle --dry-run` validates command shape but does not write a manifest or output files.
+
+## Verification
+
+- Require terminal JSON with `"ok": true`.
+- Confirm `krillinai_manifest.json` exists under `--workdir`.
+- Spot-check `bilingual_srt.srt` ordering and `short_origin_mixed_srt.srt` readability.
+- When `--prepare-video` was requested, require a non-empty `origin_video` output.
+- For Agent integration details, read `skills/krillinai-cli/references/cli-contract.md`.
diff --git a/skills/krillinai-tts/SKILL.md b/skills/krillinai-tts/SKILL.md
new file mode 100644
index 00000000..67918e12
--- /dev/null
+++ b/skills/krillinai-tts/SKILL.md
@@ -0,0 +1,50 @@
+---
+name: krillinai-tts
+description: Use when generating target-language dubbing with KrillinAI CLI from SRT subtitles, including TTS audio creation and optional dubbed video generation.
+---
+
+# KrillinAI TTS
+
+Use this skill for the `tts` stage. Read `skills/krillinai-cli/references/cli-contract.md` first for binary location, execution working directory, configuration, and JSON behavior.
+
+## Command
+
+```bash
+(cd "$KRILLINAI_CWD" && "$KRILLINAI_CLI" tts \
+ --workdir "$WORKDIR" \
+ --input-srt "$WORKDIR/target_language_srt.srt" \
+ --line-mode target-only \
+ --video "$WORKDIR/origin_video.mp4")
+```
+
+## Inputs
+
+- `--input-srt` is required. Usually use `target_language_srt.srt`.
+- `--video` is optional but needed when generating `video_with_tts.mp4`.
+- TTS provider must be configured in `<execution-cwd>/config/config.toml`.
+
+## Important Flags
+
+| Flag | Use |
+|---|---|
+| `--input-srt` | SRT to synthesize |
+| `--line-mode target-only` | Use target-language lines only |
+| `--line-mode bilingual-target-top` | Bilingual mode with target on top |
+| `--line-mode bilingual-target-bottom` | Bilingual mode with target on bottom |
+| `--voice` | Provider-specific voice |
+| `--voice-clone-source` | Voice clone source audio URL/path when supported |
+| `--dry-run` | Validate command shape |
+
+## Outputs
+
+Read paths from manifest:
+
+- `tts_final_audio.wav`
+- `video_with_tts.mp4` when a video input is available
+
+## Verification
+
+- Require terminal JSON with `"ok": true`.
+- Confirm `tts_final_audio.wav` exists and has non-zero size.
+- If `video_with_tts.mp4` is produced, inspect duration and audio stream with `ffprobe`.
+- For JSON/error contract, read `skills/krillinai-cli/references/cli-contract.md`.