Documentation
¶
Overview ¶
Package role ships the agent role prompts that drive a jaira board.
A lane carries the instructions for one step of the work; a role carries the instructions for one worker who performs steps. The lanes travel with the repository, so a teammate who clones gets the board — but until now the roles lived in one person's ~/.claude/skills, so the teammate got a board and nobody to drive it. The roles are compiled into the binary for the same reason the lanes are, and 'jaira roles install' writes them out.
A role is a directory, not a file: its SKILL.md is the prompt, and anything beside it (a reference document, a script) belongs to the same role and is installed with it. The directory name is the API — an agent harness derives the command name from it, not from the frontmatter — so the embedded directory names carry the jaira- prefix verbatim and nothing here rewrites them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func File ¶
File returns the embedded bytes of one file of a role. rel is a path relative to the role's directory, as it appears in Role.Files.
func GlobalTarget ¶
GlobalTarget returns ~/.claude/skills — the personal skills directory, for a role installed for the person rather than for one repository.
func ProjectTarget ¶
ProjectTarget returns the skills directory to install into for a project rooted at root.
The directory is returned, not created; Install creates what it writes to.
func SkippedAny ¶
SkippedAny reports whether any file was left alone because it had been edited — what the CLI turns into a non-zero exit, so a script can tell "installed" from "installed except the ones you changed".
Types ¶
type Action ¶
type Action string
Action is what Install did with one file.
const ( // Written: the file was not there. Written Action = "written" // Unchanged: the file is already byte-identical to the embedded one. A // second run of Install reports nothing but these. Unchanged Action = "unchanged" // Skipped: the file differs from the embedded one, so somebody edited it. // It is left exactly as it is and reported, because silently replacing an // adjusted role is the one failure this command must never have. Skipped Action = "skipped" // Overwritten: it differed and --force said to replace it anyway. Overwritten Action = "overwritten" )
type Result ¶
Result is one file's outcome.
func Install ¶
Install writes every embedded role into dstSkillsDir as <dstSkillsDir>/<role-id>/<file>, and every embedded mod as <dstSkillsDir>/<mod-id>/<file>, and reports what happened to each file.
The comparison is against the embedded bytes, not os.Stat as lane.Export does. Stat answers two questions — there or not — and this needs three: a file identical to the embedded one is an already-finished install and must not be an error, while a file that differs is somebody's own version and must not be touched. Only --force collapses the last case back into a write.
type Role ¶
type Role struct {
// ID is the directory name, and therefore the name the harness invokes:
// jaira-teamlead is /jaira-teamlead.
ID string
Description string
// Files are paths relative to the role's own directory, SKILL.md first
// and the rest sorted. Always at least one entry.
Files []string
}
Role is one agent prompt, with every file that belongs to it.