output

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(idx *knowledge.Index, rnd *render.Renderer, outDir string) ([]string, error)

Generate renders every skill into <outDir>/skills/<id>/SKILL.md. The output is for inspection only (gitignored); Install and Package render in-memory.

func Install

func Install(
	idx *knowledge.Index,
	rnd *render.Renderer,
	dest string,
	ids []string,
	routerFilter []string,
) (installed, skipped, backedUp []string, err error)

Install renders each selected skill in-memory and writes it to <dest>/<id>/SKILL.md plus a sibling .gitignore (see WriteDoc). Unknown ids are skipped and reported. routerFilter trims the rendered project-router to those skills (empty = the full router). backedUp carries a ready-to-print message for every foreign file WriteDoc backed up rather than overwrote.

func InstallWorkflows

func InstallWorkflows(
	idx *knowledge.Index,
	rnd *render.Renderer,
	dest string,
	wfIDs []string,
) (installed, skipped, backedUp []string, err error)

InstallWorkflows renders each workflow whose id is in wfIDs and writes it to <dest>/<id>/WORKFLOW.md plus a sibling .gitignore (see WriteDoc). Unknown ids are skipped and reported. backedUp carries a ready-to-print message for every foreign file WriteDoc backed up rather than overwrote.

func Package

func Package(idx *knowledge.Index, rnd *render.Renderer, outPath string) (err error)

Package renders every skill in-memory and zips it into outPath, one entry per skill as "<id>/SKILL.md". A failure mid-loop closes the writer and archive, then removes the partial file so a failed run never leaves a corrupt zip behind at outPath.

func RemoveDocs added in v0.4.0

func RemoveDocs(dest, docName string) (removed, restored, orphaned []string, err error)

RemoveDocs deletes the <docName> and sibling .gitignore WriteDoc wrote under each subdirectory of dest, then dest once empty, restoring any backup the removal uncovers (reported in restored). why: a user's own file, or a references/ dir the skill format ships, must survive; a directory we do not recognise is not ours to touch.

func WriteDoc

func WriteDoc(dir, docName, body string) (backedUp []string, err error)

WriteDoc writes body to <dir>/<docName> plus a sibling .gitignore that ignores both, so generated output is untracked by default; delete the .gitignore to commit it. Ownership is proven solely by docName carrying marker.Installed (see isOwnedDoc). A dir isOwnedDoc does not recognize is backed up file-by-file first, preserving a user-owned same-named dir.

Types

type DependencyPull

type DependencyPull struct {
	Skill      string
	RequiredBy string
}

DependencyPull names a skill Resolve added beyond the caller's selection because another selected skill's compose_skills listed it, and which skill asked for it, so the caller can report why the install grew.

type Selection

type Selection struct {
	All        bool
	RouterOnly bool
	IDs        []string
}

Selection resolves a user request into the skill ids to install.

func (Selection) Resolve

func (sel Selection) Resolve(idx *knowledge.Index) (ids []string, pulled []DependencyPull)

Resolve returns the concrete skill id list for the selection against idx, in composition order, plus every skill pulled in transitively through a compose_skills reference. Every mode except RouterOnly carries the mandatory baseline (project-router plus every always_load skill), so an empty selection resolves to that baseline alone; RouterOnly skips it.

Jump to

Keyboard shortcuts

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