[P0] Freeze standard-compatible SKILL.md -> Prolog IR + skill graph contract #173
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #167
Related: #117, #168, #170, #172
Goal
Freeze the canonical
SKILL.mdpackage contract forprolog-rlmbefore implementation.The runtime must:
SKILL.mdpackages;rlm_prompt_compilerskill IR;No second prompt compiler, no second skill IR, and no executable Prolog embedded in Markdown/YAML.
RAGE research decision
Read leniently where interoperability requires it; normalize strictly; write the open standard by default.
The canonical emitted form MUST remain valid under the open Agent Skills format. Prolog-specific structure therefore lives under the standard
metadataextension point, whose values are strings. Do not require a top-levelprolog:YAML object.Primary references:
Why not a top-level
prolog:block?The open specification defines
name,description, optionallicense,compatibility,metadata, and experimentalallowed-tools.metadatais the standard extension point and is specified as string -> string. Strict reference validators may reject unknown top-level fields even though some clients ignore them.Therefore this issue supersedes the earlier illustrative top-level
prolog:example.Standard compatibility floor
A strict standard skill like this must load:
It must become a valid compiler skill and a valid graph node even with zero Prolog extensions.
Canonical writers/exporters should include at least
name+description, obey standard naming/length rules, and use package-relative resource references.Canonical enriched form
Use the standard
metadatamap with one namespaced string payload:The
prolog-rlmvalue is JSON text inside a standard string metadata value. JSON is the interchange format only. It MUST be decoded as data through a closed schema, never as a Prolog term and never throughread_term/3,call/1, or equivalent executable evaluation.Why JSON-in-metadata
map[string]stringclients;schema;Do not use serialized Prolog terms as the wire representation.
Canonical extension schema v1
Allowed author-supplied keys:
schema— required integer for the extension payload; v1 is1;category— bounded identifier;aliases— bounded list of short strings;triggers— bounded list of closed trigger objects;requires— bounded list of typed unit references;suggests— bounded list of typed unit references;conflicts— bounded list of typed unit references;supersedes— bounded list of typed unit references;requires_capability—nullor one closed capability descriptor compatible with the current compiler contract;priority— bounded non-negative routing bias; policy may cap/ignore it by source trust;activation.automatic— boolean;falsemeans automatic Prolog selection is disabled but trusted explicit selection may still activate it.Trigger objects use a closed vocabulary equivalent to the current compiler:
Typed unit references use closed objects, not Prolog syntax:
Unknown
kindvalues are rejected structurally. No arbitrary functor creation from file text.Fields that MUST remain host-derived
Do not trust these from
SKILL.mdas runtime authority/policy:provider_visiblepolicy;mandatory_contextpolicy.A skill cannot mark itself trusted, mandatory, executable, or capability-granting.
priority,conflicts, and especiallysupersedesare routing declarations, not authority. Their effective use may be constrained by host source-precedence/trust policy so a lower-precedence skill cannot suppress a higher-precedence definition merely by declaring an edge.Standard/vendor field mapping
Open Agent Skills
name-> logical skill name /unit:skill(Name)after safe normalization;description-> compiler description/search evidence;license-> preserved package metadata;compatibility-> preserved compatibility metadata; do not parse free text into capabilities/tools automatically;metadata-> preserve unknown string entries; decodemetadata.prolog-rlmonly through the versioned closed schema;allowed-tools-> preserve as a declaration/advisory compatibility field only. It never grants Prolog tool capability or bypasses authority/effect policy.Claude Code compatibility adapter
Recognize common Claude extensions when importing, without requiring them in canonical output:
disable-model-invocation: true-> automatic activation disabled;user-invocable-> UI/discovery metadata only, not execution authority;allowed-toolsstring or list -> normalize as declaration only, never grant authority;model,context,agent,argument-hint, arguments-related fields -> preserve/adapter metadata where useful; do not silently reinterpret them as core Prolog execution semantics.If both the Prolog extension and a recognized vendor field constrain automatic activation, most restrictive wins.
OpenCode compatibility adapter
Recognize standard metadata and OpenCode-specific activation hints such as
metadata.opencode/autoinvoke.falsedisables automatic activation for the imported skill. Preserve other OpenCode-only presentation fields without making them core semantics.Agent Zero compatibility
Treat ordinary Agent Zero
SKILL.mdpackages as Agent Skills packages. Do not require Agent Zero-specific plugin/profile state in the portable skill format. Pinned/active-chat behavior remains an Agent Zero harness concern.Compatibility-mode parsing
Canonical output is strict; import should be pragmatic without becoming unsafe.
Recommended runtime behavior:
namebut safe standard-conforming parent directory exists -> derive the logical name from the directory and emit a diagnostic;namewith a safe directory ID -> preserve raw metadata for diagnostics, use deterministic safe identity policy;description-> do not invent one. Skill may be retained for trusted explicit activation, but it is not eligible for automatic lexical discovery;prolog-rlmkeys/kinds -> fail the extension structurally; do not partially execute guessed semantics;This deliberately follows the open client guidance that interoperability problems may warrant warning-level handling for cosmetic spec violations while security and missing-discovery data remain stricter.
Normalization target
After parsing, produce one normalized skill record from which both surfaces derive:
Do not parse the Markdown body twice and do not maintain a separately-authored graph file.
Internal skill graph
Active node model
Every valid, precedence-resolved loaded skill is a node. Standard-only skills are valid isolated nodes.
Each active node carries at least:
skill(Name)identity;Shadowed duplicate packages remain diagnostics/lifecycle inputs; the active compiler graph uses the deterministic precedence winner so the existing
prompt_catalogkeeps one logicalskill(Name).Typed edges
Derive edges only from normalized structured metadata:
Targets may be other skills or other closed compiler units such as tools/resources. A standard-only skill has zero explicit relationship edges.
Do not infer graph edges from natural-language body text. Later AgentProlog/RAGE work may propose candidate edges, but accepted edges must become explicit normalized metadata before they affect runtime behavior.
Graph validation rules
At minimum detect/report:
requires,conflicts, orsupersedes;A requires BwhileA conflicts B;A requires BwhileA supersedes B;conflictsis semantically symmetric even if authored once.requires,suggests, andsupersedesremain directed.Graph queries must not read or inject Markdown bodies.
Progressive disclosure
Keep four distinct layers:
The open Agent Skills guidance recommends name+description at discovery, full body only after activation, and resources only as needed.
prolog-rlmmay perform selection host-side rather than exposing the catalog to the model; format compatibility does not require copying another harness's model-driven activation algorithm.Collision and trust policy
Package discovery and source precedence are host configuration, not file-authored data.
Requirements:
Adversarial cases to cover later in implementation/tests
metadata.prolog-rlmJSON string;metadata.prolog-rlm-> rejected as non-portable extension form;prolog:-> never required; canonical writer does not emit it;namebut valid directory name;allowed-toolslist despite standard string wording;opencode/autoinvoke=false;allowed-toolsattempting to grant unavailable tools -> no authority change;requirescycle;supersedescycle;Acceptance
metadata.prolog-rlmJSON schema is frozen before loader implementation;prompt_unit{unit:skill(...), ...}IR is documented;allowed-toolsnever grants Prolog authority;Non-goals
SKILL.md;call/1or term evaluation from skill content;Dependency direction
Implementation should not begin until the format/normalization decisions in this issue are accepted and reconciled with current
main.RAGE authoring rule: keep
descriptionas the portable primary discovery/routing contract.metadata.prolog-rlm.triggersare optional precision overrides for deterministic evidence the portable description cannot express; they are not a required duplicate trigger language. Standard-only skills should route from name/description through the existing compiler baseline. This keeps exported skills useful in Claude/OpenCode/Agent Zero and lets #168 measure whether custom triggers materially improve precision/recall rather than adding metadata by reflex.RAGE reconciliation against canonical
main267697bef10a3fffff7c093e1435ece770e7444band merged #197:Executable truth now landed
#197 implemented the standard-compatible confined
SKILL.mdloader, closedmetadata.prolog-rlmnormalization, normalized relationship fields (requires,suggests,conflicts,supersedes), oneprompt_unit{unit:skill(...)}path intorlm_prompt_compiler, progressive body/resource disclosure, host-owned activation policy, and the default RLM operating skill bundle. The competing skill selector was removed.Current
rlm_skillalready stores the typed relationship metadata on the normalized skill record and derives prompt units from that same record. No duplicate parsing/IR is needed.Remaining #173 gap
Repository search on current
mainfinds noskill_graphimplementation or public graph projection. Therefore #173 is not complete and should not be closed merely because #117/#197 landed.The remaining coherent implementation slice is a read-only typed graph derived only from the normalized skill records:
requires,suggests, symmetricconflicts, and directedsupersedesedges without reading Markdown bodies/resources;skill(...)dependencies fail structurally;skill_catalog_skills/2; it must not become a second selector/compiler.Adversarial decision
GO to a focused child implementation issue. Do not implement inside #173 itself: this issue explicitly freezes the design and says coding is a non-goal. The child should TDD the public graph projection/validation contract against current normalized records and keep #170/#171 lifecycle/evolution semantics out of scope.
Downstream evidence agrees with ownership: current AgentProlog issues explicitly keep generic skill graph/eval/lifecycle mechanics upstream, while A0 Symbolics remains a thin consumer of the Prolog-RLM compiler/runtime.