Files
everything-claude-code/docs/ja-JP/rules
konstapukarifastnetfi 8b24f63ede fix: refresh stale technical content in agents, rules, and skills (#2168)
Several published examples contained APIs that no longer exist, code that
does not run, or model versions that drifted from reality:

- agents/performance-optimizer.md used the web-vitals v3 API
  (getCLS/getFID/getLCP/getFCP/getTTFB) and reported FID. web-vitals v4
  renamed the imports to onCLS/onINP/onLCP/onFCP/onTTFB and FID was
  replaced by INP (target < 200ms)
- rules/common/performance.md pinned stale model versions in the
  model-selection guidance; refresh to the versions the repo itself uses
  (agent.yaml pins claude-opus-4-6) and add the PowerShell variant for
  MAX_THINKING_TOKENS next to the bash export
- skills/python-patterns/SKILL.md: both get_value examples referenced
  default_value without declaring the parameter (NameError); add
  default_value: Any = None to the EAFP and LBYL signatures
- skills/frontend-patterns/SKILL.md: the custom useQuery example rebuilt
  refetch whenever callers passed inline fetchers/options, re-triggering
  the effect after every state update (infinite fetch loop). Keep the
  latest fetcher/options in refs so refetch stays referentially stable.
  The PASS-labelled useMemo example mutated its input with in-place sort;
  copy before sorting
- skills/coding-standards/SKILL.md repeated the same PASS-labelled
  in-place-sort-in-useMemo example; same fix
- rules/typescript/security.md used a vendor-specific OPENAI_API_KEY in
  generic guidance; switch to a neutral API_KEY

Every hand-maintained copy of the affected content is synced in the same
change: locale mirrors (ja-JP, ko-KR, pt-BR, tr, zh-CN, zh-TW - each only
where it carries the affected file) and the .agents/.kiro/.cursor harness
mirrors. Two structural divergences are left alone and noted here:
.kiro/steering/performance.md has no extended-thinking control list to
carry the PowerShell variant, and docs/zh-TW/rules/performance.md keeps an
older condensed thinking section without the budget-cap line.
rules/zh/performance.md is intentionally untouched - the rules/zh tree is
being retired in a separate change
2026-06-07 13:26:01 +08:00
..

ルール

構造

ルールは common レイヤーと 言語固有 ディレクトリで構成されています:

rules/
├── common/          # 言語に依存しない原則(常にインストール)
│   ├── coding-style.md
│   ├── git-workflow.md
│   ├── testing.md
│   ├── performance.md
│   ├── patterns.md
│   ├── hooks.md
│   ├── agents.md
│   └── security.md
├── typescript/      # TypeScript/JavaScript 固有
├── python/          # Python 固有
└── golang/          # Go 固有
  • common/ には普遍的な原則が含まれています。言語固有のコード例は含まれません。
  • 言語ディレクトリ は common ルールをフレームワーク固有のパターン、ツール、コード例で拡張します。各ファイルは対応する common ファイルを参照します。

インストール

オプション 1: インストールスクリプト(推奨)

# common + 1つ以上の言語固有ルールセットをインストール
./install.sh typescript
./install.sh python
./install.sh golang

# 複数の言語を一度にインストール
./install.sh typescript python

オプション 2: 手動インストール

重要: ディレクトリ全体をコピーしてください。/* でフラット化しないでください。 Common と言語固有ディレクトリには同じ名前のファイルが含まれています。 それらを1つのディレクトリにフラット化すると、言語固有ファイルが common ルールを上書きし、 言語固有ファイルが使用する相対パス ../common/ の参照が壊れます。

# common ルールをインストール(すべてのプロジェクトに必須)
cp -r rules/common ~/.claude/rules/common

# プロジェクトの技術スタックに応じて言語固有ルールをインストール
cp -r rules/typescript ~/.claude/rules/typescript
cp -r rules/python ~/.claude/rules/python
cp -r rules/golang ~/.claude/rules/golang

# 注意!実際のプロジェクト要件に応じて設定してください。ここでの設定は参考例です。

ルール vs スキル

  • ルール は広範に適用される標準、規約、チェックリストを定義します(例: 「80% テストカバレッジ」、「ハードコードされたシークレットなし」)。
  • スキル skills/ ディレクトリ)は特定のタスクに対する詳細で実行可能な参考資料を提供します(例: python-patternsgolang-testing)。

言語固有のルールファイルは必要に応じて関連するスキルを参照します。ルールは 何を するかを示し、スキルは どのように するかを示します。

新しい言語の追加

新しい言語(例: rust/)のサポートを追加するには:

  1. rules/rust/ ディレクトリを作成
  2. common ルールを拡張するファイルを追加:
    • coding-style.md — フォーマットツール、イディオム、エラーハンドリングパターン
    • testing.md — テストフレームワーク、カバレッジツール、テスト構成
    • patterns.md — 言語固有の設計パターン
    • hooks.md — フォーマッタ、リンター、型チェッカー用の PostToolUse フック
    • security.md — シークレット管理、セキュリティスキャンツール
  3. 各ファイルは次の内容で始めてください:
    > このファイルは [common/xxx.md](../common/xxx.md) を <言語> 固有のコンテンツで拡張します。
    
  4. 利用可能な既存のスキルを参照するか、skills/ 配下に新しいものを作成してください。