Agent skills¶
uh install writes two skills into your coding agents. Each skill tells the agent how to start a uh review and give you the URL. Supported agents: Claude Code, Codex, Antigravity, OpenCode and GitHub Copilot.
For the full flag table, see uh install in the CLI reference.
The skills¶
| Skill | Use it for | What the agent runs |
|---|---|---|
uhdiff-local-review |
Working tree changes, a commit range, or a branch diff against main |
uh queue add . ... then uh queue --open, or uh review . [RANGE] |
uhdiff-github-review |
A GitHub pull request URL | uh queue add <github-pr-url> then uh queue --open, or uh review <github-pr-url> |
Both skills tell the agent to run the server in the background and print the http://127.0.0.1:<port> URL.
uhdiff-local-review¶
The skill offers two options.
Option A, add to the review queue. Use this for a titled summary or several diffs:
uh queue add . --target main --head HEAD --title "Short summary" --body "Markdown overview..." --ephemeral
uh queue --open # or `uh queue` to print the localhost URL without opening a browser
- Leave out
--headto diff uncommitted working-tree changes against--target. --bodyis Markdown shown in theOverviewtab.--ephemeraladds a one-click Discard.
Option B, a single uh review:
| Scope | Command |
|---|---|
| Uncommitted changes (or the latest commit if the tree is clean) | uh review . |
Branch diff against main |
uh review . main...HEAD |
| Explicit range | uh review . <base>..<head> or uh review . --base <rev> --head <rev> |
| Patch file or stdin | uh review . --diff <path-or-dash> |
The skill also mentions --open, --ast-diff, --port <port> and --dump-html <path>.
uhdiff-github-review¶
- Confirm the PR URL (
https://github.com/<owner>/<repo>/pull/<number>or the GitHub Enterprise equivalent). - If
ghhas more than one account, pass--gh-account <login>, or save a default withuh config set default_gh_account <login>(see configuration). - Start the review with
uh queue add <github-pr-url>anduh queue --open, or withuh review <github-pr-url>(add--openor--ast-diffif wanted).
Explicit-only invocation¶
The agent runs these skills only when you ask. Three settings enforce this:
-
Each
SKILL.mdhas this frontmatter: -
Codex also gets
agents/openai.yamlin each skill directory: -
The body of each skill starts with "Explicit invocation only: Never trigger this skill automatically."
Install locations¶
All paths are relative to $HOME, or to the directory you pass with --home.
| Harness | --target |
Root | Files written |
|---|---|---|---|
| Claude Code | claude (alias claude-code) |
~/.claude/skills/ |
<skill>/SKILL.md, <skill>/.managed-by-uhdiff |
| Codex | codex |
~/.codex/skills/ |
<skill>/SKILL.md, <skill>/agents/openai.yaml, <skill>/.managed-by-uhdiff |
| Antigravity | antigravity (alias agy) |
~/.gemini/config/plugins/uhdiff/ |
plugin.json, skills/<skill>/SKILL.md, .managed-by-uhdiff |
| OpenCode | opencode |
~/.config/opencode/skills/ |
<skill>/SKILL.md, <skill>/.managed-by-uhdiff |
| GitHub Copilot | copilot |
~/.copilot/skills/ |
<skill>/SKILL.md, <skill>/.managed-by-uhdiff |
<skill> is uhdiff-local-review and uhdiff-github-review. Every harness except Antigravity gets one directory per skill. Antigravity gets one uhdiff plugin directory holding both skills and this plugin.json:
{
"name": "uhdiff",
"version": "0.1.0",
"description": "Explicit user-invoked skills for launching local and GitHub PR code reviews with uhdiff."
}
version is the uh binary version that wrote the file.
Choosing harnesses¶
--target accepts a comma-separated list (--target claude,codex), can be repeated, and accepts all.
If you leave out --target:
uh installtargets every detected harness.uh install --uninstalltargets all five harnesses, detected or not.
A harness counts as detected when its CLI is on PATH or one of its paths exists under the home directory:
| Harness | Program on PATH |
Or any of these exists |
|---|---|---|
| Claude Code | claude |
~/.claude, ~/.claude.json |
| Codex | codex |
~/.codex |
| Antigravity | agy |
~/.gemini/config, ~/.gemini/antigravity-cli, ~/.gemini/antigravity |
| OpenCode | opencode |
~/.config/opencode |
| GitHub Copilot | copilot |
~/.copilot |
--home turns off PATH probing
With --home <dir>, detection checks only paths under <dir>, not PATH. Without --home, uh reads $HOME and fails with HOME is not set; pass --home <path> explicitly if it is unset or empty.
If nothing is detected, nothing is written and the command exits 0:
uhdiff install: no supported agent harnesses detected (claude, codex, antigravity, opencode, copilot).
Pass `--target all` or `--target claude,codex,...` to target specific harnesses.
Preview with --dry-run¶
--dry-run reports changes without writing or deleting anything. Every output line starts with [dry-run]. With only ~/.claude and ~/.config/opencode present:
$ uh install --dry-run
[dry-run] uhdiff install summary:
claude (Claude Code ) : would install (/home/me/.claude/skills)
- uhdiff-local-review : would install
- uhdiff-github-review : would install
opencode (OpenCode ) : would install (/home/me/.config/opencode/skills)
- uhdiff-local-review : would install
- uhdiff-github-review : would install
Each harness line shows the result and root path, then one line per skill. Antigravity gets one uhdiff plugin line.
Re-running and upgrading¶
uh install writes a .managed-by-uhdiff marker into each directory it manages. On every run, uh checks each target directory:
| State of the target directory | Install | Uninstall |
|---|---|---|
| Missing | installed (dry run: would install) |
not present |
| Has the marker, contents match exactly | unchanged |
removed (dry run: would remove) |
| Has the marker, contents differ | updated (dry run: would update) |
removed (dry run: would remove) |
| No marker (yours) | skipped (user-owned) |
skipped (user-owned) |
- Running it again with nothing changed reports
unchangedand writes nothing. - After you upgrade
uh, runuh installagain to replace managed skills. Any edit to a managed file, or any extra file in a managed directory, counts as different. The next install overwrites the whole directory. - An update builds the new directory beside the old one, then renames it into place.
- To keep your own edits, delete
.managed-by-uhdifffrom that directory. Thenuh installanduh install --uninstallleave it alone.
$ uh install --target claude
uhdiff install summary:
claude (Claude Code ) : unchanged (/home/me/.claude/skills)
- uhdiff-local-review : unchanged
- uhdiff-github-review : unchanged
Uninstall¶
uh install --uninstall --dry-run # preview
uh install --uninstall # remove from all five harnesses
uh install --uninstall --target codex
Uninstall deletes only managed skill directories (or the Antigravity uhdiff plugin directory). It keeps the parent directory, such as ~/.claude/skills/. Harnesses with nothing installed report not present:
$ uh install --uninstall --dry-run
[dry-run] uhdiff uninstall summary:
claude (Claude Code ) : not present (/home/me/.claude/skills)
- uhdiff-local-review : not present
- uhdiff-github-review : not present
codex (Codex ) : not present (/home/me/.codex/skills)
- uhdiff-local-review : not present
- uhdiff-github-review : not present
antigravity (Antigravity ) : not present (/home/me/.gemini/config/plugins/uhdiff)
- uhdiff plugin : not present
opencode (OpenCode ) : not present (/home/me/.config/opencode/skills)
- uhdiff-local-review : not present
- uhdiff-github-review : not present
copilot (GitHub Copilot) : not present (/home/me/.copilot/skills)
- uhdiff-local-review : not present
- uhdiff-github-review : not present
Testing in a scratch home¶
--home points the install at another directory. Use it to see the exact files without touching your agent configuration: