FIRE Card to EPUB
Turn FIRE analysis cards into a small validated EPUB book.
Use this skill when the user asks:
FIRE 卡片變成電子書
把分析卡做成 EPUB
教我怎麼從 FIRE 到電子書
上傳 GitHub 成為技能,附上電子書檔案
把 Obsidian 知識卡整理成 EPUB
This skill bridges two workflows:
| Source Skill |
Role |
fire-analysis-card |
Analyze article/note material into Fact, Index, Relation, Encyclopedia |
project-note-json-to-epub |
Package structured notes into EPUB with TOC, index, links, and validation |
Core Workflow
Create or collect FIRE cards.
- Each card should have a stable
code, title, body, keywords, and optional fire_card.
- Keep each body chunk compact: one concept per card.
Build a project-note JSON manuscript.
- Use
assets/fire-to-epub-tutorial.json as the starting schema.
- Required top-level fields:
title, creator, language, chunks.
- Optional but recommended fields:
subtitle, index, orthogonal_check.
Generate EPUB.
python3 scripts/fire_cards_to_epub.py assets/fire-to-epub-tutorial.json --out assets/fire-to-epub-tutorial.epub --download-copy assets/download.epub
Verify the output.
- The script validates XML, href targets, anchors, backlink counts, index links, and file type.
- Delivery is acceptable only when
errors: 0.
Upload as a GitHub Skill asset.
- Include
SKILL.md, scripts/fire_cards_to_epub.py, the sample JSON, and the sample EPUB.
- Keep the EPUB in
assets/ so users can download or inspect it from GitHub.
JSON Schema
Minimal manuscript:
{
"title": "FIRE 卡片變成電子書",
"creator": "Codex",
"language": "zh-Hant",
"chunks": [
{
"code": "1.1",
"title": "FIRE 先成卡",
"body": "正文內容。",
"keywords": ["FIRE", "知識卡"],
"fire_card": "可選:固定寬度 FIRE 卡文字"
}
]
}
Recommended manuscript:
{
"title": "FIRE 卡片變成電子書",
"subtitle": "從分析卡到 EPUB 的最小流程",
"creator": "Codex",
"language": "zh-Hant",
"chunks": [
{
"code": "1.1",
"title": "FIRE 先成卡",
"body": "先把文章壓成穩定知識卡,再進入電子書結構。",
"keywords": ["FIRE", "知識卡", "Fact"]
}
],
"index": [
{"id": "K001", "keyword": "FIRE", "weight": 100}
],
"orthogonal_check": {
"ok": true,
"axes": {
"analysis_axis": "Fact、Index、Relation、Encyclopedia",
"book_axis": "TOC、正文、索引、驗證"
}
}
}
If index is missing, the script derives it from chunks[].keywords.
EPUB Output
The generator writes:
| EPUB File |
Purpose |
mimetype |
EPUB signature, first and uncompressed |
META-INF/container.xml |
Rootfile pointer |
OEBPS/content.opf |
Metadata, manifest, spine |
OEBPS/nav.xhtml |
EPUB navigation |
OEBPS/Text/toc.xhtml |
Directory card |
OEBPS/Text/part001.xhtml |
Chapter/card pages |
OEBPS/Text/index.xhtml |
Keyword index cards |
OEBPS/Styles/style.css |
Readable style |
Validation Contract
Before delivery, report:
errors: 0
title: ...
all_href_count: ...
index_forward_links_tested: ...
body_return_links_tested: ...
index_entries: ...
true_body_cjk_count: ...
file type: EPUB document
If errors is not 0, fix the JSON or generator and rebuild.
Teaching Script
Explain the workflow to the user like this:
fire-analysis-card 把文章變成穩定知識卡。
- 把多張 FIRE 卡整理成
chunks[]。
- 從
keywords 建立 K001、K002 等索引卡。
- EPUB 由三層組成:目錄卡、正文卡、書末索引卡。
- 每個正文關鍵詞回鏈到索引卡;索引卡再連回正文。
- 驗證所有 EPUB 連結,確認
errors: 0。
Notes
- Keep EPUB attachments in
assets/.
- Do not hand-edit generated EPUB internals after validation; fix JSON or script and rebuild.
- Use short Chinese card bodies; EPUB is a sequence of cards, not a long essay dump.
1---2name: fire-card-to-epub3description: Convert FIRE analysis cards, Chinese knowledge notes, or project-note JSON into validated EPUB books with directory cards, chapter cards, keyword index cards, backlinks, and GitHub-shareable ebook assets. Use when Codex needs to teach or automate the path from `fire-analysis-card` outputs to `project-note-json-to-epub` style EPUB files, including sample JSON manuscripts and attached `.epub` deliverables.4---56# FIRE Card to EPUB78Turn FIRE analysis cards into a small validated EPUB book.910Use this skill when the user asks:1112- `FIRE 卡片變成電子書`13- `把分析卡做成 EPUB`14- `教我怎麼從 FIRE 到電子書`15- `上傳 GitHub 成為技能,附上電子書檔案`16- `把 Obsidian 知識卡整理成 EPUB`1718This skill bridges two workflows:1920| Source Skill | Role |21|---|---|22| `fire-analysis-card` | Analyze article/note material into Fact, Index, Relation, Encyclopedia |23| `project-note-json-to-epub` | Package structured notes into EPUB with TOC, index, links, and validation |2425## Core Workflow26271. Create or collect FIRE cards.28 - Each card should have a stable `code`, `title`, `body`, `keywords`, and optional `fire_card`.29 - Keep each body chunk compact: one concept per card.30312. Build a project-note JSON manuscript.32 - Use `assets/fire-to-epub-tutorial.json` as the starting schema.33 - Required top-level fields: `title`, `creator`, `language`, `chunks`.34 - Optional but recommended fields: `subtitle`, `index`, `orthogonal_check`.35363. Generate EPUB.3738```bash39python3 scripts/fire_cards_to_epub.py assets/fire-to-epub-tutorial.json --out assets/fire-to-epub-tutorial.epub --download-copy assets/download.epub40```41424. Verify the output.43 - The script validates XML, href targets, anchors, backlink counts, index links, and file type.44 - Delivery is acceptable only when `errors: 0`.45465. Upload as a GitHub Skill asset.47 - Include `SKILL.md`, `scripts/fire_cards_to_epub.py`, the sample JSON, and the sample EPUB.48 - Keep the EPUB in `assets/` so users can download or inspect it from GitHub.4950## JSON Schema5152Minimal manuscript:5354```json55{56 "title": "FIRE 卡片變成電子書",57 "creator": "Codex",58 "language": "zh-Hant",59 "chunks": [60 {61 "code": "1.1",62 "title": "FIRE 先成卡",63 "body": "正文內容。",64 "keywords": ["FIRE", "知識卡"],65 "fire_card": "可選:固定寬度 FIRE 卡文字"66 }67 ]68}69```7071Recommended manuscript:7273```json74{75 "title": "FIRE 卡片變成電子書",76 "subtitle": "從分析卡到 EPUB 的最小流程",77 "creator": "Codex",78 "language": "zh-Hant",79 "chunks": [80 {81 "code": "1.1",82 "title": "FIRE 先成卡",83 "body": "先把文章壓成穩定知識卡,再進入電子書結構。",84 "keywords": ["FIRE", "知識卡", "Fact"]85 }86 ],87 "index": [88 {"id": "K001", "keyword": "FIRE", "weight": 100}89 ],90 "orthogonal_check": {91 "ok": true,92 "axes": {93 "analysis_axis": "Fact、Index、Relation、Encyclopedia",94 "book_axis": "TOC、正文、索引、驗證"95 }96 }97}98```99100If `index` is missing, the script derives it from `chunks[].keywords`.101102## EPUB Output103104The generator writes:105106| EPUB File | Purpose |107|---|---|108| `mimetype` | EPUB signature, first and uncompressed |109| `META-INF/container.xml` | Rootfile pointer |110| `OEBPS/content.opf` | Metadata, manifest, spine |111| `OEBPS/nav.xhtml` | EPUB navigation |112| `OEBPS/Text/toc.xhtml` | Directory card |113| `OEBPS/Text/part001.xhtml` | Chapter/card pages |114| `OEBPS/Text/index.xhtml` | Keyword index cards |115| `OEBPS/Styles/style.css` | Readable style |116117## Validation Contract118119Before delivery, report:120121```text122errors: 0123title: ...124all_href_count: ...125index_forward_links_tested: ...126body_return_links_tested: ...127index_entries: ...128true_body_cjk_count: ...129file type: EPUB document130```131132If `errors` is not `0`, fix the JSON or generator and rebuild.133134## Teaching Script135136Explain the workflow to the user like this:1371381. `fire-analysis-card` 把文章變成穩定知識卡。1392. 把多張 FIRE 卡整理成 `chunks[]`。1403. 從 `keywords` 建立 `K001`、`K002` 等索引卡。1414. EPUB 由三層組成:目錄卡、正文卡、書末索引卡。1425. 每個正文關鍵詞回鏈到索引卡;索引卡再連回正文。1436. 驗證所有 EPUB 連結,確認 `errors: 0`。144145## Notes146147- Keep EPUB attachments in `assets/`.148- Do not hand-edit generated EPUB internals after validation; fix JSON or script and rebuild.149- Use short Chinese card bodies; EPUB is a sequence of cards, not a long essay dump.