od

package
v0.700.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package od carries OpenDesign's `od:` skill-frontmatter namespace, kept verbatim so a bundle written for either tool loads in the other. It is a leaf package on purpose: both the skills subsystem and the design subsystem read these types, and neither may depend on the other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitFrontmatter

func SplitFrontmatter(content string) (string, string, error)

SplitFrontmatter separates the YAML frontmatter of a Markdown document from its body. It lives here because the design subsystem parses embedded skill bundles without going through the skills manager.

func Strip

func Strip(frontmatter string) (string, bool)

Strip removes the top-level `od:` key from a frontmatter document and re-encodes the rest. It reports false when the frontmatter is not a mapping or carries no od key. Callers use it to keep a skill whose od block they cannot understand: an unreadable extension must not make the skill invisible.

Types

type Craft

type Craft struct {
	Requires []string `yaml:"requires"`
}

Craft lists the craft references the template expects to read. Names are resolved inside the skill directory, never outside it.

type Critique

type Critique struct {
	Policy string `yaml:"policy"`
}

Critique carries the per-skill critic policy consumed in P8.

type DesignSystem

type DesignSystem struct {
	Requires bool `yaml:"requires"`
}

DesignSystem states whether the template needs a committed design system.

type Metadata

type Metadata struct {
	// Mode separates bundles that produce an artifact ("template") from the
	// craft references a template pulls in ("reference"). An unknown or empty
	// mode is treated as a template when a surface is declared.
	Mode string `yaml:"mode"`
	// Surface is the design kind the template targets ("web", "deck").
	Surface string `yaml:"surface"`
	// Category and Scenario group the bundle in the gallery.
	Category string `yaml:"category"`
	Scenario string `yaml:"scenario"`
	// ExamplePrompt is the starter brief the gallery offers as "Try it".
	ExamplePrompt string       `yaml:"example_prompt"`
	Preview       Preview      `yaml:"preview"`
	DesignSystem  DesignSystem `yaml:"design_system"`
	Craft         Craft        `yaml:"craft"`
	Critique      Critique     `yaml:"critique"`
}

Metadata is the `od:` frontmatter block, OpenDesign's namespace kept verbatim so a bundle written for either tool loads in the other. The block is optional: a skill without it is an ordinary skill and every field below keeps its zero value, which is why the parser exposes it as a pointer.

type Preview

type Preview struct {
	// Type is the preview mode ("page", "deck").
	Type     string   `yaml:"type"`
	Viewport Viewport `yaml:"viewport"`
}

Preview describes how the artifact wants to be previewed.

type Viewport

type Viewport struct {
	Width  int `yaml:"width"`
	Height int `yaml:"height"`
}

Viewport is the preview viewport in CSS pixels. Zero means "use the configured default" rather than "collapse the preview".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL