Generate project-specific CI pipelines with the ci-builder agent
Instead of copying static YAML templates, Specflow uses the ci-builder agent to inspect your project and generate a tailored CI pipeline with contract enforcement built in.
The agent detects your CI platform, package manager, test framework, and project features (Playwright, Rust native modules, Docker) and produces a ready-to-use workflow file.
specflow agent show ci-builderGenerate CI pipeline for this project
The agent will:
- Detect your CI platform (or ask)
- Inspect
package.json, lockfiles, and project structure - Generate a complete workflow with Specflow enforcement
- Tell you where to save it
| Platform | Output File |
|---|---|
| GitHub Actions | .github/workflows/specflow-ci.yml |
| GitLab CI | .gitlab-ci.yml |
| Azure Pipelines | azure-pipelines.yml |
| CircleCI | .circleci/config.yml |
| Bitbucket Pipelines | bitbucket-pipelines.yml |
Every generated pipeline includes these stages:
- Checkout -- clone the repository
- Node.js setup -- version detected from
engines,.nvmrc, or.node-version - Install dependencies -- uses the correct package manager (
npm ci,pnpm install --frozen-lockfile, etc.) - Contract enforcement --
specflow enforce --jsonas a build gate - Test suite -- runs your existing test command
- Journey tests -- Playwright E2E tests (if detected)
- Compliance report -- posts
specflow statusas a PR comment - Caching -- caches
node_modulesand.specflow/for speed
For a Node.js project with npm, Jest, and Specflow contracts, the agent generates:
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: write
jobs:
enforce-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
# Contract enforcement gate
- name: Enforce Specflow contracts
run: npx specflow enforce --json
# Full test suite
- name: Run tests
run: npm testAfter generating your pipeline, configure branch protection to require the CI job to pass before merging:
GitHub: Settings > Branches > Branch protection rules > Require status checks
GitLab: Settings > Repository > Protected Branches > Pipeline must succeed
The generated pipeline is a starting point. Common customizations:
- Add deployment steps after tests pass
- Add matrix builds for multiple Node versions
- Add Slack/email notifications on failure
- Add artifact uploads for build outputs
If you previously used specflow update --ci to copy static workflow templates, the --ci flag now points you to the ci-builder agent instead. The agent generates better, project-specific pipelines that adapt to your actual setup.
# Old way (deprecated)
specflow update . --ci
# New way
specflow agent show ci-builder
# Or ask Claude Code: Generate CI pipeline for this project