Skip to content
Back to skills

Review Code Style

ASecurity

Use when checking adherence to project conventions — import order, naming, TypeScript patterns, React idioms, file organization, over-commenting. Not formatting (use a linter).

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentstypescriptgoreactgitapidatabasesecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add forbee-dev/ForgeBee --skill review-code-style --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review Code Style?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Review Code Style
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/forbee-dev-review-code-style/badge)](https://www.skillsdirectory.com/skills/forbee-dev-review-code-style)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: review-code-style
description: Use when checking adherence to project conventions — import order, naming, TypeScript patterns, React idioms, file organization, over-commenting. Not formatting (use a linter).
context: fork
version: 1.1.0
---

Review changed code for consistency with the project's own conventions. Focus on patterns that affect maintainability.

> Read `${CLAUDE_PLUGIN_ROOT}/skills/_review-finding-contract.md` first. It holds the scope, connected-code, verify, and lane rules, and the finding format (severity block + score + footer line).

## Use When
- Changed code needs a convention check: import order, naming, type patterns, comments.
- Linting passes, but the team wants a consistency check that tools do not catch.

## Steps

1. Run the project linter and type checker on affected files (`npm run lint`, `composer lint`, `tsc --noEmit`). Report results.
2. Detect the stack: read `package.json`, `tsconfig.json`, `.eslintrc*`, `composer.json`, `pyproject.toml`, `go.mod`.
3. Read 2–3 existing files near the diff to learn the project's own conventions.
4. The checks below assume TypeScript/React. For another stack, apply the analogous rule and skip the rest. Do not flag a TS/React idiom in a non-TS/React project.

## Convention Checks

### Imports
- Cross-directory imports use the configured path alias, not deep relative paths.
- Order: framework, third-party, internal, types.
- Framework directives (`'use client'`) at the top of the file.

### Types
- No untyped `any`. Use a real type or `unknown` with a guard.
- `interface` for object shapes, `type` for unions.
- Database entities use generated or shared types, not hand-rolled interfaces.
- Exported functions declare return types.

### Naming
- Files, components, functions, constants, and DB columns follow the casing the project already uses.
- Booleans start with `is`, `has`, `should`, or `can`.

### Framework Patterns
- Server components by default where the framework supports them.
- React hook dependency arrays are complete.

### Organization
- Functions over ~50 lines or components over ~200 lines: suggest extraction.
- No commented-out code, unused imports, or unreachable branches.

### Comments (P7 — Lean Output)
- **WHAT-comment** that restates the next line (`// increment counter` above `count++`): Low.
- **Docblock that restates the name or types** (`@param {string} name - The name` on a typed param, "This function gets the user"): Low. Medium when repeated across the diff.
- **Changelog, ticket, author, or "added/updated by" notes in code**: Medium. Git keeps history.
- **Prose docblock paragraphs** where the standard asks only for a summary line and typed tags: Low.
- Do not flag docblocks that the project linter requires (WPCS file/class/function docblocks). Flag only the padding inside them.
- The fix is always deletion or a shorter line. Write the replacement.

## Output Format

Four contract lines plus `Convention:`:
```
[Critical|High|Medium|Low] <title>
File: <path>:<line>
Issue: <what is wrong, concretely>
Fix: <specific change>
Convention: <which project convention is violated>
```

Most style findings are Medium or Low. Use Critical or High only for real correctness or security risk, so a pure style pass rarely blocks.

## Example

```
[High] `any` masks an unchecked external response shape
File: src/api/client.ts:18
Issue: `const data: any = await res.json()` then reads `data.user.id`. A malformed response passes type checks and crashes at runtime.
Fix: Type the response and narrow with a guard, or parse with the project's schema validator.
Convention: no `any` on external boundaries.

[Low] Docblock restates typed params
File: src/lib/price.ts:3
Issue: `@param {number} amount - The amount` repeats the TypeScript signature.
Fix: Delete the docblock, or keep one line for the rounding rule.
Convention: P7 — JSDoc only for what types do not say.
```

End with a one-line consistency summary, then the score and footer line from the shared contract.

## Never
- Enforce a rule that contradicts the project's existing conventions.
- Report a style issue the diff does not cause.
- Rank style above correctness.

## Communication
On a team, report: violations found, cross-file patterns, overall style health.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.