code-style-review

A guide for recording an existing codebase’s naming, formatting, structure, and other coding conventions in a dated document.

In plain words
What is it for?
Use it when onboarding to an unfamiliar project, preparing to contribute, or creating shared style documentation for a team.
Why use it?
It helps new contributors understand how the project is written, including conventions that tools such as linters may not enforce.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/markerikson/opencode-config-example/code-style-review
Any agent
npx skills add markerikson/opencode-config-example --skill code-style-review
Clone the repo
git clone --depth 1 https://github.com/markerikson/opencode-config-example

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,508 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.01508
Opus 5 $0.00020 $0.00754
Sonnet 5 $0.00008 $0.00302
Haiku 4.5 $0.00004 $0.00151

Measured 2d ago against content hash ede5fc22abee, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-style-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

config/skill/code-style-review/SKILL.md · 326 lines

How it starts

The opening of the file, as written. The whole thing — 326 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Style Review Skill

Create code style documentation that captures coding conventions, patterns, and guidelines for an existing codebase.

When to Use This Skill

  • Onboarding to an unfamiliar codebase
  • Creating style documentation for team reference
  • Understanding patterns before contributing
  • Documenting conventions that aren't captured in linter configs

Don't use for:

  • High-level architecture (use architecture-review skill)
  • Planning new features (use feature-design skill)

File Location

Code style reviews live in the dev-plans repository:

dev-plans/
└── {project}/
    └── architecture/
        ├── YYYY-MM-DD-architecture.md
        └── YYYY-MM-DD-code-style.md

Naming: YYYY-MM-DD-code-style.md

Analysis Process

1. Gather Evidence

Before writing, examine:

Config files:

  • .eslintrc*, eslint.config.* - Linting rules
  • .prettierrc*, prettier.config.* - Formatting rules
  • tsconfig.json - TypeScript settings
  • biome.json, ruff.toml, etc. - Other linters/formatters

Sample code:

  • 3-5 core source files
  • 2-3 test files
  • Entry points and exports

Existing docs:

  • CONTRIBUTING.md
  • STYLE.md or similar
  • README sections on code style

2. Observe, Don't Prescribe

Document what IS, not what should be:

  • Note inconsistencies without judgment
  • Include examples from actual code
  • Reference file paths for patterns

Document Template

# Code Style: {Project Name}

**Analyzed:** YYYY-MM-DD
**Codebase:** {path or repo}

---

## Naming Conventions

### Files and Directories

[How are files named? kebab-case, camelCase, PascalCase?]

- Source files: `{pattern}` (e.g., `user-service.ts`)
- Test files: `{pattern}` (e.g., `user-service.test.ts`)
- Component files: `{pattern}` (if applicable)
- Directories: `{pattern}`

### Functions and Methods

[Naming patterns for functions]

```typescript
// Example from codebase

Classes and Types

[Naming patterns for classes, interfaces, types]

// Example from codebase

Variables and Constants

  • Variables: {pattern} (e.g., camelCase)
  • Constants: {pattern} (e.g., SCREAMING_SNAKE_CASE)
  • Private members: {pattern} (e.g., _prefixed or #private)

File Organization

Directory Structure Pattern

src/
├── {pattern}/     # {what goes here}
├── {pattern}/     # {what goes here}
└── {pattern}/     # {what goes here}

File Structure Pattern

[How are individual files typically organized?]

// 1. Imports (grouped how?)
// 2. Types/interfaces
// 3. Constants
// 4. Main exports
// 5. Helper functions

Module Boundaries

[How are modules separated? Barrel exports? Index files?]


Import Style

Grouping

[How are imports organized?]

// Example showing import organization

Preferred Patterns

  • Absolute vs relative imports: {pattern}
  • Barrel imports: {used/not used}
  • Type imports: {inline vs separate}

Code Patterns

Common Patterns

{Pattern Name}

Where used: {locations}

// Example from codebase
{Pattern Name}

Where used: {locations}

// Example from codebase

Async Patterns

[How is async code typically written?]

// Example

State Management (if applicable)

[Patterns for managing state]


Error Handling

Error Types

[What error types/classes are used?]

// Example

Throwing Errors

[Pattern for throwing errors]

Catching Errors

[Pattern for catching and handling errors]

Logging

[How is logging done? What levels? What format?]

// Example

Testing

Test File Location

  • Pattern: {where tests live}
  • Naming: {test file naming pattern}

Test Structure

// Example test structure from codebase

Mocking Patterns

[How are mocks typically done?]

What Gets Tested

[Unit tests? Integration tests? What's the focus?]


Tooling

Linter

  • Tool: {ESLint, Biome, etc.}
  • Config: {path to config}
  • Key rules: {notable enabled/disabled rules}

Formatter

  • Tool: {Prettier, Biome, etc.}
  • Config: {path to config}
  • Key settings: {tab width, quotes, etc.}

Type Checking

  • Config: {path to tsconfig}
  • Strictness: {strict mode? key compiler options}

Pre-commit

[Any pre-commit hooks? Husky? lint-staged?]


Do's and Don'ts

Do

  • [Pattern to follow]
  • [Pattern to follow]
  • [Pattern to follow]

Don't

  • [Anti-pattern to avoid]
  • [Anti-pattern to avoid]
  • [Anti-pattern to avoid]

Inconsistencies Noted

[Any inconsistencies observed in the codebase - not judgmental, just factual]

  • {inconsistency 1}
  • {inconsistency 2}

Read the full file on GitHub · 326 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 326 lines · 40 tokens per session scan A ede5fc22abee

Subscribe to this mod's changes

code-style-review is a skill published in the GitHub repository markerikson/opencode-config-example (44 stars, last pushed 3mo ago), licensed MIT. It adds 40 tokens to every session and 1,508 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens