Documentation
¶
Overview ¶
Package preamble builds what a skill's `!` line injects before the model's first turn, each load of which used to cost a turn. Claude Code 2.1.332 spills injected output over 30,000 characters to a file, hence the parts.
Index ¶
Constants ¶
const ( // InlineLimit keeps the injected text under Claude Code's 30,000-character cap. InlineLimit = 29_000 // PartLimit keeps a part under the Read tool's default token limit. PartLimit = 50_000 )
Variables ¶
var Loads = map[string][]string{
"audit": {"audit", "capture"},
"brainstorm": {"brainstorm"},
"capture": {"capture"},
"catchup": {"catchup"},
"ci": {"ci", "catchup"},
"cleanup": {"cleanup"},
"debug": {"debug", "capture", "fetch", "investigate", "plan"},
"demo": {"demo"},
"explain": {"explain"},
"handoff": {"handoff"},
"judge": {"judge"},
"plan": {"fetch", "investigate", "plan"},
"resolve": {"review", "resolve"},
"review": {"review"},
"standup": {"standup"},
"ship": {"fetch"},
}
Loads mirrors each skill's Run block: the steps its first load names. A layout test pins every entry to its SKILL.md, so the two cannot drift.
Functions ¶
Types ¶
type Args ¶
type Args struct {
Raw string
Driven bool
Paced bool // explain only: one beat per turn (modes/paced.md)
Help bool
DryRun bool
Flow string // a leading `name:` word
Pace string
Subject string // the first word left, the task id or the description's first word
Words []string // what is left, the subject first
// Lead is the lead task's id as `f10 task read` printed it, so a number
// or a url subject still finds its saved plan
Lead string
}
Args is a skill's argument as the preamble reads it.
func ParseArgs ¶
ParseArgs reads the argument up to a chained `&&`; --driven counts anywhere, because driven mode holds for the whole chain.
type Env ¶
type Env struct {
Root string // the plugin root: bin/, modes/, conventions/
Self string // the f10 binary, for the verbs the preamble runs
Cwd string
StateDir string
Session string
Skill string // without the f10: prefix
Args string
Now time.Time
Run Runner
// PlanExists reports whether a task's plan file is saved.
PlanExists func(lead string) bool
// FlowByArea reports whether project.md maps areas to flows, so ship
// cannot know its flow before investigate.
FlowByArea bool
// NoHandover is a call that got no arguments from the hook, which a
// skill given arguments cannot tell from one given none.
NoHandover bool
}
Env is what one preamble reads.