home / skills / yelmuratoff / agent_sync / ci-cd

ci-cd skill

/.ai/src/skills/ci-cd

This skill helps you create and optimize Flutter/Dart CI/CD pipelines for fast feedback, stable releases, and deterministic builds.

npx playbooks add skill yelmuratoff/agent_sync --skill ci-cd

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.6 KB
---
name: ci-cd
description: When defining or improving CI/CD workflows for Flutter/Dart repositories (quality gates, caching, release safety).
---

# CI/CD (Fast Feedback, Safe Delivery)

## When to use

- Creating or updating CI workflows.
- Reducing pipeline duration or flaky failures.
- Defining release gating for production deployments.

## Steps

### 1) Define triggers and required checks

- Trigger CI on pull requests and pushes to `main`.
- Mark format/analyze/test workflows as required checks before merge.
- Keep required checks minimal but sufficient for regression prevention.

### 2) Keep jobs deterministic and isolated

- Pin SDK/tool versions in CI.
- Avoid shared mutable state between jobs.
- Fail fast on unstable or network-fragile tests; move those to dedicated integration flows.

### 3) Order jobs for fast feedback

- Run formatting and static analysis first.
- Run unit/widget tests next.
- Run heavier build/signing jobs only after quality checks pass.

### 4) Optimize execution time

- Cache pub dependencies and reusable artifacts where CI supports it.
- Parallelize independent jobs (for example test shards or package groups).
- Prefer incremental, targeted test/build scopes when the repository supports it.

### 5) Gate production delivery

- Keep production deployment behind explicit approval or protected release jobs.
- Use feature flags or staged rollout for high-risk functionality.

### 6) Continuously tune pipeline quality

- Track pipeline duration and flaky test rate.
- Fix flaky tests before adding new jobs.
- Revisit required checks when architecture or tooling changes.

Overview

This skill helps define and improve CI/CD workflows for Flutter and Dart repositories with a focus on fast feedback and safe delivery. It codifies best practices for triggers, deterministic jobs, caching, and release gating to reduce pipeline duration and flaky failures. The guidance targets maintainable pipelines that protect production while enabling quick iteration.

How this skill works

The skill inspects repository CI definitions and recommends changes to triggers, job ordering, caching, and version pinning. It identifies non-deterministic or shared-state jobs, suggests splitting fragile tests into separate integration flows, and proposes required checks and deployment gates. It also provides optimization tactics like dependency caching, job parallelization, and incremental test scopes.

When to use it

  • Creating or updating CI workflows for Flutter/Dart projects
  • Reducing pipeline duration, test flakiness, or CI cost
  • Introducing or refining release gating for production deployments
  • Standardizing required checks and developer fast-feedback loops
  • Preparing for a major release or migration of tooling/sdk versions

Best practices

  • Trigger CI on pull requests and pushes to main; keep required checks minimal but effective
  • Pin SDK and tool versions in CI and avoid shared mutable state between jobs
  • Run format and static analysis first, then unit/widget tests, then heavy build/signing jobs
  • Cache pub dependencies and reusable artifacts; parallelize independent jobs where possible
  • Fail fast on unstable or network-fragile tests and move them to dedicated integration flows
  • Protect production delivery with explicit approvals, protected jobs, feature flags, or staged rollouts

Example use cases

  • Convert a monolithic CI workflow into staged jobs to surface lint/test failures faster
  • Add dependency caching and test sharding to cut CI duration for a multi-package repo
  • Define required status checks and branch protection for a mobile release team
  • Isolate flaky integration tests into nightly pipelines and keep PR feedback quick
  • Introduce a protected release job with manual approval and staged rollout flags

FAQ

How do I handle flaky tests without slowing down PR feedback?

Move flaky or network-dependent tests out of PR-required flows into nightly or gated integration pipelines. Fail fast on core regressions in PRs and track flaky tests to prioritize fixes.

What should be required checks before merging?

Keep required checks focused: formatting, static analysis, and core unit/widget tests that prevent regressions. Add broader integration or platform-specific builds as optional or gated jobs.