[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75MAWRVHP81C5Z6JAWVC84B":3,"skill-same:01M75MAWRVHP81C5Z6JAWVC84B":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":13,"repositoryHtmlUrl":36,"repositoryHomepageUrl":37,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":52},"01M75MAWRVHP81C5Z6JAWVC84B","book-mirror",null,"Take any book (EPUB\u002FPDF), produce a personalized chapter-by-chapter analysis with two-column tables. Left column preserves the chapter content; right column maps every idea to the reader's actual life using brain context. Output is a single brain page at media\u002Fbooks\u002F\u003Cslug>-personalized.md plus an optional PDF via brain-pdf.","Sigmacodeat\u002FSigmabrain","Sigmacodeat","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F220578687?v=4","01M75M8ZBH9439AFP2NTF8K98S","01M75M8ZC680S4377SFWSKP0D1",0,"MIT","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Fskills\u002Fbook-mirror\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: book-mirror\nversion: 0.1.0\ndescription: Take any book (EPUB\u002FPDF), produce a personalized chapter-by-chapter analysis with two-column tables. Left column preserves the chapter content; right column maps every idea to the reader's actual life using brain context. Output is a single brain page at media\u002Fbooks\u002F\u003Cslug>-personalized.md plus an optional PDF via brain-pdf.\ntriggers:\n  - \"personalized version of this book\"\n  - \"mirror this book\"\n  - \"two-column book analysis\"\n  - \"apply this book to my life\"\n  - \"how does this book apply to me\"\nmutating: true\nwrites_pages: true\nwrites_to:\n  - media\u002Fbooks\u002F\n---\n\n# book-mirror — Personalized Chapter-by-Chapter Book Analysis\n\n> **Convention:** see [_brain-filing-rules.md](..\u002F_brain-filing-rules.md) for the\n> sanctioned `media\u002F\u003Cformat>\u002F\u003Cslug>` exception this skill files under.\n>\n> **Convention:** see [conventions\u002Fquality.md](..\u002Fconventions\u002Fquality.md) for\n> citation rules, back-link enforcement, and output quality bars.\n>\n> **Convention:** see [conventions\u002Fbrain-first.md](..\u002Fconventions\u002Fbrain-first.md)\n> for the lookup chain (brain → search → external) the context-gathering\n> phase follows.\n\n## What this does\n\nGiven a book (EPUB or PDF), produce a brain page where every chapter is\nsummarized in detail on the left and mirrored back to the reader's actual life\non the right, using their own words, situations, people, and patterns from\nthe brain. Output is a brain page at `media\u002Fbooks\u002F\u003Cslug>-personalized.md`.\n\nThis is NOT a generic book summary. The right column is the value: it makes\nthe book read like a therapist who knows the reader is leaving notes in the\nmargins. If the user wants a flat summary instead, route them to a different\nskill.\n\n## Trust contract (read this before running)\n\nbook-mirror runs as a CLI command (`gbrain book-mirror`), NOT as a pure\nmarkdown skill that the agent dispatches via tools. The CLI is the trusted\nruntime; the skill is the orchestration prose around it.\n\nWhat this means for the agent:\n\n- The CLI submits N read-only subagent jobs (one per chapter). Each subagent\n  has `allowed_tools: ['get_page', 'search']` only. They CANNOT call\n  put_page or any mutating op. They produce markdown analysis via their\n  final message.\n- The CLI reads each child's `job.result`, assembles the final\n  two-column page, and writes it via a single operator-trust `put_page`.\n- This means untrusted EPUB\u002FPDF content cannot prompt-inject any\n  `people\u002F*` page. The trust narrowing happens at the tool allowlist,\n  not at the slug-prefix layer.\n\n## The pipeline\n\n```\n1. ACQUIRE   → User has the EPUB\u002FPDF locally (manual; book-acquisition is\n               not currently shipped — see \"Acquiring the book\" below).\n2. EXTRACT   → Pull chapter text from EPUB\u002FPDF into one .txt per chapter.\n3. CONTEXT   → Gather everything the brain knows about the reader.\n4. ANALYZE   → `gbrain book-mirror` fans out N read-only subagents.\n5. ASSEMBLE  → CLI reads each child result and writes one put_page.\n6. PDF       → Optional: render via skills\u002Fbrain-pdf for delivery.\n```\n\n## 1. Acquiring the book\n\nbook-acquisition (legal-grey-area downloader) was deliberately not shipped\nin this skill wave. The user drops the EPUB\u002FPDF manually. Common paths the\nuser might use:\n\n```bash\n# User-supplied path\nls path\u002Fto\u002Fbook.epub\nls path\u002Fto\u002Fbook.pdf\n\n# Or already in the brain repo (recommended for tracking)\nls $BRAIN_DIR\u002Fmedia\u002Fbooks\u002F\n```\n\nResolve `$BRAIN_DIR` from the gbrain config (`gbrain config get sync.repo_path`)\nor accept it from the user.\n\n## 2. Text extraction\n\nGoal: one `.txt` file per chapter under a temp directory. The agent has\nshell + python access; the CLI is downstream of this and takes the\nextracted directory as input.\n\n### EPUB\n\n```bash\nSLUG=\"this-book\"                                # kebab-case\nWORK=\"$(mktemp -d)\u002F$SLUG\"\nmkdir -p \"$WORK\u002Fchapters\"\nunzip -o path\u002Fto\u002Fbook.epub -d \"$WORK\u002Funpacked\"\n\n# Find content files (XHTML\u002FHTML), sorted (chapter order = sort order)\nfind \"$WORK\u002Funpacked\" -name \"*.xhtml\" -o -name \"*.html\" | sort > \"$WORK\u002Ffiles.txt\"\n\n# Strip HTML to text per chapter\npython3 - \u003C\u003C'PY'\nfrom bs4 import BeautifulSoup\nimport os, sys\nwork = os.environ['WORK']\nfiles = open(f'{work}\u002Ffiles.txt').read().splitlines()\nfor i, path in enumerate(files, 1):\n    html = open(path, encoding='utf-8', errors='replace').read()\n    text = BeautifulSoup(html, 'html.parser').get_text('\\n')\n    text = '\\n'.join(line.strip() for line in text.splitlines() if line.strip())\n    with open(f'{work}\u002Fchapters\u002F{i:02d}.txt', 'w') as f:\n        f.write(text)\nPY\n```\n\nIf `bs4` is missing: `pip3 install beautifulsoup4 lxml`.\n\nInspect the chapter files to identify which are real chapters vs front\nmatter (TOC, copyright, acknowledgments). Often the EPUB ships one file\nper chapter; sometimes multiple chapters per file. Use\n`head -5 \"$WORK\u002Fchapters\u002F\"*.txt` to spot-check.\n\n### PDF\n\n```bash\npdftotext -layout path\u002Fto\u002Fbook.pdf \"$WORK\u002Ffull.txt\"\n```\n\nThen split by chapter heading (look for \"Chapter N\", \"CHAPTER N\", or\nall-caps title lines) using `awk` or `python`. If the PDF is a scan with\nno embedded text, fall back to OCR via `skills\u002Fbrain-pdf` or another\nvision tool.\n\n### Quality check\n\nFor each chapter file:\n\n- Word count > 1500 (typical chapter range 2k–8k words).\n- No HTML tags.\n- Paragraphs preserved with `\\n\\n`.\n\nSave a `chapters\u002FINDEX.md` mapping chapter number → title → file → word\ncount for reference.\n\n## 3. Context gathering\n\nThis is the most critical step. The right column is only as good as the\ncontext fed to each chapter subagent.\n\n### What to pull\n\n1. **Templates: USER.md and SOUL.md** if the user maintains them\n   (gbrain ships templates at `templates\u002FUSER.md` and `templates\u002FSOUL.md`;\n   they live in the brain repo when populated). Read full.\n2. **Recent daily memory** — last 14 days of brain pages under\n   `wiki\u002Fpersonal\u002Freflections\u002F` or wherever the user files daily notes.\n3. **Topic-relevant brain searches** tuned to the book's themes:\n   - `gbrain query \"marriage\"`, `gbrain query \"couples therapy\"` for a\n     marriage book.\n   - `gbrain query \"founders\"`, `gbrain query \"fundraising\"` for a\n     business book.\n   - `gbrain query \"shame\"`, `gbrain query \"anger\"` for a psychology book.\n4. **Brain pages for relevant entities** — `gbrain query \"\u003Cname>\"` for\n   people who will likely come up.\n5. **Standing patterns** — anything in the user's reflections or\n   originals that's been recurring.\n\n### Assemble a context pack\n\nWrite everything to a single file the CLI can read:\n\n```bash\nCONTEXT=\"$WORK\u002Fcontext.md\"\n{\n  echo \"## USER.md (if any)\"\n  [ -f \"$BRAIN_DIR\u002FUSER.md\" ] && cat \"$BRAIN_DIR\u002FUSER.md\"\n  echo\n  echo \"## SOUL.md (if any)\"\n  [ -f \"$BRAIN_DIR\u002FSOUL.md\" ] && cat \"$BRAIN_DIR\u002FSOUL.md\"\n  echo\n  echo \"## Recent reflections (last 14 days)\"\n  # Pull recent daily reflections — adapt to the user's filing scheme\n  # ...\n  echo\n  echo \"## Topic-relevant brain pages\"\n  # gbrain query the book's key themes, embed top results\n  # ...\n  echo\n  echo \"## Themes & cruxes\"\n  # A 1-page summary, written by the agent, calling out:\n  # - What's currently active in the user's life that this book intersects\n  # - Specific quotes from the user that map to book themes\n  # - People and dates that should appear in the right column\n} > \"$CONTEXT\"\n```\n\nMake this dense. It's read by every chapter subagent.\n\n## 4. Analysis: invoke `gbrain book-mirror`\n\n```bash\ngbrain book-mirror \\\n  --chapters-dir \"$WORK\u002Fchapters\" \\\n  --context-file \"$CONTEXT\" \\\n  --slug \"$SLUG\" \\\n  --title \"Book Title Goes Here\" \\\n  --author \"Author Name\" \\\n  --model claude-opus-4-7\n```\n\nThe CLI:\n\n- Validates inputs and loads chapter files.\n- Prints a cost estimate (~$0.30\u002Fchapter at Opus) and prompts to confirm.\n- Submits N child subagent jobs with read-only `allowed_tools`.\n- Waits for every child to complete.\n- Reads each child's `job.result` (the markdown analysis text).\n- Assembles all chapters into one page with frontmatter + intro + per-chapter\n  sections + closing.\n- Writes ONE `put_page` to `media\u002Fbooks\u002F\u003Cslug>-personalized.md`.\n- Reports a JSON envelope on stdout:\n  `{\"slug\": \"...\", \"chapters_total\": N, \"chapters_completed\": N, \"chapters_failed\": 0}`.\n\nIf any chapter failed, the CLI exits 1 and the user can re-run — idempotency\nkeys (`book-mirror:\u003Cslug>:ch-\u003CN>`) deduplicate completed chapters at the\nqueue level, so retry is cheap.\n\n### Model: Opus by default\n\nThe default model is `claude-opus-4-7`. Sonnet works (use `--model\nclaude-sonnet-4-6`) but the right-column quality drops noticeably — the\ntexture that makes the analysis read like a therapist who knows the user\nneeds Opus-grade reasoning.\n\n### Cost gate\n\nThe CLI refuses to spend in a non-TTY context without `--yes`. CI \u002F scripted\ninvocations must pass `--yes` explicitly. TTY users get a `[y\u002FN]` prompt\nbefore submission.\n\n## 5. PDF (optional)\n\nAfter the brain page is written, render to PDF using `skills\u002Fbrain-pdf`:\n\n```bash\ngbrain put_page  # already done by the CLI; nothing to add here\n# Then invoke brain-pdf:\n# (see skills\u002Fbrain-pdf\u002FSKILL.md for the make-pdf invocation)\n```\n\n## 6. Fact-check and cross-link\n\nAfter the page lands, run a fact-check pass on factual claims about the\nreader (parents, siblings, marriage history, jobs, heritage). Common error\npatterns to look for:\n\n- Conflating the reader's parents' relationship with patterns in extended\n  family.\n- Inventing therapy backstory (\"after his parents' divorce…\") when the\n  reader's parents are still together.\n- Wrong number\u002Fage of children, wrong spouse \u002F kid \u002F sibling names.\n\nIf you can't verify a claim, remove it. Better to lose texture than to\nintroduce a falsehood.\n\nCross-link entities mentioned in the analysis:\n\n- For every person the right column references with a brain page, add a\n  back-link from `people\u002F\u003Cslug>` to the new `media\u002Fbooks\u002F\u003Cslug>-personalized`\n  page (per `conventions\u002Fquality.md` Iron Law).\n\n## Quality bar (the bar)\n\nThe **left column** should:\n\n- Preserve the author's actual stories, statistics, frameworks, examples.\n- Quote memorable phrases verbatim.\n- Be detailed enough that the reader could skip the book and not lose much.\n\nThe **right column** should:\n\n- Use the reader's *actual quoted words* from the context pack.\n- Reference *specific* dates, situations, people by name.\n- Read like a therapist who knows the reader is leaving notes in the margins.\n- Be plain about direct hits (\"This is exactly the [name a real situation]\").\n- Be honest about misses (\"This chapter is less directly relevant\n  because…\"). Don't force connections.\n\nThe **whole document** should feel like one coherent voice, calibrated to\nthe reader's actual life rather than a generic profile, and honest about\nwhere the book's framing breaks down for this specific reader.\n\n## Anti-patterns (do not do these)\n\n- ❌ **Skimming chapters.** Standing instruction: preserve detail.\n- ❌ **Generic right column.** \"This might apply if you've ever felt…\" →\n  kill on sight.\n- ❌ **Factual errors about the reader's life.** Always fact-check after\n  assembly.\n- ❌ **Giving the subagent put_page access.** Trust contract is read-only;\n  the CLI does the writing.\n- ❌ **Forcing connections.** If a chapter doesn't apply, say so plainly.\n- ❌ **Sycophancy or moralizing in the right column.** No \"you should…\",\n  no \"consider…\", no \"perhaps it's time to…\".\n- ❌ **Truncating the LEFT column.** The book's actual content needs to\n  survive.\n\n## Output checklist\n\n- [ ] Book file exists locally (path known).\n- [ ] Chapter texts under `$WORK\u002Fchapters\u002F*.txt` with sane word counts.\n- [ ] Context pack at `$WORK\u002Fcontext.md` is dense.\n- [ ] `gbrain book-mirror --chapters-dir … --context-file … --slug … --title …` returned exit 0.\n- [ ] `media\u002Fbooks\u002F\u003Cslug>-personalized.md` exists in the brain.\n- [ ] Fact-check pass complete (no errors against USER.md or other source-of-truth pages).\n- [ ] Cross-links added from referenced people\u002Fcompanies.\n- [ ] Optional: PDF rendered via brain-pdf and delivered.\n\n## Related skills\n\n- `skills\u002Fbrain-pdf\u002FSKILL.md` — render the personalized page to PDF.\n- `skills\u002Fstrategic-reading\u002FSKILL.md` — read a book through a specific\n  problem-lens instead of personalizing to the whole reader.\n- `skills\u002Farticle-enrichment\u002FSKILL.md` — same shape applied to articles\n  rather than books.\n\n\n## Contract\n\nThis skill guarantees:\n\n- Routing matches the canonical triggers in the frontmatter.\n- Output written under the directories listed in `writes_to:` (when applicable).\n- Conventions referenced (`quality.md`, `brain-first.md`, `_brain-filing-rules.md`) are followed.\n- Privacy contract preserved: no real names, no fork-specific filesystem path literals, no upstream-fork references.\n\nThe full behavior contract is documented in the body sections above; this section exists for the conformance test.\n\n## Output Format\n\nThe skill's output shape is documented inline in the body sections above (see \"Output\", \"Brain page format\", or equivalent). The literal section header here exists for the conformance test (`test\u002Fskills-conformance.test.ts`).\n\n## Anti-Patterns\n\nThe full anti-pattern list is in the body sections above; this header exists for the conformance test if the body uses a different casing.\n","# book-mirror — Personalized Chapter-by-Chapter Book Analysis\n\n> **Convention:** see [_brain-filing-rules.md](..\u002F_brain-filing-rules.md) for the\n> sanctioned `media\u002F\u003Cformat>\u002F\u003Cslug>` exception this skill files under.\n>\n> **Convention:** see [conventions\u002Fquality.md](..\u002Fconventions\u002Fquality.md) for\n> citation rules, back-link enforcement, and output quality bars.\n>\n> **Convention:** see [conventions\u002Fbrain-first.md](..\u002Fconventions\u002Fbrain-first.md)\n> for the lookup chain (brain → search → external) the context-gathering\n> phase follows.\n\n## What this does\n\nGiven a book (EPUB or PDF), produce a brain page where every chapter is\nsummarized in detail on the left and mirrored back to the reader's actual life\non the right, using their own words, situations, people, and patterns from\nthe brain. Output is a brain page at `media\u002Fbooks\u002F\u003Cslug>-personalized.md`.\n\nThis is NOT a generic book summary. The right column is the value: it makes\nthe book read like a therapist who knows the reader is leaving notes in the\nmargins. If the user wants a flat summary instead, route them to a different\nskill.\n\n## Trust contract (read this before running)\n\nbook-mirror runs as a CLI command (`gbrain book-mirror`), NOT as a pure\nmarkdown skill that the agent dispatches via tools. The CLI is the trusted\nruntime; the skill is the orchestration prose around it.\n\nWhat this means for the agent:\n\n- The CLI submits N read-only subagent jobs (one per chapter). Each subagent\n  has `allowed_tools: ['get_page', 'search']` only. They CANNOT call\n  put_page or any mutating op. They produce markdown analysis via their\n  final message.\n- The CLI reads each child's `job.result`, assembles the final\n  two-column page, and writes it via a single operator-trust `put_page`.\n- This means untrusted EPUB\u002FPDF content cannot prompt-inject any\n  `people\u002F*` page. The trust narrowing happens at the tool allowlist,\n  not at the slug-prefix layer.\n\n## The pipeline\n\n```\n1. ACQUIRE   → User has the EPUB\u002FPDF locally (manual; book-acquisition is\n               not currently shipped — see \"Acquiring the book\" below).\n2. EXTRACT   → Pull chapter text from EPUB\u002FPDF into one .txt per chapter.\n3. CONTEXT   → Gather everything the brain knows about the reader.\n4. ANALYZE   → `gbrain book-mirror` fans out N read-only subagents.\n5. ASSEMBLE  → CLI reads each child result and writes one put_page.\n6. PDF       → Optional: render via skills\u002Fbrain-pdf for delivery.\n```\n\n## 1. Acquiring the book\n\nbook-acquisition (legal-grey-area downloader) was deliberately not shipped\nin this skill wave. The user drops the EPUB\u002FPDF manually. Common paths the\nuser might use:\n\n```bash\n# User-supplied path\nls path\u002Fto\u002Fbook.epub\nls path\u002Fto\u002Fbook.pdf\n\n# Or already in the brain repo (recommended for tracking)\nls $BRAIN_DIR\u002Fmedia\u002Fbooks\u002F\n```\n\nResolve `$BRAIN_DIR` from the gbrain config (`gbrain config get sync.repo_path`)\nor accept it from the user.\n\n## 2. Text extraction\n\nGoal: one `.txt` file per chapter under a temp directory. The agent has\nshell + python access; the CLI is downstream of this and takes the\nextracted directory as input.\n\n### EPUB\n\n```bash\nSLUG=\"this-book\"                                # kebab-case\nWORK=\"$(mktemp -d)\u002F$SLUG\"\nmkdir -p \"$WORK\u002Fchapters\"\nunzip -o path\u002Fto\u002Fbook.epub -d \"$WORK\u002Funpacked\"\n\n# Find content files (XHTML\u002FHTML), sorted (chapter order = sort order)\nfind \"$WORK\u002Funpacked\" -name \"*.xhtml\" -o -name \"*.html\" | sort > \"$WORK\u002Ffiles.txt\"\n\n# Strip HTML to text per chapter\npython3 - \u003C\u003C'PY'\nfrom bs4 import BeautifulSoup\nimport os, sys\nwork = os.environ['WORK']\nfiles = open(f'{work}\u002Ffiles.txt').read().splitlines()\nfor i, path in enumerate(files, 1):\n    html = open(path, encoding='utf-8', errors='replace').read()\n    text = BeautifulSoup(html, 'html.parser').get_text('\\n')\n    text = '\\n'.join(line.strip() for line in text.splitlines() if line.strip())\n    with open(f'{work}\u002Fchapters\u002F{i:02d}.txt', 'w') as f:\n        f.write(text)\nPY\n```\n\nIf `bs4` is missing: `pip3 install beautifulsoup4 lxml`.\n\nInspect the chapter files to identify which are real chapters vs front\nmatter (TOC, copyright, acknowledgments). Often the EPUB ships one file\nper chapter; sometimes multiple chapters per file. Use\n`head -5 \"$WORK\u002Fchapters\u002F\"*.txt` to spot-check.\n\n### PDF\n\n```bash\npdftotext -layout path\u002Fto\u002Fbook.pdf \"$WORK\u002Ffull.txt\"\n```\n\nThen split by chapter heading (look for \"Chapter N\", \"CHAPTER N\", or\nall-caps title lines) using `awk` or `python`. If the PDF is a scan with\nno embedded text, fall back to OCR via `skills\u002Fbrain-pdf` or another\nvision tool.\n\n### Quality check\n\nFor each chapter file:\n\n- Word count > 1500 (typical chapter range 2k–8k words).\n- No HTML tags.\n- Paragraphs preserved with `\\n\\n`.\n\nSave a `chapters\u002FINDEX.md` mapping chapter number → title → file → word\ncount for reference.\n\n## 3. Context gathering\n\nThis is the most critical step. The right column is only as good as the\ncontext fed to each chapter subagent.\n\n### What to pull\n\n1. **Templates: USER.md and SOUL.md** if the user maintains them\n   (gbrain ships templates at `templates\u002FUSER.md` and `templates\u002FSOUL.md`;\n   they live in the brain repo when populated). Read full.\n2. **Recent daily memory** — last 14 days of brain pages under\n   `wiki\u002Fpersonal\u002Freflections\u002F` or wherever the user files daily notes.\n3. **Topic-relevant brain searches** tuned to the book's themes:\n   - `gbrain query \"marriage\"`, `gbrain query \"couples therapy\"` for a\n     marriage book.\n   - `gbrain query \"founders\"`, `gbrain query \"fundraising\"` for a\n     business book.\n   - `gbrain query \"shame\"`, `gbrain query \"anger\"` for a psychology book.\n4. **Brain pages for relevant entities** — `gbrain query \"\u003Cname>\"` for\n   people who will likely come up.\n5. **Standing patterns** — anything in the user's reflections or\n   originals that's been recurring.\n\n### Assemble a context pack\n\nWrite everything to a single file the CLI can read:\n\n```bash\nCONTEXT=\"$WORK\u002Fcontext.md\"\n{\n  echo \"## USER.md (if any)\"\n  [ -f \"$BRAIN_DIR\u002FUSER.md\" ] && cat \"$BRAIN_DIR\u002FUSER.md\"\n  echo\n  echo \"## SOUL.md (if any)\"\n  [ -f \"$BRAIN_DIR\u002FSOUL.md\" ] && cat \"$BRAIN_DIR\u002FSOUL.md\"\n  echo\n  echo \"## Recent reflections (last 14 days)\"\n  # Pull recent daily reflections — adapt to the user's filing scheme\n  # ...\n  echo\n  echo \"## Topic-relevant brain pages\"\n  # gbrain query the book's key themes, embed top results\n  # ...\n  echo\n  echo \"## Themes & cruxes\"\n  # A 1-page summary, written by the agent, calling out:\n  # - What's currently active in the user's life that this book intersects\n  # - Specific quotes from the user that map to book themes\n  # - People and dates that should appear in the right column\n} > \"$CONTEXT\"\n```\n\nMake this dense. It's read by every chapter subagent.\n\n## 4. Analysis: invoke `gbrain book-mirror`\n\n```bash\ngbrain book-mirror \\\n  --chapters-dir \"$WORK\u002Fchapters\" \\\n  --context-file \"$CONTEXT\" \\\n  --slug \"$SLUG\" \\\n  --title \"Book Title Goes Here\" \\\n  --author \"Author Name\" \\\n  --model claude-opus-4-7\n```\n\nThe CLI:\n\n- Validates inputs and loads chapter files.\n- Prints a cost estimate (~$0.30\u002Fchapter at Opus) and prompts to confirm.\n- Submits N child subagent jobs with read-only `allowed_tools`.\n- Waits for every child to complete.\n- Reads each child's `job.result` (the markdown analysis text).\n- Assembles all chapters into one page with frontmatter + intro + per-chapter\n  sections + closing.\n- Writes ONE `put_page` to `media\u002Fbooks\u002F\u003Cslug>-personalized.md`.\n- Reports a JSON envelope on stdout:\n  `{\"slug\": \"...\", \"chapters_total\": N, \"chapters_completed\": N, \"chapters_failed\": 0}`.\n\nIf any chapter failed, the CLI exits 1 and the user can re-run — idempotency\nkeys (`book-mirror:\u003Cslug>:ch-\u003CN>`) deduplicate completed chapters at the\nqueue level, so retry is cheap.\n\n### Model: Opus by default\n\nThe default model is `claude-opus-4-7`. Sonnet works (use `--model\nclaude-sonnet-4-6`) but the right-column quality drops noticeably — the\ntexture that makes the analysis read like a therapist who knows the user\nneeds Opus-grade reasoning.\n\n### Cost gate\n\nThe CLI refuses to spend in a non-TTY context without `--yes`. CI \u002F scripted\ninvocations must pass `--yes` explicitly. TTY users get a `[y\u002FN]` prompt\nbefore submission.\n\n## 5. PDF (optional)\n\nAfter the brain page is written, render to PDF using `skills\u002Fbrain-pdf`:\n\n```bash\ngbrain put_page  # already done by the CLI; nothing to add here\n# Then invoke brain-pdf:\n# (see skills\u002Fbrain-pdf\u002FSKILL.md for the make-pdf invocation)\n```\n\n## 6. Fact-check and cross-link\n\nAfter the page lands, run a fact-check pass on factual claims about the\nreader (parents, siblings, marriage history, jobs, heritage). Common error\npatterns to look for:\n\n- Conflating the reader's parents' relationship with patterns in extended\n  family.\n- Inventing therapy backstory (\"after his parents' divorce…\") when the\n  reader's parents are still together.\n- Wrong number\u002Fage of children, wrong spouse \u002F kid \u002F sibling names.\n\nIf you can't verify a claim, remove it. Better to lose texture than to\nintroduce a falsehood.\n\nCross-link entities mentioned in the analysis:\n\n- For every person the right column references with a brain page, add a\n  back-link from `people\u002F\u003Cslug>` to the new `media\u002Fbooks\u002F\u003Cslug>-personalized`\n  page (per `conventions\u002Fquality.md` Iron Law).\n\n## Quality bar (the bar)\n\nThe **left column** should:\n\n- Preserve the author's actual stories, statistics, frameworks, examples.\n- Quote memorable phrases verbatim.\n- Be detailed enough that the reader could skip the book and not lose much.\n\nThe **right column** should:\n\n- Use the reader's *actual quoted words* from the context pack.\n- Reference *specific* dates, situations, people by name.\n- Read like a therapist who knows the reader is leaving notes in the margins.\n- Be plain about direct hits (\"This is exactly the [name a real situation]\").\n- Be honest about misses (\"This chapter is less directly relevant\n  because…\"). Don't force connections.\n\nThe **whole document** should feel like one coherent voice, calibrated to\nthe reader's actual life rather than a generic profile, and honest about\nwhere the book's framing breaks down for this specific reader.\n\n## Anti-patterns (do not do these)\n\n- ❌ **Skimming chapters.** Standing instruction: preserve detail.\n- ❌ **Generic right column.** \"This might apply if you've ever felt…\" →\n  kill on sight.\n- ❌ **Factual errors about the reader's life.** Always fact-check after\n  assembly.\n- ❌ **Giving the subagent put_page access.** Trust contract is read-only;\n  the CLI does the writing.\n- ❌ **Forcing connections.** If a chapter doesn't apply, say so plainly.\n- ❌ **Sycophancy or moralizing in the right column.** No \"you should…\",\n  no \"consider…\", no \"perhaps it's time to…\".\n- ❌ **Truncating the LEFT column.** The book's actual content needs to\n  survive.\n\n## Output checklist\n\n- [ ] Book file exists locally (path known).\n- [ ] Chapter texts under `$WORK\u002Fchapters\u002F*.txt` with sane word counts.\n- [ ] Context pack at `$WORK\u002Fcontext.md` is dense.\n- [ ] `gbrain book-mirror --chapters-dir … --context-file … --slug … --title …` returned exit 0.\n- [ ] `media\u002Fbooks\u002F\u003Cslug>-personalized.md` exists in the brain.\n- [ ] Fact-check pass complete (no errors against USER.md or other source-of-truth pages).\n- [ ] Cross-links added from referenced people\u002Fcompanies.\n- [ ] Optional: PDF rendered via brain-pdf and delivered.\n\n## Related skills\n\n- `skills\u002Fbrain-pdf\u002FSKILL.md` — render the personalized page to PDF.\n- `skills\u002Fstrategic-reading\u002FSKILL.md` — read a book through a specific\n  problem-lens instead of personalizing to the whole reader.\n- `skills\u002Farticle-enrichment\u002FSKILL.md` — same shape applied to articles\n  rather than books.\n\n\n## Contract\n\nThis skill guarantees:\n\n- Routing matches the canonical triggers in the frontmatter.\n- Output written under the directories listed in `writes_to:` (when applicable).\n- Conventions referenced (`quality.md`, `brain-first.md`, `_brain-filing-rules.md`) are followed.\n- Privacy contract preserved: no real names, no fork-specific filesystem path literals, no upstream-fork references.\n\nThe full behavior contract is documented in the body sections above; this section exists for the conformance test.\n\n## Output Format\n\nThe skill's output shape is documented inline in the body sections above (see \"Output\", \"Brain page format\", or equivalent). The literal section header here exists for the conformance test (`test\u002Fskills-conformance.test.ts`).\n\n## Anti-Patterns\n\nThe full anti-pattern list is in the body sections above; this header exists for the conformance test if the body uses a different casing.\n",{"name":5,"version":23,"mutating":24,"triggers":25,"writes_to":31,"description":7,"writes_pages":24},"0.1.0",true,[26,27,28,29,30],"personalized version of this book","mirror this book","two-column book analysis","apply this book to my life","how does this book apply to me",[32],"media\u002Fbooks\u002F","main","b8e699fc7cff8641b94a51ac9d4aa599fcc03ae5","server\u002Fskills\u002Fbook-mirror","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain","https:\u002F\u002Fsigmabrain.vercel.app","https:\u002F\u002Fgithub.com\u002FSigmacodeat","2026-07-09 09:21:55",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":24},[42,45,48],{"tool":43,"command":44},"npx","npx skills add Sigmacodeat\u002FSigmabrain --skill book-mirror",{"tool":46,"command":47},"bunx","bunx skills add Sigmacodeat\u002FSigmabrain --skill book-mirror",{"tool":49,"command":50},"pnpm","pnpm dlx skills add Sigmacodeat\u002FSigmabrain --skill book-mirror","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Fskills\u002Fbook-mirror\u002FSKILL.md",[53],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"routing-eval.jsonl","OTHER","其他",1405,"https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Fskills\u002Fbook-mirror\u002Frouting-eval.jsonl",[60,66,72,79,86,93],{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M75MW3405DES0348DPKVF20G","query-helper","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fquery-helper\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M75MW29T3N856QPT2SK467A3","broken","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fbroken\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M75MVZV51CX9W3Y602M0GJR9","brain-ops","Read, enrich, and write brain pages with source attribution.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fbrain-ops\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M75MVXQAQBVNQBZPKPEBPRHV","signal-detector","Always-on ambient signal capture for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fsignal-detector\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M75MVWJN0EV5EFW6JMMC73XC","query","Look up brain pages in the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fquery\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M75MVVA7Q6PMDBTPQGT49M6M","context-now","ALWAYS-ON time-sensitivity discipline for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fcontext-now\u002FSKILL.md",[],[]]