analyze-config
Analyze Agent Smith session metrics and produce tuning recommendations for Claude Code, Codex, OpenCode, or Pi. Use when asked to analyze metrics, tune config, review agent performance, generate a performance report, or optimize agent settings.
- License 许可
- MIT
- 最近更新
- 2026-06-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- analyze-config
- description
- Analyze Agent Smith session metrics and produce tuning recommendations for Claude Code, Codex, OpenCode, or Pi. Use when asked to analyze metrics, tune config, review agent performance, generate a performance report, or optimize agent settings.
03 SKILL.md 正文
Analyze Config
Analyze session metrics and produce tuning recommendations for Claude Code, Codex, OpenCode, or Pi configuration.
Resolve Agent Smith Root
Before running any scripts, resolve AGENT_SMITH_ROOT:
- If the current repo already contains
scripts/analyze-config.shplus.claude-plugin/plugin.json,.codex-plugin/plugin.json,opencode-plugin/package.json, or.pi/extensions/agent-smith/index.ts, use the current repo root. - Otherwise, locate the installed Agent Smith plugin root first, then run all scripts from that path.
Process
- Resolve the initiating agent: use
claudewhen running inside Claude Code,codexwhen running inside Codex,opencodewhen running inside OpenCode, andpiwhen running inside Pi. Do not mix them unless the user explicitly asks for a cross-agent report. - Run rollup: Execute
bash "${AGENT_SMITH_ROOT}/scripts/metrics-rollup.sh"to ensure the SQLite database at~/.config/agent-smith/rollup.dbis current - Run local analysis first: Execute
bash "${AGENT_SMITH_ROOT}/scripts/analyze-config.sh" --sessions 50 --tool <initiating-agent>(adjust session count as needed) - Read the report: Read the generated report from
~/.config/agent-smith/reports/ - Only use LLM analysis with explicit approval: If the user wants AI-generated tuning suggestions, execute
bash "${AGENT_SMITH_ROOT}/scripts/analyze-config.sh" --llm --sessions 50 --tool <initiating-agent>. Only add--include-settingsif the user explicitly approves sending the relevant local settings snapshot. - Categorize suggestions: Split findings into auto-apply (safe) and approval-required (structural)
- Apply safe changes: For wording improvements in the initiating agent's prompt/instruction files, apply directly — these are non-breaking prompt refinements
- Present structural changes: For permission changes, hook timeout adjustments, hook additions, or settings modifications — show the user a summary table with the proposed change, risk level, and rationale. Wait for explicit approval before applying
- Validate: After any changes, verify the relevant config file still parses
What to Look For
- High tool failure rates -> suggest timeout increases or prompt improvements
- Frequent permission denials -> suggest additions to
permissions.allowin settings.json - Test failure loops -> suggest better test strategy wording in commands or CLAUDE.md
- Clarifying question patterns -> suggest more prescriptive wording in the commands that triggered vague prompts
- Session stop reasons (e.g. frequent
max_tokens) -> suggest model or effort level adjustments
Auto-Apply Rules
Safe to apply directly (non-breaking):
- Wording improvements in
~/.claude/commands/*.mdor.claude/commands/*.md - Wording improvements in CLAUDE.md files
- Adding clarifying instructions to existing prompt text
Requires user approval:
- Adding items to
permissions.allowin settings.json - Changing hook timeouts or matchers in settings.json
- Adding or removing hooks
- Modifying model or effort level settings
- Changes to hook shell scripts
Raw Data Mode
Local raw analysis is the default: bash "${AGENT_SMITH_ROOT}/scripts/analyze-config.sh" --sessions 50 --tool <initiating-agent>
04 同仓库更多 Skills
validate-schemas
Validate the installed agent config against the latest schema, surface new features to adopt, and flag deprecated config to remove. Use when asked to validate settings, check schema, update schemas, verify configuration files, or review config for new/deprecated options.
upgrade-settings
Refresh the latest schema for the active agent, compare it against the installed config, and produce an implementation plan for new features to adopt or deprecated settings to remove. Use when asked to review schema updates, upgrade settings, leverage new schema features, deprecate old settings, or turn schema drift into an actionable implementation plan.
validate-schemas
Validate the installed agent config against the latest schema, surface new features to adopt, and flag deprecated config to remove. Use when asked to validate settings, check schema, update schemas, verify configuration files, or review config for new/deprecated options.
upgrade-settings
Refresh the latest schema for the active agent, compare it against the installed config, and produce an implementation plan for new features to adopt or deprecated settings to remove. Use when asked to review schema updates, upgrade settings, leverage new schema features, deprecate old settings, or turn schema drift into an actionable implementation plan.
analyze-config
Analyze Agent Smith session metrics and produce tuning recommendations for Claude Code, Codex, OpenCode, or Pi. Use when asked to analyze metrics, tune config, review agent performance, generate a performance report, or optimize agent settings.
validate-schemas
暂无简介