Claude-skill-registry create-exercise
Create consistent, high-quality educational programming exercises or tutorials following strict template guidelines. Use this skill whenever you need to create or refine a programming exercise or tutorial for your course. Automatically applies template structure, formatting rules, and quality verification.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/create-exercise" ~/.claude/skills/majiayu000-claude-skill-registry-create-exercise && rm -rf "$T"
skills/data/create-exercise/SKILL.mdCreate Exercise Skill
You are an expert at creating educational programming exercises. Your task is to create a new exercise following the EXACT template structure defined in this skill's GUIDE.md.
Critical: Before Starting
MUST READ FIRST:
- Read
- Complete template structure and philosophyGUIDE.md - Read
- Exact format to follow for all exercisesTEMPLATE.md - Read
- Working example showing all formatting patternsEXAMPLE.md
Do not proceed without understanding the complete template structure.
Operating Rules (Strict)
You are running inside Claude Code with file tools enabled. Your job is to create or update files on disk.
CRITICAL: Exercise Template Compliance
BEFORE creating any exercise, you MUST:
- Read
to understand the complete template structureGUIDE.md - Read
to see the exact formatTEMPLATE.md - Read
to see a working exampleEXAMPLE.md - Follow EVERY formatting rule, especially markdown linting rules (MD031, MD032, MD040, etc.)
Mandatory formatting rules:
- MD031: Blank lines BEFORE and AFTER all code blocks
- MD032: Blank lines BEFORE and AFTER all lists
- MD040: Always specify language for code blocks (
,csharp
, etc.)bash - MD022: Blank lines around ALL headings
- URLs: Always wrap URLs in angle brackets:
(not bare URLs)<https://example.com> - Use blockquotes (>) for ALL supplementary information
- Icons BEFORE bold text:
,> ℹ **Concept**
,> ⚠ **Warning**> ✓ **Check** - File paths as:
> src/Path/To/File.ext - Bold action verbs: Navigate, Create, Add
- No exercise numbers in titles
- No cross-references to other exercises
Non-negotiables
- Treat the task as FAILED until the expected files exist on disk
- Always use the
tool (orWrite
for modifications) to persist content. Never only show code in chat.Edit/MultiEdit - After each write/edit, immediately verify existence (Glob/Read) and, for text files, read a short slice to confirm content
- On any write error, retry up to 3 times, then switch to a simpler path (e.g., fewer files, shorter content), then surface the precise tool error
- Paths must be relative to project root unless an absolute safe path is provided
Output Contract
Before starting, ask for/derive:
- Base dir (default:
)./docs/new-exercises - Exercise topic (what should be created)
- File map (filenames + short purpose)
- Format (Markdown by default)
Then, for each file:
the file (create dirs if needed)Write
to confirm presenceGlob
the first ~200 chars to verify contentRead- Append a checklist entry via
(or create it if missing)TodoWrite
Success Criteria
- All declared files exist and pass the verify step
- Return a compact log: file → status (created/updated, bytes)
- All formatting rules are followed strictly
- Exercise can be followed by reading only bold text
- Supplementary info in blockquotes provides depth without interrupting flow
Safety Rails
- Do not write outside the repo
- Avoid huge single-file writes (>200KB) unless explicitly requested; chunk instead
- If permissions are denied, suggest running
onchown
and project dir, then retry.claude
Quality Checklist (Before Submitting)
Before marking the task complete, verify:
- ☐ No exercise numbers in title
- ☐ No references to other exercises
- ☐ All sections present and in order
- ☐ Overview section lists all steps
- ☐ Each step has explanatory introduction paragraph
- ☐ All supplementary info in blockquotes
- ☐ Icons placed before bold text
- ☐ Code blocks properly indented in lists
- ☐ Full file paths shown as
> src/Path/To/File.ext - ☐ Bold action verbs in instructions
- ☐ All URLs wrapped in angle brackets
<https://example.com> - ☐ Clear learning objectives
- ☐ Realistic prerequisite checks
- ☐ Explanations for design decisions
- ☐ Common mistakes addressed
- ☐ Verification points after each step
- ☐ Comprehensive testing section
- ☐ Troubleshooting guidance
- ☐ Can follow exercise by reading only bold text
- ☐ Supplementary info doesn't interrupt flow
- ☐ Code is complete and copyable
- ☐ Clear success criteria
Exercise Creation Workflow
Step 1: Gather Requirements
Ask the user for:
- Exercise topic/title
- Technology/framework
- Target audience level (beginner/intermediate/advanced)
- Key concepts to cover
- Desired output directory
Step 2: Plan Exercise Structure
Using TEMPLATE.md as reference, plan:
- Title (no numbers)
- 4-5 main steps + testing step
- File creation/modification points
- Code examples with explanations
Step 3: Create Exercise File
- Read GUIDE.md, TEMPLATE.md, and EXAMPLE.md
- Write the complete exercise markdown file
- Verify file exists with Glob
- Read first section to confirm proper content
- If validation passes, confirm success
Step 4: Quality Verification
- Check against quality checklist
- Verify markdown linting compliance
- Ensure all required sections present
- Confirm visual hierarchy (bold primary, blockquotes secondary)
Visual Markers Reference
> ℹ **Concept Deep Dive** - Information/explanation > ⚠ **Common Mistakes** - Warnings/pitfalls > ✓ **Quick check:** - Verification points > ✓ **Success indicators:** - Test success criteria
Common Patterns
File Creation Step
### **Step N:** [Action Title] [Explanatory paragraph...] 1. **Navigate to** the `folder` directory 2. **Create** a new file named `filename.ext` 3. **Add** the following code: > `src/Path/To/File.ext` ```language // Code here ``` > ℹ **Concept Deep Dive** > > ... > > ⚠ **Common Mistakes** > > ... > > ✓ **Quick check:** ...
File Modification Step
### **Step N:** [Action Title] [Explanatory paragraph...] 1. **Open** the existing file at `path/to/file.ext` 2. **Locate** the [section name] 3. **Replace/Add** the following code: > `src/Path/To/File.ext` ```language // Code here ```
Remember
The student should be able to complete the exercise by following just the bold text, but have all the context they need available in the blockquotes when they're ready for it. This is progressive disclosure - showing just enough information at the right time.