modules/programs/agents/shared/skills/init-homebrew/SKILL.md
Set up Homebrew releases for a Bun/TypeScript CLI project
npx skillsauth add MichaelVessia/nixos-config init-homebrewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Initialize a project for multi-platform releases via GitHub Actions with automatic Homebrew tap updates. Creates release workflow, sets up secrets, and updates READMEs.
$ARGUMENTS - Optional flags:
--dry-run: Show what would be created without making changes--skip-readme: Don't update project README with install instructionsgh CLI authenticatedMichaelVessia/homebrew-tapgit rev-parse --show-toplevel
git remote get-url origin
Extract:
PROJECT_NAME: from package.json name field (strip scope like @foo/)GITHUB_REPO: owner/repo from git remoteDESCRIPTION: from package.json description or prompt userENTRYPOINT: detect main entry (check for src/main.ts, src/index.ts, packages/*/src/main.ts, etc.)Check package.json for version field. If missing, add "version": "0.1.0".
Create .github/workflows/release.yml:
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install
- name: Typecheck
run: bun run typecheck
- name: Lint
run: bun run lint
- name: Test
run: bun test
- name: Build all targets
run: |
mkdir -p dist
bun build ${ENTRYPOINT} --compile --target=bun-linux-x64 --outfile dist/${PROJECT_NAME}-linux-x64
bun build ${ENTRYPOINT} --compile --target=bun-darwin-x64 --outfile dist/${PROJECT_NAME}-darwin-x64
bun build ${ENTRYPOINT} --compile --target=bun-darwin-arm64 --outfile dist/${PROJECT_NAME}-darwin-arm64
- name: Create checksums
run: |
cd dist
sha256sum * > checksums.txt
- name: Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
- name: Update Homebrew tap
env:
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
VERSION=${GITHUB_REF#refs/tags/v}
# ... (generate formula and push to tap)
Check if HOMEBREW_TAP_TOKEN exists:
gh secret list --repo ${GITHUB_REPO}
If not present, prompt user to add it:
Secret HOMEBREW_TAP_TOKEN not found.
Run: gh secret set HOMEBREW_TAP_TOKEN --repo ${GITHUB_REPO}
(Paste your GitHub PAT with 'repo' scope)
Wait for user confirmation before proceeding.
Fetch current README from MichaelVessia/homebrew-tap, add new formula entry to the table if not present:
| [${PROJECT_NAME}](https://github.com/${GITHUB_REPO}) | ${DESCRIPTION} |
Use GitHub API to update:
gh api repos/MichaelVessia/homebrew-tap/contents/README.md --method PUT ...
Unless --skip-readme, add/update Installation section with:
## Installation
### Homebrew (macOS)
\`\`\`bash
brew tap MichaelVessia/tap
brew install ${PROJECT_NAME}
\`\`\`
### Download Binary
\`\`\`bash
# macOS ARM64 (Apple Silicon)
curl -L https://github.com/${GITHUB_REPO}/releases/latest/download/${PROJECT_NAME}-darwin-arm64 -o ${PROJECT_NAME}
chmod +x ${PROJECT_NAME} && mv ${PROJECT_NAME} /usr/local/bin/
# macOS x64 (Intel)
curl -L https://github.com/${GITHUB_REPO}/releases/latest/download/${PROJECT_NAME}-darwin-x64 -o ${PROJECT_NAME}
chmod +x ${PROJECT_NAME} && mv ${PROJECT_NAME} /usr/local/bin/
# Linux x64
curl -L https://github.com/${GITHUB_REPO}/releases/latest/download/${PROJECT_NAME}-linux-x64 -o ${PROJECT_NAME}
chmod +x ${PROJECT_NAME} && sudo mv ${PROJECT_NAME} /usr/local/bin/
\`\`\`
git add package.json .github/workflows/release.yml README.md
git commit -m "feat: add multi-platform packaging with GitHub releases and Homebrew"
git push
Homebrew release setup complete!
Created:
- .github/workflows/release.yml
- Updated package.json with version field
- Updated README.md with install instructions
- Added ${PROJECT_NAME} to homebrew-tap README
Next steps:
1. Run '/release' to create first release
2. Install via: brew tap MichaelVessia/tap && brew install ${PROJECT_NAME}
The Homebrew formula generated in the workflow:
class ${CLASS_NAME} < Formula
desc "${DESCRIPTION}"
homepage "https://github.com/${GITHUB_REPO}"
version "${VERSION}"
license "MIT"
on_macos do
on_arm do
url "https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}/${PROJECT_NAME}-darwin-arm64"
sha256 "${SHA_DARWIN_ARM64}"
end
on_intel do
url "https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}/${PROJECT_NAME}-darwin-x64"
sha256 "${SHA_DARWIN_X64}"
end
end
on_linux do
on_intel do
url "https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}/${PROJECT_NAME}-linux-x64"
sha256 "${SHA_LINUX_X64}"
end
end
def install
if OS.mac?
bin.install "${PROJECT_NAME}-darwin-#{Hardware::CPU.arm? ? "arm64" : "x64"}" => "${PROJECT_NAME}"
else
bin.install "${PROJECT_NAME}-linux-x64" => "${PROJECT_NAME}"
end
end
test do
assert_match "${PROJECT_NAME}", shell_output("#{bin}/${PROJECT_NAME} --help")
end
end
If project has specific env vars (detected from .env.example, README.md, or config files), add a caveats block to the formula prompting users to configure them.
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Turn an idea or objective into a goal package for /goal. Interviews the user, builds a reviewed fact sheet via Plannotator, then explores the codebase to produce an execution plan.
development
Open Plannotator's browser-based code review UI for the current worktree or a pull request URL, then act on the feedback that comes back.
testing
Open Plannotator on the latest rendered assistant message and use the returned annotations to revise that message or continue.