Purpose
Verify and provision the first-time DeDRM setup, per the uniform setup contract
(docs/PLUGIN-PHILOSOPHY.md "Setup is explicit and repeatable" in the marketplace repository).
check inspects prerequisites and current state read-only; apply runs the provisioning walkthrough
(the router skill's workflow reference), then re-runs check. No argument or check runs the check;
apply runs the check first, then provisioning; apply download runs only the gated
artifact-download subaction. This plugin has no repo- or consumer-scoped
configuration and no userConfig scalars/toggles. Setup writes no Claude Code user settings, no
pluginConfigs, and nothing into the plugin cache or plugin data directory; it provisions the user's
machine (installs, firewall rule, ICACLS lock, extracted keys) and every mutation has a compensating
reversal under /kindle-dedrm:manage cleanup.
Scope and the hard safety rules are the router skill's: read
${CLAUDE_PLUGIN_ROOT}/skills/manage/SKILL.md
"Hard safety rules" before any apply. They apply here unchanged (never open Kindle with the firewall
down except during an active sync; never run the cached auto-update installer; never send keys or
extracted files off the machine).
Interactivity
Much of provisioning is irreducibly interactive. The installer's UAC + EULA, the Amazon sign-in race
window, the Calibre plugin GUI loads, and the keyfinder VBS are actions on the user's machine the agent
physically cannot drive. apply keeps these as user-action hand-offs (hand the user the exact step,
wait for confirmation at each CHECKPOINT), not interview prompts. There are no configuration decisions
to interview for. The parts that genuinely automate, artifact download + SHA verification, the firewall
rule, the ICACLS lock, run non-interactively.
check (read-only)
The status script
(${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/status.sh) is the source of truth for current
state. Run it and read its JSON before reporting. Add the prerequisite probes the pre-flight table in
the workflow reference (${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/workflow.md)
requires. Report a PASS/FAIL/INFO table with one remediation per FAIL; modify
nothing, download nothing, extract nothing.
bash "${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/status.sh"
- Hard prerequisites. FAIL when absent: Calibre installed (any recent version); Python 3.6+ on
PATH and not the Windows Store
WindowsApps stub; pwsh available; admin rights available.
These are true prerequisites, not opt-in state.
- Kindle for PC version. Installed and not
2.8.0.70980 is FAIL (the user must uninstall it
first. The skill never auto-uninstalls; see
${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/troubleshooting.md). Absent is INFO (not
yet provisioned. apply installs it). Exactly 2.8.0.70980 is PASS.
- Provisioning state. Firewall rule, ICACLS deny,
~/Tools/Kindle_Key_Finder, and the three
~/Downloads artifacts. Before first setup these are legitimately absent → INFO ("not yet
provisioned; run apply"), not FAIL.
- Cached auto-update installer.
status.sh's cached_installer present is FAIL: it is the
auto-update payload that breaks key extraction; remediation is
${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/lock-updates.sh apply /
${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/sync-finalize.sh delete-cache (never run it).
- Calibre plugins and books. INFO: report
calibre_plugins (KFX Input, DeDRM, dedrm.json
presence) and the books synced/converted counts. Report the key store dedrm.json presence-only.
Never print its contents (it holds extracted keys).
apply (idempotent)
Run check, then provision. apply walks the full first-time sequence; apply download runs only the
gated download subaction. Every step's exact command, rationale, and verification live in
${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/workflow.md.
Follow it there; do not restate it here (that keeps the download flow's pinned-tag fallback and the
Key_Finder URL empty-match guard authoritative in one place). Pause at every CHECKPOINT for user
confirmation.
apply download. Step 1 of the workflow reference: download the three artifacts to
~/Downloads and SHA256-verify them against the versions reference
(${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/versions.md). The DeDRM_tools tag resolves
dynamically via the authenticated gh CLI and falls back to the pinned tag in the versions
reference when gh is unavailable or returns nothing; the guard refuses to compose a URL with the
placeholder still in place. The Key_Finder zip URL resolves from the tutorial article and stops with
the mirror-procedure pointer on an empty match. On a SHA mismatch, stop and re-fetch.
- Full
apply. Steps 1-9 of the workflow reference: download (as above) → extract → user runs
the installer (UAC/EULA hand-off, CHECKPOINT) → sign-in race window (CHECKPOINT) → verify books on
disk → firewall block (${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/firewall.ps1 enable) →
delete cached installer + ICACLS deny
(${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/lock-updates.sh apply) → Calibre plugin loads
(GUI hand-off, CHECKPOINT) → run keyfinder (VBS hand-off, CHECKPOINT) → verify EPUBs.
- Verify after each remediation. After each automated mutation re-run the relevant
status.sh
probe (firewall rule enabled, ICACLS LOCK OK, downloads 3/3, Kindle version 2.8.0.70980) and
report its actual result; never claim a step succeeded on a command's exit code alone.
Re-running apply when check already passes changes nothing new. The download, extraction, firewall,
and lock steps are idempotent, and the skill reports "already provisioned".
What this skill does NOT do
- Run
sync, update, cleanup, or status. Those stay on the router skill
(/kindle-dedrm:manage); check here is the read-only state report, apply is first-time provisioning.
- Write the plugin cache, Claude Code user settings, or
pluginConfigs. Nor the plugin data directory.
- Send any script, key, or extracted file off the user's machine. Personal-use scope only.
- Auto-uninstall a wrong Kindle for PC version or run the cached auto-update installer.
1---2name: setup-343description: Verify and provision the Kindle for PC 2.8.0 + Calibre DeDRM workflow (Windows only, personal-use, books you own). check probes prerequisites and current state read-only (Calibre, Python, pwsh, admin, Kindle version, firewall/ICACLS lock, downloads, plugins) via the plugin's own status script; apply runs the first-time provisioning walkthrough — the gated artifact download, install, firewall block, ICACLS lock, Calibre plugins, and keyfinder. Use when: 'set up Kindle DRM removal', 'is my DeDRM setup ready', 'provision kindle-dedrm', 'download DeDRM tools', 'check DeDRM prerequisites'. Re-runnable and safe.4---56## Purpose78Verify and provision the first-time DeDRM setup, per the uniform setup contract9(`docs/PLUGIN-PHILOSOPHY.md` "Setup is explicit and repeatable" in the marketplace repository).10`check` inspects prerequisites and current state read-only; `apply` runs the provisioning walkthrough11(the router skill's workflow reference), then re-runs `check`. No argument or `check` runs the check;12`apply` runs the check first, then provisioning; `apply download` runs only the gated13artifact-download subaction. This plugin has no repo- or consumer-scoped14configuration and no `userConfig` scalars/toggles. Setup writes no Claude Code user settings, no15`pluginConfigs`, and nothing into the plugin cache or plugin data directory; it provisions the user's16machine (installs, firewall rule, ICACLS lock, extracted keys) and every mutation has a compensating17reversal under `/kindle-dedrm:manage cleanup`.1819Scope and the hard safety rules are the router skill's: read20[`${CLAUDE_PLUGIN_ROOT}/skills/manage/SKILL.md`](${CLAUDE_PLUGIN_ROOT}/skills/manage/SKILL.md)21"Hard safety rules" before any `apply`. They apply here unchanged (never open Kindle with the firewall22down except during an active sync; never run the cached auto-update installer; never send keys or23extracted files off the machine).2425## Interactivity2627Much of provisioning is irreducibly interactive. The installer's UAC + EULA, the Amazon sign-in race28window, the Calibre plugin GUI loads, and the keyfinder VBS are actions on the user's machine the agent29physically cannot drive. `apply` keeps these as **user-action hand-offs** (hand the user the exact step,30wait for confirmation at each CHECKPOINT), not interview prompts. There are no configuration decisions31to interview for. The parts that genuinely automate, artifact download + SHA verification, the firewall32rule, the ICACLS lock, run non-interactively.3334## `check` (read-only)3536The status script37(`${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/status.sh`) is the source of truth for current38state. Run it and read its JSON before reporting. Add the prerequisite probes the pre-flight table in39the workflow reference (`${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/workflow.md`)40requires. Report a PASS/FAIL/INFO table with one remediation per FAIL; modify41nothing, download nothing, extract nothing.4243```bash44bash "${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/status.sh"45```46471. **Hard prerequisites.** FAIL when absent: Calibre installed (any recent version); Python 3.6+ on48 PATH and **not** the Windows Store `WindowsApps` stub; `pwsh` available; admin rights available.49 These are true prerequisites, not opt-in state.502. **Kindle for PC version.** Installed and **not** `2.8.0.70980` is FAIL (the user must uninstall it51 first. The skill never auto-uninstalls; see52 `${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/troubleshooting.md`). Absent is INFO (not53 yet provisioned. `apply` installs it). Exactly `2.8.0.70980` is PASS.543. **Provisioning state.** Firewall rule, ICACLS deny, `~/Tools/Kindle_Key_Finder`, and the three55 `~/Downloads` artifacts. Before first setup these are legitimately absent → INFO ("not yet56 provisioned; run `apply`"), not FAIL.574. **Cached auto-update installer.** `status.sh`'s `cached_installer` present is FAIL: it is the58 auto-update payload that breaks key extraction; remediation is59 `${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/lock-updates.sh apply` /60 `${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/sync-finalize.sh delete-cache` (never run it).615. **Calibre plugins and books.** INFO: report `calibre_plugins` (KFX Input, DeDRM, `dedrm.json`62 presence) and the `books` synced/converted counts. Report the key store `dedrm.json` presence-only.63 Never print its contents (it holds extracted keys).6465## `apply` (idempotent)6667Run `check`, then provision. `apply` walks the full first-time sequence; `apply download` runs only the68gated download subaction. Every step's exact command, rationale, and verification live in69[`${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/workflow.md`](${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/workflow.md).70**Follow it there; do not restate it here** (that keeps the download flow's pinned-tag fallback and the71Key_Finder URL empty-match guard authoritative in one place). Pause at every CHECKPOINT for user72confirmation.7374- **`apply download`.** Step 1 of the workflow reference: download the three artifacts to75 `~/Downloads` and SHA256-verify them against the versions reference76 (`${CLAUDE_PLUGIN_ROOT}/skills/manage/reference/versions.md`). The DeDRM_tools tag resolves77 dynamically via the authenticated `gh` CLI and **falls back to the pinned tag in the versions78 reference** when `gh` is unavailable or returns nothing; the guard refuses to compose a URL with the79 placeholder still in place. The Key_Finder zip URL resolves from the tutorial article and **stops with80 the mirror-procedure pointer on an empty match**. On a SHA mismatch, stop and re-fetch.81- **Full `apply`.** Steps 1-9 of the workflow reference: download (as above) → extract → user runs82 the installer (UAC/EULA hand-off, CHECKPOINT) → sign-in race window (CHECKPOINT) → verify books on83 disk → firewall block (`${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/firewall.ps1 enable`) →84 delete cached installer + ICACLS deny85 (`${CLAUDE_PLUGIN_ROOT}/skills/manage/scripts/lock-updates.sh apply`) → Calibre plugin loads86 (GUI hand-off, CHECKPOINT) → run keyfinder (VBS hand-off, CHECKPOINT) → verify EPUBs.87- **Verify after each remediation.** After each automated mutation re-run the relevant `status.sh`88 probe (firewall rule enabled, ICACLS `LOCK OK`, downloads `3/3`, Kindle version `2.8.0.70980`) and89 report its actual result; never claim a step succeeded on a command's exit code alone.9091Re-running `apply` when `check` already passes changes nothing new. The download, extraction, firewall,92and lock steps are idempotent, and the skill reports "already provisioned".9394## What this skill does NOT do9596- Run `sync`, `update`, `cleanup`, or `status`. Those stay on the router skill97 (`/kindle-dedrm:manage`); `check` here is the read-only state report, `apply` is first-time provisioning.98- Write the plugin cache, Claude Code user settings, or `pluginConfigs`. Nor the plugin data directory.99- Send any script, key, or extracted file off the user's machine. Personal-use scope only.100- Auto-uninstall a wrong Kindle for PC version or run the cached auto-update installer.