Linus-Style Code Review

VerifiedCaution

Perform thorough code reviews in the style of Linus Torvalds, focusing on correctness, simplicity, maintainability, and adherence to project conventions. It analyzes files, directories, git diffs, or pull requests to identify critical bugs, code smells, and pattern violations. Use after completing implementation to ensure code quality before merging.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude CodeCursorWindsurf
#code-review#maintainability#correctness#simplicity#quality

Recommended for

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)
When to use it

Use after implementation and before merging a PR to ensure code quality.

When not to use it

Avoid for minor changes or during rapid prototyping where speed is prioritized over perfection.

Security analysis

Caution
Quality score90/100

The 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.

Findings
  • •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.
How this analysis is made

Examples

Review a single file
/sdd-review src/services/UserService.ts
Review a pull request
/sdd-review PR-123
Review a git diff range
/sdd-review HEAD~3..HEAD

name: 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:

  1. Correctness - Does it actually work? Does it handle edge cases?
  2. Simplicity - Is it more complex than necessary?
  3. Maintainability - Will future developers understand this?
  4. 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-123 or /sdd-review MR-45

Step 2: Load Project Context

Before reviewing:

  1. Read project steering documents from .spec/steering/
  2. Understand existing patterns in the codebase
  3. 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:

  1. Line 78: Magic number should be a named constant
  2. Line 103: Consider extracting this to a helper function

💡 Suggestions (Optional)

Improvements that would be nice but are truly optional:

  1. Line 156: This could be simplified with Array.flatMap()

✅ What's Good

Acknowledge good patterns to reinforce them:

  1. Good use of dependency injection
  2. Clear separation of concerns
  3. 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

  • any type 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:

  1. Compare against requirements in .spec/specs/{feature}/requirements.md
  2. Verify design patterns from .spec/specs/{feature}/design.md
  3. 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

  1. Line 89: Catch block swallows all errors
  2. 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 files

This 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.md

From 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 installation
openskills 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 sync

Manual 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.

Related skills