Automated summary
Performs a thorough code review inspired by Linus Torvalds' style, focusing on correctness, simplicity, maintainability, and adherence to project conventions.
Strengths
- Rigorous analysis of correctness and edge cases
- Structured feedback with clear severity levels
- Checks for simplicity and long-term maintainability
Limitations
- Requires specific context files (.spec/steering) for accurate assessment
- Direct tone may be perceived as harsh
- Not suitable for non-code changes (documentation, configuration)
Use after implementation and before merging a PR to ensure code quality.
Avoid for minor changes or during rapid prototyping where speed is prioritized over perfection.
Security analysis
CautionThe skill primarily provides a static review checklist but instructs running a shell command with `npm test`. While intended for legitimate testing, this introduces a risk if the project's test scripts are maliciously altered. No destructive or exfiltrating actions are explicitly instructed.
- •The skill includes a step to run tests using a bash command (`npm test`). This could allow execution of arbitrary code if the test scripts are compromised.
Examples
/sdd-review src/services/UserService.ts/sdd-review PR-123/sdd-review HEAD~3..HEADname: sdd-review description: Perform thorough Linus-style code review focusing on correctness, maintainability, and adherence to project conventions. Use after completing implementation to ensure code quality. Invoked via /sdd-review [file-path or PR-number].
SDD Code Review
Perform comprehensive code reviews in the style of Linus Torvalds - direct, thorough, and focused on what matters: correctness, simplicity, and long-term maintainability.
Review Philosophy
"Talk is cheap. Show me the code." — Linus Torvalds
This review focuses on:
- Correctness - Does it actually work? Does it handle edge cases?
- Simplicity - Is it more complex than necessary?
- Maintainability - Will future developers understand this?
- Convention Adherence - Does it follow project patterns?
Workflow
Step 1: Identify Review Scope
Determine what to review:
- Single file:
/sdd-review src/services/UserService.ts - Directory:
/sdd-review src/services/ - Git diff:
/sdd-review HEAD~3..HEAD - PR/MR:
/sdd-review PR-123or/sdd-review MR-45
Step 2: Load Project Context
Before reviewing:
- Read project steering documents from
.spec/steering/ - Understand existing patterns in the codebase
- Check if there's a related spec in
.spec/specs/
Step 3: Perform Review
Code Correctness Checks
## Correctness Issues
### Critical
- [ ] Logic errors that will cause bugs
- [ ] Race conditions or threading issues
- [ ] Resource leaks (files, connections, memory)
- [ ] Unhandled error conditions
### Important
- [ ] Edge cases not handled
- [ ] Assumptions that may not hold
- [ ] Off-by-one errors
- [ ] Type mismatches or unsafe casts
Simplicity Assessment
Ask these questions:
- Could this be done with less code?
- Is there a standard library function for this?
- Is this abstraction earning its keep?
- Would a junior developer understand this in 6 months?
Pattern Violations
Check against project conventions:
## Pattern Violations
### Naming
- [ ] Variables don't follow naming convention
- [ ] Functions named for implementation, not purpose
### Structure
- [ ] Logic in wrong layer (controller doing business logic)
- [ ] Missing separation of concerns
- [ ] Circular dependencies introduced
### Error Handling
- [ ] Swallowed exceptions
- [ ] Generic error messages
- [ ] Missing error propagation
Step 4: Provide Feedback
Structure feedback with clear categories:
# Code Review: {file/PR description}
## Summary
Brief overall assessment (1-2 sentences)
## 🚨 Must Fix (Blocking)
Issues that must be resolved before merge:
1. **Line 42**: Memory leak - connection never closed
```diff
- const conn = await getConnection();
+ const conn = await getConnection();
+ try { ... } finally { conn.close(); }
⚠️ Should Fix (Non-blocking)
Issues that should be addressed but won't block:
- Line 78: Magic number should be a named constant
- Line 103: Consider extracting this to a helper function
💡 Suggestions (Optional)
Improvements that would be nice but are truly optional:
- Line 156: This could be simplified with
Array.flatMap()
✅ What's Good
Acknowledge good patterns to reinforce them:
- Good use of dependency injection
- Clear separation of concerns
- Comprehensive error handling in auth module
### Step 5: Verify Tests
For any code changes:
1. Check if tests exist for modified code
2. Verify edge cases are tested
3. Run existing tests to ensure no regressions
```bash
# Run tests for affected files
npm test -- --findRelatedTests {changed-files}
Review Severity Levels
| Level | Meaning | Action Required | |-------|---------|-----------------| | 🚨 Critical | Bug, security issue, data loss risk | Must fix before merge | | ⚠️ Warning | Code smell, potential issue | Should fix, discuss if disagree | | 💡 Info | Suggestion, style preference | Optional, author's choice |
Common Issues to Watch For
TypeScript/JavaScript Specific
anytype usage without justification- Missing null/undefined checks
- Promises not awaited
- Event listener memory leaks
- Mutable shared state
General
- Functions doing too much
- Deep nesting (> 3 levels)
- Boolean parameters (use options object)
- Comments explaining what instead of why
- Dead code or unused imports
Integration with SDD Workflow
When reviewing implementation:
- Compare against requirements in
.spec/specs/{feature}/requirements.md - Verify design patterns from
.spec/specs/{feature}/design.md - Check task completion against
.spec/specs/{feature}/tasks.md
Example Review
# Code Review: UserAuthService.ts
## Summary
Good overall structure but has a critical security issue and some error handling gaps.
## 🚨 Must Fix
1. **Line 67**: Password stored in plain text in error log
```typescript
// BAD: Leaks credentials
logger.error(`Login failed for ${email} with password ${password}`);
// GOOD: Never log credentials
logger.error(`Login failed for ${email}`);
⚠️ Should Fix
- Line 89: Catch block swallows all errors
- Line 112-130: This block should be extracted to a private method
✅ What's Good
- Clean separation between auth logic and data access
- Good use of TypeScript discriminated unions for auth result
- Comprehensive input validation
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/linus-style-code-review-mm5t89f8' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/linus-style-code-review-mm5t89f8/download' --output '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md.part' && mv '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md.part' '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md' && test -s '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/sdd-review' && cp -R '.skill-downloads/linus-style-code-review-mm5t89f8' '.claude/skills/sdd-review'Cursor
test -f '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md' && test -s '.skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/sdd-review' && cp -R '.skill-downloads/linus-style-code-review-mm5t89f8' '.cursor/skills/sdd-review'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/linus-style-code-review-mm5t89f8'openskills read 'linus-style-code-review-mm5t89f8'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/linus-style-code-review-mm5t89f8/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.