Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
4835978
docs(ai-team): v0.8.21 release session logged; npm publish automation…
bradygaster Mar 7, 2026
9473fa1
chore: bump to 0.8.22-preview.1 for next dev cycle
bradygaster Mar 7, 2026
75157be
docs(kobayashi): v0.8.21 release gate merge & publish trigger
bradygaster Mar 7, 2026
3fce06f
Merge branch 'main' into dev
bradygaster Mar 7, 2026
26d9742
Merge branch 'main' into dev
bradygaster Mar 7, 2026
fb554d1
Merge branch 'main' into dev
bradygaster Mar 7, 2026
1a38f3b
Merge branch 'main' into dev
bradygaster Mar 7, 2026
457f12f
docs: fix README migration guide link
matthewcorven Mar 11, 2026
a9eee03
fix: detect parent git repos during squad init
bradygaster Mar 13, 2026
08a574a
docs(ai-team): Reskill operation complete
bradygaster Mar 13, 2026
56ff25e
docs(ai-team): Issue triage session completed
bradygaster Mar 13, 2026
e236a70
feat: add custom universes support (#352)
bradygaster Mar 13, 2026
a698e6a
docs: fix README migration guide link (#349)
bradygaster Mar 13, 2026
fcf6f31
docs: recommend --yolo in README Quick Start (#375)
bradygaster Mar 13, 2026
822f990
docs(pao): add SCANNABILITY REVIEW hard rule to PAO charter (#358)
bradygaster Mar 13, 2026
b3da477
fix(docs): replace ~/.squad/ with platform-specific path references (…
bradygaster Mar 13, 2026
1f2c399
docs(fenster): record community PR merge session
bradygaster Mar 13, 2026
95b18eb
feat: add task context classification to coordinator acknowledgment
diberry Mar 12, 2026
d81f793
feat: conversation-aware thinking phrases in ThinkingIndicator
diberry Mar 12, 2026
04e8ef9
fix: resolve npm audit vulnerabilities and Aspire Docker test cleanup
bradygaster Mar 13, 2026
759a2cb
feat: non-blocking version check on CLI startup (Phase 1)
Copilot Mar 13, 2026
c784959
docs: add scenario and feature guides from Tamir blog analysis
Copilot Mar 10, 2026
0d562cb
docs: scope Squad docs to framework-only content
Copilot Mar 10, 2026
f138a64
docs: add cross-org authentication scenario
Copilot Mar 10, 2026
99e7522
test: sync EXPECTED_SCENARIOS and EXPECTED_FEATURES with disk
Copilot Mar 10, 2026
afdc9ab
docs(ai-team): Merge post-work orchestration — boundary heuristic, co…
Copilot Mar 11, 2026
ba8d8f7
feat(skills): add SkillScriptLoader, handler types, and applySkillHan…
bradygaster Mar 13, 2026
cc0b2c5
fix: resolve TypeScript build errors from PR merges
bradygaster Mar 13, 2026
fa32acd
feat: add 20 built-in base roles for faster team casting (#369)
bradygaster Mar 13, 2026
dea678b
test: fix test failures from community PR merges
bradygaster Mar 13, 2026
0422a67
docs: add write_agent integration guidance to squad.agent.md (#400)
lewing Mar 15, 2026
a70343c
feat: Distributed Mesh — Cross-Machine Squad Coordination (#380)
andikrueger Mar 15, 2026
542ddb7
fix: cross-platform filename and config path issues (#348, #356)
bradygaster Mar 15, 2026
4e1795c
history: EECOM cross-platform fixes (#348, #356)
bradygaster Mar 15, 2026
da2dc3e
test: sync EXPECTED_FEATURES with built-in-roles addition
bradygaster Mar 15, 2026
f6e5d3a
history: FIDO PR reviews and test assertion fix
bradygaster Mar 15, 2026
3e17b5e
docs(ai-team): Archived decisions, created session log
bradygaster Mar 15, 2026
fce937d
Merge pull request #404 from bradygaster/squad/348-356-cross-platform…
bradygaster Mar 15, 2026
26e9f0d
Merge branch 'dev' of https://github.com/bradygaster/squad into dev
bradygaster Mar 15, 2026
916130c
docs: add FAQ page and improve CLI guidance (#398)
bradygaster Mar 15, 2026
6315f38
Merge pull request #403 from bradygaster/squad/398-docs-faq-cli-guidance
bradygaster Mar 15, 2026
23ac476
fix(cli): eliminate terminal scroll flicker and rerender storm
jongio Mar 9, 2026
2716aa6
Merge pull request #405 from bradygaster/squad/254-flicker-fix-to-dev
bradygaster Mar 15, 2026
173d939
fix(ci): remove stale nested SDK from lockfile
bradygaster Mar 15, 2026
370a430
fix: stamp version in agent.md during init and upgrade (#321)
bradygaster Mar 15, 2026
0096265
fix: SDK init trio - routing, Ralph, and config wiring (#337, #338, #…
bradygaster Mar 15, 2026
705bfb8
feat: base roles opt-in for init and cast (#379)
bradygaster Mar 15, 2026
a1fcdb8
feat(metrics): Add rework rate OTEL metrics (#265)
tamirdresher Mar 15, 2026
c58640f
feat(metrics): add rework rate CLI command (5th DORA metric)
bradygaster Mar 15, 2026
ccb9b53
docs: consolidated docs quality, reduction, and dedup
diberry Mar 15, 2026
f035429
fix: align baseBranch config and docs to dev
diberry Mar 15, 2026
c4d9a82
docs: add docs quality CI — markdown lint, spell check, link validation
diberry Mar 15, 2026
3fc909c
chore: update now.md — sprint complete, next up SDK work
bradygaster Mar 15, 2026
2f43a5e
feat: add agent error lockout, product isolation, and peer quality ch…
bradygaster Mar 15, 2026
69dc856
Wire CastingEngine into CLI init flow (#417)
bradygaster Mar 15, 2026
0d86da3
test: SDK feature parity tests for #340 (#422)
bradygaster Mar 15, 2026
1f818ad
chore: reskill — compress charters, extract skills (#423)
bradygaster Mar 16, 2026
bace6c5
feat: support --sdk switch with built-in base roles (#378) (#424)
bradygaster Mar 16, 2026
8456549
test: SDK feature parity batch 2 — 64 tests for #27, #28, #36, #49, #…
williamhallatt Mar 16, 2026
4f2de95
test: SDK feature parity batch 3 — 46 tests for #31, #47, #45, #46 (#…
williamhallatt Mar 16, 2026
f87a7a5
feat: update default model selection to Claude Sonnet 4.6 and GPT-5.4…
bradygaster Mar 16, 2026
04e8918
chore(.squad): update team focus to skills migration (#330/#354)
bradygaster Mar 16, 2026
38be241
docs: Add extensibility and building extensions guides (#436)
diberry Mar 18, 2026
ee10f72
docs: agent anatomy and hiring checklist (#439)
diberry Mar 18, 2026
1468250
docs: Add nap, reskill, and compact behavior documentation (#448)
diberry Mar 18, 2026
1bde423
feat: add session recovery skill — find and resume lost sessions (#442)
tamirdresher Mar 18, 2026
32d2a23
Persistent Ralph — watch + heartbeat (#443)
tamirdresher Mar 18, 2026
5720705
Generic provider-agnostic scheduler (#445)
tamirdresher Mar 18, 2026
5826555
Cross-Squad orchestration (#446)
tamirdresher Mar 18, 2026
814133d
fix: align casting universe count with reality, create casting-refere…
diberry Mar 20, 2026
988b616
docs: fill content gaps from 7 recent PRs
diberry Mar 20, 2026
4476f42
feat(.squad): PAO external communications - Phase 1 infrastructure (#…
diberry Mar 20, 2026
dfbaac1
Merge branch 'dev' of https://github.com/bradygaster/squad into dev
bradygaster Mar 20, 2026
6cbabb5
fix(ci): add edited trigger + lockfile lint for stale workspace entries
bradygaster Mar 20, 2026
3f5f5c6
chore(booster): update history with CI hardening learnings
bradygaster Mar 20, 2026
43de4f5
ci: auto-fix stale lockfile entries instead of failing
bradygaster Mar 20, 2026
e5bf27d
ci: add manual CI rerun workflow for fork PRs
bradygaster Mar 20, 2026
80162c5
fix(ci): add git identity for merge step in ci-rerun
bradygaster Mar 20, 2026
eb29da4
fix(ci): use GitHub merge ref instead of manual merge
bradygaster Mar 20, 2026
8abfeb7
fix(ci): delete stale lockfile entries before install
bradygaster Mar 20, 2026
abab91e
docs: improve installation instructions with workflow details and hea…
tamirdresher Mar 20, 2026
61cb23a
docs: update migration guide to use @latest instead of pinned v0.8.18…
tamirdresher Mar 20, 2026
04134f8
feat: add gh-auth-isolation skill for multi-account GitHub workflows …
tamirdresher Mar 20, 2026
04a44fa
Add circuit breaker for model rate limiting in Ralph (#451)
tamirdresher Mar 20, 2026
9081840
feat: migrate skills from .squad/skills/ to .copilot/skills/ (#330, #…
bradygaster Mar 20, 2026
9962943
feat: add token usage tracking and cost visibility (#453) (#454)
spboyer Mar 20, 2026
cdab021
fix: auto-detect repo owner/name at session start (#437)
bradygaster Mar 20, 2026
3a7863c
fix: add parent squad label hygiene to workflows (#471)
bradygaster Mar 20, 2026
cb47637
fix: audit template dirs, sync package templates, expand tests (#461)…
diberry Mar 20, 2026
1446050
ADO configurable work item types (#444)
tamirdresher Mar 20, 2026
55db099
fix: add 2s timeout to az CLI exec in getAvailableWorkItemTypes (#483)
diberry Mar 22, 2026
dfa513a
fix: resolve read-modify-write race in history-shadow.ts (#480)
diberry Mar 22, 2026
aa01a0e
fix: graceful SIGINT/SIGTERM signal handling + 22 tests (#486)
diberry Mar 22, 2026
72d14ff
docs: expand CLI README and docs site reference (#487)
diberry Mar 22, 2026
e7b677a
samples: standardize READMEs, naming, and add template (#484)
diberry Mar 22, 2026
1c39d66
feat(docs): improve search with Pagefind tuning, section badges, and …
diberry Mar 22, 2026
d9d0ae3
fix: dual-layer ESM fix for Node 22/24 vscode-jsonrpc resolution (#449)
bradygaster Mar 22, 2026
72f2876
feat: add gap analysis verification loop to After Agent Work flow (#473)
bradygaster Mar 22, 2026
921dbd3
docs: restore GitHub auth setup documentation (#488) (#489)
bradygaster Mar 22, 2026
0f51a32
fix: persist user model preference across sessions (#284) (#491)
bradygaster Mar 22, 2026
ee09aae
feat: add ESLint with TypeScript support for runtime anti-pattern det…
bradygaster Mar 22, 2026
cbabc5a
fix: add memory safety caps and file watcher filtering (#259) (#495)
bradygaster Mar 22, 2026
828858d
docs: refresh Teams MCP integration for Workflows webhooks (#496)
bradygaster Mar 22, 2026
2315636
docs: update guide with latest Squad features (#476) (#490)
bradygaster Mar 22, 2026
7582649
fix: polish interactive shell UX before README re-add (#478) (#497)
bradygaster Mar 22, 2026
b5a163f
docs: add guide for building autonomous agents with Squad SDK (#492)
bradygaster Mar 22, 2026
d507dc3
feat: auto-wire telemetry in initSquadTelemetry() (#281) (#501)
bradygaster Mar 22, 2026
b741222
fix: hard-fail on Node <22.5.0 with clear message (#502) (#506)
bradygaster Mar 22, 2026
a30252f
feat: economy mode for cost-conscious model selection (#500) (#504)
bradygaster Mar 22, 2026
f86367c
feat: economy mode skill, governance proposals for #500 and #344 (#503)
bradygaster Mar 22, 2026
e42709c
fix: surface rate limit errors with recovery options (#464) (#505)
bradygaster Mar 22, 2026
d262715
docs: log session 2 — wave 1+2 results, 4 PRs merged
bradygaster Mar 22, 2026
83d02db
chore(.squad): triage #525, backlog prioritization
bradygaster Mar 22, 2026
c4b383d
chore(.squad): merge decisions, log #508/#525 fan-out
bradygaster Mar 22, 2026
04cbf84
chore(.squad): log session completion — #508/#525/#498 all done
bradygaster Mar 22, 2026
0e0e160
docs(.squad): log mega-session — #508 complete, #525 complete, #498 a…
bradygaster Mar 23, 2026
33241b5
feat(sdk): add personal squad resolution and ambient discovery (#508)…
bradygaster Mar 23, 2026
761c1c6
feat(cli): personal squad CLI commands (#508) (#538)
bradygaster Mar 23, 2026
93869be
feat(governance): add personal squad governance layer (#508) (#539)
bradygaster Mar 23, 2026
fa1b416
feat(templates): create issue-lifecycle.md template document (#527) (…
bradygaster Mar 23, 2026
66578ec
test: add personal squad unit and integration tests (#508) (#541)
bradygaster Mar 23, 2026
b39e5f3
feat(coordinator): add worktree creation to spawn flow (#529) (#537)
bradygaster Mar 23, 2026
7f86e0e
feat: Cooperative Rate Limiting & Predictive Circuit Breaker (#515) (…
tamirdresher Mar 23, 2026
677b7cf
docs: KEDA External Scaler Template for Agent Autoscaling (#516) (#519)
tamirdresher Mar 23, 2026
8d49066
feat: Machine Capability Discovery & needs:* Label Routing (#514) (#520)
tamirdresher Mar 23, 2026
6469a59
fix: P0 upgrade path gaps (#544)
bradygaster Mar 23, 2026
254a196
fix(ci): broken docs link, cspell words, test timeout
bradygaster Mar 23, 2026
505175b
docs(blog): add upgrade cross-testing at scale post (#029)
bradygaster Mar 23, 2026
37a24dd
chore: sync templates and build artifacts
bradygaster Mar 23, 2026
6a71992
fix(esm): check for complete exports before skipping patch
bradygaster Mar 23, 2026
8433689
fix(upgrade): context-aware footer + EPERM handling + gitignore paren…
bradygaster Mar 23, 2026
beb18a3
docs(squad): session log — #549 PR + community PR reviews
bradygaster Mar 23, 2026
c60c43b
docs: purge npx from user-facing content + audit agency refs
bradygaster Mar 23, 2026
a5fecaf
chore: pao history + decisions inbox for npx purge
bradygaster Mar 23, 2026
4d80bef
docs: fix stale npx reference in release-process branch table
bradygaster Mar 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/add-rework-rate-metric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-sdk": minor
---

Add rework rate OTEL metrics (#265) — tracks PR revision patterns as the emerging 5th DORA metric
4 changes: 4 additions & 0 deletions .changeset/add-session-recovery-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Add session-recovery skill for detecting and resuming interrupted Copilot CLI sessions
5 changes: 5 additions & 0 deletions .changeset/add-skill-script-loader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-sdk": minor
---

Add SkillScriptLoader, handler types, and applySkillHandlers for executable skill handler scripts
14 changes: 14 additions & 0 deletions .changeset/ado-configurable-items.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@bradygaster/squad-sdk": minor
---

ADO configurable work item types, area paths, and iteration support (#240)

- Add `getAvailableWorkItemTypes(org, project)` for process template introspection
- Add `validateWorkItemType(org, project, typeName)` for pre-creation validation
- Add `WorkItemTypeInfo` interface for type metadata
- Enhance `AzureDevOpsAdapter` with instance-level `getAvailableWorkItemTypes()` and `validateWorkItemType()` methods
- Support optional `validateType` flag in `createWorkItem()` to check type before creation
- Enhance `squad init` to introspect available work item types and store `_availableTypes` hint in `.squad/config.json`
- Support `adoConfig` in `InitOptions` for explicit work item type, area path, and iteration path during init
- Graceful fallback to default types (User Story, Bug, Task) when az CLI is unavailable
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"baseBranch": "dev",
"updateInternalDependencies": "patch",
"ignore": []
}
11 changes: 11 additions & 0 deletions .changeset/cooperative-rate-limiting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@bradygaster/squad-sdk": minor
---

feat: Cooperative rate limiting with predictive circuit breaker

Added cooperative rate limiting patterns for multi-agent deployments:
- Traffic Light, Predictive Circuit Breaker, Priority Retry Windows
- Cooperative Token Pool for shared quota management

Closes #515
6 changes: 6 additions & 0 deletions .changeset/cross-squad-orchestration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bradygaster/squad-sdk": minor
"@bradygaster/squad-cli": minor
---

Cross-squad orchestration — discovery, delegation, and manifest (#316). Adds manifest schema, `squad discover` / `squad delegate` commands, and runtime module for coordinating work across multiple Squad instances.
5 changes: 5 additions & 0 deletions .changeset/fix-readme-migration-guide-link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-cli": patch
---

docs: point README migration guide links to the published docs site
10 changes: 10 additions & 0 deletions .changeset/keda-scaler-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@bradygaster/squad-cli": patch
---

docs: Add KEDA external scaler template for GitHub issue-driven autoscaling

New template documenting how to use keda-copilot-scaler for scaling
agent pods to zero when idle, with rate-limit-aware polling.

Closes #516
15 changes: 15 additions & 0 deletions .changeset/machine-capability-routing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@bradygaster/squad-sdk": minor
"@bradygaster/squad-cli": minor
---

feat: Machine capability discovery and `needs:*` label-based issue routing

Added capability filtering to Ralph's watch command. Issues with `needs:*` labels
(e.g., `needs:gpu`, `needs:browser`) are only processed by Ralph instances whose
machine has those capabilities declared in `machine-capabilities.json`.

This enables multi-machine Squad deployments where different machines handle
different types of work based on their available tooling.

Closes #514
11 changes: 11 additions & 0 deletions .changeset/persistent-ralph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@bradygaster/squad-sdk': minor
'@bradygaster/squad-cli': minor
---

Enable persistent Ralph — heartbeat cron + healthCheck timer

- Enable cron schedule in squad-heartbeat.yml (all 5 sync locations)
- Enable RalphMonitor healthCheck timer (previously commented out pre-migration)
- Add platform detection tests for getRalphScanCommands (GitHub/ADO/Planner)
- Add healthCheck timer tests with fake timers (start/stop/interval/stale detection)
5 changes: 5 additions & 0 deletions .changeset/sdk-parity-batch2-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-sdk": patch
---

Add SDK feature parity batch 2 — 64 tests covering manual ceremonies (#27), ceremony cooldown (#28), human team members (#36), constraint budget enforcement (#49 — rate limiter, file-write guards, shell restrictions, PII scrubbing), multi-agent artifact coordination (#50), and builder validation edge cases.
11 changes: 11 additions & 0 deletions .changeset/sdk-parity-batch3-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@bradygaster/squad-sdk": patch
---

test: SDK feature parity batch 3 — 46 tests for #31, #47, #45, #46

Adds 46 automated tests covering 4 SDK features from the #341 parity matrix:
- RalphMonitor idle-watch mode (#31): construction, event handling, stale session detection
- Platform detection (#47): GitHub/Azure DevOps URL parsing, detectPlatformFromUrl
- Reviewer lockout (#45): rejection protocol, per-artifact scope, persistence
- Deadlock handling (#46): all-agents-locked detection, clearLockout escalation, recovery
6 changes: 6 additions & 0 deletions .changeset/squad-scheduler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bradygaster/squad-sdk": minor
"@bradygaster/squad-cli": minor
---

Generic, provider-agnostic scheduler for Squad (#296) — unified schedule.json manifest with LocalPolling and GitHubActions provider adapters, CLI commands (list, run, init, status), schema validation, and cron/interval trigger evaluation.
42 changes: 42 additions & 0 deletions .copilot/skills/agent-collaboration/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: "agent-collaboration"
description: "Standard collaboration patterns for all squad agents — worktree awareness, decisions, cross-agent communication"
domain: "team-workflow"
confidence: "high"
source: "extracted from charter boilerplate — identical content in 18+ agent charters"
---

## Context

Every agent on the team follows identical collaboration patterns for worktree awareness, decision recording, and cross-agent communication. These were previously duplicated in every charter's Collaboration section (~300 bytes × 18 agents = ~5.4KB of redundant context). Now centralized here.

The coordinator's spawn prompt already instructs agents to read decisions.md and their history.md. This skill adds the patterns for WRITING decisions and requesting help.

## Patterns

### Worktree Awareness
Use the `TEAM ROOT` path provided in your spawn prompt. All `.squad/` paths are relative to this root. If TEAM ROOT is not provided (rare), run `git rev-parse --show-toplevel` as fallback. Never assume CWD is the repo root.

### Decision Recording
After making a decision that affects other team members, write it to:
`.squad/decisions/inbox/{your-name}-{brief-slug}.md`

Format:
```
### {date}: {decision title}
**By:** {Your Name}
**What:** {the decision}
**Why:** {rationale}
```

### Cross-Agent Communication
If you need another team member's input, say so in your response. The coordinator will bring them in. Don't try to do work outside your domain.

### Reviewer Protocol
If you have reviewer authority and reject work: the original author is locked out from revising that artifact. A different agent must own the revision. State who should revise in your rejection response.

## Anti-Patterns
- Don't read all agent charters — you only need your own context + decisions.md
- Don't write directly to `.squad/decisions.md` — always use the inbox drop-box
- Don't modify other agents' history.md files — that's Scribe's job
- Don't assume CWD is the repo root — always use TEAM ROOT
24 changes: 24 additions & 0 deletions .copilot/skills/agent-conduct/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: "agent-conduct"
description: "Shared hard rules enforced across all squad agents"
domain: "team-governance"
confidence: "high"
source: "reskill extraction — Product Isolation Rule and Peer Quality Check appeared in all 20 agent charters"
---

## Context

Every squad agent must follow these two hard rules. They were previously duplicated in every charter. Now they live here as a shared skill, loaded once.

## Patterns

### Product Isolation Rule (hard rule)
Tests, CI workflows, and product code must NEVER depend on specific agent names from any particular squad. "Our squad" must not impact "the squad." No hardcoded references to agent names (Flight, EECOM, FIDO, etc.) in test assertions, CI configs, or product logic. Use generic/parameterized values. If a test needs agent names, use obviously-fake test fixtures (e.g., "test-agent-1", "TestBot").

### Peer Quality Check (hard rule)
Before finishing work, verify your changes don't break existing tests. Run the test suite for files you touched. If CI has been failing, check your changes aren't contributing to the problem. When you learn from mistakes, update your history.md.

## Anti-Patterns
- Don't hardcode dev team agent names in product code or tests
- Don't skip test verification before declaring work done
- Don't ignore pre-existing CI failures that your changes may worsen
84 changes: 84 additions & 0 deletions .copilot/skills/ci-validation-gates/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
name: "ci-validation-gates"
description: "Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22"
domain: "ci-cd"
confidence: "high"
source: "extracted from Drucker and Trejo charters — earned knowledge from v0.8.22 release incident"
---

## 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..."
- Exit loop on success, fail after max attempts

```yaml
- name: Verify package (with retry)
run: |
MAX_ATTEMPTS=5
WAIT_SECONDS=15
for attempt in $(seq 1 $MAX_ATTEMPTS); do
echo "Attempt $attempt/$MAX_ATTEMPTS: Checking $PACKAGE@$VERSION..."
if npm view "$PACKAGE@$VERSION" version > /dev/null 2>&1; then
echo "✅ Package verified"
exit 0
fi
[ $attempt -lt $MAX_ATTEMPTS ] && sleep $WAIT_SECONDS
done
echo "❌ Failed to verify after $MAX_ATTEMPTS attempts"
exit 1
```

### Draft Release Detection
Draft releases don't emit `release: published` event. Workflows MUST:
- Trigger on `release: published` (NOT `created`)
- If using workflow_dispatch: verify release is published via GitHub API before proceeding

### Build Script Protection
Set `SKIP_BUILD_BUMP=1` (or `$env:SKIP_BUILD_BUMP = "1"` on Windows) before ANY release build. bump-build.mjs is for dev builds ONLY — it silently mutates versions.

## Known Failure Modes (v0.8.22 Incident)

| # | What Happened | Root Cause | Prevention |
|---|---------------|-----------|------------|
| 1 | 4-part version published, npm mangled it | No semver validation gate | `npx semver` check before every publish |
| 2 | CI failed 5+ times with EOTP | User token with 2FA | Automation token only |
| 3 | Verify returned false 404 | No retry logic for propagation | 5 attempts, 15s intervals |
| 4 | Workflow never triggered | Draft release doesn't emit event | Never create draft releases |
| 5 | Version mutated during release | bump-build.mjs ran in release | SKIP_BUILD_BUMP=1 |

## Anti-Patterns
- ❌ Publishing without semver validation gate
- ❌ Single-shot verification without retry
- ❌ Hard-coded secrets in workflows
- ❌ Silent CI failures — every error needs actionable output with remediation
- ❌ Assuming npm publish is instantly queryable
Loading