scaffold-exercises
Scaffold an exercise directory tree — sections, problems, solutions, and explainers — that passes the course linter. Use when the user wants to scaffold exercises, stub out exercise folders, or spin up a new course section.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-06
- Stars
- ★ 7
- Forks
- 0
01 前言 Front Matter
- name
- scaffold-exercises
- description
- Scaffold an exercise directory tree — sections, problems, solutions, and explainers — that passes the course linter. Use when the user wants to scaffold exercises, stub out exercise folders, or spin up a new course section.
03 SKILL.md 正文
Scaffold exercises
Build an exercise directory tree that passes the course's exercise linter, then commit it. Throughout, run the linter with the project's own command (for example pnpm lint:exercises or whatever the repo defines) — substitute it wherever this skill says "run the linter".
Directory naming
- Sections:
XX-section-name/underexercises/(e.g.01-retrieval-skill-building) - Exercises:
XX.YY-exercise-name/under a section (e.g.01.03-retrieval-with-bm25) - Section number is
XX; exercise number isXX.YY - Every name is dash-case: lowercase words joined by hyphens
Exercise variants
Each exercise carries at least one of these subfolders:
problem/— the student's starting point, with TODOssolution/— the reference answerexplainer/— conceptual material, no TODOs
When you are only stubbing, default to explainer/ unless the plan asks for something else.
Required files
Every subfolder (problem/, solution/, explainer/) needs a readme.md that:
- Has real content — a lone title line counts, an empty file does not
- Contains no broken links
For a stub, a title plus a short description is enough:
# Exercise Title
Description here
If a subfolder ships code, it also needs a main.ts longer than one line. Stubs can skip that — a readme-only exercise is valid.
Workflow
- Read the plan — pull out section names, exercise names, and which variants each exercise needs.
- Make the directories —
mkdir -peach path. - Write stub readmes — one
readme.mdper variant folder, each with a title. - Run the linter — validate the tree.
- Fix what it reports — repeat until the linter is clean.
What the linter checks
- Each exercise has variant subfolders (
problem/,solution/,explainer/) - At least one of
problem/,explainer/, orexplainer.1/is present - The primary subfolder has a non-empty
readme.md - No
.gitkeepfiles - No
speaker-notes.mdfiles - No broken links in any readme
- No
pnpm run exercisecommands inside readmes - A
main.tsin each subfolder unless the subfolder is readme-only
Moving or renumbering exercises
When you renumber or relocate an exercise:
- Rename with
git mv, notmv, so git keeps the history. - Adjust the numeric prefix to hold the intended order.
- Run the linter again after the moves.
Example:
git mv exercises/01-retrieval/01.03-embeddings exercises/01-retrieval/01.04-embeddings
Example: stubbing from a plan
Given a plan such as:
Section 05: Memory Skill Building
- 05.01 Introduction to Memory
- 05.02 Short-term Memory (explainer + problem + solution)
- 05.03 Long-term Memory
Create the tree:
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 drop in the 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"
04 同仓库更多 Skills
writing-great-skills
Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.
technical-writing
House style for technical writing — the voice, sentence craft, formatting, and user-facing-copy rules that make docs and product text clear, direct, and consistent. Use when writing or editing a README, docs, a spec, release notes, a changelog, help text, or any error/CLI/UI copy a person reads; when reviewing a diff that touches prose or messages; or when a project needs a writing standard. Reference-heavy mechanics live in REFERENCE.md.
teach
Teach the user a new skill or concept, within this workspace.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
grilling
Interrogate the user's plan or design one decision at a time until you both share the same understanding. Use when the user wants to pressure-test an idea before building it, or reaches for any 'grill' trigger phrase.
grill-me
A relentless, one-decision-at-a-time interview that sharpens a plan or design.