Merge pull request '[Sprint 7] feat: add defaultModel to plugin manifests' (#307) from feat/305-plugin-defaults into development
Reviewed-on: #307
This commit was merged in pull request #307.
This commit is contained in:
15
CLAUDE.md
15
CLAUDE.md
@@ -190,6 +190,21 @@ leo-claude-mktplace/
|
|||||||
|
|
||||||
**Note:** `GITEA_ORG` is at project level since different projects may belong to different organizations.
|
**Note:** `GITEA_ORG` is at project level since different projects may belong to different organizations.
|
||||||
|
|
||||||
|
### Agent Model Configuration
|
||||||
|
|
||||||
|
Agents can specify preferred Claude models for cost/performance optimization:
|
||||||
|
|
||||||
|
| Model | Use For | Agents |
|
||||||
|
|-------|---------|--------|
|
||||||
|
| `opus` | Complex reasoning, security | planner, code-reviewer, security-reviewer |
|
||||||
|
| `sonnet` | Implementation, coordination | orchestrator, executor, most agents |
|
||||||
|
| `haiku` | Simple validation | component-check, agent-check |
|
||||||
|
|
||||||
|
**Configuration:** Add `model: opus|sonnet|haiku` to agent frontmatter, or `defaultModel` to plugin.json.
|
||||||
|
**Inheritance:** Agent → Plugin default → System default (sonnet)
|
||||||
|
|
||||||
|
See `docs/MODEL-RECOMMENDATIONS.md` for detailed guidance.
|
||||||
|
|
||||||
### Branch-Aware Security
|
### Branch-Aware Security
|
||||||
|
|
||||||
| Branch Pattern | Mode | Capabilities |
|
| Branch Pattern | Mode | Capabilities |
|
||||||
|
|||||||
@@ -522,6 +522,56 @@ cat .env
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Agent Model Configuration
|
||||||
|
|
||||||
|
Agents can specify which Claude model to use for optimal cost/performance.
|
||||||
|
|
||||||
|
### Model Options
|
||||||
|
|
||||||
|
| Model | Use For | Cost |
|
||||||
|
|-------|---------|------|
|
||||||
|
| `opus` | Complex reasoning, security analysis | Highest |
|
||||||
|
| `sonnet` | Implementation, coordination (default) | Medium |
|
||||||
|
| `haiku` | Simple validation, quick checks | Lowest |
|
||||||
|
|
||||||
|
### Configuration Levels
|
||||||
|
|
||||||
|
**1. Agent-Level (highest priority)**
|
||||||
|
|
||||||
|
Add to agent frontmatter in `agents/*.md`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
name: planner
|
||||||
|
description: Sprint planning agent
|
||||||
|
model: opus
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
**2. Plugin-Level (fallback)**
|
||||||
|
|
||||||
|
Add to `plugin.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"defaultModel": "sonnet"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. System Default**
|
||||||
|
|
||||||
|
If neither is specified, agents use `sonnet`.
|
||||||
|
|
||||||
|
### Inheritance Chain
|
||||||
|
|
||||||
|
```
|
||||||
|
Agent model → Plugin defaultModel → System default (sonnet)
|
||||||
|
```
|
||||||
|
|
||||||
|
See [Model Recommendations](MODEL-RECOMMENDATIONS.md) for detailed guidance on model selection by task type.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Security Best Practices
|
## Security Best Practices
|
||||||
|
|
||||||
1. **Never commit tokens**
|
1. **Never commit tokens**
|
||||||
|
|||||||
149
docs/MODEL-RECOMMENDATIONS.md
Normal file
149
docs/MODEL-RECOMMENDATIONS.md
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
# Model Recommendations
|
||||||
|
|
||||||
|
Guidelines for selecting Claude models (opus, sonnet, haiku) for plugin agents.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Model Overview
|
||||||
|
|
||||||
|
| Model | Best For | Cost | Speed |
|
||||||
|
|-------|----------|------|-------|
|
||||||
|
| **Opus** | Complex reasoning, architecture decisions, security analysis | Highest | Slower |
|
||||||
|
| **Sonnet** | Implementation, coordination, standard tasks | Medium | Balanced |
|
||||||
|
| **Haiku** | Simple validation, quick checks, status queries | Lowest | Fastest |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Task-Type Recommendations
|
||||||
|
|
||||||
|
| Task Type | Model | Rationale |
|
||||||
|
|-----------|-------|-----------|
|
||||||
|
| Architecture decisions | Opus | Requires deep reasoning, trade-off analysis |
|
||||||
|
| Security analysis | Opus | Critical thinking, vulnerability pattern recognition |
|
||||||
|
| Code review (quality) | Opus | Thorough analysis, edge case detection |
|
||||||
|
| Sprint planning | Opus | Strategic thinking, dependency analysis |
|
||||||
|
| Complex data analysis | Opus | Multi-step reasoning, insight generation |
|
||||||
|
| Code implementation | Sonnet | Fast, capable code generation |
|
||||||
|
| Coordination/dispatch | Sonnet | Task management, status tracking |
|
||||||
|
| Data transformation | Sonnet | ETL operations, query building |
|
||||||
|
| Documentation | Sonnet | Clear writing, structure |
|
||||||
|
| Simple validation | Haiku | Fast prop checks, schema validation |
|
||||||
|
| Status checks | Haiku | Quick queries, cost-effective |
|
||||||
|
| Quick verification | Haiku | Simple pass/fail checks |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Agent Model Assignments
|
||||||
|
|
||||||
|
### projman (Sprint Management)
|
||||||
|
|
||||||
|
| Agent | Model | Rationale |
|
||||||
|
|-------|-------|-----------|
|
||||||
|
| `planner` | opus | Architecture decisions, issue structuring |
|
||||||
|
| `orchestrator` | sonnet | Coordination, parallel execution |
|
||||||
|
| `executor` | sonnet | Code implementation |
|
||||||
|
| `code-reviewer` | opus | Quality review, security analysis |
|
||||||
|
|
||||||
|
### pr-review (PR Analysis)
|
||||||
|
|
||||||
|
| Agent | Model | Rationale |
|
||||||
|
|-------|-------|-----------|
|
||||||
|
| `coordinator` | sonnet | Task dispatch, result aggregation |
|
||||||
|
| `security-reviewer` | opus | Security vulnerability detection |
|
||||||
|
| `performance-analyst` | sonnet | Pattern recognition |
|
||||||
|
| `maintainability-auditor` | sonnet | Code quality checks |
|
||||||
|
| `test-validator` | sonnet | Test coverage analysis |
|
||||||
|
|
||||||
|
### code-sentinel (Security & Refactoring)
|
||||||
|
|
||||||
|
| Agent | Model | Rationale |
|
||||||
|
|-------|-------|-----------|
|
||||||
|
| `security-reviewer` | opus | Security scanning |
|
||||||
|
| `refactor-advisor` | sonnet | Refactoring suggestions |
|
||||||
|
|
||||||
|
### data-platform (Data Engineering)
|
||||||
|
|
||||||
|
| Agent | Model | Rationale |
|
||||||
|
|-------|-------|-----------|
|
||||||
|
| `data-analysis` | opus | Complex data insights |
|
||||||
|
| `data-ingestion` | sonnet | ETL operations |
|
||||||
|
|
||||||
|
### viz-platform (Visualization)
|
||||||
|
|
||||||
|
| Agent | Model | Rationale |
|
||||||
|
|-------|-------|-----------|
|
||||||
|
| `component-check` | haiku | Simple prop validation |
|
||||||
|
| `layout-builder` | sonnet | UI construction |
|
||||||
|
| `theme-setup` | sonnet | Design configuration |
|
||||||
|
|
||||||
|
### contract-validator (Compatibility)
|
||||||
|
|
||||||
|
| Agent | Model | Rationale |
|
||||||
|
|-------|-------|-----------|
|
||||||
|
| `full-validation` | sonnet | Contract checking |
|
||||||
|
| `agent-check` | haiku | Quick verification |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Configuration Schema
|
||||||
|
|
||||||
|
### Agent-Level (Frontmatter)
|
||||||
|
|
||||||
|
Add `model` field to agent YAML frontmatter:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
name: planner
|
||||||
|
description: Sprint planning agent
|
||||||
|
model: opus
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
**Valid values:** `opus`, `sonnet`, `haiku`
|
||||||
|
|
||||||
|
### Plugin-Level (plugin.json)
|
||||||
|
|
||||||
|
Add `defaultModel` for plugin-wide fallback:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "projman",
|
||||||
|
"version": "3.4.0",
|
||||||
|
"defaultModel": "sonnet"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Inheritance Chain
|
||||||
|
|
||||||
|
Model selection follows this precedence:
|
||||||
|
|
||||||
|
```
|
||||||
|
1. Agent model field (highest priority)
|
||||||
|
↓ if not specified
|
||||||
|
2. Plugin defaultModel (plugin.json)
|
||||||
|
↓ if not specified
|
||||||
|
3. System default: sonnet
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
- Agent has `model: opus` → Uses opus
|
||||||
|
- Agent has no model, plugin has `defaultModel: sonnet` → Uses sonnet
|
||||||
|
- Neither specified → Uses sonnet (system default)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Cost Optimization Tips
|
||||||
|
|
||||||
|
1. **Default to Sonnet** - Good balance for most tasks
|
||||||
|
2. **Reserve Opus** for critical decisions (security, architecture)
|
||||||
|
3. **Use Haiku** for validation and quick checks
|
||||||
|
4. **Batch simple tasks** - Use haiku for parallel validation
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
- [Configuration Guide](CONFIGURATION.md) - Full configuration reference
|
||||||
|
- [Plugin Development](../README.md) - Adding new plugins
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "code-sentinel",
|
"name": "code-sentinel",
|
||||||
"description": "Security scanning and code refactoring tools",
|
"description": "Security scanning and code refactoring tools",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
|
"defaultModel": "sonnet",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
"email": "leobmiranda@gmail.com"
|
"email": "leobmiranda@gmail.com"
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
name: security-reviewer
|
||||||
description: Security-focused code review agent
|
description: Security-focused code review agent
|
||||||
|
model: opus
|
||||||
---
|
---
|
||||||
|
|
||||||
# Security Reviewer Agent
|
# Security Reviewer Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "contract-validator",
|
"name": "contract-validator",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
|
"defaultModel": "sonnet",
|
||||||
"description": "Cross-plugin compatibility validation and Claude.md agent verification",
|
"description": "Cross-plugin compatibility validation and Claude.md agent verification",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: agent-check
|
||||||
|
description: Agent definition validator for quick verification
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Agent Check Agent
|
# Agent Check Agent
|
||||||
|
|
||||||
You are an agent definition validator. Your role is to verify that a specific agent's tool references and data flow are valid.
|
You are an agent definition validator. Your role is to verify that a specific agent's tool references and data flow are valid.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "data-platform",
|
"name": "data-platform",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
|
"defaultModel": "sonnet",
|
||||||
"description": "Data engineering tools with pandas, PostgreSQL/PostGIS, and dbt integration",
|
"description": "Data engineering tools with pandas, PostgreSQL/PostGIS, and dbt integration",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: data-analysis
|
||||||
|
description: Data analysis specialist for exploration and profiling
|
||||||
|
model: opus
|
||||||
|
---
|
||||||
|
|
||||||
# Data Analysis Agent
|
# Data Analysis Agent
|
||||||
|
|
||||||
You are a data analysis specialist. Your role is to help users explore, profile, and understand their data.
|
You are a data analysis specialist. Your role is to help users explore, profile, and understand their data.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "pr-review",
|
"name": "pr-review",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
|
"defaultModel": "sonnet",
|
||||||
"description": "Multi-agent pull request review with confidence scoring and actionable feedback",
|
"description": "Multi-agent pull request review with confidence scoring and actionable feedback",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: security-reviewer
|
||||||
|
description: Security-focused code reviewer for PR analysis
|
||||||
|
model: opus
|
||||||
|
---
|
||||||
|
|
||||||
# Security Reviewer Agent
|
# Security Reviewer Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "projman",
|
"name": "projman",
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
|
"defaultModel": "sonnet",
|
||||||
"description": "Sprint planning and project management with Gitea integration",
|
"description": "Sprint planning and project management with Gitea integration",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: code-reviewer
|
name: code-reviewer
|
||||||
description: Specialized agent for pre-sprint code quality review
|
description: Specialized agent for pre-sprint code quality review
|
||||||
|
model: opus
|
||||||
---
|
---
|
||||||
|
|
||||||
# Code Reviewer Agent
|
# Code Reviewer Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: planner
|
name: planner
|
||||||
description: Sprint planning agent - thoughtful architecture analysis and issue creation
|
description: Sprint planning agent - thoughtful architecture analysis and issue creation
|
||||||
|
model: opus
|
||||||
---
|
---
|
||||||
|
|
||||||
# Sprint Planner Agent
|
# Sprint Planner Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "viz-platform",
|
"name": "viz-platform",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
|
"defaultModel": "sonnet",
|
||||||
"description": "Visualization tools with Dash Mantine Components validation, Plotly charts, and theming",
|
"description": "Visualization tools with Dash Mantine Components validation, Plotly charts, and theming",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: component-check
|
||||||
|
description: DMC component validation specialist
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Component Check Agent
|
# Component Check Agent
|
||||||
|
|
||||||
You are a strict component validation specialist. Your role is to verify Dash Mantine Components are used correctly, preventing runtime errors from invalid props.
|
You are a strict component validation specialist. Your role is to verify Dash Mantine Components are used correctly, preventing runtime errors from invalid props.
|
||||||
|
|||||||
Reference in New Issue
Block a user