mcpbeat

Common Best Practices

hoangnguyen0403/agent-skills-standard-common-best-practices

Enforce SOLID principles, guard-clause style, function size limits, and intention-revealing naming across all languages. Use when refactoring for readability, applying clean-code patterns, reviewing naming conventions, or reducing function complexity.

This is a copy. The original lives at hoangnguyen0403/common-best-practices.

1k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
536
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill common-best-practices

What comes with it

2 578 bytes besides the instruction
references/CODE_STRUCTURE.md
references/EFFECTIVENESS.md

The instruction itself

6 sections, as written by the author

Global Best Practices

Priority: P0 (CRITICAL)

Core Principles

  • SOLID: Follow SRP (One reason to change), OCP (Open to extension), LSP, ISP, DIP.
  • KISS/DRY/YAGNI: Favor readability. Abstract repeated logic. No " in case" code.
  • Naming: Use intention-revealing names (isUserAuthenticated > checkUser). Match language casing.

Code Hygiene

  • Size Limits: Functions < 30 lines. Services < 600 lines. Utils < 400 lines.
  • Early Returns: Use guard clauses. Avoid deep nesting.
  • Comments: Explain why, not what. Refactor bad code; don't comment it.
  • Input: Validate/sanitize all external inputs.

Anti-Patterns

  • No Hardcoded Constants: Use named config/env vars.
  • No Deep Nesting: Use guard clauses.
  • No Global State: Prefer dependency injection.
  • No Empty Catches: Always handle, log, or rethrow.

References

  • Code Structure Patterns — file/function organization
  • Effectiveness Guide — practical application examples

How to use it

Copy the folder

Take hoangnguyen0403/agent-skills-standard-common-best-practices from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.