best-practices
Skill1 starsChanged 9 months agoMITView on GitHub
Enforces software design principles including separation of concerns, error handling patterns, thread safety, and code quality standards. Use when writing new code, reviewing patterns, or making design decisions.
20 other projects use a version of this.
Adopted by
Most recently taken up by
- jscraik/Agent-Skillstheir own version, first seen Sep 27, 2026
- sd0xdev/sd0x-harnesstheir own version, first seen Sep 26, 2026
- PracticalSwan/agent-skillstheir own version, first seen Sep 14, 2026
- vinta/hal-9000their own version, first seen Sep 12, 2026
- RealDougEubanks/ClaudeMarketplacetheir own version, first seen Sep 10, 2026
- addyosmani/web-quality-skillstheir own version, first seen Aug 24, 2026
Used with
Projects with it also use web-quality-audit, core-web-vitals and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
RodrigoTomeESSkillweb-quality-audit
Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".
Also in 5 projects that use this
thisisAhsanIqbalSkillcore-web-vitals
Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.
Also in 5 projects that use this
pluginagentmarketplaceSkillperformance
Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.
Also in 5 projects that use this
iamladiSkillseo
Comprehensive programmatic SEO (pSEO) skill for auditing, architecting, and scaling to 100k+ pages. Covers metadata, schemas, internal linking, content strategy, and Core Web Vitals. Use when planning or auditing SEO at scale.
Also in 4 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 5 projects that use this
VercelSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
Also in 3 projects that use this
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- addyosmani/web-quality-skills★ 2.9ksame name
- MoizIbnYousaf/ai-agent-skills★ 1.1ksame name
- sd0xdev/sd0x-harness★ 191same name
- vinta/hal-9000★ 138same name
- acedergren/oci-agent-skills★ 21same name
- PracticalSwan/agent-skills★ 18same name
- RodrigoTomeES/getmcp★ 13same name
- jscraik/Agent-Skills★ 9same name
- kpbray/power-bi-agent-skills★ 9same name
- officialunofficial/skills★ 7same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository48 other files it gives its agents.
- accessibilitySkill
- api-designSkill
- api-integrationSkill
- architectSkill
- async-patternsSkill
- bugSkill
- buildSkill
- cachingSkill
- ci-cdSkill
- config-managementSkill
- containerizeSkill
- database-designSkill
- data-modelingSkill
- data-pipelineSkill
- debug-latencySkill
- dependency-updateSkill
- deploySkill
- dev-setupSkill
- docsSkill
- error-handlingSkill
- estimateSkill
- feature-flag-opsSkill
- git-recoverySkill
- i18nSkill
- iacSkill
- incidentSkill
- load-testingSkill
- loggingSkill
- migrateSkill
- monitoringSkill
- observability-debugSkill
- onboardSkill
- perfSkill
- phase-gateSkill
- pr-authorSkill
- qaSkill
- refactorSkill
- reviewSkill
- rollbackSkill
- schema-evolutionSkill
- scope-checkSkill
- security-auditSkill
- state-managementSkill
- tech-debtSkill
- tech-stackSkill
- telemetrySkill
- testingSkill
- workflowSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
Never swallow exceptions: If you catch it, log it or propagate it.
- Distinctive: line 46
Validate at boundaries, trust internally: Don't re-validate inside every function - validate once at the system edge.
- Distinctive: line 84
YAGNI: - Don't build for hypothetical requirements.
- Distinctive: line 87
No magic: - Avoid implicit behavior, hidden side effects, action at a distance.
- Distinctive: line 107
Fewer is better: Every dependency is code you don't control that can break, have vulnerabilities, or go unmaintained.
- Distinctive: line 110
Wrap third-party interfaces: Don't spread a library's API throughout your codebase.
“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Best Practices
These are principles, not rules. Apply judgment. The goal is code that is correct, maintainable, and simple - in that order.
Separation of Concerns
Each module/class has one job. Common layer boundaries:
Presentation - HOW things look (UI, API responses, formatting)
Business Logic - WHAT happens (rules, calculations, workflows)
Data Access - WHERE data lives (DB, APIs, files, cache)
Infrastructure - HOW systems connect (config, logging, auth, messaging)The dependency rule: Dependencies point inward. Business logic never imports presentation or infrastructure. Data access doesn't know about UI. Inner layers define interfaces; outer layers implement them.
Signs of leaking concerns:
- UI component makes direct database calls
- Business logic formats error messages for display
- Data layer catches and handles business exceptions
- Controller contains calculation logic
Error Handling
Where to Handle Errors
Handle errors at the level where you have enough context to do something useful. Not lower (you don't know the intent). Not higher (you've lost the details).
| Level | Responsibility |
| Boundary (user input, external API) | Validate, reject bad input early, return clear errors |
| Service (business logic) | Catch domain-specific failures, apply business rules for fallbacks |
| Infrastructure (DB, network, filesystem) | Retry transient failures, convert to domain errors, never leak implementation details |
Error Handling Rules
- Never swallow exceptions. If you catch it, log it or propagate it. Silent failures are the worst bugs.
- Distinguish recoverable from fatal. Transient network error → retry. Corrupt data → crash with clear message.
- Validate at boundaries, trust internally. Don't re-validate inside every function - validate once at the system edge.
- Use typed errors where the language supports it. Avoid stringly-typed error checking (
if err.message.includes("not found")). - Error messages for two audiences: users get actionable guidance, developers get diagnostic details (in logs).
Hot Path Performance
For code that runs frequently (request handlers, event loops, inner loops):
| DO | DON'T |
| Pre-allocate buffers and collections | Allocate in tight loops |
| Use efficient data structures for the access pattern | Use a list when you need a map |
| Batch I/O and network operations | Make one call per item |
| Cache expensive computations | Recompute on every access |
| Profile before optimizing | Guess at bottlenecks |
The rest of the code: Optimize for readability, not speed. Premature optimization makes code harder to change.
Thread Safety
- Minimize shared mutable state. The safest shared state is no shared state.
- When sharing is necessary, use the simplest correct mechanism: atomic > lock > mutex > channel.
- Document ownership. Which thread/process owns which state? Is this object safe to share?
- Prefer message passing over shared memory when architecturally appropriate.
- Never hold a lock while doing I/O. Hold locks for the minimum duration.
Common Concurrency Bugs
| Bug | Pattern | Prevention |
| Race condition | Read-modify-write without lock | Atomic operations or mutex |
| Deadlock | Lock A then B in one thread, B then A in another | Consistent lock ordering |
| Lost update | Two threads read same value, both write | Compare-and-swap or serialized access |
| Stale read | Cached value not invalidated | Volatile/atomic read, or invalidation protocol |
Code Quality Principles
- Clarity over cleverness - Code is read 10x more than written. Optimize for the reader.
- YAGNI - Don't build for hypothetical requirements. Build what's needed now.
- Minimal surface area - Expose only what consumers need. Keep internals private.
- Fail fast - Detect and report errors close to the source. Don't propagate bad state.
- No magic - Avoid implicit behavior, hidden side effects, action at a distance. Make code discoverable.
- Delete aggressively - Dead code, unused abstractions, stale comments - remove them. Version control remembers.
Naming
Good names eliminate the need for comments.
| Entity | Convention | Example |
| Boolean | Question it answers | isValid, hasPermission, canRetry |
| Function | Verb phrase for what it does | calculateTotal, fetchUser, validateInput |
| Collection | Plural noun | users, orderItems, pendingTasks |
| Predicate | is/has/can/should prefix | isExpired(), hasChildren() |
| Factory | create/build/make prefix | createConnection(), buildQuery() |
| Converter | to/from pattern | toJSON(), fromDTO() |
Avoid: generic names (data, info, temp, result, handle), abbreviations (mgr, ctx, impl), and type-in-name (userList, nameString).
Dependencies
- Fewer is better. Every dependency is code you don't control that can break, have vulnerabilities, or go unmaintained.
- Evaluate before adding: How active is the maintainer? How many transitive deps? Could you write the 20 lines yourself?
- Pin versions in production. Use lockfiles. Update deliberately, not automatically.
- Wrap third-party interfaces. Don't spread a library's API throughout your codebase. One adapter module makes it replaceable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

