Airsc miễn phí cho tất cả. Nếu nó giúp bạn, hãy ủng hộ $2–$20.

Ủng hộ
PluginAn toànQuy trình & bộ nhớ agentCần cài đặt chút

adversarial-spec

zscole · zscole/adversarial-spec

Tinh chỉnh các đặc tả sản phẩm bằng quy trình tranh luận đa-LLM, trong đó các mô hình phê bình và cải thiện đặc tả cho đến khi đạt được sự đồng thuận.

A Claude Code plugin that iteratively refines product specifications by debating between multiple LLMs until all models reach consensus.

556 sao50Giấy phép: MITCập nhật 9 tháng trước0 lượt mở

Xem trước

▍

Bạn có thể làm gì với nó

  • Tinh chỉnh đặc tả sản phẩm cho một dịch vụ giới hạn tốc độ mới thông qua một cuộc tranh luận đa-LLM tự động.
  • Phát hiện các trường hợp đặc biệt và sự không nhất quán trong tài liệu yêu cầu tính năng bằng cách để nhiều agent thách thức nó.
  • Tạo một tài liệu thiết kế mạnh mẽ và hoàn chỉnh hơn sau khi nó đã vượt qua quá trình xem xét đối kháng nghiêm ngặt bởi các LLM đa dạng.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

adversarial-spec

A Claude Code plugin that iteratively refines product specifications through multi-model debate until consensus is reached.

Key insight: A single LLM reviewing a spec will miss things. Multiple LLMs debating a spec will catch gaps, challenge assumptions, and surface edge cases that any one model would overlook. The result is a document that has survived rigorous adversarial review.

Claude is an active participant, not just an orchestrator. Claude provides independent critiques, challenges opponent models, and contributes substantive improvements alongside external models.

Quick Start

# 1. Add the marketplace and install the plugin
claude plugin marketplace add zscole/adversarial-spec
claude plugin install adversarial-spec

# 2. Set at least one API key
export OPENAI_API_KEY="sk-..."
# Or use OpenRouter for access to multiple providers with one key
export OPENROUTER_API_KEY="sk-or-..."

# 3. Run it
/adversarial-spec "Build a rate limiter service with Redis backend"

How It Works

You describe product --> Claude drafts spec --> Multiple LLMs critique in parallel
        |                                              |
        |                                              v
        |                              Claude synthesizes + adds own critique
        |                                              |
        |                                              v
        |                              Revise and repeat until ALL agree
        |                                              |
        +--------------------------------------------->|
                                                       v
                                            User review period
                                                       |
                                                       v
                                            Final document output
  1. Describe your product concept or provide an existing document
  2. (Optional) Start with an in-depth interview to capture requirements
  3. Claude drafts the initial document (PRD or tech spec)
  4. Document is sent to opponent models (GPT, Gemini, Grok, etc.) for parallel critique
  5. Claude provides independent critique alongside opponent feedback
  6. Claude synthesizes all feedback and revises
  7. Loop continues until ALL models AND Claude agree
  8. User review period: request changes or run additional cycles
  9. Final converged document is output

Requirements

  • Python 3.10+
  • litellm package: pip install litellm
  • API key for at least one LLM provider

Supported Models

ProviderEnv VarExample Models
OpenAIOPENAI_API_KEYgpt-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
Codex CLIChatGPT subscriptioncodex/gpt-5.2-codex, codex/gpt-5.1-codex-max
Gemini CLIGoogle accountgemini-cli/gemini-3-pro-preview, gemini-cli/gemini-3-flash-preview
DeepseekDEEPSEEK_API_KEYdeepseek/deepseek-chat
ZhipuZHIPUAI_API_KEYzhipu/glm-4, zhipu/glm-4-plus

Check which keys are configured:

python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" providers

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):

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

# Add models 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 configuration
python3 "$(find ~/.claude -name debate.py -path '*adversarial-spec*' 2>/dev/null | head -1)" bedrock status

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

When Bedrock is enabled, all model calls route through Bedrock - no direct API calls are made. Use friendly names like claude-3-sonnet which are automatically mapped to Bedrock model IDs.

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

OpenRouter Support

OpenRouter provides unified access to multiple LLM providers through a single API. This is useful for:

  • Accessing models from multiple providers with one API key
  • Comparing models across different providers
  • Automatic fallback and load balancing
  • Cost optimization across providers

Setup:

# Get your API key from https://openrouter.ai/keys
export OPENROUTER_API_KEY="sk-or-..."

# Use OpenRouter models (prefix with openrouter/)
python3 debate.py critique --models openrouter/openai/gpt-4o,openrouter/anthropic/claude-3.5-sonnet < spec.md

Popular OpenRouter models:

  • openrouter/openai/gpt-4o - GPT-4o via OpenRouter
  • openrouter/anthropic/claude-3.5-sonnet - Claude 3.5 Sonnet
  • openrouter/google/gemini-2.0-flash - Gemini 2.0 Flash
  • openrouter/meta-llama/llama-3.3-70b-instruct - Llama 3.3 70B
Xem mã nguồn trên GitHub