← 返回 Skills 市场
nextaltair

Calibre Catalog Read

作者 Altair · GitHub ↗ · v1.0.10 · MIT-0
cross-platform ⚠ suspicious
1303
总下载
0
收藏
2
当前安装
12
版本数
在 OpenClaw 中安装
/install calibre-catalog-read
功能描述
Read-only Calibre catalog lookup (including ID-based read-only lookups like "ID 1021 を確認して") and one-book analysis-comments workflow over a running Content s...
使用说明 (SKILL.md)

calibre-catalog-read

Use this skill for:

  • Read-only catalog lookup (list/search/id)
  • ID-based read-only lookups: "ID 1021 を確認して", "1021番の詳細", "show me book 1021", "ID 1021 の情報を見せて"
  • One-book AI reading workflow (export -> analyze -> cache -> comments HTML apply)
  • Natural conversational book-reference turns where a lightweight read-only lookup would improve the reply
    • Examples: the user mentions a book that may exist in the library, suggests "if you're interested, read it", asks whether it is in the library, or continues a reading-related conversation without using explicit command wording

Skill selection contract (strict)

  • This skill is read-only for catalog lookup + analysis workflow.
  • This skill may also be selected from natural conversation when the likely user need is a lightweight library check or book lookup, even if the user does not use explicit command-style wording.
  • In such conversational cases, prefer the smallest useful action first:
    • first choice: id/search/list style read-only lookup
    • do not jump directly into heavy analysis unless the user clearly asks for it
    • do not treat casual book talk as metadata-edit intent
  • If user intent includes metadata edit/fix/update (title/authors/series/series_index/tags/publisher/pubdate/languages), route to calibre-metadata-apply and do not execute edit paths here.

Do NOT use this skill for:

  • Editing title/authors/series/series_index/tags/publisher/pubdate/languages
  • Any user request that says "metadata edit", "title fix", "ID指定で編集"
  • Heavy one-book analysis when the user only made a casual conversational reference and did not ask for reading/analysis
  • Those must use calibre-metadata-apply

Routing: ID in request ≠ edit intent

  • ID が含まれるリクエストはデフォルトで読み取り専用 → このスキル
  • calibre-metadata-apply へのルーティングは明示的な編集動詞がある場合のみ (修正/編集/変更/直す/fix/edit/update/change)
  • 確認/見せて/教えて/詳細/check/show/view は読み取り → このスキル

Requirements

  • calibredb available on PATH in the runtime where scripts are executed.
  • ebook-convert available for text extraction.
  • subagent-spawn-command-builder installed (for spawn payload generation).
  • Reachable Calibre Content server URL in --with-library format:
    • http://HOST:PORT/#LIBRARY_ID
    • If LIBRARY_ID is unknown, use #- once to list available IDs on the server.
  • Do not assume localhost/127.0.0.1; always pass explicit reachable HOST:PORT.
  • --with-library can be omitted only when one of these is configured:
    • env: CALIBRE_WITH_LIBRARY or CALIBRE_LIBRARY_URL or CALIBRE_CONTENT_SERVER_URL
    • optional library id completion: CALIBRE_LIBRARY_ID
  • Read the "Calibre Content Server" section of TOOLS.md for the correct --with-library URL.
  • Host failover (IP change resilience):
    • Optional env: CALIBRE_SERVER_HOSTS=host1,host2,...
    • Script auto-tries candidates, including WSL host-side nameserver from /etc/resolv.conf.
  • If auth is enabled:
    • Preferred: set in /home/altair/.openclaw/.env
      • CALIBRE_USERNAME=\x3Cuser>
      • CALIBRE_PASSWORD=\x3Cpassword>
    • Auth scheme policy for this workflow:
      • Non-SSL deployment assumes Digest authentication.
      • Do not pass auth mode arguments such as --auth-mode / --auth-scheme.
    • Then pass only --password-env CALIBRE_PASSWORD (username auto-loads from env)
    • You can still override with --username \x3Cuser> explicitly.

Commands

List books (JSON):

node skills/calibre-catalog-read/scripts/calibredb_read.mjs list \
  --with-library "http://192.168.11.20:8080/#Calibreライブラリ" \
  --password-env CALIBRE_PASSWORD \
  --limit 50

Search books (JSON):

node skills/calibre-catalog-read/scripts/calibredb_read.mjs search \
  --with-library "http://192.168.11.20:8080/#Calibreライブラリ" \
  --password-env CALIBRE_PASSWORD \
  --query 'series:"中公文庫"'

Get one book by id (JSON):

node skills/calibre-catalog-read/scripts/calibredb_read.mjs id \
  --with-library "http://192.168.11.20:8080/#Calibreライブラリ" \
  --password-env CALIBRE_PASSWORD \
  --book-id 3

Run one-book pipeline (analyze + comments HTML apply + cache):

uv run python skills/calibre-catalog-read/scripts/run_analysis_pipeline.py \
  --with-library "http://192.168.11.20:8080/#Calibreライブラリ" \
  --password-env CALIBRE_PASSWORD \
  --book-id 3 --lang ja

Cache DB

Initialize DB schema:

uv run python skills/calibre-catalog-read/scripts/analysis_db.py init \
  --db skills/calibre-catalog-read/state/calibre_analysis.sqlite

Check current hash state:

uv run python skills/calibre-catalog-read/scripts/analysis_db.py status \
  --db skills/calibre-catalog-read/state/calibre_analysis.sqlite \
  --book-id 3 --format EPUB

Main vs Subagent responsibility (strict split)

Use this split to avoid long blocking turns on chat listeners.

Main agent (fast control plane)

  • Validate user intent and target book_id.
  • Confirm subagent runtime knobs: model, thinking, runTimeoutSeconds.
  • Start subagent and return a short progress reply quickly.
  • After subagent result arrives, run DB upsert + Calibre apply.
  • Report final result to user.

Subagent (heavy analysis plane)

  • Read extracted source payload.
  • Generate analysis JSON strictly by schema.
  • Do not run metadata apply or user-facing channel actions.

Never do in main when avoidable

  • Long-form content analysis generation.
  • Multi-step heavy reasoning over full excerpts.

Turn policy

  • One book per run.
  • Prefer asynchronous flow: quick ack first, final result after analysis.
  • If analysis is unavailable, either ask user or use fallback only when explicitly acceptable.

Subagent pre-flight (required)

Before first subagent run in a session, confirm once:

  • model
  • thinking (low/medium/high)
  • runTimeoutSeconds

Do not ask on every run. Reuse the confirmed settings for subsequent books in the same session unless the user asks to change them.

Subagent support (model-agnostic)

Book-reading analysis is a heavy task. Use a subagent with a lightweight model for analysis generation, then return results to main agent for cache/apply steps.

  • Prompt template: references/subagent-analysis.prompt.md
  • Input schema: references/subagent-input.schema.json
  • Output schema: references/subagent-analysis.schema.json
  • Input preparation helper: scripts/prepare_subagent_input.mjs
    • Splits extracted text into multiple files to avoid read-tool single-line size issues.

Rules:

  • Use subagent only for heavy analysis generation; keep main agent lightweight and non-blocking.
  • In this environment, Python commands must use uv run python.
  • Use the strict prompt template (references/subagent-analysis.prompt.md) as mandatory base; do not send ad-hoc relaxed read instructions.
  • Keep final DB upsert and Calibre metadata apply in main agent.
  • Process one book per run.
  • Confirm model/thinking/timeout once per session, then reuse; do not hardcode provider-specific model IDs in the skill.
  • Configure callback/announce behavior and rate-limit fallbacks using OpenClaw default model/subagent/fallback settings (not hardcoded in this skill).
  • Exclude manga/comic-centric books from this text pipeline (skip when title/tags indicate manga/comic).
  • If extracted text is too short, stop and ask user for confirmation before continuing.
    • The pipeline returns reason: low_text_requires_confirmation with prompt_en text.
  • For read operations in agent/chat, prefer node .../calibredb_read.mjs instead of direct calibredb calls.
  • Never run calibre-server from this skill.
    • This workflow always connects to an already-running Calibre Content server.

Connection bootstrap (mandatory)

  • Do not ask the user for --with-library first.
  • First, run read commands (list/search/id) without explicit --with-library and use saved defaults.
    • Scripts auto-load .env and resolve CALIBRE_WITH_LIBRARY / CALIBRE_CONTENT_SERVER_URL.
  • This same rule applies to conversational lookup turns: try the lightweight read-only check first before asking the user for connection details.
  • Ask user for URL only if resolution fails (missing --with-library / unable to resolve usable --with-library).

Language policy

  • Do not hardcode user-language prose in pipeline scripts.
  • Generate user-visible analysis text from subagent output, with language controlled by user-selected settings and lang input.
  • Fallback local analysis in scripts is generic/minimal; preferred path is subagent output following the prompt template.

Orchestration note (important)

run_analysis_pipeline.py is a local script and does not call OpenClaw tools by itself. Subagent execution must be orchestrated by the agent layer using sessions_spawn.

Required runtime sequence:

  1. Main agent prepares subagent_input.json + chunked source_files from extracted text.
    • Use:
    node skills/calibre-catalog-read/scripts/prepare_subagent_input.mjs \
      --book-id \x3Cid> --title "\x3Ctitle>" --lang ja \
      --text-path /tmp/book_\x3Cid>.txt --out-dir /tmp/calibre_subagent_\x3Cid>
    
  2. Main agent uses the shared builder skill subagent-spawn-command-builder to generate the sessions_spawn payload, then calls sessions_spawn.
    • Build with profile calibre-read and run-specific analysis task text.
    • Use the generated JSON as-is (or merge minimal run-specific fields such as label/task text).
  3. Subagent reads all source_files and returns analysis JSON (schema-conformant).
  4. Main agent passes that file via --analysis-json to run_analysis_pipeline.py for DB/apply.

If step 2 is skipped and --analysis-json is not provided, the pipeline returns updated: false, analysis_mode: fallback without writing to DB or Calibre comments. Pass --allow-fallback to force-persist local analysis (testing only).

Chat execution model (required, strict)

For Discord/chat, always run as two separate turns.

Turn A: start only (must be fast)

  • Select one target book.
  • Build spawn payload with subagent-spawn-command-builder (--profile calibre-read + run-specific --task).
  • Call sessions_spawn using that payload.
  • Record run state (runId) via run_state.mjs upsert.
  • Reply to user with selected title + "running in background".
  • Stop turn here.

Turn B: completion only (separate later turn)

Trigger: completion announce/event for that run.

  • Run one command only (completion handler):
    • scripts/handle_completion.mjs (get -> apply -> remove, and fail on error).
  • If runId is missing, handler returns stale_or_duplicate and does nothing.
  • Send completion/failure reply from handler result.

Hard rule:

  • Never poll/wait/apply in Turn A.
  • Never keep a chat listener turn open waiting for subagent completion.

Run state management (single-file, required)

For one-book-at-a-time operation, keep a single JSON state file:

  • skills/calibre-catalog-read/state/runs.json

Use runId as the primary key (subagent execution id).

Lifecycle:

  1. On spawn acceptance, upsert one record:
    • runId, book_id, title, status: "running", started_at
  2. Do not wait/poll inside the same chat turn.
  3. On completion announce, load record by runId and run apply.
  4. On successful apply, delete that record immediately.
  5. On failure, set status: "failed" + error and keep record for retry/debug.

Rules:

  • Keep this file small and operational (active/failed records only).
  • Ignore duplicate completion events when record is already removed.
  • If record is missing at completion time, report as stale/unknown run and do not apply blindly.

Use helper scripts (avoid ad-hoc env var mistakes):

# Turn A: register running task
node skills/calibre-catalog-read/scripts/run_state.mjs upsert \
  --state skills/calibre-catalog-read/state/runs.json \
  --run-id \x3CRUN_ID> --book-id \x3CBOOK_ID> --title "\x3CTITLE>"

# Turn B: completion handler (preferred)
node skills/calibre-catalog-read/scripts/handle_completion.mjs \
  --state skills/calibre-catalog-read/state/runs.json \
  --run-id \x3CRUN_ID> \
  --analysis-json /tmp/calibre_\x3CBOOK_ID>/analysis.json \
  --with-library "http://HOST:PORT/#LIBRARY_ID" \
  --password-env CALIBRE_PASSWORD --lang ja
安全使用建议
What to consider before installing: - This skill needs access to your Calibre Content server and uses CALIBRE_PASSWORD (with optional CALIBRE_USERNAME). Only provide credentials you intend the skill to use and prefer least-privileged accounts. - Despite the 'read-only' emphasis, the one-book pipeline can apply analysis as HTML into the book's comments metadata on the Calibre server — if you strictly need no remote writes, do not enable the analysis/apply pipeline. - The scripts load .env files (cwd .env and ~/.openclaw/.env) and will import any keys found there into the process environment. Put only credentials you are comfortable exposing to installed skills into those files (or avoid having unrelated secrets present when running this skill). - The skill reads /etc/resolv.conf for host discovery and writes state/cache files under its own skill directory; review those files if you need to audit what it stores locally. The package also includes cached book text files in its state/cache directory — review for privacy or copyright concerns before installing in a shared environment. - If you want maximum assurance, run the commands manually in a test environment first (the SKILL.md contains the exact node/uv/calibredb/ebook-convert invocations), or inspect the specific scripts in your environment before giving it production credentials. Confidence note: assessment is based on included SKILL.md and scripts; some files were truncated in the input but the visible code and metadata are internally consistent. If you want higher confidence, provide the full content of the truncated portions (to confirm there are no hidden network calls or unexpected external endpoints).
功能分析
Type: OpenClaw Skill Name: calibre-catalog-read Version: 1.0.10 The skill bundle provides a legitimate and well-structured workflow for querying a Calibre library and performing AI-based book analysis. It includes robust scripts for managing a local SQLite cache (analysis_db.py), wrapping the calibredb CLI (calibredb_read.mjs), and orchestrating a subagent pipeline for text extraction and summarization (run_analysis_pipeline.py). Security-conscious patterns are evident, such as the use of parameterized SQL queries, array-based command execution to prevent shell injection, and a 'strict read contract' in the subagent prompt (subagent-analysis.prompt.md) designed to prevent unauthorized file access by the AI. The skill's requirement for Calibre credentials and network access to a Content Server is consistent with its stated purpose.
能力评估
Purpose & Capability
Name/description (read-only catalog lookup + one-book analysis) matches the required binaries (calibredb, ebook-convert, node, uv) and scripts. The only mismatch worth calling out is that, while described as read-only for metadata edits, the workflow explicitly includes an analysis -> comments HTML apply step and metadata declares modifiesRemoteData:["calibre:comments-metadata"] — so it will modify 'comments' metadata on the Calibre server (a limited, declared write), not general title/author/series metadata. That modification is declared but may be surprising to a user expecting strictly read-only behavior.
Instruction Scope
SKILL.md and scripts stick to catalogue listing/search/export, text extraction, analysis (subagent or local fallback), DB upsert, and applying comments. The runtime reads .env files (cwd .env and ~/.openclaw/.env), probes /etc/resolv.conf (WSL nameservers) for host failover, and reads/writes state/cache under the skill directory. These file reads are explainable for host discovery and credential loading but are outside a minimal 'list/search' operation; the loader will import any keys found in those .env files into process.env which could surface unrelated secrets if present.
Install Mechanism
No install spec — instruction-only skill with included scripts. No external downloads or obscure installers are present in the manifest; the scripts expect system binaries already installed (calibredb, ebook-convert, node, uv).
Credentials
Declared required env is CALIBRE_PASSWORD (primary credential) with optional CALIBRE_USERNAME and several CALIBRE_* URL/host env vars; these are appropriate for connecting to a Calibre Content server. Caveat: the scripts load .env files and will populate process.env with any keys found there (if not already set), which can lead to other environment values being read into the runtime. This is likely intended for convenience but means installing this skill will cause it to read local env files that may contain unrelated secrets.
Persistence & Privilege
always:false (no forced global inclusion). The skill writes only to its own state paths (skills/calibre-catalog-read/state/..., state/cache/...) as declared. It does perform a declared remote modification limited to Calibre 'comments' metadata; it does not request system- or platform-wide privileges, nor does it alter other skills' configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install calibre-catalog-read
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /calibre-catalog-read 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.10
calibre-catalog-read v1.0.10 - Clarified and expanded routing rules for requests containing book IDs to default to read-only lookup, even if an explicit ID is mentioned. - Updated documentation: made it explicit that "ID を確認" / "show me book 1021" / "詳細" triggers only a read lookup, not an edit. - Stressed that only explicit edit actions (e.g., 修正/編集/fix/update) should be routed to metadata apply skill; all other ID-based requests remain read-only in this skill. - No runtime or script logic changed; documentation and skill contract are now clearer and stricter.
v1.0.9
refactor: TOOLS.md設定統合 / config file依存を除去
v1.0.8
refactor: migrate user config from per-skill config files to TOOLS.md (#3)
v1.0.7
calibre-catalog-read 1.0.7 - Expanded skill selection logic: the skill can now be triggered in natural conversational turns to perform read-only lookups, even without explicit command wording. - Conversational policy clarified: read-only lookups are preferred on casual book mentions; heavy analysis is only triggered when explicitly requested. - Stronger recommendations to avoid accidental metadata edits or heavy reads from offhand user remarks. - No changes to commands, subagent split, or requirements. - Internal cache updated with new analysis results (book_636.txt, book_637.txt).
v1.0.6
calibre-catalog-read 1.0.6 - Clarified that this skill is strictly read-only for catalog lookup and analysis-comments workflow; directs all metadata edits to calibre-metadata-apply. - Enhanced instructions on how --with-library is auto-resolved from environment/config; scripts now attempt connection using defaults before asking the user. - Added policy on host failover and resilience to IP changes, including WSL-specific handling. - Updated README and documentation to clarify Content server requirements, connection strategies, and that calibre-server should never be run from this skill. - Minor implementation tweaks and documentation improvements in scripts for improved startup and completion handling. - Added more explicit separation of responsibility between this skill and metadata editing flows.
v1.0.5
- Improved error handling and comments in Python analysis scripts. - Updated prompt instructions for subagent analysis to clarify required structure and language use. - Minor documentation adjustments for clarity in orchestration and session policies.
v1.0.4
calibre-catalog-read 1.0.4 - Added requirement and guidance to use `uv run python` instead of `python3` for running Python scripts. - Updated required bins in metadata to include `uv`. - Declared dependency on `subagent-spawn-command-builder` in metadata. - Updated documentation in SKILL.md and README.md to reflect these changes in command examples and environment setup.
v1.0.3
calibre-catalog-read 1.0.3 adds full subagent support for book analysis workflows. - Added subagent workflow references and schemas: prompt template, input, and output schemas for subagent analysis generation. - Added scripts for full analysis orchestration: `run_analysis_pipeline.py`, database state tracking (`analysis_db.py`), state/runs management (`run_state.mjs`), and completion handling (`handle_completion.mjs`). - Added extraction input preparation utilities to split raw book text for subagent ingestion. - Updated chat/orchestration notes and policy documentation for strict two-turn execution (start and completion). - All new files and scripts are focused on enabling scalable, non-blocking AI reading workflows via subagent calls and strict DB/state management.
v1.0.2
- Removes all subagent and analysis pipeline scripts and reference files, simplifying the skill. - Updates documentation in README.md and SKILL.md to match the removal and current command usage. - Clarifies environment variable handling and introduces metadata block. - Removes support for book analysis workflow—now focused on read-only catalog lookups (list/search/id).
v1.0.0
calibre-catalog-read v1.0.0 - Migrated all orchestration and pipeline helper scripts from Python to Node.js (now `.mjs`). - Added Node.js equivalents: `handle_completion.mjs`, `prepare_subagent_input.mjs`, and `run_state.mjs`. - Removed Python script versions: `handle_completion.py`, `prepare_subagent_input.py`, `run_state.py`. - Updated documentation for new environment variable authentication method and Node.js commands. - Changed cache DB path recommendations to reside within the skill's own state directory. - Clarified orchestration, authentication, and main/subagent division in documentation.
v0.1.1
calibre-catalog-read 0.1.1 - Added required dependency on `subagent-spawn-command-builder` for subagent payload building. - Updated orchestration: main agent must use the builder skill to generate `sessions_spawn` payloads with profile `calibre-read`. - Clarified that Python commands must use `python3`. - Enhanced subagent launch policy: must use strict prompt and not send ad-hoc relaxations. - Improved documentation for orchestration, chat turn separation, and turn rules.
v0.1.0
calibre-catalog-read 0.1.0 - Initial release with catalog reading via calibredb over a Content server. - Supports list, search, and get-by-id operations for books. - Adds one-book AI analysis workflow: export, analyze, cache, and apply HTML analysis to comments. - Caches analysis state in SQLite; includes DB initialization and status check scripts. - Implements strict main vs subagent workflow for seamless async chat operation. - Includes session state handling and orchestration guidelines for chat/agent flows.
元数据
Slug calibre-catalog-read
版本 1.0.10
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 12
常见问题

Calibre Catalog Read 是什么?

Read-only Calibre catalog lookup (including ID-based read-only lookups like "ID 1021 を確認して") and one-book analysis-comments workflow over a running Content s... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1303 次。

如何安装 Calibre Catalog Read?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install calibre-catalog-read」即可一键安装,无需额外配置。

Calibre Catalog Read 是免费的吗?

是的,Calibre Catalog Read 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Calibre Catalog Read 支持哪些平台?

Calibre Catalog Read 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Calibre Catalog Read?

由 Altair(@nextaltair)开发并维护,当前版本 v1.0.10。

💬 留言讨论