best-practices

best-practices is a skill for Claude Code from FradSer/dotclaude. It costs 52 tokens per session (472 once invoked), scanned A, original, MIT.

A reference guide for applying code-quality rules to TypeScript, Python, Go, Swift, and React code. It also helps identify the project framework and choose relevant patterns.

In plain words
What is it for?
Use it during refactoring, code-quality checks, and framework detection. It covers type safety, error handling, comments, performance patterns, and unused code.
Why use it?
It reduces guesswork when reviewing or changing code across different languages and frameworks. It helps keep refactoring consistent while preserving existing behavior and public interfaces.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md.

Part of the refactor plugin — 3 skills, 1 agent shipped together

Good fit Use it during refactoring, code-quality checks, and framework detection. It covers type safety, error handling, comments, performance patterns, and unused code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fradser/dotclaude/best-practices
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.

Any agent
npx skills add FradSer/dotclaude --skill best-practices
Clone the repo
git clone --depth 1 https://github.com/FradSer/dotclaude

Made for: Claude Code.

Or install refactor, the plugin that ships this one along with the rest of its 3 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/fradser/dotclaude/best-practices/github.svg)](https://agentmods.dev/skills/fradser/dotclaude/best-practices)
Your own site
<a href="https://agentmods.dev/skills/fradser/dotclaude/best-practices"><img src="https://agentmods.dev/badge/skills/fradser/dotclaude/best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/fradser/dotclaude/best-practices"><img src="https://agentmods.dev/badge/skills/fradser/dotclaude/best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 472 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00052 $0.00472
Opus 5.5 $0.00021 $0.00189
Sonnet 5.5 $0.00010 $0.00094
Haiku 4.5 $0.00005 $0.00047

Measured 22d ago against content hash 916e5e40f9f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

best-practices 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 22d 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.

refactor/skills/best-practices/SKILL.md · 47 lines

What it actually says

Best Practices

Language References

Each file extension maps to a specific reference:

  • .ts, .js — references/typescript.md
  • .tsx, .jsx — references/typescript.md + references/react/react.md
  • .py — references/python.md + references/python/INDEX.md
  • .go — references/go.md
  • .swift — references/swift.md

Universal principles are in references/universal.md.

Next.js/React References

For Next.js projects, the references/react/ directory provides:

  1. references/react/rules/INDEX.md — pattern index by impact level
  2. references/react/rules/_sections.md — priorities and categories
  3. Specific rule files matching observed patterns

Rule Application

  • Framework-specific rules (e.g., Next.js) apply only when that framework is detected
  • CRITICAL rules have highest priority: waterfalls, bundle size, hydration
  • All refactoring MUST preserve behavior and public interfaces

Code Quality Standards

  • Comments: Only for complex business logic; code-restating comments are unnecessary
  • Error Handling: Try-catch only where recoverable; no defensive checks in trusted paths
  • Type Safety: No any; proper types or unknown with guards are required
  • Style: Existing code style and CLAUDE.md conventions take precedence
  • Cleanup: Unused imports, variables, functions, and types are removed
  • No compat hacks: Unused _vars and re-exports of deleted code are deleted
  • Renaming: Descriptive names are preferred over marking as unused
  • Dead code: Dead code is deleted, never commented out
  • File Organization: Single Responsibility applies at file level; files with multiple concerns are candidates for splitting (see references/universal.md)
Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 22d ago First seen · 47 lines · 52 tokens per session scan A 916e5e40f9f6

Subscribe to this mod's changes

best-practices is a skill published in the GitHub repository FradSer/dotclaude (593 stars, last pushed 7d ago), licensed MIT. It adds 52 tokens to every session and 472 once invoked, about $0.0002 per session on Opus 5.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-09-24.

Related

Other skills, from other repositories

splitting-oversized-modules

Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…

PostHog/posthog · 197 tokens

plankton-code-quality

Write-time code quality enforcement using Plankton — auto-formatting, linting, and Claude-powered fixes on every file edit via hooks.

loulanyue/awesome-claude-notes · 34 tokens

verify-language

Language-specific verification for Python, TypeScript/JavaScript, and Go. Checks type safety, language idioms, and best practices. Use when asked to "verify language", "check types", or for language-specific checks.

Aurite-ai/agent-verifier · 48 tokens

find-type-gaps

Identify functions, methods, and modules missing type annotations in gradually-typed languages (Python, TypeScript, JavaScript), ranked by public visibility and churn.

tomzx/agents · 36 tokens

kieran-python-reviewer

Reviews Python code with an extremely high quality bar for Pythonic patterns, type safety, and maintainability. Use after implementing features, modifying code, or creating new Python modules.

gvkhosla/compound-engineering-pi · 41 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens