AD

adversarial-spec

Iteratively improves product specifications using debate between multiple AI models.

Install

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

Installs to .claude/skills/adversarial-spec

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
209 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Orchestrate multi-model critique sessions
  • Aggregate LLM consensus on design constraints
  • Challenge specification logic via adversarial prompts
  • Normalize feedback across different model architectures

How it works

Initiates a recursive debate where multiple models iterate on a document until logical inconsistencies and design flaws are minimized.

Inputs & outputs

You give it
Initial draft specification document
You get back
Refined specification with consolidated model consensus

When to use adversarial-spec

  • Refining a product requirement document
  • Debating architectural approaches
  • Ensuring spec quality via multi-model review

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.

When not to use it

  • Simple, non-critical technical specs
  • Situations requiring rapid, single-source decision making

Prerequisites

LiteLLM configuredTarget API keys for LLM providers

Limitations

  • Significant token cost for multi-model debate cycles
  • Requires careful management of API key security
  • Consensus can lead to design homogenization

How it compares

It forces convergence through automated multi-perspective adversarial review rather than relying on a single model's bias.

Compared to similar skills

adversarial-spec side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
adversarial-spec (this skill)36moReviewAdvanced
decision-critic16moNo flagsAdvanced
research-project-planner01moNo flagsIntermediate
literature-review5592moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

decision-critic

solatis

Invoke IMMEDIATELY via python script to stress-test decisions and reasoning. Do NOT analyze first - the script orchestrates the critique workflow.

11

research-project-planner

Taichuan3

用于生物信息学或计算生物学项目启动前,将模糊研究方向转成可执行研究路线:澄清 central question、knowledge gap、hypothesis、evidence package、figure skeleton、技术路线、风险和 stop/pivot criteria。不用于已明确的代码执行、单篇论文阅读或单纯文本润色。

00

literature-review

K-Dense-AI

Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).

5591,298

openalex-database

davila7

Query and analyze scholarly literature using the OpenAlex database. This skill should be used when searching for academic papers, analyzing research trends, finding works by authors or institutions, tracking citations, discovering open access publications, or conducting bibliometric analysis across 240M+ scholarly works. Use for literature searches, research output analysis, citation analysis, and academic database queries.

48202

annas-archive-ebooks

ratacat

Use when needing to look up book content, find a book by title/author, download an ebook, or reference material from a published book. Triggers on book lookups, ebook downloads, "find the book", "get the PDF/EPUB of". Downloads produce PDF/EPUB/MOBI files - use ebook-extractor skill to convert to text.

22177

prompt-optimizer

solatis

Optimize system prompts for Claude Code agents using proven prompt engineering patterns. Use when users request prompt improvement, optimization, or refinement for agent workflows, tool instructions, or system behaviors.

43147

Search skills

Search the agent skills registry