Windsurf rules
.windsurf/rules/release-branch.mdMake the merge/PR/keep/discard decision for a feature branch, verify coverage gates, create the PR with gh, and clean up the worktree. Use when a feature is done and ready to ship, or when user says "release", "merge", or "open a PR".
Windsurf rules
Quality
74/100
Scores the file, not the repository.Length
1,399 words
42 headings · 11 code blocksRepository
114
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1234567<!-- story: e38s07 -->8<!-- story: e45s15 -->9<!-- story: e45s32 -->10<!-- story: e45s39 -->11<!-- story: e20s02 -->121314# Release Branch1516> **HARD GATE** — Do NOT merge or release if tests fail or if coverage gates are not met. If the branch is red, return to `develop-tdd` to fix regressions or add missing tests before proceeding.1718Finalize a completed feature branch: verify coverage gates, integrate onto `main`, and clean up the worktree.1920## Additional modes21- `--hotfix`: Cherry-pick to main + tag. Skip PR in solo.22- `--squash-state`: Squash `chore(state):` commits before merge.2324## Integrate mode2526Read `specs/state.yaml` key `workflow_mode` (`team-pr` | `solo-git`). Fall back to `profiles/solo-git.md`.2728| Mode | When | Ship path |29|------|------|-----------|30| **solo-local** | `workflow_mode: solo-git` | Auto: `scripts/land-branch.sh` if present, else fallback (Step 5) |31| **team-pr** | `workflow_mode: team-pr` (default) | `gh pr create` → `gh pr merge --squash` |3233If unsure, prefer **solo-local**.3435## Process3637> **Timing:** `bash scripts/bp-timing.sh start release-branch` at invocation; `bash scripts/bp-timing.sh end release-branch` before handoff.3839### 1. Final verification4041```bash42<full test command> && <typecheck command> && <lint command>43git log main...HEAD --oneline | grep -vE "^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ Non-conventional commits found" || echo "✅ Commits verified"44# Block AI agent attribution (P1)45git log main...HEAD --format="%B" | grep -qiE 'co[- ]authored[- ]by' && echo "❌ Co-authored-by footer found — blocked" || echo "✅ No AI attribution"46```4748- [ ] All tests pass, no type errors, no lint violations, all commits follow Conventional Commits49- [ ] **NO `Co-authored-by` or `Co-Authored-By`** in any commit body — P1 rule (CONVENTIONS.md § Git Attribution). `land-branch.sh` blocks the merge if found.5051### 2. Coverage check5253- [ ] Overall coverage ≥ 80%; business logic coverage ≥ 95%5455### 2a. Security gate5657- [ ] `specs/security/REVIEW.md` exists and is fresh (matches current branch diff)58- [ ] No unresolved HIGH findings with confidence ≥ 8 (or all documented in `specs/security/EXCEPTIONS.md` with sign-off rationale)5960If REVIEW.md is missing or stale → run `security-review` inline. Findings block the merge unless documented in EXCEPTIONS.md.6162### 2b. Traceability gate6364Run `gate-trace` before merge. FAIL blocks merge; CONCERNS requires explicit override in `specs/state.yaml` (`traceability_override: CONCERNS accepted, reason: <explanation>`). WAIVED if no matrix available.6566> **Adversarial refute framing (e45s32):** The final pre-merge check is **refute, not rubber-stamp**. Before declaring ready, actively try to disprove traceability completeness — missing story tags, absent verify evidence, stale security review. Only proceed when refutation fails.6768### 3. Diff review6970- [ ] All commits intentional, no secrets, CONVENTIONS.md compliance7172### 4. Decision7374Options: **Release (solo-local)** / **Open PR** / **Keep branch** / **Discard**7576### 5. Solo-local integrate7778Run `commit-message` for the squash subject, then land:7980```bash81# Path A (preferred):82bash scripts/land-branch.sh <task-slug> "feat(scope): description"83# Path B (fallback if land-branch.sh missing): see REFERENCE.md84```8586### 6. Create PR (team-pr only)8788Create the pull request with a **literal provenance marker** in the body so agent-generated PRs are identifiable and do not rot silently:8990```markdown91<!-- bigpowers-provenance: agent-generated -->92```9394Place the marker on its own line immediately after the `## Summary` heading. Then merge via `gh`:9596```bash97gh pr create --title "..." --body "$(cat <<'EOF'98## Summary99<!-- bigpowers-provenance: agent-generated -->100101- ...102103## Test plan104- [ ] ...105106EOF107)"108gh pr merge --squash --delete-branch109```110111`semantic-release` auto-detects the commit, bumps SemVer, tags the repo, generates release notes.112113### 7a. Archive completed epic capsule114115> **HARD GATE** — When all epic stories are done (all `done` in `execution-status.yaml`), archive the capsule:116117```bash118mv specs/epics/eNN-slug specs/epics/archive/119```120121### 7b. CI verification & agent lock release (e39s02)122123> **HARD GATE** — Do NOT declare success until CI completes. **Three-independent-facts** (e45s15): commit landed, workflow green, registry visible — see [REFERENCE.md](REFERENCE.md#three-independent-facts-release).124125```bash126bash scripts/wait-for-ci.sh --timeout 600 --interval 30127```128129- [ ] CI passes; `release.ci_verified: true` in state.yaml130- On failure: `handoff.next_skill = fix-bug`131132### 8. Clean up & return133134Worktree prune, branch delete, `git checkout main`. Cycle-time: see [REFERENCE.md](REFERENCE.md#cycle-time).135136Report: "Branch released."137138## Verify139140→ verify: `command -v gh >/dev/null 2>&1 && test -f specs/state.yaml && test -d skills/verify-work`141142---143144# Release Branch — Reference145146## Navigation147148| Lines | Section |149|-------|---------|150| 1 | Title |151| 3–22 | Navigation |152| 23–31 | PR body template (team-pr mode) |153| 32–35 | Summary |154| 36–41 | Verify |155| 42–47 | specs/ artifacts |156| 48–58 | Worktree cleanup details |157| 59–81 | Cycle-time recording |158| 82–100 | Why not story_start minus story_end? |159| 101–121 | CI verification |160| 122–127 | Solo-local fallback detail |161| 128–134 | Handoff |162| 135–159 | Reference block 1 |163164# Release Branch — Reference165166## PR body template (team-pr mode)167168```bash169PR_TITLE="<type>(<scope>): <description>"170echo "$PR_TITLE" | grep -vE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ ERROR: PR Title must follow Conventional Commits"171172gh pr create \173 --title "$PR_TITLE" \174 --body "$(cat <<'EOF'175## Summary176- [What this PR does]177- [Key decisions made]178179## Verify180- [ ] All tests pass181- [ ] Coverage gates met (≥80% overall, ≥95% business logic)182- [ ] CONVENTIONS.md compliance verified183- [ ] PR Title follows Conventional Commits (for automated release)184185## specs/ artifacts186- [List any specs/ files produced or updated]187EOF188)"189```190191## Worktree cleanup details192193```bash194# From the main repo root195git worktree prune196git worktree remove ../<branch-name> 2>/dev/null || true197git branch -d <branch-name>198```199200If `git worktree remove` fails due to uncommitted changes, ask: "There are uncommitted changes in the worktree. Force remove? (y/n)". If yes: `git worktree remove -f ../<branch-name>`.201202## Cycle-time recording203204After landing the branch, record delivery metrics using the git-derived,205additive script (replaces hand-arithmetic):206207```bash208bash scripts/record-cycle-time.sh append \209 --story <story_id> --bcps <bcps> \210 --range "$(git merge-base main HEAD)..HEAD" \211 --file specs/metrics/cycle-times.yaml212```213214This appends a row to the cycle-times ledger with two separated metrics:215216- **effort_hours** — ADDITIVE. Idle-stripped estimated effort from git commit217 history (git-hours model: 120-min session threshold, 120-min first-commit pad).218 Sums exactly to whole-repo effort. NO hand-arithmetic, NO wall-clock includes.219- **lead_time_minutes** — calendar latency from first commit to merge.220 Median-aggregated across stories; NEVER summed.221222The script also runs an additivity self-check: Σ(story effort) == whole-repo effort223within rounding tolerance.224225### Why not story_start minus story_end?226227The previous hand-arithmetic approach (survey-context writes `story_start`,228release-branch writes `story_end`, agent hand-computes `cycle_minutes`) was229retired because:2302311. It was **agent-self-reported** — trivially fabricated or mis-subtracted.2322. Wall-clock included **overnight/weekend/UAT gaps** — calendar latency,233 not coding effort.2343. The `bcp_per_hour` metric was **computationally meaningless** (velocity235 derived from a latency measurement).236237The new approach derives effort from commit history (objective, reproducible)238and lead time from first commit → merge (honest calendar latency). See239`docs/references/bcp.md` for BCP sizing context and240`scripts/record-cycle-time.sh` for the full algorithm.241242---243244## CI verification245246The CI polling logic has been extracted to `scripts/wait-for-ci.sh`.247See the script's `--help` for usage. Step 7b of the main SKILL.md invokes it directly:248249```bash250bash scripts/wait-for-ci.sh --timeout 600 --interval 30251```252253**Exit codes:**254- **0** — all workflows green. Set `release.ci_verified: true` in state.yaml.255- **1** — at least one workflow failed. Prints failure URLs. Set `handoff.next_skill = fix-bug`.256- **2** — timeout. CI did not complete. Retry or investigate.257- **0 with warning** — `gh` CLI not available, git-only fallback confirmed push landed but CI status unverified.258259The script handles: auto-discovery of all workflows for the current260branch/commit, polling until completion, success/failure/timeout exit codes,261and git-only fallback when `gh` CLI is unavailable.262263---264265## Solo-local fallback detail266267The fallback sequence (Path B above) handles the "remote has moved" case with `git pull --rebase`. Use when `scripts/land-branch.sh` is absent.268269**Acceptance:** When fallback runs, main is updated, feature branch is deleted locally, and output states `"used fallback merge (land-branch.sh not found)"`.270271## Handoff272273Gate: READY -> next: survey-context274Writes: state.yaml handoff.next_skill = survey-context275276---277278## Reference block 1279280```bash281# Fallback: manual squash-merge when land-branch.sh is absent282FEATURE_BRANCH=<task-slug>283DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo main)284285# Ensure we're on the feature branch286if [ "$(git branch --show-current)" != "$FEATURE_BRANCH" ]; then287 git checkout "$FEATURE_BRANCH"288fi289290# Checkout default branch and update291git checkout "$DEFAULT_BRANCH"292git pull --rebase origin "$DEFAULT_BRANCH" 2>/dev/null || git pull origin "$DEFAULT_BRANCH"293294# Squash-merge the feature branch295git merge --no-ff "$FEATURE_BRANCH" -m "<conventional-commit-message>"296297# Push298git push origin "$DEFAULT_BRANCH"299300# Clean up local feature branch301git branch -d "$FEATURE_BRANCH"302```303
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 |
