scaffold-exercises
Original:🇺🇸 English
Translated
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
4installs
Sourcemattpocock/skills
Added on
NPX Install
npx skill4agent add mattpocock/skills scaffold-exercisesTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Scaffold Exercises
Create exercise directory structures that pass , then commit with .
pnpm ai-hero-cli internal lintgit commitDirectory naming
- Sections: inside
XX-section-name/(e.g.,exercises/)01-retrieval-skill-building - Exercises: inside a section (e.g.,
XX.YY-exercise-name/)01.03-retrieval-with-bm25 - Section number = , exercise number =
XXXX.YY - Names are dash-case (lowercase, hyphens)
Exercise variants
Each exercise needs at least one of these subfolders:
- - student workspace with TODOs
problem/ - - reference implementation
solution/ - - conceptual material, no TODOs
explainer/
When stubbing, default to unless the plan specifies otherwise.
explainer/Required files
Each subfolder (, , ) needs a that:
problem/solution/explainer/readme.md- 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:
md
# Exercise Title
Description hereIf the subfolder has code, it also needs a (>1 line). But for stubs, a readme-only exercise is fine.
main.tsWorkflow
- Parse the plan - extract section names, exercise names, and variant types
- Create directories - for each path
mkdir -p - Create stub readmes - one per variant folder with a title
readme.md - Run lint - to validate
pnpm ai-hero-cli internal lint - Fix any errors - iterate until lint passes
Lint rules summary
The linter () checks:
pnpm ai-hero-cli internal lint- Each exercise has subfolders (,
problem/,solution/)explainer/ - At least one of ,
problem/, orexplainer/existsexplainer.1/ - exists and is non-empty in the primary subfolder
readme.md - No files
.gitkeep - No files
speaker-notes.md - No broken links in readmes
- No commands in readmes
pnpm run exercise - required per subfolder unless it's readme-only
main.ts
Moving/renaming exercises
When renumbering or moving exercises:
- Use (not
git mv) to rename directories - preserves git historymv - Update the numeric prefix to maintain order
- Re-run lint after moves
Example:
bash
git mv exercises/01-retrieval/01.03-embeddings exercises/01-retrieval/01.04-embeddingsExample: 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 MemoryCreate:
bash
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/explainerThen 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"