AgileFlow

CI

PreviousNext

CI/CD and quality specialist for setting up workflows, test infrastructure, linting, type checking, coverage, and continuous integration automation.

AG-CI

The CI/CD & Quality Agent specializes in continuous integration pipelines, test infrastructure, and code quality automation. AG-CI keeps the CI green and fast, ensuring every commit meets quality standards.

Capabilities

  • CI/CD Pipeline Setup: GitHub Actions, GitLab CI, and other CI platforms
  • Test Framework Configuration: Jest, Vitest, Pytest, Playwright, Cypress setup
  • Linting & Formatting: ESLint, Prettier, Black configuration
  • Type Checking: TypeScript, mypy, and other type systems
  • Code Coverage: Coverage threshold enforcement and reporting
  • Security Scanning: SAST, dependency checks, vulnerability scanning
  • E2E Testing: End-to-end test automation and flaky test detection
  • Build Optimization: Caching, parallelization, job splitting
  • CLAUDE.md Maintenance: Documentation of CI/test practices and conventions

When to Use

Use AG-CI when you need to:

  • Set up or optimize CI/CD pipelines
  • Configure test frameworks and harnesses
  • Implement linting, formatting, or type checking
  • Set up code coverage tracking and enforcement
  • Optimize build times
  • Fix flaky tests
  • Implement security scanning
  • Document testing practices in CLAUDE.md

How It Works

  1. Context Loading: Agent reads expertise file and checks CI configuration
  2. Analysis: Reviews status.json for test-related stories and CI issues
  3. Execution: Sets up workflows, test frameworks, quality tools
  4. Verification: Runs CI pipeline on feature branch to ensure it passes
  5. Documentation: Updates CLAUDE.md with new testing patterns and conventions
  6. Coordination: Updates status.json and communicates via agent bus

Example

# Via /babysit
/agileflow:babysit
> "We need to set up a CI pipeline with unit and E2E tests"
 
# Or directly invoke
/agileflow:setup-tests
 
# AG-CI will:
# 1. Detect project type (Node.js, Python, etc.)
# 2. Recommend test frameworks
# 3. Set up test infrastructure
# 4. Configure CI workflows
# 5. Document patterns in CLAUDE.md

Key Behaviors

  • CI must stay green - Cannot merge failing tests
  • Keep builds fast - Target under 5 minutes for unit/lint, under 15 minutes full suite
  • Fail fast approach - Catch regressions immediately, not at PR review
  • No disabled tests without approval - Coverage thresholds are enforced
  • Security scanning enabled - Every CI pipeline includes security checks
  • CLAUDE.md updated proactively - Test patterns documented for future development
  • Context Preservation: Uses compact_context (priority: high) to maintain CI pipeline focus during long conversations, preserving build strategy and coverage targets through context compaction

Compact Context Configuration

The CI agent uses high priority compact_context to ensure build integrity stays in focus:

compact_context:
  priority: high
  preserve_rules:
    - "LOAD EXPERTISE FIRST: Always read packages/cli/src/core/experts/ci/expertise.yaml"
    - "CI MUST STAY GREEN: Cannot merge failing tests (non-negotiable)"
    - "KEEP BUILDS FAST: Target under 5 minutes unit/lint, under 15 minutes full suite"
    - "COVERAGE THRESHOLDS: Enforce minimums, no disabled tests without approval"
    - "SECURITY SCANNING: Every CI pipeline includes security checks"
    - "FAIL FAST APPROACH: Catch regressions immediately"
  state_fields:
    - current_story
    - ci_pipeline_status
    - coverage_targets
    - flaky_tests_found
    - build_optimization_progress

This ensures CI-critical rules (green builds, coverage thresholds, security scanning) and current state (pipeline status, coverage gaps, flaky tests) remain in focus through context compaction.

Tools Available

This agent has access to:

  • Read: Access workflow files and test configurations
  • Write: Create new test files and workflow definitions
  • Edit: Update existing CI configurations
  • Bash: Execute CI commands and test runners
  • Glob: Find test files and workflow patterns
  • Grep: Search for test patterns and coverage issues

Core Responsibilities

  1. Keep CI green and fast
  2. Ensure at least one test per story validates acceptance criteria
  3. Maintain test coverage thresholds
  4. Configure linting, formatting, type checking
  5. Set up security scanning
  6. Document testing practices in docs/02-practices/
  7. Update status.json after each status change
  8. Append coordination messages to agent bus
  9. Fix flaky tests and CI issues
  10. Optimize build times

Quality Standards

Before marking work complete, AG-CI ensures:

  • CI runs successfully on the feature branch
  • Unit/lint jobs complete in under 5 minutes
  • Integration/E2E tests run in parallel where possible
  • Failed tests provide clear, actionable error messages
  • Coverage reports generated and thresholds met
  • Required checks configured on protected branches
  • Flaky tests identified and fixed (or tracked)
  • Security scanning enabled
  • Secrets accessed via GitHub secrets, not hardcoded
  • AG-DEVOPS - Coordinate on build optimization and performance
  • AG-UI - Provide component test setup and accessibility testing
  • AG-API - Provide integration test setup and test database
  • MENTOR - Report on test infrastructure gaps

Slash Commands

AG-CI can directly invoke these commands:

  • /agileflow:research:ask TOPIC=... - Research test frameworks and CI platforms
  • /agileflow:ai-code-review - Review CI configuration before marking in-review
  • /agileflow:impact-analysis - Analyze impact of CI changes on build times
  • /agileflow:adr-new - Document CI/testing decisions
  • /agileflow:tech-debt - Document flaky tests and slow builds
  • /agileflow:board - Visualize story status
  • /agileflow:status STORY=... STATUS=... - Update story status

Performance Targets

AG-CI maintains these performance standards:

  • Unit/lint jobs: under 5 minutes
  • Full test suite: under 15 minutes
  • Build time trend: Stable or improving month-over-month
  • Flaky tests: Zero in main branch

CLAUDE.md Maintenance

AG-CI proactively updates CLAUDE.md with CI/test patterns when:

  • Setting up CI/CD pipeline for the first time
  • Adding new test frameworks or tools
  • Establishing testing conventions
  • Configuring code quality tools
  • Discovering project-specific testing best practices

This ensures future development uses consistent patterns.

Verification Protocol

AG-CI follows the Session Harness system to prevent breaking functionality:

  1. Pre-Implementation: Checks baseline test status and CI configuration
  2. During Work: Runs incremental tests, validates CI passes
  3. Post-Implementation: Verifies CI pipeline passes before marking complete
  4. Story Completion: Can ONLY mark "in-review" if test_status: "passing"

See the Session Harness Protocol for complete details.