CI Validation Gates

Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22

45 stars 11 forksDevOps & Cloud

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add Azure-Samples/agent-skills-dotnet-demo --skill ci-validation-gates
Manual install
git clone --depth 1 https://github.com/Azure-Samples/agent-skills-dotnet-demo.git /tmp/agent-skills-dotnet-demo
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills-dotnet-demo/.squad/templates/skills/ci-validation-gates ~/.claude/skills/ci-validation-gates

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

## Context

CI workflows must be defensive. These patterns were learned from the v0.8.22 release disaster where invalid semver, wrong token types, missing retry logic, and draft releases caused a multi-hour outage. Both Drucker (CI/CD) and Trejo (Release Manager) carried this knowledge in their charters — now centralized here.

## Patterns

### Semver Validation Gate
Every publish workflow MUST validate version format before `npm publish`. 4-part versions (e.g., 0.8.21.4) are NOT valid semver — npm mangles them.

```yaml
- name: Validate semver
  run: |
    VERSION="${{ github.event.release.tag_name }}"
    VERSION="${VERSION#v}"
    if ! npx semver "$VERSION" > /dev/null 2>&1; then
      echo "❌ Invalid semver: $VERSION"
      echo "Only 3-part versions (X.Y.Z) or prerelease (X.Y.Z-tag.N) are valid."
      exit 1
    fi
    echo "✅ Valid semver: $VERSION"
```

### NPM Token Type Verification
NPM_TOKEN MUST be an Automation token, not a User token with 2FA:
- User tokens require OTP — CI can't provide it → EOTP error
- Create Automation tokens at npmjs.com → Settings → Access Tokens → Automation
- Verify before first publish in any workflow

### Retry Logic for npm Registry Propagation
npm registry uses eventual consistency. After `npm publish` succeeds, the package may not be immediately queryable.
- Propagation: typically 5-30s, up to 2min in rare cases
- All verify steps: 5 attempts, 15-second intervals
- Log each attempt: "Attempt 1/5: Checking package..."
Read the full skill on GitHub

Details

Skill name
ci-validation-gates
Path
.squad/templates/skills/ci-validation-gates/SKILL.md
License
MIT
Repo updated
10 April 2026

FAQ

What does the CI Validation Gates skill do?

Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22

How do I install the CI Validation Gates skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add Azure-Samples/agent-skills-dotnet-demo --skill ci-validation-gates. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is CI Validation Gates popular?

It lives in Azure-Samples/agent-skills-dotnet-demo, which has 45 GitHub stars and 11 forks.

Related skills

Browse the most popular Claude skills, all devops & cloud skills, or write your own with the skills generator.