Skip to content

実装: Skill/SubAgent context budget audit を追加し過剰な description と重複手順を削減する #1056

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1047"
goal_ref: "Skill/SubAgent の description・本文・references のサイズと重複を監査し、context 肥大化と同一ルール重複を削減する"
change_kind: workflow

Parent Issue

#1047

Parent Goal Ref

  • Goal: Skill/SubAgent context budget audit を追加し、過剰な description と重複手順を削減する
  • Desired Destination: 全 Skill description 文字数・本文行数・references 行数が一覧化され、skillOverrides / disable-model-invocation 候補が machine-readable に出力される状態

Current Validated Scope

  • .claude/skills/agent-context-audit/SKILL.md を新規追加する
  • .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py を新規追加する
  • .claude/skills/agent-context-audit/scripts/audit_duplicate_agent_instructions.py を新規追加する
  • .claude/skills/agent-context-audit/references/context-budget-policy.md を新規追加する
  • .claude/skills/agent-context-audit/tests/test_audit_skill_context_budget.py を新規追加する

Remaining Parent Gaps

  • Issue 9 が残る

Outcome

audit_skill_context_budget.py が AGENT_CONTEXT_AUDIT_RESULT_V1 を出力し、80 行以内サマリを生成し、uv run pytest .claude/skills/agent-context-audit/tests/ が PASS している。

In Scope

  • .claude/skills/agent-context-audit/SKILL.md
  • .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py(AGENT_CONTEXT_AUDIT_RESULT_V1 出力・80 行以内サマリ)
  • .claude/skills/agent-context-audit/scripts/audit_duplicate_agent_instructions.py(3 ファイル以上重複 phrase 検出)
  • .claude/skills/agent-context-audit/references/context-budget-policy.md
  • .claude/skills/agent-context-audit/tests/test_audit_skill_context_budget.py

Out of Scope

  • Skill description の実際の削減・書き換え(audit 結果を受けた follow-up)
  • .claude/settings.json の skillOverrides 実際の変更
  • agents/*.md の大規模改修

Acceptance Criteria

  • AC1: audit_skill_context_budget.py が AGENT_CONTEXT_AUDIT_RESULT_V1 を stdout に出力する
  • AC2: 全 Skill の description 文字数・本文行数・references 行数を一覧化する
  • AC3: 同じ phrase が 3 ファイル以上に重複する場合に warn を出す
  • AC4: skillOverrides 候補を machine-readable に出す
  • AC5: disable-model-invocation 候補を検出する
  • AC6: audit 結果を 80 行以内サマリとして出力できる
  • AC7: uv run pytest .claude/skills/agent-context-audit/tests/test_audit_skill_context_budget.py -q が PASS する

Verification Commands

# AC1
$ rg -q "AGENT_CONTEXT_AUDIT_RESULT_V1" .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py

# AC2
$ rg -q "description_chars" .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py

# AC3
$ rg -q "duplicate_instruction_clusters" .claude/skills/agent-context-audit/scripts/audit_duplicate_agent_instructions.py

# AC4
$ rg -q "skillOverrides" .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py

# AC5
$ rg -q "disable-model-invocation" .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py

# AC6
$ rg -q "summary" .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py

# AC7
$ uv run pytest .claude/skills/agent-context-audit/tests/test_audit_skill_context_budget.py -q

Allowed Paths

  • .claude/skills/agent-context-audit/SKILL.md
  • .claude/skills/agent-context-audit/scripts/audit_skill_context_budget.py
  • .claude/skills/agent-context-audit/scripts/audit_duplicate_agent_instructions.py
  • .claude/skills/agent-context-audit/references/context-budget-policy.md
  • .claude/skills/agent-context-audit/tests/test_audit_skill_context_budget.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

  • Python 3(pathlib / json / argparse)

Scope Delta(任意)

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions