Skip to main content
skill CX Codex

homebrew-formula-maintenance — Claude Code skill: setup & usage

Automates Homebrew formula updates for Python CLIs. It syncs PyPI releases, updates archive hashes, refreshes dependency resources, and runs tap audits.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add bobmatnyc/claude-mpm-skills --skill homebrew-formula-maintenance -a claude-code
Open on GitHub

What homebrew-formula-maintenance does

This skill guides formula maintenance across custom Homebrew taps for Python tools. It details how to pull sdist URLs from the PyPI JSON API and update formula checksums alongside dependency resource blocks.

Verification relies on native Homebrew commands: brew install --build-from-source, brew test, brew audit --strict, and brew style. Automated CI runs use update_homebrew_formula.py, which requires a valid HOMEBREW_TAP_TOKEN secret. Without an existing PyPI release, the process fails on missing sdist archives or hash validation errors.

What it helps with

  • Update package URL and SHA256 checksums in Homebrew formulas after PyPI releases
  • Regenerate dependency resource stanzas for Python virtualenv formulas
  • Run strict brew audit, brew style, and build tests before pushing tap changes
  • Automate tap repository updates in GitHub Actions using HOMEBREW_TAP_TOKEN

Example prompts for the agent

  • Fetch the latest package release from PyPI and update Formula/claude-mpm.rb with new url and sha256
  • Regenerate Python resource stanzas for this formula and run brew audit --strict
  • Test the formula locally with brew install --build-from-source and run brew test

How to install homebrew-formula-maintenance

1Skills CLI (Vercel)

npx skills add bobmatnyc/claude-mpm-skills --skill homebrew-formula-maintenance -a claude-code

2Manually: put the files in place

~/.claude/skills/homebrew-formula-maintenance/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/homebrew-formula-maintenance/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about homebrew-formula-maintenance

How to install homebrew-formula-maintenance in Claude Code?

Run npx skills add bobmatnyc/claude-mpm-skills --skill homebrew-formula-maintenance -a claude-code.

What does homebrew-formula-maintenance do?

It standardizes maintenance workflows for Python Homebrew taps, covering PyPI sync, dependency updates, and audit checks.

What is needed to automate tap updates in GitHub Actions?

The CI workflow runs update_homebrew_formula.py and requires the HOMEBREW_TAP_TOKEN environment variable to push commits to the tap repository.

Source text

SKILL.md · MIT
---
name: homebrew-formula-maintenance
description: Homebrew formula maintenance workflows for Python CLIs and taps, including version bumps, SHA/resource updates, testing, audits, and releases.
user-invocable: false
disable-model-invocation: true
version: 1.0.0
category: toolchain
author: Claude MPM Team
license: MIT
progressive_disclosure:
  entry_point:
    summary: "Maintain Homebrew Python formulas: bump version/sha, refresh resources, test install, audit/style, and push tap updates."
    when_to_use: "Updating Homebrew tap formulas for Python CLIs, syncing PyPI releases, or automating tap updates in CI."
    quick_start: "1. Verify PyPI release exists 2. Update url+sha in Formula 3. Regenerate resources if needed 4. brew install --build-from-source + brew test + brew audit"
tags:
  - homebrew
  - formula
  - tap
  - python
  - pypi
  - release
  - ci
---

# Homebrew Formula Maintenance

## Overview

Use this workflow to keep Homebrew formulas in sync with PyPI releases for Python CLIs. The pattern in your taps is: update version + sha, refresh resource blocks when needed, run brew install/test/audit, then push the tap update (manually or via CI).

## Quick Start (manual bump)

1. Verify the PyPI release exists and grab the sdist URL + SHA256.
2. Update the `url` and `sha256` in the formula.
3. Refresh `resource` stanzas if the formula uses `virtualenv_install_with_resources`.
4. Test: `brew install --build-from-source` + `brew test` + `brew audit --strict`.
5. Update changelog/tag and push the tap repo.

## Local Scripts You Already Use

- `homebrew-claude-mpm/scripts/update_formula.sh <version>`
  - Verifies PyPI, updates url/sha, regenerates resources, optional brew test/audit.
- `homebrew-claude-mpm/scripts/generate_resources.py`
  - Emits Python dependency `resource` blocks from PyPI.
- `homebrew-claude-mpm/scripts/test_formula.sh`
  - End-to-end brew install/test/audit/style.
- `mcp-vector-search/scripts/update_homebrew_formula.py`
  - End-to-end tap update with `--dry-run`, `--version`, `--tap-repo-path` and `HOMEBREW_TAP_TOKEN`.

## Standard Workflow

### 1. Confirm PyPI Release

- Check the sdist is available and capture URL/SHA.
- Typical command: `curl -s https://pypi.org/pypi/<package>/<version>/json`.

### 2. Update Formula URL + SHA

- Replace `url` and `sha256` in `Formula/<name>.rb`.
- Keep the formula version implicit via the sdist URL (your taps do this).

### 3. Refresh Resources (Python Virtualenv Formula)

If the formula uses `Language::Python::Virtualenv` and `virtualenv_install_with_resources`:

- Regenerate `resource` stanzas after dependency changes.
- Use `generate_resources.py` or equivalent; review output before pasting.

### 4. Test and Audit

Run these in the tap repo:

```bash
brew install --build-from-source ./Formula/<name>.rb
brew test <name>
brew audit --strict ./Formula/<name>.rb
brew style ./Formula/<name>.rb
```

### 5. Commit and Push

- Update `CHANGELOG.md` if the tap repo tracks releases.
- Commit, tag, and push as required by the tap workflow.

## Formula Patterns (From Your Taps)

### Full Virtualenv Formula (claude-mpm)

- `include Language::Python::Virtualenv`
- `virtualenv_install_with_resources`
- Large `resource` blocks to pin dependencies
- `test do` uses CLI commands like `--version` and subcommands

### Minimal Venv Formula (mcp-vector-search)

- Create venv explicitly and `pip install -v buildpath`
- `bin.install_symlink` for CLI entrypoint
- Minimal `test do` uses `--version` and `--help`

## CI Automation Pattern

Your GitHub Actions workflow for Homebrew updates follows this flow:

- Trigger on tag or `workflow_run` after CI succeeds.
- Run `scripts/update_homebrew_formula.py`.
- Require `HOMEBREW_TAP_TOKEN` (and optional `HOMEBREW_TAP_REPO`).
- On failure, open an issue with manual update steps.

## Troubleshooting

- **PyPI release missing**: verify tag push and publish step completed.
- **SHA mismatch**: re-fetch sdist SHA from PyPI JSON.
- **brew audit failures**: confirm dependency resource blocks match the sdist and `[email protected]` dependency is present.
- **Install failures**: verify `[email protected]` dependency and `virtualenv_install_with_resources` usage.

## Related Skills

- `toolchains/universal/infrastructure/github-actions`
- `toolchains/universal/infrastructure/docker`

© Claude MPM Team · MIT · bobmatnyc/claude-mpm-skills

Similar skills

All skills for DevOps and infrastructure →

From the same set125

test-quality-inspector Inspects test suites for empty assertions and missing edge cases. It guides your coding agent to verify persistence, negative paths, and input validation. CX Codex +1 367installs svelte5-runes-static Provides safe reactivity patterns for Svelte 5 runes paired with SvelteKit adapter-static. It prevents frozen state and hydration mismatches during static prerendering. CX Codex +1 364installs stacked-prs A skill that walks the agent through building stacks of dependent pull requests, where each branch grows from the previous one instead of main. Useful when a large feature is split into phases. CX Codex +1 362installs better-auth-core A skill for wiring Better Auth into TypeScript apps: the instance, server handlers, client, and sessions. Useful when you need auth running without digging through docs. CX Codex +1 358installs reporting-pipelines A skill that fixes one pattern for report exports: collect data, normalize it, write CSV/JSON/Markdown with timestamped names into reports/. CX Codex +1 354installs better-auth-integrations Configures Better Auth route handlers in TypeScript web frameworks like Next.js, Remix, Hono, and Express. Solves cookie and header forwarding for SSR and server actions. CX Codex +1 354installs better-auth-plugins Guides coding agents when configuring Better Auth plugins in TypeScript projects. Covers two-factor auth, passkeys, JWT, and schema migrations. CX Codex +1 352installs git-worktrees Teaches the agent to manage parallel Git branches using worktrees. Useful for stacked pull requests, urgent bugfixes, and isolated code reviews. CX Codex +1 351installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor