artifacts

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StagedSkillSupportPath

func StagedSkillSupportPath(relativePath, bareSkillName string) (string, bool)

func StripHarnessPrefix

func StripHarnessPrefix(path string) string

StripHarnessPrefix removes the per-agent directory a package may keep its components under (.claude/skills, .cursor/rules, …).

Types

type Kind

type Kind uint8
const (
	Skill Kind = iota
	Command
	Agent
	Rule
)

func RenderedKind

func RenderedKind(target harness.Target, source Kind) Kind

RenderedKind is the kind an artifact takes on a target: Codex has skills only, and rules become skills where the target has no rule files.

func (Kind) Word

func (kind Kind) Word() string

Word is the kind as it is written in messages and converted names.

type Markdown

type Markdown struct {
	Kind                   Kind
	SourceVariant          SourceVariant
	Name                   string
	StorageName            string
	Description            string
	Body                   string
	DisableModelInvocation bool
	AlwaysApply            bool
	Globs                  []string
	ExtraFrontmatter       map[string]any
	// contains filtered or unexported fields
}

func Parse

func Parse(relativePath, contents, bareSkillName string) (*Markdown, error)

func (Markdown) CodexAgent

func (artifact Markdown) CodexAgent() (Rendered, bool)

CodexAgent renders a subagent as a Codex custom agent file, agents/<name>.toml with name, description and developer_instructions, the form Codex reads from $CODEX_HOME/agents and .codex/agents. The agent's file name is its Codex name, so that it is a plain identifier. It reports false for anything that is not a subagent.

func (Markdown) NestedPath

func (artifact Markdown) NestedPath() string

NestedPath is where the artifact sits in its package's own layout, under its kind's directory (agents/team/reviewer.md).

func (Markdown) Renamed

func (artifact Markdown) Renamed(name string) Markdown

Renamed returns the artifact under another name, for a target where its own name is taken by an artifact of the kind it is converted to.

func (Markdown) Render

func (artifact Markdown) Render(target harness.Target) Rendered

type Rendered

type Rendered struct {
	RelativePath string
	Contents     string
	// Warnings name what could not be carried over to the target.
	Warnings []string
}

type SourceVariant

type SourceVariant uint8
const (
	SkillFrontmatter SourceVariant = iota
	CommandFrontmatter
	CursorPlainCommand
	AgentFrontmatter
	CursorRule
)

Jump to

Keyboard shortcuts

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