Windsurf rules
.windsurf/rules/wire-ci.mdCI pipeline setup with bundled, forge-neutral templates and local validation. Detects the forge from the git remote, generates workflows for supported forges, and skips honestly for the rest. The CI equivalent of wire-observability.
Windsurf rules
Quality
81/100
Scores the file, not the repository.Length
1,619 words
28 headings · 12 code blocksRepository
114
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Wire CI89> **HARD GATE (supported forges only)** — Do not ship a project without CI. Run this skill before first merge to main.10>11> On a forge bigpowers ships no templates for, this skill **is not a gate**: it reports the forge, explains what it cannot do, and exits 3. A gate that cannot run must not claim it did. See § Unsupported forges.12>13> **HARD GATE** — CI that is untestable locally will break every cycle. Always run `--validate` after generating workflows and `--dry-run` before pushing.1415Generate, validate, and test CI workflows. Detects the forge and project type, copies a **bundled** template, and verifies locally before anything reaches CI.1617## Forge resolution1819`scripts/lib/detect-forge.sh` resolves the forge, first match wins: `BIGPOWERS_FORGE` env var → `forge:` in `specs/forge.yaml` → the `origin` remote URL → `unknown`.2021```bash22bash scripts/wire-ci.sh --detect # report forge + stack, write nothing23bash scripts/wire-ci.sh --plan # show the template that would be used24bash scripts/wire-ci.sh --apply # write the workflow25```2627GitHub ships templates (`.github/workflows/`). GitLab, Bitbucket, Codeberg, and Gitea are detected but **unsupported** — `--apply` writes nothing and exits 3.2829## Template source — configurable, bundled by default3031Templates live in `docs/templates/ci/<forge>/` **inside the bigpowers package**, so there is no network dependency on any third party's repository. Override with `BIGPOWERS_CI_TEMPLATES=/path/to/your/templates`, laid out as `<root>/<forge>/test-build-release-<stack>.yml`.3233## What this sets up34351. **Test Build Release workflow** — lint → test → build → release in one `needs:` chain362. **`--validate` mode** — YAML syntax, workflow permissions, required secrets, common pitfalls373. **`--dry-run` mode** — runs workflows locally via `act` before push384. **Failure pattern documentation** — see the table below3940Deploy workflows are **not** bundled: they are platform-specific. See [REFERENCE.md](REFERENCE.md) for a worked example.4142## Process4344### 1. Detect forge and stack4546```bash47bash scripts/wire-ci.sh --detect48```4950Stack detection reads the project root:5152| Manifest | Stack | Bundled template |53|----------|-------|------------------|54| `Cargo.toml` | Rust | `test-build-release-rust.yml` |55| `package.json` | Node | `test-build-release-node.yml` |56| `pyproject.toml` / `setup.py` | Python | `test-build-release-python.yml` |57| `go.mod` | Go | `test-build-release-go.yml` |5859No recognized manifest → exit 3 with the list of manifests it looked for. Do not guess.6061### 2. Apply the template6263```bash64bash scripts/wire-ci.sh --apply65```6667**Do not rename the workflow `name:` field** — deploy listens for `"Test Build Release"`.6869Edit placeholders after copying: language versions, `APP_TYPE`, `SITE_URL`.7071### 3. Unsupported forges7273`--apply` writes nothing and exits 3. Your options, in the order the runner prints them:7475- point `BIGPOWERS_CI_TEMPLATES` at templates for your forge76- pin `forge: github` in `specs/forge.yaml` if the remote is misdetected77- write the CI config by hand7879Contributing a `docs/templates/ci/gitlab/` set and adding `gitlab` to `FORGE_SUPPORTED_LIST` is the natural next slice — per-forge command mapping (`gh pr checks` → `glab ci status`) is not implemented yet.8081### 4. Validate workflows (`--validate`)8283See [REFERENCE.md](REFERENCE.md). Exit codes: `0` clean, `1` YAML syntax errors, `2` warnings only.8485### 5. Dry-run workflows (`--dry-run`)8687See [REFERENCE.md](REFERENCE.md).8889> **act** runs workflows in a local Docker environment — the most accurate pre-push validation.90> **gh workflow run** sends the workflow to GitHub but does not execute locally.9192### 6. Document common CI failure patterns9394| Failure | Cause | Fix |95|---------|-------|-----|96| `npm publish` fails | `NPM_TOKEN` not set as repo secret | Add `NPM_TOKEN` to repo secrets |97| `semantic-release` fails on push | Missing `permissions: contents: write` | Add it to the release job |98| `cargo publish` auth fail | `CARGO_REGISTRY_TOKEN` not set | Add token to env or `~/.cargo/config.toml` |99| `go vet` fails | Go version mismatch | Use `go-version-file: go.mod` |100| `cargo clippy` errors | New nightly lints | Pin the toolchain; `cargo clippy --fix` |101| `act` not found | Docker not running or act missing | `brew install act`; `docker ps` |102| Hardcoded Node version stale | `.nvmrc` exists but workflow hardcodes | Use `node-version-file: .nvmrc` |103| Deploy never runs | TBR workflow renamed | Keep `name: Test Build Release` |104| Release rebuilds binary | Artifact not downloaded | `release` must `download-artifact` from `build` |105106## Verify107108→ verify: `bash scripts/wire-ci.sh --self-test`109→ verify: `test -f docs/templates/ci/github/test-build-release-node.yml && test -f scripts/lib/detect-forge.sh`110→ verify: `grep -q wire-ci SKILL-INDEX.md`111112---113114# Wire Ci — Reference115116## Navigation117118| Lines | Section |119|-------|---------|120| 1 | Title |121| 3–20 | Navigation |122| 21–22 | Examples |123| 23–39 | Create CI for a Go project (TBR + optional deploy) |124| 40–49 | Create CI for a CLI tool (TBR only, no deploy) |125| 50–57 | Validate existing workflows (no generation) |126| 58–70 | Options |127| 71–79 | Integration with build-epic |128| 80–154 | Reference block 1 — test-build-release.yml (Go, excerpt) |129| 155–204 | Reference block 2 — deploy.yml (generic web app, excerpt) |130| 205–232 | Reference block 3 — CLI dogfood (big-release pattern) |131| 233–257 | Reference block 4 — validate script |132| 258–268 | Reference block 5 — dry-run |133134## Examples135136### Create CI for a Go project (TBR + optional deploy)137138```bash139# Resolve forge + stack, then apply the bundled template140bash scripts/wire-ci.sh --detect141bash scripts/wire-ci.sh --apply142143wire-ci --validate144wire-ci --dry-run145```146147To use your own org templates instead of the bundled ones:148149```bash150BIGPOWERS_CI_TEMPLATES=/path/to/your/templates bash scripts/wire-ci.sh --apply151```152153### Create CI for a CLI tool (TBR only, no deploy)154155```bash156bash scripts/wire-ci.sh --apply157# Edit release job to download build artifact — see big-release dogfood158# CLI/library repos: delete deploy.yml; the release job is terminal.159160wire-ci --validate161```162163### Validate existing workflows (no generation)164165```bash166wire-ci --validate --check-only167```168169---170171## Options172173| Flag | Description |174|------|-------------|175| `--validate` | Check YAML syntax, permissions, secrets, common pitfalls |176| `--dry-run` | Run workflows locally via `act` or dispatch via `gh` |177| `--check-only` | Only validate, do not generate new files |178| `--type <type>` | Force project type (skip auto-detection) |179| `--force` | Overwrite existing workflow files |180| `--no-deploy` | Skip deploy.yml even for hosted stacks |181182---183184## Integration with build-epic185186When `wire-ci` is used as part of `build-epic`:1871881. **During develop-tdd**: If the task modifies `.github/workflows/`, run `wire-ci --validate` as a CI dry-run sub-step1892. **During release-branch**: After push, run `gh run list --limit 1 --branch main --json status,conclusion` to verify CI passes190191---192193## Reference block 1 — test-build-release.yml (Go, excerpt)194195```yaml196name: Test Build Release197on:198 push:199 branches: [main]200 pull_request:201 branches: [main]202203permissions:204 contents: read205206concurrency:207 group: pipeline-${{ github.workflow }}-${{ github.ref }}208 cancel-in-progress: true209210jobs:211 lint:212 runs-on: ubuntu-22.04213 timeout-minutes: 10214 steps:215 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0216 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0217 with:218 go-version: '1.22'219 cache: true220 - uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2221 with:222 version: v1.64.8223224 test:225 needs: [lint]226 runs-on: ubuntu-22.04227 steps:228 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0229 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0230 with:231 go-version: '1.22'232 cache: true233 - run: go vet ./...234 - run: go test ./... -count=1235236 build:237 needs: [test]238 runs-on: ubuntu-22.04239 steps:240 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0241 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0242 with:243 go-version: '1.22'244 cache: true245 - run: go build ./...246 - run: jq -n --arg sha "${{ github.sha }}" '{sha: $sha}' > deploy-meta.json247 - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1248 with:249 name: deploy-meta250 path: deploy-meta.json251252 release:253 if: github.ref == 'refs/heads/main' && github.event_name == 'push'254 needs: [build]255 permissions:256 contents: write257 steps:258 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0259 with:260 fetch-depth: 0261 - run: npx semantic-release262 env:263 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}264```265266---267268## Reference block 2 — deploy.yml (generic web app, excerpt)269270```yaml271name: Deploy272on:273 workflow_run:274 workflows: ["Test Build Release"]275 types: [completed]276277permissions:278 contents: read279 actions: read280281concurrency:282 group: deploy-production283 cancel-in-progress: false284285env:286 SITE_URL: "https://CHANGE-ME.example.com"287288jobs:289 deploy:290 if: >291 github.event.workflow_run.conclusion == 'success' &&292 github.event.workflow_run.head_branch == 'main'293 runs-on: ubuntu-22.04294 environment: production295 steps:296 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1297 with:298 name: deploy-meta299 github-token: ${{ secrets.GITHUB_TOKEN }}300 run-id: ${{ github.event.workflow_run.id }}301 path: deploy-meta302 # Placeholder deploy step — bigpowers ships no deploy templates and pins303 # no third-party action. Substitute your platform's own step here, or drop304 # the deploy job entirely for CLI and library repos. Pin whatever action305 # you choose to a full commit SHA rather than a tag. (GH #104)306 - name: Deploy307 run: |308 echo "Replace this step with your platform's deploy command."309 echo "commit=$(jq -r .sha deploy-meta/deploy-meta.json)"310 exit 1311 - name: Health check312 run: |313 curl -sf "${{ env.SITE_URL }}" || exit 1314```315316---317318## Reference block 3 — CLI dogfood (big-release pattern)319320```yaml321 build:322 needs: [test]323 steps:324 - run: make build325 - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1326 with:327 name: big-release-${{ github.sha }}328 path: bin/big-release329330 release:331 needs: [build]332 if: github.ref == 'refs/heads/main' && github.event_name == 'push'333 steps:334 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1335 with:336 name: big-release-${{ github.sha }}337 path: bin338 - run: make release # cross-compile assets only; host binary from artifact339 - run: big-release release --verbose340```341342No `deploy.yml` — CLI publishes via the release job.343344---345346## Reference block 4 — validate script347348```bash349for f in .github/workflows/*.yml .github/workflows/*.yaml; do350 [ -f "$f" ] || continue351 python3 -c "import yaml; yaml.safe_load(open('$f'))" || echo "FAIL: $f has YAML syntax errors"352done353354for f in .github/workflows/test-build-release.yml; do355 if grep -q "permissions:" "$f"; then356 echo "OK: $f has permissions block"357 else358 echo "WARNING: $f missing permissions block"359 fi360done361362if grep -q 'workflows: \["Test Build Release"\]' .github/workflows/deploy.yml 2>/dev/null; then363 if ! grep -q 'name: Test Build Release' .github/workflows/test-build-release.yml; then364 echo "WARNING: deploy.yml listens for Test Build Release but TBR name may differ"365 fi366fi367```368369---370371## Reference block 5 — dry-run372373```bash374if command -v act &>/dev/null; then375 act push --dry-run -W .github/workflows/test-build-release.yml376elif command -v gh &>/dev/null; then377 gh workflow run test-build-release.yml --ref "$(git branch --show-current)"378else379 echo "Install act or gh for dry-run"380fi381```382
Also in danielvm-git/bigpowers
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.cursor/rules/align-grid.mdc · 114 | Cursor rules | lint-formatdo-notagent-behaviour | 65/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 114 | Cursor rules | testtesting-strategydeployment | 66/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-code.mdc · 114 | Cursor rules | setuptestlint-formatstyle+4 | 66/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 114 | Cursor rules | buildteststylegit | 74/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 114 | Cursor rules | buildgit | 58/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/change-request.mdc · 114 | Cursor rules | no sections | 48/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 114 | Cursor rules | lint-formatstyletypesgit+3 | 82/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 114 | Cursor rules | styledo-notagent-behaviour | 65/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 114 | Cursor rules | style | 54/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/craft-skill.mdc · 114 | Cursor rules | stylearchgitdo-not | 69/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 114 | Cursor rules | testtesting-strategydo-not | 57/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-language.mdc · 114 | Cursor rules | lint-formatdo-not | 65/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-success.mdc · 114 | Cursor rules | no sections | 4/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 114 | Cursor rules | git | 62/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/deploy.mdc · 114 | Cursor rules | setupbuildtestdeployment | 77/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/design-interface.mdc · 114 | Cursor rules | styleagent-behaviour | 58/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 114 | Cursor rules | teststylearchtesting-strategy+5 | 85/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 114 | Cursor rules | no sections | 39/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 114 | Cursor rules | no sections | 44/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 114 | Cursor rules | git | 54/100 | 3 days ago |
Diff against .cursor/rules/align-grid.mdc Diff against .cursor/rules/assess-impact.mdc Diff against .cursor/rules/audit-code.mdc Diff against .cursor/rules/audit-plan.mdc Diff against .cursor/rules/build-epic.mdc Diff against .cursor/rules/change-request.mdc Diff against .cursor/rules/commit-message.mdc Diff against .cursor/rules/compose-workflow.mdc Diff against .cursor/rules/context7-mcp.mdc Diff against .cursor/rules/craft-skill.mdc Diff against .cursor/rules/deepen-architecture.mdc Diff against .cursor/rules/define-language.mdc Diff against .cursor/rules/define-success.mdc Diff against .cursor/rules/delegate-task.mdc Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/design-interface.mdc Diff against .cursor/rules/develop-tdd.mdc Diff against .cursor/rules/diagnose-root.mdc Diff against .cursor/rules/diagnose-stall.mdc Diff against .cursor/rules/dispatch-agents.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.windsurf/rules/organize-workspace.md · 114 | Windsurf rules | buildstylegitdeployment+2 | 89/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/guard-git.md · 114 | Windsurf rules | stylearchgitsecurity+2 | 89/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/quick-fix.md · 114 | Windsurf rules | teststylegitdeployment+1 | 85/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/develop-tdd.md · 114 | Windsurf rules | teststylearchtesting-strategy+5 | 85/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/session-state.md · 114 | Windsurf rules | lint-formatstyleagent-behaviour | 82/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/commit-message.md · 114 | Windsurf rules | lint-formatstyletypesgit+3 | 82/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/extract-design.md · 114 | Windsurf rules | lint-formatstyledependenciesui | 82/100 | 3 days ago | |
| danielvm-git/bigpowers.windsurf/rules/setup-environment.md · 114 | Windsurf rules | setupstylesecuritydo-not+1 | 81/100 | 3 days ago |
