Repository navigation
docs(plans): canonical skill registry (3-phase proposal) - #46
Conversation
The dashboard's Install Skill dialog is freeform paste — there is no shipping path from the worker repo's skills/*/SKILL.md files to deployed agents. PR #45's expanded rain skill and new rain-create skill are in the gateway image but invisible to the dashboard; existing per-agent skill content never updates regardless of image upgrades. Plan introduces an explicit fourth layer (canonical skill registry): worker repo → image (with manifest) → /skills/bundled endpoint → agent workspace (provenance-tagged) Three phases, all scoped upfront: - Phase 1 (MVP): worker manifest generator + gateway endpoint; dashboard "Install from Canonical" path. Solves the immediate raingame problem. - Phase 2: drift detection between installed and canonical skills, one-click update, backwards-compat scan. - Phase 3: admin skill-matrix view, bulk update, opt-in auto-sync on redeploy. Locked decisions (per user input): - Commit to all 3 phases upfront. - Per-agent gateway endpoint (no central dashboard cache yet). - skills/manifest.json committed to git, verified by pre-commit + CI. Blocks the planned wallet-level rain_build_create_market gate (which needs reliable canonical provenance to enforce skill-based gating). No code changes. Awaiting Codex review. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Codex review: needs work before implementation approval. The overall registry direction is correct: worker-owned canonical skills, gateway-bundled manifest/body endpoints, dashboard install/update UI, and workspace provenance are the right architecture. The provenance file + bodyHash drift model is workable. Two design points should be corrected before implementation starts:
§11 currently recommends deferring until first boot. I would not make that the default. The current dashboard deploy flow already supports selected skills before the gateway container starts: If Phase 1 switches canonical discovery/install to only Recommendation: use a non-running source for first-boot installs. Preferred option is a dashboard release-record manifest/body keyed by image tag/SHA. A server-checkout fallback can work for MVP, but it has skew risk and should be documented. If Phase 1 intentionally handles only already-running agents, state that explicitly as a limitation.
§4 locks Recommendation: commit stable source metadata ( Answers to §11:
Sanity-check on ownership:
No automated tests run; this is a proposal-only docs PR. |
Addresses PR #46 review (#46): - §1 reframed: acknowledges the existing host-checkout shipping path from /opt/openclaw/skills to agent workspaces. The real gaps are no image-backed provenance, no bodyHash drift, no fleet update, not "no shipping path exists". - §4 decision changed: committed manifest carries source-side metadata only (no image-tag version). Runtime image metadata is attached by the gateway endpoint. bodyHash is the load-bearing identity. - §5.1 manifest schema split into committed (source) and runtime envelope (server-side wrap with imageTag/imageSha). - §5.3 version semantics rewritten — no version field in the committed manifest; image tag is runtime metadata. - §5.5 (new) documents the pre-boot install path and skew risk. - §6.1 worker: dropped env-var version from generator; added Dockerfile ARG/ENV for OPENCLAW_IMAGE_TAG / OPENCLAW_IMAGE_SHA. - §6.2 dashboard file paths corrected — skills UI/API is largely inline today, plan now acknowledges either inline edit or component extraction during implementation. - §7 Phase 2: timestamped backup on canonical-modified overwrite. - §8 Phase 3: bulk update gated on bodyHash match in current image; release-record-pinned first-boot installs replace host-checkout fallback. - §11 open questions resolved as recorded decisions per Codex's answers (don't defer first-boot; allow-with-warning + backup; separate body fetch; matrix shows reported version + bodyHash-gated bulk update). - §13 (new) documents interaction with the existing host-checkout path, including drift risk and the Phase 3 retirement path. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Thanks for the review — v2 pushed (commit 61e2ce0). Both design defects fixed and §11 questions converted to recorded decisions per your answers. What changed1. First-boot install path (Codex finding #1) §1 rewritten to acknowledge the existing host-checkout shipping path from The Phase 1 source resolution is now explicitly two-pronged:
Release-record-pinned first-boot installs moved into Phase 3 (§8), which retires the host-checkout path's role for canonical content. Until then we accept the skew risk and surface it via the 2. Committed manifest vs image-tag version conflict (Codex finding #2) §4 decision restructured: committed manifest carries source-side metadata only — no §5.1 shows the schema split (committed vs envelope) explicitly. §5.3 rewritten to make 3. §6.2 file paths (sanity-check) Acknowledged that the current dashboard skills UI/API is largely inline in Decisions recorded (§11)All four answers locked in per your read:
Re-review?If v2 reads correctly, no objection to closing this as approved plan-only and proceeding with implementation in the order from §9. Phase 1 splits cleanly into the worker PR ( The bodyHash-as-identity decision (§4 row 4) is the load-bearing claim — please confirm that's a clean choice given how drift detection composes downstream. |
|
Codex re-review of v2 ( Resolved:
One remaining load-bearing issue: §5.1 defines Recommendation: replace Related wallet-gate note: §12 says the gate checks Minor cleanup: §2 still says the manifest lists each skill’s “version” and writes After the hash/provenance wording is corrected, I have no objection to treating this as approved plan-only work and proceeding with the §9 branch sequence. |
Addresses PR #46 v2 re-review (#46): - bodyHash (body-only) replaced with contentHash over the full normalized SKILL.md including frontmatter. Frontmatter-only changes (description, emoji, requires.env) now surface as drift, since they are real skill-contract changes. Normalization: LF endings, trailing whitespace stripped per line, single trailing newline. - §2 leftover references to "version" / meta.source@version cleaned up to match the new hash + image-metadata terminology. - §12 wallet gate tightened to three-check policy: source/name match + trusted canonical hash + on-disk re-hash. Source/name alone is too weak since provenance files are user-writable. - §1 "body-hash drift" → "content-hash drift". - §4 decisions row 1: same wording fix. - §5.1/§5.2/§5.3/§6.1: every bodyHash reference → contentHash. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
v3 pushed (commit 0cdebdb). All three v2-review points addressed. Changes1.
Updated everywhere the old name appeared: §2, §4, §5.1, §5.2, §5.3, §6.1, §6.2, §7, §8, §11.4, §13. Earlier wording "body-hash drift" / "body hash" also rewritten. 2. §2 leftover terminology cleanup §2's bullets 1–5 rewritten to match the v2/v3 schema — 3. §12 wallet gate tightened Wallet gate now runs three checks before allowing a factory-create signature:
Source/name alone is too weak since provenance files are user-writable. The hash gate cryptographically pins wallet-allowed skills to manifest-vetted content. Re-review?If v3 reads correctly, treating this as approved plan-only and ready to start implementation per §9:
The |
) * feat(skills): canonical skill registry manifest + bundled endpoints Implements §6.1 of the canonical skill registry plan (PR #46, SHA 8686c48). - scripts/generate-skills-manifest.ts: walks skills/*/SKILL.md, parses frontmatter, computes sha256 contentHash over the full normalized SKILL.md (LF endings, trailing whitespace stripped per line, single trailing newline), writes skills/manifest.json. Also normalizes SKILL.md files on disk so the committed hash matches what is baked into the image. Skips skills without a valid metadata.openclaw block (canvas, healthcheck, skill-creator) with logged warnings. - skills/manifest.json: committed initial snapshot — 53 canonical skills, deterministic (sorted by name, keys sorted within each object). - src/gateway/routes/skills-bundled.ts: GET /skills/bundled returns the runtime envelope (manifest + imageTag/imageSha/sourceSha from build-time env vars OPENCLAW_IMAGE_TAG, OPENCLAW_IMAGE_SHA, OPENCLAW_SOURCE_SHA). GET /skills/bundled/:name returns the SKILL.md body. Both routes require gateway bearer auth. No filesystem traversal outside /app/skills/. - src/gateway/routes/skills-bundled.test.ts: 13 tests covering envelope shape, manifest-file consistency, contentHash verification, body-matches-disk, auth required, and unknown-name 404. - src/gateway/server-http.ts: wire skills-bundled handler into createGatewayHttpServer. - Dockerfile: add OPENCLAW_IMAGE_TAG, OPENCLAW_IMAGE_SHA, OPENCLAW_SOURCE_SHA ARG+ENV pairs for build-time provenance injection. - git-hooks/pre-commit: regenerate and validate manifest when any SKILL.md is staged. - .github/workflows/ci.yml: add skills-manifest-check job (pnpm skills:manifest:check). - package.json: add skills:manifest and skills:manifest:check npm scripts. - docs/skills-manifest.md: schema documentation. - skills/food-order/SKILL.md: quote description field to fix YAML parse error (unquoted colon in "Triggers: order food"). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(skills): address Codex v1 review on PR #47 Three blockers from #47: 1. skills/manifest.json now oxfmt-clean. Generator runs `pnpm exec oxfmt skills/manifest.json` as a post-step on write, so future regenerations stay format-compliant. --check mode writes to a tempfile, oxfmts it, and compares against committed (catches both content drift and formatter drift in one shot). 2. Generator now strict by default. Three non-canonical skill directories (canvas, healthcheck, skill-creator) are explicitly allowlisted; any OTHER directory that fails frontmatter parse or lacks metadata.openclaw is a hard error (exit 1). Also enforces `frontmatter.name === directory name` — a mismatch is an error for canonical entries (verified by temporarily editing rain SKILL.md's name field and observing exit 1). 3. /skills/bundled/:name now rejects extra path segments. Previously /skills/bundled/rain/anything served `rain`; now it returns 404 like /skills/bundled/foo/bar. Test (e) tightened to assert 404 across {trailing slash, extra segment, deep extras, extras with unknown leading name}. Validation: - pnpm skills:manifest → writes + oxfmts cleanly - pnpm skills:manifest:check → passes (53 skills, 3 allowlisted) - pnpm exec oxfmt --check skills/manifest.json → clean - pnpm test src/gateway/routes/skills-bundled.test.ts → 13/13 pass - strict mode confirmed: temporarily breaking rain SKILL.md name causes exit 1 with a clear error. Codex's finding #4 (build-and-push.sh ops change) is captured as a follow-up in the PR description — that script lives outside this repo, so it ships as a separate ops change before the post-merge image rebuild. Co-Authored-By: Claude Opus 4.7 <[email protected]> --------- Co-authored-by: Liran Peretz <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Summary
Proposal-only PR. Adds
docs/plans/canonical-skill-registry.md. No code or skill changes yet.Why now
Verifying PR #45 on raingame exposed that the dashboard's
Install Skilldialog is freeform paste — it has no awareness of skills bundled in the gateway image. PR #45's expanded rain skill + new rain-create are present in the image (/app/skills/) but invisible in the dashboard UI. The worker repo'sskills/*/SKILL.mdfiles are effectively documentation; nothing ships them to agents.Concretely: even after a successful image rollout (
v2026.05.24.1), raingame's workspace still has the PR #19-era rain skill, and rain-create is absent. The only operator workflow to fix this today is copy-paste per agent.This also blocks the wallet-level
rain_build_create_marketgate (originally next on the queue) — that gate needs canonical provenance metadata on installed skills to work reliably, and there's no provenance system today.Proposal
Add an explicit canonical skill registry layer:
Three phases, committed upfront per user direction:
/skills/bundledroute; dashboard "Install from Canonical" UI alongside the existing freeform editor. Solves the immediate raingame problem.autoSyncCanonicalSkillson redeploy.Full plan: branch architecture, file paths in both repos, acceptance criteria per phase, four open questions for the reviewer.
Locked decisions (per user input)
skills/manifest.jsoncommitted to git, regenerated by pre-commit hook, verified by CI.Review focus
Please weigh in on the four open questions in §11:
canonical-modifiedpolicy — always allow overwrite with warning, or sometimes refuse?Also sanity-check the tool/data ownership in §6.1 and §6.2 — which routes/files belong in the worker vs the dashboard.
Why this lands before the wallet gate
§12 — the wallet gate enforces "agent has rain-create skill enabled" by inspecting provenance metadata that does not exist today. Phase 1 of this plan creates that metadata. After Phase 1, the wallet gate becomes a straightforward dashboard change.
Test plan
🤖 Generated with Claude Code