用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Vivswan/skills --skill code-standards命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | code-standards |
| description | Use when writing code changes or asked to apply house code standards. |
| license | SEE LICENSE IN LICENSE.md |
| metadata | {"author":"Vivswan"} |
House standards for code and the artifacts around it. Apply them while writing; check them while reviewing.
Where a standard has a canonical case (the specimen that set the rule), it is stated inline or in the standard's references/ file: the concrete case recalls better than the rule. The references/ file named under each standard carries the full detail: the why, the how-to-apply list, and the boundaries and exceptions.
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 this rule and its response ladder; specimen and full detail in references/design.md.
A problem that recurs, or plausibly will, ships with a test, tripwire, or pipeline fix that catches it at the source: rung 2 of the /never-twice ladder; full detail, including the guard-outside-your-reach case, in references/design.md.
Parameterize the axis that keeps changing instead of hardcoding today's instance.
Specimen: a safety classifier whose rulebook kept changing was built as a classifier FACTORY with the rubric as an input. Any rubric change produces a new classifier for free, and the same machinery serves uses beyond safety.
Full detail, including the one-pipeline-per-concept rule (the page that grew three visibly diverging error-band renderers) and where DRY stops: references/design.md.
Code quality outweighs diff size and effort spent. A big refactor is always better than a fix done the wrong way: wrong-shaped fixes compound into tech debt.
/no-invalid-states skill).Specimen: a documented workaround hybrid was reworked outright rather than kept. Never preserve a workaround to keep a diff small.
Full detail: references/design.md.
Comments exist only for non-obvious constraints, cross-file invariants, and external-system quirks; the code is the single source of truth.
Full detail, including the TODO ban: references/comments.md.
Delete these and repoint the importers or callers at the defining module or real function:
A wrapper earns its existence only by adding something real (a default, a conversion, error mapping, an injected dependency, a narrowed type). In Python, __init__.py stays EMPTY unless absolutely necessary: re-exports there are the same barrel.
Full detail, including the migration-staging exception and what is not a barrel: references/structure.md.
Code and comments never reference planning artifacts: work-package names, spike or phase labels, plan codenames, audit finding numbers. The next reader has the code, not the plan.
Specimen: a comment like "WP-B spike, part 2:" has no meaning outside the planning; comments describe purpose and constraints, not where the code came from.
Full detail: references/comments.md.
Agent instruction files (AGENTS.md, CLAUDE.md) hold only project essentials: purpose, toolchain entry points, conventions CI enforces, safety constraints, and pointers. Cut anything an agent could learn by reading the code and keep a one-line pointer instead: duplicated detail drifts and then misleads; a pointer cannot drift.
Full detail: references/artifacts.md.
Commit and PR messages state what changed and why, following the repo's subject conventions. No AI or tool attribution lines and no hard wrapping of the body at 72 columns (a wrapped body renders as ragged mid-sentence breaks in GitHub's soft-wrapping UI).
Specimen of the one sanctioned attribution, human community credit in repos that take contributions: fix: ... (#NN, thanks @user) in the subject, Co-authored-by: trailers for humans whose code landed. Credit for people, never for tools.
Full detail, including the email-patch exception: references/artifacts.md.
Docs, READMEs, reports, and PR text use scannable structure: bullets for facts, tables for enumerations, numbered steps for flows, paragraphs of 1-3 sentences. When the content is enumerable, enumerate it. Short explanatory paragraphs are fine; wall-of-text prose where structure would scan better is not.
Full detail: references/artifacts.md.
/no-invalid-states skill covers the type-level fix).Triage findings against the standards above; each criterion maps to one.
references/ file before acting on it./no-invalid-states skill for the refactor itself.references/design.md: fix the class, general-purpose over special-case (one pipeline per concept, DRY boundaries), maintainability over effortreferences/comments.md: the comment rules in full, the TODO ban, planning referencesreferences/structure.md: barrels, compatibility re-exports, escort functions, migration stagingreferences/artifacts.md: lean AGENTS.md, content-only commit messages and their two exceptions