Back to the catalog

advisor-strategy

Advisor Strategy skill — multi-model advisor for architecture, security, and debugging decisions

Open source Open in the app JSON README (API)

About

Advisor Strategy skill — multi-model advisor for architecture, security, and debugging decisions

Details

Kind
Plugins
Topic
Developer tools
Publisher
aivsomkar
Origin
gemini
Category
ferramentas
Version
1.0.0
Stars
1
Forks
1
Last push
2026-04-12T02:59:46Z
Repository state
ativo
Added
2026-08-30 14:13:39
Updated
2026-08-30 14:13:39
Origin id
aivsomkar/advisor-strategy-skill

README

# Advisor Strategy — Multi-Model Advisor Skill for AI Coding Agents

> Give your AI coding agent a senior engineer on-call. Works with **Claude Code** | **Cursor** | **Gemini CLI** | **Cline** | **Codex** | **Aider** | **Continue** | **Windsurf**

[![Claude Code](https://img.shields.io/badge/Claude_Code-plugin-blue)](https://docs.anthropic.com/en/docs/claude-code)
[![Cursor](https://img.shields.io/badge/Cursor-compatible-green)](https://cursor.com)
[![Gemini CLI](https://img.shields.io/badge/Gemini_CLI-extension-orange)](https://github.com/google-gemini/gemini-cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A skill plugin that implements [Anthropic's Advisor Strategy](https://claude.com/blog/the-advisor-strategy) for any AI coding agent. When your agent faces complex decisions — architecture, security, performance, debugging — it automatically escalates to a stronger model for expert guidance, then returns the advice to your conversation.

**No API setup. No MCP server. Just install and go.**

## Why Use an Advisor?

Your AI coding agent is fast, but sometimes it needs a second opinion. The Advisor Strategy pairs your current model with a more capable one:

- **Claude Sonnet + Opus advisor** = near-Opus intelligence at a fraction of the cost
- **Claude Haiku + Opus advisor** = 85% cheaper than Sonnet with competitive quality
- **Any model + stronger advisor** = better decisions on the tasks that matter most

Based on [Anthropic's research](https://claude.com/blog/the-advisor-strategy): Sonnet with Opus advisor showed **2.7% improvement on SWE-bench** while **reducing cost by 11.9%**.

## Features

- **Autonomous escalation** — detects when advisor consultation would help
- **6 domain advisors** — Architecture, Security, Performance, Debugging, Code Quality, Context Management
- **Multi-advisor** — dispatch multiple advisors in parallel for complex problems
- **Context management** — structured protocol keeps advisor prompts under 3000 tokens
- **Multi-platform** — one plugin, works across all major AI coding tools
- **Zero dependencies** — pure markdown skills, no external services
- **Configurable model** — default Opus 4.6, switch to any model your platform supports

## Quick Start

### Claude Code

```bash
# If plugin marketplace is available:
/plugin install advisor-strategy

# Manual install:
git clone https://github.com/aivsomkar/advisor-strategy-skill.git
cp -r advisor-strategy-skill ~/.claude/skills/advisor-strategy
```

### Cursor

```bash
git clone https://github.com/aivsomkar/advisor-strategy-skill.git
# Add to your project's .cursor/rules/ or ~/.cursor/rules/
cp advisor-strategy-skill/skills/advisor-strategy/SKILL.md .cursor/rules/advisor-strategy.md
```

### Gemini CLI

```bash
# If extension install is available:
gemini extensions install https://github.com/aivsomkar/advisor-strategy-skill

# Manual: clone and reference GEMINI.md in your config
```

### Cline / Continue / Aider

```bash
git clone https://github.com/aivsomkar/advisor-strategy-skill.git

# Cline: add SKILL.md content to your custom instructions
# Continue: add to .continue/rules/
# Aider: add to CONVENTIONS.md or .aider.conf.yml
```

### Any Other Agent

Copy `skills/advisor-strategy/SKILL.md` into whatever instruction/rules/system-prompt mechanism your tool supports.

## How It Works

```
┌─────────────────────────────────────────────────┐
│  Your AI Coding Agent (any platform)            │
│                                                 │
│  1. Detects advisor trigger                     │
│  2. Extracts relevant context (not full chat)   │
│  3. Announces: "Consulting advisor..."          │
│  4. Dispatches advisor (stronger model)         │
│                                                 │
│     ┌───────────────────────────────────┐       │
│     │  Advisor (Opus / GPT-4o / etc.)   │       │
│     │                                   │       │
│     │  - Receives focused context       │       │
│     │  - Analyzes with domain expertise │       │
│     │  - Returns structured advice      │       │
│     └───────────────────────────────────┘       │
│                                                 │
│  5. Presents advisor response (flagged)         │
│  6. Synthesizes: advisor + own assessment       │
│  7. Proceeds with best approach                 │
└─────────────────────────────────────────────────┘
```

## When Does the Advisor Trigger?

### Automatically

The skill detects these situations and escalates:

| Trigger | Example |
|---------|---------|
| **Architectural decisions** | System design, API design, database schema, major refactors |
| **Debugging dead-ends** | Stuck after 2+ failed attempts |
| **Security-sensitive code** | Auth, crypto, permissions, input validation |
| **High-stakes changes** | Production configs, data migrations, CI/CD |
| **Performance-critical paths** | Hot loops, database queries, caching |
| **Trade-off decisions** | Multiple valid approaches, unclear which is best |
| **Context growing large** | Conversation needs summarization and refocus |

### Explicitly

Just tell your agent:
- "use advisor" / "consult advisor" / "get a second opinion"
- "ask opus about this" / "escalate this"
- "security review this code" / "architecture check"

## Domain Advisors

Each domain advisor gets a tailored prompt focused on its area of expertise:

| Domain | What It Reviews | When It Triggers |
|--------|----------------|-----------------|
| **Architecture** | System design, patterns, modularity, extensibility | "design", "structure", "refactor", "scale" |
| **Security** | OWASP top 10, auth flows, input validation, secrets | "auth", "security", "vulnerability" |
| **Performance** | Profiling, caching, algorithmic complexity, DB queries | "slow", "optimize", "latency", "memory" |
| **Debugging** | Root cause analysis, hypothesis generation, test strategies | "stuck", "failing", "root cause" |
| **Code Quality** | Readability, maintainability, testing, patterns | "review", "clean up", "best practice" |
| **Context Manager** | Distill conversation, identify key decisions, compress | Auto-triggered when context is large |

### Multi-Advisor Consultations

For complex problems, dispatch multiple advisors in parallel:

```
"Consult architecture AND security advisors on this API design"
```

The skill dispatches both, then synthesizes — surfacing conflicts (security vs. performance trade-offs) for your decision.

## Context Management

The skill enforces a strict context protocol. Your advisor gets focused signal, not noise:

| Component | Token Budget |
|-----------|-------------|
| Problem statement | ~50-100 tokens (1-3 sentences) |
| Relevant code | ~500-2000 tokens (specific files only) |
| Failed approaches | ~100-200 tokens (brief summary) |
| Constraints | ~50-100 tokens |
| **Total per consultation** | **~1000-3000 tokens** |

No full conversation dumps. No irrelevant files. No tool call logs.

## Configuration

### Changing the Advisor Model

Tell your agent:
```
"Use sonnet as advisor"
"Advisor model: haiku"
```

### When Opus Is Unavailable

The skill does **NOT** silently fall back. It:
1. Informs you Opus is unavailable
2. Explains the trade-offs of proceeding without it
3. Asks whether to continue with the current model or wait

### Skipping the Advisor

```
"Don't use advisor"
"Skip advisor for this"
```

## Platform Compatibility

| Platform | How the Advisor Is Invoked | Status |
|----------|---------------------------|--------|
| **Claude Code** | `Agent(model: "opus")` sub-agent dispatch | Fully supported |
| **Cursor** | Model switching via agent mode | Compatible |
| **Gemini CLI** | Gemini extension with model dispatch | Compatible |
| **Cline** | Sub-agent with configurable model backend | Compatible |
| **Continue** | Model switching in config | Compatible |
| **Aider** | `/model` command switching | Compatible |
| **Codex** | Agent dispatch mechanism | Compatible |
| **Windsurf** | Cascade model selection | Compatible |

Each platform uses its **native mechanism** — no external CLI, no MCP server, no API keys beyond what your tool already has.

## Repository Structure

```
advisor-strategy-skill/
├── .claude-plugin/              # Claude Code plugin manifest
│   ├── plugin.json
│   └── marketplace.json
├── gemini-extension.json        # Gemini CLI extension manifest
├── CLAUDE.md                    # Claude Code platform instructions
├── GEMINI.md                    # Gemini CLI platform instructions
├── AGENTS.md                    # Generic agent instructions (Codex, etc.)
├── hooks/                       # Platform hooks (if needed)
├── skills/
│   └── advisor-strategy/
│       ├── SKILL.md             # The skill (triggers, templates, protocol)
│       └── examples.md          # Usage examples for each domain
├── package.json
└── README.md
```

## Based On

- [The Advisor Strategy](https://claude.com/blog/the-advisor-strategy) by Anthropic
- Inspired by the [Superpowers](https://github.com/obra/superpowers) plugin architecture
- Implements multi-platform skill distribution following the same pattern

## Contributing

PRs welcome. If you've adapted the advisor strategy for a platform not listed above, please contribute the adapter.

## License

MIT

More