No slash command · from junior-flow
Interactive learning module explaining why human code review remains essential even with 100% test coverage, covering test assertion quality, correctness verification, and maintainability.
Ships in junior-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This learning module helps junior developers understand why, as of today in 2026, human code review remains essential even when AI-generated code has 100% unit test coverage. Tests only verify code doesn't crash - humans must verify correctness, readability, and maintainability.
Present the following content interactively. After each section, use AskUserQuestion to offer 3 options:
Explain what test coverage measures and its limitations:
What 100% test coverage proves:
That's it. Coverage doesn't verify correctness - test assertions could be inadequate, wrong, or missing entirely.
What 100% test coverage does NOT prove:
The key insight:
Tests answer "Does it crash?" not necessarily "Does it work?" or "Is it good code?" All three questions matter.
Since 100% coverage only proves code doesn't crash, the test assertions themselves are critical - and they need human review.
// This test "passes" but proves nothing
test('should process order', () => {
const result = processOrder(mockOrder);
expect(result).toBeDefined(); // Weak assertion - just checks it exists
});
// This test passes but has wrong expectation
test('should calculate total', () => {
const total = calculateTotal([10, 20, 30]);
expect(total).toBe(50); // Wrong! Should be 60
});
// This test is missing assertions entirely
test('should update user', async () => {
await updateUser({ id: 1, name: 'John' });
// No assertions - test passes if it doesn't crash
});
All three tests pass. None prove correctness.
1. Are assertions actually verifying behavior?
expect(result).toBeDefined() - Too weakexpect(result).toBe(expectedValue) - Better2. Are assertions checking the right values?
3. Are critical assertions present?
4. Do assertions match requirements?
.toBeDefined())Present examples of working code that has readability issues:
// Passes tests but hard to understand
const d = new Date();
const t = d.getTime();
const x = t - (24 * 60 * 60 * 1000);
const r = items.filter(i => i.c > x);
// BETTER - Self-documenting
const now = new Date();
const currentTimestamp = now.getTime();
const oneDayAgo = currentTimestamp - (24 * 60 * 60 * 1000);
const recentItems = items.filter(item => item.createdAt > oneDayAgo);
Both pass the same tests. Only one is readable.
// Passes tests but requires mental parsing
return users.filter(u => u.a && u.r.includes('admin') && !u.d).map(u => ({...u, p: u.p.filter(p => p.e)}));
// BETTER - Step by step
const activeUsers = users.filter(user => user.isActive);
const adminUsers = activeUsers.filter(user => user.roles.includes('admin'));
const nonDeletedAdmins = adminUsers.filter(user => !user.isDeleted);
return nonDeletedAdmins.map(user => ({
...user,
permissions: user.permissions.filter(permission => permission.enabled)
}));
// Passes tests but meaning is unclear
if (status === 3 && retries < 5) {
setTimeout(retry, 30000);
}
// BETTER - Named constants explain intent
const STATUS_FAILED = 3;
const MAX_RETRIES = 5;
const RETRY_DELAY_MS = 30000;
if (status === STATUS_FAILED && retries < MAX_RETRIES) {
setTimeout(retry, RETRY_DELAY_MS);
}
Present examples of code that passes tests but will cause problems later:
// Passes tests but over-engineered for a simple task
interface ConfigurationStrategy {
getConfig(): Config;
}
class JsonConfigStrategy implements ConfigurationStrategy {
getConfig() { return JSON.parse(fs.readFileSync('config.json')); }
}
class ConfigFactory {
static create(type: string): ConfigurationStrategy {
if (type === 'json') return new JsonConfigStrategy();
throw new Error('Unknown type');
}
}
const config = ConfigFactory.create('json').getConfig();
// BETTER - Simple solution for simple problem
const config = JSON.parse(fs.readFileSync('config.json'));
// Passes tests but duplicates logic that should be shared
function validateUserEmail(email) {
return email.includes('@') && email.includes('.') && email.length > 5;
}
function validateContactEmail(email) {
return email.includes('@') && email.includes('.') && email.length > 5;
}
function validateNotificationEmail(email) {
return email.includes('@') && email.includes('.') && email.length > 5;
}
// BETTER - Single source of truth
function validateEmail(email) {
return email.includes('@') && email.includes('.') && email.length > 5;
}
// Passes tests but nesting makes flow hard to follow
function processOrder(order) {
if (order.status === 'pending') {
if (order.items.length > 0) {
if (order.payment) {
if (order.payment.verified) {
if (order.shipping) {
if (order.shipping.address) {
return fulfillOrder(order);
} else { return { error: 'No address' }; }
} else { return { error: 'No shipping' }; }
} else { return { error: 'Payment not verified' }; }
} else { return { error: 'No payment' }; }
} else { return { error: 'No items' }; }
} else { return { error: 'Not pending' }; }
}
// BETTER - Early returns flatten the logic
function processOrder(order) {
if (order.status !== 'pending') {
return { error: 'Not pending' };
}
if (order.items.length === 0) {
return { error: 'No items' };
}
if (!order.payment?.verified) {
return { error: 'Payment not verified' };
}
if (!order.shipping?.address) {
return { error: 'No shipping address' };
}
return fulfillOrder(order);
}
Explain patterns that AI might produce that pass tests but need human review:
AI sometimes generates more code than necessary because it's pattern-matching from training data rather than finding the simplest solution.
// AI might generate
const result = array.map(item => item).filter(item => item !== null).reduce((acc, item) => {
acc.push(item);
return acc;
}, []);
// Human reviewer suggests
const result = array.filter(item => item !== null);
AI chooses names that are accurate but not intuitive to the domain:
// AI-generated (technically accurate)
const temporalBoundaryCheck = date > startDate && date < endDate;
// Human-suggested (domain-intuitive)
const isWithinCampaignPeriod = date > campaignStart && date < campaignEnd;
AI might mix patterns from different sources:
// Inconsistent: mixes callback and promise styles
getData(id, (err, result) => {
if (err) throw err;
processResult(result).then(console.log);
});
// Consistent: uses one style throughout
const result = await getData(id);
const processed = await processResult(result);
console.log(processed);
Present the review perspective:
Before reading the code, confirm the tools are clean: lint, type check, complexity threshold, duplication (e.g. jscpd), unused exports (e.g. knip) and npm audit. Spend review time on what tools can't judge — the questions below.
Ask yourself:
Ask yourself:
Ask yourself:
Ask yourself:
Present this checklist for the developer to keep:
During implementation review, check:
Red flags to watch for:
During test review, check:
.toBeDefined())Remember:
100% coverage means the code ran. Review tells you both the code AND the tests are correct. You need both.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub intai/story-flow --plugin junior-flow3 skills in this plugin
/learn-bdd-scenariosLearn what defines effective BDD scenariosInteractive guidance on writing complete, effective BDD scenarios for story-flow./learn-technical-designLearn why to discuss technical design before implementationInteractive guidance on creating technical design PRs to align with your team before coding.Other plugins' skills for the same job