$npx -y skills add jezweb/claude-skills --skill github-releasePrepare and publish GitHub releases. Sanitizes code for public release (secrets scan, personal artifacts, LICENSE/README validation), creates version tags, and publishes via gh CLI. Trigger with 'release', 'publish', 'open source', 'prepare for release', 'create release', or 'git
| 1 | # GitHub Release |
| 2 | |
| 3 | Sanitize and release projects to GitHub. Two-phase workflow: safety checks first, then tag and publish. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | - `gh` CLI installed and authenticated (`gh auth status`) |
| 8 | - `gitleaks` installed for secrets scanning (`brew install gitleaks` or download from GitHub) |
| 9 | - Git repository with a remote configured |
| 10 | |
| 11 | ## Workflow |
| 12 | |
| 13 | ### Phase 1: Sanitize |
| 14 | |
| 15 | Run these checks before any public release. Stop on blockers. |
| 16 | |
| 17 | #### 1. Scan for Secrets (BLOCKER) |
| 18 | |
| 19 | ```bash |
| 20 | gitleaks detect --no-git --source=. --verbose |
| 21 | ``` |
| 22 | |
| 23 | If secrets found: **STOP**. Remove secrets, move to environment variables. Check git history with `git log -S "secret_value"` — if in history, use BFG Repo-Cleaner. |
| 24 | |
| 25 | If gitleaks not installed, do manual checks: |
| 26 | |
| 27 | ```bash |
| 28 | # Check for .env files |
| 29 | find . -name ".env*" -not -path "*/node_modules/*" |
| 30 | |
| 31 | # Check config files for hardcoded secrets |
| 32 | grep -ri "api_key\|token\|secret\|password" wrangler.toml wrangler.jsonc .dev.vars 2>/dev/null |
| 33 | ``` |
| 34 | |
| 35 | #### 2. Remove Personal Artifacts |
| 36 | |
| 37 | Check for and remove session/planning files that shouldn't be published: |
| 38 | |
| 39 | - `SESSION.md` — session state |
| 40 | - `planning/`, `screenshots/` — working directories |
| 41 | - `test-*.ts`, `test-*.js` — local test files |
| 42 | |
| 43 | Either delete them or add to `.gitignore`. |
| 44 | |
| 45 | #### 3. Validate LICENSE |
| 46 | |
| 47 | ```bash |
| 48 | ls LICENSE LICENSE.md LICENSE.txt 2>/dev/null |
| 49 | ``` |
| 50 | |
| 51 | If missing: create one. Check the repo visibility (`gh repo view --json visibility -q '.visibility'`). Use MIT for public repos. For private repos, consider a proprietary license instead. |
| 52 | |
| 53 | #### 4. Validate README |
| 54 | |
| 55 | Check README exists and has basic sections: |
| 56 | |
| 57 | ```bash |
| 58 | grep -i "## Install\|## Usage\|## License" README.md |
| 59 | ``` |
| 60 | |
| 61 | If missing sections, add them before release. |
| 62 | |
| 63 | #### 5. Check .gitignore |
| 64 | |
| 65 | Verify essential patterns are present: |
| 66 | |
| 67 | ```bash |
| 68 | grep -E "node_modules|\.env|dist/|\.dev\.vars" .gitignore |
| 69 | ``` |
| 70 | |
| 71 | #### 6. Build Test (non-blocking) |
| 72 | |
| 73 | ```bash |
| 74 | npm run build 2>&1 |
| 75 | ``` |
| 76 | |
| 77 | #### 7. Dependency Audit (non-blocking) |
| 78 | |
| 79 | ```bash |
| 80 | npm audit --audit-level=high |
| 81 | ``` |
| 82 | |
| 83 | #### 8. Create Sanitization Commit |
| 84 | |
| 85 | If any changes were made during sanitization: |
| 86 | |
| 87 | ```bash |
| 88 | git add -A |
| 89 | git commit -m "chore: prepare for release" |
| 90 | ``` |
| 91 | |
| 92 | ### Phase 2: Release |
| 93 | |
| 94 | #### 1. Determine Version |
| 95 | |
| 96 | Check `package.json` for current version, or ask the user. Ensure version starts with `v` prefix. |
| 97 | |
| 98 | #### 2. Check Tag Doesn't Exist |
| 99 | |
| 100 | ```bash |
| 101 | git tag -l "v[version]" |
| 102 | ``` |
| 103 | |
| 104 | If it exists, ask user whether to delete and recreate or use a different version. |
| 105 | |
| 106 | #### 3. Show What's Being Released |
| 107 | |
| 108 | ```bash |
| 109 | LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") |
| 110 | if [ -z "$LAST_TAG" ]; then |
| 111 | git log --oneline --no-merges HEAD | head -20 |
| 112 | else |
| 113 | git log --oneline --no-merges ${LAST_TAG}..HEAD |
| 114 | fi |
| 115 | ``` |
| 116 | |
| 117 | #### 4. Create Tag and Push |
| 118 | |
| 119 | ```bash |
| 120 | git tag -a v[version] -m "Release v[version]" |
| 121 | git push origin $(git branch --show-current) |
| 122 | git push origin --tags |
| 123 | ``` |
| 124 | |
| 125 | #### 5. Create GitHub Release |
| 126 | |
| 127 | ```bash |
| 128 | gh release create v[version] \ |
| 129 | --title "Release v[version]" \ |
| 130 | --notes "[auto-generated from commits]" |
| 131 | ``` |
| 132 | |
| 133 | For pre-releases add `--prerelease`. For drafts add `--draft`. |
| 134 | |
| 135 | #### 6. Report |
| 136 | |
| 137 | Show the user: |
| 138 | - Release URL |
| 139 | - Next steps (npm publish if applicable, announcements) |
| 140 | |
| 141 | ## Reference Files |
| 142 | |
| 143 | | When | Read | |
| 144 | |------|------| |
| 145 | | Detailed safety checks | [references/safety-checklist.md](references/safety-checklist.md) | |
| 146 | | Release mechanics | [references/release-workflow.md](references/release-workflow.md) | |