用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/leroyguillaume/claude --skill frontend-conventions命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | frontend-conventions |
| description | Frontend project conventions (TypeScript, React, Biome, enforced |
Always:
.ts / .tsx
only. New UI is .tsx; non-UI modules are .ts.tsconfig.json must set "strict": true (this
turns on noImplicitAny, strictNullChecks, and the rest of the strict
family). Additionally enable noUncheckedIndexedAccess and
exactOptionalPropertyTypes. Treat tsc --noEmit as a blocking gate,
on the same footing as Biome — fix every type error before a change is
done. Wire tsc --noEmit into both .pre-commit-config.yaml and CI.biome check --write). It replaces both
ESLint and Prettier. Configure everything in biome.json (or
biome.jsonc). Enable the recommended rules and set
suspicious/noExplicitAny to error.biomejs/pre-commit) running
biome check, alongside the baseline hooks from CLAUDE.md.check-added-large-files
baseline hook. A committed package-lock.json (or pnpm-lock.yaml /
yarn.lock / bun.lockb) is legitimately large and must stay versioned,
so it should never trip the large-file check. Add an exclude to that hook
rather than raising --maxkb for everything:
- id: check-added-large-files
exclude: ^package-lock\.json$
Widen the pattern to match whichever lockfile(s) the repo uses.min-width breakpoints
(or the framework's sm: / md: / lg: responsive prefixes, which are
themselves min-width-based). The default, no-media-query rendering must
be the mobile layout.type / interface, never a
bare inline object shape threaded through the code. First reuse a type a
dependency already ships (an SDK's request/response model, a generated API
client, library prop types); only define your own when none exists. Derive
rather than duplicate (Pick, Omit, ReturnType, z.infer, …).localStorage) with a schema validator (e.g. zod) and infer the
TypeScript type from the schema, so the runtime shape and the static type
cannot drift.CLAUDE.md. Frontend
mechanics: use one structured logger module configured at app startup, log
key-values (logger.debug("fetch.done", { url, status })), and gate
verbosity by a log level read from the environment
(import.meta.env / process.env), never by interpolating values into the
message string.Never:
any type. Reach for unknown plus narrowing, a generic,
or a precise type instead. If any is genuinely unavoidable (an untyped
third-party module), isolate it behind a typed boundary and annotate the
single line with // biome-ignore lint/suspicious/noExplicitAny: <reason>
explaining why. Never use a blanket any to make a type error disappear.strict: false,
noImplicitAny: false, or sprinkle @ts-ignore / @ts-expect-error /
as casts to silence tsc. A cast or suppression needs a one-line comment
saying why the checker is wrong and why it is safe; prefer fixing the type..js / .jsx, and never ship plain
JavaScript modules for app logic. (Config files a tool requires in JS are
the only exception.).eslintrc* or
.prettierrc*. Biome owns formatting and linting; all config lives in
biome.json.max-width breakpoints layered
down from a desktop base, and no default layout that assumes a wide
viewport. Start at mobile and scale up.type/interface
and use it, deriving from an existing type where possible.console.log (or console.*) for diagnostics; route everything
through the configured structured logger.基于 SOC 职业分类