defaults

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package defaults contains the default instruction texts shipped with brigada.

Index

Constants

View Source
const Version = "1.1.0"

Version names the newest directory of the archive, the version of the current defaults. It is not the brigada binary's version (internal/version), which generated headers carry: a header's version selects an archive directory when it names one, and its digest verifies the text found there; when no directory matches, FindByDigest finds the text by digest alone.

Variables

View Source
var Archive embed.FS

Archive holds every shipped version's default texts under versions/<ver>/..., at the same package-relative paths as Texts, so a three-way diff can rebuild the exact text a file was generated from: live text, the version it was generated from, the new version's text. A release that changes a live text adds the new version's directory and bumps Version; older directories never change.

View Source
var Roles = []string{"foreman", "plan_review", "reviewer", "worker"}

Roles are the roles the package carries a text for, in setting order; each role's text lives at <role>.md.

View Source
var Skills = []string{"bugfix", "cli-flag", "config-setting", "dependency", "docs-change", "refactor", "schema-migration", "surface-parity"}

Skills are the task-shape skills the package carries, each at skills/<name>/SKILL.md.

View Source
var Texts embed.FS

Texts holds the role texts and skill files at their package-relative paths.

Functions

func ArchiveRoleText

func ArchiveRoleText(version, role string) (string, error)

ArchiveRoleText returns a shipped version's archived text of a role.

func ArchiveSkillText

func ArchiveSkillText(version, skill string) (string, error)

ArchiveSkillText returns a shipped version's archived SKILL.md of a skill, so an older generated skill can be reconstructed for diffs.

func ArchiveText

func ArchiveText(version, name string) (string, error)

ArchiveText returns a shipped version's archived text by name: the package-relative path of the file, like "worker.md" or "skills/cli-flag/SKILL.md". An unknown version or a name outside the archive is refused; nothing is guessed or substituted.

func Digest

func Digest(text string) string

Digest returns the lowercase SHA-256 digest of an instruction text.

func FindByDigest

func FindByDigest(name, digest string) (text, version string, ok bool)

FindByDigest returns the archived text of a role or skill file (name as for ArchiveText) whose digest is digest, from any shipped version, newest first, and the version it was found in.

func LiveRoleText

func LiveRoleText(role string) (string, error)

LiveRoleText returns the live embedded text of a role, like "worker".

func LiveSkillText

func LiveSkillText(skill string) (string, error)

LiveSkillText returns the live embedded SKILL.md text of a skill.

func SetArchiveOverlay

func SetArchiveOverlay(f fs.FS) (restore func())

SetArchiveOverlay makes the files of f, laid out like Archive (versions/<ver>/...), readable beside the embedded archive until the returned function runs. It exists so a test can ship a fixture older version; nothing in the product calls it.

func Versions

func Versions() ([]string, error)

Versions lists the shipped versions the archive holds, oldest first.

Types

This section is empty.

Jump to

Keyboard shortcuts

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