Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

feat(skills): built-in skills come from a repository and are baked into the image

richard-epsillad8eba9d69115
diff --git a/Dockerfile b/Dockerfile
index b0361e3b..177d66d2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -60,9 +60,9 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
curl ca-certificates git bash tini \
&& rm -rf /var/lib/apt/lists/*
-# Document preview. The built-in harnesses ship docx/pptx/xlsx skills, so agents produce those
-# files routinely — and a presentation you can only download is a worse answer than one you can
-# look at. Browsers render none of them, so the console asks the gateway for a PDF rendition and
+# Document preview. The built-in skills create .docx/.pptx/.xlsx routinely, and LibreOffice is
+# also how those become a PDF — the officecli skill's own PDF export needs a plugin that is not
+# installed. A presentation you can only download is a worse answer than one you can look at. Browsers render none of them, so the console asks the gateway for a PDF rendition and
# LibreOffice headless is what makes it. Impress/Writer/Calc only, no recommends: the full
# libreoffice metapackage drags in Java and a desktop stack for no benefit here.
ARG WITH_DOC_PREVIEW=1
@@ -95,6 +95,19 @@ RUN grep -viE "^(azure-|azure_)" /app/gateway/requirements.txt > /app/gateway/re
&& pip install --no-cache-dir -r /app/gateway/req.local.txt \
&& pip install --no-cache-dir -r /app/runner/requirements.txt
+# Built-in skills, from their own repository. Pinned by ref so two builds of the same image tag
+# ship the same catalogue; HR_SKILLS_REF=<sha> for an exact pin, WITH_BUILTIN_SKILLS=0 for none.
+ARG WITH_BUILTIN_SKILLS=1
+ARG HR_SKILLS_REPO=https://github.com/HarnessRouter/skills.git
+ARG HR_SKILLS_REF=main
+ENV HR_BUILTIN_SKILLS_DIR=/opt/harnessrouter/skills
+COPY docker/install-skills.sh /tmp/install-skills.sh
+RUN chmod +x /tmp/install-skills.sh \
+ && WITH_BUILTIN_SKILLS="$WITH_BUILTIN_SKILLS" HR_SKILLS_REPO="$HR_SKILLS_REPO" \
+ HR_SKILLS_REF="$HR_SKILLS_REF" HR_SKILLS_DIR=/opt/harnessrouter/skills \
+ /tmp/install-skills.sh \
+ && rm -f /tmp/install-skills.sh
+
COPY gateway/ /app/gateway/
COPY runner/ /app/runner/
COPY docker/entrypoint.sh /app/entrypoint.sh
@@ -109,7 +122,8 @@ COPY --from=ui /ui/public /app/ui/public
# runtime user is unprivileged and owns the workspace and data volume.
RUN useradd -m -u 10001 agent \
&& mkdir -p /data \
- && chown -R agent:agent /data /app
+ && chown -R agent:agent /data /app \
+ && chmod -R a+rX /opt/harnessrouter/skills
USER agent
EXPOSE 3000
diff --git a/docker/install-skills.sh b/docker/install-skills.sh
new file mode 100644
index 00000000..e238a8eb
--- /dev/null
+++ b/docker/install-skills.sh
@@ -0,0 +1,90 @@
+#!/usr/bin/env bash
+# Bake the built-in skills into the image.
+#
+# The catalogue lives in its own repository (HarnessRouter/skills) rather than here, because a
+# skill is content that changes on its own schedule: adding one should not mean a change to the
+# gateway, and the set an image ships should be inspectable without reading a Dockerfile.
+#
+# skills.json in that repo decides what ships (`include`) and what a new Harness starts with
+# (`default_enabled`). This script honours `include` and copies `default_enabled` through to the
+# manifest the gateway reads at run time. It never asks the network for anything afterwards:
+# everything a skill needs is installed here, at build time, because a task has no internet.
+set -euo pipefail
+
+REPO="${HR_SKILLS_REPO:-https://github.com/HarnessRouter/skills.git}"
+REF="${HR_SKILLS_REF:-main}"
+DEST="${HR_SKILLS_DIR:-/opt/harnessrouter/skills}"
+
+if [ "${WITH_BUILTIN_SKILLS:-1}" != "1" ]; then
+ echo "skills: WITH_BUILTIN_SKILLS=0 — none bundled"
+ mkdir -p "$DEST"
+ echo '{"skills":[]}' > "$DEST/manifest.json"
+ exit 0
+fi
+
+SRC="$(mktemp -d)"
+trap 'rm -rf "$SRC"' EXIT
+
+echo "skills: cloning $REPO @ $REF"
+git clone -q --depth 1 --branch "$REF" "$REPO" "$SRC" 2>/dev/null \
+ || { git clone -q "$REPO" "$SRC" && git -C "$SRC" checkout -q "$REF"; }
+echo "skills: source commit $(git -C "$SRC" rev-parse --short HEAD)"
+
+mkdir -p "$DEST"
+
+# One pass over skills.json: copy every included folder, and emit the manifest the gateway serves.
+# jq is not assumed to be present, so Python (which the image has, and which already parses this
+# file's format) does the reading.
+python3 - "$SRC" "$DEST" <<'PY'
+import json, pathlib, shutil, sys
+
+src, dest = pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2])
+manifest = json.loads((src / "skills.json").read_text())
+
+out = []
+for entry in manifest.get("skills", []):
+ name = entry.get("name") or ""
+ if not name or not entry.get("include"):
+ print(f"skills: skipping {name or '(unnamed)'} — include is false")
+ continue
+ folder = src / name
+ if not (folder / "SKILL.md").is_file():
+ raise SystemExit(f"skills: {name} is in skills.json but has no {name}/SKILL.md")
+ shutil.copytree(folder, dest / name, dirs_exist_ok=True)
+ out.append({
+ "name": name,
+ "title": entry.get("title") or name,
+ "description": entry.get("description") or "",
+ "default_enabled": bool(entry.get("default_enabled")),
+ "origin": entry.get("origin") or "",
+ })
+ print(f"skills: bundled {name} (default_enabled={bool(entry.get('default_enabled'))})")
+
+(dest / "manifest.json").write_text(json.dumps({"skills": out}, indent=2))
+print(f"skills: {len(out)} bundled")
+PY
+
+# Dependencies, declared by the skills themselves. Union across every bundled skill so a shared
+# package is installed once.
+APT=$(cat "$DEST"/*/apt-packages.txt 2>/dev/null | sed 's/#.*//' | tr -d '\r' | awk 'NF' | sort -u || true)
+if [ -n "$APT" ]; then
+ echo "skills: apt install $(echo "$APT" | tr '\n' ' ')"
+ apt-get update -y
+ # shellcheck disable=SC2086
+ apt-get install -y --no-install-recommends $APT
+ rm -rf /var/lib/apt/lists/*
+fi
+
+PIPREQ=$(cat "$DEST"/*/requirements.txt 2>/dev/null | sed 's/#.*//' | tr -d '\r' | awk 'NF' | sort -u || true)
+if [ -n "$PIPREQ" ]; then
+ echo "skills: pip install $(echo "$PIPREQ" | tr '\n' ' ')"
+ echo "$PIPREQ" | pip install --no-cache-dir -r /dev/stdin
+fi
+
+for s in "$DEST"/*/install.sh; do
+ [ -f "$s" ] || continue
+ echo "skills: running $(basename "$(dirname "$s")")/install.sh"
+ bash "$s"
+done
+
+echo "skills: done — $DEST"
diff --git a/gateway/app.py b/gateway/app.py
index def1ae9d..69d9450b 100644
--- a/gateway/app.py
+++ b/gateway/app.py
@@ -23,8 +23,10 @@ import uuid
import zipfile
import base64
+import functools
import hashlib
import mimetypes
+import pathlib
import shutil
import subprocess
import tarfile
@@ -2204,14 +2206,22 @@ async def _harness_plugins(harness_id: str, org: str, hdr_vals: dict[str, str] |
skills_out: list[dict] = []
suppressed: list[str] = [] # built-in skill names this harness disabled (runner skips mounting them)
+ builtins = _builtin_skills()
+ seen: set[str] = set()
for sk in own + inherited:
name = sk.get("name") or sk.get("id")
if not name:
continue
+ seen.add(name)
if str(sk.get("enabled")) in ("False", "false", "0"):
suppressed.append(name) # present-and-disabled → suppress the inherited built-in of this name
continue
files = sk.get("files")
+ # An entry naming a built-in and carrying no files of its own is the harness switching that
+ # built-in ON (it is stored only when the answer differs from the image's default). Its
+ # content comes from the image, so a Harness never holds a stale copy of a bundled skill.
+ if not files and not sk.get("content") and not sk.get("blob") and name in builtins:
+ files = builtins[name]["files"]
# Large skill bundles (the Agent Skills folders exceed the 64k vertex-prop cap) live in a
# blob; the vertex prop carries only {name, enabled, blob}. Resolve the full files here.
if not files and sk.get("blob"):
@@ -2224,6 +2234,13 @@ async def _harness_plugins(harness_id: str, org: str, hdr_vals: dict[str, str] |
if not (files or sk.get("content")):
continue
skills_out.append({"name": name, "files": files, "content": sk.get("content")})
+
+ # Built-ins the harness never mentions: on when the image says so. Implicit, so the set follows
+ # the image rather than whatever was true when the Harness was created.
+ for name, meta in sorted(builtins.items()):
+ if name not in seen and meta["default_enabled"]:
+ skills_out.append({"name": name, "files": meta["files"], "content": None})
+
disabled_tools = [t for t in _arr("disabled_tools") if isinstance(t, str)]
return mcp_out, skills_out, suppressed, disabled_tools
@@ -6332,6 +6349,64 @@ async def test_mcp_public(body: McpTestBody, request: Request) -> dict:
return await _mcp_list_tools(body.url, token)
+# ── Built-in skills ───────────────────────────────────────────────────────────────────────────
+# Baked into the image from HarnessRouter/skills (see docker/install-skills.sh). Read from disk,
+# never hard-coded: the console used to carry its own list of four "built-in skills" that existed
+# nowhere, with Replace and Disable buttons beside them acting on nothing.
+#
+# A built-in is implicit — a Harness stores nothing to use one. It stores an entry only to turn a
+# default-off skill ON, or a default-on skill OFF. So changing what the image ships changes every
+# Harness at once, and no Harness carries a stale copy of a skill's files.
+_BUILTIN_SKILLS_DIR = os.environ.get("HR_BUILTIN_SKILLS_DIR", "/opt/harnessrouter/skills")
+_SKILL_FILE_MAX = 2 * 1024 * 1024 # per file; a skill is instructions, not a data set
+
+
[email protected]_cache(maxsize=1)
+def _builtin_skills() -> dict:
+ """{name: {"title","description","default_enabled","origin","files":[{path,content|content_b64}]}}
+
+ Empty when the image was built without them (WITH_BUILTIN_SKILLS=0), which is a supported
+ build, not an error — callers must render that honestly rather than as "none configured"."""
+ root = pathlib.Path(_BUILTIN_SKILLS_DIR)
+ manifest = root / "manifest.json"
+ if not manifest.is_file():
+ return {}
+ try:
+ entries = json.loads(manifest.read_text()).get("skills", [])
+ except Exception: # noqa: BLE001 — a corrupt manifest must not take the gateway down
+ print(f"[skills] unreadable manifest at {manifest}", flush=True)
+ return {}
+
+ out: dict = {}
+ for e in entries:
+ name = (e.get("name") or "").strip()
+ folder = root / name
+ if not name or not (folder / "SKILL.md").is_file():
+ print(f"[skills] {name or '(unnamed)'} in manifest but not on disk — skipped", flush=True)
+ continue
+ files: list[dict] = []
+ for f in sorted(folder.rglob("*")):
+ if not f.is_file():
+ continue
+ rel = f.relative_to(folder).as_posix()
+ raw = f.read_bytes()
+ if len(raw) > _SKILL_FILE_MAX:
+ print(f"[skills] {name}/{rel} exceeds {_SKILL_FILE_MAX} bytes — skipped", flush=True)
+ continue
+ try: # text where possible, so the stored form stays readable
+ files.append({"path": rel, "content": raw.decode()})
+ except UnicodeDecodeError:
+ files.append({"path": rel, "content_b64": base64.b64encode(raw).decode()})
+ if not files:
+ continue
+ out[name] = {"title": e.get("title") or name, "description": e.get("description") or "",
+ "default_enabled": bool(e.get("default_enabled")),
+ "origin": e.get("origin") or "", "files": files}
+ if out:
+ print(f"[skills] {len(out)} built-in: {', '.join(sorted(out))}", flush=True)
+ return out
+
+
# ── custom harnesses (per-org, server-persisted; replaces the client localStorage seam) ───────
# ── base harness catalog ─────────────────────────────────────────────────────────────────
# What each base IS. The console used to carry its own copy of this — models, tools, skills and
@@ -6696,9 +6771,13 @@ async def list_bases(request: Request) -> dict:
for m in cat.get("models", [])],
"tools": [{"name": n, "label": lbl, "enforcement": b["tool_enforcement"]}
for n, lbl in b["tools"]],
- # Honest emptiness: see the docstring. `builtinSkillsEnumerable` lets the console say
- # "this base brings its own" instead of implying the base has none at all.
- "builtinSkills": [],
+ # Skills bundled into the image, which every base can use. A base ALSO discovers
+ # skills of its own at run time that nothing outside a turn can enumerate, so
+ # `builtinSkillsEnumerable` stays False: the console must say "and it brings its own"
+ # rather than presenting this list as everything the agent has.
+ "builtinSkills": [{"name": n, "title": b2["title"], "description": b2["description"],
+ "defaultEnabled": b2["default_enabled"], "origin": b2["origin"]}
+ for n, b2 in sorted(_builtin_skills().items())],
"builtinSkillsEnumerable": False,
})
return {"bases": out}
diff --git a/ui/src/app/(app)/harnesses/[id]/page.tsx b/ui/src/app/(app)/harnesses/[id]/page.tsx
index 1061325b..c31fa9b9 100644
--- a/ui/src/app/(app)/harnesses/[id]/page.tsx
+++ b/ui/src/app/(app)/harnesses/[id]/page.tsx
@@ -93,7 +93,9 @@ export default function HarnessSettingsPage() {
const readOnly = Boolean(oob);
const skills = draft?.skills || [];
const ownSkills = skills.map((s, idx) => ({ s, idx })).filter(({ s }) => isOwnSkill(s));
- const baseSkillNames = (srvBase?.builtinSkills || []).filter((n) => !ownSkills.some(({ s }) => s.name === n));
+ // Built-ins the harness has not replaced with one of its own. A built-in is implicit: the
+ // harness stores an entry only when its answer differs from the image's default.
+ const baseSkills = (srvBase?.builtinSkills || []).filter((b) => !ownSkills.some(({ s }) => s.name === b.name));
const disabledTools = new Set(draft?.disabledTools || []);
const stats = statsFor(cards);
@@ -224,7 +226,7 @@ export default function HarnessSettingsPage() {
<section className="form-section">
<div><h3>Skills</h3><p>Add Harness-specific workflows, replace inherited Skills, or disable capabilities this agent should not use.</p></div>
<div className="field-stack">
- <div className="section-actions"><strong>{ownSkills.length + baseSkillNames.length} configured Skills</strong>
+ <div className="section-actions"><strong>{ownSkills.length + baseSkills.length} configured Skills</strong>
{!readOnly && <button className="button small" type="button" onClick={() => setNewSkill({ name: '' })}>
<iconify-icon icon="tabler:plus"></iconify-icon>Add Skill</button>}</div>
<div className="capability-list">
@@ -241,12 +243,16 @@ export default function HarnessSettingsPage() {
</div>
</div>
))}
- {baseSkillNames.map((n) => {
- const off = skills.some((s) => s.name === n && s.enabled === false && !isOwnSkill(s));
+ {baseSkills.map((b) => {
+ const n = b.name;
+ const stored = skills.find((s) => s.name === n && !isOwnSkill(s));
+ // No stored entry means the image's default applies.
+ const off = stored ? stored.enabled === false : !b.defaultEnabled;
return (
<div key={'inh-' + n} className="capability-row">
<span className="capability-icon"><iconify-icon icon="tabler:bulb"></iconify-icon></span>
- <div className="capability-copy"><strong>{n}</strong><span>Inherited from {base?.name}</span></div>
+ <div className="capability-copy"><strong>{b.title || n}</strong>
+ <span>{b.description || 'Built in'}</span></div>
<div className="capability-actions">
{!readOnly && <button className="button quiet small" type="button" onClick={() => {
if (!draft) return;
@@ -257,13 +263,21 @@ export default function HarnessSettingsPage() {
setEditSkillIdx(rest.length);
}}>Replace</button>}
<button className="toggle-button" type="button" disabled={readOnly} aria-pressed={!off}
- onClick={() => upd({ skills: off ? skills.filter((s) => !(s.name === n && s.enabled === false)) : [...skills, { id: 'skl_' + crypto.randomUUID().replace(/-/g, ''), name: n, enabled: false }] })}>
+ onClick={() => {
+ const rest = skills.filter((s) => !(s.name === n && !isOwnSkill(s)));
+ // Store an entry only when the harness disagrees with the image's
+ // default; agreeing with it stores nothing, so the harness keeps
+ // following the image as the bundled set changes.
+ const want = off; // clicking flips it to this
+ upd({ skills: want === b.defaultEnabled ? rest
+ : [...rest, { id: 'skl_' + crypto.randomUUID().replace(/-/g, ''), name: n, enabled: want }] });
+ }}>
{off ? 'Disabled' : 'Enabled'}</button>
</div>
</div>
);
})}
- {ownSkills.length === 0 && baseSkillNames.length === 0 && (
+ {ownSkills.length === 0 && baseSkills.length === 0 && (
<div className="capability-row">
<span className="capability-icon"><iconify-icon icon="tabler:bulb"></iconify-icon></span>
<div className="capability-copy"><strong>No Skills added yet</strong>
diff --git a/ui/src/lib/harness.ts b/ui/src/lib/harness.ts
index dd1b9976..d8ccc12e 100644
--- a/ui/src/lib/harness.ts
+++ b/ui/src/lib/harness.ts
@@ -139,13 +139,15 @@ export const oobDefaultModel = (o: OobHarness | null | undefined): string => {
};
export interface BaseTool { name: string; label: string; enforcement: 'hard' | 'instruction' }
+export interface BuiltinSkill { name: string; title: string; description: string; defaultEnabled: boolean; origin: string }
export interface BaseInfo {
id: string; label: string; backend: string; status: string; systemPrompt: string;
defaultModel: string;
models: { id: string; available: boolean; default: boolean }[];
tools: BaseTool[];
- /** Built-in skills the SERVER can enumerate. Empty when it cannot — see builtinSkillsEnumerable. */
- builtinSkills: string[];
+ /** Skills bundled into the image, which any harness can use. `defaultEnabled` is what a NEW
+ * harness starts with; a harness that stored its own answer overrides it. */
+ builtinSkills: BuiltinSkill[];
/** false means the base brings its own skills but nothing outside a turn can list them. The UI
* must say that rather than render an empty list as "this base has no skills". */
builtinSkillsEnumerable: boolean;