/vivswan-skills:code-standardsfrom Vivswan Skills
Use when writing code changes, sweeping or shortening comments (including file-size or comment-cap findings), or asked to apply the code standards.
Ships in Vivswan 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; scripts run unread.
Standards for code and the artifacts around it. Apply them while writing. Check them while reviewing.
Readability and beauty come first. Every standard here serves them and yields where following it would read worse; the deviation is said in a line, never forced through.
This is a silver standard, not gold. Languages and tools move faster than this page: a newer version's more beautiful, more readable way of writing a thing wins even where the page has not caught up, and the page is brought up to it afterwards.
Each standard below is the rule in a few lines, with the specimen that set it where one exists. The references/ page named under it carries the why, the how-to-apply list, and the boundaries. Load that page before acting on a standard's edge.
A systemic problem gets a root fix that makes recurrence impossible, never only a fix of the case at hand. The /never-twice skill owns the judgment and its response ladder. Full detail: references/design.md.
A problem that passes the /never-twice floor's judgment ships with the highest reachable rung: a type or structure that makes the state impossible, else a test, tripwire, or pipeline fix (or a proposal to the user when the pipeline is out of reach), else a written rule recorded as debt. Full detail: references/design.md.
Parameterize the axis that keeps changing instead of hardcoding today's instance, and give one concept one pipeline. Specimen: a safety classifier whose rulebook kept changing was built as a classifier factory with the rubric as an input. Full detail, including where DRY stops: references/design.md.
Code quality outweighs diff size and effort spent. A big refactor beats a fix done the wrong way, invariants live in types (the /no-invalid-states skill), and an assertion at a boundary pins what types cannot. Specimen: a documented workaround hybrid was reworked outright rather than kept. Full detail: references/design.md.
Never hand-roll what a good library already does; a tool already in the repository counts: a declared direct dependency or its own code, never a transitive dependency, a library's private module, or a skill's script. The search happens before the first line and is recorded in the brief, then the PR body or landing report. A large library or an unclear fit is a question to the owner first.
Specimen: five CI scripts whose whole job a published package or git diff --exit-code already did. Full detail: references/design.md.
A floor every test clears. A test asserts a whole outcome and answers "what would drift silently without this?" in its name or first line: an external fact, a cross-file consistency, or a named incident. A constant or a shipped file is the source and is never pinned to itself.
A guard test is seen failing on its bug. A deletion with no behavior of its own proves itself with a census, not a manufactured test. Fixtures are hand-authored, never recorded from real data.
Specimen: fifteen tests each asserting one key of a dict became one parametrized test pinning the whole dict, 81 test functions to 44, every guarded bug still caught. Full detail and the other specimens: references/tests.md.
The reason a choice was made, an invariant another file relies on, an external system's quirk, a consequence invisible here, the input that motivated a guard. Never what the code does, its types, its control flow, its history, the alternatives.
Tell first, in one or two sentences, one fact each, then show (aligned rows, an arrow flow) only when a block is faster. A reason rides with its fact once. A second link (another so, a because after it, a semicolon) is a chain to split or cut.
Never pack prose to fit a cap: cut honestly. Before writing or keeping one: what does this say that the code does not, and could a tired human read it in one pass? Unsure: delete it.
Where a variable, a field, or a constant needs a comment at all, it is one line above the item, never more; what needs more goes into the name or a short tell above the group. Once one field of a record or one constant of a block carries a comment, every field or constant does, so it reads uniform. Specimens, the TODO ban: references/comments.md.
Malformed state with one unambiguous repair is repaired at the boundary and reported; with no repair or several, it is refused there. What the tool only reads is refused, what it outputs is healed toward what the user declared, and nothing malformed passes through to fail later. Full detail: references/design.md.
Code always looks beautiful and reads once. A module reads top to bottom with nothing to scroll back for, and a function reads as the list of its steps. Everything below this heading is a default, not a law: the case decides, a deviation that reads better stands, and a reviewer who flags one says what would read better.
continues instead of nesting.#[expect] with a reason, failing when stale), never a bare inline suppression, never tighter than the page's floor.and/or as control flow). One computation per line under a plain-noun name; named arguments once three values share a type; cleanup bound to its acquisition (with, defer, Drop, using).if and its single consequence.Specimen, the body that set the paragraph rule:
key = (video_key(video), audio_sig(video), model)
if key not in SEGMENTS:
cache = cache_file(video, model)
segments = read_cache(cache)
if segments is None and window is not None:
return with_min_words(transcribe_window(video, model, window), min_words)
if segments is None:
segments = run_asr(full_audio_wav(video), model, offset=audio_start(video))
write_cache(cache, segments)
SEGMENTS[key] = segments
segments = SEGMENTS[key]
if window is not None:
segments = within_window(segments, window)
return with_min_words(segments, min_words)
The rules and their specimens: references/shape.md. The lint floor and the idioms per language, and the Python order checker: references/languages/.
Delete an import-only index, a "keep old importers compiling" re-export, and a function whose whole body forwards to another. Repoint the importers or callers at the defining module. A wrapper earns its existence only by adding something real: a default, a conversion, error mapping, an injected dependency, a narrowed type.
A confusing layout is the same defect one level up. A predictable one names each file after its main public thing and keeps its helpers beside it, gives every sibling in a folder the same internal template, and repeats file names across sibling stages, so a reader knows where a thing sits before opening it. Not sure where a thing goes: ask the user, with options.
The folders themselves, their depth, their first level, and which folder a thing belongs in, are the /think-in-trees skill's; this standard keeps the file inside the folder.
A stage's records, constants, and small functions gather in its records, constants, and util modules, and a package that fits one module is one module. A module named after its main thing may hold that thing alone; the defect is a helper of one caller, or a constant, given its own module outside those three.
Specimen: one sweep split a tree into 269 modules, among them a file holding a single format-conversion helper and another holding a default layer list.
A file per function is the same defect from the other side: a file holds one concept with its helpers, as a function holds one concept with its steps.
Any file may move, a pure move is its own PR with an export census and an equal test count, and a whole-repo reorganisation is proposed as a target layout first. Full detail: references/structure.md; the barrel in each language: references/languages/.
Code and comments never reference planning artifacts: work-package names, spike or phase labels, plan codenames, audit finding numbers. Specimen: a comment opening "WP-B spike, part 2:" means nothing outside the plan. Full detail: references/comments.md.
AGENTS.md (and CLAUDE.md) holds the project's guiding principles and nothing an agent can deduce elsewhere: what the project is, the conventions the owner wants kept, safety constraints, toolchain entry points, pointers. Anything a specific file answers is cut to a one-line pointer, and no test pins the text. Specimen: a 66-line tail became 15. Full detail: references/artifacts.md.
What changed and why, in the repo's subject conventions. No AI or tool attribution, no hard wrapping of the body, no PII (the /pr-and-issue-discipline skill's rule). The one sanctioned attribution is human community credit. Full detail: references/artifacts.md.
A pre-commit hook checks what the developer staged and reports: check and fail, or check, write the fix into the working tree, and still fail. It never stages, commits, formats-and-restages, runs a writing git command, reaches the network, or installs anything. Full detail and the specimen: references/artifacts.md.
Anything a human skims uses scannable structure: paragraphs of 1 to 3 sentences, and when the content is enumerable, enumerate it. The shape rules and the paragraph probe live in the /working-text skill; PR bodies follow the /pr-and-issue-discipline skill. Prose inside a code artifact (an action description, CLI help) follows the /working-text page rules.
references/ page before acting on it./no-invalid-states skill for the refactor itself./never-twice floor's judgment: does the change prevent recurrence (test, type, tooling), or just patch the case at hand?/never-twice floor's judgment fixed again without the highest reachable rung: a type or structure, a test, tripwire, or pipeline fix, a proposal to the user when the pipeline is out of reach, or, when none is possible, a written rule recorded as debt.needs to the list in the yaml, a constant pinned to its own literal, a shipped config file parsed and asserted back), or whose name or first line does not say what would drift silently without it./no-invalid-states skill covers the type-level fix).so, a because after it, a semicolon), prose packed to fit a cap.and/or as control flow, a guard's body wrapped in an else, a loop nesting what a continue would skip, or a hand-written cleanup block where the language binds cleanup to the acquisition.records, constants, and util modules, a sibling whose internal template differs from the folder's, or a concept spelled differently across sibling stages.Triage findings against the standards above. Each criterion maps to one. The shape and layout criteria are defaults: a finding there names what would read better, and a deviation the author can defend in a line stands.
Cross-language standards, one page each:
references/design.md: fix the class, guard the floor, general-purpose over special-case (one pipeline per concept, DRY boundaries), maintainability over effort, prefer a library, heal at the boundaryreferences/tests.md: the minimum standard for tests, the drift question, proving a guard test, the census rule for deletions, hand-authored fixturesreferences/comments.md: what a good comment carries, tell then show, the one-line rule for variables, fields, and constants, the two-question test, the specimens, the TODO ban, planning referencesreferences/shape.md: module layout, define before use, one concept per function, guards and early exits, the ugly-to-clear table, the paragraph specimen, members standing alone, types and docsreferences/structure.md: barrels, compatibility re-exports, escort functions, migration staging, the predictable layout and its specimen tree, the pure-move PR and the target layout for a reorganisationreferences/artifacts.md: lean AGENTS.md, content-only commit messages and their two exceptions, hooks that check and never commitHow the shape and barrel rules land in each language, with its lint floor and idioms:
references/languages/python.md: the ruff block, the order checker, __all__, with, Google docstringsreferences/languages/typescript.md: the biome block, no-use-before-define, options objects, usingreferences/languages/rust.md: the clippy thresholds, let ... else, Drop guards, mod.rsreferences/languages/go.md: the golangci-lint block, defer, options structs, the package as the unitLICENSE.md (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)references/artifacts.md (opens in a new tab)references/comments.md (opens in a new tab)references/design.md (opens in a new tab)references/languages/go.md (opens in a new tab)references/languages/python.md (opens in a new tab)references/languages/rust.md (opens in a new tab)references/languages/typescript.md (opens in a new tab)references/shape.md (opens in a new tab)references/structure.md (opens in a new tab)references/tests.md (opens in a new tab)scripts/python-order.mts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vivswan/skills --plugin vivswan-skills19 skills in this plugin
/claude-remote-peersUse when this Claude Code session must message, ping, or coordinate with a Claude Code session running on another machine, or when a peer the user names is on a different host and ListAgents does not show it./codex-browser-fixUse when Codex on macOS must drive the user's Chromium browser (Brave, Vivaldi, Opera, Edge, Chrome) through the bundled Chrome plugin, or that plugin fails with "Codex auth token is unavailable", a missing extension connection, or a stale plugin cache after a desktop app update. Codex only./craft-skills-and-memoriesUse when creating a skill or memory, when one fails in practice, or when the user reports one misbehaving or stale.