diff --git a/CHANGELOG.md b/CHANGELOG.md index c75970d..a77dfc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ 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.63.0] - 2026-06-12 + +LLM 性能監査(#121)P2 の最終弾(#113)。残る挙動ガード hook を整理した。 + +### Removed +- **console-log-guard を廃止(#113)**: JS/TS 編集ごとの console.log 警告と SessionEnd 全体監査を撤去。exit 0 の stderr 警告はモデルの行動を変えられず、CLI ツール等の正当な console.log にも無差別警告していた。rules/coding-style.md の「stray debug output」ルールと linter(ESLint no-console / biome)への委譲で代替 +- **git-push-review を廃止(#113)**: git push 前の定型リマインダー(情報量ゼロの stderr 1 行)を撤去。実効的なガードは permissions.json の force-push deny 側が担っている。lib/deploy.sh の `__EDITOR_CMD__` 置換特例(デッドコード)と `editor_command()`(呼び出し元ゼロ)も削除。エディタ選択ステップは設定記録用として存続(文言を修正) +- 両 feature とも `_RETIRED_HOOK_FEATURES` に追加 — 既存インストールの settings.json エントリと hook スクリプトは update 時に自動掃除。`ENABLE_CONSOLE_LOG_GUARD` / `ENABLE_GIT_PUSH_REVIEW` はレガシーキー化 + +### Changed +- **doc-size-guard を警告専用に再設計(#113)**: (1) 誤検知がほぼ 100% だったパス参照チェック(バッククォート内の `/` や `.` を含む全文字列を実在パスとして検証)を削除、(2) ERROR / exit 1 を廃止して常に非ブロックの WARNING のみに、(3) 閾値を現行モデルの指示追従力に合わせて緩和(CLAUDE.md warn 150→250 行、AGENTS.md warn 60→150 行)、(4) feature.json の `standard: true` と profiles/standard.conf の `false` の矛盾を解消(standard は false が実態) +- **no-flicker を opt-in 化(#113)**: standard / full の既定を false に変更。CLAUDE_CODE_NO_FLICKER はもはや experimental ではなく現行 CLI には第一級の `tui: "fullscreen"` 設定が存在する。また現行 Claude Code は tmux 等の環境で fullscreen レンダラーを意図的に自動無効化しており、無条件 env 注入はその安全側判定をオーバーライドするため既定配布をやめる。description から「experimental」を削除。`tui` キーへの移行は対応最小バージョン確認後に別途実施 + ## [0.62.0] - 2026-06-12 LLM 性能監査(#121)P2 の第 2 弾(#112)。doc-blocker を allowlist 全拒否から slop パターン拒否方式に反転した。 diff --git a/CLAUDE.md b/CLAUDE.md index 8fae209..581a7b9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -232,7 +232,7 @@ Rules to remember: verify fresh install, `setup.sh --update`/`/update-kit`, and 5. In `wizard/steps.sh`: add confirmation display in `_step_confirm()` and the non-interactive default in `_fill_noninteractive_defaults()` 6. If the feature is a hook, add to `HOOK_KEYS` / `HOOK_TOKENS` in `wizard/registry.sh`, add `STR_HOOKS_*` strings in both i18n files, and add the hook label to `HOOK_LABELS` 7. Features are auto-collected by `build_settings_file()` in `lib/deploy.sh` via `_FEATURE_ORDER` / `_FEATURE_FLAGS` registry — no manual merge code needed -8. If external scripts needed: add `[name]=true` to `_FEATURE_HAS_SCRIPTS` in `lib/features.sh` — fresh deploy (`deploy_hook_scripts()`), update deploy (`_update_hook_scripts()`), and manifest/snapshot tracking (`collect_managed_target_files()`) all iterate `_FEATURE_SCRIPT_ORDER` × `_FEATURE_HAS_SCRIPTS`. A feature excluded from `_FEATURE_ORDER` (settings fragment special-cased, like `git-push-review`) must be appended to `_FEATURE_SCRIPT_ORDER` so its scripts still flow through all three paths +8. If external scripts needed: add `[name]=true` to `_FEATURE_HAS_SCRIPTS` in `lib/features.sh` — fresh deploy (`deploy_hook_scripts()`), update deploy (`_update_hook_scripts()`), and manifest/snapshot tracking (`collect_managed_target_files()`) all iterate `_FEATURE_SCRIPT_ORDER` × `_FEATURE_HAS_SCRIPTS`. A feature ever excluded from `_FEATURE_ORDER` (settings fragment special-cased) must be appended to `_FEATURE_SCRIPT_ORDER` so its scripts still flow through all three paths (no such feature exists currently — the two lists are identical) 9. If the feature creates files outside the standard manifest-tracked directories, add explicit cleanup to `uninstall.sh` 10. Verify update-path adoption. A new key must be checked in all of these paths: - fresh install diff --git a/README.en.md b/README.en.md index 98ac607..97d95e4 100644 --- a/README.en.md +++ b/README.en.md @@ -54,7 +54,7 @@ Claude Code Starter Kit bootstraps a consistent, high-quality Claude Code enviro - **10 rules**: coding-style, git-workflow, hooks, patterns, performance, security, testing, agents, anti-patterns, permissions-guide - **21 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 -- **13 optional hooks/settings**: safety net (cc-safety-net), auto update, web content update, tmux reminder, git push review, doc blocker, Prettier or Biome formatting, console.log guard, PR creation log, pre-compact snapshot (opt-in), statusline, doc size guard, feature recommendation +- **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 - **14 plugins** from multiple marketplaces: security-guidance, commit-commands, pr-review-toolkit, feature-dev, code-review, claude-md-management, superpowers, code-simplifier, document-skills, example-skills, typescript-lsp, gopls-lsp, pyright-lsp, rust-analyzer-lsp - **i18n**: English & Japanese - **Codex Plugin** sub-agent integration (optional, supports ChatGPT sign-in or OpenAI API key auth) @@ -146,7 +146,7 @@ Language → Profile → Codex Plugin → New /init → Editor → Ghostty → F Each step shows numbered options with descriptions. Recommended choices are marked. -> **About the Editor step**: The wizard asks which code editor you use. This decides whether the git push review hook is enabled (it prints a review reminder before `git push`; it does not launch an editor or show a diff). Choosing "None" skips the hook entirely. **If you don't have an editor installed or aren't sure, choose "None"** — Claude Code works entirely in the terminal and does not require an editor. +> **About the Editor step**: The wizard asks which code editor you use, purely to record your environment in the saved config. **If you don't have an editor installed or aren't sure, choose "None"** — Claude Code works entirely in the terminal and does not require an editor. > **Want to know where each choice is applied?** See [Wizard Config Mapping](docs/wizard-config-mapping.en.md). It explains which values are written to `settings.json`, which are used only during setup, and which act as presets. > @@ -154,7 +154,7 @@ Each step shows numbered options with descriptions. Recommended choices are mark ### Editor Setup (Optional) -A code editor is a dedicated application for writing and editing code. While Claude Code runs in the terminal and doesn't require one, having an editor enables the git push review hook feature. +A code editor is a dedicated application for writing and editing code. Claude Code runs in the terminal and doesn't require one. **Recommended: [VS Code](https://code.visualstudio.com/)** (free, by Microsoft) - **macOS**: Download from [code.visualstudio.com](https://code.visualstudio.com/), then run `Cmd + Shift + P` → "Shell Command: Install 'code' command in PATH" @@ -191,14 +191,12 @@ Hooks are automated safety checks that run automatically when Claude Code execut | **Safety Net** | Blocks destructive git/filesystem commands (`git reset --hard`, `rm -rf`, `git push --force`, etc.) before execution | | **Auto Update** | Checks for starter kit updates on session start and applies them in the background | | Tmux Reminder | Suggests run_in_background for foreground dev servers (non-blocking) | -| Git Push Review | Pauses before git push for code review | | Doc Blocker | Asks for confirmation only on ad-hoc SUMMARY/REPORT style docs (general docs pass) | | Prettier Auto-format | Formats JS/TS files after edits | | Biome Auto-format | Formats and lints JS/TS files after edits (Full uses Biome instead of Prettier) | -| Console.log Guard | Warns about console.log statements left in code | | PR Creation Log | Logs PR URL after creation | | Pre-compact Snapshot | Stashes tracked changes before context compaction (opt-in) | -| Doc Size Guard | Warns when CLAUDE.md/AGENTS.md exceeds recommended line count (Full only) | +| Doc Size Guard | Warns when CLAUDE.md/AGENTS.md exceeds size-hygiene targets (non-blocking; Full only) | | Web Content Update | Auto-updates the web-content-extraction skill's deps on session start (opt-in; default in Full only) | | Feature Recommendation | Notifies about newly available features for the selected profile | @@ -329,7 +327,7 @@ NONINTERACTIVE=1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/cloudna --new-init=true \ --codex-plugin=false \ --commit-attribution=false \ - --hooks=safety-net,auto-update,tmux,git-push,prettier,console,pr-log,pre-commit \ + --hooks=safety-net,auto-update,tmux,prettier,pr-log,pre-commit \ --plugins=security-guidance,commit-commands,pr-review-toolkit,document-skills@anthropic-agent-skills # Reuse a saved config diff --git a/README.md b/README.md index 73c8edc..6e4abec 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ irm https://raw.githubusercontent.com/cloudnative-co/claude-code-starter-kit/mai メモ帳(テキストエディット)のプログラミング向け高機能版と考えてください。コードの色分け表示、入力補完、エラー検出など、コーディングを助ける機能が備わっています。 > **Claude Code 自体はターミナルで動くため、エディタがなくても使えます。** -> ただし、このキットの一部機能(git push 前のコードレビュー)でエディタと連携できるため、ウィザードでエディタの質問が表示されます。 +> ウィザードのエディタの質問は、使用環境の記録(設定の保存・将来の連携機能)のためのものです。 > **エディタを持っていない場合や、よくわからない場合は「なし」を選べば問題ありません。** #### おすすめエディタ:VS Code @@ -365,7 +365,7 @@ cd claude-code-starter-kit > 何を選べばいいかわからない場合は、**Standard プロファイル** を選べば間違いありません。 > **エディタの質問について**: ステップ 5 で「どのエディタを使っていますか?」と聞かれます。 -> これは git push レビューフック(push 実行前にレビューを促すリマインダーを表示する機能)を有効にするかどうかの設定です。 +> これは使用しているエディタを記録するための設定です(現在この選択で挙動が変わる機能はありません)。 > エディタの起動や差分表示は行いません。「なし」を選ぶとこのフックは追加されません。 > **エディタをインストールしていない場合や、わからない場合は「5) なし」を選んでください。** Claude Code の動作には影響しません。 > エディタの詳細は「[エディタ(コードエディタ)とは?](#エディタコードエディタとは)」をご覧ください。 @@ -471,14 +471,12 @@ URL・公式ドキュメント・ブログ・ニュース・OSS ページを読 | **Safety Net** | **破壊的な git/ファイルシステムコマンド(`git reset --hard`、`rm -rf` 等)を実行前にブロック** | | **自動アップデート** | **セッション開始時にスターターキットの最新版を自動で適用** | | Tmux リマインダー | foreground の dev サーバーに run_in_background を提案(非ブロック) | -| Git Push レビュー | コードを共有する前に確認を促す | | Doc ブロッカー | SUMMARY/REPORT 等のアドホック文書のみ確認に降格(一般文書は素通し) | | Prettier 自動フォーマット | JS/TS ファイルを自動で見た目を整える | | Biome 自動フォーマット | JS/TS ファイルを整形・lint(Full は Prettier の代わりに Biome) | -| Console.log ガード | デバッグ用コードの消し忘れを警告 | | PR 作成ログ | Pull Request の URL を記録 | | コンパクト前スナップショット | compact 直前に tracked 変更を git stash に退避(opt-in) | -| ドキュメントサイズガード | CLAUDE.md/AGENTS.md の肥大化を警告(Full のみ) | +| ドキュメントサイズガード | CLAUDE.md/AGENTS.md の肥大化を警告(非ブロック・Full のみ) | | Web 取得スキル更新 | web-content-extraction スキルの依存を起動時に自動更新(opt-in・Full のみ既定有効) | | 機能レコメンド | 選択プロファイルで利用可能になった新機能を通知 | @@ -855,7 +853,7 @@ NONINTERACTIVE=1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/cloudna --codex-plugin=false \ --commit-attribution=false \ --ghostty=true \ - --hooks=safety-net,auto-update,tmux,git-push,prettier,console,pr-log,pre-commit \ + --hooks=safety-net,auto-update,tmux,prettier,pr-log,pre-commit \ --plugins=security-guidance,commit-commands,pr-review-toolkit,document-skills@anthropic-agent-skills ``` diff --git a/docs/GUIDES/hooks-reference.md b/docs/GUIDES/hooks-reference.md index e6c49fc..5d761da 100644 --- a/docs/GUIDES/hooks-reference.md +++ b/docs/GUIDES/hooks-reference.md @@ -11,7 +11,7 @@ |---|---| | `SessionStart` | auto-update, web-content-update, feature-recommendation | | `SessionEnd` | auto-update | -| `PreToolUse` | safety-net, tmux-hooks, doc-blocker, console-log-guard, git-push-review | +| `PreToolUse` | safety-net, tmux-hooks, doc-blocker | | `PostToolUse` | prettier-hooks, biome-hooks, doc-size-guard, pr-creation-log | | `PreCompact` | pre-compact-commit | diff --git a/docs/wizard-config-mapping.en.md b/docs/wizard-config-mapping.en.md index 2050614..31ed1fc 100644 --- a/docs/wizard-config-mapping.en.md +++ b/docs/wizard-config-mapping.en.md @@ -18,7 +18,7 @@ Not every saved value is supposed to appear in `settings.json`. In particular, ` | Profile | `PROFILE` / `--profile` | Preset bundle for other defaults | wizard initialization, manifest | No | | Codex Plugin | `ENABLE_CODEX_PLUGIN` / `--codex-plugin` | Whether to install Codex Plugin and run CLI auth | Codex Plugin setup in `setup.sh` | No | | New `/init` | `ENABLE_NEW_INIT` / `--new-init` | Enable Claude Code's interactive `/init` flow | `settings.json` `env.CLAUDE_CODE_NEW_INIT` | Yes | -| Editor | `EDITOR_CHOICE` / `--editor` | Whether the git push review hook is enabled (`none` skips the hook fragment entirely) | Hook fragment inclusion, manifest | Indirectly | +| Editor | `EDITOR_CHOICE` / `--editor` | Records your editor (no feature currently changes behavior based on it) | Saved config, manifest | No | | Ghostty | `ENABLE_GHOSTTY_SETUP` / `--ghostty` | Extra Ghostty setup | Ghostty setup flow | No | | Hooks | `ENABLE_*` / `--hooks` | Which hooks are enabled | Hook fragments merged into `settings.json` | Yes | | Plugins | `SELECTED_PLUGINS` / `--plugins` | Recommended Claude Code plugins to install | Plugin install flow, manifest | No | @@ -32,7 +32,7 @@ Not every saved value is supposed to appear in `settings.json`. In particular, ` | `LANGUAGE` | UI and generated file language | `settings.json`, `CLAUDE.md`, i18n | Currently written as `English` or `日本語` | | `PROFILE` | Minimal / Standard / Full / Custom preset | Wizard defaults, manifest | Expanded into lower-level flags during setup | | `ENABLE_NEW_INIT` | Claude Code's new interactive `/init` mode | `settings.json` `env.CLAUDE_CODE_NEW_INIT` | Defaults to `true` for Minimal, Standard, and Full; Custom asks explicitly | -| `EDITOR_CHOICE` | Gates the git push review hook | Inclusion of `features/git-push-review/hooks.json` | `none` skips the hook fragment entirely. The hook only prints a review reminder to stderr before `git push`; it does not launch an editor or show a diff | +| `EDITOR_CHOICE` | Recorded for reference only | Saved config and manifest | With git-push-review retired, no feature changes behavior based on this value | | `COMMIT_ATTRIBUTION` | Claude Code attribution on or off | `settings.json` `attribution.commit`, `attribution.pr` | `false` clears both commit and PR attribution | | `ENABLE_CODEX_PLUGIN` | Run Codex Plugin setup or skip it | Codex CLI auth and plugin install | A setup action, not a JSON setting | | `ENABLE_GHOSTTY_SETUP` | Optional Ghostty setup | Ghostty install/config flow | Disabled automatically outside macOS | @@ -59,11 +59,11 @@ These flags are used to merge the corresponding `features/*/hooks.json` fragment | `ENABLE_AUTO_UPDATE` | Auto Update | Check for starter kit updates on session start | Yes | | `ENABLE_WEB_CONTENT_UPDATE` | Web Content Update | Check web extraction skill dependency updates | Yes | | `ENABLE_TMUX_HOOKS` | Tmux Reminder | Suggest run_in_background for foreground dev servers (non-blocking) | Yes | -| `ENABLE_GIT_PUSH_REVIEW` | Git Push Review | Pause before push and open a diff | Yes | +| `ENABLE_GIT_PUSH_REVIEW` | (retired) effective guard lives in permissions | None | Read as a legacy key and ignored | | `ENABLE_DOC_BLOCKER` | Doc Blocker | Ask-only guard for slop doc patterns (general docs allowed) | Yes | | `ENABLE_PRETTIER_HOOKS` | Prettier Auto-format | Format JS / TS edits | Yes | | `ENABLE_BIOME_HOOKS` | Biome Auto-format | Format and lint JS / TS edits | Yes | -| `ENABLE_CONSOLE_LOG_GUARD` | Console Log Guard | Warn on leftover `console.log` | Yes | +| `ENABLE_CONSOLE_LOG_GUARD` | (retired) delegated to rules/linters | None | Read as a legacy key and ignored | | `ENABLE_MEMORY_PERSISTENCE` | (retired) superseded by native auto-memory | None | Read as a legacy key and ignored | | `ENABLE_STRATEGIC_COMPACT` | (retired) hook removed; skill remains on-demand | None | Read as a legacy key and ignored | | `ENABLE_PR_CREATION_LOG` | PR Creation Log | PR creation logging support | Yes | diff --git a/docs/wizard-config-mapping.md b/docs/wizard-config-mapping.md index 695fc98..914599a 100644 --- a/docs/wizard-config-mapping.md +++ b/docs/wizard-config-mapping.md @@ -18,7 +18,7 @@ | プロファイル | `PROFILE` / `--profile` | 個別フラグの初期値セットを決める | `wizard` の初期化, manifest | いいえ | | Codex Plugin | `ENABLE_CODEX_PLUGIN` / `--codex-plugin` | Codex プラグインのインストールと認証を行うか | `setup.sh` の Codex Plugin セットアップ | いいえ | | 新しい `/init` | `ENABLE_NEW_INIT` / `--new-init` | Claude Code の対話型 `/init` を有効にする | `settings.json` の `env.CLAUDE_CODE_NEW_INIT` | はい | -| エディタ | `EDITOR_CHOICE` / `--editor` | git push review hook を有効にするかどうか(`none` で hook フラグメント自体をスキップ) | hook フラグメントの合成可否, manifest | 間接的 | +| エディタ | `EDITOR_CHOICE` / `--editor` | 使用エディタの記録(現在この選択で挙動が変わる機能はない) | 保存 config, manifest | いいえ | | Ghostty | `ENABLE_GHOSTTY_SETUP` / `--ghostty` | Ghostty の追加セットアップ | Ghostty 設定処理 | いいえ | | フック | `ENABLE_*` / `--hooks` | 有効化するフックを選ぶ | `settings.json` の hooks 合成 | はい | | プラグイン | `SELECTED_PLUGINS` / `--plugins` | Claude Code セッション内で有効化する推奨プラグイン | プラグイン導入処理, manifest | いいえ | @@ -32,7 +32,7 @@ | `LANGUAGE` | UI 表示言語と生成物の言語 | `settings.json`, `CLAUDE.md`, i18n | 現在は `日本語` / `English` を設定 | | `PROFILE` | Minimal / Standard / Full / Custom の初期値選択 | `wizard` のデフォルト展開, manifest | 実際の挙動は個別フラグへ展開される | | `ENABLE_NEW_INIT` | Claude Code の新しい `/init` 対話モード | `settings.json` の `env.CLAUDE_CODE_NEW_INIT` | Minimal / Standard / Full は既定 `true`、Custom では選択式 | -| `EDITOR_CHOICE` | git push review hook の有効化判定 | `features/git-push-review/hooks.json` の合成可否 | `none` のときは hook フラグメント自体をスキップ。hook は push 前に stderr へレビューリマインダーを表示するだけで、エディタ起動や差分表示は行わない | +| `EDITOR_CHOICE` | 使用エディタの記録のみ | 保存 config と manifest への記録 | git-push-review hook の廃止に伴い、この値で挙動が変わる機能はなくなった | | `COMMIT_ATTRIBUTION` | Claude Code 帰属の表示有無 | `settings.json` の `attribution.commit`, `attribution.pr` | `false` で commit / PR 両方の帰属表示を空文字にする | | `ENABLE_CODEX_PLUGIN` | Codex Plugin セットアップ実行可否 | Codex CLI 認証と plugin install | 反映は `settings.json` ではなく外部セットアップ | | `ENABLE_GHOSTTY_SETUP` | Ghostty の追加セットアップ | macOS 向け Ghostty 設定 | macOS 以外では無効化される | @@ -59,11 +59,11 @@ | `ENABLE_AUTO_UPDATE` | Auto Update | セッション開始時の更新確認 | はい | | `ENABLE_WEB_CONTENT_UPDATE` | Web Content Update | Web 取得スキル依存の更新確認 | はい | | `ENABLE_TMUX_HOOKS` | Tmux Reminder | foreground の dev サーバーに run_in_background を提案(非ブロック) | はい | -| `ENABLE_GIT_PUSH_REVIEW` | Git Push Review | push 前に差分確認 | はい | +| `ENABLE_GIT_PUSH_REVIEW` | (廃止)実効ガードは permissions 側が担当 | なし | レガシーキーとして読み捨て | | `ENABLE_DOC_BLOCKER` | Doc Blocker | SUMMARY/REPORT 等の slop パターンのみ確認に降格(一般文書は許可) | はい | | `ENABLE_PRETTIER_HOOKS` | Prettier Auto-format | JS / TS 編集後の整形 | はい | | `ENABLE_BIOME_HOOKS` | Biome Auto-format | JS / TS 編集後の整形・lint | はい | -| `ENABLE_CONSOLE_LOG_GUARD` | Console Log Guard | `console.log` の取り残し検知 | はい | +| `ENABLE_CONSOLE_LOG_GUARD` | (廃止)rules/coding-style と linter に委譲 | なし | レガシーキーとして読み捨て | | `ENABLE_MEMORY_PERSISTENCE` | (廃止)native auto-memory に委譲 | なし | レガシーキーとして読み捨て | | `ENABLE_STRATEGIC_COMPACT` | (廃止)hook は撤去、skill のみオンデマンドで残存 | なし | レガシーキーとして読み捨て | | `ENABLE_PR_CREATION_LOG` | PR Creation Log | PR 作成ログの補助 | はい | diff --git a/features/console-log-guard/feature.json b/features/console-log-guard/feature.json deleted file mode 100644 index 766bd54..0000000 --- a/features/console-log-guard/feature.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "console-log-guard", - "displayName": "Console.log Guard", - "description": "Warn about console.log in edited files and audit at session end", - "category": "hook", - "default": true, - "profiles": { "minimal": false, "standard": true, "full": true }, - "dependencies": [], - "conflicts": [] -} diff --git a/features/console-log-guard/hooks.json b/features/console-log-guard/hooks.json deleted file mode 100644 index 0d9cd10..0000000 --- a/features/console-log-guard/hooks.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "hooks": { - "PostToolUse": [ - { - "matcher": "Edit|Write", - "hooks": [ - { - "type": "command", - "command": "__HOME__/.claude/hooks/console-log-guard/check-file.sh" - } - ] - } - ], - "SessionEnd": [ - { - "matcher": "*", - "hooks": [ - { - "type": "command", - "command": "__HOME__/.claude/hooks/console-log-guard/audit-session.sh" - } - ] - } - ] - } -} diff --git a/features/console-log-guard/scripts/audit-session.sh b/features/console-log-guard/scripts/audit-session.sh deleted file mode 100755 index d6f44c6..0000000 --- a/features/console-log-guard/scripts/audit-session.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -euo pipefail - -cat >/dev/null - -if git rev-parse --git-dir >/dev/null 2>&1; then - modified_files="$(git diff --name-only HEAD 2>/dev/null | grep -E '\.(ts|tsx|js|jsx)$' || true)" - if [[ -n "$modified_files" ]]; then - while IFS= read -r file; do - if [[ -f "$file" ]] && grep -q "console\\.log" "$file" 2>/dev/null; then - echo "[Hook] WARNING: console.log in $file" >&2 - fi - done <<< "$modified_files" - fi -fi diff --git a/features/console-log-guard/scripts/check-file.sh b/features/console-log-guard/scripts/check-file.sh deleted file mode 100755 index 7fba1d5..0000000 --- a/features/console-log-guard/scripts/check-file.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -euo pipefail - -input="$(cat)" -file_path="$(printf '%s' "$input" | jq -r '.tool_input.file_path // ""')" - -if [[ "$file_path" =~ \.(ts|tsx|js|jsx)$ ]] && [[ -f "$file_path" ]]; then - console_logs="$(grep -n "console\\.log" "$file_path" 2>/dev/null || true)" - if [[ -n "$console_logs" ]]; then - echo "[Hook] WARNING: console.log found in $file_path" >&2 - printf '%s\n' "$console_logs" | head -5 >&2 - fi -fi diff --git a/features/doc-size-guard/feature.json b/features/doc-size-guard/feature.json index 9e73967..a480224 100644 --- a/features/doc-size-guard/feature.json +++ b/features/doc-size-guard/feature.json @@ -1,12 +1,12 @@ { "name": "doc-size-guard", "displayName": "Doc Size Guard", - "description": "Validates CLAUDE.md/AGENTS.md size and path integrity", + "description": "Warn when CLAUDE.md/AGENTS.md exceeds size-hygiene targets (non-blocking)", "category": "hook", "default": false, "profiles": { "minimal": false, - "standard": true, + "standard": false, "full": true }, "dependencies": [], diff --git a/features/doc-size-guard/scripts/check-doc-size.sh b/features/doc-size-guard/scripts/check-doc-size.sh index 2ef9e56..4d39929 100755 --- a/features/doc-size-guard/scripts/check-doc-size.sh +++ b/features/doc-size-guard/scripts/check-doc-size.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Doc Size Guard - Validates CLAUDE.md/AGENTS.md size and path integrity +# Doc Size Guard - Warns when CLAUDE.md/AGENTS.md grows beyond size-hygiene targets # Runs as PostToolUse hook when Write tool modifies these files set -euo pipefail @@ -15,16 +15,13 @@ if [[ ! "$written_path" =~ (CLAUDE|AGENTS)\.md$ ]]; then exit 0 fi -WARN_LINES_AGENTS=60 -ERROR_LINES_AGENTS=100 -WARN_LINES_CLAUDE=150 -ERROR_LINES_CLAUDE=300 +WARN_LINES_AGENTS=150 +WARN_LINES_CLAUDE=250 check_file_size() { local file="$1" local warn_limit="$2" - local error_limit="$3" - local label="$4" + local label="$3" if [[ ! -f "$file" ]]; then return 0 @@ -33,60 +30,25 @@ check_file_size() { local line_count line_count=$(wc -l < "$file" | tr -d ' ') - if (( line_count > error_limit )); then - echo "ERROR: ${label} is ${line_count} lines (size-hygiene threshold: ${error_limit}). Always-loaded lines cost context every turn — move details into skills/ or docs/ (progressive disclosure)." >&2 - return 1 - elif (( line_count > warn_limit )); then - echo "WARNING: ${label} is ${line_count} lines (size-hygiene target: <${warn_limit}). Consider moving details to skills/ or docs/ to reduce always-loaded context." >&2 + if (( line_count > warn_limit )); then + echo "WARNING: ${label} is ${line_count} lines (size-hygiene target: <${warn_limit}). Always-loaded lines cost context every turn — consider moving details to skills/ or docs/ (progressive disclosure)." >&2 fi return 0 } -check_path_references() { - local file="$1" - local label="$2" - - if [[ ! -f "$file" ]]; then - return 0 - fi - - local has_error=0 - while IFS= read -r path; do - local expanded_path="${path/#\~/$HOME}" - if [[ "$path" == http* || "$path" == "#"* ]]; then - continue - fi - if [[ -n "$path" && ! -e "$expanded_path" && "$path" != http* && "$path" != "#"* ]]; then - if [[ "$path" == *"/"* || "$path" == *"."* ]]; then - echo "WARNING: Broken path reference in ${label}: ${path}" >&2 - has_error=1 - fi - fi - done < <(grep -oE '`[^`]+`' "$file" 2>/dev/null | tr -d '`' | grep -E '(/|\.)' || true) - - return $has_error -} - PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" -exit_code=0 # Check AGENTS.md for agents_path in "${PROJECT_ROOT}/AGENTS.md" "${PROJECT_ROOT}/.claude/AGENTS.md"; do - if [[ -f "$agents_path" ]]; then - check_file_size "$agents_path" "$WARN_LINES_AGENTS" "$ERROR_LINES_AGENTS" "AGENTS.md" || exit_code=1 - check_path_references "$agents_path" "AGENTS.md" || true - fi + check_file_size "$agents_path" "$WARN_LINES_AGENTS" "AGENTS.md" done # Check CLAUDE.md for claude_path in "${PROJECT_ROOT}/CLAUDE.md" "${PROJECT_ROOT}/.claude/CLAUDE.md"; do - if [[ -f "$claude_path" ]]; then - check_file_size "$claude_path" "$WARN_LINES_CLAUDE" "$ERROR_LINES_CLAUDE" "CLAUDE.md" || exit_code=1 - check_path_references "$claude_path" "CLAUDE.md" || true - fi + check_file_size "$claude_path" "$WARN_LINES_CLAUDE" "CLAUDE.md" done # Pass through the input printf '%s\n' "$input" -exit $exit_code +exit 0 diff --git a/features/git-push-review/feature.json b/features/git-push-review/feature.json deleted file mode 100644 index 2c98fe0..0000000 --- a/features/git-push-review/feature.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "git-push-review", - "displayName": "Git Push Review", - "description": "Pause before git push to review changes", - "category": "hook", - "default": true, - "profiles": { "minimal": false, "standard": true, "full": true }, - "dependencies": [], - "conflicts": [] -} diff --git a/features/git-push-review/hooks.json b/features/git-push-review/hooks.json deleted file mode 100644 index ccfa3cb..0000000 --- a/features/git-push-review/hooks.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "hooks": { - "PreToolUse": [ - { - "matcher": "Bash", - "hooks": [ - { - "type": "command", - "command": "__HOME__/.claude/hooks/git-push-review/remind.sh" - } - ] - } - ] - } -} diff --git a/features/git-push-review/scripts/remind.sh b/features/git-push-review/scripts/remind.sh deleted file mode 100755 index 3122ab3..0000000 --- a/features/git-push-review/scripts/remind.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -euo pipefail - -input="$(cat)" -cmd="$(printf '%s' "$input" | jq -r '.tool_input.command // ""')" - -if printf '%s' "$cmd" | grep -qE 'git[[:space:]]+push'; then - echo '[Hook] Reminder: review your staged changes and target branch before pushing.' >&2 - echo '[Hook] Tip: run `git log origin/HEAD..HEAD --oneline` and `git diff origin/HEAD..HEAD` to review.' >&2 -fi diff --git a/features/no-flicker/feature.json b/features/no-flicker/feature.json index 5f2baa1..193931e 100644 --- a/features/no-flicker/feature.json +++ b/features/no-flicker/feature.json @@ -1,13 +1,13 @@ { "name": "no-flicker", "displayName": "No Flicker", - "description": "Enable Claude Code experimental flicker-free terminal renderer via CLAUDE_CODE_NO_FLICKER env var", + "description": "Enable the Claude Code flicker-free fullscreen renderer via CLAUDE_CODE_NO_FLICKER (opt-in; equivalent to tui: fullscreen)", "category": "settings", "default": false, "profiles": { "minimal": false, - "standard": true, - "full": true + "standard": false, + "full": false }, "dependencies": [], "conflicts": [] diff --git a/i18n/en/strings.sh b/i18n/en/strings.sh index a84dc04..dd60765 100644 --- a/i18n/en/strings.sh +++ b/i18n/en/strings.sh @@ -28,7 +28,7 @@ STR_NEW_INIT_YES="Yes - Use the interactive /init flow" STR_NEW_INIT_NO="No - Keep the previous /init behavior" # Step 4: Editor -STR_EDITOR_TITLE="Which editor do you use? (for git push review hook)" +STR_EDITOR_TITLE="Which editor do you use? (recorded in saved config)" STR_EDITOR_VSCODE="VS Code" STR_EDITOR_CURSOR="Cursor" STR_EDITOR_ZED="Zed" @@ -85,11 +85,9 @@ STR_HOOKS_SAFETY_NET="Safety Net - Block destructive git/filesystem commands (cc STR_HOOKS_AUTO_UPDATE="Auto Update - Automatically update starter kit on session start" STR_HOOKS_WEB_CONTENT_UPDATE="Web Content Update - Auto-update web-content-extraction skill deps on session start (opt-in)" STR_HOOKS_TMUX="Tmux Reminder - Suggest run_in_background for foreground dev servers (non-blocking)" -STR_HOOKS_GIT_PUSH="Git Push Review - Pause before git push for review" STR_HOOKS_DOC_BLOCK="Doc Blocker - Confirm ad-hoc SUMMARY/REPORT style docs (general docs pass)" STR_HOOKS_PRETTIER="Prettier Auto-format - Format JS/TS files after edits" STR_HOOKS_BIOME="Biome Auto-format - Format and lint JS/TS files after edits" -STR_HOOKS_CONSOLE="Console.log Guard - Warn about console.log statements" STR_HOOKS_PR_LOG="PR Creation Log - Log PR URL after creation" STR_HOOKS_PRE_COMMIT="Pre-compact Snapshot - Stash tracked changes before context compaction (opt-in)" STR_HOOKS_DOC_SIZE="Doc Size Guard - Warn when CLAUDE.md/AGENTS.md is too large" diff --git a/i18n/ja/strings.sh b/i18n/ja/strings.sh index 2e5940c..063e422 100644 --- a/i18n/ja/strings.sh +++ b/i18n/ja/strings.sh @@ -26,7 +26,7 @@ STR_NEW_INIT_YES="はい - /init を対話型フローで使う" STR_NEW_INIT_NO="いいえ - 従来の /init 挙動のままにする" # Step 4: Editor -STR_EDITOR_TITLE="使用しているエディタを選択してください(git push レビューフック用):" +STR_EDITOR_TITLE="使用しているエディタを選択してください(設定の記録用):" STR_EDITOR_VSCODE="VS Code" STR_EDITOR_CURSOR="Cursor" STR_EDITOR_ZED="Zed" @@ -83,11 +83,9 @@ STR_HOOKS_SAFETY_NET="Safety Net - 破壊的な git/ファイルシステムコ STR_HOOKS_AUTO_UPDATE="自動アップデート - セッション開始時にスターターキットを自動更新" STR_HOOKS_WEB_CONTENT_UPDATE="Web取得スキル更新 - セッション開始時に web-content-extraction の依存を自動更新(opt-in)" STR_HOOKS_TMUX="Tmux リマインダー - foreground の dev サーバーに run_in_background を提案(非ブロック)" -STR_HOOKS_GIT_PUSH="Git Push レビュー - push 前に一時停止してレビュー" STR_HOOKS_DOC_BLOCK="Doc ブロッカー - SUMMARY/REPORT 等のアドホック文書のみ確認(一般文書は素通し)" STR_HOOKS_PRETTIER="Prettier 自動フォーマット - JS/TS ファイルを編集後にフォーマット" STR_HOOKS_BIOME="Biome 自動フォーマット - JS/TS ファイルを編集後に整形と lint 修正" -STR_HOOKS_CONSOLE="Console.log ガード - console.log の警告" STR_HOOKS_PR_LOG="PR 作成ログ - PR 作成後に URL をログ" STR_HOOKS_PRE_COMMIT="コンパクト前スナップショット - compact 前に tracked 変更を git stash に退避(opt-in)" STR_HOOKS_DOC_SIZE="ドキュメントサイズガード - CLAUDE.md/AGENTS.md の肥大化を警告" diff --git a/lib/deploy.sh b/lib/deploy.sh index 2f8a906..7224fdd 100644 --- a/lib/deploy.sh +++ b/lib/deploy.sh @@ -142,16 +142,6 @@ apply_settings_preferences() { mv "$tmp_file" "$file" } -editor_command() { - case "${1:-none}" in - vscode) printf "code --diff" ;; - cursor) printf "cursor --diff" ;; - zed) printf "zed" ;; - neovim) printf "nvim -d" ;; - *) printf "" ;; - esac -} - # --------------------------------------------------------------------------- # Backup # --------------------------------------------------------------------------- @@ -541,7 +531,6 @@ build_claude_md_to_file() { # Usage: build_settings_file # # Uses _FEATURE_ORDER and _FEATURE_FLAGS from lib/features.sh to iterate -# enabled features. Special case: git-push-review (editor substitution). # Assertion: safety-net must be _FEATURE_ORDER[0]. # --------------------------------------------------------------------------- build_settings_file() { @@ -587,27 +576,6 @@ build_settings_file() { [[ -f "$hooks_json" ]] && hook_fragments+=("$hooks_json") done - # Special case: git-push-review (needs editor command substitution) - if is_true "${ENABLE_GIT_PUSH_REVIEW:-false}"; then - if [[ "${EDITOR_CHOICE:-none}" == "none" ]]; then - warn "Git push review hook skipped (no editor selected)" - else - local editor_cmd editor_cmd_escaped src tmp - editor_cmd="$(editor_command "$EDITOR_CHOICE")" - editor_cmd_escaped="$(printf '%s\n' "$editor_cmd" | sed 's/[&\\|]/\\&/g')" - src="$PROJECT_DIR/features/git-push-review/hooks.json" - tmp="$(mktemp)" - _SETUP_TMP_FILES+=("$tmp") - if grep -q "__EDITOR_CMD__" "$src" 2>/dev/null; then - sed "s|__EDITOR_CMD__|$editor_cmd_escaped|g" "$src" > "$tmp" - else - cp -a "$src" "$tmp" - fi - hook_fragments+=("$tmp") - tmp_files+=("$tmp") - fi - fi - build_settings_json "$base" "$permissions" "$out" ${hook_fragments[@]+"${hook_fragments[@]}"} apply_settings_preferences "$out" replace_home_path "$out" diff --git a/lib/features.sh b/lib/features.sh index cb7ecdd..af690b9 100644 --- a/lib/features.sh +++ b/lib/features.sh @@ -22,7 +22,6 @@ declare -g -A _FEATURE_FLAGS=( [doc-blocker]=ENABLE_DOC_BLOCKER [prettier-hooks]=ENABLE_PRETTIER_HOOKS [biome-hooks]=ENABLE_BIOME_HOOKS - [console-log-guard]=ENABLE_CONSOLE_LOG_GUARD [pr-creation-log]=ENABLE_PR_CREATION_LOG [pre-compact-commit]=ENABLE_PRE_COMPACT_COMMIT [auto-update]=ENABLE_AUTO_UPDATE @@ -31,7 +30,6 @@ declare -g -A _FEATURE_FLAGS=( [doc-size-guard]=ENABLE_DOC_SIZE_GUARD [no-flicker]=ENABLE_NO_FLICKER [feature-recommendation]=ENABLE_FEATURE_RECOMMENDATION - [git-push-review]=ENABLE_GIT_PUSH_REVIEW ) # --------------------------------------------------------------------------- @@ -42,13 +40,11 @@ declare -g -A _FEATURE_HAS_SCRIPTS=( [tmux-hooks]=true [prettier-hooks]=true [biome-hooks]=true - [console-log-guard]=true [pr-creation-log]=true [auto-update]=true [statusline]=true [doc-size-guard]=true [feature-recommendation]=true - [git-push-review]=true ) # --------------------------------------------------------------------------- @@ -56,27 +52,20 @@ declare -g -A _FEATURE_HAS_SCRIPTS=( # CRITICAL: safety-net MUST be first (PreToolUse runs in array order) # --------------------------------------------------------------------------- declare -g -a _FEATURE_ORDER=( - safety-net tmux-hooks doc-blocker prettier-hooks biome-hooks console-log-guard + safety-net tmux-hooks doc-blocker prettier-hooks biome-hooks pr-creation-log pre-compact-commit auto-update web-content-update statusline doc-size-guard no-flicker feature-recommendation ) # --------------------------------------------------------------------------- -# Script deployment iteration list (= _FEATURE_ORDER + script-only specials). -# -# git-push-review is intentionally NOT in _FEATURE_ORDER: its settings fragment -# needs __EDITOR_CMD__ runtime substitution in build_settings_file(). But its -# hook script MUST still flow through deploy/update/manifest/snapshot like any -# other feature script — iterating only _FEATURE_ORDER here caused updates to -# ship a settings.json referencing a never-deployed remind.sh. +# Script deployment iteration list (currently identical to _FEATURE_ORDER; +# kept as a separate registry for script-only special cases). # --------------------------------------------------------------------------- -declare -g -a _FEATURE_SCRIPT_ORDER=("${_FEATURE_ORDER[@]}" git-push-review) +declare -g -a _FEATURE_SCRIPT_ORDER=("${_FEATURE_ORDER[@]}") # --------------------------------------------------------------------------- # Special-case features (not in _FEATURE_ORDER, handled individually): -# - git-push-review: EDITOR_CHOICE runtime substitution in build_settings_file() -# (scripts deploy via _FEATURE_SCRIPT_ORDER above) # - codex-plugin: managed by lib/codex-setup.sh + plugin install # - ghostty: platform-specific, managed by lib/ghostty.sh # - fonts: non-hook component, managed by lib/fonts.sh diff --git a/lib/update.sh b/lib/update.sh index f57218e..f9118fa 100644 --- a/lib/update.sh +++ b/lib/update.sh @@ -546,7 +546,7 @@ _migrate_statusline_command() { # Hook features the kit no longer ships. Their settings.json entries must be # stripped during update even when the user customized "hooks" (merge keeps # user-touched values, which would leave commands pointing at deleted scripts). -_RETIRED_HOOK_FEATURES=(memory-persistence strategic-compact) +_RETIRED_HOOK_FEATURES=(memory-persistence strategic-compact console-log-guard git-push-review) # _strip_retired_hook_entries - Remove hook commands referencing retired # feature script dirs (~/.claude/hooks//) from settings.json, then diff --git a/profiles/full.conf b/profiles/full.conf index a7fa3de..52f0e8f 100644 --- a/profiles/full.conf +++ b/profiles/full.conf @@ -10,11 +10,9 @@ INSTALL_SKILLS=true ENABLE_CODEX_PLUGIN=true ENABLE_TMUX_HOOKS=true -ENABLE_GIT_PUSH_REVIEW=true ENABLE_DOC_BLOCKER=true ENABLE_PRETTIER_HOOKS=false ENABLE_BIOME_HOOKS=true -ENABLE_CONSOLE_LOG_GUARD=true ENABLE_PR_CREATION_LOG=true ENABLE_PRE_COMPACT_COMMIT=false ENABLE_SAFETY_NET=true @@ -25,5 +23,5 @@ ENABLE_GHOSTTY_SETUP=true ENABLE_FONTS_SETUP=true ENABLE_DOC_SIZE_GUARD=true -ENABLE_NO_FLICKER=true +ENABLE_NO_FLICKER=false ENABLE_FEATURE_RECOMMENDATION=true diff --git a/profiles/minimal.conf b/profiles/minimal.conf index e2918dc..2863845 100644 --- a/profiles/minimal.conf +++ b/profiles/minimal.conf @@ -10,11 +10,9 @@ INSTALL_SKILLS=false ENABLE_CODEX_PLUGIN=false ENABLE_TMUX_HOOKS=false -ENABLE_GIT_PUSH_REVIEW=false ENABLE_DOC_BLOCKER=false ENABLE_PRETTIER_HOOKS=false ENABLE_BIOME_HOOKS=false -ENABLE_CONSOLE_LOG_GUARD=false ENABLE_PR_CREATION_LOG=false ENABLE_PRE_COMPACT_COMMIT=false ENABLE_SAFETY_NET=false diff --git a/profiles/standard.conf b/profiles/standard.conf index 61233f3..fe4aec1 100644 --- a/profiles/standard.conf +++ b/profiles/standard.conf @@ -10,11 +10,9 @@ INSTALL_SKILLS=true ENABLE_CODEX_PLUGIN=false ENABLE_TMUX_HOOKS=true -ENABLE_GIT_PUSH_REVIEW=true ENABLE_DOC_BLOCKER=false ENABLE_PRETTIER_HOOKS=true ENABLE_BIOME_HOOKS=false -ENABLE_CONSOLE_LOG_GUARD=true ENABLE_PR_CREATION_LOG=true ENABLE_PRE_COMPACT_COMMIT=false ENABLE_SAFETY_NET=true @@ -25,5 +23,5 @@ ENABLE_GHOSTTY_SETUP=true ENABLE_FONTS_SETUP=true ENABLE_DOC_SIZE_GUARD=false -ENABLE_NO_FLICKER=true +ENABLE_NO_FLICKER=false ENABLE_FEATURE_RECOMMENDATION=true diff --git a/tests/unit/test-hook-fixtures.sh b/tests/unit/test-hook-fixtures.sh index d287f8e..c33ac20 100644 --- a/tests/unit/test-hook-fixtures.sh +++ b/tests/unit/test-hook-fixtures.sh @@ -85,7 +85,6 @@ fi _post_edit_fixture="$_hook_tmp/post-edit.json" _post_write_fixture="$_hook_tmp/post-write.json" -_pre_push_fixture="$_hook_fixture_dir/pretooluse-bash-git-push.json" _pre_dev_fixture="$_hook_fixture_dir/pretooluse-bash-npm-dev.json" _sample_ts="$_hook_tmp/sample.ts" _sample_claude="$_hook_tmp/CLAUDE.md" @@ -99,17 +98,13 @@ jq --arg path "$_sample_claude" '.tool_input.file_path = $path' \ _script_smoke_ok=true bash "$PROJECT_DIR/features/biome-hooks/scripts/format-file.sh" <"$_post_edit_fixture" >/dev/null 2>/dev/null || _script_smoke_ok=false bash "$PROJECT_DIR/features/prettier-hooks/scripts/format-file.sh" <"$_post_edit_fixture" >/dev/null 2>/dev/null || _script_smoke_ok=false -bash "$PROJECT_DIR/features/console-log-guard/scripts/check-file.sh" <"$_post_edit_fixture" >/dev/null 2>"$_hook_tmp/console.err" || _script_smoke_ok=false (cd "$_hook_tmp" && bash "$PROJECT_DIR/features/doc-size-guard/scripts/check-doc-size.sh" <"$_post_write_fixture" >/dev/null 2>/dev/null) || _script_smoke_ok=false -bash "$PROJECT_DIR/features/git-push-review/scripts/remind.sh" <"$_pre_push_fixture" >/dev/null 2>"$_hook_tmp/push.err" || _script_smoke_ok=false bash "$PROJECT_DIR/features/feature-recommendation/scripts/check-pending.sh" <"$_hook_fixture_dir/sessionstart-startup.json" >/dev/null 2>/dev/null || _script_smoke_ok=false _tmux_rc=0 env -u TMUX bash "$PROJECT_DIR/features/tmux-hooks/scripts/check-bash.sh" <"$_pre_dev_fixture" >/dev/null 2>"$_hook_tmp/tmux.err" || _tmux_rc=$? if [[ "$_script_smoke_ok" == "true" ]] \ - && assert_matches "console\\.log found" "$(cat "$_hook_tmp/console.err")" \ - && assert_matches "Reminder: review your staged changes" "$(cat "$_hook_tmp/push.err")" \ && [[ "$_tmux_rc" -eq 0 ]] \ && assert_matches "prefer run_in_background" "$(cat "$_hook_tmp/tmux.err")"; then pass "hook-fixtures: distributed hook scripts consume real-schema fixtures" @@ -124,41 +119,6 @@ fi # - safety-net: requires the external cc-safety-net binary, absent in CI # --------------------------------------------------------------------------- -# console-log-guard audit-session.sh (SessionEnd) — needs a git repo with an -# unstaged console.log change; run inside an isolated temp repo + temp HOME. -_cla_repo="$_hook_tmp/console-audit-repo" -_cla_home="$_hook_tmp/console-audit-home" -_cla_err="$_hook_tmp/cla.err" -_cla_setup_ok=true -mkdir -p "$_cla_repo" "$_cla_home" -( - export HOME="$_cla_home" GIT_CONFIG_NOSYSTEM=1 - cd "$_cla_repo" \ - && git init -q . \ - && git config user.name "Fixture" \ - && git config user.email "fixture@example.com" \ - && printf 'export const ok = true\n' >app.ts \ - && git add app.ts \ - && git commit -qm 'init' \ - && printf "console.log('leftover')\n" >>app.ts -) >/dev/null 2>&1 || _cla_setup_ok=false - -_cla_rc=0 -( - cd "$_cla_repo" \ - && HOME="$_cla_home" GIT_CONFIG_NOSYSTEM=1 \ - bash "$PROJECT_DIR/features/console-log-guard/scripts/audit-session.sh" \ - <"$_hook_fixture_dir/sessionend-other.json" >/dev/null 2>"$_cla_err" -) || _cla_rc=$? - -if [[ "$_cla_setup_ok" == "true" ]] \ - && [[ "$_cla_rc" -eq 0 ]] \ - && assert_matches "\\[Hook\\] WARNING: console\\.log in app\\.ts" "$(cat "$_cla_err")"; then - pass "hook-fixtures: console-log-guard session audit consumes SessionEnd fixture" -else - fail "hook-fixtures: console-log-guard session audit should consume SessionEnd fixture" -fi - # pre-compact-commit inline PreCompact command — executed verbatim from # hooks.json via bash -c with the PreCompact fixture on stdin. _pcc_cmd="$(jq -r '.hooks.PreCompact[0].hooks[0].command' "$PROJECT_DIR/features/pre-compact-commit/hooks.json")" diff --git a/tests/unit/test-retired-files.sh b/tests/unit/test-retired-files.sh index 83a496c..87bfe33 100644 --- a/tests/unit/test-retired-files.sh +++ b/tests/unit/test-retired-files.sh @@ -3,7 +3,7 @@ # statusline migration regression guards # # Covers the update-path bugs fixed after the #78-#103 refactor review: -# 1. git-push-review scripts must deploy via _update_hook_scripts +# 1. scripted features must deploy via _update_hook_scripts # 2. _remove_retired_managed_files must not treat user-deleted (but still # kit-shipped) files as retired, must keep customized retired files, and # must map manifest paths recorded under a different claude_dir (dry-run) @@ -29,36 +29,36 @@ ENABLE_CODEX_PLUGIN="false" source "$PROJECT_DIR/lib/deploy.sh" source "$PROJECT_DIR/lib/update.sh" -# Disable every scripted feature, then enable only git-push-review so the +# Disable every scripted feature, then enable only doc-size-guard so the # update deploy assertions stay focused. for _rt_feat in "${_FEATURE_SCRIPT_ORDER[@]}"; do _rt_flag="${_FEATURE_FLAGS[$_rt_feat]:-}" [[ -n "$_rt_flag" ]] && printf -v "$_rt_flag" '%s' "false" done # shellcheck disable=SC2034 # read via ${!flag} indirection in sourced libs -printf -v ENABLE_GIT_PUSH_REVIEW '%s' "true" +printf -v ENABLE_DOC_SIZE_GUARD '%s' "true" -# ── 1. update path deploys git-push-review scripts ──────────────────────── +# ── 1. update path deploys scripted feature scripts ─────────────────────── { - test_name="retired-files: _update_hook_scripts deploys git-push-review remind.sh" + test_name="retired-files: _update_hook_scripts deploys doc-size-guard script" _rt_cd="$(mktemp -d)" _rt_snap="$(mktemp -d)" _SETUP_TMP_FILES+=("$_rt_cd" "$_rt_snap") _rt_rc=0 _update_hook_scripts "$_rt_cd" "$_rt_snap" || _rt_rc=$? - if [[ "$_rt_rc" -eq 0 ]] && [[ -x "$_rt_cd/hooks/git-push-review/remind.sh" ]]; then + if [[ "$_rt_rc" -eq 0 ]] && [[ -x "$_rt_cd/hooks/doc-size-guard/check-doc-size.sh" ]]; then pass "$test_name" else fail "$test_name (rc=$_rt_rc)" fi } -# ── 2. manifest/snapshot tracking covers git-push-review ────────────────── +# ── 2. manifest/snapshot tracking covers scripted features ──────────────── { - test_name="retired-files: collect_managed_target_files includes git-push-review script" + test_name="retired-files: collect_managed_target_files includes doc-size-guard script" collect_managed_target_files if printf '%s\n' "${_MANAGED_TARGET_FILES[@]+"${_MANAGED_TARGET_FILES[@]}"}" \ - | grep -qx "$CLAUDE_DIR/hooks/git-push-review/remind.sh"; then + | grep -qx "$CLAUDE_DIR/hooks/doc-size-guard/check-doc-size.sh"; then pass "$test_name" else fail "$test_name" diff --git a/tests/unit/test-runtime-hooks.sh b/tests/unit/test-runtime-hooks.sh index 41f6f3a..d8ee9fb 100644 --- a/tests/unit/test-runtime-hooks.sh +++ b/tests/unit/test-runtime-hooks.sh @@ -15,7 +15,7 @@ { test_name="runtime hooks: high-frequency inline bash hooks are external scripts" ok_all=true - for feature in biome-hooks prettier-hooks console-log-guard doc-blocker tmux-hooks git-push-review pr-creation-log; do + for feature in biome-hooks prettier-hooks doc-blocker tmux-hooks pr-creation-log; do if jq -r '.. | objects | .command? // empty' "$PROJECT_DIR/features/$feature"/hooks*.json \ | grep -q '#!/bin/bash'; then ok_all=false @@ -39,15 +39,6 @@ fi } -{ - test_name="console-log-guard: session audit moved from Stop to SessionEnd and Write is covered" - if jq -e 'has("hooks") and (.hooks | has("Stop") | not) and .hooks.SessionEnd[0].matcher == "*" and .hooks.PostToolUse[0].matcher == "Edit|Write"' "$PROJECT_DIR/features/console-log-guard/hooks.json" >/dev/null; then - pass "$test_name" - else - fail "$test_name" - fi -} - { test_name="pre-compact-commit: cd failure cannot fall through to git stash" cmd="$(jq -r '.hooks.PreCompact[0].hooks[0].command' "$PROJECT_DIR/features/pre-compact-commit/hooks.json")" diff --git a/tests/unit/test-web-content-extraction.sh b/tests/unit/test-web-content-extraction.sh index e14176f..2ee09fc 100644 --- a/tests/unit/test-web-content-extraction.sh +++ b/tests/unit/test-web-content-extraction.sh @@ -38,10 +38,10 @@ source "$PROJECT_DIR/lib/update.sh" _wce_reset_flags() { local v for v in ENABLE_SAFETY_NET ENABLE_TMUX_HOOKS ENABLE_DOC_BLOCKER ENABLE_PRETTIER_HOOKS \ - ENABLE_BIOME_HOOKS ENABLE_CONSOLE_LOG_GUARD \ + ENABLE_BIOME_HOOKS \ ENABLE_PR_CREATION_LOG ENABLE_PRE_COMPACT_COMMIT ENABLE_AUTO_UPDATE ENABLE_WEB_CONTENT_UPDATE \ ENABLE_STATUSLINE ENABLE_DOC_SIZE_GUARD ENABLE_NO_FLICKER ENABLE_FEATURE_RECOMMENDATION \ - ENABLE_GIT_PUSH_REVIEW ENABLE_CODEX_PLUGIN INSTALL_SKILLS; do + ENABLE_CODEX_PLUGIN INSTALL_SKILLS; do printf -v "$v" '%s' "false" done LANGUAGE="en"; COMMIT_ATTRIBUTION="false"; ENABLE_NEW_INIT="true"; EDITOR_CHOICE="none" diff --git a/wizard/defaults.conf b/wizard/defaults.conf index d0cb170..c576d1d 100644 --- a/wizard/defaults.conf +++ b/wizard/defaults.conf @@ -13,11 +13,9 @@ INSTALL_SKILLS="true" ENABLE_CODEX_PLUGIN="false" ENABLE_TMUX_HOOKS="false" -ENABLE_GIT_PUSH_REVIEW="false" ENABLE_DOC_BLOCKER="false" ENABLE_PRETTIER_HOOKS="false" ENABLE_BIOME_HOOKS="false" -ENABLE_CONSOLE_LOG_GUARD="false" ENABLE_PR_CREATION_LOG="false" ENABLE_GHOSTTY_SETUP="false" ENABLE_FONTS_SETUP="false" diff --git a/wizard/registry.sh b/wizard/registry.sh index 9b225db..05d3c2c 100644 --- a/wizard/registry.sh +++ b/wizard/registry.sh @@ -31,7 +31,7 @@ _CONFIG_KEYS=( # never written back by save_config (e.g., ENABLE_CODEX_MCP is migrated to # ENABLE_CODEX_PLUGIN by _normalize_codex_state; INSTALL_MEMORY is retired — # the kit no longer ships seed memory files). -_CONFIG_LEGACY_KEYS="ENABLE_CODEX_MCP INSTALL_MEMORY ENABLE_MEMORY_PERSISTENCE ENABLE_STRATEGIC_COMPACT" +_CONFIG_LEGACY_KEYS="ENABLE_CODEX_MCP INSTALL_MEMORY ENABLE_MEMORY_PERSISTENCE ENABLE_STRATEGIC_COMPACT ENABLE_CONSOLE_LOG_GUARD ENABLE_GIT_PUSH_REVIEW" # Generated lists (do not edit by hand — extend _CONFIG_KEYS instead): # _CONFIG_ALLOWED_KEYS — space-separated allowlist for _safe_source_config @@ -170,11 +170,9 @@ HOOK_KEYS=( "ENABLE_AUTO_UPDATE" "ENABLE_WEB_CONTENT_UPDATE" "ENABLE_TMUX_HOOKS" - "ENABLE_GIT_PUSH_REVIEW" "ENABLE_DOC_BLOCKER" "ENABLE_PRETTIER_HOOKS" "ENABLE_BIOME_HOOKS" - "ENABLE_CONSOLE_LOG_GUARD" "ENABLE_PR_CREATION_LOG" "ENABLE_PRE_COMPACT_COMMIT" "ENABLE_DOC_SIZE_GUARD" @@ -186,11 +184,9 @@ HOOK_TOKENS=( "auto-update" "web-content" "tmux" - "git-push" "doc-block" "prettier" "biome" - "console" "pr-log" "pre-commit" "doc-size" @@ -205,11 +201,9 @@ _init_hook_labels() { "${STR_HOOKS_AUTO_UPDATE:-Auto Update - Automatically update starter kit on session start}" "${STR_HOOKS_WEB_CONTENT_UPDATE:-Web Content Update - Auto-update web-content-extraction skill deps on session start}" "$STR_HOOKS_TMUX" - "$STR_HOOKS_GIT_PUSH" "$STR_HOOKS_DOC_BLOCK" "$STR_HOOKS_PRETTIER" "${STR_HOOKS_BIOME:-Biome Auto-format - Format and lint JS/TS files after edits}" - "$STR_HOOKS_CONSOLE" "$STR_HOOKS_PR_LOG" "${STR_HOOKS_PRE_COMMIT:-Pre-compact Snapshot}" "${STR_HOOKS_DOC_SIZE:-Doc Size Guard - Warn when CLAUDE.md/AGENTS.md is too large}" diff --git a/wizard/wizard.sh b/wizard/wizard.sh index b52b38c..ca5f910 100755 --- a/wizard/wizard.sh +++ b/wizard/wizard.sh @@ -30,11 +30,11 @@ INSTALL_MEMORY="${INSTALL_MEMORY:-}" # legacy compat (read-only, seed memory no ENABLE_CODEX_PLUGIN="${ENABLE_CODEX_PLUGIN:-}" ENABLE_CODEX_MCP="${ENABLE_CODEX_MCP:-}" # legacy compat (read-only, migrated by _normalize_codex_state) ENABLE_TMUX_HOOKS="${ENABLE_TMUX_HOOKS:-}" -ENABLE_GIT_PUSH_REVIEW="${ENABLE_GIT_PUSH_REVIEW:-}" +ENABLE_GIT_PUSH_REVIEW="${ENABLE_GIT_PUSH_REVIEW:-}" # legacy compat (read-only, feature retired) ENABLE_DOC_BLOCKER="${ENABLE_DOC_BLOCKER:-}" ENABLE_PRETTIER_HOOKS="${ENABLE_PRETTIER_HOOKS:-}" ENABLE_BIOME_HOOKS="${ENABLE_BIOME_HOOKS:-}" -ENABLE_CONSOLE_LOG_GUARD="${ENABLE_CONSOLE_LOG_GUARD:-}" +ENABLE_CONSOLE_LOG_GUARD="${ENABLE_CONSOLE_LOG_GUARD:-}" # legacy compat (read-only, feature retired) ENABLE_MEMORY_PERSISTENCE="${ENABLE_MEMORY_PERSISTENCE:-}" # legacy compat (read-only, feature retired in favor of native auto-memory) ENABLE_STRATEGIC_COMPACT="${ENABLE_STRATEGIC_COMPACT:-}" # legacy compat (read-only, hook retired; skill remains on-demand) ENABLE_PR_CREATION_LOG="${ENABLE_PR_CREATION_LOG:-}"