oc_skill_record
Record a skill with domain, name, steps, and contract ID into a JSON memory store. Idempotent on domain and name: updates steps and contract ID while preserving skill ID and usage counters. Optionally persist a frozen snapshot.
Instructions
Record a skill (domain, name, steps, contract_id) into the JSON skill memory store. Idempotent on (domain, name) — re-recording preserves the existing skill_id and usage counters while updating steps and contract_id. Pass frozen_snapshot to atomically write a gzipped snapshot alongside the record. Returns { skill_id, stored_at, snapshot_path? }. Core-tier; no LLM ranking. Use oc_skill_recall to retrieve skills.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain this skill belongs to (e.g. "amazon.com"). Used as the storage partition key and must be a non-empty string ≤ 253 chars. | |
| name | Yes | Human-readable skill name, unique within the domain (e.g. "add-to-cart"). Acts as the idempotency key together with domain. | |
| steps | Yes | Opaque step list supplied by the host agent. The store persists this inline in the JSON file without schema validation. Each element may be any JSON-serialisable value. | |
| contract_id | Yes | Identifier of the Outcome Contract that governs this skill (ties into oc_assert #784 and the contracts registry). | |
| frozen_snapshot | No | Optional opaque snapshot payload to persist alongside the record. Written exactly once (write-once semantics) under <rootDir>/<domain>/snapshots/<skill_id>.json.gz. Omit on re-records when you do not want to update the snapshot. | |
| replay_artifacts | No | Optional replay artifacts (selector-chain step recordings) to persist alongside the skill. Each artifact must conform to the ReplayArtifact schema. Ignored when OPENCHROME_SKILL_REPLAY is not enabled. |