# Send Calibre Metadata Apply to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "calibre-metadata-apply",
    "name": "Calibre Metadata Apply",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/NEXTAltair/calibre-metadata-apply",
    "canonicalUrl": "https://clawhub.ai/NEXTAltair/calibre-metadata-apply",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/calibre-metadata-apply",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=calibre-metadata-apply",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "scripts/calibredb_apply.mjs",
      "scripts/handle_completion.mjs",
      "scripts/run_state.mjs"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/calibre-metadata-apply"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/calibre-metadata-apply",
    "downloadUrl": "https://openagent3.xyz/downloads/calibre-metadata-apply",
    "agentUrl": "https://openagent3.xyz/skills/calibre-metadata-apply/agent",
    "manifestUrl": "https://openagent3.xyz/skills/calibre-metadata-apply/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/calibre-metadata-apply/agent.md"
  }
}
```
## Documentation

### calibre-metadata-apply

A skill for updating metadata of existing Calibre books.

### Requirements

calibredb must be available on PATH in the runtime environment
subagent-spawn-command-builder installed (for spawn payload generation)
pdffonts is optional/recommended for PDF evidence checks
Reachable Calibre Content server URL

http://HOST:PORT/#LIBRARY_ID


If authentication is enabled, prefer /home/altair/.openclaw/.env:

CALIBRE_USERNAME=<user>
CALIBRE_PASSWORD=<password>


Pass --password-env CALIBRE_PASSWORD (username auto-loads from env)
You can still override explicitly with --username <user>.
Optional auth cache: --save-auth (default file: ~/.config/calibre-metadata-apply/auth.json)

### Direct fields (set_metadata --field)

title
title_sort
authors (string with & or array)
author_sort
series
series_index
tags (string or array)
publisher
pubdate (YYYY-MM-DD)
languages
comments

### Helper fields

comments_html (OC marker block upsert)
analysis (auto-generates analysis HTML for comments)
analysis_tags (adds tags)
tags_merge (default true)
tags_remove (remove specific tags after merge)

### A. Target confirmation (mandatory)

Run read-only lookup to narrow candidates
Show id,title,authors,series,series_index
Get user confirmation for final target IDs
Build JSONL using only confirmed IDs

### B. Proposal synthesis (when metadata is missing)

Collect evidence from file extraction + web sources
Show one merged proposal table with:

candidate, source, confidence (high|medium|low)
title_sort_candidate, author_sort_candidate


Get user decision:

approve all
approve only: <fields>
reject: <fields>
edit: <field>=<value>


Apply only approved/finalized fields
If confidence is low or sources conflict, keep fields empty

### C. Apply

Run dry-run first (mandatory)
Run --apply only after explicit user approval
Re-read and report final values

### Analysis worker policy

Use subagent-spawn-command-builder to generate sessions_spawn payload for heavy candidate generation

task is required.
Profile should include model/thinking/timeout/cleanup for this workflow.


Use lightweight subagent model for analysis (avoid main heavy model)
Keep final decisions + dry-run/apply in main

### Data flow disclosure

Local execution:

Build calibredb set_metadata commands from JSONL.
Read/write local state files (state/runs.json) and optional auth/config files under ~/.config/calibre-metadata-apply/.


Subagent execution (optional for heavy candidate generation):

Uses sessions_spawn via subagent-spawn-command-builder.
Text/metadata sent to subagent can reach model endpoints configured by runtime profile.


Remote write:

calibredb set_metadata updates metadata on the target Calibre Content server.

Security rules:

Do not use --save-plain-password unless explicitly instructed by the user.
Prefer env-based password (--password-env CALIBRE_PASSWORD) over inline --password.
If user does not want external model/subagent processing, keep flow local and skip subagent orchestration.

### Long-run turn-split policy (library-wide)

For library-wide heavy processing, always use turn-split execution.

### Unknown-document recovery flow (M3)

Batch sizing rule:

Keep each unknown-document batch small enough to show full row-by-row results in chat (no representative sampling).
If unresolved items remain, stop and wait for explicit user instruction to start the next batch.

### User intervention checkpoints (fixed)

Light pass (metadata-only)

Always run this stage by default (no extra user instruction required)
Analyze existing metadata only (no file content read)
Present a table to user:

current file/title
recommended title/metadata
confidence/evidence summary


Stop and wait for user instruction before any deeper stage



On user request: page-1 pass

Read only the first page and refine proposals
Report delta from light pass



If still uncertain: deep pass

Read first 5 pages + last 5 pages
Add web evidence search
Produce finalized proposal with confidence + rationale



Approval gate

Show detailed findings and request explicit approval before apply

### Pending and unsupported handling

Use pending-review tag for unresolved/hold items.
If document is unresolved in current flow, do not force metadata guesses.

Tag with pending-review and keep for follow-up investigation.

### Diff report format (for unknown batch runs)

Return full results (not samples):

execution summary (target/changed/pending/skipped/error)
full changed list with id + key before/after fields
full pending list with id + reason
full error list with id + error summary
confidence must be expressed as high|medium|low

### Runtime artifact policy

Keep run-state and temporary artifacts only while a run is active.
On successful completion, remove per-run state/artifacts.
On failure, keep minimal artifacts only for retry/debug, then clean up after resolution.

### Internal orchestration (recommended)

Use lightweight subagent for all analysis stages
Keep apply decisions in main session
Persist run state for each stage in state/runs.json

### Turn 1 (start)

Main defines scope
Main generates spawn payload via subagent-spawn-command-builder (profile example: calibre-meta), then calls sessions_spawn
Save run_id/session_key/task via scripts/run_state.mjs upsert
Immediately tell the user this is a subagent job and state the execution model used for analysis
Reply with "analysis started" and keep normal chat responsive

### Turn 2 (completion)

Receive subagent completion notice
Save result JSON
Complete state handling via scripts/handle_completion.mjs --run-id ... --result-json ...
Return summarized proposal (apply only when needed)

Run state file:

state/runs.json

### PDF extraction policy

Try ebook-convert first
If empty/failed, fallback to pdftotext
If both fail, switch to web-evidence-first mode

### Sort reading policy

Use user-configured reading_script for Japanese/non-Latin sort fields

katakana / hiragana / latin


Ask once on first use, then persist and reuse
Default policy is full reading (no truncation)
Config path: ~/.config/calibre-metadata-apply/config.json

key: reading_script

### Usage

Dry-run:

cat changes.jsonl | node skills/calibre-metadata-apply/scripts/calibredb_apply.mjs \\
  --with-library "http://127.0.0.1:8080/#MyLibrary" \\
  --password-env CALIBRE_PASSWORD \\
  --lang ja

Apply:

cat changes.jsonl | node skills/calibre-metadata-apply/scripts/calibredb_apply.mjs \\
  --with-library "http://127.0.0.1:8080/#MyLibrary" \\
  --password-env CALIBRE_PASSWORD \\
  --apply

### Do not

Do not run direct --apply using ambiguous title matches only
Do not include unconfirmed IDs in apply payload
Do not auto-fill low-confidence candidates without explicit confirmation
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: NEXTAltair
- Version: 1.0.1
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/calibre-metadata-apply)
- [Send to Agent page](https://openagent3.xyz/skills/calibre-metadata-apply/agent)
- [JSON manifest](https://openagent3.xyz/skills/calibre-metadata-apply/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/calibre-metadata-apply/agent.md)
- [Download page](https://openagent3.xyz/downloads/calibre-metadata-apply)