/book-to-course:course-to-apkfrom book-to-course
Packages an interactive course (HTML/JS folder or .zip) into a signed Android APK using raw SDK tools. Checks for JDK and Android SDK, downloads missing pieces, and builds a lightweight offline WebView app.
Ships in book-to-course. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Wraps a finished book-to-course course into a small Android app: one Activity with a WebView that serves the course
files from inside the APK. No Gradle, no Android Studio project, no network permission — the build calls the SDK tools
directly (aapt2 → javac → d8 → zipalign → apksigner), so the APK is roughly the size of the course plus ~10 KB.
The app wrapper (assets/android/) and the scripts are fixed and tested — your job is the conversation around them:
find the course, get the toolchain in place with the user's consent, build, and explain how to put it on the device.
script (in scripts/) | purpose |
|---|---|
toolchain.py [--json] | what is installed, what is missing, where to download it; exit 0 = ready |
setup_toolchain.py --dry-run | list exactly what would be downloaded (name, size, URL) — downloads nothing |
setup_toolchain.py --show-license | print the Android SDK licence text |
setup_toolchain.py --accept-licenses | download only the missing parts into ~/.local/share/course-to-apk (no sudo) |
build_apk.py COURSE_DIR [--install] | build the signed APK into <COURSE_DIR>-android/ |
All scripts are Python 3 standard library only.
A course folder has index.html, assets/app.js and course/data.js. Look where the user points, in the current
directory, or among recent book-to-course output. If they give a .zip (from pack_course.py), unzip it next to the zip
first — it contains one top folder named after the course; that folder is COURSE_DIR. If content/ exists but course/data.js is missing or older than the lessons, the course was not rebuilt —
run book-to-course's build_course.py COURSE_DIR first (when that skill is available), otherwise ask the user to.
python3 scripts/toolchain.py
It searches well beyond PATH (JAVA_HOME, ANDROID_HOME, ~/Android/Sdk, ~/.jdks, Android Studio's bundled JBR,
/usr/lib/jvm, …), so a JDK that which java does not see is still found. If it prints READY, go to step 4.
Tell the user, in their language, what is missing — use the report's lines, they already contain the official download
links and package-manager commands for their OS. Then run setup_toolchain.py --dry-run so you can quote the real sizes
and URLs, and ask them to choose (AskUserQuestion works well here):
JAVA_HOME / ANDROID_HOME). Then stop and wait. Do not poll, do not build, do not download
anything. When they write that it's installed, rerun toolchain.py; if something is still missing, say exactly what
and wait again.--show-license). Their choice of this option must include
agreeing to it — say so in the question. Only then run
python3 scripts/setup_toolchain.py --accept-licenses (≈320 MB if the JDK is also missing, ≈125 MB otherwise; it
verifies checksums and installs only into ~/.local/share/course-to-apk, nothing system-wide, no sudo).Why the care: downloading hundreds of megabytes and accepting a licence are the user's decisions, not yours, and a user who said they'd install things themselves is mid-installation — building or downloading behind their back collides with that.
python3 scripts/build_apk.py "<COURSE_DIR>"
Defaults that are right for almost everyone — mention them, don't ask:
<COURSE_DIR>-android/<course-id>.apk, next to the course folder; apk.json there remembers the package id,
label, icon colour and an auto-incremented versionCode.~/.android/debug.keystore (the standard developer certificate; created with
keytool if it doesn't exist). Fine for installing on your own devices; it is not a Play Store release key. If the user
has their own keystore: --keystore FILE --key-alias A --ks-pass P (or APK_KS_PASS env var so the password doesn't
land in shell history); it's remembered in apk.json.net.booktocourse.<course_id>, label = course title. Override with --package / --label only
when asked — changing the package later makes Android treat it as a different app and the learner loses progress.If the build fails, the error names the tool and shows its output; see references/troubleshooting.md.
Tell the user in a few lines: where the APK is (absolute path), its size, and how to install it:
build_apk.py … --install
(or adb install -r <apk>). Offer this if toolchain.py showed adb and a device is connected (adb devices).Also say, briefly:
progress/progress.json of the computer copy) and survives
updates — rebuild with the same folder and key after adding chapters and install over the old app. Uninstalling deletes it.start.sh/start.bat); on the phone the page
shows the test command instead. Lessons, quizzes, tests and flashcards all work offline.https://appassets.androidplatform.net/ via shouldInterceptRequest — a reserved host that
never hits the network, giving the page a stable origin for localStorage. No INTERNET permission; links to other
sites open in the user's browser.alert()/confirm() show real dialogs (the player avoids them anyway).To change the wrapper itself (e.g. lock orientation), edit assets/android/ — MainActivity.java, AndroidManifest.xml
(placeholders {{PACKAGE}}, {{LABEL}}), res/. Keep it framework-only: there is no Gradle, so AndroidX libraries can't be added.
assets/android/AndroidManifest.xml (opens in a new tab)assets/android/res/drawable/ic_book.xml (opens in a new tab)assets/android/res/mipmap-anydpi-v26/ic_launcher.xml (opens in a new tab)assets/android/res/mipmap/ic_launcher.xml (opens in a new tab)assets/android/res/values-night/colors.xml (opens in a new tab)assets/android/res/values-night/themes.xml (opens in a new tab)assets/android/res/values/colors.xml (opens in a new tab)assets/android/res/values/themes.xml (opens in a new tab)assets/android/src/net/booktocourse/app/MainActivity.java (opens in a new tab)references/troubleshooting.md (opens in a new tab)scripts/build_apk.py (opens in a new tab)scripts/setup_toolchain.py (opens in a new tab)scripts/toolchain.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sebastianhaba/book-to-course-skill --plugin book-to-course3 skills in this plugin
/book-to-courseTurn a book or document (EPUB, PDF, HTML, DOCX, Markdown, TXT — e.g. a programming course book) into a complete interactive beginner-friendly course delivered as a local web page, with step-by-step explanations, animations, quizzes, chapter tests, flashcards, hints, programming exercises checked by unit tests, and learner progress saved to files. Use this skill whenever the user uploads or mentions a book/ebook/PDF/EPUB/tutorial/lecture notes and wants to LEARN from it, wants a "kurs interaktywny", "kurs z książki", "zrób z tego kurs/naukę", an interactive course, study site, quiz/exercise version of a book, or says to continue/extend an existing generated course ("następny rozdział", "kontynuuj kurs"). Use it even if they don't say "skill" or "course" explicitly but describe turning reading material into something to study interactively. Do NOT use for plain summaries, a single quiz, or translating a book./course-to-appimagePackage an existing interactive course generated by the book-to-course skill (a folder with index.html, assets/ and course/data.js, or its .zip) into a self-contained Linux AppImage — one file that carries its own WebView engine (Electron), so it runs on any desktop distro without installing anything, keeps progress in a file and can run code exercises' tests. Checks the build tools on the machine (appimagetool, Electron, AppImage runtime), tells the user exactly what is missing and where to get it, and can download it for them. Use this whenever the user wants a course "na Linuxa", "jako aplikację na pulpit/desktop", "w menu aplikacji", "zrób z kursu AppImage", "course to appimage", wants a course app they can copy to another Linux computer, wants to open their generated course like a normal program instead of start.sh, or wants to rebuild/update the course app after adding chapters — even if they don't say "AppImage" explicitly. Do NOT use for building a course from a book (that is book-to-course), for Android (course-to-apk), Windows/macOS installers, Flatpak/Snap/.deb packaging, or general Linux/Electron app development.Other plugins' skills for the same job