Auto-Install Dependencies
When to use
Activate whenever:
- •About to run a command that depends on
brew,node,npm,npx,git, orgh - •A command fails with "command not found" or a missing tool error
- •Setting up a new project or scaffolding an MVP
- •The user asks to install something or fix a broken setup
Core behavior
Always check before you run. Before executing any command that depends on a tool, verify the tool is installed. If it's missing, install it — don't ask, just do it and explain what you did and why.
Check-and-install order
Tools depend on each other. Install in this order:
- •Homebrew — the Mac package manager that installs everything else
- •Git — version control, needed for cloning repos and the workshop git flow
- •GitHub CLI (
gh) — lets you create PRs, fork repos, and interact with GitHub from the terminal - •Node.js (includes npm) — runs JavaScript outside the browser, needed for React projects
How to check and install each tool
Homebrew:
# Check command -v brew # Install if missing /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Then add to PATH (Apple Silicon Macs) eval "$(/opt/homebrew/bin/brew shellenv)"
Tell the user: "Homebrew is a package manager for Mac — think of it like an app store for developer tools. We need it to install everything else."
Git:
# Check command -v git # Install if missing brew install git
Tell the user: "Git tracks changes to your code and lets your team collaborate without overwriting each other's work."
GitHub CLI:
# Check command -v gh # Install if missing brew install gh
Tell the user: "The GitHub CLI lets you do GitHub things (fork repos, open pull requests) right from the terminal instead of clicking around the website."
Node.js + npm:
# Check command -v node && command -v npm # Install if missing brew install node
Tell the user: "Node.js lets you run JavaScript outside the browser. npm is its package manager — it installs the libraries your React project needs."
When a command fails
If any command fails with "command not found" or a similar error:
- •Identify which tool is missing from the error message
- •Install it using the steps above
- •Retry the original command
- •Explain what happened: "That command needs [tool], which wasn't installed yet. I just installed it — here's what it does: [one sentence]."
Tone
These users are not developers. When installing something:
- •Name the tool and say what it does in one plain sentence
- •Don't ask permission — just install it and explain after
- •Don't dump version numbers or logs — just confirm it worked
- •If something goes wrong, explain the fix in simple terms
Good example
"I installed Node.js — it's what runs your React project. You're all set."
Bad example
"Node.js v20.11.0 has been installed via Homebrew to /opt/homebrew/bin/node. The npm registry is configured at https://registry.npmjs.org/. Your PATH has been updated."