code-quality
Skill1 starsChanged 27 days agoMITView on GitHub
Enforces engineering standards for code an agent writes or reviews, covering domain-accurate naming, flat control flow with early returns, abstraction only after real callers exist, boundary-only validation, error context preservation, and no unrequested options. Use when writing, modifying, or reviewing application code and before finishing any change that adds functions, handlers, branches, or error paths; do not use for prose, documentation-only edits, formatting-only changes, or data and configuration files with no logic.
77 other projects use a version of this.
Adopted by
Most recently taken up by
- magnusrodseth/dotfilestheir own version, first seen Nov 8, 2026
- KadirHarmanc/nazar-skilltheir own version, first seen Nov 8, 2026
- AndersonAndrad/skillstheir own version, first seen Nov 8, 2026
- Mehul72/skillstheir own version, first seen Nov 8, 2026
- eea/eea.agent.skillstheir own version, first seen Nov 8, 2026
- notque/vexjoy-agenttheir own version, first seen Nov 7, 2026
Used with
Projects with it also use spring-boot, logging-patterns and 10 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.
ffsshhttiikkSkillspring-boot
Spring Boot framework and Java enterprise patterns
Also in 3 projects that use this
DIL8654Skilllogging-patterns
Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.
Also in 3 projects that use this
mstuder-slalomSkilljpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Also in 3 projects that use this
ffsshhttiikkSkilldesign-patterns
Practical application and coding skills for Design Patterns
Also in 4 projects that use this
glommerSkillpr-workflow
General guidelines for Commits, formatting, CI, dependencies, security
Also in 4 projects that use this
vm0-aiSkillcli-design
Design patterns and conventions for the Okou CLI user experience
Also in 3 projects that use this
Other versions77 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 77
- tursodatabase/turso★ 25ksame name
- superdesigndev/treg★ 7.7ksame name
- doorkeeper-gem/doorkeeper★ 5.5ksame name
- static-web-server/static-web-server★ 2.4ksame name
- piomin/claude-ai-spring-boot★ 1.4ksame name
- microsoft/winappCli★ 1.4ksame name
- glommer/pgmicro★ 1.2ksame name
- vm0-ai/vm0★ 1.2ksame name
- rommapp/argosy-launcher★ 710same name
- waybarrios/opencode-power-pack★ 547same name
67 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 repository12 other files it gives its agents.
- root-causeSkill
- bot-developmentSkill
- readmeSkill
- dependenciesSkill
- languagesSkill
- commitSkill
- publishSkill
- project-memorySkill
- code-reviewSkill
- data-extractionSkill
- reviewSkill
- strategySkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 71 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Must NOT activate for prose or documentation-only edits, dependency bumps, formatting-only changes, data and configuration files with no …
- Distinctive: line 25
Read access to the repository, plus its test, lint, and format commands when they exist.
- Distinctive: line 27
If the repo has no linter, formatter, or test command, do not invent one.
- Distinctive: line 47
Add no unrequested options.
- Very specific: line 49
Keep the change minimal and cutover-clean.
- Very specific: line 55
Run the project's own tooling, not your judgement alone: its test command, linter, type checker, and formatter.
- Distinctive: line 62
No test or lint command found: state that verification is limited to review and name exactly which checks were unavailable.
- Distinctive: line 141
Never put secrets, tokens, or full personal data into names, comments, error messages, or test fixtures.
- Very specific: line 148
Read only the two or three files that establish local convention, not the whole repository.
- Very specific: line 149
Use uaf notes and uaf remember "<note>" for facts you will need across turns instead of re-reading files.
- Distinctive: line 150
Keep diffs small so review context stays small: prefer one focused edit over rewriting a file, and do not open files irrelevant to the …
“Common” is measured: kept by at least 6 in 10 of the 71 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
Purpose
Code quality here means code a reviewer can read without translating it: names that carry domain meaning, control flow that reads top to bottom, and abstractions that exist because callers demanded them. This skill governs how you write and revise application code so the result looks like the repository it lives in rather than like generic assistant output. It is language-agnostic; the examples use TypeScript and Python because the failure modes are easiest to see there.
When this activates
- You are about to write or modify application code: functions, classes, handlers, modules, error paths.
- You are reviewing a diff and must decide whether a comment, abstraction, or validation belongs.
- You are renaming, extracting, or de-duplicating existing code.
- You are adding an option, flag, config key, or parameter to existing code.
Must NOT activate for prose or documentation-only edits, dependency bumps, formatting-only changes, data and configuration files with no logic, or a throwaway script the user explicitly said will not be kept.
Prerequisites
- Read access to the repository, plus its test, lint, and format commands when they exist. Read two or three files in the same area before writing (Procedure step 1).
uaf mode getto know the current mode:litefor a small scoped change,full(default),ultrafor risky or release-critical work.- If the repo has no linter, formatter, or test command, do not invent one. Match the surrounding code by hand and state which checks were unavailable.
Procedure
- Read before writing. Open the module you will change and at least one sibling module that does something similar. Record the naming style (casing, verb versus noun for functions), error-handling convention, logging, config access, and test layout. Match them even where you would have chosen differently; divergence is a defect in a shared codebase.
- Name by domain, not by shape.
user,invoice,retryPolicybeatdata,item,obj;fetchInvoicesForTenantbeatsprocessData. If a name needs a comment to explain what it holds, rename it instead of commenting. Renaming beats documenting a bad name. - Flatten control flow. Handle the failure or edge case first and return early; keep the happy path at the lowest indentation. Prefer guard clauses over
if/elsepyramids. If a function exceeds roughly three levels of nesting or a screen of length, extract the inner block into a function named after what it does. - Abstraction comes after the callers, not before. Write the concrete code. Introduce a shared function, interface, class, or wrapper at the second or third real caller, when the callers demonstrably change together. Do not create an interface, factory, or base class for a single implementation. "We might need it later" is not a caller.
- Comment the why, never the what. A comment earns its place when it records a non-obvious constraint, an external requirement, a workaround with a link, or a decision a future reader would otherwise re-litigate. If it restates the next line, delete it.
- Validate at the boundary only. Parse and validate untrusted input once, at the edge where it enters the system: HTTP handler, CLI argument parse, file or queue read, third-party response. Downstream, trust the validated value. Do not re-check for
nulla value the type system already narrows, and do not re-validate an object the caller's contract already guarantees. - Preserve error context. When you handle or rethrow, keep what failed and with which input, and chain the original cause. Never catch and discard. Never replace a specific, useful error with a generic one. If you can act on the error, act; otherwise let it propagate.
- De-duplicate at the third occurrence. Two similar blocks may legitimately differ; wait until a third copy appears and the copies change together, then extract one function with a clear name. Do not merge code that merely looks similar but is expected to diverge.
- Add no unrequested options. No config key, flag, environment variable, or parameter that the task did not require and no caller passes. Options are permanent compatibility surface. If you believe an option is needed, state the need to the user instead of adding it.
- Keep the change minimal and cutover-clean. Delete what your change made obsolete: dead branches, now-unused helpers, stale comments. Leave no commented-out code, no
TODOs you created, and no backwards-compatibility shim nobody requested. - Match the mode. In
lite, do steps 1, 2, 3, and 10 and stop. Infull, apply every step. Inultra, re-read steps 4 and 6 with a hostile eye: every abstraction and every validation must name its caller.
Verification
- Run the project's own tooling, not your judgement alone: its test command, linter, type checker, and formatter. Read the actual command from
package.jsonscripts,Makefile,pyproject.toml, or CI config; do not guess flags, and confirm them against the tool's own--helpwhen unsure. uaf doctorreports whether the environment is wired for the current agent.- Review the diff as the reviewer would; use
uaf git --commitfor commits anduaf ghfor pull request work when the repo uses them. - Self-check the diff against steps 2 through 9: any new name generic, any new nesting, any abstraction with one implementation, any comment restating code, any validation the type system already guarantees, any option no caller passes; and confirm the change added no dead code by finding a caller for each symbol you introduced.
Failure behavior
- No test or lint command found: state that verification is limited to review and name exactly which checks were unavailable. Never report an unexecuted check as passing.
- The surrounding code violates this skill (deep nesting, generic names everywhere): match the local convention for the change at hand, do not silently refactor unrelated code, and mention the inconsistency in your summary.
- You cannot decide between extracting and leaving duplication: leave it duplicated with a short note on why the copies exist, and flag the decision. The cheaper error is duplication, not the wrong abstraction.
- The type contract conflicts with the validation need (input is
anyor untyped): treat that input as untrusted and validate it at the boundary where it is still untyped. - A step is genuinely impossible (no repository access): say so and stop rather than proceeding with invented context.
Anti-patterns
(a) Over-abstraction in TypeScript: one implementation wrapped in an interface and a factory.
Poor:
interface InvoiceRenderer { render(i: Invoice): string; }
class DefaultInvoiceRenderer implements InvoiceRenderer {
render(i: Invoice): string { return `${i.id}: ${i.total}`; }
}
function makeInvoiceRenderer(): InvoiceRenderer { return new DefaultInvoiceRenderer(); }
const out = makeInvoiceRenderer().render(invoice);Improved:
function renderInvoice(invoice: Invoice): string {
return `${invoice.id}: ${invoice.total}`;
}
const out = renderInvoice(invoice);Why the improved version fits: there is exactly one implementation and one caller, so the interface and factory add indirection and names to maintain while hiding nothing. Introduce the interface when a second renderer actually appears and callers must choose between them.
(b) Nested conditionals with a swallowed error in Python.
Poor:
def load_rate(currency, table):
if currency:
if currency in table:
try:
return float(table[currency])
except Exception:
return None
else:
return None
else:
return NoneImproved:
def load_rate(currency, table):
if not currency:
raise ValueError("currency is required")
if currency not in table:
raise KeyError(f"no rate for {currency!r}; known: {sorted(table)}")
try:
return float(table[currency])
except ValueError as exc:
raise ValueError(f"rate for {currency!r} is not numeric: {table[currency]!r}") from excWhy the improved version fits: the guards remove the pyramid and read top to bottom, while except Exception: return None erased both the failure kind and the offending input; the specific handlers keep the currency, the raw value, and the original cause.
(c) Redundant re-validation of an already-typed value plus a comment that restates the code.
Poor:
function totalPrice(order: Order): number {
// loop over the items and add up the price
if (order === null || order === undefined) throw new Error("order missing");
if (!Array.isArray(order.items)) throw new Error("items missing");
return order.items.reduce((sum, item) => sum + item.price, 0);
}Improved:
function totalPrice(order: Order): number {
return order.items.reduce((sum, item) => sum + item.price, 0);
}Why the improved version fits: Order already guarantees a non-null object with an items array, so the checks re-test the type system and the caller's contract, and the comment merely narrates the reduce. Delete both; if order really arrives untyped, validate it once where it enters.
Security
- Never put secrets, tokens, or full personal data into names, comments, error messages, or test fixtures; error context should carry the failing field, not a credential.
- Messages you surface to end users must not leak internal paths, stack traces, SQL, or third-party payloads. Keep detail in logs; keep the user-facing message generic. This is the one place a generic message is correct.
- Validation is a security control only at trust boundaries: validate and normalize untrusted input before it reaches a query, a shell command, a filesystem path, or a template.
uaf secretslists configured secret references; do not print their values.
Token notes
- Read only the two or three files that establish local convention, not the whole repository. Use
uaf search "<query>"to locate the relevant module anduaf indexto refresh the index. - Use
uaf notesanduaf remember "<note>"for facts you will need across turns instead of re-reading files. - Keep diffs small so review context stays small: prefer one focused edit over rewriting a file, and do not open files irrelevant to the change.
Known limitations
- "Second or third caller" and "third occurrence" are judgement thresholds, not mechanical rules; the right count depends on how likely the copies are to change together.
- The size guidance (about a screen, about three nesting levels) is a heuristic, not a lint rule; some languages and domains legitimately need longer functions.
- This skill cannot resolve a repository that is internally inconsistent. Where the repo disagrees with itself, pick the convention nearest the code you touch and say so.
- The examples use TypeScript and Python; other languages have equivalent failure modes, but their idioms (error returns versus exceptions, for instance) may shift which step applies.
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.

