Documentation
¶
Overview ¶
Package plans holds the shared vocabulary of captured Claude Code plans: the note-slug prefixes, the plan-status tag lifecycle, and the tracking-task composition. The hooks capture path, the console Plans surface, the briefing assembler, and the gardener all speak this vocabulary; keeping it here stops the tag spellings from drifting apart.
Index ¶
- Constants
- func Basename(noteSlug string) string
- func EnsureTask(ctx context.Context, db *sql.DB, note core.Note, planSlug, createdBy string) (core.Task, bool, error)
- func NoteDescription(basename string, iter int, status string) string
- func NoteIteration(n core.Note) int
- func SetStatusTag(tags []string, status string) []string
- func SlugFromTags(tags []string) string
- func SlugTag(planSlug string) string
- func SlugTagPrefix() string
- func StatusFromTags(tags []string) string
Constants ¶
const ( TagPlan = "cc-plan" TagAgent = "agent-cache" )
Marker tags on captured notes: TagPlan marks the plan note itself, TagAgent the cached planning-subagent runs attached to it.
const ( StatusDraft = "draft" StatusPresented = "presented" StatusApproved = "approved" StatusAbandoned = "abandoned" )
Plan lifecycle statuses, stored as a plan-status:<v> note tag. Draft -> presented -> approved is the capture flow; abandoned is the gardener's terminal state for plans that were never approved.
const AgentNotePrefix = "cc-agent-"
AgentNotePrefix + the CC agent id is the agent-cache note slug.
const NotePrefix = "cc-plan-"
NotePrefix + the CC plan file basename is the captured-plan note slug -- the correlation key across iterations (a direct NoteBySlug lookup, no tag query).
Variables ¶
This section is empty.
Functions ¶
func EnsureTask ¶
func EnsureTask(ctx context.Context, db *sql.DB, note core.Note, planSlug, createdBy string) (core.Task, bool, error)
EnsureTask creates the "Implement plan" tracking task for an approved plan unless the plan already has an open or in-progress step (idempotent on re-approval). It returns the created task and true, or a zero task and false when one already exists. Event recording is the caller's job (hooks and the console attribute differently).
func NoteDescription ¶
NoteDescription is the captured-plan note's one-line index text.
func NoteIteration ¶
NoteIteration reads a captured-plan note's plan_iteration frontmatter (preserved in Extra), tolerating the numeric types YAML/JSON round-trips produce.
func SetStatusTag ¶
SetStatusTag replaces the plan-status:<v> tag, preserving all others.
func SlugFromTags ¶
SlugFromTags returns the plan:<slug> composition slug, or "".
func SlugTagPrefix ¶
func SlugTagPrefix() string
SlugTagPrefix is the literal prefix every composition tag carries, for surfaces that enumerate the plan:<slug> family without a known slug.
func StatusFromTags ¶
StatusFromTags returns the plan-status:<v> value, or "".
Types ¶
This section is empty.