New to Claude Skills? Learn how to install them →

mattpocock on GitHub

Scaffold Exercises

Free

Easily create structured exercise directories for courses.

by mattpocock212.7k stars on mattpocock/skills
5 views
Updated Aug 6, 2026
Get this skill

Free · Opens the source repo

What Scaffold Exercises does

Scaffold Exercises is a command-line tool designed to help educators and developers create well-structured exercise directories for learning materials. This skill automates the process of setting up directories that conform to specific naming conventions and organizational standards, ensuring that each exercise is properly categorized into sections and variants. By using this tool, you can streamline the creation of exercises, making it easier to manage educational content and improve the learning experience.

The tool operates by parsing a predefined plan that outlines the sections and exercises to be created. It generates the necessary directory structure, including subfolders for problems, solutions, and explainers. Each of these subfolders must contain a readme.md file that is not empty and adheres to linting rules. This ensures that all created materials are ready for use and meet quality standards before they are committed to version control.

Scaffold Exercises is particularly useful for educators looking to set up new course sections or for developers creating coding exercises. It helps maintain consistency in naming and structure, which is crucial for collaborative projects or when scaling educational content. By automating the creation of exercise stubs, it saves time and reduces the potential for errors, allowing you to focus on content development rather than file management.

Whether you are an instructor preparing materials for a class or a developer looking to organize coding challenges, Scaffold Exercises provides a straightforward solution to scaffold your exercises efficiently. With built-in linting to validate your structure, you can ensure that your educational resources are both organized and functional.

When to use it

Use this tool when you need to scaffold exercises for a course or project, ensuring proper structure and linting compliance.

When not to use it

This skill may not be suitable for projects that do not require a structured directory setup or for users unfamiliar with command-line tools.

What you can build with it

Setting Up a New Course Section

Use Scaffold Exercises to quickly create a new section for your course, ensuring all exercises are properly organized.

Creating Coding Challenges

Developers can utilize this tool to scaffold coding challenges, maintaining a consistent structure for problem and solution files.

Automating Educational Material Preparation

Educators can automate the preparation of exercise directories, saving time and reducing errors in content organization.

How to install Scaffold Exercises

View source

1. Install with the skills CLI

npx skills add mattpocock/skills/scaffold-exercises --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mattpocock

Scaffold Exercises

Create exercise directory structures that pass pnpm ai-hero-cli internal lint, then commit with git commit.

Directory naming

  • Sections: XX-section-name/ inside exercises/ (e.g., 01-retrieval-skill-building)
  • Exercises: XX.YY-exercise-name/ inside a section (e.g., 01.03-retrieval-with-bm25)
  • Section number = XX, exercise number = XX.YY
  • Names are dash-case (lowercase, hyphens)

Exercise variants

Each exercise needs at least one of these subfolders:

  • problem/ - student workspace with TODOs
  • solution/ - reference implementation
  • explainer/ - conceptual material, no TODOs

When stubbing, default to explainer/ unless the plan specifies otherwise.

Required files

Each subfolder (problem/, solution/, explainer/) needs a readme.md that:

  • Is not empty (must have real content, even a single title line works)
  • Has no broken links

When stubbing, create a minimal readme with a title and a description:

# Exercise Title

Description here

If the subfolder has code, it also needs a main.ts (>1 line). But for stubs, a readme-only exercise is fine.

Workflow

  1. Parse the plan - extract section names, exercise names, and variant types
  2. Create directories - mkdir -p for each path
  3. Create stub readmes - one readme.md per variant folder with a title
  4. Run lint - pnpm ai-hero-cli internal lint to validate
  5. Fix any errors - iterate until lint passes

Lint rules summary

The linter (pnpm ai-hero-cli internal lint) checks:

  • Each exercise has subfolders (problem/, solution/, explainer/)
  • At least one of problem/, explainer/, or explainer.1/ exists
  • readme.md exists and is non-empty in the primary subfolder
  • No .gitkeep files
  • No speaker-notes.md files
  • No broken links in readmes
  • No pnpm run exercise commands in readmes
  • main.ts required per subfolder unless it's readme-only

Moving/renaming exercises

When renumbering or moving exercises:

  1. Use git mv (not mv) to rename directories - preserves git history
  2. Update the numeric prefix to maintain order
  3. Re-run lint after moves

Example:

git mv exercises/01-retrieval/01.03-embeddings exercises/01-retrieval/01.04-embeddings

Example: stubbing from a plan

Given a plan like:

Section 05: Memory Skill Building
- 05.01 Introduction to Memory
- 05.02 Short-term Memory (explainer + problem + solution)
- 05.03 Long-term Memory

Create:

mkdir -p exercises/05-memory-skill-building/05.01-introduction-to-memory/explainer
mkdir -p exercises/05-memory-skill-building/05.02-short-term-memory/{explainer,problem,solution}
mkdir -p exercises/05-memory-skill-building/05.03-long-term-memory/explainer

Then create readme stubs:

exercises/05-memory-skill-building/05.01-introduction-to-memory/explainer/readme.md -> "# Introduction to Memory"
exercises/05-memory-skill-building/05.02-short-term-memory/explainer/readme.md -> "# Short-term Memory"
exercises/05-memory-skill-building/05.02-short-term-memory/problem/readme.md -> "# Short-term Memory"
exercises/05-memory-skill-building/05.02-short-term-memory/solution/readme.md -> "# Short-term Memory"
exercises/05-memory-skill-building/05.03-long-term-memory/explainer/readme.md -> "# Long-term Memory"

Frequently asked questions about Scaffold Exercises

Similar skills