Agent 生成器
- 作者仓库星标 3,914
- 作者更新于 实时读取
- 作者仓库 book-to-skill
- 领域
- 文档
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @virgiliojr94 · 未声明 license
- Token 消耗评级
- 中等消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: book-to-skill
description: Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Ca…
category: 文档
runtime: Python
---
# book-to-skill 输出预览
## PART A: 任务判断
- 适用问题:PRD、RFC、README、项目说明或知识库整理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Philosophy / Modes of Operation / 1. Full Conversion (Default)”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于PRD、RFC、README、项目说明或知识库整理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Philosophy / Modes of Operation / 1. Full Conversion (Default)”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Philosophy / Modes of Operation / 1. Full Conversion (Default)”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: book-to-skill
description: Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Ca…
category: 文档
source: virgiliojr94/book-to-skill
---
# book-to-skill
## 什么时候使用
- 把项目文档方向的常用动作沉淀成 Agent 可调用的技能 适合处理README、PRD、RFC、教程和知识库文档,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的…
- 面向PRD、RFC、README、项目说明或知识库整理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Philosophy / Modes of Operation / 1. Full Conversion (Default)」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "book-to-skill" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Philosophy / Modes of Operation / 1. Full Conversion (Default)
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Book-to-Skill Converter
Transform written knowledge into actionable agent skills by extracting structure — not producing summaries.
Philosophy
Books contain crystallized expertise: frameworks, principles, and techniques that took years to develop. This skill extracts that knowledge into a format Amp, Claude Code, or another compatible agent can leverage repeatedly.
Extract structure, not summaries. A skill isn't a book report. It's a toolkit of:
- Named frameworks (mental models with clear application)
- Actionable principles (rules that guide decisions)
- Techniques (step-by-step methods)
- Anti-patterns (what to avoid and why)
- Voice calibration (how the author thinks and communicates)
Preserve the author's precision. Frameworks often have specific names for reasons. "The 5 Whys" isn't interchangeable with "ask why multiple times." Capture the exact formulation.
Layer depth appropriately. Simple books → simple skills. Complex books with 10+ frameworks → skills with reference files and on-demand chapters.
Modes of Operation
Four paths available. Route based on what the user asks:
1. Full Conversion (Default)
Trigger: User provides one or more document/directory/glob paths without special instructions Action: Run all steps below (Steps 0–9) Output: Complete skill with SKILL.md, chapters/, glossary, patterns, cheatsheet
2. Analyze Only
Trigger: User says "analyze", "just extract", or "I want to review before generating" Action: Run Steps 0–3, then produce a structured extraction report (frameworks, principles, techniques found). Stop — do NOT generate skill files. Output: Analysis report for user review
3. Generate from Prior Analysis
Trigger: User has existing analysis notes or previously ran analyze-only Action: Skip Steps 0–3, use the provided analysis as input, run Steps 4–9 Output: Skill files from the provided analysis
4. Update / Fold-in (Existing Skill)
Trigger: User provides one or more new source paths and indicates they want to update an existing skill (either by pointing to the existing skill folder, providing a skill slug that already exists in SKILLS_HOME, or explicitly requesting an update).
Action: Run Step 0 (out-of-scope check), Step 1 (validate inputs), Step 1.5 (identify book type), and Step 2 (extract new files). Then skip to Step 5 (identify/detect existing skill path) and run the Update / Fold-in Workflow to merge the new content into the existing skill files.
Output: Updated existing skill with new/revised chapter summaries and merged indexes/glossaries.
Skill Locations
This converter can run from multiple skill systems. When looking for this converter's helper script or writing the generated book skill, prefer these locations in order:
- Claude Code skills:
~/.claude/skills/ - Amp project-local skills:
.agents/skills/ - Amp global skills:
~/.config/agents/skills/ - Amp legacy global skills:
~/.config/amp/skills/
Generated skills should default to ~/.claude/skills/ for Claude Code unless the user asks for Amp project-local or Amp global output.
Step 0 — Out-of-scope check
If no arguments are provided, stop and respond:
"book-to-skill requires a supported document path, folder, or glob pattern. Usage:
book-to-skill <path-to-document-folder-or-glob>... [skill-name-slug]"
Throughout the workflow:
- Identify the input paths and the optional skill slug.
- If the last argument is not a file, folder, or glob that exists or matches any files, and it looks like a skill slug (e.g. lowercase hyphens, alphanumeric), treat it as
SKILL_NAME. - Treat all other arguments as the list of
INPUT_PATHS. - If any input path is an existing skill directory (contains
SKILL.mdand achapters/sub-folder), or ifSKILL_NAMEmatches an existing skill slug inSKILLS_HOME, flag this run as an Update/Fold-in operation (Mode 4).
Step 1 — Validate input
Verify that there is at least one supported file, directory, or glob pattern among the INPUT_PATHS.
For directories and globs, expand them to find matching supported files (.pdf, .epub, .docx, .txt, .md, .markdown, .rst, .adoc, .html, .htm, .rtf, .mobi, .azw, .azw3).
If no supported files are found, stop with a clear error message.
Step 1.5 — Identify content type
Before extracting, ask the user:
"What kind of content do these sources have? This helps me choose the best extraction method.
- Technical — has code blocks, tables, formulas, diagrams (e.g. programming books, academic papers, architecture guides)
- Text-heavy — mostly prose, few or no tables/code (e.g. management, productivity, narrative non-fiction)
- Not sure — I'll use the fast method and warn you if quality seems limited"
Store the answer as BOOK_TYPE:
- Option 1 →
BOOK_TYPE=technical - Option 2 →
BOOK_TYPE=text - Option 3 →
BOOK_TYPE=text
If BOOK_TYPE=technical, inform the user before proceeding:
"📐 Technical mode selected — using Docling for structure-aware extraction (tables, code blocks, formulas preserved as markdown). This takes ~1.5s per page, so expect a few minutes for longer sources. Starting now…"
If BOOK_TYPE=text, inform:
"📄 Text mode selected — using the fastest suitable extractor for each file type. Plain text/Markdown/HTML are usually ready in seconds; PDFs use pdftotext when available."
Step 2 — Extract text from the source documents
Run the extraction script, passing the input paths:
SCRIPT_PATH=""
for candidate in \
"$HOME/.claude/skills/book-to-skill/scripts/extract.py" \
".agents/skills/book-to-skill/scripts/extract.py" \
"$HOME/.config/agents/skills/book-to-skill/scripts/extract.py" \
"$HOME/.config/amp/skills/book-to-skill/scripts/extract.py"
do
if [ -f "$candidate" ]; then
SCRIPT_PATH="$candidate"
break
fi
done
if [ -z "$SCRIPT_PATH" ]; then
echo "Could not find scripts/extract.py for book-to-skill" >&2
exit 1
fi
PYTHON_BIN="${PYTHON_BIN:-python3}"
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
PYTHON_BIN="python"
fi
"$PYTHON_BIN" "$SCRIPT_PATH" $INPUT_PATHS --mode <BOOK_TYPE> --install-missing ask
Before extraction, the script checks optional Python packages needed for the detected format. If a better extractor is missing, it prompts the user with the available fallback. Non-interactive sessions default to fallback unless install mode is explicitly yes.
This creates:
<tempdir>/book_skill_work/full_text.txt— combined extracted text of all sources with clear visually demarcated boundaries.<tempdir>/book_skill_work/metadata.json— overall combined size, words, pages, token counts, and a detailed list of individual processedsources.
Read <tempdir>/book_skill_work/metadata.json to inspect the results.
Step 2.5 — Pre-flight cost estimate
Read <tempdir>/book_skill_work/metadata.json and present the user with an estimate before doing any generation:
📖 Sources detected: <total_sources> source(s)
<list each source filename and format from the sources metadata list>
📄 Combined Pages/Sections: ~<N> | Words: ~<N> | Total tokens: ~<N>K
💰 Estimated token cost (Full Conversion / Update):
Input (reading + prompts): ~<N>K tokens
Output (skill files generated/updated): ~<N>K tokens
Total: ~<N>K tokens
Reference prices (as of 2025):
Claude Sonnet 4.5 → ~$<X> USD
Claude Haiku 4.5 → ~$<X> USD
⏱ Estimated time: ~<N> minutes
📁 Files to be generated/updated:
SKILL.md + chapter files + glossary + patterns + cheatsheet
➡ Proceed with Full Conversion / Update? (or type "analyze only" to preview first)
How to estimate:
- Input tokens ≈
estimated_tokensfrom metadata × 1.3 (prompts overhead per chapter pass) - Output tokens ≈ chapters × 1,000 + 4,000 (SKILL.md) + 4,500 (glossary + patterns + cheatsheet)
- Price: Sonnet input=$3/MTok output=$15/MTok — Haiku input=$0.80/MTok output=$4/MTok
Wait for the user to confirm before proceeding. If they say "analyze only", switch to Mode 2.
Step 2.6 — REPL-style access for large books (> 50k tokens)
Inspired by the Recursive Language Model (RLM) paradigm: treat full_text.txt as a queryable corpus, not a single read. Loading the whole file into context burns budget you will need later for generation.
For books over ~50k tokens, prefer programmatic probes over Read(full_text.txt) without bounds:
# Size check before any Read
wc -w "$FULL_TEXT_PATH"
# Find chapter offsets without loading the whole file
grep -n -E "^\s*(Chapter|CHAPTER)\s+[0-9]+" "$FULL_TEXT_PATH" | head -40
# Pull only the chapter you need (lines start..end inclusive)
sed -n '<start>,<end>p' "$FULL_TEXT_PATH"
# Verify a framework is actually mentioned before claiming it in SKILL.md
grep -c -i "westrum\|dora" "$FULL_TEXT_PATH"
# Targeted Read with offset/limit avoids dumping the full file
# Read(file_path=full_text.txt, offset=<line>, limit=<lines>)
Use this approach for Step 3 (structure analysis), Step 7 (per-chapter summaries), and Step 8 (glossary / patterns extraction). On books under 50k tokens, a single Read is fine.
Why this matters: a 200-page book is ~75k tokens. Re-reading it once per chapter (28 passes) costs ~2M input tokens; using grep + sed to pull only relevant slices keeps generation cost proportional to the output, not the source.
Step 3 — Analyze book structure
Read the first 8,000 characters of the extracted full_text.txt to identify:
- Book title and author(s)
- Chapter structure (look for "Chapter N", "PART I", numbered headings, table of contents)
- Core themes and subject domain
- Approximate number of chapters
Then read the Table of Contents section if present to map all chapters.
If mode is "Analyze Only": produce the extraction report now and stop. Structure:
## Extraction Report — <Title>
### Author's Core Frameworks
- **<Framework Name>**: <what it is and when to apply>
### Key Principles
- <Principle>: <actionable rule>
### Techniques & Methods
- <Technique>: <step-by-step or how-to>
### Anti-patterns
- <What to avoid>: <why>
### Suggested Skill Name
`{author-lastname}-{core-concept}` — e.g. `cialdini-influence`
### Chapters Detected
| # | Title | Main Frameworks |
Step 4 — Ask purpose (Full Conversion only)
Before generating, ask the user:
"What should this skill help you do? (Pick one or more)
- Apply the author's frameworks while working
- Think with the author's mental models
- Reference specific chapters and concepts
- All of the above"
Use the answer to weight what gets highlighted in the SKILL.md Core section.
Step 5 — Determine skill name
If SKILL_NAME was provided, use it as the skill slug.
Otherwise, propose two options and let the user choose:
- By author-concept:
{author-lastname}-{core-concept}(e.g.cialdini-influence,meadows-systems) - By title: lowercase hyphens from book title (e.g.
designing-data-intensive-apps)
Default to author-concept format if the book has a strong methodological identity.
Choose the destination skill root:
- Claude Code default:
~/.claude/skills - Amp global:
~/.config/agents/skillsif that is the user's existing global skill location - Amp project-local:
.agents/skillswhen the user explicitly wants the generated book skill scoped to the current workspace - Amp legacy:
~/.config/amp/skillsif that is the user's existing global skill location
Set SKILLS_HOME to the selected root and check if $SKILLS_HOME/<skill_name>/ already exists.
If it does, prompt the user to choose:
- Update / Fold-in (Mode 4) — integrate new files/content into the existing skill components.
- Overwrite — delete and regenerate the skill from scratch.
- Rename — append
-2or use a different custom slug.
If the user selects Update / Fold-in, proceed immediately to the Update / Fold-in Workflow section after Step 2.5 (skipping Steps 3, 4, 6, 7, 8, 9).
Step 6 — Create skill directory structure
mkdir -p "$SKILLS_HOME/<skill_name>/chapters"
Step 7 — Generate chapter summaries
TOKEN BUDGET RULE — CRITICAL:
- Each chapter summary file: 800–1,200 tokens (dense, not verbose)
- Files are loaded on-demand — they are NOT capped per se, but keep them useful and tight
For EACH chapter/major section identified in Step 3:
Read the corresponding section of the extracted full_text.txt (use character offsets or grep for chapter headings).
Create $SKILLS_HOME/<skill_name>/chapters/ch<NN>-<slug>.md using the structure below.
Adapt emphasis based on BOOK_TYPE:
technical→ prioritize "Code Examples", "Reference Tables", and "Commands & APIs" sections; preserve exact syntaxtext→ prioritize "Frameworks Introduced", "Mental Models", and "Key Takeaways"; skip empty technical sections
# Chapter N: <Full Title>
## Core Idea
<1–2 sentences: the single most important thing this chapter teaches>
## Frameworks Introduced
- **<Framework Name>**: <exact formulation — preserve the author's naming>
- When to use: <specific situation>
- How: <steps or criteria>
## Key Concepts
- **<Term>**: <precise definition in 1 sentence>
(5–10 most important terms from this chapter)
## Mental Models
<2–4 frameworks or thinking tools. Write as "Use X when Y" or "Think of X as Y">
## Anti-patterns
- **<What to avoid>**: <why it fails>
## Code Examples *(technical books only — omit if BOOK_TYPE=text)*
<!-- Copy the most instructive snippet from the chapter. Preserve indentation exactly. -->
```<language>
<key code example from this chapter>
- What it demonstrates:
Reference Tables (technical books only — omit if BOOK_TYPE=text)
Key Takeaways
(3–7 takeaways a practitioner must remember)
Connects To
- Ch N:
:
---
## Step 8 — Generate supporting files
### glossary.md
Create `$SKILLS_HOME/<skill_name>/glossary.md`:
- Every significant term from the book, alphabetically sorted
- Format: `**Term** — definition (Ch N)`
- Max 1,500 tokens
### patterns.md
Create `$SKILLS_HOME/<skill_name>/patterns.md`:
- All concrete techniques, design patterns, algorithms from the book
- Format: `## Pattern Name\n**When to use**: ...\n**How**: ...\n**Trade-offs**: ...`
- Max 2,000 tokens
### cheatsheet.md
Create `$SKILLS_HOME/<skill_name>/cheatsheet.md`:
- Decision tables, comparison matrices, quick-reference rules
- The content you'd want on a single printed page
- Max 1,000 tokens
---
## Step 9 — Generate the master SKILL.md
**CRITICAL TOKEN BUDGET: Keep SKILL.md body under 4,000 tokens.**
Compaction truncates from the END — put the most important content FIRST.
Create `$SKILLS_HOME/<skill_name>/SKILL.md`:
```markdown
---
name: <skill_name>
description: "Knowledge base from \"<Full Title>\" by <Author(s)>. Use when applying <author>'s frameworks for <key topics, 3–6 terms>, studying the book, or referencing its concepts."
allowed-tools:
- Read
- Grep
argument-hint: [topic, framework name, or chapter number]
---
# <Full Title>
**Author**: <Author(s)> | **Pages**: ~<N> | **Chapters**: <N> | **Generated**: <YYYY-MM-DD>
## How to Use This Skill
- **Without arguments** — load core frameworks for reference
- **With a topic** — ask about `replication`, `pricing`, or another indexed topic; I find and read the relevant chapter
- **With chapter** — ask for `ch05`; I load that specific chapter
- **Browse** — ask "what chapters do you have?" to see the full index
When you ask about a topic not covered in Core Frameworks below, I will read
the relevant chapter file before answering.
---
## Core Frameworks & Mental Models
<!-- ~2,000 tokens: the author's most important named frameworks and principles.
Preserve exact names. Write as "Use X when Y", "Prefer X over Y because Z".
This is a toolkit, not a summary. -->
<generate 2,000 tokens of the most critical frameworks and insights here>
---
## Chapter Index
| # | Title | Key Frameworks |
|---|-------|----------------|
| [ch01](chapters/ch01-<slug>.md) | <Title> | <framework1>, <framework2> |
| [ch02](chapters/ch02-<slug>.md) | <Title> | <framework1>, <framework2> |
...
## Topic Index
<!-- Alphabetical. Major terms/frameworks → chapter(s) that cover them. -->
- **<Term>** → ch<N>[, ch<N>]
- **<Term>** → ch<N>
## Supporting Files
- [glossary.md](glossary.md) — all key terms with definitions
- [patterns.md](patterns.md) — all techniques and design patterns
- [cheatsheet.md](cheatsheet.md) — quick reference tables and decision guides
---
## Scope & Limits
This skill covers the book content only. For hands-on implementation in your codebase,
combine with project-specific tools. For topics beyond this book, check related skills
or ask the agent directly.
Step 10 — Cleanup and report
PYTHON_BIN="${PYTHON_BIN:-python3}"
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
PYTHON_BIN="python"
fi
"$PYTHON_BIN" - <<'PY'
import os
import shutil
import tempfile
from pathlib import Path
shutil.rmtree(
os.environ.get("BOOK_SKILL_WORKDIR", Path(tempfile.gettempdir()) / "book_skill_work"),
ignore_errors=True,
)
PY
Then report to the user:
✅ Skill created: $SKILLS_HOME/<skill_name>/
📚 Book: <Full Title> — <Author>
📄 Pages: ~<N> | Chapters: <N>
Files generated:
SKILL.md — core frameworks + index (~X tokens)
chapters/ — <N> chapter summaries (~X tokens each, ~X total)
glossary.md — key terms (~X tokens)
patterns.md — techniques & patterns (~X tokens)
cheatsheet.md — quick reference (~X tokens)
─────────────────────────────────────────────────────
Total skill size: ~X tokens (loaded on-demand, not all at once)
💡 Tip: check your agent's session cost/usage command to see actual token usage.
Usage:
Ask for <skill_name> → load core frameworks
Ask <skill_name> about <topic> → find and explain a topic
Ask <skill_name> for ch<N> → dive into a specific chapter
Update / Fold-in Workflow
When performing an Update/Fold-in operation on an existing skill at $SKILLS_HOME/<skill_name>/:
1. Read Existing Skill Structure
Read and parse the existing skill's files:
- Read
$SKILLS_HOME/<skill_name>/SKILL.mdto parse the existing Chapter Index, Topic Index, metadata (author, total chapters), and Core Frameworks. - List all files in
$SKILLS_HOME/<skill_name>/chapters/to find the highest chapter number (e.g.ch12). - Read
$SKILLS_HOME/<skill_name>/glossary.md,$SKILLS_HOME/<skill_name>/patterns.md, and$SKILLS_HOME/<skill_name>/cheatsheet.mdto see what terms and frameworks are already indexed.
2. Match Content & Identify Revisions vs. Additions
Analyze the new extracted text in <tempdir>/book_skill_work/full_text.txt to identify if the new content represents:
- Updates/Revisions to existing chapters: If a section of the new content directly updates or expands an existing chapter's topic, read the existing chapter file, merge the new details into it, and rewrite the file.
- New additions: If the content introduces new chapters, papers, or separate sections, create new chapter summary files under
chapters/. Start numbering these files after the highest existing chapter number (e.g. if the existing chapters stop atch12, createch13-*.md,ch14-*.md, etc.).
3. Generate or Update Chapter Summary Files
For each new or revised chapter:
- Read the corresponding section of the extracted new text.
- Follow the formatting guidelines in Step 7 to build the summary.
- Write/update the file in
$SKILLS_HOME/<skill_name>/chapters/.
4. Merge Supporting Files
- Merge glossary.md:
- Read the existing
$SKILLS_HOME/<skill_name>/glossary.md. - Extract all new terms and definitions from the new content (Step 8 glossary guidelines).
- Combine and alphabetize the list of existing and new terms.
- If a term already exists, append the new chapter/source references to it (e.g.
**Term** — definition (Ch 4, Ch 13)). - Rewrite
$SKILLS_HOME/<skill_name>/glossary.mdwith the fully merged, alphabetized list.
- Read the existing
- Merge patterns.md:
- Read existing
$SKILLS_HOME/<skill_name>/patterns.md. - Extract any new techniques, algorithms, or patterns from the new content.
- Append the new patterns, ensuring consistent formatting, and keeping the total length concise (under 2,500 tokens).
- Read existing
- Merge cheatsheet.md:
- Read existing
$SKILLS_HOME/<skill_name>/cheatsheet.md. - Extract new comparison rules, decision tables, or parameter guides.
- Integrate them cleanly into the cheatsheet structure.
- Read existing
5. Re-generate the Master SKILL.md
Update the master skill file $SKILLS_HOME/<skill_name>/SKILL.md:
- Metadata: Increment the chapter count, update the estimated page count, and add the new source names if appropriate. Update the
Generateddate to the current date. - Core Frameworks: Fold in the most high-impact mental models or principles from the new content (ensuring the overall file remains under 4,000 tokens).
- Chapter Index: Append the new chapters to the index table, linking to the newly created files.
- Topic Index: Merge the new topics alphabetically. If an existing topic is also covered in the new chapters, append the new chapter links to its line (e.g.
- **Topic** → ch05, ch13).
6. Cleanup and Proceed to Step 10
Once the files are successfully written and merged, skip to Step 10 to perform cleanup and print a custom update report summarizing the newly added chapters, merged glossary terms, and updated indices.
Quality Rules
- Extract structure, not summaries — capture named frameworks, exact formulations, anti-patterns; not chapter recaps
- Preserve the author's precision — "The 5 Whys" ≠ "ask why multiple times"; keep exact naming
- Density over completeness — a 1,000-token summary beats a 10,000-token excerpt
- Practitioner voice — write "Use X when Y", not "The book explains X"
- Front-load SKILL.md — compaction keeps the first 5,000 tokens; most important content comes first
- Chapter files are on-demand — they don't count against skill budget until loaded
- Never copy raw book text — always synthesize, summarize, extract signal
- Topic index is critical — it's how the agent navigates to the right chapter file
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核