bigpowers 2.86.1 → 2.86.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/.agents/skills/security-review/SKILL.md +3 -1
  2. package/.agents/skills/smoke-test/SKILL.md +1 -1
  3. package/.agents/skills/wire-ci/SKILL.md +78 -59
  4. package/.codebuddy/skills/security-review/SKILL.md +3 -1
  5. package/.codebuddy/skills/smoke-test/SKILL.md +1 -1
  6. package/.codebuddy/skills/wire-ci/SKILL.md +78 -59
  7. package/.codex/skills/security-review/SKILL.md +3 -1
  8. package/.codex/skills/smoke-test/SKILL.md +1 -1
  9. package/.codex/skills/wire-ci/SKILL.md +78 -59
  10. package/.hermes/skills/security-review/SKILL.md +3 -1
  11. package/.hermes/skills/smoke-test/SKILL.md +1 -1
  12. package/.hermes/skills/wire-ci/SKILL.md +78 -59
  13. package/.kilocode/rules/security-review.md +3 -1
  14. package/.kilocode/rules/smoke-test.md +1 -1
  15. package/.kilocode/rules/wire-ci.md +78 -59
  16. package/.mimocode/skills/security-review/SKILL.md +3 -1
  17. package/.mimocode/skills/smoke-test/SKILL.md +1 -1
  18. package/.mimocode/skills/wire-ci/SKILL.md +78 -59
  19. package/.pi/package.json +1 -1
  20. package/.pi/prompts/security-review.md +3 -1
  21. package/.pi/prompts/smoke-test.md +1 -1
  22. package/.pi/prompts/wire-ci.md +78 -59
  23. package/.pi/skills/security-review/SKILL.md +3 -1
  24. package/.pi/skills/smoke-test/SKILL.md +1 -1
  25. package/.pi/skills/wire-ci/SKILL.md +78 -59
  26. package/.trae/skills/security-review/SKILL.md +3 -1
  27. package/.trae/skills/smoke-test/SKILL.md +1 -1
  28. package/.trae/skills/wire-ci/SKILL.md +78 -59
  29. package/.windsurf/rules/security-review.md +3 -1
  30. package/.windsurf/rules/smoke-test.md +1 -1
  31. package/.windsurf/rules/wire-ci.md +78 -59
  32. package/.zcode/skills/security-review/SKILL.md +3 -1
  33. package/.zcode/skills/smoke-test/SKILL.md +1 -1
  34. package/.zcode/skills/wire-ci/SKILL.md +78 -59
  35. package/CHANGELOG.md +21 -0
  36. package/SKILL-INDEX.md +1 -1
  37. package/package.json +1 -1
  38. package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
  39. package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
  40. package/scripts/lib/context-wire.sh +9 -0
  41. package/scripts/lib/detect-forge.sh +105 -0
  42. package/scripts/lib/extract-story-verify.py +102 -0
  43. package/scripts/lib/fail-open-detect.sh +67 -0
  44. package/scripts/lib/golden-suite-gates.sh +4 -0
  45. package/scripts/lib/plan-consistency-check.sh +26 -2
  46. package/scripts/lib/test-assertions.sh +11 -1
  47. package/scripts/run-skill-verify.sh +5 -46
  48. package/scripts/run-story-verify.sh +208 -0
  49. package/scripts/test-adapters.sh +14 -8
  50. package/scripts/verify-cwe-fixture-sync.sh +88 -0
  51. package/scripts/verify-install.sh +13 -1
  52. package/scripts/wire-ci.sh +159 -0
  53. package/skills/security-review/SKILL.md +3 -1
  54. package/skills/security-review/fixtures/CWE-639-idor-negative.go +48 -0
  55. package/skills/security-review/fixtures/CWE-639-idor-positive.go +29 -0
  56. package/skills/smoke-test/SKILL.md +1 -1
  57. package/skills/wire-ci/REFERENCE.md +15 -4
  58. package/skills/wire-ci/SKILL.md +63 -55
  59. package/skills-lock.json +4 -4
@@ -58,6 +58,8 @@ Every **new detection rule** added to this skill MUST:
58
58
  |------|-----|------------------|------------------|
59
59
  | SQL injection | CWE-89 | `fixtures/CWE-89-sqli-positive.py` | `fixtures/CWE-89-sqli-negative.py` |
60
60
  | XSS (DOM) | CWE-79 | `fixtures/CWE-79-xss-positive.js` | `fixtures/CWE-79-xss-negative.js` |
61
+ | Missing tenant scoping (IDOR) | CWE-639 | `fixtures/CWE-639-idor-positive.go` | `fixtures/CWE-639-idor-negative.go` |
62
+ | Fail-open verify directive | CWE-754 | `fixtures/CWE-fail-open-verify-positive.sh` | `fixtures/CWE-fail-open-verify-negative.sh` |
61
63
 
62
64
  Before merging a new category, run both fixtures through the detection guidance and confirm positive flags / negative passes.
63
65
 
@@ -109,7 +111,7 @@ Each finding: **`File:Line` — Severity — Category**
109
111
 
110
112
  ## Verify
111
113
 
112
- → verify: `test -d specs/security && test -f scripts/lib/parallel-review-worktrees.sh && git rev-parse HEAD >/dev/null 2>&1`
114
+ → verify: `test -d specs/security && test -f scripts/lib/parallel-review-worktrees.sh && bash scripts/verify-cwe-fixture-sync.sh >/dev/null && git rev-parse HEAD >/dev/null 2>&1`
113
115
 
114
116
  ---
115
117
 
@@ -78,7 +78,7 @@ Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-te
78
78
 
79
79
  ## Verify
80
80
 
81
- → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && grep -qv 'See \[REFERENCE.md\]' skills/smoke-test/SKILL.md && echo OK`
81
+ → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && ! grep -q 'See \[REFERENCE.md\](REFERENCE.md)$' skills/smoke-test/SKILL.md && echo OK`
82
82
 
83
83
  ---
84
84
 
@@ -1,104 +1,112 @@
1
1
  ---
2
2
  name: wire-ci
3
3
  model: sonnet
4
- description: "CI pipeline setup with pre-built templates and local validation. Generates GitHub Actions workflows, validates YAML syntax and permissions, supports dry-run via act/gh. The CI equivalent of wire-observability."
4
+ description: "CI 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."
5
5
  ---
6
6
 
7
7
  # Wire CI
8
8
 
9
- > **HARD GATE** — Do not ship a project without CI. Run this skill before first merge to main or when adding CI to an existing project.
9
+ > **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.
10
12
  >
11
13
  > **HARD GATE** — CI that is untestable locally will break every cycle. Always run `--validate` after generating workflows and `--dry-run` before pushing.
12
14
 
13
- Generate, validate, and test CI workflows. Detects your project type, copies org templates from `danielvm-git/.github/workflow-templates/`, and provides local verification to catch auth, permissions, and syntax issues before they reach CI.
15
+ Generate, validate, and test CI workflows. Detects the forge and project type, copies a **bundled** template, and verifies locally before anything reaches CI.
14
16
 
15
- ## What this sets up
17
+ ## Forge resolution
16
18
 
17
- 1. **Test Build Release workflow** — `.github/workflows/test-build-release.yml` with lint → test → build → release (single pipeline, `needs:` chain)
18
- 2. **Deploy workflow** — `.github/workflows/deploy.yml` triggered via `workflow_run` (BigBase/Pages stacks only; CLI/library repos omit this)
19
- 3. **`--validate` mode** — checks YAML syntax, workflow permissions, required secrets, and common pitfalls
20
- 4. **`--dry-run` mode** — runs workflows locally via `act` or `gh workflow run` to prove correctness before push
21
- 5. **Failure pattern documentation** — common CI failure categories and their fixes
19
+ `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`.
22
20
 
23
- ## Process
21
+ ```bash
22
+ bash scripts/wire-ci.sh --detect # report forge + stack, write nothing
23
+ bash scripts/wire-ci.sh --plan # show the template that would be used
24
+ bash scripts/wire-ci.sh --apply # write the workflow
25
+ ```
24
26
 
25
- ### 1. Detect project type
27
+ GitHub ships templates (`.github/workflows/`). GitLab, Bitbucket, Codeberg, and Gitea are detected but **unsupported** — `--apply` writes nothing and exits 3.
26
28
 
27
- Read the project root for manifest files to determine which template pair to copy:
29
+ ## Template source — configurable, bundled by default
28
30
 
29
- | Manifest | Type | Template pair (from `.github` repo) |
30
- |----------|------|-------------------------------------|
31
- | `Cargo.toml` | Rust | `test-build-release-monorepo.yml` + `deploy-monorepo.yml` (or monorepo subset) |
32
- | `package.json` | Node | `test-build-release-node.yml` + `deploy-node.yml` |
33
- | `setup.py` / `pyproject.toml` | Python | `test-build-release-python.yml` + `deploy-python.yml` |
34
- | `go.mod` | Go | `test-build-release-go.yml` + `deploy-go.yml` |
35
- | Static site (no server) | Static | `test-build-release-static.yml` + `deploy-static.yml` |
36
- | `Package.swift` | Swift | `test-build-release-swift.yml` only (no deploy yet) |
37
- | Multiple detected | Polyglot | `test-build-release-monorepo.yml` + `deploy-monorepo.yml` |
31
+ Templates 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`.
38
32
 
39
- **CLI/library repos** (no hosted target): copy only `test-build-release-<stack>.yml` → `test-build-release.yml`. The `release` job is terminal; skip `deploy.yml`. See `docs/how-to/migrate-ci-cd/migration-plan.md` § CLI and library repos.
33
+ ## What this sets up
40
34
 
41
- If no manifest is found, prompt the user to specify the type or pass `--type <rust|node|python|go|static|swift>`.
35
+ 1. **Test Build Release workflow** — lint → test → build → release in one `needs:` chain
36
+ 2. **`--validate` mode** — YAML syntax, workflow permissions, required secrets, common pitfalls
37
+ 3. **`--dry-run` mode** — runs workflows locally via `act` before push
38
+ 4. **Failure pattern documentation** — see the table below
42
39
 
43
- ### 2. Copy test-build-release template
40
+ Deploy workflows are **not** bundled: they are platform-specific. See [REFERENCE.md](REFERENCE.md) for a worked example.
44
41
 
45
- Copy the matching template from `~/Developer/.github/workflow-templates/` to `.github/workflows/test-build-release.yml`. **Do not rename the workflow `name:` field** — deploy listens for `"Test Build Release"`.
42
+ ## Process
43
+
44
+ ### 1. Detect forge and stack
45
+
46
+ ```bash
47
+ bash scripts/wire-ci.sh --detect
48
+ ```
46
49
 
47
- Edit placeholders: `APP_TYPE`, `SITE_URL`, language versions.
50
+ Stack detection reads the project root:
48
51
 
49
- See [REFERENCE.md](REFERENCE.md) for stack-specific job shapes.
52
+ | 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` |
50
58
 
51
- ### 3. Copy deploy template (hosted stacks only)
59
+ No recognized manifest → exit 3 with the list of manifests it looked for. Do not guess.
52
60
 
53
- If the project deploys to BigBase or GitHub Pages:
61
+ ### 2. Apply the template
54
62
 
55
63
  ```bash
56
- cp ~/Developer/.github/workflow-templates/deploy-${STACK}.yml .github/workflows/deploy.yml
64
+ bash scripts/wire-ci.sh --apply
57
65
  ```
58
66
 
59
- Configure `BIGBASE_SITE_ID`, `BIGBASE_DEPLOY_TOKEN`, and matching `SITE_URL`. Deploy runs via `workflow_run` after TBR succeeds on `main` with `cancel-in-progress: false`.
67
+ **Do not rename the workflow `name:` field** — deploy listens for `"Test Build Release"`.
60
68
 
61
- Skip this step for CLI/library repos.
69
+ Edit placeholders after copying: language versions, `APP_TYPE`, `SITE_URL`.
62
70
 
63
- ### 4. Validate workflows (`--validate`)
71
+ ### 3. Unsupported forges
64
72
 
65
- Run `wire-ci --validate` to check all generated workflow files:
73
+ `--apply` writes nothing and exits 3. Your options, in the order the runner prints them:
66
74
 
67
- See [REFERENCE.md](REFERENCE.md)
75
+ - point `BIGPOWERS_CI_TEMPLATES` at templates for your forge
76
+ - pin `forge: github` in `specs/forge.yaml` if the remote is misdetected
77
+ - write the CI config by hand
68
78
 
69
- **Exit codes:**
70
- - `0` — all checks pass (no errors)
71
- - `1` — YAML syntax errors found
72
- - `2` — validation warnings only (missing permissions, secrets, etc.)
79
+ Contributing 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.
73
80
 
74
- ### 5. Dry-run workflows (`--dry-run`)
81
+ ### 4. Validate workflows (`--validate`)
75
82
 
76
- Attempt to run the generated workflows locally to catch errors before push:
83
+ See [REFERENCE.md](REFERENCE.md). Exit codes: `0` clean, `1` YAML syntax errors, `2` warnings only.
84
+
85
+ ### 5. Dry-run workflows (`--dry-run`)
77
86
 
78
- See [REFERENCE.md](REFERENCE.md)
87
+ See [REFERENCE.md](REFERENCE.md).
79
88
 
80
89
  > **act** runs workflows in a local Docker environment — the most accurate pre-push validation.
81
- > **gh workflow run** sends the workflow to GitHub but doesn't execute locally — useful for checking YAML parsing but not for testing the actual steps.
90
+ > **gh workflow run** sends the workflow to GitHub but does not execute locally.
82
91
 
83
92
  ### 6. Document common CI failure patterns
84
93
 
85
- Add the following to the project's documentation or CLAUDE.md after setup:
86
-
87
94
  | Failure | Cause | Fix |
88
95
  |---------|-------|-----|
89
- | `npm publish` fails | `NPM_TOKEN` not set as repo secret | Add `NPM_TOKEN` to GitHub repo secrets |
90
- | `semantic-release` fails on push | Missing `permissions: contents: write` | Add `permissions: contents: write` to release job |
91
- | `cargo publish` auth fail | `CARGO_REGISTRY_TOKEN` not set | Add token to `~/.cargo/config.toml` or env |
92
- | `go vet` fails | Go version mismatch | Match `go.mod` `go` directive with setup-go version |
93
- | `cargo clippy` errors | New lints in Rust nightly | `cargo clippy --fix` or allow specific lints |
94
- | `act` not found | Docker not running or act not installed | `brew install act` / `docker ps` to verify Docker |
95
- | Hardcoded Node version stale | `.nvmrc` exists but workflow uses hardcoded version | Use `node-version-file: .nvmrc` instead |
96
- | Deploy never runs | TBR workflow renamed | Keep `name: Test Build Release` in test-build-release.yml |
97
- | Release rebuilds binary | Artifact not downloaded | `release` job must `download-artifact` from `build` |
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` |
98
105
 
99
106
  ## Verify
100
107
 
101
- → verify: `test -f skills/wire-ci/REFERENCE.md && test -f .github/workflows/sync-skills.yml`
108
+ → 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`
102
110
  → verify: `grep -q wire-ci SKILL-INDEX.md`
103
111
 
104
112
  ---
@@ -121,19 +129,26 @@ Add the following to the project's documentation or CLAUDE.md after setup:
121
129
  ### Create CI for a Go project (TBR + optional deploy)
122
130
 
123
131
  ```bash
124
- # Copy org templates
125
- cp ~/Developer/.github/workflow-templates/test-build-release-go.yml .github/workflows/test-build-release.yml
126
- cp ~/Developer/.github/workflow-templates/deploy-go.yml .github/workflows/deploy.yml
132
+ # Resolve forge + stack, then apply the bundled template
133
+ bash scripts/wire-ci.sh --detect
134
+ bash scripts/wire-ci.sh --apply
127
135
 
128
136
  wire-ci --validate
129
137
  wire-ci --dry-run
130
138
  ```
131
139
 
140
+ To use your own org templates instead of the bundled ones:
141
+
142
+ ```bash
143
+ BIGPOWERS_CI_TEMPLATES=/path/to/your/templates bash scripts/wire-ci.sh --apply
144
+ ```
145
+
132
146
  ### Create CI for a CLI tool (TBR only, no deploy)
133
147
 
134
148
  ```bash
135
- cp ~/Developer/.github/workflow-templates/test-build-release-go.yml .github/workflows/test-build-release.yml
149
+ bash scripts/wire-ci.sh --apply
136
150
  # Edit release job to download build artifact — see big-release dogfood
151
+ # CLI/library repos: delete deploy.yml; the release job is terminal.
137
152
 
138
153
  wire-ci --validate
139
154
  ```
@@ -277,6 +292,10 @@ jobs:
277
292
  github-token: ${{ secrets.GITHUB_TOKEN }}
278
293
  run-id: ${{ github.event.workflow_run.id }}
279
294
  path: deploy-meta
295
+ # BigBase-specific composite action, not a bigpowers default: this deploy
296
+ # example targets the author's own hosting stack. Replace it with your
297
+ # platform's deploy step (or drop the deploy job entirely for CLI and
298
+ # library repos). bigpowers itself ships no deploy templates. (GH #104)
280
299
  - uses: danielvm-git/.github/actions/bigbase-deploy@9c56ac10c629f3baa110ddb19136579e3c90d690 # v1
281
300
  with:
282
301
  site_id: ${{ secrets.BIGBASE_SITE_ID }}
@@ -58,6 +58,8 @@ Every **new detection rule** added to this skill MUST:
58
58
  |------|-----|------------------|------------------|
59
59
  | SQL injection | CWE-89 | `fixtures/CWE-89-sqli-positive.py` | `fixtures/CWE-89-sqli-negative.py` |
60
60
  | XSS (DOM) | CWE-79 | `fixtures/CWE-79-xss-positive.js` | `fixtures/CWE-79-xss-negative.js` |
61
+ | Missing tenant scoping (IDOR) | CWE-639 | `fixtures/CWE-639-idor-positive.go` | `fixtures/CWE-639-idor-negative.go` |
62
+ | Fail-open verify directive | CWE-754 | `fixtures/CWE-fail-open-verify-positive.sh` | `fixtures/CWE-fail-open-verify-negative.sh` |
61
63
 
62
64
  Before merging a new category, run both fixtures through the detection guidance and confirm positive flags / negative passes.
63
65
 
@@ -109,7 +111,7 @@ Each finding: **`File:Line` — Severity — Category**
109
111
 
110
112
  ## Verify
111
113
 
112
- → verify: `test -d specs/security && test -f scripts/lib/parallel-review-worktrees.sh && git rev-parse HEAD >/dev/null 2>&1`
114
+ → verify: `test -d specs/security && test -f scripts/lib/parallel-review-worktrees.sh && bash scripts/verify-cwe-fixture-sync.sh >/dev/null && git rev-parse HEAD >/dev/null 2>&1`
113
115
 
114
116
  ---
115
117
 
@@ -78,7 +78,7 @@ Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-te
78
78
 
79
79
  ## Verify
80
80
 
81
- → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && grep -qv 'See \[REFERENCE.md\]' skills/smoke-test/SKILL.md && echo OK`
81
+ → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && ! grep -q 'See \[REFERENCE.md\](REFERENCE.md)$' skills/smoke-test/SKILL.md && echo OK`
82
82
 
83
83
  ---
84
84
 
@@ -1,104 +1,112 @@
1
1
  ---
2
2
  name: wire-ci
3
3
  model: sonnet
4
- description: "CI pipeline setup with pre-built templates and local validation. Generates GitHub Actions workflows, validates YAML syntax and permissions, supports dry-run via act/gh. The CI equivalent of wire-observability."
4
+ description: "CI 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."
5
5
  ---
6
6
 
7
7
  # Wire CI
8
8
 
9
- > **HARD GATE** — Do not ship a project without CI. Run this skill before first merge to main or when adding CI to an existing project.
9
+ > **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.
10
12
  >
11
13
  > **HARD GATE** — CI that is untestable locally will break every cycle. Always run `--validate` after generating workflows and `--dry-run` before pushing.
12
14
 
13
- Generate, validate, and test CI workflows. Detects your project type, copies org templates from `danielvm-git/.github/workflow-templates/`, and provides local verification to catch auth, permissions, and syntax issues before they reach CI.
15
+ Generate, validate, and test CI workflows. Detects the forge and project type, copies a **bundled** template, and verifies locally before anything reaches CI.
14
16
 
15
- ## What this sets up
17
+ ## Forge resolution
16
18
 
17
- 1. **Test Build Release workflow** — `.github/workflows/test-build-release.yml` with lint → test → build → release (single pipeline, `needs:` chain)
18
- 2. **Deploy workflow** — `.github/workflows/deploy.yml` triggered via `workflow_run` (BigBase/Pages stacks only; CLI/library repos omit this)
19
- 3. **`--validate` mode** — checks YAML syntax, workflow permissions, required secrets, and common pitfalls
20
- 4. **`--dry-run` mode** — runs workflows locally via `act` or `gh workflow run` to prove correctness before push
21
- 5. **Failure pattern documentation** — common CI failure categories and their fixes
19
+ `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`.
22
20
 
23
- ## Process
21
+ ```bash
22
+ bash scripts/wire-ci.sh --detect # report forge + stack, write nothing
23
+ bash scripts/wire-ci.sh --plan # show the template that would be used
24
+ bash scripts/wire-ci.sh --apply # write the workflow
25
+ ```
24
26
 
25
- ### 1. Detect project type
27
+ GitHub ships templates (`.github/workflows/`). GitLab, Bitbucket, Codeberg, and Gitea are detected but **unsupported** — `--apply` writes nothing and exits 3.
26
28
 
27
- Read the project root for manifest files to determine which template pair to copy:
29
+ ## Template source — configurable, bundled by default
28
30
 
29
- | Manifest | Type | Template pair (from `.github` repo) |
30
- |----------|------|-------------------------------------|
31
- | `Cargo.toml` | Rust | `test-build-release-monorepo.yml` + `deploy-monorepo.yml` (or monorepo subset) |
32
- | `package.json` | Node | `test-build-release-node.yml` + `deploy-node.yml` |
33
- | `setup.py` / `pyproject.toml` | Python | `test-build-release-python.yml` + `deploy-python.yml` |
34
- | `go.mod` | Go | `test-build-release-go.yml` + `deploy-go.yml` |
35
- | Static site (no server) | Static | `test-build-release-static.yml` + `deploy-static.yml` |
36
- | `Package.swift` | Swift | `test-build-release-swift.yml` only (no deploy yet) |
37
- | Multiple detected | Polyglot | `test-build-release-monorepo.yml` + `deploy-monorepo.yml` |
31
+ Templates 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`.
38
32
 
39
- **CLI/library repos** (no hosted target): copy only `test-build-release-<stack>.yml` → `test-build-release.yml`. The `release` job is terminal; skip `deploy.yml`. See `docs/how-to/migrate-ci-cd/migration-plan.md` § CLI and library repos.
33
+ ## What this sets up
40
34
 
41
- If no manifest is found, prompt the user to specify the type or pass `--type <rust|node|python|go|static|swift>`.
35
+ 1. **Test Build Release workflow** — lint → test → build → release in one `needs:` chain
36
+ 2. **`--validate` mode** — YAML syntax, workflow permissions, required secrets, common pitfalls
37
+ 3. **`--dry-run` mode** — runs workflows locally via `act` before push
38
+ 4. **Failure pattern documentation** — see the table below
42
39
 
43
- ### 2. Copy test-build-release template
40
+ Deploy workflows are **not** bundled: they are platform-specific. See [REFERENCE.md](REFERENCE.md) for a worked example.
44
41
 
45
- Copy the matching template from `~/Developer/.github/workflow-templates/` to `.github/workflows/test-build-release.yml`. **Do not rename the workflow `name:` field** — deploy listens for `"Test Build Release"`.
42
+ ## Process
43
+
44
+ ### 1. Detect forge and stack
45
+
46
+ ```bash
47
+ bash scripts/wire-ci.sh --detect
48
+ ```
46
49
 
47
- Edit placeholders: `APP_TYPE`, `SITE_URL`, language versions.
50
+ Stack detection reads the project root:
48
51
 
49
- See [REFERENCE.md](REFERENCE.md) for stack-specific job shapes.
52
+ | 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` |
50
58
 
51
- ### 3. Copy deploy template (hosted stacks only)
59
+ No recognized manifest → exit 3 with the list of manifests it looked for. Do not guess.
52
60
 
53
- If the project deploys to BigBase or GitHub Pages:
61
+ ### 2. Apply the template
54
62
 
55
63
  ```bash
56
- cp ~/Developer/.github/workflow-templates/deploy-${STACK}.yml .github/workflows/deploy.yml
64
+ bash scripts/wire-ci.sh --apply
57
65
  ```
58
66
 
59
- Configure `BIGBASE_SITE_ID`, `BIGBASE_DEPLOY_TOKEN`, and matching `SITE_URL`. Deploy runs via `workflow_run` after TBR succeeds on `main` with `cancel-in-progress: false`.
67
+ **Do not rename the workflow `name:` field** — deploy listens for `"Test Build Release"`.
60
68
 
61
- Skip this step for CLI/library repos.
69
+ Edit placeholders after copying: language versions, `APP_TYPE`, `SITE_URL`.
62
70
 
63
- ### 4. Validate workflows (`--validate`)
71
+ ### 3. Unsupported forges
64
72
 
65
- Run `wire-ci --validate` to check all generated workflow files:
73
+ `--apply` writes nothing and exits 3. Your options, in the order the runner prints them:
66
74
 
67
- See [REFERENCE.md](REFERENCE.md)
75
+ - point `BIGPOWERS_CI_TEMPLATES` at templates for your forge
76
+ - pin `forge: github` in `specs/forge.yaml` if the remote is misdetected
77
+ - write the CI config by hand
68
78
 
69
- **Exit codes:**
70
- - `0` — all checks pass (no errors)
71
- - `1` — YAML syntax errors found
72
- - `2` — validation warnings only (missing permissions, secrets, etc.)
79
+ Contributing 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.
73
80
 
74
- ### 5. Dry-run workflows (`--dry-run`)
81
+ ### 4. Validate workflows (`--validate`)
75
82
 
76
- Attempt to run the generated workflows locally to catch errors before push:
83
+ See [REFERENCE.md](REFERENCE.md). Exit codes: `0` clean, `1` YAML syntax errors, `2` warnings only.
84
+
85
+ ### 5. Dry-run workflows (`--dry-run`)
77
86
 
78
- See [REFERENCE.md](REFERENCE.md)
87
+ See [REFERENCE.md](REFERENCE.md).
79
88
 
80
89
  > **act** runs workflows in a local Docker environment — the most accurate pre-push validation.
81
- > **gh workflow run** sends the workflow to GitHub but doesn't execute locally — useful for checking YAML parsing but not for testing the actual steps.
90
+ > **gh workflow run** sends the workflow to GitHub but does not execute locally.
82
91
 
83
92
  ### 6. Document common CI failure patterns
84
93
 
85
- Add the following to the project's documentation or CLAUDE.md after setup:
86
-
87
94
  | Failure | Cause | Fix |
88
95
  |---------|-------|-----|
89
- | `npm publish` fails | `NPM_TOKEN` not set as repo secret | Add `NPM_TOKEN` to GitHub repo secrets |
90
- | `semantic-release` fails on push | Missing `permissions: contents: write` | Add `permissions: contents: write` to release job |
91
- | `cargo publish` auth fail | `CARGO_REGISTRY_TOKEN` not set | Add token to `~/.cargo/config.toml` or env |
92
- | `go vet` fails | Go version mismatch | Match `go.mod` `go` directive with setup-go version |
93
- | `cargo clippy` errors | New lints in Rust nightly | `cargo clippy --fix` or allow specific lints |
94
- | `act` not found | Docker not running or act not installed | `brew install act` / `docker ps` to verify Docker |
95
- | Hardcoded Node version stale | `.nvmrc` exists but workflow uses hardcoded version | Use `node-version-file: .nvmrc` instead |
96
- | Deploy never runs | TBR workflow renamed | Keep `name: Test Build Release` in test-build-release.yml |
97
- | Release rebuilds binary | Artifact not downloaded | `release` job must `download-artifact` from `build` |
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` |
98
105
 
99
106
  ## Verify
100
107
 
101
- → verify: `test -f skills/wire-ci/REFERENCE.md && test -f .github/workflows/sync-skills.yml`
108
+ → 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`
102
110
  → verify: `grep -q wire-ci SKILL-INDEX.md`
103
111
 
104
112
  ---
@@ -121,19 +129,26 @@ Add the following to the project's documentation or CLAUDE.md after setup:
121
129
  ### Create CI for a Go project (TBR + optional deploy)
122
130
 
123
131
  ```bash
124
- # Copy org templates
125
- cp ~/Developer/.github/workflow-templates/test-build-release-go.yml .github/workflows/test-build-release.yml
126
- cp ~/Developer/.github/workflow-templates/deploy-go.yml .github/workflows/deploy.yml
132
+ # Resolve forge + stack, then apply the bundled template
133
+ bash scripts/wire-ci.sh --detect
134
+ bash scripts/wire-ci.sh --apply
127
135
 
128
136
  wire-ci --validate
129
137
  wire-ci --dry-run
130
138
  ```
131
139
 
140
+ To use your own org templates instead of the bundled ones:
141
+
142
+ ```bash
143
+ BIGPOWERS_CI_TEMPLATES=/path/to/your/templates bash scripts/wire-ci.sh --apply
144
+ ```
145
+
132
146
  ### Create CI for a CLI tool (TBR only, no deploy)
133
147
 
134
148
  ```bash
135
- cp ~/Developer/.github/workflow-templates/test-build-release-go.yml .github/workflows/test-build-release.yml
149
+ bash scripts/wire-ci.sh --apply
136
150
  # Edit release job to download build artifact — see big-release dogfood
151
+ # CLI/library repos: delete deploy.yml; the release job is terminal.
137
152
 
138
153
  wire-ci --validate
139
154
  ```
@@ -277,6 +292,10 @@ jobs:
277
292
  github-token: ${{ secrets.GITHUB_TOKEN }}
278
293
  run-id: ${{ github.event.workflow_run.id }}
279
294
  path: deploy-meta
295
+ # BigBase-specific composite action, not a bigpowers default: this deploy
296
+ # example targets the author's own hosting stack. Replace it with your
297
+ # platform's deploy step (or drop the deploy job entirely for CLI and
298
+ # library repos). bigpowers itself ships no deploy templates. (GH #104)
280
299
  - uses: danielvm-git/.github/actions/bigbase-deploy@9c56ac10c629f3baa110ddb19136579e3c90d690 # v1
281
300
  with:
282
301
  site_id: ${{ secrets.BIGBASE_SITE_ID }}
@@ -58,6 +58,8 @@ Every **new detection rule** added to this skill MUST:
58
58
  |------|-----|------------------|------------------|
59
59
  | SQL injection | CWE-89 | `fixtures/CWE-89-sqli-positive.py` | `fixtures/CWE-89-sqli-negative.py` |
60
60
  | XSS (DOM) | CWE-79 | `fixtures/CWE-79-xss-positive.js` | `fixtures/CWE-79-xss-negative.js` |
61
+ | Missing tenant scoping (IDOR) | CWE-639 | `fixtures/CWE-639-idor-positive.go` | `fixtures/CWE-639-idor-negative.go` |
62
+ | Fail-open verify directive | CWE-754 | `fixtures/CWE-fail-open-verify-positive.sh` | `fixtures/CWE-fail-open-verify-negative.sh` |
61
63
 
62
64
  Before merging a new category, run both fixtures through the detection guidance and confirm positive flags / negative passes.
63
65
 
@@ -109,7 +111,7 @@ Each finding: **`File:Line` — Severity — Category**
109
111
 
110
112
  ## Verify
111
113
 
112
- → verify: `test -d specs/security && test -f scripts/lib/parallel-review-worktrees.sh && git rev-parse HEAD >/dev/null 2>&1`
114
+ → verify: `test -d specs/security && test -f scripts/lib/parallel-review-worktrees.sh && bash scripts/verify-cwe-fixture-sync.sh >/dev/null && git rev-parse HEAD >/dev/null 2>&1`
113
115
 
114
116
  ---
115
117
 
@@ -78,7 +78,7 @@ Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-te
78
78
 
79
79
  ## Verify
80
80
 
81
- → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && grep -qv 'See \[REFERENCE.md\]' skills/smoke-test/SKILL.md && echo OK`
81
+ → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && ! grep -q 'See \[REFERENCE.md\](REFERENCE.md)$' skills/smoke-test/SKILL.md && echo OK`
82
82
 
83
83
  ---
84
84