Token导航 LogoToken导航TokenDH.com
待分类执行命令github未标认证来源可访问clear审计通过

book-chapter-generator书籍章节生成器

Agent Skill

book-chapter-generator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

734

周安装

30

GitHub Stars

65

下载量

238
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:book-chapter-generator(书籍章节生成器)
来源仓库:https://github.com/dmccreary/claude-skills
仓库路径:skills/book-chapter-generator
安装命令:
npx skills add https://github.com/dmccreary/claude-skills --skill book-chapter-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/dmccreary/claude-skills --skill book-chapter-generator

简介

book-chapter-generator 根据课程描述和学习图谱生成结构化章节大纲。

  • 确保概念全覆盖、依赖关系合理,并按逻辑分布章节内容密度。
  • 运行于学习图谱生成之后,输出章节级指标和教学组件分布报告。
  • 需确认 learning-graph.json 存在且课程描述已 finalized 方可生效。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Book Chapter Generator

Overview

This skill creates a comprehensive chapter structure for intelligent textbooks by analyzing the course description, learning graph, and concept taxonomy. It designs an optimal chapter outline that ensures all concepts are covered exactly once, respects dependency relationships, and distributes content appropriately across chapters. This task is run serially after the learning graph generation.

When to Use This Skill

Use this skill when:

  • The course description is finalized and the a learning graph has been generated (learning-graph.json exists)
  • Chapter content structure needs to be designed before writing begins

Prerequisites:

  • /docs/course-description.md must exist
  • /docs/learning-graph/learning-graph.json must exist with ~200 concepts
  • mkdocs.yml file must be in place for the chapter links to be generated to the nav section

Do NOT use this skill if:

  • The learning graph hasn't been generated yet (use learning-graph-generator first)
  • Chapter content already exists and just needs updating

Chapter Generation Workflow

This skill follows a four-step sequential workflow with user approval before generating files.

Step 1: Analyze Input Resources

Before designing chapters, analyze the following resources:

1.1 Read Course Description

Read /docs/course-description.md to understand:

  • Course title and target audience
  • Learning objectives and outcomes
  • Prerequisite knowledge
  • Overall scope and goals

1.2 Read Learning Graph

Read /docs/learning-graph/learning-graph.json to extract:

  • Complete list of concepts (typically 200 concepts)
  • Concept dependencies (which concepts require others as prerequisites)
  • Concept groupings by taxonomy category
  • Metadata about the course

!!! info "Learning Graph = Concept Dependency Graph (a DAG)" A learning graph is a Concept Dependency Graph -- a directed acyclic graph (DAG) where each edge represents a "depends on" relationship. We chose the dependency direction (edges point FROM a concept TO the concepts it depends on) because this aligns with standard graph theory algorithms for topological sorting, cycle detection, and transitive reduction.

Some learning management systems use an alternative called an **enablement graph**,
where edges point in the opposite direction (FROM prerequisite TO the concepts it
enables). The enablement direction is more intuitive for some teachers ("learning
Ecology enables you to learn Ecosystems"), but it is less natural for graph
algorithms. This project uses the dependency direction exclusively.

!!! danger "CRITICAL: Edge Direction in learning-graph.json" In the vis-network JSON format, edges point FROM dependent TO prerequisite (the dependency direction).

- Edge `{from: 5, to: 1}` means "Biodiversity (5) depends on Ecology (1)"
- It does NOT mean "Ecology leads to Biodiversity" (that would be the enablement direction)

**To build a prerequisite map:**

prereqs = defaultdict(set) for edge in data['edges']: prereqs[edge['from']].add(edge['to']) # CORRECT: dependency direction


**NEVER use** `prereqs[edge['to']].add(edge['from'])` -- this accidentally
converts to the enablement direction, inverting ALL dependencies and silently
producing invalid chapter orderings. This bug wastes significant tokens and
requires a complete redesign.

Validate that:

  • The graph structure is a valid DAG (no circular dependencies)
  • All concepts have unique IDs
  • Dependency references are valid

1.2a Validate Edge Direction (MANDATORY)

Before designing any chapters, verify the edge direction is correct:

  1. Build the prerequisite map using prereqs[edge['from']].add(edge['to'])
  2. Identify foundational concepts (those with zero entries in prereqs)
  3. Verify foundational concepts are simple, introductory terms (e.g., "Ecology", "Energy", "System")
  4. If advanced concepts appear as foundational, the direction is WRONG -- stop and fix
# Quick validation
foundational = [n for n in data['nodes'] if n['id'] not in prereqs]
print(f"Foundational ({len(foundational)}):")
for n in foundational:
    print(f"  {n['id']}: {n['label']}")
# These should be simple/introductory. If you see "Sustainability",
# "Climate Change", etc., the edge direction is inverted.

Do NOT proceed to chapter design until this check passes.

1.3 Read Concept Taxonomy

Read /docs/learning-graph/concept-taxonomy.md (if it exists) to understand:

  • Taxonomy categories and their meanings
  • How concepts are grouped conceptually
  • Any suggested ordering or progression

1.4 Identify Design Constraints

Analyze the data to identify:

  • Foundational concepts: Concepts with no dependencies (should appear early)
  • Advanced concepts: Concepts with many dependencies (should appear later)
  • Dependency chains: Long sequences of prerequisite relationships
  • Concept clusters: Groups of related concepts that should stay together
  • Terminal concepts: Concepts that nothing depends on (can be placed flexibly)

Step 2: Design Chapter Structure

Design an optimal chapter structure following these principles:

2.1 Determine Chapter Count

Choose the appropriate number of chapters (6-20) based on:

  • Total concepts: ~200 concepts typically need 10-15 chapters
  • Dependency complexity: More complex dependencies may need more chapters
  • Taxonomy distribution: Natural groupings suggest chapter boundaries
  • Target audience: Introductory courses may need smaller chapters

Guidelines:

  • Minimum 6 chapters (for very concise courses)
  • Optimal range: 10-15 chapters
  • Maximum 20 chapters (for comprehensive graduate-level content)
  • Aim for 10-20 concepts per chapter on average

2.2 Assign Concepts to Chapters

Design chapter assignments that satisfy these requirements:

CRITICAL REQUIREMENTS:

  1. Every concept appears in exactly one chapter (no duplicates, no omissions)
  2. No concept appears before its dependencies (respect the DAG structure)
  3. Balanced distribution (avoid chapters with too many or too few concepts)

OPTIMIZATION GOALS:

  • Keep related concepts (same taxonomy category) together when possible
  • Create logical progression from foundational to advanced topics
  • Balance chapter sizes (avoid chapters with <8 or >25 concepts)
  • Group concepts that form natural learning units
  • Consider cognitive load (mix difficulty levels within chapters)

2.3 Create Chapter Titles

For each chapter, create a title that:

  • Uses Title Case formatting
  • Is no longer than 200 characters (to fit on one line)
  • Clearly describes the chapter's main topic
  • Uses standard educational terminology
  • Avoids acronyms unless widely known

Examples:

  • "Introduction to Graph Theory Fundamentals"
  • "Binary Trees and Tree Traversal Algorithms"
  • "Graph Coloring Problems and Applications"
  • "Advanced Topics in Network Flow Optimization"

2.4 Write Chapter Summaries

For each chapter, write a single sentence (20-40 words) that:

  • Describes what the chapter covers
  • Mentions key concepts or themes
  • Indicates the chapter's role in the learning progression

Step 3: Present Design to User for Approval

Before creating any files, present the chapter design to the user in this format:

## Proposed Chapter Structure

I've designed a [number]-chapter structure for your textbook covering [total] concepts.

### Chapters:

1. **[Chapter Title]** ([X] concepts)
   [One sentence summary]

2. **[Chapter Title]** ([X] concepts)
   [One sentence summary]

[... continue for all chapters ...]

### Design Challenges & Solutions:

[Discuss any challenges encountered and how the design addresses them, such as:]
- **Challenge**: Concept X has 15 dependencies, making placement difficult
  **Solution**: Placed in Chapter 8 after all prerequisites are covered in Chapters 1-7

- **Challenge**: Taxonomy category Y contains 45 concepts
  **Solution**: Split across Chapters 3, 6, and 9 to maintain logical flow

[... other challenges ...]

### Statistics:

- Total chapters: [X]
- Average concepts per chapter: [X.X]
- Range: [min]-[max] concepts per chapter
- All [total] concepts covered: ✓
- All dependencies respected: ✓

3.1 Get User Approval

After presenting the design, ask:

Do you approve this chapter structure? (y/n)

If no, please specify what changes you'd like:
- Different number of chapters?
- Specific concepts moved to different chapters?
- Chapter titles revised?
- Different grouping strategy?

3.2 Handle User Feedback

If the user says "no" or requests changes:

  • Listen to their specific feedback
  • Revise the chapter design accordingly
  • Re-present the updated structure
  • Continue iterating until approval is received

If the user says "yes":

  • Proceed to Step 4 to generate the chapter files

Step 4: Generate Chapter Directory Structure and Files

Once the user approves the design, create the chapter structure:

4.1 Create URL Path Names

For each chapter, create a URL-friendly path name:

Rules:

  • Use only lowercase letters and dashes (no other characters)
  • Remove all special characters, punctuation, and numbers (except in numbered prefixes)
  • Replace spaces with dashes
  • Use abbreviations if needed to keep names short (<50 characters)
  • Make names descriptive but concise

Examples:

"Introduction to Graph Theory Fundamentals" → "intro-to-graph-theory"
"Binary Trees and Tree Traversal Algorithms" → "binary-trees-traversal"
"Advanced Topics in Network Flow Optimization" → "advanced-network-flow"

4.2 Create Directory Structure

Create the following directory structure:

/docs/chapters/
├── index.md
├── 01-[url-path-name]/
│   └── index.md
├── 02-[url-path-name]/
│   └── index.md
├── 03-[url-path-name]/
│   └── index.md
[... continue for all chapters ...]

Implementation:

mkdir -p /docs/chapters
mkdir -p /docs/chapters/01-[url-path-name]
mkdir -p /docs/chapters/02-[url-path-name]
# ... continue for all chapters

4.3 Create Main Chapters Index

Create /docs/chapters/index.md with:

# Chapters

This textbook is organized into [X] chapters covering [Y] concepts.

## Chapter Overview

1. [Chapter 1 Title](01-[url-path-name]/index.md) - [One sentence summary]
2. [Chapter 2 Title](02-[url-path-name]/index.md) - [One sentence summary]
[... continue for all chapters ...]

## How to Use This Textbook

[Add 2-3 sentences about how readers should progress through the chapters, noting that dependencies are respected and concepts build on each other]

---

**Note:** Each chapter includes a list of concepts covered. Make sure to complete prerequisites before moving to advanced chapters.

4.4 Create Individual Chapter Index Files

For each chapter, create /docs/chapters/[XX]-[url-path-name]/index.md with this structure:

# [Chapter Title]

## Summary

[Write a 2-4 sentence summary of what the chapter covers, expanding on the one-sentence version from the design. Include:]
- Main topics and themes
- How this chapter fits in the learning progression
- What students will be able to do after completing this chapter

## Concepts Covered

This chapter covers the following [X] concepts from the learning graph:

1. [Concept Name 1]
2. [Concept Name 2]
3. [Concept Name 3]
[... continue for all concepts in this chapter ...]

## Prerequisites

[If this is not the first chapter, list which previous chapters should be completed first:]

This chapter builds on concepts from:
- [Chapter X: Chapter Title](../[XX]-[url-path-name]/index.md)
- [Chapter Y: Chapter Title](../[YY]-[url-path-name]/index.md)

[If this is the first chapter or has no prerequisites within the book:]

This chapter assumes only the prerequisites listed in the [course description](../../course-description.md).

---

TODO: Generate Chapter Content

Important formatting notes:

  • Always include a blank line before markdown lists (MkDocs requirement)
  • Use relative paths for internal links
  • Concept names should match exactly as they appear in learning-graph.json
  • Maintain consistent heading hierarchy (# → ## → ###)

4.5 Update MkDocs Navigation

After creating all chapter files, update mkdocs.yml to include the chapters in navigation. Note that the navigation bar is not very wide, so we don't spell out the name "Chapter X" in the nav bar. We only need to put the number since the "Chapters:" label is above the list of chapters.

nav:
  - Home: index.md
  - Course Description: course-description.md
  - Chapters:
    - List of Chapters: chapters/index.md
    - 1. [Chapter 1 Title]: chapters/01-[url-path-name]/index.md
    - 2. [Chapter 2 Title]: chapters/02-[url-path-name]/index.md
    - 3. [Chapter 3 Title]: chapters/03-[url-path-name]/index.md
    # ... continue for all chapters
  - Learning Graph:
    - Introduction: learning-graph/index.md
    # ... existing learning graph pages

Note: Only update the Chapters: section. Do not remove or modify other navigation entries.

4.6 Confirm Completion

After all files are created, inform the user:

✅ Chapter structure generated successfully!

Created:
- chapters/index.md (main chapter overview)
- [X] chapter directories with index files
- Updated mkdocs.yml navigation

Next steps:
1. Review the chapter structure: `mkdocs serve`
2. Navigate to the Chapters section to see all chapter outlines
3. Use the chapter content generation skill (when ready) to populate each chapter
4. Each chapter index.md has "TODO: Generate Chapter Content" as a placeholder

Statistics:
- Total chapters: [X]
- Total concepts assigned: [Y]
- All dependencies respected: ✓

Design Principles

Dependency Management

Critical: The chapter sequence must respect the DAG structure:

  • If concept B depends on concept A, then A must appear in an earlier (or same) chapter than B
  • Check all dependency relationships before finalizing chapter assignments
  • Use topological sorting to verify the order is valid

Mandatory validation before presenting to user:

Run this strict check and achieve zero violations before proceeding to Step 3:

# Build prereqs: from=dependent, to=prerequisite (NEVER invert this)
prereqs = defaultdict(set)
for e in data['edges']:
    prereqs[e['from']].add(e['to'])

# Map each concept to its chapter index
chapter_map = {}
for i, (title, cids) in enumerate(chapters):
    for cid in cids:
        chapter_map[cid] = i

# Check: every prerequisite must be in same or earlier chapter
violations = []
for i, (title, cids) in enumerate(chapters):
    for cid in cids:
        for dep in prereqs.get(cid, set()):
            if dep in chapter_map and chapter_map[dep] > i:
                violations.append(f"{nodes[cid]} ch{i+1} needs {nodes[dep]} ch{chapter_map[dep]+1}")

assert len(violations) == 0, f"{len(violations)} dependency violations found"

Do NOT present a chapter design with any violations to the user. Fix all violations first by moving concepts between chapters or reordering chapters.

Content Balance

Aim for balanced chapter sizes:

  • Optimal: 12-18 concepts per chapter
  • Acceptable: 8-25 concepts per chapter
  • Avoid: <8 concepts (too thin) or >25 concepts (too dense)

If a chapter is too large, consider splitting it into two chapters. If a chapter is too small, consider merging it with a related chapter.

Pedagogical Flow

Structure chapters to support learning:

  • Early chapters: Foundational concepts, simple ideas, build confidence
  • Middle chapters: Core content, increasing complexity, practical applications
  • Late chapters: Advanced topics, integration, synthesis

Within each chapter, order concepts from:

  1. Foundational to advanced (based on dependencies)
  2. Simple to complex (based on cognitive load)
  3. Abstract to concrete (when introducing new ideas)

Cognitive Load

Consider student cognitive load:

  • Don't overload early chapters (students are still building context)
  • Mix difficulty levels within chapters when possible
  • Group related concepts to reduce cognitive switching
  • Ensure adequate scaffolding (prerequisite concepts in prior chapters)

Common Challenges and Solutions

Challenge: Taxonomy Category Too Large

Problem: A single taxonomy category contains 40+ concepts.

Solutions:

  • Split the category across multiple chapters
  • Use different aspects or sub-themes as chapter boundaries
  • Interleave with other categories to maintain engagement

Challenge: Long Dependency Chains

Problem: Concept Z depends on Y, which depends on X, which depends on W... (5+ levels deep).

Solutions:

  • Spread the chain across multiple chapters
  • Place earlier dependencies in multiple chapters if appropriate
  • Consider creating a dedicated "foundations" chapter for deep dependency roots

Challenge: Terminal Concepts

Problem: Some concepts have no dependents (nothing builds on them).

Solutions:

  • Place terminal concepts at the end of related chapters
  • Group terminal concepts into "Additional Topics" or "Special Topics" chapters
  • Consider whether these concepts are truly necessary (but don't remove them without user approval)

Challenge: Cluster Splitting

Problem: A natural concept cluster (e.g., 5 tree traversal algorithms) is too large for one chapter but splitting it feels wrong.

Solutions:

  • Split into "Part 1" and "Part 2" chapters with clear continuation
  • Use dependency relationships to find a natural split point
  • Group by complexity (basic vs. advanced) or application domain

Challenge: Uneven Distribution

Problem: The dependency structure forces 30 concepts into Chapter 2 and only 8 concepts into Chapter 7.

Solutions:

  • Split the large chapter into two chapters
  • Merge the small chapter with an adjacent chapter
  • Revisit chapter boundaries to find better balance
  • Adjust the total number of chapters

Validation Checklist

Before finalizing the chapter structure, verify:

  • All concepts from learning-graph.json are assigned to exactly one chapter
  • No concept appears before any of its dependencies
  • Chapter sizes are within acceptable range (8-25 concepts)
  • Chapter titles are Title Case and ≤200 characters
  • URL path names contain only lowercase letters and dashes
  • All files follow the specified directory structure
  • MkDocs navigation is correctly updated
  • All markdown files have proper formatting (blank lines before lists, etc.)
  • Each chapter index.md includes all required sections
  • User has approved the chapter design

Example Usage

User request: "Create chapters for my Graph Theory textbook"

Skill workflow:

  1. Read course-description.md, learning-graph.json, and concept-taxonomy.md
  2. Analyze 200 concepts and their dependencies
  3. Design 12 chapters with balanced content distribution
  4. Present chapter outline to user:

- Chapter 1: Introduction (15 concepts) - Chapter 2: Graph Representations (18 concepts) - ... etc.

  1. Get user approval (y/n)
  2. Create directory structure and all index.md files
  3. Update mkdocs.yml navigation
  4. Confirm completion

Notes

  • This skill only creates the structure and outlines for chapters
  • It does NOT generate actual chapter content (that requires a separate skill)
  • The "TODO: Generate Chapter Content" marker indicates where content should be added later
  • Always preserve the concept list in each chapter index.md for use by content generation skills

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

26.11%
按下载量换算62

windsurf

22.99%
按下载量换算55

Claude Code

18.38%
按下载量换算44

OpenCode

12.73%
按下载量换算30

Gemini CLI

7.46%
按下载量换算18

Antigravity

3.12%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dmccreary/claude-skills --skill book-chapter-generator;npx skills add dmccreary/claude-skills --skill "book-chapter-generator" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills