aiskillstore/marketplace / skills/92bilal26/book-scaffolding
book-scaffolding
VerifiedPlan, structure, and scaffold large educational books using cognitive load management, just-in-time specification, and pedagogical best practices. Use this skill when planning multi-part, multi-chapter educational works that require narrative continuity, progressive complexity, and hands-on exercises. This skill helps create cohesive learning journeys that balance foundational scaffolding with advanced independence. Activate when tasks involve structuring books, managing cognitive load across chapters, defining part-level narratives, or coordinating multi-phase content development workflows.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.1 KB |
| reference/chapter-dependencies.md | markdown | 16.0 KB |
| reference/chapter-flow-patterns.md | markdown | 15.4 KB |
| reference/content-organization.md | markdown | 16.4 KB |
| reference/structural-patterns.md | markdown | 17.9 KB |
| scripts/analyze-flow.pyexecutable | script | 16.0 KB |
| scripts/validate-structure.pyexecutable | script | 13.7 KB |
| skill-report.json | config | 54.2 KB |
| templates/book-outline-template.yml | config | 11.0 KB |
| templates/chapter-structure-template.yml | config | 15.9 KB |
reference/chapter-dependencies.md
View on GitHub# Chapter Dependencies and Prerequisite Management
## Overview
This document provides strategies for managing dependencies between chapters, mapping prerequisite knowledge chains, identifying optional vs. core chapters, and creating flexible reading paths in technical books.
---
## Understanding Chapter Dependencies
### Dependency Types
#### Strong Dependencies (Sequential)
**Definition**: Chapter B cannot be understood without reading Chapter A first.
**Characteristics**:
- Concepts build directly on previous material
- Code examples reference earlier examples
- Exercises assume mastery of prior content
- Notation or terminology introduced in prior chapter
**Example**:
```
Chapter 3: Functions and Parameters
↓ (Strong dependency)
Chapter 4: Higher-Order Functions
(Cannot understand passing functions as arguments
without understanding functions first)
```
**Diagram Notation**: Solid arrow (→)
---
#### Weak Dependencies (Recommended)
**Definition**: Chapter B is easier to understand after Chapter A, but not strictly required.
**Characteristics**:
- Shares concepts but doesn't build directly
- Prior chapter provides context but not prerequisites
- Can be understood independently with extra effort
- Cross-references explain connections
**Example**:
```
Chapter 5: List Comprehensions
⇢ (Weak dependency)
Chapter 8: Generator Expressions
(Syntax is similar, but generators are independent concept)
```
**Diagram Notation**: Dashed arrow (⇢)
---
#### Conceptual Dependencies (Related)
**Definition**: Chapters share conceptual themes but no direct prerequisite relationship.
**Characteristics**:
- Similar topics or domains
- May use similar techniques
- Understanding one enriches understanding of the other
- No required reading order
**Example**:
```
Chapter 6: Working with Files
Chapter 7: Working with Databases
(Both are I/O operations, but independent)
```
**Diagram Notation**: No arrow, but grouped in same part
---
#### Optional Dependencies (Enhancement)
**Definition**: Chapter A provides useful background for Chapter B, but Chapter B is self-contained.
**Characteristics**:
- Background chapter provides deeper understanding
- Main chapter works without background
- Optional reading for enrichment
- Often advanced theory behind practical chapters
**Example**:
```
Chapter 9: Using Collections (practical)
⟵ (Optional dependency)
Chapter 15: Big O Notation and Algorithm Analysis (theory)
(Understanding complexity helps choose collections,
but not required to use them)
```
**Diagram Notation**: Dotted arrow (⟵)
---
## Mapping Chapter Dependencies
### Linear Dependency Chain
**Pattern**: Each chapter depends on exactly one prior chapter.
```
Ch1 → Ch2 → Ch3 → Ch4 → Ch5 → Ch6
```
**Example**:
```
Ch1: Variables and Types →
Ch2: Control Flow (uses variables) →
Ch3: Functions (uses control flow) →
Ch4: Data Structures (uses functions) →
Ch5: OOP (uses data structures) →
Ch6: Projects (uses OOP)
```
**Advantages**:
- Simple, clear progression
- No confusion about reading order
- Easy for instructors to plan
**Disadvantages**:
- Not flexible
- Can't skip or reorder chapters
- One weak chapter blocks all subsequent chapters
**Best For**: Absolute beginner books, bootcamps, structured courses
---
### Tree Dependency Structure
**Pattern**: Early foundational chapters branch into multiple independent paths.
```
Ch1
↓
Ch2
↙ ↘
Ch3 Ch4
↓ ↓ ↘
Ch5 Ch6 Ch7
```
**Example**:
```
Ch1: Python Basics
↓
Ch2: Functions and Data Structures
↙ ↘
Ch3: File I/O Ch4: Object-Oriented Programming
↓ ↓ ↓
Ch5: Data Processing Ch6: Design Patterns Ch7: Testing OOP Code
```
**Advantages**:
- Flexible reading paths after foundation
- Multiple independent learning tracks
- Readers can specialize based on interests
- Parts of book remain useful even if other parts skipped
**Disadvantages**:
- Requires clear foundation (Ch1-2)
- May need integration chapter at end
- More complex to navigate
**Best For**: Intermediate books, multi-topic books, comprehensive guides
---
### Diamond Dependencies
**Pattern**: Multiple paths converge on a single advanced chapter.
```
Ch1
↙ ↘
Ch2 Ch3
↘ ↙
Ch4
```
**Example**:
```
Ch1: Python Basics
↙ ↘
Ch2: Functions Ch3: Classes
↘ ↙
Ch4: Decorators
(Requires both functions and classes to understand
class decorators and property decorators)
```
**Advantages**:
- Natural for integrative topics
- Shows how concepts combine
- Rewards readers who complete multiple paths
**Disadvantages**:
- Creates bottleneck chapter
- Hard for readers who want just one path
- Requires tracking multiple prerequisites
**Best For**: Advanced chapters, integration topics, design patterns
---
### DAG (Directed Acyclic Graph) Dependencies
**Pattern**: Complex web of dependencies without cycles (no circular dependencies).
```
Ch1
↙ ↘
Ch2 Ch3
↓ ↙ ↘
Ch4 Ch5
↘ ↙
Ch6
```
**Example**:
```
Ch1: Python Fundamentals
↙ ↘
Ch2: Functions Ch3: Classes
↓ ↙ ↘
Ch4: Closures Ch5: Inheritance Ch6: Modules
↘ ↙ ↘ ↙
Ch7: Design Patterns
```
**Advantages**:
- Maximum flexibility
- Natural for real-world topic relationships
- Multiple valid reading orders
**Disadvantages**:
- Complex for readers to navigate
- Requires explicit prerequisite statements
- Hard to plan reading order
**Best For**: Reference books, advanced topics, modular cookbooks
**Critical Requirement**: Must provide reading path recommendations
---
## Core vs. Optional Chapters
### Identifying Core Chapters
**Core Chapter Characteristics**:
- Essential for understanding book's main topic
- Prerequisite for multiple other chapters
- Contains foundational concepts
- Exercises build essential skills
- Typically in Part I or early in book
**Example Core Chapters** (Python book):
```
✓ Chapter 1: Variables and Types
✓ Chapter 2: Control Flow
✓ Chapter 3: Functions
✓ Chapter 4: Data Structures
✓ Chapter 5: Object-Oriented Basics
```
---
### Identifying Optional Chapters
**Optional Chapter Characteristics**:
- Specialized topics not needed by all readers
- Advanced techniques for specific use cases
- Alternative approaches to problems
- Domain-specific applications
- Often in later parts of book
**Example Optional Chapters** (Python book):
```
○ Chapter 10: Regular Expressions
(Useful for text processing, but not universally needed)
○ Chapter 12: Metaclasses
(Advanced topic, most developers never use)
○ Chapter 14: Network Programming
(Domain-specific, only for networked applications)
○ Chapter 16: GUI Development with Tkinter
(Only for desktop GUI applications)
```
---
### Marking Optional Content
**Strategy 1: Visual Indicators**
```
Chapter 10: Regular Expressions [OPTIONAL]
```
**Strategy 2: Part Organization**
```
Part III: Advanced Topics (Optional)
Chapter 10: Regular Expressions
Chapter 11: Metaclasses
Chapter 12: Network Programming
```
**Strategy 3: Prerequisite Statements**
```
Chapter 10: Regular Expressions
This chapter is optional. Skip if you're not working with text
pattern matching. Required only for Chapter 15 (Web Scraping).
```
**Strategy 4: Reader Profiles**
```
Reading Paths:
Beginner Path (Core only):
Chapters 1-8, 10, 12
Web Development Path:
Chapters 1-8, 10, 12-14, 16-17
Data Science Path:
Chapters 1-8, 11, 18-20
```
---
## Reading Path Design
### Linear Path (Simplest)
**Structure**: Read chapters 1 through N in order.
```
Reading Path: Ch1 → Ch2 → Ch3 → Ch4 → Ch5 → Ch6
```
**When to Provide**:
- Beginner-focused books
- Strong sequential dependencies
- Short books (< 10 chapters)
**Example**:
```
This book is designed to be read sequentially. Each chapter builds
on concepts from previous chapters. We recommend reading in order
from Chapter 1 to Chapter 12.
```
---
### Fast Track Path (For Experienced Readers)
**Structure**: Skip introductory material, focus on advanced chapters.
```
Fast Track Path:
Ch1 (skim) → Ch3 → Ch5 → Ch7 → Ch8 → Ch10-12
Skip: Ch2 (basics), Ch4 (beginner exercises), Ch6 (review), Ch9 (recap)
```
**When to Provide**:
- Books serving mixed audiences
- When early chapters are foundational but potentially redundant
- Readers with prior experience in related languages
**Example**:
```
If you already know another programming language:
- Skim Chapter 1-2 for Python-specific syntax
- Start serious reading at Chapter 3 (OOP in Python)
- Focus on Chapters 5-12 (Python-specific features)
```
---
### Topic-Specific Paths (For Goal-Oriented Readers)
**Structure**: Different paths for different goals.
```
Web Development Path:
Ch1-5 (foundation) → Ch8 (databases) → Ch12-14 (web frameworks)
Data Science Path:
Ch1-5 (foundation) → Ch9 (NumPy) → Ch10 (Pandas) → Ch11 (Visualization)
Automation Path:
Ch1-5 (foundation) → Ch6 (file I/O) → Ch7 (system tasks) → Ch16 (scheduling)
```
**When to Provide**:
- Multi-topic comprehensive books
- Books targeting diverse use cases
- Large books (15+ chapters)
**Example**:
```
Choose Your Path:
Path 1: Web Developer (Core + Chapters 12-14)
Path 2: Data Analyst (Core + Chapters 9-11)
Path 3: Automation Engineer (Core + Chapters 6-7, 16)
Path 4: Complete Mastery (All chapters)
Core = Chapters 1-5 (required for all paths)
```
---
### Modular Path (Maximum Flexibility)
**Structure**: No prescribed order; readers choose based on needs.
```
Foundational Chapters (Read first):
Ch1: Python Basics
Ch2: Functions
Ch3: Data Structures
Independent Topics (Read in any order):
Ch4: File I/O
Ch5: Networking
Ch6: Regular Expressions
Ch7: Database Access
Ch8: Web APIs
Ch9: Testing
Ch10: Debugging
```
**When to Provide**:
- Cookbook-style books
- Reference guides
- Advanced topic collections
**Example**:
```
After completing the foundational chapters (1-3), you can read
any remaining chapter in any order based on your needs. Each
chapter is self-contained with clearly stated prerequisites.
```
---
## Prerequisite Statements
### Clear Chapter Prerequisites
**Format**:
```
Chapter 7: Decorators
Prerequisites:
✓ Required: Chapter 3 (Functions and Closures)
✓ Required: Chapter 4 (Higher-Order Functions)
○ Recommended: Chapter 6 (Scope and Namespaces)
○ Optional: Chapter 5 (Function Attributes) for enrichment
Assumed Knowledge:
- Comfortable writing and calling functions
- Understand nested functions
- Know what closures are and why they're useful
```
---
### Self-Assessment Prerequisites
**Format**:
```
Before Starting This Chapter, You Should Be Able To:
□ Define a function with parameters and return value
□ Explain what a closure is
□ Write a function that returns another function
□ Use functions as first-class objects
If you can't check all boxes, review Chapter 3 before continuing.
```
---
### Prerequisite Recaps
**Format**:
```
Chapter 7: Decorators
Quick Recap (From Chapter 3):
Functions in Python are first-class objects. You can pass them
as arguments and return them from other functions:
def outer():
def inner():
print("Hello")
return inner
This creates a closure where inner() remembers the environment
of outer() even after outer() has finished executing.
Now let's build on this to create decorators...
```
---
## Preventing Circular Dependencies
### Circular Dependency Example (Bad)
```
Chapter 5: Classes
→ Needs Chapter 8 for understanding inheritance
Chapter 8: Inheritance
→ Needs Chapter 5 for understanding classes
❌ Circular dependency: Neither can be read first!
```
---
### Resolution Strategies
#### Strategy 1: Content Reordering
**Solution**: Rearrange to break cycle.
```
Chapter 5: Basic Classes (without inheritance)
Chapter 6: More Class Features
Chapter 7: Inheritance (builds on Ch5, no new class concepts)
```
#### Strategy 2: Content Splitting
**Solution**: Split chapters to separate independent concepts.
```
Chapter 5: Classes
5.1-5.3: Basic classes (no inheritance mentioned)
5.4: Advanced classes (inheritance preview, full coverage in Ch7)
Chapter 7: Inheritance and Polymorphism
(Builds only on Ch5.1-5.3)
```
#### Strategy 3: Self-Contained Recaps
**Solution**: Make each chapter independently understandable with recaps.
```
Chapter 8: Inheritance
Background (From Chapter 5):
[Recap class basics here, enough to understand inheritance]
Main Content:
[Inheritance content, doesn't require re-reading Ch5]
```
---
## Validation: Dependency Cycle Detection
### Manual Validation Checklist
For each chapter, ask:
1. What chapters does this chapter reference?
2. Do any of those chapters reference this chapter?
3. Can I draw a dependency path back to this chapter?
If yes to #3, you have a cycle.
### Dependency Matrix
Create a table showing chapter dependencies:
| | Ch1 | Ch2 | Ch3 | Ch4 | Ch5 |
|-------|-----|-----|-----|-----|-----|
| **Ch1** | - | ✓ | ✓ | | |
| **Ch2** | | - | ✓ | ✓ | |
| **Ch3** | | | - | ✓ | ✓ |
| **Ch4** | | | | - | ✓ |
| **Ch5** | | | | | - |
✓ = Row chapter depends on column chapter
**Check**: No chapter should have dependencies forming a cycle.
---
## Design Patterns for Flexible Dependencies
### Pattern 1: Foundation + Modules
```
Foundation (Required, Linear):
Ch1 → Ch2 → Ch3
Modules (Independent, Any Order):
Ch4 (Web Dev)
Ch5 (Data Analysis)
Ch6 (Automation)
Ch7 (Testing)
```
**Advantages**: Clear starting point, maximum flexibility after foundation
---
### Pattern 2: Spiral with Weak Dependencies
```
Ch1: Intro to Classes (basic)
Ch2: Functions
Ch3: Data Structures (uses basic classes)
Ch4: Advanced Classes (builds on Ch1, uses functions and data structures)
Ch5: Design Patterns (integrates everything)
```
Chapters revisit concepts at greater depth. Reading out of order is possible but not ideal.
---
### Pattern 3: Parallel Tracks
```
Track A (Functional Programming):
Ch1 → Ch3 → Ch5 → Ch7
Track B (Object-Oriented):
Ch1 → Ch2 → Ch4 → Ch6
Integration:
Ch8: Combining Approaches (requires both tracks)
```
**Advantages**: Supports different learning styles and preferences
---
## Summary: Dependency Management Principles
1. **Identify Dependency Types**: Strong, weak, conceptual, optional
2. **Map Dependencies Visually**: Use diagrams to see structure
3. **Avoid Cycles**: Ensure no circular dependencies (critical)
4. **Mark Optional Content**: Help readers prioritize
5. **Provide Reading Paths**: Multiple paths for different goals
6. **State Prerequisites Clearly**: What readers must know before each chapter
7. **Validate Structure**: Check dependency matrix for cycles
8. **Design for Flexibility**: Foundation + modular structure where possible
**Key Questions**:
- Can I read chapters out of order safely?
- Are prerequisites clearly stated?
- Are there any circular dependencies?
- Do I provide reading paths for different reader goals?
- Is it clear which chapters are core vs. optional?
**Best Practice**: Create a visual dependency map in the book's introduction to help readers navigate.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |