/awesome-agent-skills:awesome-code-standardsfrom awesome-agent-skills
Applies consistent coding conventions for naming, structure, immutability, types, error handling, and layering. Use when starting a module, setting lint rules, refactoring, or onboarding.
Ships in awesome-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Apply consistent naming, structure, and patterns so code is readable and maintainable across the team.
// GOOD: Descriptive, verb-noun for functions
const marketSearchQuery = 'election';
const isUserAuthenticated = true;
async function fetchMarketData(marketId: string) {}
function calculateSimilarity(a: number[], b: number[]) {}
// BAD: Unclear or noun-only for actions
const q = 'election';
const flag = true;
async function market(id: string) {}
function similarity(a, b) {}
MAX_RETRIES, API_BASE_URL).User, OrderItem, ApiResponse<T>.CreateUserRequest, UserResponse.Button.tsx, UserProfile.tsx).formatDate.ts, useAuth.ts)..types or .d as project uses (market.types.ts).The examples above are TypeScript; the rule is "follow the language's own published convention", and that convention differs. Each language's style guide wins over the casing shown here:
snake_case functions, variables, modules; PascalCase classes; UPPER_SNAKE constants; a leading _ marks non-public.MixedCaps, never underscores; a capital initial is the export marker. The package name is part of the name: chi.NewRouter, not chi.NewChiRouter.snake_case functions, variables, modules; UpperCamelCase types and traits; SCREAMING_SNAKE_CASE consts and statics.camelCase methods and fields, PascalCase types, one public type per file named after it.PascalCase for methods, properties, and types; camelCase for locals and parameters; interfaces prefixed I.// GOOD: Spread and new references
const updatedUser = { ...user, name: 'New Name' };
const updatedArray = [...items, newItem];
// BAD: Direct mutation
user.name = 'New Name';
items.push(newItem);
Other languages — same rule, different mechanism:
def f(xs=[]) shares one list across calls; use None + build inside). Prefer tuples and frozenset for fixed collections; dataclasses.replace(obj, field=…) for a modified copy.append can write through to it later; copy before retaining (slices.Clone). Value receivers for methods that shouldn't mutate.mut is the exception you justify, not the default you type.record for data carriers, List.copyOf/Map.copyOf for defensive copies at the boundary.record types plus with expressions; ImmutableArray/ImmutableList for shared collections.// GOOD: add context, keep the cause; log once at the boundary
async function fetchData(url: string) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
return await response.json();
} catch (error) {
throw new Error(`Failed to fetch ${url}`, { cause: error });
}
}
// BAD: No handling or swallowed errors
async function fetchData(url: string) {
const response = await fetch(url);
return response.json();
}
Other languages — the shape changes, "add context, never swallow" does not:
except: (it eats KeyboardInterrupt too). Re-raise with the chain intact: raise ParseError(...) from err.%w so errors.Is/errors.As still work (fmt.Errorf("fetch %s: %w", url, err)). Discarding one with _ = needs a comment saying why it's safe.Result<T, E> and propagate with ?; a typed error enum (or thiserror) at library boundaries, anyhow only in the binary. unwrap()/expect() in library code is a panic you shipped.catch; keep the cause (throw new X(msg, err)).throw; (not throw ex;, which resets the stack trace).// GOOD: Parallel when independent
const [users, markets, stats] = await Promise.all([
fetchUsers(),
fetchMarkets(),
fetchStats(),
]);
// BAD: Sequential when unnecessary
const users = await fetchUsers();
const markets = await fetchMarkets();
const stats = await fetchStats();
Other languages — run independent work concurrently, and give every concurrent unit a way to be cancelled:
asyncio.gather(*coros) for independent awaits; asyncio.TaskGroup (3.11+) when a failure should cancel the siblings. Blocking calls go to run_in_executor, never inline in a coroutine.errgroup.Group (golang.org/x/sync) for fan-out that must fail as a unit, sync.WaitGroup when it must not. context.Context is the first parameter of anything that can block, and it is passed down, not stored in a struct.tokio::join! for independent futures, try_join! when the first error should abort; a CancellationToken or dropping the JoinHandle for teardown.CompletableFuture.allOf(...), or structured concurrency (StructuredTaskScope) where available.Task.WhenAll(...), with a CancellationToken threaded through every async signature.// GOOD: Explicit types, no any
interface Market {
id: string;
name: string;
status: 'active' | 'resolved' | 'closed';
}
function getMarket(id: string): Promise<Market> { /* ... */ }
// BAD: any or untyped
function getMarket(id: any): Promise<any> { /* ... */ }
Other languages — the goal is the same: make an invalid value unrepresentable, and check it at the boundary rather than at every call site.
mypy/pyright in strict mode in CI; a type hint nothing checks is a comment. TypedDict/dataclass/Pydantic model at API and parse boundaries, not raw dict[str, Any].any; accept interfaces, return structs. An any in a signature is a parse boundary, and it gets a type switch or errors.As immediately.struct UserId(u64), not u64) so the compiler catches a swapped argument; enums over stringly-typed state.Optional plus nullability annotations in Java; no Object in a public signature.<Nullable>enable</Nullable>), warnings as errors.Dynamically-typed languages without a checker (plain JS, Ruby, PHP, Lua) do the same job at runtime: validate at the trust boundary with a schema, and let internal calls stay unguarded.
- not —, ... not …, straight quotes, no decorative glyphs or emoji. Typographic glyphs in a comment are an AI-generation tell, not house style. (Comment text only — never string literals, identifiers, or data.)awesome-humanize-en/references/lexicon.md, which also carries the domains where one of the words is the product's own vocabulary. Without that skill the rule still binds: where a plainer verb exists, the comment uses it. (Comment text only — inside a string literal or product data the word is content.)max-height, a colour, a timeout, a bare number mirroring a constant, and not a selector, class name or storage key the source holds. The comment is the one copy no rename sweep reaches. A value declared nowhere in the repo (a vendor limit, a protocol's fixed width) may be named, with what fixes it.// --- HTTP, // ==== Helpers ==== and their kind: a blank line separates blocks, and a file that wants a table of contents wants splitting.// . Indentation that mirrors real nesting being documented is content and stays.deliberately, intentionally, by design assert what only the reason proves; write the reason, drop the word (lexicon.md, Borrowed diction).null, 0 or empty means), and an example where the call is not obvious. Document more on a published library or SDK surface, and near nothing on an internal helper or a plain data type. @param and @returns appear only when they say something beyond the name and type; a block that repeats the signature is noise. Use the language's own format and match project style: JSDoc/TSDoc, Python docstrings (PEP 257, in the project's Google/NumPy/reST flavor), Go doc comments starting with the symbol name, Rust /// with a # Examples section, Javadoc, XML doc comments in C#.That is the bar for code you are writing or touching now. For a repo-wide pass over existing comments — deciding what to delete, condense, or fix, with the false-positive boundaries and the behavior-preserving verification gate — use awesome-code-cleanup, which owns that procedure.
src/app/, src/components/, src/lib/).User object flowing through transport, business logic, and storage traps API shape to table shape and makes every refactor touch every layer.controller -> service -> repository -> gateway.// GOOD: service throws a domain error; the global handler maps NotFoundError -> 404
throw new NotFoundError('market', id);
// BAD: business logic reaches into HTTP transport
return res.status(404).json({ error: 'not found' });
This section only places the layers. Designing the error envelope, HTTP status mapping, and retry policy in depth is awesome-error-standards' job — go there when the task is the error contract itself.
| Smell | Action |
|---|---|
| Function > ~50 lines | Split into smaller functions with clear names |
| Deep nesting (5+ levels) | Use early returns or extract functions |
| Magic numbers | Extract named constants (e.g. MAX_RETRIES, DEBOUNCE_MS) |
| Long parameter list | Use options object or split into smaller types |
| Duplicate logic in two places | Extract to shared function or module |
The smells above hold in any language. Numeric thresholds are a starting point, not a law; a documented repo standard always wins, and don't re-flag what a linter or type-checker already enforces. Before inventing a pattern, search the codebase — the problem is often already solved somewhere; reuse it rather than adding a second way to do the same thing.
Separate from the universal smells above: every framework has a short list of footguns that look correct and fail at runtime. Learn the list for the framework in front of you rather than assuming another framework's list transfers — the authority is that framework's own documentation (React's Rules of Hooks and "You Might Not Need an Effect", Vue's reactivity caveats, Angular's change-detection guide, Svelte's store and reactivity notes).
React, as the worked example:
| Smell | Action |
|---|---|
{count && <X/>} in JSX | Renders literal 0/NaN when falsy — use an explicit ternary count > 0 ? <X/> : null |
| Component defined inside another component | Hoist it out — a nested definition is a new type each render and remounts, losing state |
State derivable from props/state kept in useState+useEffect | Derive it during render (or use a keyed reset) — no effect needed |
The transferable part is the shape of the class, not these three rows: a falsy value rendering as visible output, an identity that changes every render and silently discards state, and state duplicated instead of derived. Look for that shape in whatever framework the project uses.
transform and opacity. Never animate layout properties (width, height, top, margin) — they trigger reflow every frame; use the FLIP technique for position changes.getBoundingClientRect, offsetWidth) before writes to avoid layout thrashing.animation-timeline: view()/scroll() over JS scroll-event listeners for scroll-linked animation; use will-change surgically and remove it after.text-balance on headings, text-pretty on body, tabular-nums for numeric columns, h-dvh over h-screen, interactions under ~200ms, one accent color per view, a fixed z-index scale.shared/common/utils bucket with no boundary; a giant global components/; a folder per one-file throwaway.index.ts re-export next to it.parseApiError) and surface the server request_id in error UI so user reports line up with server logs.any; types explicit at boundaries| Anti-pattern | Better approach |
|---|---|
| "It's just a small script" | Apply same naming and structure; future readers will thank you |
| Commenting out code "for later" | Delete; use git history or a ticket |
| Fixing only the file in scope | If touching a pattern, suggest project-wide convention or follow-up |
| Adding style rules without tooling | Put them in the language's formatter and linter so format is automatic (gofmt, ruff/black, rustfmt+clippy, ktlint, dotnet format, ESLint/Prettier), plus .editorconfig for what crosses languages |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub khasky/awesome-agent-skills --plugin awesome-agent-skills49 skills in this plugin
/awesome-accessibility-auditRead-only WCAG audit of UI and markup with a concrete fix per finding. Use when asked to check accessibility, a11y, keyboard or screen-reader support, or contrast./awesome-agents-md-generatorMines a codebase's real commands, conventions and boundaries into an agent-agnostic AGENTS.md, nested per package in monorepos, every rule backed by counted evidence. Use when asked to write, generate or refresh AGENTS.md or agent instructions for a repo./awesome-api-designDesigns or reviews an HTTP API's shape before code: resources, versioning, pagination, idempotency, filtering. Use when asked to design an API or an endpoint./awesome-architecture-auditRead-only audit of a whole codebase's design: module boundaries, dependency direction, docs-vs-code drift, extensibility, with a verdict. Use when asked to audit the architecture./awesome-bug-fixFixes a bug through a runnable reproduction and its root cause. Use for errors, crashes, failing tests or builds, flaky behavior, or repeated failed fixes./awesome-claims-auditChecks public claims (site, README, store listing, privacy policy, structured data) against the code and config that decide them, then fixes drift. Use when asked whether the site still matches the product.Other plugins' skills for the same job