update-textbook-chapter

update-textbook-chapter is a command for Cursor from AI-Learning-Gems/AI-Learning-Gems.github.io. It costs 19 tokens per session (5,790 once invoked), scanned A, original, MIT.

An editing workflow for updating an existing textbook chapter with information from new sources. It treats the chapter as a living document instead of replacing it with a rewrite.

In plain words
What is it for?
Use it when given a chapter file and source links, such as research papers, articles, documentation, or PDFs, that need to be incorporated carefully.
Why use it?
It helps add relevant findings while keeping the chapter’s existing scope, learning goals, structure, and flow intact.

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/update-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 update-textbook-chapter

README.md
[![agentmods](https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/update-textbook-chapter.svg)](https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/update-textbook-chapter)
Your own site
<a href="https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/update-textbook-chapter"><img src="https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/update-textbook-chapter.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,790 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00019 $0.05790
Opus 5 $0.00010 $0.02895
Sonnet 5 $0.00004 $0.01158
Haiku 4.5 $0.00002 $0.00579

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

Security

Grade A, and why

update-textbook-chapter scanned grade A with 0 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/commands/update-textbook-chapter.md · 533 lines

How it starts

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

You are an expert technical editor performing a content update on an existing textbook chapter. Your goal is to incorporate new sources and information into the chapter while preserving its scope, learning objectives, narrative flow, and existing quality.

This is NOT a rewrite. You are updating a living document, not starting over. Think of yourself as a journal editor handling a revision: the structure stands, and new material is woven in where it serves the existing learning objectives.

=== USER INPUT ===

The user will provide:

  1. Path to the existing chapter's index .qmd file (e.g., Preference Learning/Ranking Preferences.qmd)
  2. New source URLs — a list of arXiv papers, blog posts, documentation pages, PDFs, etc.
  3. Optional: brief note on what these sources cover or why they are relevant

=== EXECUTION CONTEXT ===

This prompt is designed for agentic execution. Execute the entire workflow autonomously without asking for user confirmation at any step, UNLESS a scope expansion is required (see Phase 3).

Key principles:

  • No confirmation needed (except for scope expansion): Do NOT ask the user to confirm anything. Just execute.
  • File-based output: All edits go directly to .qmd files and TEXTBOOK-PLAN.md, not the chat.
  • Surgical edits: Use targeted StrReplace operations, not full-file rewrites.
  • Preserve existing content: The chapter's structure, running example, learning objectives, and section count remain unchanged unless the user explicitly approves a change.

=== MANDATORY RULES RE-READ (Do This FIRST) ===

CRITICAL: You MUST read the following rules files from disk before starting any work. Do NOT assume you already know their contents from system prompt injection or prior context. Rules may have been updated since the chat started. Read each file in full using your file-reading tool.

Read ALL of these files now, before proceeding to Phase 1:

# File to Read What It Contains When It Matters
1 source-integrity.md Zero World Knowledge principle, training data boundary (what requires a source vs. what doesn't), source readability verification, sub-agent rules, observed failure patterns, proof-of-work protocol Every phase. This is the most critical rules file. It prevents hallucinated content from entering the chapter.
2 writing-style.md Tone, sentence rhythm, emphasis hierarchy, AI tell avoidance, mathematical vs narrative modes, inline citations Phase 5 (writing new paragraphs), Phase 6 (coherence pass)
3 quarto-conventions.md Heading levels, LaTeX formatting, cross-references, image paths, callout syntax Phase 5 (section edits), Phase 6 (cross-references)
4 visualization-standards.md Image priority order, source image handling, D2 diagrams, hvplot patterns Phase 5 (adding new visualizations)
5 source-management.md Centralized source storage, folder naming, download commands, citation format Phase 2 (downloading new sources)
6 web-source-fetching.md Site-specific fetch strategies, decision tree for choosing extraction method Phase 2 (downloading new sources)
7 high-quality-blogs.md Blog attribution rules Phase 5 (attributing blog-sourced content)
8 exercise-syntax.md Exercise div syntax Phase 5 (to avoid breaking existing exercises during edits)
9 python-env.md Conda environment activation Any terminal commands

Per-section re-read and proof-of-work (MANDATORY): Before editing each section file in Phase 5, you must:

  1. Re-read source-integrity.md, writing-style.md, and exercise-syntax.md from disk.
  2. Produce a Rules Application Analysis in the chat (see source-integrity.md for the full protocol). This is not optional. It is your proof that you actually engaged with the rules before editing.

Shared rules (MUST follow):

  • Writing style: Follow writing-style.md
  • Visualizations: Follow visualization-standards.md
  • Quarto format: Follow quarto-conventions.md
  • Source handling: Follow source-management.md and web-source-fetching.md

Read the full file on GitHub · 533 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. 5d ago First seen · 533 lines · 19 tokens per session scan A ec481fcda31b

Subscribe to this mod's changes

update-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 19 tokens to every session and 5,790 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.