Turn any textbook chapter PDF into uniform, print-ready, colour-coded revision notes — with Chapter Insights, Textbook Solutions, Practice Questions, and vector-preserved maps & diagrams — delivered as a PDF and/or an editable DOCX (you choose).
Opens SKILL.md directly so you can download just the skill file (no need to download Marketing/) · Raw SKILL.md
Watch the full 1080p 60 fps trailer with sound
chapter-notes-builder is an AI agent skill (SKILL.md) paired with a lightweight Node.js (docx) + Python (Pillow/NumPy) + Poppler + LibreOffice build pipeline. Every chapter across every subject follows the exact same layout, typography, and colour system so a student's study binder looks cohesive from Chapter 1 to the final unit.
- Consistent Three-Part Architecture — Blue Chapter Insights (always included), green Solutions (optional), and red Practice Questions (optional), with automatic A/B/C re-lettering that preserves content-type colours.
- 5-Question Fast Intake — Asks an opt-out question first, then configures solutions, practice question source, figure extraction, and output file format in a single message.
- Strict Textbook Grounding — Traces every definition, date, figure, and solution back to the source chapter; matches the book's own spelling (e.g. British/Indian English) and never invents personal metadata or local survey statistics.
- Vector-Preserving Figure Cropping — Renders PDF pages via
pdftoppmand crops diagrams/maps viacrop_figures.pyinstead ofpdfimages, keeping vector map labels, compass roses, scale bars, and legends intact. - Flexible Delivery + Zero-Dependency Fallbacks — Outputs
{Chapter_Title}_Notes.pdf, editable{Chapter_Title}_Notes.docx, or both (defaulting to PDF only to save time and token budget), or degrades cleanly to a self-contained print-to-PDF HTML file or structured Markdown when code execution is unavailable.
All screenshots below are 180-DPI renders of real PDFs generated by the skill from Class VIII Social Science textbook chapters.
The skill always begins with a structured intake flow (using the host agent's multiple-choice UI if available, or a numbered message):
-
Question 1 (Asked Alone First — Opt-Out Gate)
Use the colour-coded notes format (blue explainer · green solutions · red practice questions), or deactivate this skill and handle the request normally?
- Choosing 2 immediately deactivates the skill.
- If the user's initial prompt already explicitly requests the format (e.g., "make notes in the usual colour format"), Q1 is skipped automatically.
-
Questions 2–5 (Asked Together in One Message)
- Q2 — Textbook Solutions (
Yes/No): Solve in-text prompts (Let's Explore,Think About It,Don't Miss Out,Probe and Ponder, etc.) and end-of-chapter questions. - Q3 — Practice Questions (
1–4):- No practice questions
- AI-generated questions (MCQs, very short, short, long, and case-study questions — all with answers; default 43 questions: 15 MCQ, 10 VSA, 10 SA, 5 LA, 3 Case Studies, adjustable if requested)
- User's own question bank (pasted or uploaded; keeps original wording/order and adds solutions if missing)
- Both (user's bank first within each sub-heading, topped up with AI questions to at least the default counts)
- Q4 — Maps & Figures (
Yes/No): Copy the maps, diagrams, and figures from the chapter PDF into the notes next to the topics they explain. - Q5 — File Format (
1–3): Deliver as:- PDF only (default — faster and lighter on conversation budget)
- Word (
.docx) only - Both (PDF + editable
.docx)
- Q2 — Textbook Solutions (
Shortcut: Replying
"you decide"or"all"applies the defaults:Q2 = Yes,Q3 = 2 (AI-generated),Q4 = Yes(only if the chapter actually has maps/figures), andQ5 = 1 (PDF only). Once answered, the agent states a one-line build plan (e.g., "Building: Insights + Solutions + AI practice questions + figures, as a PDF") and starts generating.
Colours belong to the content type, never the section letter. Switching off a section re-letters the remaining sections sequentially without changing their colours:
| Q2 (Solutions) | Q3 (Practice) | Resulting Document Structure |
|---|---|---|
No |
No |
Insights only — Blue banner CHAPTER INSIGHTS (no section letter) |
No |
Yes |
SECTION A : CHAPTER INSIGHTS (Blue) + SECTION B : PRACTICE QUESTIONS (Red) |
Yes |
No |
SECTION A : CHAPTER INSIGHTS (Blue) + SECTION B : SOLUTIONS (Green) |
Yes |
Yes |
SECTION A : CHAPTER INSIGHTS (Blue) + SECTION B : SOLUTIONS (Green) + SECTION C : PRACTICE QUESTIONS (Red) |
Textbook PDF
│
├──► 1. Inspect (pdfinfo + pdffonts + pdftotext -layout / OCR)
│ • Handles extensionless uploads via `file`
│ • Extracts headings, margin glossaries, boxes, dates, questions, figure pages
│
├──► 2. Extract Figures [if Q4 = Yes] (pdftoppm @ 160 DPI + crop_figures.py)
│ • auto_crop() / manual_crop() preserves vector map labels & legends
│ • contact_sheet() visual check before embedding (<= 540x400 px)
│
├──► 3. Build DOCX (Node.js + docx + helpers.js)
│ • Always built first ({Chapter_Title}_Notes.docx)
│ • Section breaks via pageBreakBefore (prevents blank pages)
│ • Consecutive boxes/tables separated by gap() so borders never fuse
│
├──► 4. Convert & Verify (LibreOffice soffice --headless --convert-to pdf)
│ • Converted when Q5 = PDF or Both (or temporarily to check a Word-only build)
│ • Render key pages and visually verify against the 7-point QA checklist
│
└──► Deliverable (exact Q5 choice): {Chapter_Title}_Notes.pdf / .docx / both
If the host environment cannot execute Node.js or Python:
- Self-Contained HTML Fallback: Generates one standalone HTML file using CSS variables mapped to the exact hex palette (
div.banner,div.box.term|fact|casewith1.5px solidborders, blue-header tables) ready for browser Print → Save as PDF. - Markdown Fallback: If file output is also unavailable, outputs clean Markdown using
> **KEY TERM** …blockquotes. - Figure Placeholder Fallback: When figures cannot be extracted or visually inspected, inserts a neutral grey
FIGURE — Fig. n.n, textbook p. Nbox (figurePlaceholder()).
| Property | Specification |
|---|---|
| Page Size & Margins | A4, 0.625 in (900 twips) margins on all sides (CONTENT_WIDTH = 10106 twips) |
| Typeface | Calibri (UTF-8 supported for diacritics and regional terms) |
| Header Strip | Three-cell table: Class (left) · Subject (centre) · Unit / Book name (right), 10 pt bold over #16345C bottom rule |
| Running Header | {Chapter title} — Notes — centred, 8 pt italic #888888 with thin #16345C bottom rule |
| Footer | Centred page number — 9 pt #666666 |
| Type Scale | Chapter title 16 pt bold · Section banner 13 pt bold white · Sub-heading 11.5 pt bold (with bottom rule) · Mini-heading 10.5 pt bold · Body & box title/text 10.5 pt · Answers 10 pt · Table header 10 pt white bold · Table body 9.5 pt · Figure caption & footer 9 pt · Running header 8 pt italic |
| Role | Hex | Swatch / Usage |
|---|---|---|
| Document Accent (Navy) | #16345C |
Chapter title, header strip bottom rule, running-header bottom rule |
| Section A — Insights (Blue) | #1F6FB2 |
Section A banner, Section A sub-headings, table header fill |
| Section B — Solutions (Green) | #2E8B57 |
Section B banner, Section B sub-headings, Section A mini-headings, MCQ Answer: (x) line |
| Section C — Practice (Red) | #C0392B |
Section C banner, Section C sub-headings, CASE STUDY border/title & sub-question numbers |
| Key Term Box | #DCEEF9 / #1F6FB2 |
Fill #DCEEF9, 1 pt border & uppercase title #1F6FB2 |
| Facts / Timeline / Don't Miss Out | #FFF6D9 / #E0A800 |
Fill #FFF6D9, 1 pt border & uppercase title #E0A800 |
| Case Study / Biography Box | #FDECEA / #C0392B |
Fill #FDECEA, 1 pt border & uppercase title #C0392B |
| Table Rows & Grid | #FFFFFF / #F2F7FC / #AAAAAA |
Alternating zebra rows #FFFFFF and #F2F7FC; #AAAAAA cell borders |
| Figure Placeholder & Captions | #F2F2F2 / #555555 |
Placeholder fill #F2F2F2 (#AAAAAA border, #555555 title); captions #555555 italic 9 pt |
- Section A — Chapter Insights (typically 4–7 pages):
The Big Questionsfrom the chapter opener (bulleted with●).- Numbered topics (
1. … 2. …) following the chapter's own headings, mapping margin glossaries toKEY TERM(S), fun facts/timelines to yellow boxes (DON'T MISS OUT,QUICK FACTS,DID YOU KNOW?,TIMELINE — KEY DATES), biographies/caselets to redCASE STUDYboxes, and comparisons/classifications to blue-header tables. Before We Move On …summary bullets as the final block.
- Section B — Solutions (only if Q2 =
Yes):- Solutions only — no re-teaching or study tips. Uses the textbook's own sub-headings (e.g.,
Let's Explore / Think About It / Don't Miss Out,Questions and Activities (Page N)), includes(Page N)citations, and provides adaptable outlines for local/personal projects without fabricating local data.
- Solutions only — no re-teaching or study tips. Uses the textbook's own sub-headings (e.g.,
- Section C — Practice Questions (only if Q3 ≠
1):- Five ordered sub-headings with every answer placed directly below its question. Default Q3 = 2 counts (adjustable if the user states other counts):
| Question Type | Default Count | Numbering | Solution Style |
|---|---|---|---|
| Multiple Choice Questions | 15 |
1–15 |
4 inline options (a)–(d); Answer: (x) (varied keys, max 5 of 15 on any one letter) |
| Very Short Answer Questions | 10 |
16–25 |
1 line |
| Short Answer Questions | 10 |
26–35 |
2–4 sentences |
| Long Answer Questions | 5 |
36–40 |
1 solid paragraph (~120–220 words, 5-mark depth) |
| Case Study Based Questions | 3 |
41–43 |
Original 2–4 line scenario box + (i)(ii)(iii) sub-questions (1–3 sentences each) |
Both helper modules are included directly in SKILL.md (Appendices A and B):
helpers.js(docx-jscomponent library)- Layout & Structure:
headerRowTable,chapterTitle,sectionBanner,subHeading,miniHeading,para,bullet,spacer,gap,pageBreakPara,buildDoc - Boxes & Tables:
coloredBox,keyTerms,factBox,caseBox,dataTable - Q&A & Figures:
qBlock,mcq,caseStudy,figure,figurePlaceholder,parseInline(supports**bold**inline markup only — never single*asterisks*)
- Layout & Structure:
crop_figures.py(Poppler + Pillow + NumPy)render_pages(pdf, pages, outdir, dpi=160)— renders textbook pages and normalisespdftoppmfilenamesauto_crop(page_png, x_range, y_range, row_thr=0.6, col_thr=0.6)— tight-crops dense diagrams while excluding original textbook captions (use0.35–0.45thresholds for pale/white-heavy maps)manual_crop(page_png, box, scale=1.0)— exact coordinate cropping from downscaled previewssave(img, path, quality=90)&contact_sheet(paths, out, cols=3, cell=(620, 520))— batch preview grid for visual verification before embedding
Clone the repository and copy SKILL.md into your agent's skill directory:
git clone https://github.com/nobrocoding/Chapter-Notes-Builder.git- Antigravity (Project-local):
.agents/skills/chapter-notes-builder/SKILL.md - Antigravity (Global):
~/.gemini/config/skills/chapter-notes-builder/SKILL.md - Claude / Other Agent Skills Hosts: Upload or register
SKILL.mdin your client's Skills configuration.
For local builds, save Appendix A from SKILL.md as helpers.js and Appendix B as crop_figures.py in your working directory.
| Dependency | Purpose | Install Command |
|---|---|---|
Node.js + docx |
Programmatic .docx generation (helpers.js) |
npm install docx |
| LibreOffice | Headless .docx → .pdf conversion (soffice) |
See OS commands below |
Poppler (poppler-utils) |
pdfinfo, pdffonts, pdftotext, pdftoppm |
See OS commands below |
Python 3 + pillow, numpy |
Cropping & contact-sheet verification (crop_figures.py) |
pip install pillow numpy |
OS-specific installation commands (Linux, macOS, Windows)
Ubuntu / Debian
sudo apt-get update && sudo apt-get install -y nodejs npm libreoffice poppler-utils python3-pip
pip3 install pillow numpy
npm install docxmacOS (Homebrew)
brew install node poppler python
brew install --cask libreoffice
pip3 install pillow numpy
npm install docxWindows (winget / Chocolatey)
winget install OpenJS.NodeJS.LTS TheDocumentFoundation.LibreOffice Python.Python.3.12
# Poppler for Windows (e.g., via Chocolatey or Scoop):
choco install poppler -y
pip install pillow numpy
npm install docxAttach any textbook chapter PDF and prompt:
"Turn this textbook chapter into study notes."
or "Make notes like the last one."
Answer the 5 intake questions (or reply "all" / "you decide"), and the agent handles text extraction, figure cropping, DOCX assembly, LibreOffice PDF rendering (when requested or for visual QA), and delivery in your chosen format.
Using the Appendix C skeleton (build.js) alongside helpers.js:
node build.js
# Only if you want a PDF (Q5 = PDF or both):
soffice --headless --convert-to pdf Chapter_Title_Notes.docxSix Class VIII Social Science chapters produced with chapter-notes-builder (featuring Blue Section A CHAPTER INSIGHTS, Green Section B solutions — titled NCERT SOLUTIONS in these Class VIII sample PDFs — and Red Section C with 43 solved practice questions):
| Chapter | Unit / Book | Format & Length | Sections & Extracted Elements |
|---|---|---|---|
| CH1 – World Geography: Some Glimpses | Land and the People | 17 pp · A4 | Sec A (p. 1–10), Sec B (p. 11–13, 23 items), Sec C (p. 14–17, 43 Qs) · 12 embedded figures/maps, 5 tables, 4 KEY TERM(S), 3 DON'T MISS OUT |
| CH1 – Natural Resources and Their Use | Land and the People | 11 pp · A4 | Sec A (p. 1–4), Sec B (p. 5–6, 16 items), Sec C (p. 7–11, 43 Qs) · 4 KEY TERM(S), 2 DON'T MISS OUT, 1 QUICK FACTS, 1 DID YOU KNOW?, 2 CASE STUDY, 1 table |
| CH3 – The Rise of the Marathas | Tapestry of the Past | 12 pp · A4 | Sec A (p. 1–5), Sec B (p. 6–7, 14 items), Sec C (p. 8–12, 43 Qs) · 4 KEY TERM(S), 4 DON'T MISS OUT, 2 QUICK FACTS, 1 DID YOU KNOW?, 1 table |
| CH4 – The Colonial Era in India | Tapestry of the Past | 14 pp · US Letter | Sec A (p. 1–5), Sec B (p. 6–9, 23 items), Sec C (p. 10–14, 43 Qs) · 7 KEY TERM(S), 2 DON'T MISS OUT, 1 QUICK FACTS, 1 TIMELINE — KEY DATES |
| CH5 – Universal Franchise & India's Electoral System | Governance & Democracy | 10 pp · A4 | Sec A (p. 1–3), Sec B (p. 4–5, 14 items incl. Suryodaya School caselet), Sec C (p. 6–10, 43 Qs) · 3 KEY TERM(S), 1 DON'T MISS OUT, 1 QUICK FACTS, 1 DID YOU KNOW?, 3 tables |
| CH7 – Factors of Production | Economic Life Around Us | 12 pp · A4 | Sec A (p. 1–4), Sec B (p. 5–7, 22 items), Sec C (p. 8–12, 43 Qs) · 8 KEY TERM(S), 3 DON'T MISS OUT, 1 QUICK FACTS, 1 DID YOU KNOW?, 1 CASE STUDY |








