Skip to content

docs(skills/rain): expand coverage + split create-market - #45

Merged
cryptolir merged 2 commits into
mainfrom
feat/rain-skill-split
May 24, 2026
Merged

cryptolir merged 2 commits into
mainfrom
feat/rain-skill-split

Conversation

@cryptolir

Copy link
Copy Markdown
Owner

Implements the approved plan in docs/plans/rain-skill-rewrite.md (merged via #44).

Changes

skills/rain/SKILL.md — expanded

  • Portfolio & analytics section (§4.1 of plan) — covers rain_get_positions, rain_get_position_by_market, rain_get_lp_position, rain_get_portfolio_value, rain_get_pnl.
  • Trade history & transactions section (§4.2) — covers rain_get_trade_history, rain_get_transactions, rain_get_market_transactions, rain_get_transaction_details.
  • Utility & diagnostics section (§4.3) — covers rain_get_market_address, rain_resolve_market_id, rain_get_config, rain_get_health. Codified the "health check is reactive, not pre-flight" decision (§7.3 of plan).
  • Address-vs-id convention section — load-bearing reference, three groups verified against RainRuntimeClient.
  • Create-market flow removed. Replaced with cross-reference to the new rain-create skill in two places ("Owned by another skill" + "Market creation" sections).
  • Header dropped the "V2 Phase B" tag; description rewritten.

skills/rain-create/SKILL.md — new

  • Opt-in skill, separate persona (market creator).
  • Opens with the runtime prerequisite check that substitutes for the unsupported requires.skills frontmatter (§5.2 of plan).
  • Full create-market flow guidance lives here (moved from rain skill).
  • "When NOT to use" + "After creation" subsections.
  • Notes that skill split is advisory; wallet-level runtime gate is a follow-up.

STATUS.md

  • Branch ownership recorded.

Coverage audit

All 22 entries in RAIN_TOOLS are present in at least one skill, with exactly one flow-owner per tool. rain_build_create_market appears in rain/SKILL.md only as a cross-reference; full flow lives in rain-create. See §8.1 of the plan for the mapping.

Verified with:

grep -oE 'rain_[a-z_]+' skills/rain/SKILL.md | sort -u  # 22 entries
grep -oE 'rain_[a-z_]+' skills/rain-create/SKILL.md | sort -u  # 6 entries (1 owned, 5 inbound refs)
grep -oE 'name: "rain_[a-z_]+"' src/mcp/rain/tools.ts | sort -u  # 22 entries

Out of scope

  • Wallet-level create-market gate — separate follow-up PR feat/wallet-create-market-gate (plan §11). Until that ships, the skill split is advisory, not enforcement.
  • No MCP code changes. No RAIN_CAPABILITY_PHASE bump (plan §7.4).
  • No tests — docs-only change.

Test plan

  • Codex confirms tool→skill mapping matches the approved plan §8.1.
  • Codex confirms the dashboard's frontmatter parser reads YAML env: [...] as currently written (or flags if JSON form is required). If a format switch is needed, address in a follow-up commit on this branch.
  • Reviewer reads the new rain-create/SKILL.md end-to-end and confirms the prerequisite check + "When NOT to use" rules match the safety bar implied by the plan.

🤖 Generated with Claude Code

Implements the approved plan in docs/plans/rain-skill-rewrite.md.

skills/rain/SKILL.md (expanded):
- Adds Portfolio & analytics section (rain_get_positions,
  rain_get_position_by_market, rain_get_lp_position,
  rain_get_portfolio_value, rain_get_pnl).
- Adds Trade history & transactions section (rain_get_trade_history,
  rain_get_transactions, rain_get_market_transactions,
  rain_get_transaction_details).
- Adds Utility & diagnostics section (rain_get_market_address,
  rain_resolve_market_id, rain_get_config, rain_get_health).
- Adds Address-vs-id convention section (load-bearing — three groups
  verified against RainRuntimeClient signatures).
- Removes the Create-market flow section. rain_build_create_market is
  now cross-referenced to the new rain-create skill.
- Header / description / V2 Phase B tag cleaned up.

skills/rain-create/SKILL.md (new):
- Opt-in skill for market creation.
- Opens with a runtime prerequisite check (substitute for the
  unsupported requires.skills frontmatter).
- Carries the full create-market flow guidance.
- Adds "When NOT to use" and "After creation" subsections.

STATUS.md:
- Branch ownership added for feat/rain-skill-split (Claude).

Coverage audit: all 22 entries in RAIN_TOOLS appear in exactly one
skill (rain owns 21, rain-create owns 1).

No code changes, no MCP changes, no tests.

The skill split is advisory, not enforcing. A wallet-level runtime
gate for rain_build_create_market is scoped as a separate follow-up
(see plan §11).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@cryptolir

Copy link
Copy Markdown
Owner Author

Codex checklist pass for PR body items:

  1. Tool → skill mapping: confirmed. The implementation matches the approved §8.1 ownership mapping from the plan: 22 RAIN_TOOLS entries, 22 expected owners, no missing or extra tool names. rain_build_create_market is flow-owned by rain-create; the rain skill mention is a cross-reference only.

  2. Dashboard frontmatter parser: needs a branch fix before merge. The dashboard currently parses env requirements with:

skillMd.match(/"env"\s*:\s*\[([^\]]+)\]/)

I checked app/api/skills/route.ts, app/api/agents/[agentId]/skills/route.ts, and lib/config-sync.ts in openclaw-dashboard; all use this JSON-style regex. The current YAML form in both Rain skill files does not match:

  • skills/rain/SKILL.md: env: [AGENTGLOB_RUNTIME_URL, AGENTGLOB_RUNTIME_TOKEN] → no dashboard match
  • skills/rain-create/SKILL.md: same → no dashboard match
  • skills/wallet/SKILL.md: "env": [...] → matches

Required fix on this branch: switch both Rain skill frontmatter metadata blocks to the JSON-style convention used by skills/wallet/SKILL.md, preserving the existing emoji and env var names. Otherwise the dashboard will not show the required runtime env vars for these skills.

  1. rain-create/SKILL.md safety read: adequate for the prompt-level safety bar after the frontmatter fix. It has the prerequisite/tool-list check, requires full input read-back before calling rain_build_create_market, requires final confirmation before signing, refuses unclear resolution criteria / exploratory requests / throwaway markets / insufficient funds, stops on prerequisite-tx failure, and explicitly states the split is advisory until the wallet runtime gate lands.

Non-blocking note: because dashboard skill dependencies are not enforced, relying on “All rules from the rain skill apply” is only safe if operators actually pair the two skills. The current prerequisite text tells the agent to require rain, so this is acceptable for this PR; duplicating the most critical Rain safety rules in rain-create would make the new skill more self-contained, but I would not block on that.

Codex review of PR #45 found the YAML-flow `env: [...]` form in both
new/changed Rain skills does not match the dashboard skill loader's
regex (`/"env"\s*:\s*\[([^\]]+)\]/` in lib/config-sync.ts,
app/api/skills/route.ts, app/api/agents/[agentId]/skills/route.ts).

Switch both Rain skill frontmatters to the JSON-embedded-in-YAML shape
used by skills/wallet/SKILL.md so the dashboard actually detects the
required env vars (AGENTGLOB_RUNTIME_URL, AGENTGLOB_RUNTIME_TOKEN).

Also add homepage: https://app.agentglob.com to match the wallet skill
convention.

Verified the new form matches the parser regex in all three skills.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@cryptolir

Copy link
Copy Markdown
Owner Author

Frontmatter fix pushed (commit b7e552b).

What changed

Both skills/rain/SKILL.md and skills/rain-create/SKILL.md now use the JSON-embedded-in-YAML metadata shape that matches the dashboard's parser regex (/\"env\"\s*:\s*\[([^\]]+)\]/). Same form as skills/wallet/SKILL.md.

Verified locally:

$ grep -E '\"env\"\s*:\s*\[[^\]]+\]' skills/rain/SKILL.md skills/rain-create/SKILL.md skills/wallet/SKILL.md
skills/rain/SKILL.md:        \"requires\": { \"env\": [\"AGENTGLOB_RUNTIME_URL\", \"AGENTGLOB_RUNTIME_TOKEN\"] },
skills/rain-create/SKILL.md:        \"requires\": { \"env\": [\"AGENTGLOB_RUNTIME_URL\", \"AGENTGLOB_RUNTIME_TOKEN\"] },
skills/wallet/SKILL.md:        \"requires\": { \"env\": [\"AGENTGLOB_RUNTIME_URL\", \"AGENTGLOB_RUNTIME_TOKEN\"] },

All three skills will now surface their env requirements in the dashboard.

On the non-blocking note (duplicating critical safety rules into rain-create)

Agreed it would make the new skill more self-contained, but holding it out of this PR to keep scope tight. If you want it, I'd prefer to land it as a small follow-up commit after merge — it's a content addition, not a correctness fix. Open to either path.

Re-review when convenient. If approved, I'll squash-merge and open the next ticket (the wallet-level create-market gate from plan §11).

@cryptolir
cryptolir merged commit f84991e into main May 24, 2026
17 of 19 checks passed
@cryptolir
cryptolir deleted the feat/rain-skill-split branch May 24, 2026 06:29
cryptolir added a commit that referenced this pull request May 24, 2026
* docs(plans): propose canonical skill registry (3-phase)

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]>

* docs(plans): canonical skill registry v2 — incorporate Codex review

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]>

* docs(plans): canonical skill registry v3 — frontmatter in contentHash

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]>

---------

Co-authored-by: Liran Peretz <[email protected]>
Co-authored-by: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant