agentleFS
NickMoignardNickMoignard/agent-workspace-template/.agents/skills/setup-homebrew/SKILL.md

setup-homebrew

Skill0 starsChanged 2 months agoMITView on GitHub

Install and configure Homebrew for the current machine. Ensures brew is present, wires `brew shellenv` onto PATH idempotently, installs the foundational CLI tools the workspace relies on (jq, yq), and verifies it works. Use when onboarding a machine, when `brew`/`jq`/`yq` are missing, or when `make setup` reports Homebrew is not configured. Run this BEFORE /setup-asdf (asdf is installed via brew).

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If brew is missing, install it non-interactively:

    line 23
  2. Very specific:

    Add this marker-guarded block once (resolve BREW to the real path found above):

    line 52
  3. Very specific:

    Check first: grep -q 'managed by /setup-homebrew' <rc> — only write if absent.

    line 62
  4. Very specific:

    Don't hardcode brew's path — resolve it from the platform / from which brew.

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Set up Homebrew for this workspace

Homebrew is a hard requirement for every agent workspace, on the same level as asdf. It is the package manager the workspace uses to install foundational tooling — including asdf itself — so run this before /setup-asdf.

You are an agent running this end-to-end. Inspect state, adapt to the OS/shell, and debug failures yourself rather than handing them back to the user.

Steps

1. Ensure Homebrew is installed

brew --version   # any recent version is fine

If brew is missing, install it non-interactively:

NONINTERACTIVE=1 /bin/bash -c \
  "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • macOS also needs the Command Line Tools (xcode-select --install); the installer prompts if they're absent.
  • Linux (incl. WSL) installs to /home/linuxbrew/.linuxbrew and needs build-essential / procps / curl / git; install those with the system package manager first if the installer complains.

2. Wire brew shellenv onto PATH (idempotent, marker-guarded)

Homebrew's location differs by platform — find the installed brew and use its own shellenv (don't hardcode paths):

Platformbrew path
macOS Apple Silicon/opt/homebrew/bin/brew
macOS Intel/usr/local/bin/brew
Linux / WSL/home/linuxbrew/.linuxbrew/bin/brew
  1. Detect the shell and target rc file:
    • zsh → ~/.zshrc
    • bash → ~/.bashrc (also ensure it's sourced from ~/.bash_profile on macOS login shells)
    • fish → ~/.config/fish/config.fish
  2. Add this marker-guarded block once (resolve BREW to the real path found above):

    # >>> homebrew — managed by /setup-homebrew >>>
    eval "$(<BREW> shellenv)"
    # <<< homebrew — managed by /setup-homebrew <<<

    (fish: eval (<BREW> shellenv).)

  3. Check first: grep -q 'managed by /setup-homebrew' <rc> — only write if absent.
  4. Also eval it in the current session so the next steps (and /setup-asdf) work without opening a new shell:
    eval "$(<BREW> shellenv)"

3. Install foundational CLI tools (jq, yq)

The workspace's mechanical tooling parses JSON (skills-lock.json, *.code-workspace) with jq and YAML (the project manifest) with yq. Both are hard requirements and both come from Homebrew:

brew install jq yq   # no-ops / upgrades if already present

Heads-up on yq: the name is shared by two different tools — Homebrew's yq is mikefarah/yq (Go), which the scripts require, while many Linux boxes ship python-yq (a jq wrapper) at /usr/bin/yq. Homebrew's shellenv puts brew's bin ahead of /usr/bin, so after this skill runs yq resolves to mikefarah's. If a system python-yq still wins, fix PATH order before continuing.

4. Verify

brew --version
jq --version
yq --version   # MUST mention "mikefarah"; if not, brew's yq isn't first on PATH

Confirm brew, jq, and yq resolve on PATH in the current session and that yq --version names mikefarah, then continue with /setup-asdf (which installs asdf via brew install asdf).

Rules

  • Install non-interactively (NONINTERACTIVE=1); never leave a prompt hanging.
  • Edit exactly one rc file, guarded by the marker; keep it idempotent.
  • Don't hardcode brew's path — resolve it from the platform / from which brew.
  • On failure, diagnose and fix in place — you're the agent, not the user.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.