Agent skill

best-practices

Language-specific best practices, code quality standards, and framework detection rules. Use when executing refactoring workflows, applying code quality rules, detecting frameworks, or checking language-specific patterns for TypeScript, Python, Go, Swift, or React.

Stars 521
Forks 40

Install this agent skill to your Project

npx add-skill https://github.com/FradSer/dotclaude/tree/main/refactor/skills/best-practices

SKILL.md

Best Practices

Language References

Each file extension maps to a specific reference:

  • .ts, .jsreferences/typescript.md
  • .tsx, .jsxreferences/typescript.md + references/react/react.md
  • .pyreferences/python.md + references/python/INDEX.md
  • .goreferences/go.md
  • .swiftreferences/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)

Expand your agent's capabilities with these related and highly-rated skills.

FradSer/dotclaude

optimize-plugin

This skill should be used when the user asks to "validate a plugin", "optimize plugin", "check plugin quality", "review plugin structure", or "run plugin optimizer".

521 40
Explore
FradSer/dotclaude

plugin-best-practices

This skill should be used when the user asks to "validate plugin structure", "review manifest files", "check frontmatter compliance", "verify tool invocation patterns", "explain plugin component types", or needs Claude Code plugin architectural guidance.

521 40
Explore
FradSer/dotclaude

init-config

Generates a CLAUDE.md file with AI-driven environment detection and advanced configuration options. This skill should be used when the user asks to "initialize config", "setup claude config", "create CLAUDE.md", or needs help configuring project instructions.

521 40
Explore
FradSer/dotclaude

start-feature

Starts working on a new feature branch using git-flow. This skill should be used when the user asks to "start a feature", "create feature branch", "begin new feature", "git flow feature start", or wants to start a new feature.

521 40
Explore
FradSer/dotclaude

finish-feature

Finalizes and merges a feature branch into develop using git-flow. This skill should be used when the user asks to "finish a feature", "merge feature branch", "complete feature", "git flow feature finish", or wants to finalize a feature branch.

521 40
Explore
FradSer/dotclaude

finish-hotfix

Finalizes a hotfix and merges it into main and develop using git-flow. This skill should be used when the user asks to "finish a hotfix", "merge hotfix branch", "complete hotfix", "git flow hotfix finish", or wants to finalize a hotfix.

521 40
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results