code-quality
Skill20 starsChanged 7 months agoMITView on GitHub
Apply when writing or refactoring code. Generic rules to prevent the most common review comments — function length, naming, error handling, security, and tooling.
38 other projects use a version of this.
Adopted by
Most recently taken up by
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- hodstack/hodstacktheir own version, first seen Oct 1, 2026
- AhmedAbdelfattah0/AI-Skillstheir own version, first seen Sep 28, 2026
- notque/vexjoy-agenttheir own version, first seen Sep 26, 2026
- yogvidwankhede/vishwakarmatheir own version, first seen Sep 26, 2026
- mthines/agent-skillstheir own version, first seen Sep 25, 2026
Used with
Projects with it also use spring-boot, design-patterns and 6 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.
MindrallySkillspring-boot
Expert guidance for Spring Boot application development with best practices for RESTful APIs, testing, security, and deployment
Also in 3 projects that use this
ratacatSkilldesign-patterns
Use when designing software architecture, refactoring code structure, solving recurring design problems, or when code exhibits symptoms like tight coupling, rigid hierarchies, scattered responsibilities, or difficult-to-test components. Also use when choosing between architectural approaches or reviewing code for structural improvements.
Also in 3 projects that use this
0xSeroSkillsecurity
Also in 4 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 3 projects that use this
NVIDIASkilltesting
Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.
Also in 3 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
Other versions38 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 38
- piomin/claude-ai-spring-boot★ 1.3ksame name
- microsoft/winappCli★ 1.3ksame name
- waybarrios/opencode-power-pack★ 531same name
- notque/vexjoy-agent★ 424same name
- instructa/agent-skills★ 139same name
- hodstack/hodstack★ 70same name
- fagemx/edda★ 36same name
- georgekhananaev/claude-skills-vault★ 28same name
- PracticalSwan/agent-skills★ 18same name
- mindfortai/security-skills★ 16same name
28 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 repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/brainstorming.mdcCursor rule
- .cursor/rules/branch-finishing.mdcCursor rule
- .cursor/rules/code-quality.mdcCursor rule
- .cursor/rules/db-schema.mdcCursor rule
- .cursor/rules/debugging.mdcCursor rule
- .cursor/rules/docker.mdcCursor rule
- .cursor/rules/domain-template.mdcCursor rule
- .cursor/rules/drawio.mdcCursor rule
- .cursor/rules/error-log.mdcCursor rule
- .cursor/rules/fastapi.mdcCursor rule
- .cursor/rules/git-conventions.mdcCursor rule
- .cursor/rules/github-cli.mdcCursor rule
- .cursor/rules/implementation-plan.mdcCursor rule
- .cursor/rules/langchain.mdcCursor rule
- .cursor/rules/python.mdcCursor rule
- .cursor/rules/react.mdcCursor rule
- .cursor/rules/review-deployment.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/self-extension-workflow.mdcCursor rule
- .cursor/rules/shell-scripting.mdcCursor rule
- .cursor/rules/svg-check.mdcCursor rule
- .cursor/rules/tdd.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
- skill-everythingSkill
- brainstormingSkill
- branch-finishingSkill
- db-schemaSkill
- debuggingSkill
- dockerSkill
- domain-templateSkill
- drawioSkill
- error-logSkill
- fastapiSkill
- git-conventionsSkill
- github-cliSkill
- implementation-planSkill
- langchainSkill
- pythonSkill
- reactSkill
- review-deploymentSkill
- security-reviewSkill
- self-extension-workflowSkill
- shell-scriptingSkill
- svg-checkSkill
- tddSkill
- <kebab-case-name>Skill
- typescriptSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 37 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Where these rules don't strictly apply: test fixtures, generated code (parser tables, codegen output, schema-derived types), CLI bootstrap …
- Distinctive: line 52
SHOULD: Use exponential backoff with jitter for retry logic: Never retry in a tight loop.
- Very specific: line 58
SHOULD: No circular imports: When in doubt: run madge --circular src/.
- Very specific: line 60
MUST: Remove
console.logbefore commit: Use a pre-commit hook or linter rule no-console. - Distinctive: line 64
MUST: Every new function needs at least one happy-path test: No merge without test coverage for new logic.
- Very specific: line 68
MUST: No DB queries in loops (N+1 problem): Instead of for (item of items) { await db.find(item.id) } → use a JOIN or WHERE id IN (...) …
- Very specific: line 69
MUST: Paginate large datasets: Never SELECT * FROM table without LIMIT.
- Very specific: line 70
SHOULD: New
WHEREclauses need indexes: Before every new query: is there a matching DB index? - Distinctive: line 75
MUST: Never use user input directly in queries: Always use prepared statements or ORM query builders.
- Distinctive: line 76
MUST: New API endpoints need auth: No endpoint without authentication and authorization — not even "internal" endpoints.
- Distinctive: line 77
MUST: Never put secrets in code: No API keys, passwords, or tokens in source code or comments.
“Common” is measured: kept by at least 6 in 10 of the 37 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
Sub-Skill: Code Quality & Common Mistakes
<!-- target: ~1800 tokens (real tiktoken count, see tools/render_readme_table.py) | 28 rules with severity classification -->Purpose: Prevents the 20 % of mistakes that cause 80 % of review comments. Concrete rules from real projects — no boilerplate.
Rule classification
- MUST — load-bearing. Violating causes bugs, security issues, or cross-team confusion. Never break.
- SHOULD — default behavior. Deviation needs a documented reason in the code or PR.
- AVOID — usually wrong; documented exception inline where needed.
Where these rules don't strictly apply: test fixtures, generated code (parser tables, codegen output, schema-derived types), CLI bootstrap scripts, framework adapters, and migration scripts may legitimately differ. The rules below apply to production code paths unless an inline exception says otherwise.
Rules
Functions & Logic
- SHOULD: Functions under ~30 lines. Longer → split where practical. Reduces cognitive load.
- AVOID: Boolean as last argument.
render(true)is unreadable. Use enum or named-property:render({ withHeader: true }). - SHOULD: Early return over nested if-blocks. Nesting depth > 2 is a warning sign.
- SHOULD: No magic numbers.
if (status === 3)→if (status === OrderStatus.SHIPPED). - AVOID: Double negation.
if (!isNotValid)→if (isValid).
Variables & Naming
- SHOULD: Variable names describe content, not type.
userListinstead ofarr,activeUserIdinstead ofid. - SHOULD: Temporary variables for complex expressions.
const isEligible = age >= 18 && !isBanned;instead of cramming it all into anif. - AVOID: Abbreviations except established ones (
id,url,ctx,req,res).usr,cfg,tmp→ spell out.
Error Handling
- MUST: Every
asynccall needstry/catchor.catch(). Unhandled promise rejections crash Node processes. - MUST: Never silently swallow error objects.
catch (e) {}is forbidden. At minimum:logger.warn(e). - MUST: Error messages must include context.
throw new Error('User not found: ' + userId)notthrow new Error('Not found'). - SHOULD: Catch specific exception types, not broad categories. Catch
ConnectionErrornotException. Broad catches mask unrelated bugs and make debugging harder. - SHOULD: Use exponential backoff with jitter for retry logic. Never retry in a tight loop. Each retry should wait longer than the last with randomization to prevent thundering herds.
- MUST: Never retry non-idempotent operations without explicit safeguards. A retried POST that creates a resource can produce duplicates. Use idempotency keys or check-before-retry patterns.
- SHOULD: Propagate errors with context rather than swallowing and re-raising generic exceptions. Use
raise NewError("context") from original_errorto preserve the chain. Reference: ERR-2026-016.
Imports & Dependencies
- SHOULD: No circular imports. When in doubt: run
madge --circular src/. - SHOULD: External dependencies only in dedicated adapter files. No direct
axios.get()in business logic — always wrap through an interface. - MUST: Remove
console.logbefore commit. Use a pre-commit hook or linter ruleno-console. Exception: debug helpers behind a build-time__DEV__flag.
Tests
- MUST: Every new function needs at least one happy-path test. No merge without test coverage for new logic. Exception: pure projection wrappers, single-line getters, and deprecated shims may rely on integration tests.
Performance
- MUST: No DB queries in loops (N+1 problem). Instead of
for (item of items) { await db.find(item.id) }→ use a JOIN orWHERE id IN (...)query. - MUST: Paginate large datasets. Never
SELECT * FROM tablewithoutLIMIT. API endpoints with lists need?page=and?limit=. - SHOULD: New
WHEREclauses need indexes. Before every new query: is there a matching DB index? Without index → full table scan on growing data. - SHOULD: Lazy loading for heavy operations. Load data only when needed, not "just in case".
Security
- MUST: Never use user input directly in queries. Always use prepared statements or ORM query builders. Applies to SQL, NoSQL, shell commands, and template engines.
- MUST: New API endpoints need auth. No endpoint without authentication and authorization — not even "internal" endpoints. Exception: documented public-asset / health-check routes that explicitly opt out in code comments.
- MUST: Never put secrets in code. No API keys, passwords, or tokens in source code or comments. Always use environment variables.
- MUST: Validate and sanitize user input. At the system boundary (API entry): check type, length, format. Never trust blindly.
Tooling & Cross-Platform
- MUST: Always prefix
docker run -vfrom Git Bash / MSYS on Windows withMSYS_NO_PATHCONV=1. MSYS auto-converts unquoted Linux paths to Windows paths before passing them todocker.exe, mangling bind-mount arguments. UseMSYS_NO_PATHCONV=1 docker run -v "C:/path:/repo" ...with explicit Windows-style host paths. Reference:ERR-2026-013.
Why This Sub-Skill Earns Stars
Without these rules, the agent produces code that works but immediately gets flagged in reviews. With these rules, it writes code that looks like it came from a senior developer — on the first try. The MUST/SHOULD/AVOID classification means rules are followed strictly where they matter (security, error handling) and pragmatically where context matters (function length, lazy loading).
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.

