Agent skill

Book Writer

by aospbooks in aospbooks/aosp-internal-book

Patterns for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork).

Apache-2.0Auto-check passedDevelopment

Install Book Writer

skills CLI
$ npx skills add aospbooks/aosp-internal-book --skill book-writer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aospbooks/aosp-internal-book book-writer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aospbooks/aosp-internal-book.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/book-writer .claude/skills/book-writer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
book-writer
GitHub stars
139
Token cost
~3.1k tokens
SKILL.md length
1,428 words
Files
2 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Patterns for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork).

  • Works in 6 steps: Create NN-slug.md with the chapter… → Add a nav entry to properdocs.yml in the… → Create a symlink in docs/ → …
  • Renaming book chapters
  • SKILL.md covers ProperDocs Site Maintenance, Chapter Structure, Content Guidelines and Content Organization, plus 4 more sections
  • Calls python3; reaches aospbooks.github.io

What it does

Book Writer is an agent skill from aospbooks/aosp-internal-book. Patterns for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork). Use this skill whenever writing, editing, reviewing, adding, removing, or renaming book chapters, organizing multi-chapter content, fixing Mermaid rendering issues, or changing the book's structure. Also triggers when updating properdocs.yml, docs/ symlinks, or navigation — even if the user just says "add a chapter" or "reorganize sections" without mentioning MkDocs.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/mermaid-syntax.md`).

It sits in Development, covering Diagrams. It works with Mermaid and Python. The repository describes itself as: The book introduces the internal of AOSP. The licence is Apache-2.0.

When your agent uses it

  • Renaming book chapters
  • Organizing multi-chapter content
  • Fixing Mermaid rendering issues
  • Changing the books structure

Example prompts

  • “add a chapter”
  • “reorganize sections”
  • “Use the book-writer skill to pattern for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork)”
  • “/book-writer”

Requirements

  • Python 3
  • Docker

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Create NN-slug.md with the chapter template below
  2. Add a nav entry to properdocs.yml in the correct Part section
  3. Create a symlink in docs/
  4. Add a chapter entry to llms.txt in the correct Part section, in chapter order
  5. If the chapter number changes existing chapters, renumber the affected properdocs.yml entries and llms.txt URLs too
  6. Add the new chapter slug to agents/_content/manifest.toml under the right Part (and create a new Part entry there +…

What it can do on your machine

Read from SKILL.md and the folder at commit fc0b48b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • aospbooks.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Book Writer loads about 3.1k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 125 tokens; SKILL.md has 1,428 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~125
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aospbooks/aosp-internal-book at commit fc0b48b, republished under its Apache-2.0 licence (© aospbooks). 1,428 words, ~3,091 tokens.

Download SKILL.mdSave it as .claude/skills/book-writer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
book-writer
description
Patterns for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork). Use this skill whenever writing, editing, reviewing, adding, removing, or renaming book chapters, organizing multi-chapter content, fixing Mermaid rendering issues, or changing the book's structure. Also triggers when updating properdocs.yml, docs/ symlinks, or navigation — even if the user just says "add a chapter" or "reorganize sections" without mentioning MkDocs.
metadata.author
utzcoz
metadata.last-updated
2026-05-25

Book Writer

Write source-code-referenced technical books in Markdown with Mermaid diagrams, served as a ProperDocs website. Covers chapter structure, content flow, diagram syntax, and keeping the ProperDocs site in sync with content changes.

ProperDocs Site Maintenance

The book is served via ProperDocs (a MkDocs fork) with the Material theme. When chapter content changes, the site configuration must stay in sync. Forgetting this breaks navigation or hides new chapters from readers.

When you add a new chapter
  1. Create NN-slug.md with the chapter template below
  2. Add a nav entry to properdocs.yml in the correct Part section:
    yaml
    - "N. Chapter Title": NN-slug.md
  3. Create a symlink in docs/:
    bash
    ln -sf "../NN-slug.md" "docs/NN-slug.md"
  4. Add a chapter entry to llms.txt in the correct Part section, in chapter order:
    markdown
    - [Chapter N: Title](https://aospbooks.github.io/aosp-internal-book/NN-slug/): one-line description of what the chapter covers
  5. If the chapter number changes existing chapters, renumber the affected properdocs.yml entries and llms.txt URLs too
  6. Add the new chapter slug to agents/_content/manifest.toml under the right Part (and create a new Part entry there + agents/_content/parts/<slug>/SKILL.md if the chapter belongs to a brand-new Part), then run python3 agents/build.py and commit the regenerated agents/<platform>/ trees.
When you remove a chapter
  1. Delete the .md file
  2. Remove its entry from properdocs.yml nav
  3. Remove the symlink from docs/
  4. Remove the matching llms.txt entry
  5. Renumber subsequent chapters if needed (in filenames, properdocs.yml, llms.txt, and section headings inside the files)
  6. Remove the chapter slug from agents/_content/manifest.toml, then run python3 agents/build.py and commit the regenerated agents/<platform>/ trees.
When you rename or reorder chapters
  1. Rename the .md file
  2. Update the properdocs.yml nav entry (both the label and the filename)
  3. Update the docs/ symlink
  4. Update the llms.txt entry (label, URL slug, and the one-line description if scope changed)
  5. Update all ## N.x section headings inside the file to match the new chapter number
  6. Update the chapter slug in agents/_content/manifest.toml (and the relevant Part's SKILL.md description if scope shifted), then run python3 agents/build.py and commit the regenerated agents/<platform>/ trees.
properdocs.yml nav structure

The nav groups chapters into Parts. Each Part is a collapsible section in the sidebar:

yaml
nav:
  - Introduction: index.md
  - "Part I: Getting Started":
    - "Frontmatter": 00-frontmatter.md
    - "1. Introduction": 01-introduction.md
  - "Part II: Kernel & Boot":
    - "4. Boot and Init": 04-boot-and-init.md

The label format is "N. Short Title": NN-slug.md. Keep labels short — they appear in the sidebar.

ProperDocs reads from docs/ which contains symlinks to the actual chapter files in the repo root. This indirection exists because ProperDocs requires docs_dir to be a child directory, but chapters live at the repo root for simplicity.

When creating symlinks, always use relative paths (../filename.md) so they work regardless of absolute path. Also symlink any static assets the chapters reference.

Chapter Structure

Use this template for every chapter:

markdown
# Chapter N: Title

> *Optional opening quote*

Introduction paragraph (no heading).

---

## N.1 First Major Section
### N.1.1 Subsection

## N.X Try It
Hands-on exercises with real commands.

## Summary
Key takeaways as bullets.

### Key Source Files
| File | Purpose |

Example:

markdown
# Chapter 9: Binder IPC

> *"Binder is the heart of Android's inter-process communication."*

Android's IPC mechanism enables type-safe, identity-aware communication...

---

## 9.1 Why Binder?
### 9.1.1 One-Copy Semantics

## 9.7 Try It
- Run `adb shell service list` to see all registered Binder services

## Summary
- Binder provides one-copy IPC with caller identity

Content Guidelines

Reference real source code. Every architectural claim should point to a specific file and line — this is what makes the book valuable beyond a generic overview.

java
// Source: frameworks/base/services/core/.../PowerManagerService.java:202
private static final int DIRTY_WAKE_LOCKS = 1 << 0;

Match code block language to source file extension. AOSP has Go code (.go files in build/soong/) alongside Java. Use ```go for Go code, ```java for Java — never mark Go as Java. Key tells: Go uses :=, func (c *config), []string{}, no semicolons. Java uses ; line endings, public class, @Override.

go
// Source: build/soong/android/config.go:2402
func (c *config) UseHostMusl() bool {
    return Bool(c.productVariables.HostMusl)
}

Use manual section numbers matching the chapter (## 5.1 for chapter 5). ProperDocs doesn't auto-number, and if you ever generate PDF, Pandoc's auto-numbering doubles manual numbers.

Title format: # Chapter N: Title with colon separator. Not --, not — (em-dash) — those slip in from autocomplete and routine editing and have to be fixed in audit passes.

End every chapter with "Try It" (hands-on exercises) immediately followed by "Summary" (key takeaways). Summary is the last ## section, full stop. Don't append more sections after Summary — not "Appendix", not "Deep Dive", not a new feature you forgot about. If you have extra material, fold it into a numbered section before Try It, or extract it into the standalone appendix file. Reviewers found this drift in 5+ chapters during a single audit pass; it always starts as "just one more section" and degrades the chapter shape.

Watch for duplicate section numbers when inserting new content. Adding a new ## 9.10 between existing sections requires renumbering everything that follows — or you end up with two ## 9.11 headings later in the chapter (real bug found in chapter 9). Skim the full heading sequence after any insertion.

Content Organization

Bottom-to-top for system books — each layer builds on the one below:

Build system → Kernel/boot → Native foundation → HAL → Native services → Runtime → Framework core → Framework features → Connectivity → Security → UI → Apps → Infrastructure → Device support → Practical guide

Mermaid Diagrams

Place a descriptive heading before every mermaid block — it helps readers navigate and becomes the figure caption if you ever generate PDF.

For syntax rules (quoting, special characters, parse errors), read references/mermaid-syntax.md. The short version: quote any node label containing (), <br/>, or |.

Show full SKILL.md (665 more words)Show less
Visually verify every mermaid edit

Parse-clean is not enough. Mermaid will happily render a diagram with text overflowing its rectangle, nodes overlapping, or arrows crossing into illegibility — and it will also render diagrams that are syntactically valid but factually wrong about the architecture (missing components, reversed arrow direction, made-up relationships). The build pipeline doesn't catch any of that.

After writing or editing any mermaid block, render it to PNG and look at the result:

bash
./serve.sh png NN-slug.md          # one chapter
./serve.sh png --all               # every chapter (slow)

PNGs land in .mermaid-png/<slug>/NN-<sha16>.png (one file per block, indexed in chapter order). The wrapper runs tools/render_mermaid_png.py inside the book-serve Docker image, reusing the same Playwright + Chromium that the SVG cache already uses. PNGs are content-addressed by the same hash as the SVG cache, so reruns skip unchanged diagrams.

The script also refreshes .mermaid-cache/<sha16>.svg for any block whose hash isn't there yet — that's the same cache the pdf/epub plugins read, so editing a diagram and running ./serve.sh png leaves the next serve.sh pdf or serve.sh epub build with full cache hits and no Mermaid re-render. One command keeps both caches in sync.

What to check on each PNG:

  1. Layout. Every label sits inside its shape. No text spills past a rectangle's edge. No two nodes or edge labels overlap. Long labels use <br/> breaks (in quoted node labels — never in transition labels).
  2. Architectural accuracy. Open the chapter alongside the PNG. Every box in the diagram corresponds to a component the prose actually mentions. Arrow direction matches the described data/control flow. Subgraph groupings reflect the real process / package boundaries (e.g. system_server boxes only contain things that live in system_server). No invented relationships.
  3. Readability at zoom-1. Open the PNG at native size — if you have to squint, the diagram has too many nodes and should be split.

Don't ship a chapter without re-rendering the diagrams you touched.

Parallel Writing

For 20+ chapters, launch 5 agents per batch. Review after each batch — then update properdocs.yml nav and docs/ symlinks for all new chapters before starting the next batch.

Lists

Markdown lists silently break when you forget the blank line before them — they render as inline text instead of a proper list. This is the single most common formatting issue in the book (we fixed 1,268 instances).

Always leave a blank line before any numbered or bullet list:

markdown
BAD — renders on one line:
Services are started in four phases:
1. Bootstrap services
2. Core services

GOOD — renders as proper list:
Services are started in four phases:

1. Bootstrap services
2. Core services

Match counts to list items. If you write "three phases:" make sure exactly three items follow. Readers notice when the prose says "three" but the list has four items — it undermines trust in the technical accuracy of the entire chapter.

Quick Reference

DoDon'tWhy
Blank line before every listList right after textRenders inline instead of as a list
"four phases:" with 4 items"three phases:" with 4 itemsCount mismatch erodes reader trust
Update properdocs.yml when adding/removing chaptersAdd a chapter file without a nav entryReaders won't find it in the sidebar
Create docs/ symlink for every new chapterForget the symlinkProperDocs can't serve files outside docs/
## 5.1 Title in chapter 5## 3.1 Title (wrong chapter)Readers use the number to locate content
# Chapter 5: Title# Chapter 5 -- Title or # Chapter 5 — TitlePick :, stick with it (em-dash creeps in from autocomplete)
Summary as the last ## sectionAny section after ## SummaryReaders stop at Summary; trailing sections get lost
Heading before each mermaid blockTwo mermaid blocks in a rowEach diagram needs its own context
```go for .go files```java for Go codeWrong syntax highlighting, misleads readers
NODE["text(stuff)"]NODE[text(stuff)]Unquoted parens break Mermaid parser
Idle --> Running : startIdle --> Running : start()Parens in stateDiagram-v2 transition labels are a hard parse error — strip them, don't quote
subgraph HS["Home Screen"]subgraph Home ScreenMulti-word subgraph names need explicit IDs
<br/> in stateDiagram/sequenceDiagram labels\n in stateDiagram/sequenceDiagram labels\n renders literally in those contexts (silently); flowchart labels are the exception
{placeholder} in flowchart labels<placeholder> in flowchart labelsSVG renderer strips angle-bracket placeholders as HTML tags — text vanishes silently
Source path + line number"The framework does X"Unverifiable claims undermine the book

© aospbooks, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .claude/skills/book-writer of aospbooks/aosp-internal-book.

  • SKILL.md
  • references/mermaid-syntax.md

Open the folder on GitHubat commit fc0b48b

Compare with similar skills

Book Writer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Book Writer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Book Writer this skillaospbooks/aosp-internal-book139—~3.1kAutomated safety check: PassApache-2.0
Code Graph Mermaid Diagramstrailofbits/skills7.5k—~1.7kAutomated safety check: PassCC-BY-SA-4.0
Design Doc MermaidSpillwaveSolutions/design-doc-mermaid1761 repos~5.6kAutomated safety check: PassNone
Markdown Mermaid Writingneflibata-feng/MyArxiv-Agent1265 repos~3.8kAutomated safety check: NotesApache-2.0
Code To Diagramzebbern/claude-code-guide4.7k—~972Automated safety check: PassMIT
Generate Readmedivar-ir/ai-doc-gen767—~996Automated safety check: PassMIT

Similar skills

  • Code Graph Mermaid Diagrams

    trailofbits/skills

    Official

    Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.

    7.5k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Design Doc Mermaid

    SpillwaveSolutions/design-doc-mermaid

    Create Mermaid diagrams (flowchart, sequence, class, ER, state, C4, architecture) from text or source code.

    176 GitHub starsUsed in 1 repo~5.6k tokens
    DevelopmentAuto-check passed
  • Markdown Mermaid Writing

    neflibata-feng/MyArxiv-Agent

    Comprehensive markdown and Mermaid diagram writing skill that establishes text-based diagrams as the DEFAULT documentation standard.

    126 GitHub starsUsed in 5 repos~3.8k tokens
    DevelopmentAuto-check: notes
  • Code To Diagram

    zebbern/claude-code-guide

    Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts.

    4.7k GitHub stars~972 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Generate Readme

    divar-ir/ai-doc-gen

    Generate or refresh a comprehensive, professional README.md for a repository, with architecture overview, mermaid and optional C4 diagrams, repository structure, dependencies, and API documentation.

    767 GitHub stars~996 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Apex Python Diagrams

    jonathan-vella/apex

    UTILITY SKILL — Python diagram generation for Azure architectures, WAF/cost/compliance charts, ERDs, swimlanes, timelines, and wireframes.

    217 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed

More from aospbooks/aosp-internal-book

All 17 skills in this repo
  • Aosp Version Diff

    aospbooks/aosp-internal-book

    Compare two AOSP releases (e.g. An agent skill from aospbooks/aosp-internal-book.

    139 GitHub stars~2k tokensUpdated 5 days ago
    Auto-check passed
  • Aosp Device Support

    aospbooks/aosp-internal-book

    AOSP Part XIV — Device Support. An agent skill from aospbooks/aosp-internal-book.

    139 GitHub stars~574 tokensUpdated 5 days ago
    Auto-check passed
  • Aosp Framework Core

    aospbooks/aosp-internal-book

    AOSP Part VI — Framework Core. An agent skill from aospbooks/aosp-internal-book.

    139 GitHub stars~628 tokensUpdated 5 days ago
    Auto-check passed
  • Aosp Framework Services

    aospbooks/aosp-internal-book

    AOSP Part VII — Framework Services. An agent skill from aospbooks/aosp-internal-book.

    139 GitHub stars~888 tokensUpdated 5 days ago
    Auto-check passed
  • Aosp Native Services And Media

    aospbooks/aosp-internal-book

    AOSP Part IV — Native Services & Media. An agent skill from aospbooks/aosp-internal-book.

    139 GitHub stars~606 tokensUpdated 5 days ago
    Auto-check passed
  • Aosp AI And Devices

    aospbooks/aosp-internal-book

    AOSP Part XII — AI & Devices. An agent skill from aospbooks/aosp-internal-book.

    139 GitHub stars~411 tokensUpdated 5 days ago
    Auto-check passed

Works with

Categories

Questions about Book Writer

What does Book Writer do?

Patterns for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork). Book Writer is an agent skill from aospbooks/aosp-internal-book. Patterns for writing technical book chapters in Markdown with Mermaid diagrams, served via ProperDocs (a MkDocs fork).

When should I use Book Writer?

Book Writer fits situations like: renaming book chapters; organizing multi-chapter content; fixing Mermaid rendering issues; changing the books structure.

How do I install Book Writer in Claude Code?

Run `npx skills add aospbooks/aosp-internal-book --skill book-writer -a claude-code`. Or copy the skill folder (.claude/skills/book-writer in aospbooks/aosp-internal-book) into .claude/skills/book-writer in your project. Claude Code loads it when a task matches its description.

How do I install Book Writer in Codex?

Run `npx skills add aospbooks/aosp-internal-book --skill book-writer -a codex`. Or copy the skill folder (.claude/skills/book-writer in aospbooks/aosp-internal-book) into .agents/skills/book-writer in your project. Codex loads it when a task matches its description.

Can I use Book Writer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aospbooks/aosp-internal-book --skill book-writer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/book-writer, .gemini/skills/book-writer, .github/skills/book-writer and .opencode/skills/book-writer in your project.

What does Book Writer need to run?

Going by SKILL.md and its folder, Book Writer needs the command-line tools its instructions call (python3). Our summary lists: Python 3; Docker.

Does Book Writer access the network?

SKILL.md names 1 domain. In commands or code: aospbooks.github.io; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Book Writer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Book Writer use?

Book Writer is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Book Writer use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Book Writer?

Skills that share tags, products or a category with Book Writer: Code Graph Mermaid Diagrams (trailofbits/skills, 7.5k stars), Design Doc Mermaid (SpillwaveSolutions/design-doc-mermaid, 176 stars), Markdown Mermaid Writing (neflibata-feng/MyArxiv-Agent, 126 stars) and Code To Diagram (zebbern/claude-code-guide, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Book Writer?

aospbooks (a GitHub organization) maintains it in aospbooks/aosp-internal-book, which has 139 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 5, 2026.

Source: aospbooks/aosp-internal-book on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.