Lesson 5: Case Study: Building a Code Review Skill
Learning goals:
- Learn how to organize a multi-step workflow
- Understand how the checklist pattern applies
- Get comfortable using supporting files
- Build one complex Skill that's ready for real use
Prerequisites: << Lesson 4 | Next: Lesson 6 >>
Why Code Review Makes a Good Case Study
Code review is a textbook structured workflow:1
- The steps are fixed: check conventions, look for problems, propose changes
- The standards are measurable: every check item either passes or it doesn't
- It repeats constantly: every PR needs one
- It suits a Skill: write your team's review standards into a Skill and every review holds the same bar
This case study shows you:
- How to break a complex workflow into clear steps
- How to organize instructions around a checklist
- How to handle several output dimensions at once
Step 1: Define the Review Scope
Before writing anything, decide what this Skill is responsible for checking.
Our code review Skill covers three dimensions:
- Conventions: naming, formatting, comments
- Potential problems: error handling, edge cases, security risk
- Maintainability: duplicated code, function length, logical complexity
What it deliberately doesn't check:
- Whether the business logic is actually correct (that needs real knowledge of the requirements)
- Algorithmic efficiency (that needs performance testing)
- UI/UX design (out of scope for code review)
Step 2: Create the Directory Structure
This time we'll use supporting files to organize the review rules:2
Why split the files:
- SKILL.md stays short and holds only the core flow
- The detailed check rules live in separate files, loaded on demand2
- Your team can maintain each checklist independently without touching the main file
Step 3: Write the Main SKILL.md
Step 4: Write the Supporting Files
checklists/naming.md:
checklists/error-handling.md:
Step 5: Test a Messy Case
Prepare a snippet with several problems in it:
Invoke the Skill:
The output should include:
- ⚠️ Naming:
process, data, x, and y are all too generic
- ⚠️ Uses
var instead of const/let
- ⚠️ Uses
== instead of ===
- ⚠️ Never checks whether
data is null or not an array
- ⚠️ Never checks whether
item.value exists
- Suggestion: the function can be split into smaller pure functions
Step 6: Iterate
What the first run tends to surface:
- Misses (real problems it didn't catch) → add check rules
- Output too long → tighten the output format so it reports only what matters
- False positives (normal code flagged as a problem) → add a "needs confirmation" category
Keep improving it:
- After each review, note which problems slipped past
- Update the checklists
- Test again
- A month in, the Skill gets genuinely accurate.3
Recap
- Code review is a natural fit for a Skill: fixed steps, measurable standards, high repetition
- Organize the flow as a checklist: conventions, error handling, potential problems, maintainability
- Supporting files keep the Skill maintainable: the main file stays short, detailed rules live on their own
- Grading the output matters: passed, worth a look, must fix — so the reviewer knows what to do first
- Keep iterating: add the checks you missed after each review, and a month in it'll be accurate
In the next lesson we move on to advanced patterns: personal versus project skills, version control, and team collaboration.
Lesson 6 >>