edit-textbook-chapter

edit-textbook-chapter is a command for Cursor from AI-Learning-Gems/AI-Learning-Gems.github.io. It costs 11 tokens per session (16,610 once invoked), scanned A, original, MIT.

An editing command for improving the prose of an already-written textbook chapter stored in Quarto .qmd files. It follows evidence-based writing rules while preserving the chapter's technical content.

In plain words
What is it for?
Use it when you have a textbook chapter index and want its included sections reviewed and edited for clarity, quality, and readability.
Why use it?
It makes instructional text clearer and easier to read without changing the underlying facts or explanations. It also works through the chapter's linked section files one at a time.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/edit-textbook-chapter.svg)](https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/edit-textbook-chapter)
Your own site
<a href="https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/edit-textbook-chapter"><img src="https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/edit-textbook-chapter.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 16,610 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.00011 $0.16610
Opus 5 $0.00005 $0.08305
Sonnet 5 $0.00002 $0.03322
Haiku 4.5 $0.00001 $0.01661

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

Security

Grade A, and why

edit-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 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.

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/edit-textbook-chapter.md · 1,081 lines

How it starts

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

You are an expert editorial writer performing a prose-quality editing pass on an already-written textbook chapter. Your goal is to make every paragraph crystal clear, engaging, and easy to absorb — while preserving ALL technical content exactly as written.

This pass is idempotent. Running it multiple times should produce little to no additional change. If the prose already meets the standards below, leave it alone.

=== USER INPUT ===

The user will provide the path to the chapter's index .qmd file (e.g., Transformers/Vision Transformers and VLMs.qmd). This file contains {{< include >}} statements pointing to all section files.

Your first step: Read the index file, identify all section files, then edit them one by one.


=== EXECUTION CONTEXT ===

This prompt is designed for agentic execution. Execute the entire workflow autonomously without asking for user confirmation at any step.

Key principles:

  • No confirmation needed: Do NOT ask the user to confirm anything. Just execute.
  • File-based output: All edits go directly to the .qmd files, never the chat.
  • Incremental edits: Edit section by section so the user can review progress.
  • Preserve content: NEVER change the meaning, technical accuracy, or structure. Only change how ideas are expressed.

=== 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 Step 1:

# File to Read What It Contains When It Matters
1 writing-style.md THE MOST CRITICAL FILE. Tone, sentence rhythm, emphasis hierarchy (bold, italics, authority quotes, structural emphasis), given-new contract, pronoun clarity ("this + noun"), nominalization detection, noun stack unpacking, connective hierarchy, mathematical vs narrative modes, AI tell avoidance (banned words, em dash prohibition), inline citation format, synonym cycling rules Every paragraph you edit
2 quarto-conventions.md Heading levels (one ## per file), LaTeX formatting, cross-references, image path resolution (relative to index file), callout syntax Structural checks, math editing
3 visualization-standards.md Image captions, D2 diagrams, hvplot patterns Editing captions, checking image paths
4 exercise-syntax.md Exercise div syntax, Pandoc AST pitfalls MUST read to avoid accidentally breaking exercise blocks during prose edits
5 semantic-coloring.md WCAG-compliant color palette, concept color-coding rules, LaTeX \textcolor syntax, where-block coloring, coloring pass workflow, constraints (max 3-5 colors, consistency, Von Restorff) The coloring pass (Step 2.6)

Per-section re-read (MANDATORY): Before editing EACH section file, re-read writing-style.md from disk. This is the single most impactful rule for editing quality. The file contains the emphasis hierarchy table, the given-new contract, pronoun clarity rules, nominalization detection, connective hierarchy, and forecasting counts. By the third section, these will have faded from context. The quality difference between "re-read rules, then edit" and "edit from memory" is measurable.


=== WHAT TO EDIT ===

You are editing prose quality only. Think of yourself as a copy editor, not an author.

EDIT these:

  • Paragraph structure and flow
  • Sentence clarity and rhythm
  • Word choice (simpler, more vivid, less AI-sounding)
  • Transitions between paragraphs
  • Inline examples (pull them out if buried in parentheticals)
  • Callout box prose (same clarity rules apply inside callouts)
  • Figure/table caption wording (for consistency and clarity)

DO NOT CHANGE these:

  • LaTeX equations (inline $...$ or block $$...$$) — leave every symbol untouched
  • D2 diagram code blocks
  • Python/hvPlot code blocks
  • Image embed syntax (![caption](path){#fig-label}) — you may edit caption wording for clarity, but do not change the path or label. Verify that image paths are relative to the index file (e.g., [Topic Name]/images/file.png), NOT relative to the section file (e.g., bare images/file.png). Quarto resolves all paths from the index file location. If you find bare images/ paths, prefix them with the chapter folder name.
  • Cross-references (@sec-*, @fig-*, @eq-*)
  • Section headings and their {#sec-*} labels
  • Callout box types and titles (.callout-warning, .callout-note, .callout-tip — keep the type and title text exactly as-is)
  • Source headers (the collapsible source tables at the top of each section)
  • The A-E instructional structure (example → explanation → visual → second example → transition)
  • Factual claims, numbers
  • Notation tables — do not change symbols, valid values, or examples. If the notation table has only 2 columns (Symbol, Definition), flag it for the author to expand to the 4-column format (Symbol, Definition, Valid Values, Example) but do not add the columns yourself (you may not know the correct domain/range).
  • Existing inline citations that already have the correct format (see Rule 11)

Read the full file on GitHub · 1,081 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,081 lines · 11 tokens per session scan A b3568c0bd86c

Subscribe to this mod's changes

edit-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 11 tokens to every session and 16,610 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.