write-textbook-chapter

write-textbook-chapter is a command for Cursor from AI-Learning-Gems/AI-Learning-Gems.github.io. It costs 18 tokens per session (23,855 once invoked), scanned B, original, MIT.

A command for writing a textbook-style chapter from a prepared TEXTBOOK-PLAN.md file, which outlines the research, sections, sources, and examples.

In plain words
What is it for?
Use it to create chapters for technical textbooks from an existing research and lesson plan.
Why use it?
It turns a detailed writing plan into a structured chapter while keeping the planned evidence and teaching approach in view.

Command for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ai-learning-gems/ai-learning-gems.github.io/write-textbook-chapter
Clone the repo
git clone --depth 1 https://github.com/AI-Learning-Gems/AI-Learning-Gems.github.io

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-textbook-chapter

README.md
[![agentmods](https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/write-textbook-chapter.svg)](https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/write-textbook-chapter)
Your own site
<a href="https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/write-textbook-chapter"><img src="https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/write-textbook-chapter.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 23,855 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00018 $0.23855
Opus 5 $0.00009 $0.11928
Sonnet 5 $0.00004 $0.04771
Haiku 4.5 $0.00002 $0.02386

Measured 4d ago against content hash 275f20ab3c95, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

write-textbook-chapter scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

**Why the template helps indirectly:** When the sub-agent's report contains the failure-pattern warnings (because the template includes them), the main agent sees those warnings in the report output and is reminded to re

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

mkdir -p "sources/arxiv-{ID}" && cd "sources/arxiv-{ID}" && curl -sL "https://arxiv.org/src/{ID}" -o source.tar.gz && tar -xzf source.tar.gz && rm source.tar.gz
.cursor/commands/write-textbook-chapter.md · 1,411 lines

How it starts

The opening of the file, as written. The whole thing — 1,411 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an exceptional expert educational content creator tasked with writing a textbook-style chapter. You will be given a TEXTBOOK-PLAN.md that was created by a prior research workflow. Your goal is to engineer "aha moments" and deep understanding through evidence-based instructional design.

Target audience: Make it very reader-friendly for someone who understands the basic background on this topic but nothing about this topic specifically. Assume the reader has strong reading comprehension and technical maturity.

=== USER INPUT ===

The user will provide the path to a TEXTBOOK-PLAN.md file created by the /research-textbook-chapter workflow. This file contains:

  • The original user query
  • A list of all sources used across sections
  • A detailed section plan (5-6 sections, 1500-2000 words each)
  • Per-section source references (which files, which specific parts)
  • Running example design
  • Notation table, concept map design, misconceptions

Your first step: Read the TEXTBOOK-PLAN.md file to understand the full plan.


=== THE TEXTBOOK-PLAN IS A STRUCTURAL GUIDE, NOT A SOURCE OF TRUTH (CRITICAL) ===

The TEXTBOOK-PLAN.md tells you WHAT to write about and WHERE to find the information. It does NOT contain reliable information itself.

The plan was created by a research agent that used web search summaries to identify sources and outline sections. Web search summaries are lossy, frequently inaccurate, and sometimes fabricate details. As a result:

  1. Quotes in the plan are placeholders. A quote attributed to "Author X" may be paraphrased incorrectly, taken out of context, combined from multiple sentences, or entirely hallucinated. DO NOT copy any quote from the plan into the chapter. Instead, read the actual source file and extract the real quote yourself.

  2. Statistics and numbers in the plan are unverified. A number like "21% of reviews" or "3.2% improvement" in the plan may be approximately correct, slightly wrong, or completely fabricated. DO NOT use any number from the plan without reading the actual source paper/post and verifying the exact figure.

  3. Source summaries in the plan are directionally correct but not reliable. The plan says "Source X contains Y" to help you know where to look. But the actual content of Source X may differ from the plan's summary. Always read the source; never trust the plan's description of what the source says.

  4. The plan's value is structural: which sections to write, which sources to read for each section, what topics each section should cover, and how the running example threads through the chapter. Use the plan for structure. Use the sources for content.

The guiding principle: The plan tells you WHERE to look. The sources tell you WHAT to write.


=== ZERO WORLD KNOWLEDGE PRINCIPLE (CRITICAL) ===

You know nothing about the topic except what you read from the downloaded sources.

This is the single most important principle in this workflow. You are a skilled writer and organizer, but you have zero reliable knowledge about the chapter's topic. Your training data may contain information about the topic, but that information may be outdated, incomplete, or wrong. You MUST NOT:

  • Quote an author from memory (even a famous, widely-known quote)
  • Cite a statistic you "know" without reading the source
  • Describe a method, framework, or concept from training data instead of from a downloaded source
  • Fill in gaps when a source is unavailable by "remembering" the content
  • Assume a well-known fact is correct without verifying it in a source

If you cannot find a claim in a downloaded, readable source file, the claim does not exist for you. Drop it, or download a source that contains it.

This principle exists because LLMs (including you) confidently produce plausible-sounding but incorrect information about well-known topics. A "famous quote" may be a common misattribution. A "well-known statistic" may be outdated or from a retracted paper. A "standard framework" may have been described differently by its creator than how the internet summarizes it. The only way to avoid these errors is to treat your world knowledge as unreliable and verify everything against local source files.

Read the full file on GitHub · 1,411 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 1,411 lines · 18 tokens per session scan B 275f20ab3c95

Subscribe to this mod's changes

write-textbook-chapter is a command published in the GitHub repository AI-Learning-Gems/AI-Learning-Gems.github.io (22 stars, last pushed 2mo ago), licensed MIT. It adds 18 tokens to every session and 23,855 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (strips warnings and disclaimers, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.