// claude-symphony Pipeline Configuration
{
  "$schema": "https://raw.githubusercontent.com/znehraks/claude-symphony/main/schemas/pipeline.schema.json",
  "pipeline": {
    "name": "Claude Code Development Pipeline",
    "version": "1.0.0",
    "description": "8-stage software development pipeline with TDD-first quality gates"
  },
  "stages": [
    {
      "id": "01-brainstorm",
      "name": "Brainstorming",
      "description": "Divergent idea generation and requirements exploration",
      "models": ["claudecode"],
      "debate_mode": "full",
      "mode": "yolo",
      "inputs": [
        "project_brief.md",
        "user_requirements.md"
      ],
      "outputs": [
        "ideas.md",
        "requirements_analysis.md",
        "HANDOFF.md"
      ],
      "timeout": 3600
    },
    {
      "id": "02-research",
      "name": "Research",
      "description": "Technical research and market analysis",
      "models": ["claudecode"],
      "debate_mode": "standard",
      "mode": "plan",
      "mcp_servers": [
        "context7"
      ],
      "inputs": [
        "requirements_analysis.md"
      ],
      "outputs": [
        "tech_research.md",
        "market_analysis.md",
        "feasibility_report.md",
        "HANDOFF.md"
      ],
      "timeout": 7200
    },
    {
      "id": "03-planning",
      "name": "Planning",
      "description": "System architecture and tech stack decisions",
      "models": ["claudecode"],
      "debate_mode": "full",
      "mode": "plan",
      "inputs": [
        "tech_research.md",
        "feasibility_report.md"
      ],
      "outputs": [
        "architecture.md",
        "tech_stack.md",
        "project_plan.md",
        "HANDOFF.md"
      ],
      "timeout": 3600
    },
    {
      "id": "04-ui-ux",
      "name": "UI/UX Planning",
      "description": "User interface and experience design",
      "models": ["claudecode"],
      "debate_mode": "standard",
      "mode": "plan",
      "inputs": [
        "requirements_analysis.md",
        "architecture.md"
      ],
      "outputs": [
        "wireframes.md",
        "user_flows.md",
        "design_system.md",
        "HANDOFF.md"
      ],
      "timeout": 3600
    },
    {
      "id": "05-task-management",
      "name": "Task Management",
      "description": "Task breakdown and sprint planning",
      "models": ["claudecode"],
      "debate_mode": "light",
      "mode": "plan",
      "inputs": [
        "project_plan.md",
        "architecture.md"
      ],
      "outputs": [
        "tasks.md",
        "sprint_plan.md",
        "milestones.md",
        "HANDOFF.md"
      ],
      "timeout": 1800
    },
    {
      "id": "06-implementation",
      "name": "Implementation (TDD-First)",
      "description": "TDD implementation: write tests first, then code, verify before moving on",
      "models": ["claudecode"],
      "debate_mode": "full",
      "mode": "plan_sandbox",
      "sandbox": true,
      "inputs": [
        "tasks.md",
        "architecture.md",
        "design_system.md"
      ],
      "outputs": [
        "source_code/",
        "implementation_log.md",
        "test_summary.md",
        "HANDOFF.md"
      ],
      "timeout": 14400,
      "checkpoint_required": true
    },
    {
      "id": "07-qa",
      "name": "QA & Full Testing",
      "description": "Security audit, accessibility review, bug fixing, full E2E + test suite execution until all pass",
      "models": ["claudecode"],
      "debate_mode": "full",
      "mode": "plan_sandbox",
      "sandbox": true,
      "mcp_servers": [
        "playwright"
      ],
      "inputs": [
        "source_code/",
        "refactoring_report.md",
        "e2e-test-sheet.md"
      ],
      "outputs": [
        "qa_report.md",
        "bug_list.md",
        "test_report.md",
        "coverage_report.md",
        "HANDOFF.md"
      ],
      "timeout": 7200
    },
    {
      "id": "08-deployment",
      "name": "CI/CD & Deployment",
      "description": "Deployment pipeline setup and deployment",
      "models": ["claudecode"],
      "debate_mode": "light",
      "mode": "headless",
      "inputs": [
        "source_code/",
        "qa_report.md",
        "test_report.md"
      ],
      "outputs": [
        ".github/workflows/",
        "deployment_config/",
        "deployment_log.md"
      ],
      "timeout": 3600
    }
  ],
  "debate": {
    "enabled": true,
    "config_file": "config/debate.jsonc",
    "description": "Claude multi-agent debate system for all pipeline stages"
  },
  "state_management": {
    "progress_file": "state/progress.json",
    "checkpoints_dir": "state/checkpoints",
    "context_dir": "state/context",
    "handoffs_dir": "state/handoffs",
    "context_thresholds": {
      "warning": 60,
      "action": 50,
      "critical": 40
    },
    "task_save_frequency": 5,
    "auto_actions": {
      "on_warning": ["display_banner"],
      "on_action": ["save_snapshot", "suggest_compact"],
      "on_critical": ["save_snapshot", "require_compact"]
    },
    "statusline": {
      "enabled": true,
      "script": ".claude/hooks/statusline.sh",
      "update_interval_ms": 300
    },
    "auto_checkpoint": true,
    "auto_handoff": true,
    "preserve_failed_states": true
  },
  "hooks": {
    "pre_stage": [
      "validate_inputs",
      "check_previous_handoff",
      "verify_prerequisites"
    ],
    "post_stage": [
      "generate_handoff",
      "update_progress",
      "create_checkpoint",
      "notify_completion"
    ]
  },
  "transitions": {
    "allow_skip": false,
    "require_handoff": true,
    "require_checkpoint": [
      "06-implementation"
    ],
    "rollback": {
      "enabled": true,
      "max_rollback_stages": 2
    }
  },
  "quality_gates": {
    "enabled": true,
    "description": "TDD-first quality gates: tests must pass before stage completion",
    "gates": [
      {
        "stage": "06-implementation",
        "required_checks": [
          {
            "name": "build",
            "command": "npm run build",
            "description": "Level 1: Project compiles",
            "required": true
          },
          {
            "name": "test",
            "command": "npm run test",
            "description": "Level 2: All unit/integration tests pass",
            "required": true
          },
          {
            "name": "e2e",
            "command": "npm run test:e2e",
            "description": "Level 3: E2E tests pass (mandatory — test sheet scenarios)",
            "required": true
          }
        ],
        "on_failure": {
          "action": "block_handoff",
          "message": "Tests failed — resolve issues before proceeding"
        }
      },
      {
        "stage": "07-qa",
        "required_checks": [
          {
            "name": "test",
            "command": "npm run test",
            "description": "Full unit + integration test suite",
            "required": true
          },
          {
            "name": "e2e",
            "command": "npm run test:e2e",
            "description": "Full E2E test sheet — all scenarios must pass",
            "required": true
          },
          {
            "name": "coverage",
            "command": "npm run test:coverage",
            "description": "Coverage report — target 80%",
            "required": false
          }
        ],
        "on_failure": {
          "action": "block_handoff",
          "message": "Tests failed — fix and re-run until all pass"
        }
      }
    ]
  }
}
