Skip to content

[Feature] forge SKILL description に MANDATORY 句と negative example を追加し Claude の自動発火率を上げる #148

Description

@BlueEventHorizon

背景 / コンテキスト

meta-plugin リポジトリで追加開発 feature (codex-copy、種別 B × copy) を進めていた際、要件定義書 FNC-010 と設計書 DES-008 を手動 Write ツールで作成してしまった。後からユーザーの指摘で「/forge:start-requirements / /forge:start-design を使うべきだった」と判明。

原因分析:

  1. トリガー語 (「要件定義書作成」「設計書作成」等) が SKILL description の prose 内に埋もれ、構造化されていない
  2. description が「〜を作成する」という能力の宣言で、「Write/Edit の代わりに必ずこれを使え」という義務・排他が明示されていない
  3. トリガー語の網羅性不足 (「要件定義書を温める」「はい (先の提案に対する応答)」等、Claude 側が発する造語や間接的な同意表現をカバーしない)
  4. negative example (「手動 Write で作成しない」) が description に無い
  5. SKILL ごとに description の形式・粒度・トリガー数がバラバラで、Claude が一貫したパターンマッチをしにくい

このため Claude Code (Claude LLM 側) は forge SKILL の存在を知りながらも、Write / Edit / 汎用 Agent invoke に流れがちで、SKILL に組み込まれたレビュー + 自動修正 + commit の一貫フローがスキップされる事象が発生する。

ユーザーストーリー

As a plugin developer using Claude Code with the forge plugin installed,
I want Claude to reliably auto-invoke /forge:start-* SKILLs when I ask for requirements / design / plan / implementation / review / merge-specs work,
so that the SKILL's built-in review + auto-fix + commit flow is applied instead of Claude hand-crafting documents via Write/Edit and skipping the review step.

受け入れ基準

  • 主要な forge SKILL (/forge:start-requirements, /forge:start-design, /forge:start-plan, /forge:start-implement, /forge:review, /forge:merge-specs) の description 冒頭付近に「MANDATORY」相当の義務句が入っている (例: "MUST invoke this Skill WHENEVER creating...")
  • トリガー語が description 内で構造化された箇条書きとして prose と分離されて配置されている
  • 「Write / Edit で手動作成する代わりに使う」という negative example が明記されている
  • 対象ファイルパスパターン (例: docs/**/requirements/FNC-*.md, docs/**/design/DES-*.md) が description に列挙されており、Claude が「これから Write しようとしているファイルが SKILL 対象か」を機械的に照合できる
  • 少なくとも 1 プロジェクトで実測し、以前と比較して SKILL 発火率が向上する (定性評価で可)
  • description の書式が SKILL 間で統一され、「WHEN TO USE / MANDATORY / TRIGGERS / DO NOT USE MANUALLY」等のセクションが揃っている

代替案 / 補足

検討した代替案:

  1. プロジェクト側 CLAUDE.md に「SKILL を必ず確認」ルール追加 → 効果あるが二重管理になる
  2. ~/.claude/CLAUDE.md (グローバル) にルール追加 → 適用範囲は広いが、SKILL 側で自己記述する方が forge プラグイン単独の改修で完結する
  3. hook (PreToolUse) で Write/Edit invoke 前に警告 → 強制力は最大だが柔軟性を犠牲、/anvil:commit 等の内部 Bash 使用まで妨げる可能性

本要望は上記代替案より SKILL 単体の改修で済むため、コスト最小。ユーザー側の CLAUDE.md 編集や hook 導入と併用可能で排他ではない。

対象 SKILL 一覧 (forge プラグイン全体)

  • /forge:start-requirements
  • /forge:start-design
  • /forge:start-plan
  • /forge:start-implement
  • /forge:review
  • /forge:merge-specs
  • /forge:next-spec-id
  • /forge:update-db-specs
  • /forge:update-db-rules
  • /forge:setup-doc-structure
  • /forge:setup-version-config
  • /forge:update-version
  • /forge:query-db-specs
  • /forge:query-db-rules
  • /forge:query-forge-rules
  • /forge:clean-rules
  • /forge:present-findings
  • /forge:doc-structure
  • /forge:help
  • /forge:start-uxui-design
  • /forge:create-feature-from-markdown-plan

Metadata

Metadata

Labels

IMPROVENew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions