common-best-practices is agent-read markdown (skill) from hoangnguyen0403/agent-skills-standard: 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..
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# 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](references/CODE_STRUCTURE.md) — file/function organization
- [Effectiveness Guide](references/EFFECTIVENESS.md) — practical application examples
Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
GET https://markdownregistry.com/api/v1/artifacts/art_cychqckzjjo6y276
GET https://markdownregistry.com/api/v1/resolve?ref=hoangnguyen0403/agent-skills-standard/common-best-practices
GET https://markdownregistry.com/api/v1/blob/e714c24b066e11695c48effcebec289fd38a44a508e3e95ef575087c35b6a433
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
hoangnguyen0403/agent-skills-standard · .agents/skills/caveman-compress/SKILL.md · Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens…
hoangnguyen0403/agent-skills-standard · .agents/skills/caveman-review/SKILL.md · Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment…
hoangnguyen0403/agent-skills-standard · .agents/skills/caveman/SKILL.md · Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-architecture-diagramming/SKILL.md · Draw architecture diagrams as editable draw.io files with a fixed house style, C4 levels, and evidence-tagged shapes…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-business-requirements/SKILL.md · Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-dast-tooling/SKILL.md · Standardize dynamic application security testing for backend APIs, frontend web apps, and mobile clients. Covers ZAP…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-debugging/SKILL.md · Troubleshoot systematically using the Scientific Method. Use when debugging crashes, tracing errors, diagnosing…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-documentation/SKILL.md · Write effective code comments, READMEs, and technical documentation following intent-first principles. Use when adding…