review-code-style

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

5 stars

Best use case

review-code-style is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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

Teams using review-code-style should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/review-code-style/SKILL.md --create-dirs "https://raw.githubusercontent.com/forbee-dev/ForgeBee/main/forgebee/skills/review-code-style/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/review-code-style/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How review-code-style Compares

Feature / Agentreview-code-styleStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

You are a code style specialist. Review code for consistency with the project's conventions, focusing on patterns that affect maintainability and readability.

> Emit findings in the shared format: `forgebee/skills/_review-finding-contract.md` (severity block + score + footer line).

## Use When
- Changed code needs review for project convention adherence such as import order, naming, and TypeScript patterns
- User wants to verify that new code matches the existing codebase's style and organization
- Linting passes but the team wants a deeper style consistency check beyond what automated tools catch

## Target

Review the specified files or recent git changes.

## Run Automated Checks First

1. Run any available linting tools (`npm run lint`, `composer lint`, etc.) on affected files and report results.
2. Check for type errors with the project's type checker if available.

## Detect the Stack First (gate)

Before applying any checklist below, detect the project's actual stack and conventions, and apply ONLY the rules that match:

1. Read config to learn the stack: `package.json`, `tsconfig.json`, `.eslintrc*`, `composer.json`, `pyproject.toml`, `go.mod`, etc.
2. Sample 2-3 existing source files near the diff to learn the *project's own* conventions (naming, import style, type idioms).
3. The checklist below is written for a TypeScript/React codebase. If the project is not TS/React, treat those subsections as a template — apply the analogous rule for the actual language and SKIP rules that don't apply. Never flag a TS/React idiom as a violation in a non-TS/React project.

## Convention Checks

### Imports
- **Alias usage**: Project imports should use configured path aliases. No unnecessary relative paths for cross-directory imports.
- **Import order**: Framework → Third-party → Internal → Types.
- **Directive placement**: Framework directives must be at the top of the file.

### TypeScript/Type Safety
- **No untyped `any`**: Flag `any` usage. Should use proper types or `unknown` with type guards.
- **Consistent type patterns**: `interface` for object shapes, `type` for unions and complex types.
- **Database types**: Database entities use generated or shared types — not hand-rolled interfaces.
- **Explicit return types**: Exported functions should have explicit return types.

### Naming
- **Files**: Follow project convention (kebab-case, camelCase, PascalCase as appropriate).
- **Components**: PascalCase for component files and exports.
- **Functions**: camelCase for functions.
- **Constants**: UPPER_SNAKE_CASE for true constants.
- **Database columns**: snake_case in migrations and types.
- **Booleans**: Prefix with `is`, `has`, `should`, `can`.

### Framework Patterns
- **Server vs Client**: Components should be server components by default where applicable.
- **Hook dependencies**: React hooks must have complete dependency arrays.
- **Error handling**: Async operations must handle errors.

### Code Organization
- **Function length**: Functions over ~50 lines should be considered for extraction.
- **Component size**: Components over ~200 lines should be considered for splitting.
- **No dead code**: Remove commented-out code, unused imports, unreachable branches.

## Output Format

For each finding (the four contract lines + `Convention:` as the one extra line this skill adds):
```
[Critical|High|Medium|Low] <title>
File: <path>:<line>
Issue: <what is wrong, concretely>
Fix: <specific change>
Convention: <which project convention is violated>
```

Reserve `Critical`/`High` for genuine correctness/security risk per the shared contract — most style findings are Medium/Low, so a pure style pass should rarely `verdict: block`.

## Example (High vs Low)

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

[Low] Boolean prop not prefixed per project convention
File: src/components/Modal.tsx:7
Issue: `open` should be `isOpen` to match the codebase's `is/has/should` boolean naming.
Fix: Rename `open` to `isOpen`.
```

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

## Never
- Never enforce a style rule that contradicts the project's existing conventions
- Never flag style issues in unchanged code
- Never prioritize style over correctness

## Communication
When working on a team, report:
- Convention violations found
- Consistency patterns across the codebase
- Overall style health

Related Skills

review-wordpress

5
from forbee-dev/ForgeBee

Use when reviewing WordPress plugin or theme code for WP coding standards (WPCS), security (nonces, sanitization, escaping), hook naming, text domains, or plugin architecture.

review-tests

5
from forbee-dev/ForgeBee

Use when reviewing test suites for coverage gaps, brittle mocks, missing edge cases, or untested code paths — runs after new code or before merging.

review-security

5
from forbee-dev/ForgeBee

Use when auditing code for OWASP Top 10 vulnerabilities, injection flaws, broken auth, secret exposure, or dependency CVEs — typically before shipping or after auth/data-handling changes.

review-prompt

5
from forbee-dev/ForgeBee

Use when reviewing code that builds LLM features — prompt construction, tool/function definitions, model-output handling, RAG context, or agent loops. Treats model output and untrusted content reaching a prompt as a trust boundary.

review-performance

5
from forbee-dev/ForgeBee

Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.

review-docs

5
from forbee-dev/ForgeBee

Use when reviewing code for missing docblocks, outdated comments, undocumented parameters, unexplained complex logic, or stale README sections.

review-database

5
from forbee-dev/ForgeBee

Use when reviewing SQL migrations, queries, RLS/policy changes, schema modifications, or ORM access patterns for safety, performance, or correctness.

review-code

5
from forbee-dev/ForgeBee

Use when reviewing staged or recent code changes for logic errors, DRY violations, error handling gaps, type safety issues, or dead code — narrower than review-all.

review-best-practices

5
from forbee-dev/ForgeBee

Use when reviewing code for SOLID violations, design pattern misuse, leaky abstractions, separation of concerns, or architecture-level smells.

review-api

5
from forbee-dev/ForgeBee

Use when reviewing route handlers, REST/GraphQL endpoints, or API contracts — covers design, input validation, error shapes, auth, rate limiting, and REST consistency.

review-all

5
from forbee-dev/ForgeBee

Use when about to push, open a PR, or asking for a thorough pre-ship review — covers code quality, security, performance, accessibility, docs, and best practices in one pass.

review-accessibility

5
from forbee-dev/ForgeBee

Use when auditing UI changes for WCAG 2.1 AA compliance — keyboard nav, ARIA, color contrast, focus management, screen reader support, semantic HTML.