Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDefaultsInstalled ¶ added in v0.1.1
EnsureDefaultsInstalled materializes the embedded default pack into workspaceDir/.brocode/skills/<name>/SKILL.md and keeps them in sync with the binary's pack across upgrades:
- Missing skill → installed (counted).
- Installed, untouched → upgraded in place when the embedded version is newer (counted as an install/upgrade).
- Installed, user-edit → NEVER touched; marked user-owned so later versions don't keep retrying.
- Legacy install (no version state yet) → the current file is compared to the embedded content: identical = treated as the default (upgradeable later), different = user-owned.
Best-effort: a failure to write never breaks a session (the catalog just shows fewer entries).
func ProposeGotchasPatch ¶ added in v0.1.1
ProposeGotchasPatch appends repair-distilled gotchas to <skillDir>/GOTCHAS.md — a reviewable patch proposal for the skill's SKILL.md, so the skill evolves from real repairs in this project. It NEVER touches SKILL.md itself: keeping its content byte-identical to the installed default means the version-aware installer still applies official skill updates (a modified SKILL.md is marked user-owned and frozen from upgrades). Returns the number of NEW gotchas written (0 when nothing new or the directory is unusable).
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader manages lazy loading of skill files.
func NewLoader ¶
NewLoader initializes skill discovery across project (.brocode/skills) and home locations (~/.config/brocode/skills).
type Skill ¶
type Skill struct {
Name string `json:"name"`
Description string `json:"description"`
Path string `json:"path"`
Content string `json:"content"`
// Version is the skill's own frontmatter version (defaults start at 1).
// The installer uses it to upgrade untouched default skills safely.
Version int `json:"version,omitempty"`
// Builtin marks skills from the embedded default pack (before they are
// materialized to disk). After EnsureDefaultsInstalled they are regular
// files and Builtin is false.
Builtin bool `json:"builtin,omitempty"`
}
Skill represents a loaded SKILL.md document.
func DefaultSkills ¶ added in v0.1.1
func DefaultSkills() []Skill
DefaultSkills returns the embedded default pack as Skill values. They are not wired into any Loader; call EnsureDefaultsInstalled to materialize them onto disk, after which the regular Loader picks them up.