lesson-creator
Skill0 starsChanged 2 months agoMITView on GitHub
Author a new ACC lesson end-to-end from a topic and its documentation. Curates a docs snapshot (Phase 0), plans the ordered chapters, writes the per-chapter tests plus one e2e test and a reference solution that makes them pass, writes the chapter briefs and lesson manifests, then runs a learner sub-agent validation pass and records validation.json. Use when the user asks to "create a new lesson", "author an ACC lesson", "scaffold a lesson", "add a lesson about <topic>", or "turn these docs into a lesson".
- Reads credentials
- Installs packages
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- chapter-artifactSkill
- course-creatorSkill
- course-engineSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 8 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run Steps 0 to 7 in order.
- Very specific: line 31
Target course: Call the start MCP tool with the user's projectRoot.
- Very specific: line 51
Read <course>/.claude-plugin/plugin.json and check whether the id exists in accContent.probes.
- Very specific: line 52
If it exists, add the id to the lesson's prerequisites.
- Very specific: line 53
If it does not exist, offer to declare it now.
- Distinctive: line 54
Never add a prerequisite id without a declaration.
- Distinctive: line 72
Keep only the lesson's language.
- Distinctive: line 73
Keep code examples verbatim.
- Very specific: line 74
Write docs/INDEX.md: one line per file with the filename, what it covers, and which chapter needs it.
- Distinctive: line 88
test cases: names plus one line on what each asserts.
- Distinctive: line 99
Offline by default: Use fixtures, in-memory fakes, or a mock at the network boundary.
- Very specific: line 101
Implement the solution: Write the code in src/ until pnpm install && pnpm vitest run is green in reference-app/.
- Very specific: line 106
Write <lesson>/chapters.json from chapters.json.tmpl.
- Very specific: line 110
Write one <lesson>/chapters/NN-<name>.md per chapter from chapter.md.tmpl.
- Very specific: line 116
Write <lesson>/lesson.json from lesson.json.tmpl.
- Very specific: line 118
Never put {{ }} in a path-shaped field.
- Very specific: line 122
Write <lesson>/description.md from description.md.tmpl.
- Very specific: line 128
Create a fresh temp workspace: mktemp -d.
- Distinctive: line 147
Remove the temp workspace when done.
- Very specific: line 157
If the user asks to skip Step 6 (--skip-validation), still write validation.json as a placeholder:
- Distinctive: line 167
Never skip silently, so a reviewer can tell an unvalidated lesson apart from a validated one.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lesson Creator Skill
You are authoring one lesson for the Agentic Community College (ACC) framework. A lesson is a topic split into chapters. Each chapter is defined by the tests it makes pass. At runtime the conductor implements every chapter, so the lesson ships the docs, the tests, the briefs, and a reference solution that proves the tests are satisfiable.
Run Steps 0 to 7 in order. Do not skip steps. The validation pass in Step 6 depends on every file being in place.
Output layout, inside the target course:
lessons/<slug>/
├── lesson.json identity, prerequisites, workspace seeding rules
├── description.md what the learner will build, why, prerequisites, time
├── docs/ Phase 0 snapshot: curated markdown + INDEX.md
├── chapters.json ordered chapters, per-chapter verification, final e2e gate
├── chapters/NN-<name>.md chapter briefs; NN is the position, <name> is the chapter id without its cNN- prefix
├── reference-app/ complete working solution INCLUDING every test
└── validation.json result of the learner validation passTemplates live in skills/lesson-creator/templates/: lesson.json.tmpl, chapters.json.tmpl, chapter.md.tmpl, description.md.tmpl. Fill {{ key }} placeholders with a plain string replace. No template engine.
Step 0: Inputs
Collect these with AskUserQuestion where a choice is involved, plain chat otherwise.
Target course. Call the start MCP tool with the user's projectRoot. Use result.courses:
- Empty: ask for the absolute path of a course repo on disk (for example
~/workspace/acc/acc-<domain>/). Refuse to author into ACC itself. - One entry: default to that course and confirm.
- Several entries: ask which one.
Resolve the target to <course-install-dir>/lessons/<slug>/. Refuse to overwrite an existing lesson directory.
Topic. One sentence: what the learner builds and which library or API it uses. Note the language and toolchain the topic implies (default: TypeScript, pnpm, vitest). Confirm.
Docs source. One of:
- absolute paths to local docs files or directories,
- one or more URLs,
retrieve: ACC finds and fetches the official documentation in Step 1.
Slug, title, summary. Slug is kebab-case with a numeric prefix (01-basic-agent), unique inside the course. Title is human-readable. Summary is one sentence for the catalog.
Prerequisites (optional). Probe ids the course-engine must pass before the learner starts. Probes are declared in the course plugin's plugin.json under accContent.probes. ACC ships zero domain probes. For each prerequisite the user names:
- Read
<course>/.claude-plugin/plugin.jsonand check whether the id exists inaccContent.probes. - If it exists, add the id to the lesson's
prerequisites. - If it does not exist, offer to declare it now. Run the same probe wizard
course-creatoruses (kind,message_pass,message_fail,params, optionalremediation). Append the declaration toaccContent.probes, write the manifest back atomically, then add the id toprerequisites. - Never add a prerequisite id without a declaration. A missing probe breaks the course-engine at runtime.
Personalization (optional). Free-form keys with integer ranges (min, max, default) or enums (values, default). Most lessons ship none. Personalization values substitute {{ key }} in chapter briefs only.
Step 1: Phase 0 docs
The implementing agent grounds every chapter in this snapshot, so curate it with care.
Obtain the source.
- Local paths: read them.
- URLs: fetch each page with
WebFetch. Many documentation sites serve a markdown variant of every page; trycurl -sL <url>.mdfirst, then<url>/index.md, then the HTML page. Prefer the.mdvariant, it needs no cleanup. retrieve: find the official documentation site for the topic (WebSearch, or a URL you know), list the pages that cover the planned steps, then fetch them as above. Show the page list to the user before fetching.
Curate into <lesson>/docs/.
- One markdown file per concept, named by concept (
query.md,tools.md,sessions.md). - Trim each file to at most about 300 lines. Keep the parts a learner needs to implement the chapters: API signatures, option tables, and code examples. Drop navigation, marketing, changelogs, and unrelated sections.
- Keep only the lesson's language. Remove tabs and examples for other languages.
- Keep code examples verbatim. Do not rewrite them.
- Write
docs/INDEX.md: one line per file with the filename, what it covers, and which chapter needs it. Add the source URL or path of each file.
Set "docs": "docs/" in lesson.json (Step 4).
Step 2: Plan
Turn the topic into an ordered list of steps, then map every step to one chapter. Aim for 3 to 6 chapters. Chapter N builds on chapter N-1; the last chapter completes the feature.
For every chapter define:
id:cNN-<short-name>(c01-run-query).title: human-readable.key_idea: the one concept the chapter artifact centers on. One or two sentences. Be specific.expected_files: workspace-relative files the conductor writes in this chapter.- test cases: names plus one line on what each asserts.
Render the plan as a table and confirm it with the user via AskUserQuestion before Step 3. Refine until the user accepts it.
Step 3: Tests and reference solution
Build <lesson>/reference-app/ as a complete, working project.
- Scaffold.
package.json,tsconfig.json, vitest config,src/stubs,.gitignore. Use pnpm. Pin dependency versions. - One test file per chapter.
tests/NN-<id>.test.ts. Tests exercise the public surface of that chapter'sexpected_files. Keep the whole suite under 30 seconds. - One e2e test.
tests/e2e.test.tsdrives the whole feature end to end. - Offline by default. Use fixtures, in-memory fakes, or a mock at the network boundary. A learner with no network must pass every chapter.
- Credentials. When the topic needs a live credential (an API key), the e2e reads it from an environment variable. When the variable is absent, the e2e skips itself with a clear message that names the variable, for example
describe.skipIf(!process.env.ANTHROPIC_API_KEY)("e2e (ANTHROPIC_API_KEY not set: skipped)", ...). A skipped e2e exits 0. Chapter tests never need credentials. - Implement the solution. Write the code in
src/untilpnpm install && pnpm vitest runis green inreference-app/. Run each chapter's command too (pnpm vitest run tests/NN-<id>.test.ts). - Decide
solution_files. List every file the conductor must write at runtime. Scaffold, config, fixtures, and tests are not solution files. Every entry must exist inreference-app/; the seed fails on a missing entry. Check the seed: copyreference-app/to a temp dir, delete the solution files, run the install command. The install must succeed and the tests must fail on missing modules, not crash the runner.
Step 4: Chapter briefs and manifests
Write <lesson>/chapters.json from chapters.json.tmpl. One entry per planned chapter with id, title, brief_md, key_idea, expected_files, tests, and verification. Per-chapter verification is { "mode": "test-suite", "command": "pnpm vitest run tests/NN-<id>.test.ts" }. final_verification is { "mode": "test-suite", "command": "pnpm vitest run" }. Modes: compile, test-suite. Pass is exit 0.
Every command is split on whitespace and run without a shell: one program plus its arguments. No &&, ||, |, ;, >, <, backticks, environment prefixes (VAR=x cmd), or single quotes. The schema rejects shell operators, and a whitespace-only command. When a chapter needs two commands, put them behind one script in package.json and call that script.
Write one <lesson>/chapters/NN-<name>.md per chapter from chapter.md.tmpl. NN is the chapter position and <name> is the chapter id without its cNN- prefix (id c01-run-query gives chapters/01-run-query.md). Three parts:
- What we implement: learner-facing, 3 to 6 lines. What the code does after this chapter and why it matters.
- Done when: one bullet per test in this chapter's test files. Test name plus what it asserts. Use the real names from the test files.
- Implementation notes: for the agent. Which
docs/file to read first, pitfalls, constraints such as "do not touch package.json".
Write <lesson>/lesson.json from lesson.json.tmpl. Fill slug, title, summary, prerequisites, docs, workspace.solution_files, and any personalization. workspace.host is reference-app. Keep workspace.files empty unless a chapter needs a starter file that the solution does not contain.
Never put {{ }} in a path-shaped field. Substitution runs on briefs only.
Step 5: Description
Write <lesson>/description.md from description.md.tmpl. What the learner will build, why it matters, prerequisites, estimated time. Keep it under 30 lines. The course-engine renders it right after selectLesson.
Step 6: Validation pass
Prove that an agent can implement the lesson from the briefs and the docs alone.
- Create a fresh temp workspace:
mktemp -d. Copy<lesson>/reference-app/into it. Delete everysolution_filesentry. Runhost_install_command. Dispatch ONE learner sub-agent with the
Agenttool (subagent_type: general-purpose). Prompt:You implement an ACC lesson as its conductor would. Lesson directory:
<abs lesson dir>. Workspace:<abs temp dir>. Never read<abs lesson dir>/reference-app/. For every chapter inchapters.json, in order: readchapters/NN-<id>.md,docs/INDEX.mdand the docs files it points at, and the chapter's test files. Edit only the chapter'sexpected_filesinside the workspace. Runverification.commandfrom the workspace until it exits 0, at most 5 attempts per chapter; then stop and report. After the last chapter runfinal_verification.command. Report: chapters passed out of total, the final exit code, and the last 60 lines of test output.Write
<lesson>/validation.json:{ "ran_at": "<ISO-8601>", "exit_code": 0, "chapters_passed": 4, "total_chapters": 4, "transcript_excerpt": "<last 60 lines>" }- On failure (
exit_code !== 0, orchapters_passed < total_chapters): find the failing chapter in the transcript. Ask the user: refine the brief, the docs, or the tests, or accept the failure as a known issue. If refining, edit and re-run this step in a new temp workspace. If accepting, add aknown_issuesarray tovalidation.jsonwith one entry per failure.
Remove the temp workspace when done.
Step 7: Hand-off
Summarize the lesson: chapters, test counts, docs files, validation result. Recommend git add + commit inside the course repo. Do not run git commands from this skill. The user audits the diff first.
Tell the user how to run it: enable the course plugin, then run /<course>:start.
Skipping validation
If the user asks to skip Step 6 (--skip-validation), still write validation.json as a placeholder:
{
"ran_at": "<ISO-8601>",
"validation_skipped": true,
"reason": "<user-provided reason>"
}Never skip silently, so a reviewer can tell an unvalidated lesson apart from a validated one.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

