Homebrew Cask Authoring
Author and maintain Homebrew Casks with correct token naming, stanzas, audit/style compliance, and local install testing.
Operating rules
- Prefer the official Homebrew documentation (Cask Cookbook, Acceptable Casks) when uncertain.
- Keep casks minimal: only add stanzas that are required for correct install/uninstall/cleanup.
- Avoid destructive system changes unless explicitly requested; call out any
rm/tap changes before suggesting them.
- When testing local casks, ensure Homebrew reads from the local file (not the API).
Quick intake (ask these first)
Collect:
- App name (exact
.app bundle name)
- Homepage (official)
- Download URL(s) (DMG/ZIP/PKG) and whether they differ by arch
- Version scheme (single version? per-arch?)
- Install artifact type (
app, pkg, suite, etc.)
- Uninstall requirements (pkgutil ids, launch agents, kernel extensions)
- Desired cleanup (zap paths)
If any of these are unknown, propose a short plan to discover them.
Workflow: create or update a cask
1) Choose the token
- Start from the
.app bundle name.
- Remove
.app and common suffixes: “App”, “Mac”, “Desktop”, “for macOS”, version numbers.
- Downcase; replace spaces/underscores with hyphens.
- Remove non-alphanumerics except hyphens.
- Use
@beta, @nightly, or @<major> for variants.
Confirm the token before writing the file.
2) Draft a minimal cask
Use this canonical structure:
cask "token" do
version "1.2.3"
sha256 "..."
url "https://example.com/app-#{version}.dmg"
name "Official App Name"
desc "Short one-line description"
homepage "https://example.com"
app "AppName.app"
end
Rules of thumb:
- Prefer
https URLs.
- Add
verified: when download host domain differs from homepage domain.
- Keep
desc factual and concise (no marketing).
3) Handle architecture (if needed)
If URLs and/or sha256 differ by CPU:
- Use
arch + sha256 arm: ..., intel: ... when versions match.
- Use
on_arm / on_intel blocks when versions differ.
4) Add required uninstall/zap
- Add
uninstall for pkg installs (include pkgutil: identifiers).
- Add
zap for user data cleanup (support directories, preferences, caches), but keep it accurate.
5) Validate and test locally
Run, in this order:
brew style --fix <token>
brew audit --cask --online <token>
For new casks also run:
brew audit --cask --new <token>
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <token>
brew uninstall --cask <token>
If install fails:
- Re-check URL reachability,
sha256, and artifact name.
- Re-run with verbosity:
brew install --cask --verbose <token>.
6) PR hygiene
Before suggesting submission:
- Ensure
brew style and all relevant brew audit commands pass.
- For new casks, check the token has not been previously refused/unmerged.
Local development patterns
If the user is editing Homebrew/homebrew-cask locally and wants Homebrew to execute their working copy, use a tap symlink workflow.
Read the full end-to-end checklist here:
references/homebrew-cask-contribution-workflow.md
1---2name: homebrew-cask-authoring3description: Create, update, validate, and submit Homebrew Casks. Use when the user mentions Homebrew cask/cask, Homebrew/homebrew-cask, adding a new cask, updating a cask, cask token naming, sha256, url verified:, livecheck, zap/uninstall, or when asked to run brew style/audit for a cask.4---5
6# Homebrew Cask Authoring
7
8Author and maintain Homebrew Casks with correct token naming, stanzas, audit/style compliance, and local install testing.
9
10## Operating rules
11
12- Prefer the official Homebrew documentation (Cask Cookbook, Acceptable Casks) when uncertain.
13- Keep casks minimal: only add stanzas that are required for correct install/uninstall/cleanup.
14- Avoid destructive system changes unless explicitly requested; call out any `rm`/tap changes before suggesting them.
15- When testing local casks, ensure Homebrew reads from the local file (not the API).
16
17## Quick intake (ask these first)
18
19Collect:
20- App name (exact `.app` bundle name)
21- Homepage (official)
22- Download URL(s) (DMG/ZIP/PKG) and whether they differ by arch
23- Version scheme (single version? per-arch?)
24- Install artifact type (`app`, `pkg`, `suite`, etc.)
25- Uninstall requirements (pkgutil ids, launch agents, kernel extensions)
26- Desired cleanup (zap paths)
27
28If any of these are unknown, propose a short plan to discover them.
29
30## Workflow: create or update a cask
31
32### 1) Choose the token
33
34- Start from the `.app` bundle name.
35- Remove `.app` and common suffixes: “App”, “Mac”, “Desktop”, “for macOS”, version numbers.
36- Downcase; replace spaces/underscores with hyphens.
37- Remove non-alphanumerics except hyphens.
38- Use `@beta`, `@nightly`, or `@<major>` for variants.
39
40Confirm the token before writing the file.
41
42### 2) Draft a minimal cask
43
44Use this canonical structure:
45
46```ruby
47cask "token" do
48 version "1.2.3"
49 sha256 "..."
50
51 url "https://example.com/app-#{version}.dmg"
52 name "Official App Name"
53 desc "Short one-line description"
54 homepage "https://example.com"
55
56 app "AppName.app"
57end
58```
59
60Rules of thumb:
61- Prefer `https` URLs.
62- Add `verified:` when download host domain differs from `homepage` domain.
63- Keep `desc` factual and concise (no marketing).
64
65### 3) Handle architecture (if needed)
66
67If URLs and/or sha256 differ by CPU:
68- Use `arch` + `sha256 arm: ..., intel: ...` when versions match.
69- Use `on_arm` / `on_intel` blocks when versions differ.
70
71### 4) Add required uninstall/zap
72
73- Add `uninstall` for `pkg` installs (include `pkgutil:` identifiers).
74- Add `zap` for user data cleanup (support directories, preferences, caches), but keep it accurate.
75
76### 5) Validate and test locally
77
78Run, in this order:
79
80```bash
81brew style --fix <token>
82brew audit --cask --online <token>
83```
84
85For new casks also run:
86
87```bash
88brew audit --cask --new <token>
89HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <token>
90brew uninstall --cask <token>
91```
92
93If install fails:
94- Re-check URL reachability, `sha256`, and artifact name.
95- Re-run with verbosity: `brew install --cask --verbose <token>`.
96
97### 6) PR hygiene
98
99Before suggesting submission:
100- Ensure `brew style` and all relevant `brew audit` commands pass.
101- For new casks, check the token has not been previously refused/unmerged.
102
103## Local development patterns
104
105If the user is editing `Homebrew/homebrew-cask` locally and wants Homebrew to execute their working copy, use a tap symlink workflow.
106
107Read the full end-to-end checklist here:
108- `references/homebrew-cask-contribution-workflow.md`