brainstorming
Structured design dialogue that validates ideas before implementation begins.
book-metrics-generator
This skill generates comprehensive metrics reports for intelligent textbooks built with MkDocs Material, analyzing chapters, concepts, glossary terms, FAQs, quiz questions, diagrams, equations, MicroSims, word counts, and links. Use this skill when working with an intelligent textbook project tha...
Full skill instructions
This skill automates the generation of comprehensive metrics for intelligent textbooks. It analyzes the entire textbook structure and content to produce two detailed reports:
The metrics provide quantitative insights into content volume, educational components, and interactive elements, helping authors track progress and identify areas needing attention.
Tell the user the following:
We setup this skill mostly to automate the process of installing the shell script. The shell script calls a Python program that does the work of building the metrics files. If you want to save a few tokens, after the skill is installed (a symbolic link really) you can run the following from your terminal:
~/.claude/skills/book-metrics-generator/scripts/book-metrics-generator.sh
Just make sure that you do a git pull on the claude-skills repo to get the latest version.
Use this skill when:
The skill is designed for MkDocs Material-based intelligent textbooks following the structure defined in the intelligent-textbook skill.
The intelligent textbook project should have:
docs/ directory containing the textbook contentdocs/chapters/ directory with chapter subdirectories (e.g., 01-chapter-name/, 02-chapter-name/)index.md filedocs/learning-graph/ directory (will be created if it doesn't exist)Optional components that enhance metrics:
docs/learning-graph/learning-graph.csv - For concept countingdocs/glossary.md - For glossary term countingdocs/faq.md - For FAQ countingdocs/sims/ - For MicroSim countingquiz.md files - For quiz question countingTo generate metrics for an intelligent textbook:
./scripts/book-metrics-generator.sh
Or if the skill scripts are available:
bash /path/to/skill/scripts/book-metrics-generator.sh
Review the generated files:
docs/learning-graph/book-metrics.mddocs/learning-graph/chapter-metrics.mdUpdate mkdocs.yml navigation to include the new metrics files:
nav:
- Learning Graph:
- Book Metrics: learning-graph/book-metrics.md
- Chapter Metrics: learning-graph/chapter-metrics.md
To analyze a textbook in a non-standard location:
./scripts/book-metrics-generator.sh path/to/custom/docs
For more control or integration into custom workflows:
python3 scripts/book-metrics.py docs
The book-metrics.md file contains a four-column table with the following metrics:
| Category | Metric | Description |
|---|---|---|
| Structure | Chapters | Count of chapter directories with index.md files |
| Learning | Concepts | Number of concepts in learning-graph.csv |
| Learning | Glossary Terms | Count of defined terms (H2/H3 headers in glossary.md) |
| Learning | FAQs | Number of FAQ items (H2 headers in faq.md) |
| Assessment | Quiz Questions | Total quiz questions across all chapters |
| Visual | Diagrams | Count of H4 headers starting with "#### Diagram:" |
| Technical | Equations | LaTeX expressions using $ and $$ delimiters |
| Interactive | MicroSims | Directories in docs/sims/ with index.md files |
| Content | Total Words | All words in markdown files (excluding code and URLs) |
| Content | Links | Markdown-formatted hyperlinks text |
| Estimation | Equivalent Pages | Calculated pages based on words + visuals |
Equivalent pages are estimated using:
Pages = (Total Words ÷ 250) + (Diagrams × 0.25) + (MicroSims × 0.5)
Assumptions:
The chapter-metrics.md file contains a table with these columns:
| Column | Description |
|---|---|
| Chapter | Chapter number (leading zeros removed) |
| Name | Chapter title extracted from index.md H1 header |
| Sections | Count of H2 and H3 headers in chapter markdown files |
| Diagrams | Count of "#### Diagram:" headers in chapter |
| Words | Total word count for all markdown in the chapter |
This table enables quick identification of:
The Python script uses these patterns to count elements:
docs/chapters/ containing index.mddocs/learning-graph/learning-graph.csv (excluding header)^## and ^### patterns in glossary.md^## pattern in faq.md^## pattern in all quiz.md files^####\s+Diagram: pattern (multiline flag)\$[^$]+\$ (inline) and \$\$[^$]+\$\$ (display)docs/sims/ with index.md\[([^\]]+)\]\(([^)]+)\) patternTo ensure accurate word counts, the script:
\b\w+\b patternThe script gracefully handles:
To add a new book-level metric:
BookMetricsGenerator class:def count_new_metric(self) -> int:
"""Count the new metric.
Returns:
Number of items
"""
# Implementation here
pass
generate_book_metrics_md() to call the new method:new_metric = self.count_new_metric()
md += f"| New Metric | {new_metric} | [Link](path) | Description |\n"
To add a new chapter-level metric:
get_chapter_metrics() to compute the new metric:def get_chapter_metrics(self, chapter: Dict[str, Any]) -> Dict[str, Any]:
# Existing code...
# Add new metric
new_metric = self.count_new_metric_for_chapter(chapter)
return {
# Existing fields...
'new_metric': new_metric
}
generate_chapter_metrics_md() to include the new column:md += "| Chapter | Name | ... | New Metric |\n"
# In the row loop:
md += f"| {metrics['number']} | ... | {metrics['new_metric']} |\n"
Run metrics generation after completing chapters:
# Generate chapter content
/skill intelligent-textbook
# Generate metrics
/skill book-metrics-generator
# Review progress
cat docs/learning-graph/book-metrics.md
Add to .github/workflows/metrics.yml:
name: Generate Metrics
on:
push:
paths:
- 'docs/**/*.md'
jobs:
metrics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate metrics
run: python3 scripts/book-metrics.py docs
- name: Commit metrics
run: |
git config user.name "GitHub Actions"
git add docs/learning-graph/book-metrics.md
git add docs/learning-graph/chapter-metrics.md
git commit -m "Update metrics" || exit 0
git push
Before deploying the textbook:
Symptom: "No chapters found" in chapter-metrics.md
Solution: Ensure chapter directories:
docs/chapters/index.md fileNN-chapter-name/ (where NN is a number)Symptom: Concepts metric shows 0
Solution: Verify that:
docs/learning-graph/learning-graph.csv existsSymptom: Metrics files not created
Solution: Check that:
docs/learning-graph/ directory exists (script creates it if missing)python3 commandSymptom: Word counts seem too high or too low
Solution: The script excludes code blocks and URLs. To verify:
This skill includes two executable scripts:
Bash wrapper script that:
Default usage assumes docs/ directory in current working directory.
Python 3 script that:
BookMetricsGenerator classThe Python script is designed for extensibility - new metrics can be added by implementing new counting methods and updating the markdown generation functions.
| Metric Name | Value | Link | Notes |
|-------------|-------|------|-------|
| Chapters | 12 | [Chapters](../chapters/) | Number of chapter directories |
| Concepts | 200 | [Learning Graph](learning-graph.csv) | Concepts from learning graph |
| Total Words | 45,000 | - | Words in all markdown files |
| Equivalent Pages | 195 | - | Estimated pages (250 words/page + visuals) |
| Chapter | Name | Sections | Diagrams | Words |
|---------|------|----------|----------|-------|
| 1 | Introduction to Geometry | 8 | 3 | 3,200 |
| 2 | Points and Lines | 12 | 7 | 4,100 |
| 3 | Angles and Triangles | 15 | 12 | 5,500 |
Structured design dialogue that validates ideas before implementation begins.
Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Introduction to the obra skills system with mandatory skill invocation rules and best practices.
Execute a written implementation plan with critical review and task checkpoints.
Delegate independent tasks to specialized agents working concurrently with isolated context.
Isolated git worktrees with smart directory selection and safety verification.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Plan searchable and shareable content that drives traffic, builds authority, and generates leads.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.
Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.
The world's fastest calendar for remote work
Capture, organize, and utilize your knowledge effortlessly.
Instant Summaries of Audio & Video Interviews with AnySummary
Transform PDFs into engaging mind maps.
Chat with any PDF instantly
Create an optimal daily plan using your voice
A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.
AskYourPDF Pricing Plans: Tailored to Your Needs