Loading...
Loading...
Create Claude skills from book content (markdown files). Transforms long-form book knowledge into structured, context-efficient skill packages with granular reference files, workflows, and use-case guidelines. Use this skill when: - Converting a book (markdown) into a reusable Claude skill - Creating knowledge bases from technical books, guides, or documentation - Building skills that need progressive disclosure of large content - Structuring book knowledge for efficient context loading
npx skill4agent add bmad-labs/skills skill-from-bookreferences/analysis-guide.md# Count total lines
wc -l book.md
# Extract headers/TOC - THIS IS ALL YOU NEED
grep -E "^#{1,3} " book.mdreferences/extraction-patterns.mdreferences/file-templates.mdknowledge.mdrules.mdexamples.mdpatterns.mdsmells.mdchecklist.mdskill-name/
├── SKILL.md
├── progress.md
├── guidelines.md
├── workflows/ # NEW: Step-by-step processes
│ ├── [task-1].md
│ └── [task-2].md
└── references/
├── category-1/
│ ├── knowledge.md # REQUIRED
│ ├── rules.md # REQUIRED
│ ├── examples.md # REQUIRED
│ ├── patterns.md # Optional
│ └── checklist.md # Optional
└── category-2/
├── knowledge.md # REQUIRED
├── rules.md # REQUIRED
├── examples.md # REQUIRED
└── smells.md # Optional## Task: Extract [TOPIC] Knowledge Base
You are extracting knowledge from a book section to create a complete topic reference.
### Prerequisites - Read These Files First:
1. `skills/skill-from-book/references/file-templates.md` - Templates for all file types
2. `skills/skill-from-book/references/extraction-patterns.md` - Extraction rules
### Source Material:
- **Book**: [BOOK_PATH]
- **Section**: [CHAPTER/SECTION_NAME]
- **Line range**: Read with offset=[START_LINE], limit=[LINE_COUNT]
### Output Directory: [OUTPUT_TOPIC_PATH]
### Files to Create (in this order):
#### 1. knowledge.md (REQUIRED)
Core concepts, definitions, and foundational understanding.
- Extract: definitions, terminology, key concepts, how things relate
- Use the "Knowledge File" template
#### 2. rules.md (REQUIRED)
Specific guidelines, do's and don'ts.
- Extract: explicit rules, guidelines, best practices, exceptions
- Use the "Rules File" template
#### 3. examples.md (REQUIRED)
Good/bad code examples, before/after comparisons.
- Extract: all code samples, refactoring examples, comparisons
- Use the "Examples File" template
#### 4. [OPTIONAL_FILES - list any additional files needed]
[e.g., patterns.md, smells.md, checklist.md - specify what each should contain]
### Your Instructions:
1. Read the two prerequisite files FIRST to understand templates and extraction rules
2. Read the book section ONCE using: offset=[START_LINE], limit=[LINE_COUNT]
3. From that single read, extract content for ALL files listed above
4. For each file:
- Transform content (prose → bullets, extract rules, include examples)
- Format using the appropriate template from file-templates.md
- Keep each file under 200 lines
- Write to [OUTPUT_TOPIC_PATH]/[filename].md
5. Create files in order: knowledge.md → rules.md → examples.md → optional files
### Content Guidance:
[SPECIFIC_GUIDANCE - what to focus on, what to skip]
### Language Conversion (if applicable):
- Source: [SOURCE_LANG or "N/A"]
- Target: [TARGET_LANG or "N/A"]
- Convert ALL code examples to target language## Task: Extract Functions Knowledge Base
You are extracting knowledge from a book section to create a complete topic reference.
### Prerequisites - Read These Files First:
1. `skills/skill-from-book/references/file-templates.md` - Templates for all file types
2. `skills/skill-from-book/references/extraction-patterns.md` - Extraction rules
### Source Material:
- **Book**: /path/to/clean-code.md
- **Section**: Chapter 3 - Functions
- **Line range**: Read with offset=450, limit=380
### Output Directory: skills/clean-code/references/functions
### Files to Create (in this order):
#### 1. knowledge.md (REQUIRED)
Core concepts, definitions, and foundational understanding.
- Extract: what makes a function clean, key terminology (side effects, arguments, abstraction levels), how functions relate to other concepts
- Use the "Knowledge File" template
#### 2. rules.md (REQUIRED)
Specific guidelines, do's and don'ts.
- Extract: size rules, argument limits, naming conventions, single responsibility, do one thing principle
- Use the "Rules File" template
#### 3. examples.md (REQUIRED)
Good/bad code examples, before/after comparisons.
- Extract: all code samples showing good vs bad functions, refactoring walkthroughs
- Use the "Examples File" template
#### 4. checklist.md (OPTIONAL)
Quick reference for reviewing functions.
- Create a checklist from the rules for code review
### Your Instructions:
1. Read the two prerequisite files FIRST to understand templates and extraction rules
2. Read the book section ONCE using: offset=450, limit=380
3. From that single read, extract content for ALL files listed above
4. For each file:
- Transform content (prose → bullets, extract rules, include examples)
- Format using the appropriate template from file-templates.md
- Keep each file under 200 lines
- Write to skills/clean-code/references/functions/[filename].md
5. Create files in order: knowledge.md → rules.md → examples.md → checklist.md
### Content Guidance:
Focus on practical, actionable content. Skip author anecdotes and historical context. Prioritize rules that are universally applicable.
### Language Conversion:
- Source: Java
- Target: TypeScript
- Convert ALL code examples to TypeScriptreferences/guidelines-template.mdguidelines.mdreferences/workflow-templates.mdBased on the book content, I recommend these workflows:
| Workflow | Purpose | Key Steps |
|----------|---------|-----------|
| [name] | [what it does] | [brief step summary] |
| [name] | [what it does] | [brief step summary] |Which workflows would you like me to create?
- Select from the list above
- Suggest additional workflows
- Skip workflow creationreferences/workflow-templates.md## Workflows
| Task | Workflow |
|------|----------|
| [task description] | `workflows/[name].md` |skill-name/
├── SKILL.md
├── guidelines.md
├── progress.md
├── workflows/ # Step-by-step processes
│ ├── [verb]-[noun].md # e.g., code-review.md, bug-fix.md
│ └── ...
└── references/
├── [category]/ # Noun, plural (e.g., functions, classes)
│ ├── knowledge.md # REQUIRED: Core concepts and definitions
│ ├── rules.md # REQUIRED: Specific guidelines
│ ├── examples.md # REQUIRED: Good/bad examples
│ ├── patterns.md # Optional: Reusable solutions
│ ├── smells.md # Optional: Anti-patterns
│ └── checklist.md # Optional: Quick referenceprogress.md# [Skill Name] - Creation Progress
## Status: [X/Y files complete]
## Phase 1: Foundation
- [x] SKILL.md
- [x] progress.md
- [ ] guidelines.md
## Phase 2: Workflows
- [ ] workflows/[name].md
- [ ] workflows/[name].md
## Phase 3: [Category Name]
- [ ] category/knowledge.md # REQUIRED
- [ ] category/rules.md # REQUIRED
- [ ] category/examples.md # REQUIRED
- [ ] category/patterns.md # Optional
...