feat(hook-enablement): add the shared layer-resolution helper and the count-script check
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with docs/contracts/hook-enablement/README.md and docs/contracts/hook-config-delivery/README.md to understand the layer precedence and hook configuration channel, then inspect plugins/session-flow/scripts/focus.py for the existing resolver. Define and test the shared helper across each supported runtime and git-hook path, and measure its hook-fire cost against the hook budget. Done means the helper, documentation, and CI check are in place, and the check initially lists the 11 plugins named in the issue.
索引モデルが issue の本文から書いたものです。
説明
Context
The hook-enablement convention (docs/contracts/hook-enablement/README.md, "The per-hook setting") has each hook's own script resolve the plugin default, the user layer and the repository layer before it does any work, with the user's explicit value winning over the repository value. Only plugins/session-flow/scripts/focus.py (enabled()) does this today. The other hook plugins read the user layer alone (for example plugins/bash-format/hooks/hooks.json launches through --run-if-unset-or-true BASH_FORMAT_ENABLED), and 11 plugins have no setting. Without one shared resolver, each per-plugin change would copy the precedence and drift.
Owner decision on #18921 (2026-11-25): build one shared layer-resolution helper first, commit the count script as the acceptance check, and file one issue per plugin.
Proposed work
Build the shared helper, then commit the count script as its check.
Acceptance criteria
- A helper resolves one
<name>_enabledkey from the plugin default, the user layer and the repository layer, in the convention's precedence: an explicit user value wins; otherwise the repository value; otherwise the plugin default. - The user layer reads
CLAUDE_PLUGIN_OPTION_<KEY>only when set (an unset option exports nothing), through the channeldocs/contracts/hook-config-delivery/README.mdpicks for the hook. - The repository layer reads the key from
docs/conventions/<plugin>.yaml(or the repository's bound convention home) under the project root Claude Code passes. - A value that is not an unquoted
trueorfalseis named with its file or option and dropped, per config-cascade "The layers". - The git-hook path reads the user layer from the plugin's
pluginConfigsentry in the user's Claude Code settings and the repository layer from the top-leveldocs/conventions/<plugin>.yaml; unset when the settings file or entry is absent. - The security-control variant exists: for a guard whose off state loosens a security control, a repository
falseis ignored and only the user's ownfalseturns the guard off. - Tests cover, per runtime the helper supports: user
falseover repositorytrue; usertrueover repositoryfalse; user unset with repositoryfalse(off); user unset with repositorytrue(on); both unset (plugin default); invalid value dropped and named; the security-control variant. - The helper's cost on a hook fire is measured and recorded against
docs/contracts/hook-budget/README.md. -
docs/contracts/hook-enablement/README.mdnames the helper and how a plugin consumes it, and the "Adopters" section still points at #18921. - The count script is committed as a check (a test or a script wired into CI) that, over
plugins/*/hooks/hooks.jsonand each plugin'suserConfigkeys, lists every plugin with a hook lacking its<name>_enabledoption; its starting output matches the 11-plugin list in #18921 (animation, context-budget, discovery, display-redaction, explainer-video, multi-agent, playwright, plugin-profiles, speech, themes, toolchain). - The check's documentation states how a hook maps to its key, so each per-plugin child can be verified against it.
- #18921 states that the whole retrofit is accepted when the check lists no plugin.
Parent: #18921
- 主要言語
- Shell
- スター
- 22
- フォーク
- 2
- 平均マージ
- 2時間 1分
- マージ済み PR(30日)
- 972
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
melodic-software/claude-code-plugins のほかの issue
-
session-owned
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
melodic-software/claude-code-plugins#19371 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
melodic-software/claude-code-plugins#19225 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
melodic-software/claude-code-plugins#17779 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
melodic-software/claude-code-plugins#19380 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
melodic-software/claude-code-plugins#19379 ·
メンテナーはふだん 1 日以内に返信
melodic-software/claude-code-plugins の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
The-AIOS/aios#405 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dracut-ng/dracut#2843 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
luainkernel/lunatik#2752 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
omacom/omarchy#20366 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
DaoCloud/public-image-mirror#46361 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信