# VERSATIL SDLC Framework - Cursor Configuration Template
# Generated by: versatil cursor:init
# Framework Version: 4.1.0
# Last Updated: 2025-10-05

# ============================================================================
# PROJECT CONTEXT
# ============================================================================

project_name: "My Project"  # TODO: Update with your project name
project_type: "fullstack"  # Options: fullstack | frontend | backend | mobile | ai-ml | data-science

tech_stack:
  frontend:
    - "React"  # TODO: Update with your frontend framework
    - "TypeScript"
    - "Tailwind CSS"

  backend:
    - "Node.js"  # TODO: Update with your backend stack
    - "Express"
    - "PostgreSQL"

  testing:
    - "Jest"  # TODO: Update with your testing frameworks
    - "React Testing Library"
    - "Playwright"

  # Optional: Add if using AI/ML
  # ai_ml:
  #   - "Python"
  #   - "TensorFlow"
  #   - "PyTorch"

# ============================================================================
# VERSATIL AGENT CONFIGURATION
# ============================================================================

agents:
  # ---------------------------------------------------------------------------
  # Maria-QA - Quality Guardian
  # Auto-activates on: *.test.*, __tests__/**, coverage reports
  # ---------------------------------------------------------------------------
  maria-qa:
    enabled: true
    auto_run_on_save: true
    coverage_threshold: 80  # Minimum test coverage percentage
    test_frameworks: ["jest", "vitest", "playwright"]

    proactive_actions:
      test_coverage_analysis:
        enabled: true
        threshold: 80
        report_format: "html"  # Options: html | json | text
        show_uncovered_lines: true

      missing_test_detection:
        enabled: true
        scan_on_file_save: true
        suggest_test_cases: true
        detect_untested_functions: true

      assertion_validation:
        enabled: true
        check_edge_cases: true
        validate_error_scenarios: true
        suggest_additional_assertions: true

      visual_regression:
        enabled: false  # Enable for UI-heavy projects
        browser: "chrome"
        viewports: [375, 768, 1920]

      quality_gate_enforcement:
        enabled: true
        block_on_failure: true
        min_coverage: 80
        require_passing_tests: true

  # ---------------------------------------------------------------------------
  # James-Frontend - UI/UX Expert
  # Auto-activates on: *.tsx, *.jsx, *.vue, *.css, *.scss
  # ---------------------------------------------------------------------------
  james-frontend:
    enabled: true
    auto_run_on_save: true
    accessibility_standard: "WCAG 2.1 AA"  # Options: WCAG 2.0 A | WCAG 2.1 AA | WCAG 2.1 AAA
    responsive_breakpoints: [320, 768, 1024, 1920]
    css_framework: "tailwind"  # Options: tailwind | bootstrap | mui | custom

    proactive_actions:
      accessibility_check_wcag:
        enabled: true
        level: "AA"  # Options: A | AA | AAA
        auto_fix_simple_issues: false  # Set to true for auto-fixes
        check_aria_labels: true
        validate_color_contrast: true
        keyboard_navigation: true

      component_structure_validation:
        enabled: true
        enforce_patterns: ["composition", "container-presentational"]
        max_component_size_lines: 300
        suggest_decomposition: true

      responsive_design_verification:
        enabled: true
        breakpoints: [320, 768, 1024, 1920]
        test_orientation: true  # Portrait + landscape
        suggest_media_queries: true

      performance_optimization_suggestions:
        enabled: true
        target_lighthouse_score: 90
        check_bundle_size: true
        suggest_code_splitting: true
        detect_unnecessary_rerenders: true

  # ---------------------------------------------------------------------------
  # Marcus-Backend - API Architect & Security Expert
  # Auto-activates on: *.api.*, routes/**, controllers/**, server/**
  # ---------------------------------------------------------------------------
  marcus-backend:
    enabled: true
    auto_run_on_save: true
    security_standard: "OWASP Top 10 2023"
    performance_target_ms: 200  # Target API response time
    auto_stress_test: true

    proactive_actions:
      security_pattern_validation_owasp:
        enabled: true
        check_sql_injection: true
        check_xss: true
        check_csrf: true
        validate_auth: true
        scan_dependencies: true

      response_time_check_200ms:
        enabled: true
        target_ms: 200
        monitor_slow_queries: true
        suggest_caching: true

      stress_test_generation:
        enabled: true
        concurrent_users: 1000
        duration_seconds: 60
        auto_run_on_api_change: true

      database_query_optimization:
        enabled: true
        detect_n_plus_1: true
        suggest_indexes: true
        validate_transactions: true

  # ---------------------------------------------------------------------------
  # Sarah-PM - Project Manager & Coordinator
  # Auto-activates on: *.md, docs/**, project events
  # ---------------------------------------------------------------------------
  sarah-pm:
    enabled: true
    sprint_duration_days: 14  # 2-week sprints
    daily_standup_time: "09:00"
    track_velocity: true

    proactive_actions:
      sprint_progress_tracking:
        enabled: true
        auto_update_board: true
        generate_daily_reports: false

      milestone_monitoring:
        enabled: true
        alert_on_delay: true
        suggest_reallocation: false

      documentation_validation:
        enabled: true
        check_readme_updated: true
        validate_api_docs: true

  # ---------------------------------------------------------------------------
  # Alex-BA - Business Analyst & Requirements Expert
  # Auto-activates on: requirements/**, *.feature, issues, feature requests
  # ---------------------------------------------------------------------------
  alex-ba:
    enabled: true
    requirement_format: "user_stories"  # Options: user_stories | use_cases | gherkin
    acceptance_criteria_format: "gherkin"  # Options: gherkin | checklist | custom

    proactive_actions:
      requirement_extraction:
        enabled: true
        auto_create_user_stories: true
        suggest_acceptance_criteria: true

      traceability_matrix:
        enabled: true
        link_requirements_to_code: true
        track_implementation_status: true

      stakeholder_communication:
        enabled: false  # Enable for client-facing projects
        generate_status_reports: false

  # ---------------------------------------------------------------------------
  # Dr.AI-ML - AI/ML Specialist (Disable if not using AI/ML)
  # Auto-activates on: *.py, *.ipynb, models/**, ml/**
  # ---------------------------------------------------------------------------
  dr-ai-ml:
    enabled: false  # Set to true for AI/ML projects
    model_frameworks: ["tensorflow", "pytorch", "scikit-learn"]

    proactive_actions:
      model_validation:
        enabled: false
        check_overfitting: true
        validate_metrics: true

      performance_monitoring:
        enabled: false
        track_inference_time: true
        monitor_accuracy_drift: true

# ============================================================================
# QUALITY GATES CONFIGURATION
# ============================================================================

quality_gates:
  # Pre-Commit Gate (runs before git commit)
  pre_commit:
    enabled: true
    require_tests: true
    min_coverage: 80  # Block commit if coverage below this
    lint_check: true
    type_check: true  # TypeScript projects
    security_scan: true
    block_on_failure: true

  # Pre-Push Gate (runs before git push)
  pre_push:
    enabled: true
    require_all_tests_pass: true
    min_coverage: 85  # Stricter for push
    integration_tests: true
    e2e_tests: false  # Set to true if you have E2E tests
    security_scan: true
    block_on_failure: true

  # Pre-Deploy Gate (runs before deployment)
  pre_deploy:
    enabled: true
    require_e2e_tests: true
    security_scan: true
    performance_check: true
    accessibility_audit: true
    min_lighthouse_score: 90
    block_on_failure: true

# ============================================================================
# PROACTIVE FEATURES CONFIGURATION
# ============================================================================

proactive:
  # Inline Suggestions - Show agent suggestions as you type
  inline_suggestions: true

  # Statusline Updates - Show agent activity in Cursor statusline
  statusline_updates: true

  # Background Monitoring - Watch files for changes
  background_monitoring: true

  # Auto Documentation - Generate docs from code
  auto_documentation: false  # Set to true if you want auto-docs

  # Parallel Execution - Run multiple agents simultaneously (Rule 1)
  parallel_execution: true

  # Automated Stress Testing - Auto-generate stress tests (Rule 2)
  automated_stress_testing: true

  # Daily Health Audits - Run comprehensive health checks (Rule 3)
  daily_health_audits: true
  audit_schedule: "02:00"  # 2 AM daily

# ============================================================================
# MCP (Model Context Protocol) INTEGRATION
# ============================================================================

mcp:
  enabled: true
  server: "claude-desktop"  # Options: claude-desktop | custom
  auto_sync: true
  memory_persistence: true

  # MCP Server Configuration
  server_config:
    host: "localhost"
    port: 3000
    timeout_ms: 30000

# ============================================================================
# RAG (Retrieval-Augmented Generation) MEMORY SYSTEM
# ============================================================================

rag:
  enabled: true
  vector_storage: "supabase"  # Options: supabase | local | pinecone
  learning_mode: "continuous"  # Options: continuous | manual | session
  pattern_recognition: true

  # What patterns to store and learn from
  project_patterns:
    - "Component naming conventions"
    - "API response structures"
    - "Test assertion patterns"
    - "Error handling approaches"
    - "Database query patterns"
    - "Security best practices"

  # RAG performance tuning
  tuning:
    max_vector_results: 10
    similarity_threshold: 0.7
    context_window_size: 4000

# ============================================================================
# MONITORING & ANALYTICS
# ============================================================================

monitoring:
  track_agent_performance: true
  collect_usage_analytics: false  # Privacy-first (opt-in)
  error_reporting: true

  dashboards:
    realtime_sdlc_tracker: true  # Track development progress
    quality_metrics: true  # Coverage, bugs, performance
    velocity_tracking: true  # Sprint velocity, burndown

# ============================================================================
# CUSTOM RULES (Project-Specific Conventions)
# ============================================================================

custom_rules:
  coding_standards:
    - "Always use TypeScript strict mode"
    - "Follow conventional commits format (feat|fix|docs|style|refactor|test|chore)"
    - "Prefer functional components over class components"
    - "All API endpoints must have OpenAPI/Swagger documentation"
    - "Use async/await over raw Promises"
    - "Error handling: Always use try-catch for async operations"

  naming_conventions:
    - "Components: PascalCase (e.g., UserProfile.tsx)"
    - "Functions: camelCase (e.g., fetchUserData)"
    - "Constants: SCREAMING_SNAKE_CASE (e.g., API_BASE_URL)"
    - "Files: kebab-case for utils, PascalCase for components"

  testing_standards:
    - "Test file naming: *.test.ts or *.spec.ts"
    - "Test descriptions: Start with 'should' (e.g., 'should validate email format')"
    - "Coverage: Every exported function must have tests"
    - "AAA pattern: Arrange, Act, Assert"

  git_workflow:
    - "Branch naming: feature/*, bugfix/*, hotfix/*"
    - "Commit messages: 50 char summary, blank line, detailed description"
    - "PR requirements: 2 reviewers, passing CI, > 80% coverage"
    - "Merge strategy: Squash and merge for features"

# ============================================================================
# TEAM COLLABORATION (For teams > 1 developer)
# ============================================================================

team:
  size: 1  # TODO: Update with your team size

  # Uncomment and configure for teams
  # roles:
  #   - frontend_developers: 3
  #   - backend_developers: 2
  #   - qa_engineers: 2
  #   - product_manager: 1

  workflow: "feature-branch"  # Options: gitflow | trunk-based | feature-branch

  code_review:
    required_reviewers: 1  # Minimum reviewers for PR approval
    auto_assign_maria: true  # Let Maria-QA review automatically
    block_on_quality_gate_failure: true
    review_checklist:
      - "Code follows project conventions"
      - "Tests added for new functionality"
      - "Documentation updated"
      - "No security vulnerabilities introduced"
      - "Performance impact considered"

# ============================================================================
# ADVANCED CONFIGURATION (Optional)
# ============================================================================

advanced:
  # File Watching - Which files/folders to monitor
  file_watching:
    include_patterns:
      - "src/**/*"
      - "test/**/*"
      - "docs/**/*"

    exclude_patterns:
      - "node_modules/**"
      - "dist/**"
      - "coverage/**"
      - ".git/**"
      - ".versatil/cache/**"

  # Agent Coordination
  agent_coordination:
    max_parallel_agents: 3  # Limit concurrent agent activations
    prioritize_quality_gates: true
    handoff_strategy: "sequential"  # Options: sequential | parallel | smart

  # Performance Tuning
  performance:
    debounce_file_changes_ms: 500  # Wait before triggering agents
    max_cache_size_mb: 500
    enable_lazy_loading: true

# ============================================================================
# ENVIRONMENT-SPECIFIC OVERRIDES
# ============================================================================

# Development Environment
env_development:
  quality_gates:
    pre_commit:
      block_on_failure: false  # Allow commits in dev
  proactive:
    inline_suggestions: true
    background_monitoring: true

# Staging Environment
env_staging:
  quality_gates:
    pre_deploy:
      min_lighthouse_score: 85  # Slightly relaxed for staging
  monitoring:
    track_agent_performance: true

# Production Environment
env_production:
  quality_gates:
    pre_deploy:
      min_lighthouse_score: 95  # Strict for production
      require_e2e_tests: true
  monitoring:
    track_agent_performance: true
    error_reporting: true

# ============================================================================
# MIGRATION NOTES (For existing projects)
# ============================================================================

# If adding VERSATIL to an existing project:
# 1. Start with minimal config (only Maria-QA enabled)
# 2. Set quality_gates.pre_commit.block_on_failure: false initially
# 3. Gradually increase coverage_threshold as you add tests
# 4. Enable other agents one-by-one as you validate their value
# 5. See docs/MIGRATION_EXISTING_PROJECT.md for detailed guide

# ============================================================================
# TROUBLESHOOTING
# ============================================================================

# If agents not activating:
# 1. Run: versatil test-activation
# 2. Check: versatil agents --status
# 3. Debug: VERSATIL_DEBUG=true versatil agents --watch
# 4. See: docs/AGENT_ACTIVATION_TROUBLESHOOTING.md

# If quality gates not enforcing:
# 1. Verify Git hooks installed: ls -la .git/hooks/
# 2. Reinstall: versatil quality-gate:setup
# 3. See: docs/QUALITY_GATES.md

# If MCP connection issues:
# 1. Test: versatil mcp:test
# 2. Check Claude Desktop config
# 3. See: docs/mcp-integration.md

# For all other issues:
# - Documentation: docs/CURSOR_INTEGRATION.md
# - GitHub Issues: https://github.com/versatil-sdlc-framework/issues
# - Community: https://github.com/versatil-sdlc-framework/discussions

# ============================================================================
# END OF CONFIGURATION
# ============================================================================

# This file was generated by VERSATIL SDLC Framework v4.1.0
# To regenerate: versatil cursor:init --force
# To validate: versatil config:validate
# Documentation: https://docs.versatil.dev
