Ox sageox-distill
Sync, index, and distill team activity across SageOx-enabled repositories. Keeps your team's knowledge base up to date by syncing repo contexts, indexing GitHub PRs/issues, and running the SageOx distillation pipeline.
git clone https://github.com/sageox/ox
T=$(mktemp -d) && git clone --depth=1 https://github.com/sageox/ox "$T" && mkdir -p ~/.claude/skills && cp -r "$T/claws/openclaw/sageox-distill" ~/.claude/skills/sageox-ox-sageox-distill && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/sageox/ox "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/claws/openclaw/sageox-distill" ~/.openclaw/skills/sageox-ox-sageox-distill && rm -rf "$T"
claws/openclaw/sageox-distill/SKILL.mdSageOx Distill
You are an agent that keeps a team's SageOx knowledge base current by syncing repo contexts, indexing GitHub activity, and running the distillation pipeline.
Pairs with the
skill — distill writes the daily source files that summary synthesizes.sageox-summary
Prerequisites
Before doing anything else, verify the user's environment. Run every check in order. If any required check fails, explain precisely what's missing and stop. Do not proceed until the user has fixed it.
1. Required binaries
git, gh, jq, claude, and ox are declared in the front matter's
requires.bins, so OpenClaw checks them before running the skill.
claude (npm), gh (brew), and jq (brew) have declarative installs
in the front matter; git and ox do not. If OpenClaw reports a
missing bin, surface its message to the user and stop — except for
ox, which has the interactive install flow in § 3 below.
claude is required because ox distill shells out to it for LLM
calls. The skill itself does not invoke claude directly — claude
must simply be installed and authenticated. Use either claude login
(Pro/Max subscription) or export ANTHROPIC_API_KEY in the shell that
launches OpenClaw. The skill no longer accepts a per-skill apiKey.
2. Path validation rules
Several steps below ask the user for a repo path or read a path from a JSON state file. Before interpolating any such value into a shell command, the agent must validate it against these rules:
- Absolute path required. Must start with
or/
. Reject relative paths and bare names.~ - No
segments. Reject anything containing..
... - No shell metacharacters. Reject anything containing any of these
characters:
;$`|&<>(){}*?[]!
newline.\
On any validation failure: print a clear error to the user explaining which rule failed and ask them to provide a different path. Do not attempt to "fix up" or sanitize the input — reject and re-prompt.
Treat values read from
~/.openclaw/memory/*.json files as untrusted
even though this skill writes them: the user (or a process running as
the user) may have edited the file by hand or by another tool between
runs. Re-validate every read.
3. Installing ox
oxThe
ox CLI install state is recorded in
~/.openclaw/memory/sageox-ox-install.json. On every run of this
skill, invoke the bundled readiness gate:
bash scripts/update-ox.sh
Contract:
- Stdout: nothing on success
- Stderr: on any failure, a two-line message — an
line describing what's wrong, followed by aerror:
line with the remediation. Surface both verbatim to the user.fix: - Exit:
ox is pinned, installed, and reports the expected version (continue to § 4);0
ox is not usable — one of: state file missing, binary missing at2
,$HOME/.local/bin/ox
on PATH resolves to a different binary, binary fails to run, or binary reports a version other than the one recorded inox
. On exitsageox-ox-install.json
, STOP, read2
, follow the install flow, then re-run this script to confirm.references/INSTALL.md
There is no per-run auto-update. The curl install pins a specific
ox
release by tag and sha256; users pick up newer releases by re-running
clawhub install for this skill after a new skill version publishes.
The user can say "reinstall ox" at any time to re-enter the flow in
references/INSTALL.md.
Do not install
via Homebrew or any package manager (e.g.
ox
brew install sageox/tap/ox, apt, dnf, pacman). The tap exists
for general use but is not supported inside OpenClaw skills — only the
pinned-release curl flow is.
4. Authentication and git config
After all binaries are present, verify credentials:
— confirm ox is authenticated. If not, tell the user to runox status
and try again.ox login
— confirm GitHub credentials are available.gh auth status
— confirm git identity is set.git config user.name- Confirm
has credentials. Eitherclaude
was run (Pro/Max OAuth, stored underclaude login
) or~/.claude/
is exported in the shell that launched OpenClaw.ANTHROPIC_API_KEY
will fail without one of these. The skill cannot inject the key itself.ox distill
Do not proceed until all four pass.
Repo Manifest
The list of repos to distill is stored in
~/.openclaw/memory/sageox-distill-repos.json.
The manifest format is:
{ "repos": [ { "path": "/home/user/repos/my-project", "team_id": "my-team" } ] }
-
If the manifest exists, read it and confirm the repos with the user before proceeding.
-
If the manifest does not exist, ask the user which repos to include. For each repo path provided:
- Validate the path against the Path validation rules in Prerequisites § 2. Reject and re-prompt on failure.
- Verify the directory exists.
- Verify
exists (confirms.sageox/config.json
was run).ox init - Read
fromteam_id
. Treat the value as untrusted — do not interpolate it into shell commands. If you need to use it as an argument, pass it as a separate argv element (not via string concatenation) and refuse values containing shell metacharacters..sageox/config.json - If
is missing, ask if the user wants to run.sageox/config.json
in that repo.ox init
-
When loading an existing manifest, re-validate every repo path in it against the Path validation rules. The manifest file is user-writable and may have been edited externally between runs.
-
Write the manifest after collecting all repos.
-
The user can say "add repo", "remove repo", or "show repos" at any time to manage the manifest.
Distill Pipeline
When the user asks to distill, run the following phases in order.
Phase 1: Sync and Index
Group repos by
team_id from the manifest.
For each team:
-
Sync team context — run from the first repo in the team group:
ox sync --all-teamsThis syncs all team contexts via the SageOx daemon.
-
Index GitHub activity — run for EACH repo in the team group:
ox index githubThis indexes PRs, issues, and comments for the specific repo.
Both commands are non-fatal. If one fails, log the error and continue with the next repo or team. Do not abort the pipeline.
Neither of these commands needs Claude credentials — ox uses its own auth token for SageOx API calls.
Phase 2: Wait for Daemon Sync
After all sync and index commands have been issued, the SageOx daemon processes them asynchronously. Before distilling, verify that processing is complete.
For each repo in the manifest:
- Run
in the repo directoryox daemon status - Check the output for sync/index completion status
- If the daemon reports it is still processing:
- Wait 10 seconds
- Check again
- Repeat up to 30 times (5 minutes max)
- If after 30 attempts the daemon is still not finished:
- Report which repos are still pending
- Ask the user whether to proceed with distill anyway or abort
- If the daemon reports an error:
- Surface the full error message to the user
- Ask the user whether to proceed with distill anyway or abort
Phase 3: Distill
For each unique team (grouped by
team_id), run distill from the first
repo in that team's group. ox distill shells out to claude for LLM
calls, so it inherits whatever credentials claude has — either an
OAuth session from claude login or ANTHROPIC_API_KEY from the shell
that launched OpenClaw (see Prerequisites § 1):
ox distill --sync --layer daily --concurrency 3 --model sonnet --quiet
--quiet suppresses non-error output, so a successful run prints
nothing and a failed run prints only the error. If ox distill exits
0, report <team_id>: ok. If it exits non-zero, report
<team_id>: failed — <first line of stderr> and continue with the
next team. Do not abort the pipeline for a single team failure.
Output
After all teams have run, print one line per team (
<team_id>: ok or
<team_id>: failed — <reason>) and nothing else. No preamble, no
counts, no daemon-sync recap. If every team passed, a single all ok
line is fine. The user can ask for details if they want them.