Document portable agent skill installation

cyph3rasi
2026-07-11 14:50:39 -07:00
parent 7249dc7e32
commit d950f05429
10 changed files with 105 additions and 56 deletions
+27 -10
@@ -1,16 +1,26 @@
# Codex Desktop and agent workflow # Agent integrations and workflow
## Codex Desktop ## Skill-based integration
Users type into Codex normally. The installed skill makes prompt capture the A compatible agent skill makes prompt capture the agent's first repository
agent's first repository action: action. The integration supplies a stable agent and session identity. In a
POSIX shell:
```bash ```bash
hop begin --agent codex --heredoc <<'HOP_PROMPT_EOF' hop begin --agent my-agent --session stable-session-id --heredoc <<'HOP_PROMPT_EOF'
<exact visible user message> <exact visible user message>
HOP_PROMPT_EOF HOP_PROMPT_EOF
``` ```
In PowerShell:
```powershell
$hopPrompt = @'
<exact visible user message>
'@
$hopPrompt | hop begin --agent my-agent --session stable-session-id --heredoc
```
The agent adopts the returned `HOP_STATE_ID`, `HOP_TASK_ID`, The agent adopts the returned `HOP_STATE_ID`, `HOP_TASK_ID`,
`HOP_ATTEMPT_ID`, and `HOP_WORKSPACE`, then confines reads, commands, edits, and `HOP_ATTEMPT_ID`, and `HOP_WORKSPACE`, then confines reads, commands, edits, and
tests to that workspace. tests to that workspace.
@@ -26,15 +36,22 @@ hop land R_... -- go test ./...
No second landing authorization is requested unless the user explicitly asks No second landing authorization is requested unless the user explicitly asks
for review-first behavior. for review-first behavior.
Desktop capture stores the agent's verbatim transcription of the visible Skill-based capture stores the agent's verbatim transcription of the visible
message and its attachment references. Because the skill runs after Codex message and its attachment references. Because the skill runs after the client
receives the message, it cannot prove byte-for-byte fidelity with the raw receives the message, it cannot prove byte-for-byte fidelity with the raw
submission. A trusted prompt-submission hook or controller is the deterministic submission. A trusted prompt-submission hook or controller is the deterministic
capture boundary. capture boundary.
### Codex Desktop example
The bundled Codex integration uses `CODEX_THREAD_ID` as its stable session key,
defaults the agent name to `codex`, and lets the user type normally. Its bundle
is installed at `${CODEX_HOME:-~/.codex}/skills/hop`; the same files are also
installed at `~/.agents/skills/hop` for compatible clients.
## Follow-up messages ## Follow-up messages
A later `hop begin` with the same Codex task session checkpoints existing A later `hop begin` with the same integration session checkpoints existing
workspace effects, appends a new prompt state, and continues the same attempt workspace effects, appends a new prompt state, and continues the same attempt
while that work remains unfinished. If Hop prepares reconciliation, the session while that work remains unfinished. If Hop prepares reconciliation, the session
follows its fresh workspace. After the result lands, the next prompt starts a follows its fresh workspace. After the result lands, the next prompt starts a
@@ -60,8 +77,8 @@ follow-ups use:
hop prompt --from P_... --heredoc hop prompt --from P_... --heredoc
``` ```
This provides a stronger pre-delivery boundary than a Desktop skill, which can This provides a stronger pre-delivery boundary than an agent-side skill, which
only guarantee capture before project effects. can only guarantee capture before project effects.
## Agent rules ## Agent rules
+4 -4
@@ -25,7 +25,7 @@ mirrored at `refs/hop/accepted`.
- prompt/task/attempt identity; - prompt/task/attempt identity;
- typed state edges and accepted lineage; - typed state edges and accepted lineage;
- evidence tied to exact source trees; - evidence tied to exact source trees;
- session heads for Desktop follow-ups; - session heads for interactive-agent follow-ups;
- materialized-root state; and - materialized-root state; and
- immutable audit events. - immutable audit events.
@@ -46,9 +46,9 @@ initialization when `.hop` is already tracked as user-owned project content.
## Acceptance consistency ## Acceptance consistency
Acceptance is serialized and compare-and-swapped. SQLite is authoritative; Acceptance is serialized and compare-and-swapped. SQLite is authoritative;
derived Git refs can be repaired by `hop doctor --repair`. Desktop landing also derived Git refs can be repaired by `hop doctor --repair`. Visible-root landing
tracks which accepted state is physically visible, allowing safe catch-up with also tracks which accepted state is physically visible, allowing safe catch-up
`hop sync` without treating a divergent folder as disposable. with `hop sync` without treating a divergent folder as disposable.
For the full product direction, read the For the full product direction, read the
[product blueprint](https://githop.xyz/GnosysLabs/Hop/src/branch/main/docs/product-blueprint.md). [product blueprint](https://githop.xyz/GnosysLabs/Hop/src/branch/main/docs/product-blueprint.md).
+5 -4
@@ -18,7 +18,7 @@ release.
| Command | Purpose | | Command | Purpose |
|---|---| |---|---|
| `hop init [path]` | Initialize Hop without moving the Git branch or index | | `hop init [path]` | Initialize Hop without moving the Git branch or index |
| `hop begin ...` | Desktop entry point: initialize if needed, capture prompt, continue session | | `hop begin ...` | Interactive-agent entry point: initialize if needed, capture prompt, continue session |
| `hop prompt ...` | Controller-managed prompt or follow-up capture | | `hop prompt ...` | Controller-managed prompt or follow-up capture |
| `hop checkpoint STATE` | Freeze current attempt progress | | `hop checkpoint STATE` | Freeze current attempt progress |
| `hop check STATE -- COMMAND...` | Validate an immutable checkpoint | | `hop check STATE -- COMMAND...` | Validate an immutable checkpoint |
@@ -49,15 +49,16 @@ release.
| `hop history` | Accepted lineage | | `hop history` | Accepted lineage |
| `hop version` | Installed version | | `hop version` | Installed version |
## Skill distribution ## Agent integration bundle
```bash ```bash
hop skill install [--path SKILLS_DIR] [--force] hop skill install [--path SKILLS_DIR] [--force]
hop skill print hop skill print
``` ```
Without `--path`, the skill installs under Without `--path`, Hop installs the same Hop-managed skill files at
`${CODEX_HOME:-~/.codex}/skills/hop`. `~/.agents/skills/hop` and `${CODEX_HOME:-~/.codex}/skills/hop`. With `--path`,
it installs only to `SKILLS_DIR/hop`.
## Exit codes ## Exit codes
+8 -7
@@ -22,9 +22,10 @@ different moments and causal roles.
A task groups the prompts and attempts pursuing one user outcome. Follow-up A task groups the prompts and attempts pursuing one user outcome. Follow-up
messages pursuing unfinished work stay connected automatically through messages pursuing unfinished work stay connected automatically through
`CODEX_THREAD_ID`. Once that outcome is accepted, the next message starts a new a stable session ID supplied by the integration. Codex Desktop supplies
Hop task at the latest accepted state even when the Codex conversation stays `CODEX_THREAD_ID` automatically. Once that outcome is accepted, the next message
open. starts a new Hop task at the latest accepted state even when the client
conversation stays open.
## Attempt and workspace ## Attempt and workspace
@@ -54,7 +55,7 @@ state but intentionally leaves the visible folder unchanged.
## Visible root ## Visible root
The visible root is the project directory selected in Codex. Hop only The visible root is the project directory selected in an agent client or passed
materializes into it when it still matches an accepted Hop ancestor. Untracked, as the controller's working directory. Hop only materializes into it when it
ignored, staged, or ordinary file divergence that could be overwritten causes a still matches an accepted Hop ancestor. Untracked, ignored, staged, or ordinary
fail-closed error. file divergence that could be overwritten causes a fail-closed error.
+21 -11
@@ -1,18 +1,27 @@
# Getting started # Getting started
## Use Hop from Codex Desktop ## Use Hop with an agent integration
1. [Install Hop](Installation). 1. [Install Hop](Installation).
2. Restart Codex Desktop if it was already open. 2. Select an existing Git project in a compatible agent client, or make it the
3. Select an existing Git project as the Codex working directory. controller's working directory.
4. Ask Codex to make a normal change. 3. Ask the agent to make a normal change.
That is the full user workflow. Do not manually create `.hop`, route the prompt That is the full user workflow. Do not manually create `.hop`, route the prompt
through a terminal, or tell Codex to work inside `.hop/workspaces`. The Hop skill through a terminal, or tell the agent to work inside `.hop/workspaces`. A Hop
does that coordination for the agent. integration does that coordination for the agent.
The skill is eligible for implicit activation on every repository task. Mention Without `--path`, `hop skill install` writes the same Hop-managed skill files to
`$hop` in the task if you want deterministic explicit activation. `~/.agents/skills/hop` and `${CODEX_HOME:-~/.codex}/skills/hop`. Compatible
runtimes can use the shared bundle. An explicit `--path` installs only to the
requested skills directory.
### Codex Desktop example
Restart Codex Desktop after installing or upgrading the skill, select a Git
project, and ask Codex to work normally. The skill is eligible for implicit
activation on every repository task; mention `$hop` for deterministic explicit
activation.
## What happens on the first task ## What happens on the first task
@@ -37,7 +46,7 @@ hop history
hop doctor hop doctor
``` ```
A normal Desktop result reports `Root: synchronized`. A normal interactive result reports `Root: synchronized`.
## Ask for review before landing ## Ask for review before landing
@@ -48,9 +57,10 @@ local code change. To stop at a proposal, say one of the following in the task:
- `proposal only` - `proposal only`
- `do not land` - `do not land`
## Use another agent runtime ## Connect another agent runtime
Install the embedded skill into that runtime's skills directory: If a compatible runtime does not read `~/.agents/skills`, install the embedded
bundle into that runtime's skills directory:
```bash ```bash
hop skill install --path /path/to/agent/skills --force hop skill install --path /path/to/agent/skills --force
+5 -4
@@ -10,7 +10,7 @@ visible project folder.
- [Installation](Installation) - [Installation](Installation)
- [Getting started](Getting-Started) - [Getting started](Getting-Started)
- [Core concepts](Core-Concepts) - [Core concepts](Core-Concepts)
- [Codex Desktop and agent workflow](Agent-Workflow) - [Agent integrations and workflow](Agent-Workflow)
- [Parallel agents and conflict resolution](Parallel-Agents-and-Conflicts) - [Parallel agents and conflict resolution](Parallel-Agents-and-Conflicts)
## Reference and operations ## Reference and operations
@@ -36,9 +36,10 @@ Windows PowerShell:
irm https://githop.xyz/GnosysLabs/Hop/raw/branch/main/scripts/install.ps1 | iex irm https://githop.xyz/GnosysLabs/Hop/raw/branch/main/scripts/install.ps1 | iex
``` ```
Restart Codex Desktop, open a Git project, and ask Codex to work normally. The Open a Git project in a compatible agent client and work normally. The installed
installed skill activates Hop before the agent inspects or changes the project; skill bundle activates Hop before the agent inspects or changes the project;
there is no separate prompt router and no required manual `hop init` step. controllers can invoke the same protocol directly. Codex Desktop is a bundled
integration, and there is no required manual `hop init` step.
Hop is currently an alpha. Keep Git history and normal backups, read release Hop is currently an alpha. Keep Git history and normal backups, read release
notes before upgrading, and report unexpected behavior with `hop doctor` output notes before upgrading, and report unexpected behavior with `hop doctor` output
+19 -8
@@ -16,7 +16,11 @@ The installer:
3. downloads `checksums.txt` and verifies SHA-256 before extraction; 3. downloads `checksums.txt` and verifies SHA-256 before extraction;
4. installs the CLI to `~/.local/bin/hop`; 4. installs the CLI to `~/.local/bin/hop`;
5. adds `~/.local/bin` to `.zprofile` or `.profile` when necessary; and 5. adds `~/.local/bin` to `.zprofile` or `.profile` when necessary; and
6. runs `hop skill install --force` for Codex. 6. runs `hop skill install --force` to install the bundled agent integration.
The no-path skill command writes the same Hop-managed skill files to
`~/.agents/skills/hop` and `${CODEX_HOME:-~/.codex}/skills/hop`. The second path
supports Codex Desktop; compatible clients can use the shared `.agents` path.
Review before execution: Review before execution:
@@ -32,7 +36,7 @@ Installer options are environment variables:
|---|---|---| |---|---|---|
| `HOP_VERSION` | `latest` | Release tag such as `v0.1.0` | | `HOP_VERSION` | `latest` | Release tag such as `v0.1.0` |
| `HOP_INSTALL_DIR` | `~/.local/bin` | Binary destination | | `HOP_INSTALL_DIR` | `~/.local/bin` | Binary destination |
| `HOP_INSTALL_SKILL` | `1` | Set to `0` to skip Codex skill installation | | `HOP_INSTALL_SKILL` | `1` | Set to `0` for a CLI-only or custom integration |
| `HOP_MODIFY_PATH` | `1` | Set to `0` to leave shell profiles unchanged | | `HOP_MODIFY_PATH` | `1` | Set to `0` to leave shell profiles unchanged |
| `HOP_GITEA_URL` | `https://githop.xyz` | Gitea instance base URL | | `HOP_GITEA_URL` | `https://githop.xyz` | Gitea instance base URL |
| `HOP_REPOSITORY` | `GnosysLabs/Hop` | Alternate Gitea owner/repository | | `HOP_REPOSITORY` | `GnosysLabs/Hop` | Alternate Gitea owner/repository |
@@ -52,15 +56,15 @@ irm https://githop.xyz/GnosysLabs/Hop/raw/branch/main/scripts/install.ps1 | iex
``` ```
The script verifies the Windows archive, installs to The script verifies the Windows archive, installs to
`%LOCALAPPDATA%\Programs\Hop`, updates the user PATH, and installs the Codex `%LOCALAPPDATA%\Programs\Hop`, updates the user PATH, and installs the shared and
skill. To pin a version after downloading the script: Codex-compatible skill bundles. To pin a version after downloading the script:
```powershell ```powershell
.\install.ps1 -Version v0.1.0 .\install.ps1 -Version v0.1.0
``` ```
Use `-SkipSkill` only when another agent runtime will receive the skill. Use Use `-SkipSkill` for a CLI-only or separately managed integration. Use `-SkipPath`
`-SkipPath` when another tool manages your PATH. when another tool manages your PATH.
## Go install ## Go install
@@ -71,7 +75,8 @@ go install githop.xyz/GnosysLabs/Hop/cmd/hop@latest
hop skill install --force hop skill install --force
``` ```
Put `$(go env GOPATH)/bin` on PATH if `hop` is not found. Put `$(go env GOPATH)/bin` on PATH if `hop` is not found. The second command
installs both default skill bundles; omit it for a CLI-only installation.
## Build from source ## Build from source
@@ -87,6 +92,12 @@ install -m 755 hop "$HOME/.local/bin/hop"
Source builds are intended for contributors and as a pre-release fallback. Source builds are intended for contributors and as a pre-release fallback.
To install only one compatible runtime target, pass its parent skills directory:
```bash
hop skill install --path /path/to/agent/skills --force
```
## Verify ## Verify
```bash ```bash
@@ -95,5 +106,5 @@ hop help
git --version git --version
``` ```
If Codex Desktop was open during installation, restart it. See Restart any agent client that was open while its skill bundle changed. See
[Getting started](Getting-Started) next. [Getting started](Getting-Started) next.
+2 -1
@@ -40,7 +40,8 @@ scripts/release-local.sh --snapshot
Inspect `dist/` and test at least one archive on each operating system family. Inspect `dist/` and test at least one archive on each operating system family.
Confirm `hop version` reports the snapshot/tag-injected version and Confirm `hop version` reports the snapshot/tag-injected version and
`hop skill install --force` installs usable skill files. `hop skill install --force` installs identical Hop-managed files at both
default skill destinations while preserving unrelated user files.
## Create a release ## Create a release
+6 -4
@@ -13,14 +13,16 @@ printf '%s\n' "$PATH"
The default Unix location is `~/.local/bin`. On Windows it is The default Unix location is `~/.local/bin`. On Windows it is
`%LOCALAPPDATA%\Programs\Hop`. `%LOCALAPPDATA%\Programs\Hop`.
## Codex does not activate Hop ## An agent integration does not activate Hop
```bash ```bash
hop skill install --force hop skill install --force
``` ```
Restart Codex Desktop. Mention `$hop` in a task as a deterministic activation The command refreshes both default skill bundles. Restart the agent client. For
fallback. Codex Desktop, mention `$hop` in a task as a deterministic activation fallback.
For another compatible runtime, confirm that it reads `~/.agents/skills` or run
`hop skill install --path /path/to/agent/skills --force`.
## The installer cannot find a release ## The installer cannot find a release
@@ -55,7 +57,7 @@ workspace, and rerun the check.
Hop found visible files or index state it will not overwrite. Preserve those Hop found visible files or index state it will not overwrite. Preserve those
changes. Capture them as a new Hop task or resolve them intentionally, then changes. Capture them as a new Hop task or resolve them intentionally, then
retry `hop land`. Do not bypass this with `hop accept` in Desktop workflows. retry `hop land`. Do not bypass this with `hop accept` in interactive workflows.
## Internal ref or object warning ## Internal ref or object warning
+8 -3
@@ -2,7 +2,8 @@
## Upgrade packaged installations ## Upgrade packaged installations
Rerun the installer. It replaces the binary and refreshes the embedded skill: Rerun the installer. It replaces the binary and refreshes both default skill
bundles:
```bash ```bash
curl -fsSL https://githop.xyz/GnosysLabs/Hop/raw/branch/main/scripts/install.sh | sh curl -fsSL https://githop.xyz/GnosysLabs/Hop/raw/branch/main/scripts/install.sh | sh
@@ -31,7 +32,7 @@ hop skill install --force
hop doctor hop doctor
``` ```
Restart Codex Desktop when the installed skill changed. Restart any agent client whose installed skill changed.
## Upgrade Go installations ## Upgrade Go installations
@@ -46,12 +47,13 @@ Hop opens and migrates older supported SQLite schemas automatically. Back up
important repositories before alpha upgrades and read the release notes for any important repositories before alpha upgrades and read the release notes for any
one-way schema change. one-way schema change.
## Uninstall the CLI and skill ## Uninstall the CLI and skill bundles
Unix default: Unix default:
```bash ```bash
rm -f "$HOME/.local/bin/hop" rm -f "$HOME/.local/bin/hop"
rm -rf "$HOME/.agents/skills/hop"
rm -rf "${CODEX_HOME:-$HOME/.codex}/skills/hop" rm -rf "${CODEX_HOME:-$HOME/.codex}/skills/hop"
``` ```
@@ -59,9 +61,12 @@ Windows PowerShell:
```powershell ```powershell
Remove-Item -Force "$env:LOCALAPPDATA\Programs\Hop\hop.exe" Remove-Item -Force "$env:LOCALAPPDATA\Programs\Hop\hop.exe"
Remove-Item -Recurse -Force "$HOME\.agents\skills\hop"
Remove-Item -Recurse -Force "$HOME\.codex\skills\hop" Remove-Item -Recurse -Force "$HOME\.codex\skills\hop"
``` ```
If `CODEX_HOME` points somewhere else, remove its `skills\hop` directory instead
of `$HOME\.codex\skills\hop`. Remove any explicit `--path` target manually.
Remove the Hop install directory from PATH if it is no longer used. Remove the Hop install directory from PATH if it is no longer used.
Uninstalling the program does not delete project-local `.hop/` histories. That Uninstalling the program does not delete project-local `.hop/` histories. That