██████╗ █████╗ ██████╗
██╔════╝ ██╔══██╗██╔══██╗
██║ ███╗███████║██████╔╝
██║ ██║██╔══██║██╔═══╝
╚██████╔╝██║ ██║██║
╚═════╝ ╚═╝ ╚═╝╚═╝
GAP is one set of rules that every coding agent on your machine follows. You, or an agent, write the rules once in global/AGENTS.md. The gap sync command copies them into the file each agent already reads.
- macOS or Linux.
gapbuilds on Windows, but its harness paths and tests are not checked there. - git and curl on your
PATH. Go is optional; the installer can download a release binary. - On macOS and Linux, package and configuration changes from the CLI, TUI, and MCP server share one lock per home. A change that reaches a busy home lock waits up to three seconds, then stops without writing if the lock is still held. The MCP server rejects a second mutation immediately if its own mutation slot is occupied. In either case, retry after the first change finishes.
curl -fsSL https://raw.githubusercontent.com/edheltzel/GAP/master/scripts/install.sh | shcurl downloads scripts/install.sh from the master branch of github.com/edheltzel/GAP. The script chooses an installation path based on whether go is on your PATH:
- With Go, use the version required by go.mod, or newer. The piped script clones the repo into a new checkout under
~/.gap/checkouts/, then buildsgapwithgo install ./cmd/gap. The binary goes inGOBINif set, otherwise$(go env GOPATH)/bin. Each curl install keeps its own checkout, so earlier installs and published documentation links keep their source. - Without Go, the script downloads the latest release for macOS or Linux on amd64 or arm64. It checks the archive's SHA-256 against
checksums.txt, stops on a mismatch, and installs the binary to~/.local/bin. It also clonesmasterinto~/.gap/checkout, or fast-forwards that checkout on a later install. This path needs tar and either shasum or sha256sum.
The script checks whether your shell can find the binary's folder. If not, it prints the exact export PATH=... line to add to your shell config. Open a new terminal after adding it. Installation writes the binary and source checkout; gap sync publishes the policy and installs the selected packages and skills.
The script also installs tab completion for the shell in $SHELL with gap completion --install. It supports bash, zsh, and fish, and skips any other shell without failing the install. Completion covers commands, flags, item ids for update, check, restore, remove, and pin, the groups for sync --only and --skip, and sync --profile names. Where each shell's file goes:
| Shell | File | Loaded by |
|---|---|---|
| bash | $XDG_DATA_HOME/bash-completion/completions/gap |
bash-completion 2. On macOS, brew install bash-completion@2 |
| zsh | $XDG_DATA_HOME/zsh/site-functions/_gap |
compinit, once that folder is in fpath. Add fpath=(~/.local/share/zsh/site-functions $fpath) to ~/.zshrc before compinit |
| fish | $XDG_CONFIG_HOME/fish/completions/gap.fish |
fish, automatically |
$XDG_DATA_HOME defaults to ~/.local/share and $XDG_CONFIG_HOME to ~/.config. Run gap completion --install zsh (or bash, fish) to add another shell, or gap completion zsh to print the script instead of installing it.
The script also installs the manual to share/man/man1/gap.1 next to the binary's folder, so man gap works. If man cannot find it, the script prints the export MANPATH=... line to add. When tealdeer is installed, it also writes docs/tldr/gap.md to tealdeer's custom pages folder (gap.page before tealdeer 1.7, gap.page.md after), so tldr gap works; a tealdeer that never downloaded its cache needs tldr --update once first, and gap says so. Other tldr clients get no page until it is in tldr-pages; gap tldr prints it. gap self-update installs or refreshes both; after a plain go install, run gap man --install and gap tldr --install. gap help concepts explains the terms gap uses, and gap <command> --help shows each command's flags and examples.
Already have the repo checked out? With Go available, sh scripts/install.sh from its root builds that copy instead of cloning, including when stdin is redirected. Keep that checkout too.
Then publish:
gap syncgap runs from any folder. Source builds use their build checkout (see Update vs self-update for what happens when it moves); release builds use ~/.gap/checkout. Keep the checkout: published documentation links point into it. Run gap self-update to update the gap program itself; see Update vs self-update. It then installs or refreshes the manual and, when tealdeer is installed, the tldr page; a tldr page gap did not write stays. A page another program creates or edits in the instant between gap's check and its write can still be replaced. A gap self-update run by an older binary may skip them, so after that first update run gap man --install and gap tldr --install once. Running the curl command again also works. With Go, you can skip installing and run go run ./cmd/gap sync from a checkout.
To uninstall, run:
gap uninstallIt previews what it will remove and asks on a terminal (--yes skips the question, --dry-run only previews). Without a terminal, --yes is required. Use the same CODEX_HOME and JCODE_HOME you published with. It removes every package you added the way gap remove does, then the remaining recorded MCP servers and commands, including any an interrupted uninstall kept, GAP policy blocks, the GAP Codex hooks, and published global commands that still match ~/.gap/published.json. Text outside marked policy blocks stays byte for byte; files left with only whitespace or Cursor front matter are removed. An unmarked policy file is removed when its whole-file SHA-256 matches the ledger. A ledger-verified prefix, including a legacy Codex GAP prefix, is stripped while preserving the text after it; the file is removed if only whitespace remains. Other policy files and unmatched global commands stay and are listed.
Skills are removed from the destinations GAP recorded for them in ~/.gap/state.json, or from both ~/.agents/skills/ and ~/.claude/skills/ when a package's skills or skillCopies records the name without destinations. An unreadable or malformed skills.sh lock stops discovery before removal. Policy, command, skill, and Codex hook backups go under ~/.gap/backups/<time>/; package removals can use separate timestamped folders. Before removing packages, GAP saves their skill and command ownership in ~/.gap/state.json so cleanup can resume after an interruption. After cleanup succeeds, it deletes ~/.gap/store/, ~/.gap/state/, ~/.gap/state.json, and ~/.gap/published.json. A failed cleanup exits 1 and keeps the records for a retry.
It leaves ~/.gap/backups/, ~/.gap/recovery/, ~/.gap/checkout/, ~/.gap/checkouts/, your remaining ~/.config/gap/ settings, and the gap binary. It prints a trash command for the binary and confirms successful cleanup with Uninstall complete. Copy out any saved files you want, then trash ~/.gap/ yourself.
| Command | What it does |
|---|---|
gap sync |
Preview what will sync, ask on a terminal, then publish global/AGENTS.md and each global/commands/*.md, install missing skills, and check skills for drift. See Choose what syncs |
gap sync --skip <groups> / --only <groups> / --yes |
Leave groups out, sync only some, or sync without asking. Groups: policy or a package id |
gap sync --profile crew |
Prepare project files for cloud agents without fetching packages or writing to the home directory |
gap sync --remove-codex-legacy |
Same, then strip the old policy copy from Codex home's AGENTS.md; see Set up Codex |
gap status |
Show each package's locked version, its store copy, and drift in its selected skills. With recall on PATH, also prints recall: N promotion candidates (skipped after 5 seconds or on any Recall error). Writes nothing; exits 1 on skill drift or an unpinned, missing, changed, or unreadable source checkout |
gap source |
Print the GAP checkout gap sync publishes from. Writes nothing |
gap restore [id] |
Back up and replace selected missing or drifted package skills at the locked commit, reusing a verified store copy |
gap check [id] |
List the commits waiting on each package's ref after its locked version. Changes no locked version; gap status shows the counts from the last check as new=N. See Update packages |
gap pin <id>@<ref> |
Resolve a default package's branch, tag, or commit and write it to GAP's gap.lock |
gap doctor |
Run configured package doctors and report which harness commands are on PATH |
gap add <source> [options] (aliases install, i, a) |
Add skills from any git repository or local folder, with the flags of npx skills add: per project by default, -g for every project. See Add a package and Global vs project |
gap update [id] |
Move one package, or every package without pin = true when the id is omitted, to the newest commit on its ref. A default package's new locked version goes to gap.lock for a PR; a package you added installs right away. Does not update gap itself. See Update packages |
gap remove <id> |
Remove a package you added and its recorded installations. Default packages cannot be removed; enabled = false leaves one out. See Add a package |
gap uninstall [--yes] [--dry-run] |
Preview and remove recorded installations. See Install gap for removal rules and retained files |
gap search [query] |
Search catalog.toml, the list of known packages, by id, tag, or description. Default packages show included with GAP; gap sync installs it; other matches show a gap add command |
gap list |
List every package with the file that declares it, its source (default or user), repo, ref, locked commit, and hook trust. See List packages |
gap axi |
For agents: version, GAP checkout, project, harnesses, package counts with drift and new commits, a one-line command index, and next steps in one call. Prints TOON by default. See Agent output |
gap describe [command] (alias gap axi schema) |
For agents: the live spec of one command (arguments, flags, safety, examples), or every command with its safety, the global flags, and the error codes. Prints TOON by default |
gap mcp |
Serve six read tools over stdio, or use authenticated local HTTP. Package changes require operator opt-in |
gap tui |
Open the terminal UI to update, check, remove, and disable items and see status and projects. Plain gap on a terminal opens it too. See Terminal UI |
gap init [--adopt] [dir] |
Create project configuration and a policy pointer; --adopt reports and preserves existing project files |
gap self-update |
Update the gap program itself: rebuild from its clone (source builds) or download the latest release (release builds). Moves no package. See Update vs self-update |
gap completion [bash|zsh|fish] [--install] |
Print the shell's completion script, or with --install write it where that shell loads it. The shell defaults to $SHELL. See Install gap |
gap --version |
Show the CLI version; release binaries report the tagged release version |
go test ./... |
Run the self-test against throwaway folders |
Use gap --help or gap <command> --help for usage and flags. Help and terminal reports use GAP's light or dark palette; status, list, and search show framed tables with totals. Git ref lookups and store fetching show spinners on terminal stderr. On a terminal, gap sync and gap update render a live inline Bubble Tea v2 progress view on stderr: a step checklist (completed steps with durations such as ✓ do-skills 1.3s, the active step with a MiniDot spinner, current item such as 42/156 do-commit, and live git/fetch detail, plus upcoming planned steps) above a gradient progress bar showing percent, steps done, ticking elapsed time, and estimated time left. Terminal report lines print above the live view, interactive prompts and package hooks pause and resume the view cleanly, and nothing is drawn when output is redirected or TERM=dumb; long lines truncate to the terminal width. Set NO_COLOR=1 or TERM=dumb to suppress report colors and spinners while keeping terminal layouts. Redirected reports use plain text. Add, update, restore, pin, remove, and uninstall outcome lines also appear when redirected.
Changed stores, skill drift, crew projects, and disabled packages require a person to review them. Their agent results have no repair command, retry, or next step. A successful changed pin includes a package-scoped install next step after its lock is merged.
--format toon|json (or --axi, which means --format toon) turns a CLI command other than mcp into one structured result on stdout for an agent; GAP_FORMAT=toon|json sets the default and --format human overrides it. status, list, doctor, check, search, source, and pin return typed data; other commands return their report as output lines. TOON keeps the first 50 rows of a list, the last 40 output lines (doctor hook output included), and 200 characters of a value, and says so in truncated; a retry_cmd or a next step's cmd is never cut, and a next step that runs gap carries the same output flags. --full prints everything. A failure carries error with code (INTERACTION_REQUIRED, VALIDATION_ERROR, UNTRUSTED_HOOK, DRIFT_DETECTED, STORE_CHANGED, CREW_PROJECT, PACKAGE_DISABLED, NOT_FOUND, IO_ERROR, INCOMPLETE, FAILED), message, hint, retry_cmd, and mutated (whether anything was written before it stopped). Agent mode never reads stdin: a prompt fails at once with INTERACTION_REQUIRED, an untrusted hook is skipped with UNTRUSTED_HOOK, and retry_cmd names the exact command to run instead. Without these flags, output is unchanged.
An agent learns GAP from the binary, not from these docs: gap axi returns the live state, and gap describe <command> returns the exact flags and safety (read_only, mutates_lock, may_prompt, may_run_hooks, and the non_interactive_flags that skip every question). Both print TOON unless --format or GAP_FORMAT says otherwise; a section gap axi cannot read says unknown and the rest still print. Plain gap without a terminal prints help plus a line pointing agents at both. skills/gap-axi/SKILL.md is a harness-neutral Agent Skill that only sends an agent to those two commands, so it cannot go stale; install it with gap add edheltzel/GAP --skill gap-axi.
Start gap mcp --project /absolute/project as an MCP stdio command. Use a client supporting protocol 2026-07-28; older initialize handshakes are refused. Diagnostics go to stderr. Six tools are available: gap_dashboard, gap_describe, gap_status, gap_list, gap_search, and gap_source. Search reads GAP's published catalog over HTTPS. Clients cannot supply URLs, directories, environment variables, shell commands, or another profile.
For Streamable HTTP, create a new private token file with 32 random bytes encoded as hex or base64. For example, from a private directory:
(umask 077; set -C; openssl rand -hex 32 > gap-mcp.token)
gap mcp --transport http --token-file "$PWD/gap-mcp.token" --project /absolute/projectRead the numeric /mcp URL from stderr. Send Authorization: Bearer <token> on every request; never put the token in a URL, cookie, or command argument. GAP_MCP_TOKEN is an alternative to a token file, not an additional credential. To rotate a token, replace it and restart. HTTP accepts POST only, checks the exact Host including port, and rejects browser origins by default. --allow-origin filters Origin headers on direct POST requests; it does not enable cross-origin browser JavaScript or unauthenticated CORS preflights. --allow-host adds a canonical host:port. --network tailnet --listen <your-own-numeric-tailnet-IP>:0 verifies the local Tailscale node before binding. No public, wildcard, LAN, hostname or proxy listener is supported.
--allow-mutations adds gap_doctor and gap_manage. Every call needs confirm_mutation: true and a unique 16 to 64 character request_id. Manage supports only explicitly selected sync groups (only), one package for update or restore, or a catalog ID with named skills and agents for project add. The project and optional --profile are fixed at startup. Package hooks never run. If a selected change needs one, the whole request fails before writing with UNTRUSTED_HOOK and hook approval not available in M2, even with both hook opt-ins. Use the local CLI for machine-wide package MCP registration or changes requiring intervention.
Receipts under ~/.gap/mcp/operations/ record completed and remaining steps. Repeating a request ID with the same arguments returns its receipt; different arguments conflict. A partial or unknown result requires manual review, not an automatic retry. Displaced files stay under .gap/recovery/mcp/ in the affected home, project, or GAP checkout. Each request is limited to 512 durable steps; split large operations where possible, otherwise use the local CLI. Read the server specification for schemas, limits and the hook policy.
They are different commands that update different things.
gap update [id] |
gap self-update |
|
|---|---|---|
| Updates | Packages: the named one, or with no id every package without pin = true, moves to the newest commit on its ref |
The gap program and the GAP clone it reads |
| Writes | gap.lock in the GAP clone for default packages (commit and merge it, then gap sync); ~/.config/gap/gap.lock for packages you added, installed right away |
The gap binary, and a fast-forward of the clone |
Touches gap itself |
No | Yes |
| Touches packages | Yes | No. A fast-forward can bring in a newer default gap.lock, which the next gap sync installs |
gap self-update works one of two ways, depending on how gap was installed:
- Source build: you cloned this repo and built
gapfrom that clone, with the installer and Go or withgo install ./cmd/gap. Self-update fetchesorigin's primary branch (master), builds that commit withgo buildfrom a clean copy so local files never reach the binary, then fast-forwards the clone and replaces the running binary. The rebuilt binary records that clone's path and keeps using it, so keep the clone; once recorded, that clone must stay usable. A binary with no recorded clone uses the folder it was built from only when it knows that folder's absolute path and findsglobal/AGENTS.mdthere; otherwise it falls back to~/.gap/checkout. - Release build: installed from a GitHub release by the installer without Go. Self-update downloads the latest release for this OS and architecture, checks it against
checksums.txt, fast-forwards~/.gap/checkout, and replaces the running binary. It never moves to an older release.
Either way the clone must stay clean and on the primary branch that origin/HEAD names (master here). Self-update refuses, before the checked-out commit or the binary changes, when the clone is on another branch, has uncommitted changes to tracked files, has commits that are not on origin, or has no origin/HEAD; its fetch may already have written fetch metadata such as FETCH_HEAD, but the primary tracking ref advances only after the clone fast-forwards. A failed build, download, or fast-forward (for example, one that would overwrite an ignored local file) leaves the clone and the binary as they were. Run gap sync afterwards to publish what the clone brought in.
gap add -l now means --list, not --local. Use -p, --project, or --local for a project install.
gap tui opens a terminal UI with three views:
Captured from the real TUI in an isolated demo home with two local example packages.
Status, Projects, an update, and removal confirmation
scripts/tui-shots.sh regenerates the captures in an isolated demo home.
- Items: every package with its source, scope, effective ref and commit, store state, drift, and
new=Nfrom the lastgap check. Default packages show as locked. An item this repo turns off showsoff herebeside its real locked version and store state. - Status: the output of
gap status. - Projects: each repo in
~/.gap/projects.jsonwith its profile and project-scope skill drift. A folder that no longer exists is flagged missing. A project item whose locked store is missing or changed stays listed and the project showsunchecked. Project drift is checked only when this view opens, once per refresh. Items and Projects verify each locked store once per refresh, and the Status view runsgap statusonly while it is shown.
| Key | What it does |
|---|---|
j/k or arrows |
Move, or scroll the Status view |
gg / G |
Top / bottom. In a finished run's summary, gg opens the first step. After g, the status line shows the keys it waits for |
ctrl+d / ctrl+u |
Half a page down / up. In a run summary they scroll the step's output |
ctrl+f / ctrl+b |
A full page down / up, outside a run summary |
H / M / L |
Top, middle, or bottom row on screen, in the Items and Projects lists |
enter |
Open the selected item or project full screen, scrollable; esc goes back |
l / h |
Move focus to the details pane beside the list and back. The focused pane has the accent border; while details have focus, j/k, ctrl+d/ctrl+u, gg and G scroll them, and esc also returns to the list. The pill at the start of the status line names the mode: NORMAL, DETAIL, FILTER, CMD, SEARCH, EDIT, CONFIRM, RUN, DONE or HELP |
tab / shift+tab, gt / gT, or 1-3 |
Switch views |
space |
Mark a package |
? |
Show every key for the current view, grouped and wrapped to the terminal width; j/k or ctrl+d/ctrl+u scroll it on a small terminal. The footer lists only the common ones, with ? first. ?, esc or q closes it |
/ |
Filter the Items or Projects list as you type, by item id or project path. enter keeps the filter, and the status line shows how many rows it hides; esc while typing goes back to the previous filter, and esc in the list clears it |
: |
Run a command: :sync, :update [id], :check [id], :restore [id], :doctor, :search <query>, :filter <text>, :status, :refresh, :help, :q. tab completes a command name, and any unique prefix runs (:up) |
S |
Search the skills.sh catalog as you type. Hits show install counts, a check for trusted sources (vercel-labs, anthropics, microsoft, google-labs-code), and where you already have them. enter asks Everywhere or This project, then runs gap add <repo> --skill <name> with --global or --project. Hits from non-GitHub sources are hidden because gap add cannot install them |
a |
Add a package: type the repo, an optional id, and whether it installs everywhere or only in this project. On the Projects view it adds to the selected project. It hands the terminal to gap add, so its trust prompt works |
e |
Edit the selected item: enabled, hold updates (pin), and color, saved everywhere or for this project only. For a package it also edits the version: a new one runs gap update and is kept only if the locked version moves. A default package's version changes with gap pin <id>@<ref>. On the Projects view, e opens that project's .gap/gap.toml |
E |
Open ~/.config/gap/gap.toml or this project's .gap/gap.toml in $VISUAL or $EDITOR |
u |
Run gap update <id> on the selected item |
U |
Confirm the items gap update will move (every item not held with pin = true, disabled ones included), then hand the terminal to it and press enter to come back |
s |
Hand the terminal to gap sync: its group picker, progress bar, and every prompt work as on the command line. Press enter to come back |
c / C |
Run gap check <id> / gap check |
d |
Remove the marked packages you added, or the selected one, after one confirmation that lists every id. Each runs gap remove <id>: the uninstall hook runs and files move to ~/.gap/backups/ |
x |
Disable or enable a default package after a confirmation. It writes enabled = false or enabled = true under [components.<id>] in ~/.config/gap/gap.toml |
f |
Forget a project from the registry |
y |
On the Projects view or a project's details, copy the selected project's lock fix command to the clipboard (OSC 52), whole and unwrapped |
r |
Refresh |
q |
Quit |
A run looks like AUP: the animated GAP wordmark with done/total and elapsed time, each step in its group color with a spinner, check, or cross and its time or exit code, the selected step's live output beside it, and a progress bar with the percent done under both. j/k pick a step, f follows the running one again. While a run is going, esc asks before cancelling. Stop interrupts the current step's whole process group, kills what is still running after 5 seconds, waits for it to end, and skips the rest. A failed step does not stop the others. The summary lists each step as ok, failed, cancelled, or not run; it opens on the first failure, j/k pick a step, and pgup/pgdn scroll that step's output. A removal confirmation too short to show one id refuses enter; long ids wrap and scroll.
Actions run the gap binary itself with stdin closed and NO_COLOR=1, so they behave exactly like the CLI. Item ids follow --, so an id that looks like a flag is never read as one. An untrusted package hook is skipped and exits 1, as without a terminal.
Each item shows in its group color. Set color = "#RRGGBB" in a package's table in gap.toml, or in [components.<id>] in ~/.config/gap/gap.toml or a project's .gap/gap.toml; later files win. Without one, items take the next color from GAP's palette. Any other value is an error.
Plain gap with no subcommand opens the TUI when stdin and stdout are terminals and NO_COLOR and TERM=dumb are unset. Otherwise it prints help and exits 2. gap tui without a terminal prints gap tui needs a terminal ... and exits 2.
A successful gap init, gap add --project (including a project package added to another repo), gap sync in a repo with .gap/gap.toml once its selection goes ahead, and a gap sync that leaves a project-scope skill installed and matching its locked version record that repo's root in ~/.gap/projects.json. A quit or crew sync writes nothing there. Roots are stored with symlinks resolved, so one repo reached through a link has one entry. The file is sorted, has one entry per root, and keeps the date each root was first seen. Home is never recorded, through a link either. A failed registry write prints a warning and never fails the command. Until the file exists, the Projects view shows the roots recorded under projectSkills in ~/.gap/state.json. Folders are never scanned.
Do these steps every time you change the rules.
Make your change in global/AGENTS.md. Longer notes it links to live in global/docs/agents/. Keep one policy for every agent; don't add a policy file for a single agent.
Commit the edit, merge it to master, and pull. gap sync publishes only merged rules. It refuses when:
- the checkout is on a branch other than
master. The main checkout and a git worktree onmasterboth publish. global/,skills/,gap.toml, orgap.lockdiffers fromorigin/HEAD, including untracked files. An ignored file blocks only when it is installable content underskills/, or when gap reads it (global/AGENTS.md, top-levelglobal/commands/*.md,gap.toml,gap.lock). Ignorednode_modulesand.DS_Storedo not block.
gap syncIt reports each file it wrote using the terminal or plain-text format.
Policy files are the shared rules. Each top-level global/commands/*.md is a slash-command prompt, copied unchanged as a whole file to Claude Code, Pi, and OMP. See how sync handles existing files.
The bundled /state-docs prompt writes project maps under docs/state. It follows the skill in a local clone of nessa-docs, found through NESSA_DOCS; see the prompt for arguments.
Each is a regular file, not a symlink. Start a new session in any agent to load the new rules.
gap sync asks before it appends the policy to a foreign file without a complete GAP marker pair, or replaces a foreign command file or a symlink. An empty file without a matching ledger entry also needs confirmation.
- Type
y. For a foreign regular policy file, sync copies it under~/.gap/backups/and appends the policy between<!-- gap:begin -->and<!-- gap:end -->. The rest of the file stays, so the harness keeps loading it. For a foreign command file, sync copies the old contents under~/.gap/backups/and replaces them. A policy symlink moves under~/.gap/recovery/; a command symlink moves under~/.gap/backups/. Sync writes a regular file in the link's place, so the harness loads the new file. - Later policy syncs replace only that block and do not ask again. An unchanged policy file stays in place. Before replacing a changed policy file, sync moves the previous file under
~/.gap/recovery/<dest-id>/<timestamp>/and prints that path; it keeps the 3 newest regular copies per destination and never prunes displaced symlinks. A concurrent edit retained only in that copy triggers a warning with the path. Existing regular policy files keep their permissions. Routine updates to managed command files replace their contents without saving the previous version. The full recovery rules are step 5 of the sync contract. - Rules you want every harness to follow still belong in
global/AGENTS.md. Text outside the policy markers stays in that file. Command edits belong in the matching source underglobal/commands/.
Any other answer leaves that file alone. With no terminal to ask in, such as an agent's shell, sync prints Refusing to replace foreign file, skips that file, publishes the rest, and exits 1. Run gap sync yourself in a terminal to answer.
The paths below use the default Codex home, ~/.codex. Substitute the absolute CODEX_HOME value if set. An empty CODEX_HOME counts as unset; a relative path is refused.
Codex has no rules folder. The first gap sync adds two hooks to ~/.codex/hooks.json, SessionStart and SubagentStart. They print ~/.codex/gap/global-agent-policy.md into every Codex session and subagent.
-
Open Codex and run
/hooks. Trust both GAP hooks. -
Start a session and a subagent. Confirm both see the policy.
-
If
~/.codex/AGENTS.mdstill holds an old copy of the policy, remove it:gap sync --remove-codex-legacy
The flag refuses unless both hooks were already in
hooks.jsonbefore that run. On a clean machine it reports that there's nothing to strip.
Grok has no file of its own. It reads the Claude copy when Claude compatibility is on, which is the default.
grok inspectLook for ~/.claude/rules/global-agent-policy.md in the global rules list. If it's missing, turn Claude compatibility back on. Don't add a Grok file. A second copy would load the policy twice.
Empryo reads ~/.empryo/EMPRYO.md, which already holds SoulStack's block. The first gap sync asks once to append the GAP block there, so run it from a terminal and type y. SoulStack's block and anything else in the file stay as they are.
Empryo injects every skill in skills.autoLoad in full into every prompt. GAP recommends two: do-todo (the policy tracks tasks every turn) and do-commit. Everything else loads by name when a task needs it. Until your skills.autoLoad list matches, gap sync prints the exact settings call. Ask an agent inside Empryo to run it. gap never changes Empryo's settings; it only writes its block in EMPRYO.md.
Empryo loads a project's AGENTS.md only when its instruction sources include codex (desktop: Settings > Instruction files > AGENTS.md (Codex)). EMPRYO.md loads on its own. While codex is off, gap status and gap sync print the settings call that adds it and leave ~/.empryo/config.json untouched. That source also reads ~/AGENTS.md, which is why GAP never creates one: a file there would sit above every project.
gap sync warns when ~/.empryo/skills/<name> differs from a managed skill and never changes that copy, because Empryo loads it first. A jcode copy that differs from the locked store is replaced with it. The drift-check contract says when, and what is left alone.
GAP's gap.toml and your ~/.config/gap/gap.toml select locked packages. Their skill lists and load levels are described under Load levels. The separate global/skills.json manifest is no longer used.
gap sync copies a default package's selected skills directly from the locked store into ~/.agents/skills and ~/.claude/skills. A package added with gap add installs where add put it: one copy in .agents/skills that each selected agent reads, a symlink to that copy in each other agent's skills folder, or a separate copy per agent with --copy. Harnesses that read none of these folders get no skills from GAP; the policy still reaches them. GAP's skill copying, drift repair, and restore do not use Node or npx. Project skills use the same paths under the invoking project instead of the home directory; see load levels.
Sync checks every selected skill against its locked store. Existing skills.sh installations are adopted in place when both destinations match that source: GAP records package ownership and removes only that skill's entry from the skills.sh lock. The lock is $XDG_STATE_HOME/skills/.skill-lock.json when XDG_STATE_HOME is set, otherwise ~/.agents/.skill-lock.json. Unrelated lock entries and fields stay intact. If GAP cannot save package ownership, adoption fails and restores the previous lock contents. If that restoration also fails, the error includes both failures and the lock path. Missing, unreadable, or malformed locks follow the migration failure contract. Edited copies go to drift review. For each drifted skill, sync shows the diff and asks:
kkeeps the installed copies for this run. Later runs check them again. An incomplete installation still exits1.ttakes the source. Sync backs up both destinations under~/.gap/backups/, then reinstalls. A failed install restores the previous destinations.sskips it for now. Sync exits1.
With no terminal to ask in, sync lists the drifted skills, leaves those copies in place, and exits 1. Skills outside the selected packages are never touched, including skills from a package that was removed from gap.toml; delete those copies by hand.
A package is a repo locked to one commit. gap.toml selects the default packages; gap.lock records the exact commits and trees. A package whose locked commit includes a gap-utility.toml takes its installation declarations from that manifest, so its entry needs only repo and ref; keeping install or doctor in that entry is refused. A default package whose locked commit lacks one lists its skills in names and may set install and doctor commands in its entry.
An optional path restricts skill lookup to that subtree of the locked checkout. For example, path = ".agents/skills" selects that variant when a repository contains multiple copies. Without path, lookup tries skills/ first, then the repository, choosing the shallowest matching folder and using lexical order to break ties.
GAP's gap.toml can narrow a manifest's skill list as described under Load levels. For example:
# gap.toml
schema = "2"
[components.do-skills]
repo = "github.com/edheltzel/Do-Skills"
ref = "master"
names = ["do-commit", "do-todo"]gap pin do-skills@master writes the requested ref, resolved commit, and tree to gap.lock. If a branch and tag share a name, use refs/heads/<name> or refs/tags/<name> to choose one. Machine sync fetches the locked commit into ~/.gap/store/<id>/<commit>/, checks its tree against the lock, and installs the selected skills as described above. Sync never moves a locked version. A package missing from gap.lock stops the sync and names the gap pin command to run. gap.toml and gap.lock pass the same merge gate as global/.
gap pin confirms the new locked version, shows the old and new commits when it moves, or reports that it is already current. A new or moved locked version includes a reminder to run gap sync to install it.
gap list shows where each package is configured, so you know which file to edit.
| Column | Shows |
|---|---|
config |
The file that declares the package, then (+ <file>, ...) for each file that overrides it. ~ is your home, ./ the current project |
source |
user for packages you added, default for packages a GAP checkout's own gap.toml lists. GAP ships none, so a standard install shows only user |
| Package | Declared in | Edit it with |
|---|---|---|
default (forks only) |
The checkout's own gap.toml |
Change it in the fork. Override it in ~/.config/gap/gap.toml or the project's .gap/gap.toml |
user (gap add, global or project) |
~/.config/gap/gap.toml |
gap add, gap remove, or that file |
A project's .gap/gap.toml and a profile only override a package; they never declare one. gap list reads the overrides of the project you run it in.
Example: ~/.config/gap/gap.toml (+ ./.gap/gap.toml) is a package you added that this project overrides.
Piped output ends with a CONFIG column holding the full path of the declaring file, without overrides. A script that splits each row into a fixed list of fields now gets that path in its last field, so read --format json instead. A file is listed as an override only when it changes a setting, so a project file that repeats the values already in effect is not listed. Agent output (--format json) adds config, the full declaring path, and overrides, a list of full paths that is empty when nothing overrides the package.
GAP updates the way lazy.nvim does. gap.toml says what you want (a ref), gap.lock records the commit installed, and only an update moves the lock.
| lazy.nvim | GAP |
|---|---|
Startup installs from lazy-lock.json |
gap sync installs from gap.lock and never moves a locked version |
:Lazy check and its checker |
gap check [id] fetches each ref into ~/.gap/cache/<id>.git (history only, no file contents) and lists the commits after the locked version. It records the counts in ~/.gap/check.json; gap status shows them offline as new=N while the locked version is unchanged |
:Lazy update |
gap update [id] moves each locked version to the newest commit on its ref and prints the commits it brings in |
:Lazy restore |
gap restore [id] |
pin = true |
pin = true in a package's table. Update and check skip it unless it is named |
| Update refuses a plugin with local changes | Sync upgrades a skill copy without asking when it equals that skill in an earlier commit of the same package under ~/.gap/store/<id>/, including a skills.sh install, which it adopts. A copy that matches no earlier commit was edited, and the drift choices apply |
A default package's new locked version is written to gap.lock in the GAP checkout, the same way gap pin writes it. Commit gap.lock and merge it; the merge gate refuses gap sync until then. After the merge, gap sync installs the new commit. A package added with gap add keeps its locked version in ~/.config/gap/gap.lock, so gap update installs it right away.
GAP ships the policy only, with no default packages: gap.toml declares no packages, and its comments show how to add one. Add every package with gap add; gap search lists the known ones. Recall and Echo have empty skill lists: machine sync runs their install commands from their verified stores, and those installers own their skills and runtime prerequisites. Hook timing and state are described under Hooks and trust. Gap copies no skills from them and never installs a harness.
gap doctor runs each configured doctor command from its verified locked store, then reports harness presence using PATH. Missing locked versions, missing or changed stores, and failed doctors produce exit 1; doctor does not fetch missing packages.
Doctor also records the adapters Echo reports in ~/.gap/state.json, when the locked Echo supports that report. GAP never installs or removes adapters itself; the full rule is in the gap contract.
gap status checks package source checkouts and selected package skills, using the locked ref when there is one. It does not check Recall's memory database. store=missing means the checkout is absent, store=changed means its source files differ from the locked version, and store=unpinned means gap.lock has no entry. For these states, it prints the matching repair command. Ignored, untracked build output does not change the result; tracked edits, deletions, and mode changes still do. Skill drift is checked only when the source checkout matches the lock; an unreadable checkout reports an error.
Status and gap restore [id] use the same package overrides and skill selection as sync. gap restore do-skills repairs that package's selected missing or drifted skills without asking; omit the id to repair all packages. Restore backs up replaced copies and rolls them back if installation fails. A verified store avoids network access.
Restore names each repaired skill and the locked commit it came from, then reports the total restored. If nothing needs repair, it reports how many selected skills were checked, or that none were selected. An id limits that confirmation to the requested package.
| Scope | Config | Where skills go | How to use it |
|---|---|---|---|
| Global | ~/.config/gap/gap.toml |
~/.agents/skills, plus each selected agent's own global folder |
gap add -g owner/repo, or a default package's skill with the default load |
| Project | <repo>/.gap/gap.toml |
<repo>/.agents/skills, plus each selected agent's project folder |
gap add owner/repo (the default, or -p, --local) inside the repo, or a default package's skill with load = "project" and a matching when.files |
gap add -g owner/repo # global: every project sees its skills
cd ~/code/site
gap add owner/repo # only this repo gets its skills
cd ~/code/app
gap add owner/repo # add the same utility to a second repoA per-project add records repo, ref, and load = "project" under the package in ~/.config/gap/gap.toml, and load = "project" with the repo's selection (names, agents, copy, subagents, and each renamed skill's from) under [components.<id>] in the repo's .gap/gap.toml, creating that file the way gap init does when it is missing. Each repo keeps its own selection. gap sync and gap update inside an opted-in repo keep its copy current; elsewhere they install no skills for that package. A package's commands, hooks, and MCP servers stay machine-wide in both scopes. One id is either global or per project: gap remove <id> removes it from every repo it was added to, moving each project copy to ~/.gap/backups/<time>/projects/, and then it can be added again in the other scope. A project file can also leave any package out of that repo with enabled = false.
A package's skills are the skills in its gap-utility.toml, or its names array when its repo has no manifest. names beside a manifest narrows that list. An optional [components.<id>.skills.<name>] table selects how an existing name installs:
load |
Installation |
|---|---|
listed (default), always |
Install in the home-directory skill destinations |
project |
Install under the invoking project only when any when.files glob matches |
command, off |
Not selected for installation by sync or restore |
For example, a do-astro selection can use load = "project" with when.files = ["astro.config.*"]. Globs are relative to the invoking project's Git root, or the current directory outside Git. do-no-comments uses load = "project" with no when.files, so it installs only in a project whose .gap/gap.toml opts in:
[components.do-skills.skills.do-no-comments.when]
files = ["*"]Sync, status, restore, and doctor read the installed default gap.toml, then ~/.config/gap/gap.toml, then the invoking project's .gap/gap.toml. Later values win. gap sync --profile <name> applies GAP's profiles/<name>.toml last. A project with profile = "crew" also loads the crew profile on later runs.
Overrides can replace an existing package's enabled, pin, ref, and color, or a listed skill's load and when.files. Only ~/.config/gap/gap.toml can add a package, and gap add writes that entry for you; see Add a package. A later enabled = true can re-enable a package. when.files replaces the earlier list. For example:
[components.recall]
enabled = false
[components.do-skills.skills.do-astro]
load = "project"
[components.do-skills.skills.do-astro.when]
files = ["astro.config.*", "apps/site/astro.config.*"]Overrides never write either lock. If an overridden ref differs from the locked ref, the command stops: use gap pin <id>@<ref> for a default package, or gap update <id> for a user package. On the TUI Projects view, that hint for a project other than the one gap tui started in begins with cd <its folder> &&, so it works pasted anywhere, and y copies it. For a project folder inside another Git repo, gap update reads the enclosing root's settings, so the hint points to gap status at that root instead. The default-package gap pin command includes the requested ref and remains available to copy. If that pin conflicts with the enclosing root's ref override, the TUI warns that moving the shared lock will break status there.
gap sync groups its work as policy (policy and global commands) and each enabled package id (default or user). A package's skills, commands, and MCP servers belong to its package group. With both stdin and stdout attached to a terminal, it opens a picker with every group checked: space toggles a group, and enter syncs the checked groups. Only enter syncs: ctrl+c, a termination signal, or submitting with no groups checked writes nothing. A TERM=dumb terminal gets the line prompt below instead.
After selection, terminal output shows a framed plan, phase headers, progress lines, and a final result. Written paths use ~ for your home directory. Piped output keeps the plain preview and progress lines, for example:
gap sync will:
policy publish AGENTS.md to 7 harness files and 1 command
do-skills 66 skills @ master (abc1234)
echo run its installer @ v0.13.0 (def5678)
gh-axi 1 skill @ main (fed4321)
With terminal input and either TERM=dumb or piped output, sync prints the preview before asking [a]ll, [c]hoose, [q]uit; c asks [Y/n/q] about each group. Press enter to submit each answer. An empty submitted line means all at the first prompt and yes at each group prompt. Entering q, choosing no groups, or reaching end of input (EOF), even after typing a partial answer, prints Nothing synced., writes nothing, and exits 0.
For scripts, gap sync --skip do-skills,gh-axi, gap sync --only policy, or gap sync --yes skip the question. --only and --skip are mutually exclusive. Without terminal input, every group syncs unless a flag leaves it out. Agent mode needs one of these flags (--yes with the crew profile) and otherwise fails with INTERACTION_REQUIRED before writing; its retry and next steps name the groups, never a bare gap sync. A skip lasts for one run; to leave a package out of every sync, add [components.<id>] with enabled = false to ~/.config/gap/gap.toml.
To add a whole package for yourself, run gap add. To add a skill from an existing package, add its name to that package's names array in gap.toml. For another default source, add a package with its repo, ref, and names, then run gap pin <id>@<ref>. Follow the merge and publish steps.
Run gap init --adopt [dir] for an existing project, or gap init [dir] for a new one; dir defaults to the current directory. Both create .gap/gap.toml when it is missing, using profile = "project" and the directory name as the slug, and add a short policy pointer to AGENTS.md. A new slug must be valid UTF-8; control characters are escaped as needed in the TOML file. --adopt leaves an existing AGENTS.md exactly as it is and lists the agent, Forge, task, and stack files it found. When Recall is installed, init records gap provisioned <slug> in it once per project. Init never runs the Forge interview. The full rules, including refusals and Recall errors, are in the gap contract.
For cloud agents, run gap sync --profile crew. It uses the same protected project-file writes, creating missing configuration with profile = "crew". The crew profile excludes Recall and Echo; this sync skips home publication, store fetching, package installers, and skill installation. Commit the project files for the cloud agent. With an effective crew profile, status reports crew: project files only and restore writes nothing.
A package is any git repository or local folder of skills; each skill is a folder with a SKILL.md that has a name and a description. gap add takes the sources and flags of npx skills add, then locks the repo the way a lazy.nvim plugin is locked, so gap sync, update, status, restore, and remove manage what it installed:
gap add owner/repo # this repo; asks which skills, agents, and scope
gap add owner/repo -g -y # every project, every detected agent, no prompts
gap add owner/repo -s web-design # one skill; owner/repo@web-design does the same
gap add owner/repo#v2 -a claude-code -a cursor
gap add owner/repo@v1.2.0 # a version tag; branches use #branch
gap add https://gitlab.com/group/repo/-/tree/main/skills
gap add ./my-skills --copy # a folder inside a git repository
gap add owner/repo --list # show the skills and install nothing| Flag | What it does |
|---|---|
-g, --global / -p, --project, --local |
Install for every project, or into the repo you run it in (the default with -y). Without either, add asks |
-a, --agent <ids...> |
Agents to install to, by skills.sh id (claude-code, cursor, codex, ...); '*' for all. Default: the agents found on this machine, plus every agent that reads .agents/skills |
-s, --skill <names...> |
Skills to install; '*' for all. Without it, add asks unless the source has one skill or -y is set |
-y, --yes / --all |
No prompts. --all also selects every skill and every agent |
--copy |
A separate copy in each agent folder instead of one copy plus symlinks |
-l, --list |
List the source's skills and exit; writes nothing but the locked checkout |
--rename <name> |
Install the one selected skill under another name |
--full-depth |
Search the whole repo instead of the usual skill folders |
--subagent <names...> |
Eve subagents to install to; root is the root agent |
--json |
With -y, print one JSON result per skill on stdout |
--id <id> |
Package id; the default is the repo name, lowercased |
A source is owner/repo, owner/repo/path/to/skills, a GitHub, GitLab, or Azure Repos URL (a tree URL picks the ref and folder), git@host:path, an ssh:// or https:// git URL, or a local folder inside a git repository, where gap locks the current commit and notes uncommitted changes it leaves out. Download links, well-known skill sites, and Notion pages are refused because gap locks a git commit. A private GitHub repo that refuses HTTPS is retried over SSH.
gap add resolves the ref (the default branch unless the source names one), locks the commit in ~/.config/gap/gap.lock, records the repo in ~/.config/gap/gap.toml, and installs the selected skills. A repo with a gap-utility.toml offers the skills its manifest lists and also installs its commands, MCP servers, and hooks; without one, add finds skills the way skills.sh does. Add reads nothing outside the locked checkout: a skill folder, SKILL.md, search folder, or discovery file (skills-lock.json, skills.sh.json, .claude-plugin/marketplace.json, .claude-plugin/plugin.json) that resolves outside it through a symlink is skipped unread. These files are yours: they never touch GAP's gap.toml or gap.lock, and the sync merge gate does not cover them. An id a default package already uses is refused, even when disabled. policy and manifest are reserved ids. A skill name another package already installs in the same place is refused; --rename installs it under another name. A per-skill load = "project" is available only to default packages. Disabling a package skips installation while keeping it available to gap list, gap update, and gap remove.
Running gap add again for the same id merges: the new skills, agents, and subagents join the recorded ones, and the latest copy mode applies to every unedited installed skill. A package added per project keeps its locked commit when you add it to another project; gap update moves the locked version. A different repo, path, ref, or scope under the same id is refused with the --id to use instead. Inside a project whose .gap/gap.toml sets the package's ref, the re-add compares and locks that ref, the one gap update locks there, and leaves the ref in ~/.config/gap/gap.toml as it was. Re-adding a package that is disabled here is refused: nothing is installed, and the registration and shared lock stay unchanged. Re-add checks the selected skills against the fetched version, both with and without project overrides for a global package. A project cannot hide a missing global skill by setting its load to off. Skills selected implicitly by the candidate manifest must also be free of ownership conflicts at their install destination. If either configuration selects a home skill, no other package may claim it in either configuration. To exclude a conflicting skill, set names and remove per-skill overrides for excluded names. A project-only skill in a separate checkout does not reserve its name under home. If home is the project root and the skill's base file rule matches there, it claims the home copy even when you run gap add -g from another checkout. If home is nested inside a Git checkout, the rule is evaluated at that checkout's root, not at home. Malformed selection, target, color, or when.files values report the file and key. A failed validation leaves the configuration and lock untouched. For a per-project package, --list uses the locked commit when the source, path, and effective ref match. If the refs differ, it previews the requested source instead. If malformed project config prevents checking the match, an explicit #ref can still be previewed; without one, --list reports the config error. A local re-add reports the commit it uses, even when the lock differs from the checkout. Add prints the installation summary and asks before it writes, then confirms the package id, ref, and commit, and flags skipped installation steps when registration succeeded but installation is incomplete.
A global re-add also checks the project settings at home's resolved root. A missing when.files match stops new installs; it does not release an installed copy. GAP checks occupied install destinations and any old copies it would move. If you change an agent's directory, local edits or nested skills in its former copy stay in place and do not block installation at a free new destination. If no other package claims the skill, either a record for that path or contents matching the package's verified current or previous version establishes ownership. If another package declares the skill, GAP needs both: identical contents alone do not identify the owner. Another package's recorded or selected skill remains off limits. Content checks follow agent links to the canonical copy and do not depend on today's load rule or agent directory. Empty destinations remain available.
If ownership is uncertain, GAP leaves the skill in place. Reinstate a missing when.files match in the named project before restoring its package, or exclude the skill from the re-add. For a category, exclude the conflicting name so its nested skills stay installed. Only an unclaimed standalone skill gets a move-aside command: it saves a manual copy in a fresh directory under ~/.gap/, or renames a link beside the original so its relative target still works.
# ~/.config/gap/gap.toml, as written by gap add -g owner/repo -s web-design -a claude-code -a codex
[components.repo]
repo = "github.com/owner/repo"
ref = "main"
names = ["web-design"]
agents = ["claude-code", "codex"]A repo with a manifest omits names while every manifest skill is selected, so new manifest skills install on update. copy = true records copy mode. [components.<id>.skills.<name>] from = "<original>" records the skill's name in the repo when it differs from the installed folder name: a --rename, or a name like Web Design that installs as web-design. Two selected skills that would install under one folder name are refused; --rename one of them.
| Step | Command | What happens |
|---|---|---|
| Install from the lock | gap sync |
Installs every package at its locked commit, like the default packages. Sync never moves a locked version |
| Update | gap update [id] |
Moves every requested locked version to the newest commit on its effective ref before installing enabled packages. A skill copy you did not edit moves to the new version; an edited copy is kept and gap restore <id> takes the new one. Hook timing follows the manifest reference |
| See what is added | gap list |
See List packages for the columns and which file to edit |
| Remove | gap remove <id> |
Runs the uninstall hook, unregisters its MCP servers, moves the skills and commands GAP placed for it into one ~/.gap/backups/<time>/ folder, and drops its config entry, locked version, and record. An edited copy is named in the output |
Update reports each package's lock change or that it is up to date, then totals the packages checked, updated, and up to date. Those counts describe locked versions; the summary also flags failed updates or skipped installation steps. Once packages are selected, failures still print the summary and name packages whose locked versions were not checked. Without an id, update first moves the locked versions of default packages as described in Update packages. With no added packages, it then says so and shows gap add owner/repo.
Before installing any package, update verifies every requested source checkout, including disabled packages, and rebuilds missing or corrupt caches even when the locked version is already current. Update compares each skill with its last copied version, tracked separately from hook completion in ~/.gap/state.json. If an update hook fails, fix its cause and rerun gap update [id]: installation retries even when the locked version is already current.
GAP removes only the files it recorded for that package in ~/.gap/state.json, keeping files another source still selects. If it cannot determine remaining package selections from verified local checkouts, removal stops before running the uninstall hook; run gap sync before retrying. If a successfully installed, untrusted package has an install hook and no uninstall hook, gap remove warns that it cannot undo what the installer did. A failing or unapproved uninstall hook stops gap remove before anything moves. Successful removal confirms the package id and, when files were moved, the backup folder.
A package's hooks are shell commands from someone else's repo, so GAP shows the command and asks [y/N] whenever it needs to run one. Approval applies to that execution. MCP registrations can launch a package's code, so they use the same trust setting and ask separately before registering or re-registering servers. With no terminal, untrusted hooks and registrations are skipped and the command exits 1. During add, update, or sync, skills and commands still install when a hook or registration is skipped. Successful install and update hooks, and completed installations needing no hook, are recorded in ~/.gap/state.json so repeating the same locked version skips the hook. An installation needing no hook is complete only after its selected skills, commands, and MCP steps succeed. The hook choice on a lock change is defined in the manifest reference.
To stop the questions for a repo or an owner you trust, the way you trust a Homebrew tap, list it in your config:
# ~/.config/gap/gap.toml
[trust]
repos = ["owner/repo", "edheltzel/*"]A trusted repo runs its hooks with no prompt and no warning. Default packages are trusted: GAP's gap.toml already passes the merge gate.
Any repo with skill folders installs with gap add. Put a gap-utility.toml at its root to fix the skill list by folder name and to ship commands, hooks, or MCP servers as well. A minimal manifest:
schema = "1"
name = "my-tools"
description = "Skills and a command for my workflow"
skills = ["my-skill"]
commands = ["commands/my-command.md"]
[hooks]
install = "./scripts/install.sh"
uninstall = "./scripts/uninstall.sh"
[mcp.my-tools]
command = ["node", "{store}/mcp/server.js"]
env = ["LOG_LEVEL=info"]| Key | Required | Meaning |
|---|---|---|
schema |
yes | Always "1" |
name |
yes | Display name |
description |
no | One line about the package |
skills |
no | Skill names. Each needs a <name>/SKILL.md folder in the repo, such as skills/<name>/SKILL.md. gap add installs them for the agents the user picks |
commands |
no | Repo paths of .md command files. GAP copies each by basename, unchanged, into ~/.claude/commands, ~/.pi/agent/prompts, and ~/.omp/agent/commands |
hooks.install |
no | Runs on the first installation and on later lock changes when update is absent |
hooks.update |
no | Replaces install when installing a different locked version after a first successful installation |
hooks.uninstall |
no | Runs on gap remove from the last successfully installed version, before GAP moves its files; skipped if no installation succeeded or an earlier removal attempt already ran the hook successfully. It must undo the effects of install and update outside GAP's skill and command files |
hooks.doctor |
no | Runs on gap doctor |
mcp.<name> |
no | One MCP server. Set exactly one of command (a nonempty string array) or url (an http:// or https:// URL). Command servers may also set env (KEY=value strings). {store} in command arguments and environment values becomes the locked checkout path |
A manifest needs at least one skill, command, hook, or MCP server. Unknown keys are refused, so a typo fails at gap add instead of being ignored. Hooks run with sh -c from the verified checkout for that version in ~/.gap/store/<id>/<commit>/; treat that folder as read-only. Exit 0 is success. Any other exit fails that package, makes the command exit 1, and leaves the hook to run again next time. Command basenames must be unique within a package and across registered packages and global/commands/. Names of previously copied commands remain reserved until the owning package is removed.
Command publication stops if a registered user package's manifest cannot be resolved from a verified local checkout, even when that package is disabled or skipped for this run.
During add, sync, and update, GAP registers MCP servers through each installed harness's own CLI: claude mcp add --scope user, codex mcp add, and pi mcp add. Registration follows Hooks and trust. OMP, Cursor, and Empryo get none yet. A missing CLI is skipped for new registrations; if GAP already owns a server in that harness, a missing CLI makes the command exit 1 and preserves its ownership.
First registration uses CLAUDE_CONFIG_DIR (default: your home directory), CODEX_HOME (default: ~/.codex), or PI_CODING_AGENT_DIR (default: ~/.pi/agent). Empty overrides use those defaults; nonempty overrides must be absolute paths. GAP records each server's configuration target in ~/.gap/state.json. Later checks, updates, and removal use that recorded target even if the environment changes.
Sync and update leave an unchanged registered server in place, remove and re-add it when its expanded declaration changes, and restore it if it is missing. A lock change only requires re-registration when it changes the expanded declaration, such as a command containing {store}. A server name you already configured in a harness, or one another package owns, is left alone and reported, and the command exits 1. If a failed add command nevertheless writes a registration, GAP retains ownership for later removal.
GAP unregisters recorded servers through the harness CLIs when the manifest drops them or on gap remove. Removal happens before skills and commands move to backup. If MCP removal fails, gap remove exits 1, retains the package's config entry and locked version, and records which servers still need removal. Resolve the reported failure and retry gap remove <id>.
GAP keeps no skill source. Do-Skills supplies the do-* and marketing skills, locked in gap.toml and gap.lock; its README holds the catalog and the human docs for each skill. See Packages for the other sources and their installation rules.
| Agent | File it reads | Commands |
|---|---|---|
| Claude | ~/.claude/rules/global-agent-policy.md |
~/.claude/commands/ |
| Pi | ~/.pi/agent/APPEND_SYSTEM.md |
~/.pi/agent/prompts/ |
| OMP | ~/.omp/agent/APPEND_SYSTEM.md |
~/.omp/agent/commands/ |
| Codex | ~/.codex/gap/global-agent-policy.md ($CODEX_HOME/gap/global-agent-policy.md when nonempty), printed by the SessionStart and SubagentStart hooks |
none |
| Cursor | ~/.cursor/rules/global-agent-policy.mdc |
none |
| Empryo | ~/.empryo/EMPRYO.md, beside the SoulStack block. The first sync asks once, so run it from a terminal. |
none |
| jcode | ~/.jcode/prompt-overlay.md ($JCODE_HOME/prompt-overlay.md when set; must be absolute, and set but empty is refused) |
none |
| Grok | No file of its own. It reads the Claude copy. | none |
The sync contract defines ledger fingerprints, legacy-file recognition, and Cursor frontmatter handling.
Claude searches parent folders for CLAUDE.md. A file at ~/CLAUDE.md sits above every project, and it stops Claude from reading that project's AGENTS.md. The Claude rules file above already covers every project.
go test ./...The test builds gap inside a throwaway clone of this repo and runs it against a temporary home folder. It never touches your real agent files. It exits 0 when every check passes.







