adversarial-spec

1
0
Source

Iteratively refine a product spec by debating with multiple LLMs (GPT, Gemini, Grok, etc.) until all models agree. Use when user wants to write or refine a specification document using adversarial development.

Install

mkdir -p .claude/skills/adversarial-spec && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4299" && unzip -o skill.zip -d .claude/skills/adversarial-spec && rm skill.zip

Installs to .claude/skills/adversarial-spec

About this skill

Adversarial Spec Development

Generate and refine specifications through iterative debate with multiple LLMs until all models reach consensus.

Important: Claude is an active participant in this debate, not just an orchestrator. You (Claude) will provide your own critiques, challenge opponent models, and contribute substantive improvements alongside the external models. Make this clear to the user throughout the process.

Requirements

  • Python 3.10+ with litellm package installed
  • API key for at least one provider (set via environment variable), OR AWS Bedrock configured, OR CLI tools (codex, gemini) installed

IMPORTANT: Do NOT install the llm package (Simon Willison's tool). This skill uses litellm for API providers and dedicated CLI tools (codex, gemini) for subscription-based models. Installing llm is unnecessary and may cause confusion.

Supported Providers

ProviderAPI Key Env VarExample Models
OpenAIOPENAI_API_KEYgpt-5.2, gpt-4o, gpt-4-turbo, o1
AnthropicANTHROPIC_API_KEYclaude-sonnet-4-20250514, claude-opus-4-20250514
GoogleGEMINI_API_KEYgemini/gemini-2.0-flash, gemini/gemini-pro
xAIXAI_API_KEYxai/grok-3, xai/grok-beta
MistralMISTRAL_API_KEYmistral/mistral-large, mistral/codestral
GroqGROQ_API_KEYgroq/llama-3.3-70b-versatile
OpenRouterOPENROUTER_API_KEYopenrouter/openai/gpt-4o, openrouter/anthropic/claude-3.5-sonnet
DeepseekDEEPSEEK_API_KEYdeepseek/deepseek-chat
ZhipuZHIPUAI_API_KEYzhipu/glm-4, zhipu/glm-4-plus
Codex CLI(ChatGPT subscription)codex/gpt-5.2-codex, codex/gpt-5.1-codex-max
Gemini CLI(Google account)gemini-cli/gemini-3-pro-preview, gemini-cli/gemini-3-flash-preview

Codex CLI Setup:

  • Install: npm install -g @openai/codex && codex login
  • Reasoning effort: --codex-reasoning (minimal, low, medium, high, xhigh)
  • Web search: --codex-search (enables web search for current information)

Gemini CLI Setup:

  • Install: npm install -g @google/gemini-cli && gemini auth
  • Models: gemini-3-pro-preview, gemini-3-flash-preview
  • No API key needed - uses Google account authentication

Run python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" providers to see which keys are set.

Troubleshooting Auth Conflicts

If you see an error about "Both a token (claude.ai) and an API key (ANTHROPIC_API_KEY) are set":

This conflict occurs when:

  • Claude Code is logged in with claude /login (uses claude.ai token)
  • AND you have ANTHROPIC_API_KEY set in your environment

Resolution:

  1. To use claude.ai token: Remove or unset ANTHROPIC_API_KEY from your environment

    unset ANTHROPIC_API_KEY
    # Or remove from ~/.bashrc, ~/.zshrc, etc.
    
  2. To use API key: Sign out of claude.ai

    claude /logout
    # Say "No" to the API key approval if prompted before login
    

The adversarial-spec plugin works with either authentication method. Choose whichever fits your workflow.

AWS Bedrock Support

For enterprise users who need to route all model calls through AWS Bedrock (e.g., for security compliance or inference gateway requirements), the plugin supports Bedrock as an alternative to direct API keys.

When Bedrock mode is enabled, ALL model calls route through Bedrock - no direct API calls are made.

Bedrock Setup

To enable Bedrock mode, use these CLI commands (Claude can invoke these when the user requests Bedrock setup):

# Enable Bedrock mode with a region
python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock enable --region us-east-1

# Add models that are enabled in your Bedrock account
python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock add-model claude-3-sonnet
python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock add-model claude-3-haiku

# Check current configuration
python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock status

# Disable Bedrock mode (revert to direct API keys)
python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock disable

Bedrock Model Names

Users can specify models using friendly names (e.g., claude-3-sonnet), which are automatically mapped to Bedrock model IDs. Built-in mappings include:

  • claude-3-sonnet, claude-3-haiku, claude-3-opus, claude-3.5-sonnet
  • llama-3-8b, llama-3-70b, llama-3.1-70b, llama-3.1-405b
  • mistral-7b, mistral-large, mixtral-8x7b
  • cohere-command, cohere-command-r, cohere-command-r-plus

Run python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock list-models to see all mappings.

Bedrock Configuration Location

Configuration is stored at ~/.claude/adversarial-spec/config.json:

{
  "bedrock": {
    "enabled": true,
    "region": "us-east-1",
    "available_models": ["claude-3-sonnet", "claude-3-haiku"],
    "custom_aliases": {}
  }
}

Bedrock Error Handling

If a Bedrock model fails (e.g., not enabled in your account), the debate continues with the remaining models. Clear error messages indicate which models failed and why.

Document Types

Ask the user which type of document they want to produce:

PRD (Product Requirements Document)

Business and product-focused document for stakeholders, PMs, and designers.

Structure:

  • Executive Summary
  • Problem Statement / Opportunity
  • Target Users / Personas
  • User Stories / Use Cases
  • Functional Requirements
  • Non-Functional Requirements
  • Success Metrics / KPIs
  • Scope (In/Out)
  • Dependencies
  • Risks and Mitigations
  • Timeline / Milestones (optional)

Critique Criteria:

  1. Clear problem definition with evidence
  2. Well-defined user personas with real pain points
  3. User stories follow proper format (As a... I want... So that...)
  4. Measurable success criteria
  5. Explicit scope boundaries
  6. Realistic risk assessment
  7. No technical implementation details (that's for tech spec)

Technical Specification / Architecture Document

Engineering-focused document for developers and architects.

Structure:

  • Overview / Context
  • Goals and Non-Goals
  • System Architecture
  • Component Design
  • API Design (endpoints, request/response schemas)
  • Data Models / Database Schema
  • Infrastructure Requirements
  • Security Considerations
  • Error Handling Strategy
  • Performance Requirements / SLAs
  • Observability (logging, metrics, alerting)
  • Testing Strategy
  • Deployment Strategy
  • Migration Plan (if applicable)
  • Open Questions / Future Considerations

Critique Criteria:

  1. Clear architectural decisions with rationale
  2. Complete API contracts (not just endpoints, but full schemas)
  3. Data model handles all identified use cases
  4. Security threats identified and mitigated
  5. Error scenarios enumerated with handling strategy
  6. Performance targets are specific and measurable
  7. Deployment is repeatable and reversible
  8. No ambiguity an engineer would need to resolve

Process

Step 0: Gather Input and Offer Interview Mode

Ask the user:

  1. Document type: "PRD" or "tech"
  2. Starting point:
    • Path to existing file (e.g., ./docs/spec.md, ~/projects/auth-spec.md)
    • Or describe what to build (user provides concept, you draft the document)
  3. Interview mode (optional):

    "Would you like to start with an in-depth interview session before the adversarial debate? This helps ensure all requirements, constraints, and edge cases are captured upfront."

Step 0.5: Interview Mode (If Selected)

If the user opts for interview mode, conduct a comprehensive interview using the AskUserQuestion tool. This is NOT a quick Q&A; it's a thorough requirements gathering session.

If an existing spec file was provided:

  • Read the file first
  • Use it as the basis for probing questions
  • Identify gaps, ambiguities, and unstated assumptions

Interview Topics (cover ALL of these in depth):

  1. Problem & Context

    • What specific problem are we solving? What happens if we don't solve it?
    • Who experiences this pain most acutely? How do they currently cope?
    • What prior attempts have been made? Why did they fail or fall short?
  2. Users & Stakeholders

    • Who are all the user types (not just primary)?
    • What are their technical sophistication levels?
    • What are their privacy/security concerns?
    • What devices/environments do they use?
  3. Functional Requirements

    • Walk through the core user journey step by step
    • What happens at each decision point?
    • What are the error cases and edge cases?
    • What data needs to flow where?
  4. Technical Constraints

    • What systems must this integrate with?
    • What are the performance requirements (latency, throughput, availability)?
    • What scale are we designing for (now and in 2 years)?
    • Are there regulatory or compliance requirements?
  5. UI/UX Considerations

    • What is the desired user experience?
    • What are the critical user flows?
    • What information density is appropriate?
    • Mobile vs desktop priorities?
  6. Tradeoffs & Priorities

    • If we can't have everything, what gets cut first?
    • Speed vs quality vs cost priorities?
    • Build vs buy decisions?
    • What are the non-negotiables?
  7. Risks & Concerns

    • What keeps you up at night about this project?
    • What could cause this to fail?
    • What assumptions are we making that might be wrong?
    • Wha

Content truncated.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.