From 0120e3277fa8fb7d9db1c9020f1d5c0ae5a84070 Mon Sep 17 00:00:00 2001 From: okash1n <48118431+okash1n@users.noreply.github.com> Date: Fri, 12 Jun 2026 12:20:48 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20rules/=20=E3=82=92=E7=8F=BE=E8=A1=8C?= =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AB=E8=A6=B3=E7=82=B9=E3=81=A7=E3=82=B9?= =?UTF-8?q?=E3=83=AA=E3=83=A0=E5=8C=96=20=E2=80=94=20patterns/hooks=20?= =?UTF-8?q?=E5=BB=83=E6=AD=A2=E3=83=BB=E6=83=85=E5=A0=B1=E9=87=8F=E3=82=BC?= =?UTF-8?q?=E3=83=AD=E8=A1=8C=E3=81=AE=E5=89=8A=E9=99=A4=EF=BC=88#117?= =?UTF-8?q?=E3=80=81v0.67.0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - patterns.md 廃止(有効 2 行は coding-style.md へ統合)、hooks.md 廃止(要点は CLAUDE.md へ移設) - agents.md を委譲閾値 + 出力照合の 2 行に書換 - anti-patterns / coding-style / permissions-guide から harness 標準・デフォルト挙動の再記述を削除 - README の rules 数を 10→8 に追随 Closes #117 --- CHANGELOG.md | 11 +++++++++++ CLAUDE.md | 2 ++ README.en.md | 4 ++-- README.md | 2 +- rules/agents.md | 4 +--- rules/anti-patterns.md | 1 - rules/coding-style.md | 6 ++---- rules/hooks.md | 6 ------ rules/patterns.md | 6 ------ rules/permissions-guide.md | 1 - 10 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 rules/hooks.md delete mode 100644 rules/patterns.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 9686a3f..578c18d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [0.67.0] - 2026-06-12 + +LLM 性能監査(#121)P4 の第 1 弾(#117)。常時注入される rules/ から現行モデルに情報量のない行を削除した(10 → 8 ファイル)。 + +### Removed +- **rules/patterns.md / rules/hooks.md を廃止(#117)**: patterns.md は「既存パターン踏襲」(harness 標準と重複)と「詳細例は skills へ」(ルール作者向けメタ指示の誤配置)を削除し、有効な 2 行(抽象化の閾値・構造化パーサ優先)を coding-style.md へ統合。hooks.md は hook 作成時しか意味を持たないリファレンスの常時注入だったため、要点をリポジトリ CLAUDE.md の Hook Fragment Assembly 節へ移設(SessionStart/SessionEnd の用途限定行はキット自身の利用実態と矛盾するため削除)。既存配備分は update の retired 掃除で除去 +- **行単位の削除(#117)**: anti-patterns.md「Load only task-relevant files…」(小コンテキスト時代の遺物)、agents.md の 8 領域列挙と並列実行・スコープ最小化行(agents/*.md の description と harness 標準の再記述)、coding-style.md の immutability 選好(JS テンプレ由来の越境。TS/JS スコープでは skills/coding-standards がカバー)とデフォルト挙動の再掲 3 行、permissions-guide.md の回帰テスト義務(キット開発規約のグローバル漏出 — リポジトリ CLAUDE.md へ移設) + +### Changed +- **rules/agents.md を委譲閾値基準に書換(#117)**: 「Delegate to a subagent only when the task is large enough to amortize the overhead, or benefits from isolation or parallelism」+ 出力照合の 2 行に縮小(反証検証で「残す」と判定された L6 は維持) + ## [0.66.0] - 2026-06-12 LLM 性能監査(#121)P3 の最終弾(#116)。skills の一律強制を縮小し内容の鮮度を更新した。 diff --git a/CLAUDE.md b/CLAUDE.md index 581a7b9..dc2d0cf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -244,6 +244,8 @@ Rules to remember: verify fresh install, `setup.sh --update`/`/update-kit`, and Multiple features can safely use the same hook type (e.g., `PreCompact`, `PostCompact`) — `merge_deep()` concatenates arrays instead of replacing them. +**Hook authoring conventions** (formerly distributed as `rules/hooks.md`): treat hook stdout/stderr as user-visible control surfaces and keep output concise; prefer external hook scripts over inline JSON shell when logic is nontrivial; filter by matcher first, then validate the real tool input schema inside the script. New hooks.json fragments and permissions.json changes need a regression test under `tests/unit/` (follow the `test-hook-fixtures.sh` style). + **Hook ordering matters**: `safety-net` must be the **first** entry in `hook_fragments[]` so its `PreToolUse` entry appears at index 0 (runs before other PreToolUse hooks). When adding new PreToolUse hooks, append after safety-net. **`build_settings_file()`** in `lib/deploy.sh` is the single unified settings.json builder. It accepts an output path parameter and is called by both fresh install and update paths. diff --git a/README.en.md b/README.en.md index d14031b..bad6a86 100644 --- a/README.en.md +++ b/README.en.md @@ -51,7 +51,7 @@ Claude Code Starter Kit bootstraps a consistent, high-quality Claude Code enviro - **3 profiles**: Minimal, Standard (recommended), Full - **9 agents**: planner, architect, tdd-guide, code-reviewer, security-reviewer, build-error-resolver, e2e-runner, refactor-cleaner, doc-updater -- **10 rules**: coding-style, git-workflow, hooks, patterns, performance, security, testing, agents, anti-patterns, permissions-guide +- **8 rules**: coding-style, git-workflow, performance, security, testing, agents, anti-patterns, permissions-guide - **20 slash commands**: /plan, /tdd, /build-fix, /e2e, /verify, /research, /web-article, /oss-analyze, /web-source-review, /handover, /update-kit, and more - **12 skill modules**: backend-patterns, frontend-patterns, security-review, tdd-workflow, prompt-patterns, and more - **11 optional hooks/settings**: safety net (cc-safety-net), auto update, web content update, tmux reminder, doc blocker, Prettier or Biome formatting, PR creation log, pre-compact snapshot (opt-in), statusline, doc size guard, feature recommendation @@ -392,7 +392,7 @@ claude-code-starter-kit/ │ ├── en/ # English templates & strings │ └── ja/ # Japanese templates & strings ├── agents/ # Agent definitions (9 files) -├── rules/ # Rule files (10 files) +├── rules/ # Rule files (8 files) ├── commands/ # Slash commands (20 files) └── skills/ # Skill modules (12 dirs) ``` diff --git a/README.md b/README.md index f64e167..893f3cb 100644 --- a/README.md +++ b/README.md @@ -1103,7 +1103,7 @@ claude-code-starter-kit/ │ ├── en/ # 英語 │ └── ja/ # 日本語 ├── agents/ # AI エージェント定義(9種) -├── rules/ # コーディングルール(10種) +├── rules/ # コーディングルール(8種) ├── commands/ # スラッシュコマンド(20個) └── skills/ # スキルモジュール(12個) ``` diff --git a/rules/agents.md b/rules/agents.md index f65296f..9e99163 100644 --- a/rules/agents.md +++ b/rules/agents.md @@ -1,6 +1,4 @@ # Agents -- Use specialized agents for clearly complex planning, architecture, review, security, TDD, E2E, cleanup, or docs work. -- Run independent agent/review work in parallel when it reduces wait time. -- Keep each agent prompt scoped to one responsibility and the minimum context needed. +- Delegate to a subagent only when the task is large enough to amortize the overhead, or benefits from isolation or parallelism. - After agent output, reconcile findings yourself before changing code or reporting completion. diff --git a/rules/anti-patterns.md b/rules/anti-patterns.md index 4d947fb..2fe68d2 100644 --- a/rules/anti-patterns.md +++ b/rules/anti-patterns.md @@ -4,4 +4,3 @@ - Implement the requested scope; ask before adding adjacent features. - Do not claim completion until required tests or checks have actually passed. - If the same approach fails repeatedly, stop and choose a different approach or report the blocker. -- Load only task-relevant files and summarize large error output. diff --git a/rules/coding-style.md b/rules/coding-style.md index 5e9706a..023f7ec 100644 --- a/rules/coding-style.md +++ b/rules/coding-style.md @@ -1,7 +1,5 @@ # Coding Style -- Prefer immutable updates over mutating objects or arrays in place. -- Keep files focused; split large modules when a real boundary appears. - Validate external input and handle errors with useful messages. -- Keep functions small enough to review, with shallow control flow. -- Avoid hardcoded values, stray debug output, and unrelated refactors. +- Add abstraction only when it removes meaningful duplication or complexity. +- Prefer structured parsers/APIs over ad-hoc string manipulation. diff --git a/rules/hooks.md b/rules/hooks.md deleted file mode 100644 index e844e08..0000000 --- a/rules/hooks.md +++ /dev/null @@ -1,6 +0,0 @@ -# Hooks - -- Treat hook stdout/stderr as user-visible control surfaces; keep output concise. -- Prefer external hook scripts over inline JSON shell when logic is nontrivial. -- Filter by matcher first, then validate real tool input schema inside the script. -- Use SessionStart only for startup/resume needs and SessionEnd for audits. diff --git a/rules/patterns.md b/rules/patterns.md deleted file mode 100644 index a9cadb8..0000000 --- a/rules/patterns.md +++ /dev/null @@ -1,6 +0,0 @@ -# Patterns - -- Follow existing project patterns before introducing new abstractions. -- Add abstraction only when it removes meaningful duplication or complexity. -- Prefer structured parsers/APIs over ad-hoc string manipulation. -- Put detailed language/framework examples in skills or project docs, not always-loaded rules. diff --git a/rules/permissions-guide.md b/rules/permissions-guide.md index a6332ab..301a920 100644 --- a/rules/permissions-guide.md +++ b/rules/permissions-guide.md @@ -2,4 +2,3 @@ - Keep allowlists narrow and tied to real workflows. - Do not bypass safety hooks by changing commands unless the user explicitly approves. -- When adding hooks or permissions, add a regression test for the intended tool schema.