Skill Wiki v0.1.0

Docs / spec / edges

On this page

Edges · 14 verbs

Edges declare typed relationships between atoms. Each verb has documented semantics; the L3 cross-atom checker reasons over them; the runtime walks them to satisfy contracts.

Why typed verbs (vs flat related)

A flat related: [...] list — like SKILL.md's see also — can't be reasoned over. The system can't know whether a referenced atom is a dependency, an illustration, a contradiction, or a specialisation. Each of those answers needs different runtime behaviour:

  • Dependency → must be loaded together (requires)
  • Illustration → optional, soft enhancement (enhances, example)
  • Contradiction → flag and warn (contradicts, conflicts)
  • Specialisation → narrowed version of (specializes, extends)

The 14 verbs

Verb Semantic Allowed source kinds Allowed target kinds
relatedGeneral association — discoverable.anyany
requiresStrong dep. A loaded ⇒ B MUST load.method, pattern, persona, ruleany
enhancesSoft dep. B improves A but optional.anyany
validates-withA's correctness verified against B.rule, fact, patternsource, metric, check
contradictsA and B make incompatible claims.anyany
specializesA is a narrower version of B.anysame kind as src
conflictsA and B can't both load (variant gates).anyany
extendsA inherits structure from B.type, persona, methodsame kind as src
derived-fromA is computed from / based on B.anyany
compatibleA and B compose without conflict.anyany
supplies-toA's output is consumed by B.tool, transform, methodmethod, tool
see-alsoPure cross-reference, no semantic claim.anyany
includesStructural containment (collection→atoms).collection, scopeany
relationshipsFree-form labelled relationship (escape hatch).anyany

What the L3 checker enforces

The cross-atom checker (checker-l3-cross.ts) runs over the resolved edge graph and surfaces three classes of error:

  1. Cycles in requires chains. Atom A requires B, B requires C, C requires A. The runtime can't satisfy this load order.
  2. Contradictions. If A contradicts B and a method's contract pulls both into the same composition, surface a hard error before the agent ever sees them.
  3. Kind mismatches. If a validates-with edge points from a rule to another rule (instead of a source, metric, or check), surface a schema error.

An edge walk in code

Once compiled, edges are stored per-atom in graph.yaml next to the atom directory. The runtime reads them lazily:

// packages/runtime/src/atom-loader.ts (excerpt)
async function loadAtom(id: string): Promise<AtomMeta> {
  const dir = atomDirFor(id);
  const meta  = parseYaml(await read(`${dir}/atom.yaml`));
  const graph = parseYaml(await read(`${dir}/graph.yaml`));
  return {
    ...meta,
    edges: graph.edges, // [{ verb, target, ... }]
  };
  // Note: chunk content is *not* read here. Only metadata.
}

Authoring an edge

Edges are field assignments inside an atom body. The field name is the verb; the value is a list of atom IDs.

rule MyRule {
  id: "@my/rule-x"
  version: "1.0.0"
  description: "..."
  domain: my-domain

  claim: "..."
  severity: recommended

  // edges:
  requires: [@my/term-x, @my/term-y]
  validates-with: [@my/source-rfc-1234]
  contradicts: [@my/anti-pattern-y]
  see-also: [@my/pattern-z]
}

Adding a verb

The 14 verbs are fixed in the parser at v1. To add a verb you patch the parser and run a Tier-2 RFC. See Custom verbs.