🐙 Git — Autonomous End-to-End Release & GitHub Lifecycle Engine
Aliases: git-flow | git-lifecycle | github-workflow | git-workflow | github-release
Autonomous, vendor-neutral Git and GitHub release orchestrator. Enforces the strict 4-Phase Branch Model (master production, dev staging, release/vX.Y.Z cuts, feature/* lanes), 9-tier anti-slop issue triage, automated documentation synchronization, GitHub SEO/metadata tuning, semantic release tagging, and post-release cleanup.
When to Use
Execute this skill when:
- Triage and classify incoming GitHub issues or bug reports before writing code.
- Starting feature or bugfix development that requires a clean branch from
dev.
- Preparing a pull request with verified test evidence, secret scanning, and automated doc updates.
- Optimizing GitHub repository SEO, topics, tags, descriptions, and README visual hierarchy.
- Cutting a production release: staging on
release/vX.Y.Z, merging into protected master, tagging with SemVer (vX.Y.Z), back-merging to dev, and publishing GitHub release notes.
- Cleaning up merged local and remote branches safely after a sprint or milestone.
Do NOT use this skill for:
- One-line scratch edits in untracked local exploration workspaces.
- Committing directly to
master (commits to master are strictly prohibited).
Quick Reference
The 11-Phase Lifecycle Protocol
┌─────────────────────────────────────────────────────────────────────────────┐
│ 11-PHASE LIFECYCLE PIPELINE │
├─────────────────────────────────────────────────────────────────────────────┤
│ 1. Issue Intake & 9-Tier Anti-Slop Triage │
│ 2. Feature Branch Creation from dev (feat/*, fix/*) │
│ 3. Surgical Code Edits & Local Gate (bun test, tsc, secret scan) │
│ 4. Documentation & Changelog Sync (updatedocs) │
│ 5. GitHub SEO, Open Graph & README Copywriting Pass │
│ 6. PR Creation Against dev with Evidence Receipt │
│ 7. Staging Integration & Merge into dev │
│ 8. Cut release/vX.Y.Z from dev & Bump package.json │
│ 9. Production Merge into master (no-ff) + Tag vX.Y.Z + GitHub Release │
│ 10. Back-Merge master into dev │
│ 11. Branch Cleanup & Linked Issue Closure │
└─────────────────────────────────────────────────────────────────────────────┘
9-Tier Anti-Slop Classification Matrix
| Classification |
Meaning |
Action |
actionable-bug |
Reproducible defect with clear error trace |
Create fix/* branch from dev |
actionable-feature |
Scoped request matching product roadmap |
Create feat/* branch from dev |
actionable-docs |
Missing, stale, or conflicting documentation |
Run updatedocs or docs/* branch |
duplicate |
Another issue/PR covers identical outcome |
Link canonical ticket; close duplicate |
spam-or-promotion |
Irrelevant marketing or malicious content |
Close immediately with summary note |
generated-slop |
Mechanically generated or ungrounded diffs |
Reject or demand narrow reproducer |
unsafe-or-secret |
Exposes tokens, keys, or exploit payloads |
Move to private path; redact secrets |
not-reproducible |
Lacks runtime environment or steps |
Request reproducer before writing code |
externally-blocked |
Blocked on external API or credential |
Defer with explicit unblock condition |
Branching Rules & Permissions
| Branch |
State |
Protection |
Allowed Source |
Allowed Target |
master |
Production |
Protected |
release/*, hotfix/* |
Deployment |
dev |
Staging |
Active Target |
feat/*, fix/*, master |
release/* |
feat/* |
Working |
Working branch |
dev |
dev |
fix/* |
Working |
Working branch |
dev |
dev |
release/* |
Staging |
Release branch |
dev |
master & dev |
hotfix/* |
Urgent |
Hotfix branch |
master |
master & dev |
Procedure
Phase 0: Workspace Security & Dynamic .gitignore Initialization
Before executing any Git operations or staging commits, verify workspace repository hygiene:
- Dynamic
.gitignore Seeding:if [ ! -f ".gitignore" ]; then
echo "🛡️ .gitignore missing. Seeding hardened Zero-Leakage template from ai-ready..."
TEMPLATE_PATH="$(git rev-parse --show-toplevel 2>/dev/null)/ai-ready/templates/gitignore.template"
if [ -f "$TEMPLATE_PATH" ]; then
cp "$TEMPLATE_PATH" .gitignore
else
cat > .gitignore << 'EOF'
.e[n]v
.e[n]v.*
!.e[n]v.example
node_modules/
dist/
build/
.worktrees/
worktrees/
.agents/
.gemini/
.claude/
.cursor/
.DS_Store
*.log
EOF
fi
git add .gitignore
git commit -m "chore(git): seed hardened zero-leakage .gitignore"
else
# Ensure worktrees directory is ignored
if ! git check-ignore -q .worktrees 2>/dev/null; then
echo -e "\n# Git Worktrees\n.worktrees/\nworktrees/" >> .gitignore
fi
fi
### Phase 1: Issue Intake & Anti-Slop Triage
1. View issue details using GitHub CLI:
```bash
gh issue view <issue-id>
- Classify against the 9-tier taxonomy.
- If non-actionable, comment with clear evidence and close or defer.
- If actionable, note the exact minimal scope and proceed to Phase 2.
Phase 2: Feature Branch Creation & Worktree Parallel Lanes
Choose the execution lane appropriate for your environment:
Option A: Worktree Parallel Lane (Recommended for Multi-Agent Workflows & Active Watchers)
Protects running dev servers (bun dev), file watchers, and parallel subagents from branch-switching churn:
- Detect Existing Isolation & Submodule Guard:
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
SUBMODULE=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
# If GIT_DIR != GIT_COMMON and no SUBMODULE, already in a worktree—work in place!
- Create Worktree Lane:
git checkout dev && git pull origin dev
git worktree add .worktrees/feat-<slug> -b feat/<issue-id>-<slug> dev
cd .worktrees/feat-<slug>
- Bootstrap & Verify Clean Baseline:
bun install || npm install || cargo check || true
bun test || npm test || cargo test
(For detailed worktree mechanics, see Worktree Parallel Lanes).
Option B: In-Place Working Tree Lane (Standard Single-Agent Fallback)
Used when sandboxing restricts worktrees or for simple isolated edits:
- Ensure working tree is clean and
dev is up to date:git checkout dev && git pull origin dev
git checkout -b feat/<issue-id>-<slug> dev
Phase 3: Surgical Implementation, Interactive Rebase & Local Verification Gate
- Implement the requested changes following the Surgical Changes Doctrine (touch only what is necessary; no unrequested refactors of adjacent code).
- Interactive Rebase & Atomic Commits:
- Execute the verification suite:
# Run tests
bun test
# Run type checks
tsc --noEmit
# Run pre-ship secret scan
bun ~/.config/LIFEOS/runtime/TOOLS/SecretScan.ts . 2>/dev/null || rg -i "ghp_|sk-[a-zA-Z0-9]{20,}|PRIVATE KEY" . || grep -riE "ghp_|sk-[a-zA-Z0-9]{20,}|PRIVATE KEY" . --exclude-dir={.git,node_modules,dist}
- Commit using Conventional Commits format:
git add -A
git commit -m "feat(<scope>): <imperative summary> (Closes #<issue-id>)"
Phase 4: Documentation Synchronization (updatedocs)
- Invoke
updatedocs to synchronize project context with new code behavior:# Update CHANGELOG.md under [Unreleased] following the High-Signal Feature Craft Standard
# (Section 4 in updatedocs/references/CHANGELOG-POLICY.md: thematic naming, multi-category, PR links)
# Synchronize .agents/context/current.md
- If docs were updated, commit:
git add CHANGELOG.md .agents/context/
git commit -m "docs(<scope>): update documentation and changelog"
Phase 5: GitHub SEO, Open Graph & Presentation Polish
- Audit and sync repository topics, description, and homepage:
gh repo edit --add-topic "ai-agents,developer-tools,agent-skills,devops,release-automation"
gh repo edit --description "Autonomous end-to-end Git release engine with anti-slop issue triage and automated doc sync."
- Verify social preview card exists in
assets/banner.svg or assets/banner.png.
- Check README visual layout against Refactoring UI standards (clean badges, scannable tables, crisp typography, copy-paste quickstart).
Phase 6: Pull Request Creation & Review Gate
- Push the branch to remote:
git push -u origin feat/<issue-id>-<slug>
- Open PR against
dev:gh pr create --base dev --title "feat(<scope>): <summary>" --body "$(cat << 'EOF'
### Summary
- Concise summary of changes.
### Verification Evidence
- [x] All automated tests pass (`bun test`).
- [x] Static type check passes (`tsc --noEmit`).
- [x] Pre-ship secret scan passed.
- [x] Documentation synchronized.
Closes #<issue-id>
EOF
)"
Phase 7: Staging Integration & Conflict Resolution Playbook (dev)
- Verify CI workflow passes:
gh pr checks
- Merge Conflict Resolution (If conflicts occur during staging):
- Scope Assessment:
git diff --name-only --diff-filter=U
- Rebase vs. Merge Decision: Rebase feature branches (
git rebase dev); never rebase or force-push shared branches (dev, master). Use --force-with-lease on feature branches.
- Emergency Abort & Code Extraction: If rebase loops or diverges catastrophically:
git rebase --abort 2>/dev/null || git merge --abort 2>/dev/null
git show feat/<slug>:path/to/file > /tmp/recovered-file
# Reset branch to latest dev, re-apply extracted files, test, and commit cleanly
- Reflog Safety Net: Recover lost states with
git reflog -n 25 and git checkout -b recovery-branch HEAD@{n}.
(For full details, see Conflict Resolution & Recovery Playbook).
- Merge PR into
dev using squash or linear rebase:gh pr merge --squash --delete-branch=false
git checkout dev && git pull origin dev
Phase 8: Cut Production Release Branch & Pre-Release Sanitization Gate
- Pre-Release Sanitization Gate:
- Sweep and purge uncommitted scratch files (
SESSION.md, planning/, screenshots/, test-*.ts, scratch/).
- Audit repository visibility and licensing:
VISIBILITY=$(gh repo view --json visibility -q '.visibility' 2>/dev/null || echo "UNKNOWN")
# Ensure private client repos carry proprietary notices and package.json has "private": true
- Synthetic ADE/IDE Artifact Sweep: Audit for and unwrap any synthetic ADE/IDE placeholders before release:
if rg "\[\[ORCA_RICH_MD|<antArtifact|\[cursor:|<<<windsurf" . --exclude-dir={.git,node_modules,dist,.worktrees}; then
echo "🚨 Synthetic ADE/IDE artifacts detected! Run 'bun ai-ready/scripts/ai-ready.ts . --sanitize' before release."
exit 1
fi
- Determine SemVer Version & Monorepo Tag Scoping:
(For sanitization & monorepo rules, see Monorepo & Sanitization Protocol).
- Cut release branch from updated
dev:git checkout -b release/vX.Y.Z dev
- Bump version in
package.json and stamp CHANGELOG.md with version and release date:
- Audit
CHANGELOG.md against the High-Signal Feature Craft Standard (updatedocs/references/CHANGELOG-POLICY.md).
- Append the comparison diff URL before the release divider:
**Full Changelog**: https://github.com/<owner>/<repo>/compare/v<PREV>...v<NEW>
- Commit release preparation:
git add package.json CHANGELOG.md
git commit -m "chore(release): vX.Y.Z"
Phase 9: Production Merge & Semantic Tagging
- Switch to
master and merge the release branch with --no-ff:git checkout master
git pull origin master
git merge --no-ff release/vX.Y.Z -m "Release: vX.Y.Z"
git push origin master
- Create annotated tag and push:
git tag -a vX.Y.Z -m "release: vX.Y.Z"
git push origin vX.Y.Z
- Create GitHub release with release notes:
gh release create vX.Y.Z --title "vX.Y.Z" --notes-file RELEASE_NOTES.md || gh release create vX.Y.Z --generate-notes
Phase 10: Back-Merge to dev
- Merge
master back into dev to keep staging strictly synchronized:git checkout dev
git merge master
git push origin dev
Phase 11: Safe Branch Pruning, Worktree Teardown & Issue Closure
- Delete local and remote feature/release branches safely:
git branch -d feat/<issue-id>-<slug>
git push origin --delete feat/<issue-id>-<slug> 2>/dev/null || true
git branch -d release/vX.Y.Z
git push origin --delete release/vX.Y.Z 2>/dev/null || true
- Safe Bulk Branch Pruning (Sweeps merged branches while protecting
dev, master, and main):git branch --merged dev | (rg -v '^\*|main|master|dev|develop' 2>/dev/null || grep -vE '^\*|main|master|dev|develop') | xargs -r git branch -d
git fetch --prune
- Worktree Teardown (If feature lane was executed in a worktree):
cd "$MAIN_REPO_ROOT"
git worktree remove .worktrees/feat-<slug> 2>/dev/null || true
git worktree prune
- Close linked issues with release receipts:
gh issue close <issue-id> --comment "Resolved and released in vX.Y.Z."
Pitfalls
- Never Commit Directly to
master: Direct commits to master violate production protection invariants. All changes must arrive via dev and release/*.
- Never Skip the Verification Gate: Merging unverified PRs introduces regressions and breaks staging pipelines. Always run tests and secret scans before opening or merging PRs.
- Never Leave Stale Branches: Unmerged or orphaned branches create cognitive clutter and trigger spurious merge conflicts. Clean up immediately after release.
- Never Include Unredacted Credentials: Scan diffs for
.env files, API keys (sk-*, ghp_*), and private tokens before pushing.
- No Vague Commit Messages: Messages like "fixes bug" or "updates" are strictly forbidden. Always use Conventional Commits with scope and rationale.
- Never Force-Push Shared Branches:
--force-with-lease is permissible only on isolated feature branches; force-pushing dev or master is catastrophic.
Verification
Before marking this skill complete, verify:
git status shows a clean working tree.
master and dev branch pointers are properly synchronized.
- Feature branch is cut strictly from
dev (in-place or via .worktrees/).
- Tests and secret scans pass cleanly.
- GitHub release is published with valid tag
vX.Y.Z (or {package}-vX.Y.Z in monorepos).
- Obsolete feature branches and worktrees have been deleted locally and remotely.
References
- 🌲 Worktree Parallel Lanes Protocol
- ⚔️ Merge Conflict Resolution & Git Recovery Playbook
- 📦 Monorepo Tagging & Pre-Release Sanitization Protocol
- 🌳 Branching, Commits & Release Matrix
- 🛡️ Anti-Slop Issue Intake Matrix
- 🎨 GitHub SEO & Open Graph Presentation Guide
- 📜 Changelog Policy & High-Signal Craft Standard
1---2name: git3description: Autonomous end-to-end Git & GitHub release engine: 9-tier anti-slop issue triage, strict 4-phase branching (dev/master/release/feat), surgical test gating, automated doc sync, PR review gates, GitHub SEO & Open Graph asset tuning, production release cuts with semver tagging, and branch cleanup. Trigger when asked to: 'manage git workflow', 'triage issues', 'create PR', 'release project', 'cut release', 'run git', 'sync github seo', or 'execute release lifecycle'.4license: MIT5---67# 🐙 Git — Autonomous End-to-End Release & GitHub Lifecycle Engine89> **Aliases**: `git-flow` | `git-lifecycle` | `github-workflow` | `git-workflow` | `github-release`1011Autonomous, vendor-neutral Git and GitHub release orchestrator. Enforces the strict **4-Phase Branch Model** (`master` production, `dev` staging, `release/vX.Y.Z` cuts, `feature/*` lanes), 9-tier anti-slop issue triage, automated documentation synchronization, GitHub SEO/metadata tuning, semantic release tagging, and post-release cleanup.1213---1415## When to Use1617Execute this skill when:18- Triage and classify incoming GitHub issues or bug reports before writing code.19- Starting feature or bugfix development that requires a clean branch from `dev`.20- Preparing a pull request with verified test evidence, secret scanning, and automated doc updates.21- Optimizing GitHub repository SEO, topics, tags, descriptions, and README visual hierarchy.22- Cutting a production release: staging on `release/vX.Y.Z`, merging into protected `master`, tagging with SemVer (`vX.Y.Z`), back-merging to `dev`, and publishing GitHub release notes.23- Cleaning up merged local and remote branches safely after a sprint or milestone.2425Do **NOT** use this skill for:26- One-line scratch edits in untracked local exploration workspaces.27- Committing directly to `master` (commits to `master` are strictly prohibited).2829---3031## Quick Reference3233### The 11-Phase Lifecycle Protocol3435```text36┌─────────────────────────────────────────────────────────────────────────────┐37│ 11-PHASE LIFECYCLE PIPELINE │38├─────────────────────────────────────────────────────────────────────────────┤39│ 1. Issue Intake & 9-Tier Anti-Slop Triage │40│ 2. Feature Branch Creation from dev (feat/*, fix/*) │41│ 3. Surgical Code Edits & Local Gate (bun test, tsc, secret scan) │42│ 4. Documentation & Changelog Sync (updatedocs) │43│ 5. GitHub SEO, Open Graph & README Copywriting Pass │44│ 6. PR Creation Against dev with Evidence Receipt │45│ 7. Staging Integration & Merge into dev │46│ 8. Cut release/vX.Y.Z from dev & Bump package.json │47│ 9. Production Merge into master (no-ff) + Tag vX.Y.Z + GitHub Release │48│ 10. Back-Merge master into dev │49│ 11. Branch Cleanup & Linked Issue Closure │50└─────────────────────────────────────────────────────────────────────────────┘51```5253### 9-Tier Anti-Slop Classification Matrix5455| Classification | Meaning | Action |56| :--- | :--- | :--- |57| `actionable-bug` | Reproducible defect with clear error trace | Create `fix/*` branch from `dev` |58| `actionable-feature` | Scoped request matching product roadmap | Create `feat/*` branch from `dev` |59| `actionable-docs` | Missing, stale, or conflicting documentation | Run `updatedocs` or `docs/*` branch |60| `duplicate` | Another issue/PR covers identical outcome | Link canonical ticket; close duplicate |61| `spam-or-promotion` | Irrelevant marketing or malicious content | Close immediately with summary note |62| `generated-slop` | Mechanically generated or ungrounded diffs | Reject or demand narrow reproducer |63| `unsafe-or-secret` | Exposes tokens, keys, or exploit payloads | Move to private path; redact secrets |64| `not-reproducible` | Lacks runtime environment or steps | Request reproducer before writing code |65| `externally-blocked`| Blocked on external API or credential | Defer with explicit unblock condition |6667### Branching Rules & Permissions6869| Branch | State | Protection | Allowed Source | Allowed Target |70| :--- | :--- | :--- | :--- | :--- |71| `master` | Production | Protected | `release/*`, `hotfix/*` | Deployment |72| `dev` | Staging | Active Target | `feat/*`, `fix/*`, `master` | `release/*` |73| `feat/*` | Working | Working branch | `dev` | `dev` |74| `fix/*` | Working | Working branch | `dev` | `dev` |75| `release/*` | Staging | Release branch | `dev` | `master` & `dev` |76| `hotfix/*` | Urgent | Hotfix branch | `master` | `master` & `dev` |7778---7980## Procedure8182### Phase 0: Workspace Security & Dynamic `.gitignore` Initialization83Before executing any Git operations or staging commits, verify workspace repository hygiene:841. **Dynamic `.gitignore` Seeding**:85 ```bash86 if [ ! -f ".gitignore" ]; then87 echo "🛡️ .gitignore missing. Seeding hardened Zero-Leakage template from ai-ready..."88 TEMPLATE_PATH="$(git rev-parse --show-toplevel 2>/dev/null)/ai-ready/templates/gitignore.template"89 if [ -f "$TEMPLATE_PATH" ]; then90 cp "$TEMPLATE_PATH" .gitignore91 else92 cat > .gitignore << 'EOF'93.e[n]v94.e[n]v.*95!.e[n]v.example96node_modules/97dist/98build/99.worktrees/100worktrees/101.agents/102.gemini/103.claude/104.cursor/105.DS_Store106*.log107EOF108 fi109 git add .gitignore110 git commit -m "chore(git): seed hardened zero-leakage .gitignore"111 else112 # Ensure worktrees directory is ignored113 if ! git check-ignore -q .worktrees 2>/dev/null; then114 echo -e "\n# Git Worktrees\n.worktrees/\nworktrees/" >> .gitignore115 fi116 fi117 ```118119### Phase 1: Issue Intake & Anti-Slop Triage1201. View issue details using GitHub CLI:121 ```bash122 gh issue view <issue-id>123 ```1242. Classify against the 9-tier taxonomy.1253. If non-actionable, comment with clear evidence and close or defer.1264. If actionable, note the exact minimal scope and proceed to Phase 2.127128### Phase 2: Feature Branch Creation & Worktree Parallel Lanes129Choose the execution lane appropriate for your environment:130131#### Option A: Worktree Parallel Lane (Recommended for Multi-Agent Workflows & Active Watchers)132Protects running dev servers (`bun dev`), file watchers, and parallel subagents from branch-switching churn:1331. **Detect Existing Isolation & Submodule Guard**:134 ```bash135 GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)136 GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)137 SUBMODULE=$(git rev-parse --show-superproject-working-tree 2>/dev/null)138 # If GIT_DIR != GIT_COMMON and no SUBMODULE, already in a worktree—work in place!139 ```1402. **Create Worktree Lane**:141 ```bash142 git checkout dev && git pull origin dev143 git worktree add .worktrees/feat-<slug> -b feat/<issue-id>-<slug> dev144 cd .worktrees/feat-<slug>145 ```1463. **Bootstrap & Verify Clean Baseline**:147 ```bash148 bun install || npm install || cargo check || true149 bun test || npm test || cargo test150 ```151*(For detailed worktree mechanics, see [Worktree Parallel Lanes](references/worktree-parallel-lanes.md)).*152153#### Option B: In-Place Working Tree Lane (Standard Single-Agent Fallback)154Used when sandboxing restricts worktrees or for simple isolated edits:1551. Ensure working tree is clean and `dev` is up to date:156 ```bash157 git checkout dev && git pull origin dev158 git checkout -b feat/<issue-id>-<slug> dev159 ```160161### Phase 3: Surgical Implementation, Interactive Rebase & Local Verification Gate1621. Implement the requested changes following the **Surgical Changes Doctrine** (touch only what is necessary; no unrequested refactors of adjacent code).1632. **Interactive Rebase & Atomic Commits**:164 - Keep commits atomic and self-contained.165 - Clean up intermediate checkpoint commits before pushing:166 ```bash167 git rebase -i dev # Squash fixups, clean up commit messages168 ```169 - When updating a remote feature branch, always use `--force-with-lease` (never bare `--force` and never on shared branches).1703. Execute the verification suite:171 ```bash172 # Run tests173 bun test174 # Run type checks175 tsc --noEmit176 # Run pre-ship secret scan177 bun ~/.config/LIFEOS/runtime/TOOLS/SecretScan.ts . 2>/dev/null || rg -i "ghp_|sk-[a-zA-Z0-9]{20,}|PRIVATE KEY" . || grep -riE "ghp_|sk-[a-zA-Z0-9]{20,}|PRIVATE KEY" . --exclude-dir={.git,node_modules,dist}178 ```1794. Commit using Conventional Commits format:180 ```bash181 git add -A182 git commit -m "feat(<scope>): <imperative summary> (Closes #<issue-id>)"183 ```184185### Phase 4: Documentation Synchronization (`updatedocs`)1861. Invoke `updatedocs` to synchronize project context with new code behavior:187 ```bash188 # Update CHANGELOG.md under [Unreleased] following the High-Signal Feature Craft Standard189 # (Section 4 in updatedocs/references/CHANGELOG-POLICY.md: thematic naming, multi-category, PR links)190 # Synchronize .agents/context/current.md191 ```1922. If docs were updated, commit:193 ```bash194 git add CHANGELOG.md .agents/context/195 git commit -m "docs(<scope>): update documentation and changelog"196 ```197198### Phase 5: GitHub SEO, Open Graph & Presentation Polish1991. Audit and sync repository topics, description, and homepage:200 ```bash201 gh repo edit --add-topic "ai-agents,developer-tools,agent-skills,devops,release-automation"202 gh repo edit --description "Autonomous end-to-end Git release engine with anti-slop issue triage and automated doc sync."203 ```2042. Verify social preview card exists in `assets/banner.svg` or `assets/banner.png`.2053. Check README visual layout against Refactoring UI standards (clean badges, scannable tables, crisp typography, copy-paste quickstart).206207### Phase 6: Pull Request Creation & Review Gate2081. Push the branch to remote:209 ```bash210 git push -u origin feat/<issue-id>-<slug>211 ```2122. Open PR against `dev`:213 ```bash214 gh pr create --base dev --title "feat(<scope>): <summary>" --body "$(cat << 'EOF'215 ### Summary216 - Concise summary of changes.217218 ### Verification Evidence219 - [x] All automated tests pass (`bun test`).220 - [x] Static type check passes (`tsc --noEmit`).221 - [x] Pre-ship secret scan passed.222 - [x] Documentation synchronized.223224 Closes #<issue-id>225 EOF226 )"227 ```228229### Phase 7: Staging Integration & Conflict Resolution Playbook (`dev`)2301. Verify CI workflow passes:231 ```bash232 gh pr checks233 ```2342. **Merge Conflict Resolution (If conflicts occur during staging)**:235 - **Scope Assessment**:236 ```bash237 git diff --name-only --diff-filter=U238 ```239 - **Rebase vs. Merge Decision**: Rebase feature branches (`git rebase dev`); never rebase or force-push shared branches (`dev`, `master`). Use `--force-with-lease` on feature branches.240 - **Emergency Abort & Code Extraction**: If rebase loops or diverges catastrophically:241 ```bash242 git rebase --abort 2>/dev/null || git merge --abort 2>/dev/null243 git show feat/<slug>:path/to/file > /tmp/recovered-file244 # Reset branch to latest dev, re-apply extracted files, test, and commit cleanly245 ```246 - **Reflog Safety Net**: Recover lost states with `git reflog -n 25` and `git checkout -b recovery-branch HEAD@{n}`.247 *(For full details, see [Conflict Resolution & Recovery Playbook](references/conflict-resolution-and-recovery.md)).*2483. Merge PR into `dev` using squash or linear rebase:249 ```bash250 gh pr merge --squash --delete-branch=false251 git checkout dev && git pull origin dev252 ```253254### Phase 8: Cut Production Release Branch & Pre-Release Sanitization Gate2551. **Pre-Release Sanitization Gate**:256 - Sweep and purge uncommitted scratch files (`SESSION.md`, `planning/`, `screenshots/`, `test-*.ts`, `scratch/`).257 - Audit repository visibility and licensing:258 ```bash259 VISIBILITY=$(gh repo view --json visibility -q '.visibility' 2>/dev/null || echo "UNKNOWN")260 # Ensure private client repos carry proprietary notices and package.json has "private": true261 ```262 - **Synthetic ADE/IDE Artifact Sweep**: Audit for and unwrap any synthetic ADE/IDE placeholders before release:263 ```bash264 if rg "\[\[ORCA_RICH_MD|<antArtifact|\[cursor:|<<<windsurf" . --exclude-dir={.git,node_modules,dist,.worktrees}; then265 echo "🚨 Synthetic ADE/IDE artifacts detected! Run 'bun ai-ready/scripts/ai-ready.ts . --sanitize' before release."266 exit 1267 fi268 ```2692. **Determine SemVer Version & Monorepo Tag Scoping**:270 - Auto-detect monorepo (`pnpm-workspace.yaml`, `packages/`, `lerna.json`, `turbo.json`):271 - Monorepo format: `{package-name}-v{semver}`272 - Standard single package: `v{semver}`273 - **Tag Pre-Existence Gate**:274 ```bash275 if git tag -l "$TAG_NAME" | (rg -q "^${TAG_NAME}$" 2>/dev/null || grep -q "^${TAG_NAME}$"); then276 echo "🚨 Tag $TAG_NAME already exists! Bump version in package.json."277 exit 1278 fi279 ```280 *(For sanitization & monorepo rules, see [Monorepo & Sanitization Protocol](references/monorepo-and-sanitization.md)).*2813. Cut release branch from updated `dev`:282 ```bash283 git checkout -b release/vX.Y.Z dev284 ```2854. Bump version in `package.json` and stamp `CHANGELOG.md` with version and release date:286 - Audit `CHANGELOG.md` against the High-Signal Feature Craft Standard (`updatedocs/references/CHANGELOG-POLICY.md`).287 - Append the comparison diff URL before the release divider:288 `**Full Changelog**: https://github.com/<owner>/<repo>/compare/v<PREV>...v<NEW>`2895. Commit release preparation:290 ```bash291 git add package.json CHANGELOG.md292 git commit -m "chore(release): vX.Y.Z"293 ```294295### Phase 9: Production Merge & Semantic Tagging2961. Switch to `master` and merge the release branch with `--no-ff`:297 ```bash298 git checkout master299 git pull origin master300 git merge --no-ff release/vX.Y.Z -m "Release: vX.Y.Z"301 git push origin master302 ```3032. Create annotated tag and push:304 ```bash305 git tag -a vX.Y.Z -m "release: vX.Y.Z"306 git push origin vX.Y.Z307 ```3083. Create GitHub release with release notes:309 ```bash310 gh release create vX.Y.Z --title "vX.Y.Z" --notes-file RELEASE_NOTES.md || gh release create vX.Y.Z --generate-notes311 ```312313### Phase 10: Back-Merge to `dev`3141. Merge `master` back into `dev` to keep staging strictly synchronized:315 ```bash316 git checkout dev317 git merge master318 git push origin dev319 ```320321### Phase 11: Safe Branch Pruning, Worktree Teardown & Issue Closure3221. Delete local and remote feature/release branches safely:323 ```bash324 git branch -d feat/<issue-id>-<slug>325 git push origin --delete feat/<issue-id>-<slug> 2>/dev/null || true326 git branch -d release/vX.Y.Z327 git push origin --delete release/vX.Y.Z 2>/dev/null || true328 ```3292. **Safe Bulk Branch Pruning** (Sweeps merged branches while protecting `dev`, `master`, and `main`):330 ```bash331 git branch --merged dev | (rg -v '^\*|main|master|dev|develop' 2>/dev/null || grep -vE '^\*|main|master|dev|develop') | xargs -r git branch -d332 git fetch --prune333 ```3343. **Worktree Teardown** (If feature lane was executed in a worktree):335 ```bash336 cd "$MAIN_REPO_ROOT"337 git worktree remove .worktrees/feat-<slug> 2>/dev/null || true338 git worktree prune339 ```3404. Close linked issues with release receipts:341 ```bash342 gh issue close <issue-id> --comment "Resolved and released in vX.Y.Z."343 ```344345---346347## Pitfalls348349- **Never Commit Directly to `master`**: Direct commits to `master` violate production protection invariants. All changes must arrive via `dev` and `release/*`.350- **Never Skip the Verification Gate**: Merging unverified PRs introduces regressions and breaks staging pipelines. Always run tests and secret scans before opening or merging PRs.351- **Never Leave Stale Branches**: Unmerged or orphaned branches create cognitive clutter and trigger spurious merge conflicts. Clean up immediately after release.352- **Never Include Unredacted Credentials**: Scan diffs for `.env` files, API keys (`sk-*`, `ghp_*`), and private tokens before pushing.353- **No Vague Commit Messages**: Messages like "fixes bug" or "updates" are strictly forbidden. Always use Conventional Commits with scope and rationale.354- **Never Force-Push Shared Branches**: `--force-with-lease` is permissible only on isolated feature branches; force-pushing `dev` or `master` is catastrophic.355356---357358## Verification359360Before marking this skill complete, verify:3611. `git status` shows a clean working tree.3622. `master` and `dev` branch pointers are properly synchronized.3633. Feature branch is cut strictly from `dev` (in-place or via `.worktrees/`).3644. Tests and secret scans pass cleanly.3655. GitHub release is published with valid tag `vX.Y.Z` (or `{package}-vX.Y.Z` in monorepos).3666. Obsolete feature branches and worktrees have been deleted locally and remotely.367368---369370## References371372- 🌲 [Worktree Parallel Lanes Protocol](references/worktree-parallel-lanes.md)373- ⚔️ [Merge Conflict Resolution & Git Recovery Playbook](references/conflict-resolution-and-recovery.md)374- 📦 [Monorepo Tagging & Pre-Release Sanitization Protocol](references/monorepo-and-sanitization.md)375- 🌳 [Branching, Commits & Release Matrix](references/branching-and-release-matrix.md)376- 🛡️ [Anti-Slop Issue Intake Matrix](references/anti-slop-triage.md)377- 🎨 [GitHub SEO & Open Graph Presentation Guide](references/github-seo-and-presentation.md)378- 📜 [Changelog Policy & High-Signal Craft Standard](../updatedocs/references/CHANGELOG-POLICY.md)