本文へ移動
cccskills
無料GitHub で公開

add-lint

Turn a code pattern the user doesn't want into a check that finds it without them — an oxlint rule in `scripts/oxlint/shift-plugin.mjs`, a workspace clippy lint, or a report in `shift-scan` (Rust) or `scan-ts` (TypeScript) — and clean up what it finds. Use when the user says "I don't like X", "we keep doing X", "add a lint/rule/check for X", "make this a rule", "scan for X", "can we catch this automatically", or when the same review comment comes up a second time. Also use to run the scanners on a branch before review.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shiftスター 379(GitHub 379 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

/add-lint — Catch a pattern once, not in every review

Every pattern the user has to point out twice should be found by a tool after that. A rule that blocks is better than a report; a report is better than a reviewer remembering.

1. Pin the pattern down

Write a before/after for the pattern from real code (file:line), and one case that looks similar but is fine. Show it with show_code and agree it with the user before writing the check: a rule that flags the wrong thing teaches everyone to ignore it.

2. Pick where it lives

The pattern isPut it inEffect
Decidable in one TypeScript file, from syntaxa rule in scripts/oxlint/shift-plugin.mjs, enabled in .oxlintrc.jsonblocks in pnpm lint:check and CI
Covered by an existing clippy lint[workspace.lints.clippy] in Cargo.tomlblocks in clippy and CI
Covered by an oxlint built-in or a plugin rule (@shadcn/lint for the design system).oxlintrc.json (the root, or a package's for its own rules)blocks
Needs other files, types, or a reviewer's judgement (TypeScript)a kind in scripts/scan/scan-ts.mjspnpm scan:ts reports
Rust structure clippy can't see (free functions, shared shapes, chains)a Kind in crates/shift-scanpnpm scan:rust reports

Prefer the first row that fits. A scanner kind is right when some hits are correct code (a free numeric helper, a cache that really is a cache), so it can't block.

3. Count before enabling

Run the new check over the tree first (pnpm lint:check, pnpm scan:ts --kind <kind>, pnpm scan:rust --kind <kind>) and report the count with a few real hits.

  • 0 hits: enable it as an error and stop.
  • A handful: fix them in the same branch, one commit for the rule and one for the fixes.
  • Many: ask. Usually the rule lands with its fixes in batches by area; never land a rule with a blanket disable. A disable comment on one line says why that line is the exception.

lint:check runs with --deny-warnings, so a "warn" rule blocks as well as "error".

4. Write it like the existing ones

  • oxlint rule: copy the shape of a nearby rule in shift-plugin.mjs (meta.messages saying what to write instead, create(context) returning node visitors). Add describe cases to scripts/oxlint/shift-plugin.test.mjs for a flagged line and an unflagged look-alike; run pnpm test:lint-rules.

  • scan-ts kind: add it to KINDS, check it in FileScan#check (or across files in TsScan#findings), add a test in scripts/scan/scan-ts.test.mjs; run pnpm test:scan.

  • shift-scan kind: add a Kind variant (with as_str), report it from FileScan or CrateScan, and add a test in crate_scan.rs. Then run:

    cargo test -p shift-scan
    cargo clippy -p shift-scan --all-targets -- -D warnings
    cargo fmt -p shift-scan
    

5. Write the rule down where it's read

Add or update the rule's line in the skill that owns it (typescript, rust, signals, writing-tests, ui, jsdoc) and end it with "Enforced by shift/<rule>" or "Reported by pnpm scan:ts --kind <kind>". AGENTS.md's anti-slop list holds only rules no tool checks; remove a rule from it once a check covers it.

Running the scanners on a branch

Before review, report only what the branch touches:

pnpm scan:ts --since origin/main
pnpm scan:rust --since origin/main

Treat each finding as a question, not a failure: say for each whether to fix it in the branch, leave it (and why), or turn it into a rule.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

commit

無料

Canonical rules for writing git commits in the Shift codebase. Use whenever the user asks to commit, stage and commit, create a pull request that requires commits, or draft a commit message. Enforces Conventional Commits, release-note quality, concise subjects, and logical commit boundaries.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shift3792026年10月29日 更新

dead-code

無料

Find and remove dead code (unused files, exports, class members) using Knip as a candidate generator, then verify each candidate through AST-level analysis and interface tracing before removing anything. Use when the user asks to clean up unused code, find dead code, or reduce the codebase.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shift3792026年10月29日 更新

docs

無料

Update or create DOCS.md files for Shift subsystems. Use this skill whenever the user asks to update docs, refresh documentation, create a DOCS.md, write module documentation, or says "update docs for X". Also trigger after completing a large feature when Claude.md says to update docs — check if any DOCS.md in the affected subsystem needs refreshing.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shift3792026年10月29日 更新

Adversarially fact-check DOCS.md files against the actual source code, verifying every concrete claim rather than trusting structure checks. Use when the user asks to audit docs, verify documentation accuracy, check whether docs are still true, or on a scheduled documentation review. This is the semantic layer the mechanical checkers cannot cover.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shift3792026年10月29日 更新

issue

無料

Canonical rules for finding, creating, and updating Shift GitHub issues. Use whenever the user asks to file, create, open, update, triage, or search for an issue, or when substantial work needs an issue before a pull request. Prevents duplicates and defines acceptance criteria and pull-request closure semantics.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shift3792026年10月29日 更新

jsdoc

無料

Add or revise source-level JSDoc for Shift APIs. Use this skill before writing or editing documentation comments for exported classes, methods, constructors, domain data structures, render frames, reactive state, or any API where caller intent, side effects, lifetime, ownership, or nullability are easy to misunderstand.

日本語の概要は準備中です。原文の説明を表示しています。

shift-editor/shift3792026年10月29日 更新

shift-editor のスキルをすべて見る

このスキルの問題を報告する