From f6931a0e0f45ec31bad5390cfa35d7be28df542e Mon Sep 17 00:00:00 2001 From: lmiranda Date: Mon, 2 Feb 2026 20:33:07 -0500 Subject: [PATCH] feat(agents): add model selection and standardize frontmatter Add per-agent model selection using Claude Code's now-supported `model` frontmatter field, and standardize all agent frontmatter across the marketplace. Changes: - Add `model` field to all 25 agents (18 sonnet, 7 haiku) - Fix viz-platform/data-platform agents using `agent:` instead of `name:` - Remove non-standard `triggers:` field from domain agents - Add missing frontmatter to 13 agents - Document model selection in CLAUDE.md and CONFIGURATION.md - Fix undocumented commands in README.md Model assignments based on reasoning depth, tool complexity, and latency: - sonnet: Planner, Orchestrator, Executor, Coordinator, Security Reviewers - haiku: Maintainability Auditor, Test Validator, Git Assistant, etc. Co-Authored-By: Claude Opus 4.5 --- CHANGELOG.md | 25 ++++++++ CLAUDE.md | 34 +++++++++++ README.md | 10 ++-- docs/CONFIGURATION.md | 57 +++++++++++++++++++ .../clarity-assist/agents/clarity-coach.md | 6 ++ .../agents/maintainer.md | 1 + .../cmdb-assistant/agents/cmdb-assistant.md | 6 ++ .../code-sentinel/agents/refactor-advisor.md | 4 +- .../code-sentinel/agents/security-reviewer.md | 1 + .../contract-validator/agents/agent-check.md | 1 + .../agents/full-validation.md | 6 ++ plugins/data-platform/agents/data-advisor.md | 9 +-- plugins/data-platform/agents/data-analysis.md | 1 + .../data-platform/agents/data-ingestion.md | 6 ++ plugins/doc-guardian/agents/doc-analyzer.md | 4 +- plugins/git-flow/agents/git-assistant.md | 6 ++ plugins/pr-review/agents/coordinator.md | 6 ++ .../agents/maintainability-auditor.md | 6 ++ .../pr-review/agents/performance-analyst.md | 6 ++ plugins/pr-review/agents/security-reviewer.md | 1 + plugins/pr-review/agents/test-validator.md | 6 ++ plugins/projman/agents/code-reviewer.md | 1 + plugins/projman/agents/executor.md | 1 + plugins/projman/agents/orchestrator.md | 1 + plugins/projman/agents/planner.md | 1 + .../viz-platform/agents/component-check.md | 1 + .../viz-platform/agents/design-reviewer.md | 9 +-- plugins/viz-platform/agents/layout-builder.md | 6 ++ plugins/viz-platform/agents/theme-setup.md | 6 ++ 29 files changed, 209 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb0d249..16817b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,31 @@ New scripts for installing marketplace plugins into consumer projects: - `viz-platform` → `["viz-platform"]` - `contract-validator` → `["contract-validator"]` +#### Agent Model Selection + +Per-agent model selection using Claude Code's now-supported `model` frontmatter field. + +- All 25 marketplace agents assigned appropriate model (`sonnet`, `haiku`, or `inherit`) +- Model assignment based on reasoning depth, tool complexity, and latency requirements +- Documentation added to `CLAUDE.md` and `docs/CONFIGURATION.md` + +**Supported values:** `sonnet` (default), `opus`, `haiku`, `inherit` + +**Model assignments:** +| Model | Agent Types | +|-------|-------------| +| sonnet | Planner, Orchestrator, Executor, Code Reviewer, Coordinator, Security Reviewers, Data Advisor, Design Reviewer, etc. | +| haiku | Maintainability Auditor, Test Validator, Component Check, Theme Setup, Git Assistant, Data Ingestion, Agent Check | + +### Fixed + +#### Agent Frontmatter Standardization + +- Fixed viz-platform and data-platform agents using non-standard `agent:` field (now `name:`) +- Removed non-standard `triggers:` field from domain agents (trigger info already in agent body) +- Added missing frontmatter to 13 agents across pr-review, viz-platform, contract-validator, clarity-assist, git-flow, doc-guardian, code-sentinel, cmdb-assistant, and data-platform +- All 25 agents now have consistent `name`, `description`, and `model` fields + --- ## [5.8.0] - 2026-02-02 diff --git a/CLAUDE.md b/CLAUDE.md index 253cdb8..7af645f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -271,6 +271,40 @@ leo-claude-mktplace/ | **Executor** | Implementation-focused | Code implementation, branch management, MR creation | | **Code Reviewer** | Thorough, practical | Pre-close quality review, security scan, test verification | +### Agent Model Selection + +Agents specify their model in frontmatter using Claude Code's `model` field. Supported values: `sonnet` (default), `opus`, `haiku`, `inherit`. + +| Plugin | Agent | Model | Rationale | +|--------|-------|-------|-----------| +| projman | Planner | sonnet | Architectural analysis, sprint planning | +| projman | Orchestrator | sonnet | Coordination and tool dispatch | +| projman | Executor | sonnet | Code generation and implementation | +| projman | Code Reviewer | sonnet | Quality gate, pattern detection | +| pr-review | Coordinator | sonnet | Orchestrates sub-agents, aggregates findings | +| pr-review | Security Reviewer | sonnet | Security analysis | +| pr-review | Performance Analyst | sonnet | Performance pattern detection | +| pr-review | Maintainability Auditor | haiku | Pattern matching (complexity, duplication) | +| pr-review | Test Validator | haiku | Coverage gap detection | +| data-platform | Data Advisor | sonnet | Schema validation, dbt orchestration | +| data-platform | Data Analysis | sonnet | Data exploration and profiling | +| data-platform | Data Ingestion | haiku | Data loading operations | +| viz-platform | Design Reviewer | sonnet | DMC validation + accessibility | +| viz-platform | Layout Builder | sonnet | Dashboard design guidance | +| viz-platform | Component Check | haiku | Quick component validation | +| viz-platform | Theme Setup | haiku | Theme configuration | +| contract-validator | Agent Check | haiku | Reference checking | +| contract-validator | Full Validation | sonnet | Marketplace sweep | +| code-sentinel | Security Reviewer | sonnet | Security analysis | +| code-sentinel | Refactor Advisor | sonnet | Code refactoring advice | +| doc-guardian | Doc Analyzer | sonnet | Documentation drift detection | +| clarity-assist | Clarity Coach | sonnet | Conversational coaching | +| git-flow | Git Assistant | haiku | Git operations | +| claude-config-maintainer | Maintainer | sonnet | CLAUDE.md optimization | +| cmdb-assistant | CMDB Assistant | sonnet | NetBox operations | + +Override by editing the `model:` field in `plugins/{plugin}/agents/{agent}.md`. + ### MCP Server Tools (Gitea) | Category | Tools | diff --git a/README.md b/README.md index dfbf32a..97b2f87 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,11 @@ Comprehensive pull request review using specialized agents. **Commands:** `/pr-review`, `/pr-summary`, `/pr-findings`, `/pr-diff`, `/initial-setup`, `/project-init`, `/project-sync` #### [claude-config-maintainer](./plugins/claude-config-maintainer) -**CLAUDE.md Optimization and Maintenance** +**CLAUDE.md and Settings Optimization** -Analyze, optimize, and create CLAUDE.md configuration files for Claude Code projects. +Analyze, optimize, and create CLAUDE.md configuration files. Audit and optimize settings.local.json permissions. -**Commands:** `/config-analyze`, `/config-optimize`, `/config-init`, `/config-diff`, `/config-lint` +**Commands:** `/analyze`, `/optimize`, `/init`, `/config-diff`, `/config-lint`, `/config-audit-settings`, `/config-optimize-settings`, `/config-permissions-map` #### [contract-validator](./plugins/contract-validator) *NEW in v5.0.0* **Cross-Plugin Compatibility Validation** @@ -122,7 +122,7 @@ Comprehensive data engineering toolkit with persistent DataFrame storage. - 100k row limit with chunking support - Auto-detection of dbt projects -**Commands:** `/ingest`, `/profile`, `/schema`, `/explain`, `/lineage`, `/lineage-viz`, `/run`, `/dbt-test`, `/data-quality`, `/initial-setup` +**Commands:** `/ingest`, `/profile`, `/schema`, `/explain`, `/lineage`, `/lineage-viz`, `/run`, `/dbt-test`, `/data-quality`, `/data-review`, `/data-gate`, `/initial-setup` ### Visualization @@ -312,7 +312,7 @@ After installing plugins, the `/plugin` command may show `(no content)` - this i | clarity-assist | `/clarity-assist:clarify` | | doc-guardian | `/doc-guardian:doc-audit` | | code-sentinel | `/code-sentinel:security-scan` | -| claude-config-maintainer | `/claude-config-maintainer:config-analyze` | +| claude-config-maintainer | `/claude-config-maintainer:analyze` | | cmdb-assistant | `/cmdb-assistant:cmdb-search` | | data-platform | `/data-platform:ingest` | | viz-platform | `/viz-platform:chart` | diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index abf7c6d..ed6e6b6 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -496,6 +496,63 @@ Not all plugins have MCP servers. The install script handles this automatically: --- +## Agent Model Selection + +Marketplace agents specify their preferred model using Claude Code's `model` frontmatter field. This allows cost/performance optimization per agent. + +### Supported Values + +| Value | Description | +|-------|-------------| +| `sonnet` | Default. Balanced performance and cost. | +| `opus` | Higher reasoning depth. Use for complex analysis. | +| `haiku` | Faster, lower cost. Use for mechanical tasks. | +| `inherit` | Use session's current model setting. | + +### How It Works + +Each agent in `plugins/{plugin}/agents/{agent}.md` has frontmatter like: + +```yaml +--- +name: planner +description: Sprint planning agent - thoughtful architecture analysis +model: sonnet +--- +``` + +Claude Code reads this field when invoking the agent as a subagent. + +### Model Assignments + +Agents are assigned models based on their task complexity: + +| Model | Agents | Rationale | +|-------|--------|-----------| +| **sonnet** | Planner, Orchestrator, Executor, Code Reviewer, Coordinator, Security Reviewers, Performance Analyst, Data Advisor, Data Analysis, Design Reviewer, Layout Builder, Full Validation, Doc Analyzer, Clarity Coach, Maintainer, CMDB Assistant, Refactor Advisor | Standard reasoning, tool orchestration, code generation | +| **haiku** | Maintainability Auditor, Test Validator, Component Check, Theme Setup, Agent Check, Data Ingestion, Git Assistant | Pattern matching, quick validation, mechanical tasks | + +### Overriding Model Selection + +**Per-agent override:** Edit the `model:` field in the agent file: + +```bash +# Change executor to use opus for heavy implementation work +nano plugins/projman/agents/executor.md +# Change model: sonnet to model: opus +``` + +**Session-level:** Users on Opus subscription can change the agent's model to `inherit` to use whatever model the session is using. + +### Best Practices + +1. **Default to sonnet** - Good balance for most tasks +2. **Use haiku for speed-sensitive agents** - Sub-agents dispatched in parallel, read-only tasks +3. **Reserve opus for heavy analysis** - Only when sonnet's reasoning isn't sufficient +4. **Use inherit sparingly** - Only when you want session-level control + +--- + ## Automatic Validation Features ### API Validation diff --git a/plugins/clarity-assist/agents/clarity-coach.md b/plugins/clarity-assist/agents/clarity-coach.md index dd57b67..1c2c62f 100644 --- a/plugins/clarity-assist/agents/clarity-coach.md +++ b/plugins/clarity-assist/agents/clarity-coach.md @@ -1,3 +1,9 @@ +--- +name: clarity-coach +description: Patient, structured coach helping users articulate requirements clearly. Uses neurodivergent-friendly communication patterns. +model: sonnet +--- + # Clarity Coach Agent ## Visual Output Requirements diff --git a/plugins/claude-config-maintainer/agents/maintainer.md b/plugins/claude-config-maintainer/agents/maintainer.md index d07470e..550273a 100644 --- a/plugins/claude-config-maintainer/agents/maintainer.md +++ b/plugins/claude-config-maintainer/agents/maintainer.md @@ -1,6 +1,7 @@ --- name: maintainer description: CLAUDE.md optimization and maintenance agent +model: sonnet --- # CLAUDE.md Maintainer Agent diff --git a/plugins/cmdb-assistant/agents/cmdb-assistant.md b/plugins/cmdb-assistant/agents/cmdb-assistant.md index f091371..791a322 100644 --- a/plugins/cmdb-assistant/agents/cmdb-assistant.md +++ b/plugins/cmdb-assistant/agents/cmdb-assistant.md @@ -1,3 +1,9 @@ +--- +name: cmdb-assistant +description: Infrastructure management assistant specialized in NetBox CMDB operations. Use for device management, IP addressing, and infrastructure queries. +model: sonnet +--- + # CMDB Assistant Agent You are an infrastructure management assistant specialized in NetBox CMDB operations. diff --git a/plugins/code-sentinel/agents/refactor-advisor.md b/plugins/code-sentinel/agents/refactor-advisor.md index 395e60e..ff34167 100644 --- a/plugins/code-sentinel/agents/refactor-advisor.md +++ b/plugins/code-sentinel/agents/refactor-advisor.md @@ -1,5 +1,7 @@ --- -description: Code structure and refactoring specialist +name: refactor-advisor +description: Code structure and refactoring specialist. Use when analyzing code quality, design patterns, or planning refactoring work. +model: sonnet --- # Refactor Advisor Agent diff --git a/plugins/code-sentinel/agents/security-reviewer.md b/plugins/code-sentinel/agents/security-reviewer.md index da6eeab..3f1dee7 100644 --- a/plugins/code-sentinel/agents/security-reviewer.md +++ b/plugins/code-sentinel/agents/security-reviewer.md @@ -1,6 +1,7 @@ --- name: security-reviewer description: Security-focused code review agent +model: sonnet --- # Security Reviewer Agent diff --git a/plugins/contract-validator/agents/agent-check.md b/plugins/contract-validator/agents/agent-check.md index d3e3e0e..39c5a51 100644 --- a/plugins/contract-validator/agents/agent-check.md +++ b/plugins/contract-validator/agents/agent-check.md @@ -1,6 +1,7 @@ --- name: agent-check description: Agent definition validator for quick verification +model: haiku --- # Agent Check Agent diff --git a/plugins/contract-validator/agents/full-validation.md b/plugins/contract-validator/agents/full-validation.md index 7ead26e..5fc9767 100644 --- a/plugins/contract-validator/agents/full-validation.md +++ b/plugins/contract-validator/agents/full-validation.md @@ -1,3 +1,9 @@ +--- +name: full-validation +description: Contract validation specialist for comprehensive cross-plugin compatibility validation of the entire marketplace. +model: sonnet +--- + # Full Validation Agent You are a contract validation specialist. Your role is to perform comprehensive cross-plugin compatibility validation for the entire marketplace. diff --git a/plugins/data-platform/agents/data-advisor.md b/plugins/data-platform/agents/data-advisor.md index 0a69067..d54ea1e 100644 --- a/plugins/data-platform/agents/data-advisor.md +++ b/plugins/data-platform/agents/data-advisor.md @@ -1,10 +1,7 @@ --- -agent: data-advisor -description: Reviews code for data integrity, schema validity, and dbt compliance using data-platform MCP tools -triggers: - - /data-review command - - /data-gate command - - projman orchestrator domain gate +name: data-advisor +description: Reviews code for data integrity, schema validity, and dbt compliance using data-platform MCP tools. Use when validating database operations or data pipelines. +model: sonnet --- # Data Advisor Agent diff --git a/plugins/data-platform/agents/data-analysis.md b/plugins/data-platform/agents/data-analysis.md index 81f133b..3f47a35 100644 --- a/plugins/data-platform/agents/data-analysis.md +++ b/plugins/data-platform/agents/data-analysis.md @@ -1,6 +1,7 @@ --- name: data-analysis description: Data analysis specialist for exploration and profiling +model: sonnet --- # Data Analysis Agent diff --git a/plugins/data-platform/agents/data-ingestion.md b/plugins/data-platform/agents/data-ingestion.md index ab1e4bc..1a88768 100644 --- a/plugins/data-platform/agents/data-ingestion.md +++ b/plugins/data-platform/agents/data-ingestion.md @@ -1,3 +1,9 @@ +--- +name: data-ingestion +description: Data ingestion specialist for loading, transforming, and preparing data for analysis. +model: haiku +--- + # Data Ingestion Agent You are a data ingestion specialist. Your role is to help users load, transform, and prepare data for analysis. diff --git a/plugins/doc-guardian/agents/doc-analyzer.md b/plugins/doc-guardian/agents/doc-analyzer.md index 29b5965..2599360 100644 --- a/plugins/doc-guardian/agents/doc-analyzer.md +++ b/plugins/doc-guardian/agents/doc-analyzer.md @@ -1,5 +1,7 @@ --- -description: Specialized agent for documentation analysis and drift detection +name: doc-analyzer +description: Specialized agent for documentation analysis and drift detection. Use when detecting or fixing discrepancies between code and documentation. +model: sonnet --- # Documentation Analyzer Agent diff --git a/plugins/git-flow/agents/git-assistant.md b/plugins/git-flow/agents/git-assistant.md index 1dbb053..65c02e2 100644 --- a/plugins/git-flow/agents/git-assistant.md +++ b/plugins/git-flow/agents/git-assistant.md @@ -1,3 +1,9 @@ +--- +name: git-assistant +description: Git workflow assistant for complex git operations, conflict resolution, and repository history management. +model: haiku +--- + # Git Assistant Agent ## Visual Output Requirements diff --git a/plugins/pr-review/agents/coordinator.md b/plugins/pr-review/agents/coordinator.md index 2b80757..ec3ee8d 100644 --- a/plugins/pr-review/agents/coordinator.md +++ b/plugins/pr-review/agents/coordinator.md @@ -1,3 +1,9 @@ +--- +name: coordinator +description: Review coordinator that orchestrates the multi-agent PR review process. Dispatches to specialized reviewers, aggregates findings, and produces the final review report. Use proactively after code changes. +model: sonnet +--- + # Coordinator Agent ## Visual Output Requirements diff --git a/plugins/pr-review/agents/maintainability-auditor.md b/plugins/pr-review/agents/maintainability-auditor.md index 8af5cc7..c605a82 100644 --- a/plugins/pr-review/agents/maintainability-auditor.md +++ b/plugins/pr-review/agents/maintainability-auditor.md @@ -1,3 +1,9 @@ +--- +name: maintainability-auditor +description: Identifies code complexity, duplication, naming issues, and architecture concerns in PR changes. +model: haiku +--- + # Maintainability Auditor Agent ## Visual Output Requirements diff --git a/plugins/pr-review/agents/performance-analyst.md b/plugins/pr-review/agents/performance-analyst.md index 5b4e3dd..17af156 100644 --- a/plugins/pr-review/agents/performance-analyst.md +++ b/plugins/pr-review/agents/performance-analyst.md @@ -1,3 +1,9 @@ +--- +name: performance-analyst +description: Performance-focused code reviewer that identifies performance issues, inefficiencies, and optimization opportunities. +model: sonnet +--- + # Performance Analyst Agent ## Visual Output Requirements diff --git a/plugins/pr-review/agents/security-reviewer.md b/plugins/pr-review/agents/security-reviewer.md index a85a245..ba3b76f 100644 --- a/plugins/pr-review/agents/security-reviewer.md +++ b/plugins/pr-review/agents/security-reviewer.md @@ -1,6 +1,7 @@ --- name: security-reviewer description: Security-focused code reviewer for PR analysis +model: sonnet --- # Security Reviewer Agent diff --git a/plugins/pr-review/agents/test-validator.md b/plugins/pr-review/agents/test-validator.md index 741e528..eee25ea 100644 --- a/plugins/pr-review/agents/test-validator.md +++ b/plugins/pr-review/agents/test-validator.md @@ -1,3 +1,9 @@ +--- +name: test-validator +description: Test quality reviewer that validates test coverage, test quality, and testing practices in PR changes. +model: haiku +--- + # Test Validator Agent ## Visual Output Requirements diff --git a/plugins/projman/agents/code-reviewer.md b/plugins/projman/agents/code-reviewer.md index f2e808a..8209808 100644 --- a/plugins/projman/agents/code-reviewer.md +++ b/plugins/projman/agents/code-reviewer.md @@ -1,6 +1,7 @@ --- name: code-reviewer description: Pre-sprint code quality review agent +model: sonnet --- # Code Reviewer Agent diff --git a/plugins/projman/agents/executor.md b/plugins/projman/agents/executor.md index 165438c..5813712 100644 --- a/plugins/projman/agents/executor.md +++ b/plugins/projman/agents/executor.md @@ -1,6 +1,7 @@ --- name: executor description: Implementation executor agent - precise implementation guidance and code quality +model: sonnet --- # Implementation Executor Agent diff --git a/plugins/projman/agents/orchestrator.md b/plugins/projman/agents/orchestrator.md index 9f48f2e..9651060 100644 --- a/plugins/projman/agents/orchestrator.md +++ b/plugins/projman/agents/orchestrator.md @@ -1,6 +1,7 @@ --- name: orchestrator description: Sprint orchestration agent - coordinates execution and tracks progress +model: sonnet --- # Sprint Orchestration Agent diff --git a/plugins/projman/agents/planner.md b/plugins/projman/agents/planner.md index 6094891..65a3820 100644 --- a/plugins/projman/agents/planner.md +++ b/plugins/projman/agents/planner.md @@ -1,6 +1,7 @@ --- name: planner description: Sprint planning agent - thoughtful architecture analysis and issue creation +model: sonnet --- # Sprint Planning Agent diff --git a/plugins/viz-platform/agents/component-check.md b/plugins/viz-platform/agents/component-check.md index 6d0d706..3483e00 100644 --- a/plugins/viz-platform/agents/component-check.md +++ b/plugins/viz-platform/agents/component-check.md @@ -1,6 +1,7 @@ --- name: component-check description: DMC component validation specialist +model: haiku --- # Component Check Agent diff --git a/plugins/viz-platform/agents/design-reviewer.md b/plugins/viz-platform/agents/design-reviewer.md index 4f76eec..58f880b 100644 --- a/plugins/viz-platform/agents/design-reviewer.md +++ b/plugins/viz-platform/agents/design-reviewer.md @@ -1,10 +1,7 @@ --- -agent: design-reviewer -description: Reviews code for design system compliance using viz-platform MCP tools -triggers: - - /design-review command - - /design-gate command - - projman orchestrator domain gate +name: design-reviewer +description: Reviews code for design system compliance using viz-platform MCP tools. Use when validating DMC components, theme tokens, or accessibility standards. +model: sonnet --- # Design Reviewer Agent diff --git a/plugins/viz-platform/agents/layout-builder.md b/plugins/viz-platform/agents/layout-builder.md index 8a09925..f5d4760 100644 --- a/plugins/viz-platform/agents/layout-builder.md +++ b/plugins/viz-platform/agents/layout-builder.md @@ -1,3 +1,9 @@ +--- +name: layout-builder +description: Practical dashboard layout specialist for creating well-structured layouts with filtering, grid systems, and responsive design. +model: sonnet +--- + # Layout Builder Agent You are a practical dashboard layout specialist. Your role is to help users create well-structured dashboard layouts with proper filtering, grid systems, and responsive design. diff --git a/plugins/viz-platform/agents/theme-setup.md b/plugins/viz-platform/agents/theme-setup.md index 36f3d9c..12be071 100644 --- a/plugins/viz-platform/agents/theme-setup.md +++ b/plugins/viz-platform/agents/theme-setup.md @@ -1,3 +1,9 @@ +--- +name: theme-setup +description: Design-focused theme setup specialist for creating consistent, brand-aligned themes for Dash Mantine Components applications. +model: haiku +--- + # Theme Setup Agent You are a design-focused theme setup specialist. Your role is to help users create consistent, brand-aligned themes for their Dash Mantine Components applications.