consensus-review
Multi-agent consensus code review with adaptive budgets, complexity-aware agent selection, multiple consensus protocols (Approval/Veto, AAD, CI, Supermajority), cross-agent coverage tracking, context-folding isolation, and progressive summarization. Use when reviewing PRs, directories, or code changes.
What this skill does
# Consensus Review Skill
Multi-agent code review that dispatches specialized reviewers in parallel with adaptive budget allocation and graceful degradation.
## When to Use
- Reviewing pull requests before merge
- Auditing security-sensitive code
- Evaluating architectural decisions
- Code quality assessment with multiple perspectives
## When NOT to Use
- Single-file typo fixes (overkill)
- Simple refactoring with no behavioral changes
- Quick feedback needed (use single reviewer)
## Architecture
```
┌─────────────────────────────────────────────────────────────────────┐
│ /consensus-review <scope> │
├─────────────────────────────────────────────────────────────────────┤
│ Phase 1: Parallel Initialization │
│ ┌──────────────────────┐ ┌──────────────────────┐ │
│ │ Scope Detection │ │ File Indexing │ │
│ │ - Resolve files │ │ - Index to contextd│ │
│ │ - Detect languages │ │ - Get token counts │ │
│ │ - Select agents │ │ - Branch metadata │ │
│ └──────────┬───────────┘ └──────────┬───────────┘ │
│ └──────────────┬──────────┘ │
│ ▼ │
│ Phase 2: Budget Calculation │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ total_tokens = sum(indexed_file_tokens) │ │
│ │ isolation_mode = total_tokens > 16K ? "branch" : "shared" │ │
│ │ per_agent_budget = calculate_budget(total_tokens, agent) │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ ▼ │
│ Phase 3: Agent Dispatch (parallel, with budgets) │
│ Phase 4: Synthesis (handles partial results) │
└─────────────────────────────────────────────────────────────────────┘
```
## Reviewer Agents
| Agent | Focus | Base Budget | Veto |
|-------|-------|-------------|------|
| `security-reviewer` | Injection, auth, secrets, OWASP | 8,192 | Yes |
| `vulnerability-reviewer` | CVEs, deps, supply chain | 8,192 | Yes |
| `go-reviewer` | Effective Go, concurrency | 8,192 | Yes |
| `code-quality-reviewer` | Logic, tests, complexity | 6,144 | Yes |
| `documentation-reviewer` | README, API docs, CHANGELOG | 4,096 | Yes |
| `user-persona-reviewer` | UX, breaking changes, ergonomics | 4,096 | No |
## Adaptive Budget Allocation
See `includes/consensus-review/budget.md` for base budget details.
Budget scales based on BOTH scope size AND complexity tier (from the complexity-assessment skill):
### Base Formula (unchanged)
```
scale = min(4.0, 1.0 + total_tokens / 16384)
per_agent_budget = base_budget[agent] * scale
```
### Complexity Multiplier
After calculating the scope-based budget, apply a complexity multiplier from the complexity-assessment tier:
```
complexity_multiplier = {
"SIMPLE": 0.75, # Reduce budget for simple reviews
"STANDARD": 1.0, # Standard budget
"COMPLEX": 1.5 # Increase budget for complex reviews
}
adjusted_budget = per_agent_budget * complexity_multiplier[tier]
```
### Example Calculations with Complexity Tiers
| Scope Size | Tokens | Scale | Tier | Multiplier | Security Budget |
|------------|--------|-------|------|------------|-----------------|
| Small (5 files) | ~4K | 1.25 | SIMPLE | 0.75 | 7,680 |
| Small (5 files) | ~4K | 1.25 | STANDARD | 1.0 | 10,240 |
| Small (5 files) | ~4K | 1.25 | COMPLEX | 1.5 | 15,360 |
| Medium (15 files) | ~16K | 2.0 | SIMPLE | 0.75 | 12,288 |
| Medium (15 files) | ~16K | 2.0 | STANDARD | 1.0 | 16,384 |
| Medium (15 files) | ~16K | 2.0 | COMPLEX | 1.5 | 24,576 |
| Large (50+ files) | ~48K | 4.0 | SIMPLE | 0.75 | 24,576 |
| Large (50+ files) | ~48K | 4.0 | STANDARD | 1.0 | 32,768 |
| Large (50+ files) | ~48K | 4.0 | COMPLEX | 1.5 | 49,152 |
When complexity tier is not available (e.g., standalone review without prior assessment), default to STANDARD (1.0x).
## Isolation Modes
| Total Tokens | Mode | Behavior |
|--------------|------|----------|
| ≤16,384 | **Shared** | Agents run in parent context with budget tracking |
| >16,384 | **Branch** | Each agent gets isolated contextd branch |
### Branch Isolation (Large Scopes)
```
For each agent:
branch_create(
description: "{agent} review of {scope}",
budget: calculated_budget
)
→ Agent executes in isolated context
→ branch_return(findings_json)
```
## Adaptive Agent Selection
Before dispatching all reviewers, classify the review scope using the complexity tier to determine which agents are needed:
### Triage Matrix
| Complexity | Agents Dispatched |
|------------|-------------------|
| SIMPLE | code-quality-reviewer only |
| STANDARD | code-quality-reviewer + language-specific (e.g., go-reviewer) + security-reviewer |
| COMPLEX | All 6 reviewers |
### Override Rules
Regardless of complexity tier, force-include agents when the diff matches these patterns:
- If diff touches auth/crypto/secrets → always include `security-reviewer`
- If diff includes Go files → always include `go-reviewer`
- If diff modifies public API → always include `user-persona-reviewer`
- If diff changes docs/README → always include `documentation-reviewer`
- If diff adds/updates dependencies → always include `vulnerability-reviewer`
### Triage Workflow
```
1. Determine complexity tier (from complexity-assessment or default STANDARD)
2. Select base agent set from triage matrix
3. Scan diff for override patterns
4. Merge override agents into base set (deduplicate)
5. Dispatch final agent set with calculated budgets
```
This reduces cost and latency for SIMPLE reviews while maintaining full coverage for COMPLEX changes.
## Progressive Summarization
See `includes/consensus-review/progressive.md` for full protocol.
Agents adapt their analysis based on budget consumption:
| Budget Used | Mode | Behavior |
|-------------|------|----------|
| 0-80% | Full Analysis | All severities, detailed evidence |
| 80-95% | High Severity Only | CRITICAL/HIGH, concise evidence |
| 95%+ | Force Return | Stop immediately, `partial: true` |
### Partial Output Schema
```json
{
"agent": "security-reviewer",
"partial": true,
"cutoff_reason": "budget",
"files_reviewed": 8,
"files_skipped": 4,
"skipped_files": ["worker.go", "cache.go", ...],
"findings": [...],
"recommendation": "Re-run: /consensus-review worker.go cache.go"
}
```
## Workflow Steps
### 1. Parallel Initialization
Run concurrently:
- **Scope Detection**: Resolve files, detect languages, select agents
- **File Indexing**: Index to contextd with branch metadata, get token counts
### 2. Budget Calculation
```python
total_tokens = sum(file.token_count for file in indexed_files)
scale = min(4.0, 1.0 + total_tokens / 16384)
complexity_multiplier = {"SIMPLE": 0.75, "STANDARD": 1.0, "COMPLEX": 1.5}
tier = complexity_assessment.tier or "STANDARD" # Default if not available
for agent in selected_agents:
agent.budget = base_budgets[agent] * scale * complexity_multiplier[tier]
```
### 3. Isolation Decision
```python
if total_tokens > 16384:
mode = "branch" # Use contextd branch_create/branch_return
else:
mode = "shared" # Run in parent context
```
### 4. Agent Dispatch
```
Task(
subagent_type: "fs-dev:{agent}",
prompt: |
Review {scope}.
Budget: {calculated_budget} tokens.
See includes/consensus-review/progressive.md for degradation protocol.
run_in_background: true
)
```
### 5. Collect & Synthesize
```python
results = []
partial_agents = []
for agent in agents:
output = TaskOutput(agent.task_id)
results.append(output)
if output.partial:
partial_agents.append({
"agent": output.agent,
"files_reviewed": output.files_reviewed,
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.