feat: Add metacognition capability and dynamic rule loading system#21
Merged
Conversation
- rules-index.yaml: ルールファイルのメタデータ管理 - 各ルールファイルのタグ、用途、サイズ、セクション情報を定義 - rule-advisorが効率的にルール選択するための索引 - rule-advisor.md: 動的ルール選択サブエージェント - タスクの本質を分析し、必要十分なルールセットを選択 - 最大500行を目安にAIの実行精度を最大化 - CLAUDE.mdを含む構造化されたJSON形式で出力 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
## 変更内容 - 1,382行 → 863行(519行削減、37.6%減) - 重複記述の完全排除(型安全性、エラーハンドリング、品質保証、テスト戦略) - 見出し階層をフラット化(最大3階層まで) - 各ファイルの独立性確保(相互参照を削除) ## 主な統廃合 - 型安全性: typescript.mdに一元化 - エラーハンドリング: typescript.mdに集約 - 品質保証プロセス: ai-development-guide.mdに統合 - テスト戦略: 重複削除と簡素化 ## AI実行精度向上のための工夫 - 具体的で明確な記述(曖昧な表現を排除) - 行動指向の記述(「〜すること」形式) - 数値基準の明記(5ファイル以上、70%以上等) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
エージェント定義ファイルから静的なルール参照を削除し、 動的ルールロードシステムと整合性のある記述に変更: - quality-fixer: @docs/rules参照を削除し、原則のみを記載 - rule-advisor: any型禁止を型チェック実施に変更 - task-executor: 型システム規約の@参照を削除 - CLAUDE.ja.md: 品質チェック詳細の@参照をrule-advisor提供に変更 これにより動的ルールシステムとの整合性を確保し、 ルール更新時の柔軟性を向上させた。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- 用語統一: 「品質保証」→「品質チェック」「開発」→「実装」に全体統一 - canonical-phrases.mdをルールファイル群に統合し重複解消 - カバレッジ要求を80%→70%に現実的な値に調整 - rules-index.yamlの記述を最新状態に同期 - .claude/commands-ja/rule-maintenance.mdを追加 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- 用語統一: 「品質保証」→「品質チェック」「開発」→「実装」に全体統一 - canonical-phrases.mdをルールファイル群に統合し重複解消 - architectureディレクトリのLLM向け構造最適化 - README/rulesの役割明確化、実装チェックリスト強化 - エスカレーション基準・判断基準の標準化 - rules-index.yamlを実際のセクション名に同期(動的ルールロード対応) - カバレッジ要求を70%に統一、品質チェック基準の標準化 - .claude/commands-ja/rule-maintenance.mdを追加 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
## 主な変更内容 ### 1. 必須実行プロセスへの移行 - CLAUDE.ja.md: 「調査OK・実装STOP」→「必須実行プロセス」へ全面改訂 - 必須チェック4項目とメタ認知の構造的実行を中核に ### 2. 動的ルール選択への対応 - rule-advisor.md: 必須チェック4項目との連携機能追加 - ai-development-guide.md: 技術的判断基準とアンチパターン集に特化 - 各ファイル: 静的な全ルール読み込みから動的選択への参照変更 ### 3. 固定基準から状況判断への移行 - 「5ファイル以上」→「当初想定範囲の明らかな超過」 - 「300行制限」→「単一責任原則(SRP)違反」 ### 4. 出典情報の体系化 - rules-index.yaml: key-referencesフィールド追加 - 各ルールファイル: 参照した手法・原則セクション追加 - 経験則と確立された原則の明確な区別 ### 5. canonical-phrases.md参照の削除 - 該当する全ファイルから参照を削除 - README.ja.md: 7つ→6つのルールファイルに修正 これにより、動的ルール選択システムが完全に機能し、 AI実行精度の向上と認知負荷の軽減を実現。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
主要な変更: - サブエージェント定義から古いルール参照を削除 - sub-agents.mdの構造化レスポンス仕様を簡潔化(約48行削減) - ルール参照の動的化に対応した修正 - 精度を維持しながら認知負荷を軽減 変更内容: - 9つのサブエージェント定義を新ルールシステムに対応 - 構造化レスポンスの詳細をエージェント定義に委譲 - 不要なルール参照(@docs/rules/*)を削除 - 全体で約12%の行数削減を達成 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
主な変更: - 最重要原則「調査OK、実装STOP」を文書冒頭に配置 - 重複記載を削除(3ファイル編集、承認なしEdit) - 曖昧な表現を具体化(5 Whys、トレードオフ不明等) - 誤解を招く「システム的強制」を「実行ルール」に修正 - 各ルールに理由を追加して理解促進 - メタ認知を「自動化」から「支援」に正確化 - rule-advisor.mdの参照を「最重要原則」に更新 これによりAIの実行精度を最大化し、ルール遵守率の向上を図る 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- rule-advisorの精度向上とメタ認知サポート強化 - 各専門エージェントの役割明確化と連携改善 - CLAUDE.ja.mdの実行精度最大化ルール更新 - rules-index.yamlの整合性確保 評価結果: 現行ルールが型安全性、セキュリティ、品質保証において優位 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Translate all Japanese agent definitions to English (.claude/agents-en/*.md) - Add new rule-advisor agent with comprehensive rule selection logic - Update existing agents to follow mandatory execution process - Create rule-maintenance command for terminology consistency - Update command files to match latest Japanese versions - Ensure consistent terminology across all English documentation: - "work plan" for 作業計画書 - "subagent" for サブエージェント - "quality check" for 品質チェック - "user approval" for ユーザー承認 - "Research OK, Implementation STOP" for 調査OK、実装STOP - Update CLAUDE.en.md with latest rule system structure All agents now properly integrate with rule-advisor for maximizing AI execution accuracy. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Translated all rule files in docs/rules-en/ from Japanese originals - Removed canonical-phrases.md as requested - Added rules-index.yaml for rule-advisor metadata - Updated sub-agents.md with corrected translations - Ensured terminology consistency with CLAUDE.en.md and rule-maintenance.md All translations maintain the original structure and meaning while using established English terminology conventions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ation - Add rule-advisor subagent to README documentation (both EN/JA) - Document rule index system (rules-index.yaml) in project structure - Update subagent descriptions with detailed explanations - Bump version to 1.4.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rule Organization and Dynamic Rule Extraction Implementation
Changes
Results
Japanese rules: 2,000 lines → 1,647 lines (-17.7%)
English rules: 1,999 lines → 1,646 lines (-17.7%)
CLAUDE.ja.md: 175 lines → 136 lines (-22.3%)
CLAUDE.en.md: 174 lines → 136 lines (-21.8%)
Achieved ~20% reduction in overall size, improving AI processing efficiency.