/ci-setup
Bootstrap a minimal CI/CD workflow with automated testing and quality checks integrated with GitHub Actions and code ownership rules.
Quick Start
/agileflow:ci-setup OWNERS=@username,@teamPurpose
This command sets up a complete CI/CD foundation for your project by:
- Creating a GitHub Actions workflow with lint, typecheck, and test jobs
- Establishing code ownership through a CODEOWNERS file
- Configuring permissions and concurrency controls
- Providing guidance on enabling required checks
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
OWNERS | Yes | - | GitHub usernames or team handles (comma-separated, e.g., @alice,@team-backend) |
Examples
Basic Usage
/agileflow:ci-setup OWNERS=@alice,@bobSets up CI with Alice and Bob as code owners.
Multiple Team Handles
/agileflow:ci-setup OWNERS=@frontend-team,@devops-team,@maintainerAssigns multiple teams as code owners for code review requirements.
Workflow
The command follows a consistent workflow:
- Parse Owners Input - Validates and normalizes GitHub handles
- Generate CI Workflow - Creates
.github/workflows/ci.ymlwith three jobs:- Lint Job - Placeholder for ESLint, Prettier, or similar
- Typecheck Job - Placeholder for TypeScript, Flow, mypy, or similar
- Test Job - Placeholder for Jest, pytest, cargo test, or similar
- Generate CODEOWNERS - Creates ownership mappings:
/src/→ assigned owners/docs/03-decisions/→ assigned owners
- Show Preview - Displays both generated files for review
- Await Confirmation - Asks "Create these files? (YES/NO)"
- Create Files - Writes CI workflow and CODEOWNERS if approved
- Display Next Steps - Shows how to enable required checks in GitHub
Output Files
The command creates two files:
.github/workflows/ci.yml - GitHub Actions workflow with:
- Runs on: push and pull_request events
- Three jobs: lint, typecheck, test (minimal permissions)
- Concurrency control (cancels in-progress runs)
- Generic job commands for customization
CODEOWNERS - Code ownership configuration:
/src/ @owners
/docs/03-decisions/ @ownersCI Jobs
Each job is configured as a placeholder for customization:
Lint Job
- Runs on: ubuntu-latest
- Purpose: Code style and quality checks
- Customize with:
npm run lint,eslint .,prettier --check, etc.
Typecheck Job
- Runs on: ubuntu-latest
- Purpose: Type safety verification
- Customize with:
tsc --noEmit,flow check,mypy, etc.
Test Job
- Runs on: ubuntu-latest
- Purpose: Automated test execution
- Customize with:
npm test,pytest,cargo test, etc.
Next Steps
After setup completes, you need to:
-
Customize Job Commands
- Edit
.github/workflows/ci.yml - Replace generic commands with your project's actual commands
- Edit
-
Enable Branch Protection
- Go to GitHub repository Settings
- Navigate to Branches → Branch protection rules
- Create rule for
mainbranch
-
Add Required Status Checks
- In branch protection settings, enable:
- ✓ Require status checks to pass
- ✓ Require branches to be up to date
- ✓ Include administrators
- Select which checks are required (lint, typecheck, test)
- In branch protection settings, enable:
-
Configure Code Review
- Enable: Require pull request reviews
- Set number of reviewers (e.g., 1 or 2)
- Dismiss stale pull request approvals
- Require code owner reviews (uses CODEOWNERS file)
-
Optional: Merge Queue
- Enable GitHub merge queue for safer deployments
- Automatically merges after all checks pass
Customization
The generated workflow files are starting points. You should customize:
In .github/workflows/ci.yml:
# Change these commands to match your project
- run: npm run lint # ESLint, Prettier, stylelint, etc.
- run: npm run typecheck # TypeScript, Flow, mypy, etc.
- run: npm test # Jest, pytest, cargo test, etc.In CODEOWNERS:
# Add more specific paths as your project grows
/src/api/ @api-team
/src/ui/ @frontend-team
/docs/ @documentation-team
*.md @maintainersRelated Commands
/setup-deployment- Configure deployment pipelines/setup-tests- Set up testing infrastructure/agileflow:status- Check CI status