ci-validation-gates

Implements defensive CI/CD validation gates for npm publish workflows.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/codebytes/btt --skill ci-validation-gates-codebytes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ci-validation-gates
Source: https://github.com/codebytes/btt/tree/main/.squad/templates/skills/ci-validation-gates
Command: npx skills add https://github.com/codebytes/btt --skill ci-validation-gates-codebytes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Release pipelines fail in costly ways when workflows publish invalid semver versions, use the wrong npm token type, skip retry logic for registry propagation, or miss draft release events. This Skill codifies defensive CI/CD patterns learned from a real multi-hour release outage so those failures never repeat. ## Core Features & Use Cases - Semver Validation Gate: Blocks npm publish when the release tag is not valid 3-part semver (e.g., rejects 4-part versions like 0.8.21.4) using npx semver. - Token & Retry Safeguards: Enforces npm Automation tokens instead of 2FA user tokens, and verifies published packages with 5 attempts at 15-second intervals to handle registry propagation delays. - Draft Release & Build Protection: Detects draft releases that never emit release: published events and requires SKIP_BUILD_BUMP=1 so dev-only version bump scripts never mutate release builds. - Use Case: A release manager wiring up a GitHub Actions publish workflow applies these gates so a malformed tag or premature verification check fails fast with actionable output instead of corrupting the release. ## Quick Start Add the semver validation gate and retry-based package verification steps from this skill to my npm publish GitHub Actions workflow.

Frequently Asked Questions about ci-validation-gates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate semver before npm publish in CI?

Run `npx semver "$VERSION"` against the release tag (stripped of the leading v) as a workflow step before npm publish. Exit with code 1 if validation fails, since 4-part versions like 0.8.21.4 are not valid semver and npm mangles them.

Why does npm publish fail with EOTP in GitHub Actions?

EOTP occurs when NPM_TOKEN is a User token with 2FA enabled, which requires a one-time password CI cannot provide. Create an Automation token at npmjs.com under Settings, Access Tokens, Automation and use that as the workflow secret.

How to verify an npm package after publish in CI?

Poll `npm view PACKAGE@VERSION version` with retry logic: 5 attempts at 15-second intervals, exiting on first success. The npm registry is eventually consistent, so a package may not be queryable for 5-30 seconds (up to 2 minutes) after publish.

Why didn't my release workflow trigger on a GitHub release?

Draft releases do not emit the `release: published` event, so workflows listening for that event never run. Publish releases directly instead of drafting, or verify published status via the GitHub API when using workflow_dispatch.

When should I skip build version bump scripts in releases?

Set SKIP_BUILD_BUMP=1 before any release build. Dev-only bump scripts like bump-build.mjs silently mutate version numbers, which corrupts release artifacts if they run during a publish pipeline.