setup-projects
Skill0 starsChanged 2 months agoMITView on GitHub
Provision the shared git source directory ($AGENTS_GIT_SRC_DIR) and clone+symlink the projects this workspace references. Ensures the env var is set (written to the shell rc file, marker-guarded, default ~/agents/git_repos), creates the directory, then runs the mechanical sync that clones each repo in projects.yaml and links it into projects/. Use when onboarding a workspace, when projects/ is empty, or when `make setup` reports AGENTS_GIT_SRC_DIR is not set.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-projectSkill
- setup-asdfSkill
- setup-beadsSkill
- setup-homebrewSkill
- update-workspaceSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
Check first: grep -q 'managed by /setup-projects' <rc> — only write if absent.
- Distinctive: line 60
Create parents as needed. Confirm it's writable.
- Very specific: line 64
Run the mechanical sync (clones any missing repo into $AGENTS_GIT_SRC_DIR, then symlinks it into projects/), then regenerate the VS Code …
- Very specific: line 90
Only projects.yaml and projects/README.md are tracked.
≈ “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.
Files
Set up this workspace's projects
A Workspace references its Projects as symlinks, not git submodules: each
Project is cloned once into a shared machine-level directory
($AGENTS_GIT_SRC_DIR) and symlinked into projects/. This keeps the Workspace
independent of the Projects it works on (it pins no commits). See
docs/adr/0004-projects-as-symlinks-not-submodules.md and CONTEXT.md.
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
0. Prerequisites
yq and git must be present. yq is installed by /setup-homebrew; if it's
missing, run that first, then continue here.
1. Ensure AGENTS_GIT_SRC_DIR is set (idempotent, marker-guarded)
This is the single machine-level directory where every workspace's Project clones live.
echo "${AGENTS_GIT_SRC_DIR:-<unset>}"- Already set → use it as-is.
Unset → pick a value. Offer the user a directory or let them set their own; default to
~/agents/git_repos. Then add this marker-guarded block once to the shell rc file (~/.zshrcfor zsh,~/.bashrcfor bash,~/.config/fish/config.fishfor fish):# >>> agents git src — managed by /setup-projects >>> export AGENTS_GIT_SRC_DIR="$HOME/agents/git_repos" # <<< agents git src — managed by /setup-projects <<<(fish:
set -gx AGENTS_GIT_SRC_DIR $HOME/agents/git_repos.)Check first:
grep -q 'managed by /setup-projects' <rc>— only write if absent. Then also export it in the current session so the next steps work:export AGENTS_GIT_SRC_DIR="$HOME/agents/git_repos"
2. Ensure the directory exists
mkdir -p "$AGENTS_GIT_SRC_DIR"Create parents as needed. Confirm it's writable.
3. Clone + link the manifest's projects
Run the mechanical sync (clones any missing repo into $AGENTS_GIT_SRC_DIR, then
symlinks it into projects/), then regenerate the VS Code folder list:
make sync-projects # = bash scripts/sync-projects.sh
make sync-workspace # rescans projects/ into the *.code-workspace foldersprojects.yaml may be empty in a fresh workspace — that's fine; there is simply
nothing to clone yet. Add projects later with make add-project URL=<git-url>.
4. Verify
ls -l projects/ # each entry is a symlink into $AGENTS_GIT_SRC_DIR
git -C "$AGENTS_GIT_SRC_DIR"/* rev-parse --abbrev-ref HEAD 2>/dev/null || trueConfirm every symlink resolves and the folders list in the *.code-workspace
file lists the linked projects. Then hand back to onboarding (make setup).
Rules
- Edit exactly one rc file, guarded by the marker; keep it idempotent. Never
hardcode a home path — use
$HOME. - The symlinks and clones are per-machine and git-ignored — never commit them.
Only
projects.yamlandprojects/README.mdare tracked. - Clones track each remote's default branch. Do not pin commits here; if a user wants a specific ref, that's a normal git operation inside the clone.
- On any failure, diagnose and fix in place — you're the agent, not the user.
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
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.

