scaffold-exercises
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScaffold Exercises
生成练习目录结构
Create exercise directory structures that pass linting validation for educational content.
创建可通过代码检查验证的教育内容练习目录结构。
When to use this skill
适用场景
- Creating course sections and exercises for educational content
- Scaffolding structured learning materials with problem/solution variants
- Building content that must pass
pnpm ai-hero-cli internal lint
- 为教育内容创建课程章节与练习
- 生成包含问题/解答变体的结构化学习资料
- 构建需要通过检查的内容
pnpm ai-hero-cli internal lint
When not to use this skill
不适用场景
- General project scaffolding → use
file-organization - Documentation writing → use
technical-writing
- 通用项目结构搭建 → 请使用技能
file-organization - 文档撰写 → 请使用技能
technical-writing
Directory structure
目录结构
exercises/
├── 01-introduction/
│ ├── 01.01-getting-started/
│ │ ├── problem/
│ │ │ ├── readme.md (required, non-empty, has title)
│ │ │ └── main.ts (optional, >1 line if present)
│ │ └── solution/
│ │ ├── readme.md
│ │ └── main.ts
│ └── 01.02-basic-concepts/
│ └── explainer/
│ └── readme.mdexercises/
├── 01-introduction/
│ ├── 01.01-getting-started/
│ │ ├── problem/
│ │ │ ├── readme.md (required, non-empty, has title)
│ │ │ └── main.ts (optional, >1 line if present)
│ │ └── solution/
│ │ ├── readme.md
│ │ └── main.ts
│ └── 01.02-basic-concepts/
│ └── explainer/
│ └── readme.mdNaming conventions
命名规范
- Sections: (two-digit number, lowercase, hyphens)
XX-section-name/ - Exercises: (section.exercise number, lowercase, hyphens)
XX.YY-exercise-name/ - Variants: ,
problem/,solution/explainer/
- 章节:(两位数字,小写字母,连字符分隔)
XX-section-name/ - 练习:(章节.练习编号,小写字母,连字符分隔)
XX.YY-exercise-name/ - 子目录变体:、
problem/、solution/explainer/
Required files per variant
各子目录变体的必填文件
Every variant folder needs:
- — non-empty, must have at least a title (
readme.md)# Title - — optional, but must be >1 line if present
main.ts
每个子目录变体需包含:
- — 非空,至少包含一个标题(
readme.md)# 标题 - — 可选,但如果存在则内容需超过1行
main.ts
Workflow
工作流程
1. Parse requirements
1. 解析需求
Identify section names, exercise names, and which variants are needed (problem, solution, explainer, or combinations).
确定章节名称、练习名称,以及所需的子目录变体(problem、solution、explainer或组合)。
2. Create directory hierarchy
2. 创建目录层级
bash
mkdir -p exercises/01-section-name/01.01-exercise-name/problem
mkdir -p exercises/01-section-name/01.01-exercise-name/solutionbash
mkdir -p exercises/01-section-name/01.01-exercise-name/problem
mkdir -p exercises/01-section-name/01.01-exercise-name/solution3. Add stub readme files
3. 添加占位README文件
bash
undefinedbash
undefinedMinimum valid readme
Minimum valid readme
echo "# Exercise: Getting Started\n\nComplete the task described below." > exercises/01-section-name/01.01-exercise-name/problem/readme.md
undefinedecho "# Exercise: Getting Started\n\nComplete the task described below." > exercises/01-section-name/01.01-exercise-name/problem/readme.md
undefined4. Validate
4. 验证
bash
pnpm ai-hero-cli internal lintbash
pnpm ai-hero-cli internal lint5. Fix iteratively
5. 迭代修复
The linter checks:
- Exercises have appropriate subfolders
- Readmes are non-empty with titles
- No broken links
- No prohibited files (,
.gitkeep)speaker-notes.md
代码检查工具会验证以下内容:
- 练习包含合适的子目录
- README文件非空且包含标题
- 无无效链接
- 无禁用文件(、
.gitkeep)speaker-notes.md
Moving exercises
移动练习
Use (not ) to rename directories — preserves git history:
git mvmvbash
git mv exercises/01-old-name exercises/01-new-name使用(而非)重命名目录 — 可保留Git历史记录:
git mvmvbash
git mv exercises/01-old-name exercises/01-new-nameInstructions
操作指引
- Identify the task trigger and expected output.
- Follow the workflow steps in this skill from top to bottom.
- Validate outputs before moving to the next step.
- Capture blockers and fallback path if any step fails.
- 明确任务触发条件与预期输出。
- 按本技能中的工作流程步骤依次执行。
- 进入下一步前先验证输出结果。
- 记录执行过程中的障碍,以及步骤失败时的备选方案。
Examples
示例
- Example: Apply this skill to a small scope first, then scale to full scope after validation passes.
- 示例:先在小范围内应用本技能,验证通过后再扩展至完整范围。
Best practices
最佳实践
- Keep outputs deterministic and auditable.
- Prefer small reversible changes over broad risky edits.
- Record assumptions explicitly.
- 确保输出结果可预测、可追溯。
- 优先选择小幅度、可回滚的修改,而非大范围高风险的编辑。
- 明确记录所有假设条件。
References
参考资料
- Project standards:
.agent-skills/skill-standardization/SKILL.md - Validator script:
.agent-skills/skill-standardization/scripts/validate_skill.sh
- 项目标准:
.agent-skills/skill-standardization/SKILL.md - 验证脚本:
.agent-skills/skill-standardization/scripts/validate_skill.sh