opencode

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package opencode renders canonical skills into OpenCode's plain-markdown SKILL.md format.

Output layout: .opencode/skill/<id>/SKILL.md with optional sidecars. No YAML frontmatter; the renderer emits a `# <id>` heading followed by the description and the skill body.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Spec

func Spec() adept.HarnessSpec

Spec is the static description of the OpenCode harness.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter wires the OpenCode Renderer with filesystem helpers for Detect/Validate.

func NewAdapter

func NewAdapter(r *Renderer, w common.Writer, l common.Linker) *Adapter

NewAdapter constructs an Adapter.

func (*Adapter) Aggregate

func (a *Adapter) Aggregate(_ context.Context, parts []adept.RenderOutput, _ int) ([]adept.RenderOutput, error)

Aggregate is a no-op for per-skill harnesses.

func (*Adapter) Detect

func (a *Adapter) Detect(projectRoot string) (bool, error)

Detect reports whether projectRoot looks like an OpenCode project. True if .opencode/ or .opencode/skill/ exists.

func (*Adapter) Import

func (a *Adapter) Import(_ context.Context, projectRoot string) ([]adept.ImportedSkill, error)

Import walks .opencode/skill/<id>/SKILL.md. OpenCode emits plain markdown with no required frontmatter, so we treat the first `# <id>` heading and optional one-line description as the skill metadata; everything else is body.

func (*Adapter) Renderer

func (a *Adapter) Renderer() adept.Renderer

Renderer returns the underlying per-skill renderer.

func (*Adapter) Spec

func (a *Adapter) Spec() adept.HarnessSpec

Spec returns the static harness description.

func (*Adapter) Validate

func (a *Adapter) Validate(projectRoot string, expected []adept.RenderOutput) (adept.DriftReport, error)

Validate computes drift between expected outputs and the on-disk state.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer is the OpenCode Renderer implementation.

func New

func New() *Renderer

New constructs a Renderer with the default path templater.

func (*Renderer) Render

Render produces a plain-markdown SKILL.md plus any sidecars. Activation is ignored — OpenCode discovers skills through the directory layout alone.

Jump to

Keyboard shortcuts

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