plans

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 8 Imported by: 0

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

View Source
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.

View Source
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.

View Source
const AgentNotePrefix = "cc-agent-"

AgentNotePrefix + the CC agent id is the agent-cache note slug.

View Source
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 Basename

func Basename(noteSlug string) string

Basename recovers the CC plan file basename from a captured-plan note slug.

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

func NoteDescription(basename string, iter int, status string) string

NoteDescription is the captured-plan note's one-line index text.

func NoteIteration

func NoteIteration(n core.Note) int

NoteIteration reads a captured-plan note's plan_iteration frontmatter (preserved in Extra), tolerating the numeric types YAML/JSON round-trips produce.

func SetStatusTag

func SetStatusTag(tags []string, status string) []string

SetStatusTag replaces the plan-status:<v> tag, preserving all others.

func SlugFromTags

func SlugFromTags(tags []string) string

SlugFromTags returns the plan:<slug> composition slug, or "".

func SlugTag

func SlugTag(planSlug string) string

SlugTag renders the composition tag for a plan slug.

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

func StatusFromTags(tags []string) string

StatusFromTags returns the plan-status:<v> value, or "".

Types

This section is empty.

Jump to

Keyboard shortcuts

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