$npx -y skills add girijashankarj/cursor-handbook --skill ci-cdWorkflow for creating a complete CI/CD pipeline. Use when the user needs to set up or modify CI/CD pipelines.
| 1 | # Skill: Set Up CI/CD Pipeline |
| 2 | |
| 3 | ## Trigger |
| 4 | When the user needs to set up or modify CI/CD pipelines. |
| 5 | |
| 6 | ## Steps |
| 7 | |
| 8 | ### Step 1: Define Pipeline Stages |
| 9 | - [ ] Lint and format check |
| 10 | - [ ] Type check: `{{CONFIG.testing.typeCheckCommand}}` |
| 11 | - [ ] Unit tests: `{{CONFIG.testing.testCommand}}` |
| 12 | - [ ] Build |
| 13 | - [ ] Integration tests |
| 14 | - [ ] Security scan |
| 15 | - [ ] Deploy |
| 16 | |
| 17 | ### Step 2: Create Pipeline Configuration |
| 18 | - [ ] Create workflow file (`.github/workflows/ci.yml` for GitHub Actions) |
| 19 | - [ ] Define trigger events (push, PR, schedule) |
| 20 | - [ ] Configure job runners and environments |
| 21 | - [ ] Set up caching for dependencies |
| 22 | |
| 23 | ### Step 3: Configure Secrets |
| 24 | - [ ] List required secrets |
| 25 | - [ ] Add to CI/CD secrets store (never in code) |
| 26 | - [ ] Document required secrets in README |
| 27 | |
| 28 | ### Step 4: Add Quality Gates |
| 29 | - [ ] Tests must pass (0 failures) |
| 30 | - [ ] Coverage ≥ {{CONFIG.testing.coverageMinimum}}% |
| 31 | - [ ] No type errors |
| 32 | - [ ] No critical security vulnerabilities |
| 33 | - [ ] Build succeeds |
| 34 | |
| 35 | ### Step 5: Set Up Deployment |
| 36 | - [ ] Configure environment promotion (dev → staging → prod) |
| 37 | - [ ] Add manual approval for production |
| 38 | - [ ] Configure rollback triggers |
| 39 | - [ ] Set up smoke tests post-deployment |
| 40 | |
| 41 | ### Step 6: Test Pipeline |
| 42 | - [ ] Trigger on a test branch |
| 43 | - [ ] Verify all stages complete |
| 44 | - [ ] Verify failure handling (intentionally break a stage) |
| 45 | - [ ] Verify notifications work |
| 46 | |
| 47 | ## If a step fails |
| 48 | |
| 49 | | Step | Failure | Recovery | |
| 50 | |------|---------|----------| |
| 51 | | Step 4 | Quality gate blocks pipeline | Fix failing tests, coverage, or type errors locally; do not lower thresholds to pass | |
| 52 | | Step 5 | Deploy stage fails | Check secrets and env vars; verify target environment is reachable; rollback if prod deploy partially applied | |
| 53 | | Step 6 | Pipeline fails on test trigger | Fix the broken stage; verify failure handling works (pipeline should fail fast, not deploy on failure) | |
| 54 | |
| 55 | Never remove manual approval for production. Never deploy on failure. |
| 56 | |
| 57 | ## Completion |
| 58 | CI/CD pipeline is running, tested, and documented. |