Documentation
¶
Overview ¶
Package sidekick scaffolds lint-clean sidekick-seed artifacts — the scaled-down Idea one-pagers parked under spec/ideas/seeds/.
Features implemented: cli/sidekick/new
Index ¶
Constants ¶
const ( // TypeValue is the literal `type:` frontmatter value every seed carries. TypeValue = "sidekick-seed" // MaxOneLinerChars caps the trimmed one-liner length // (cli/sidekick/new#req:one-liner-length). MaxOneLinerChars = 500 // MaxBodyChars caps the body region (H1 line through end of optional // content) per the sidekick-seed lint rule // (cli/sidekick/new#req:optional-body). MaxBodyChars = 2000 // MaxSlugChars caps the derived slug length // (cli/sidekick/new#req:slug-derivation). MaxSlugChars = 60 )
Variables ¶
var TriggerValues = []string{"heuristic", "explicit"}
TriggerValues enumerates the legal `trigger:` values (cli/sidekick/new#req:frontmatter-values).
Functions ¶
func DeriveSlug ¶
DeriveSlug turns a one-liner into a lowercase, hyphen-separated, URL-safe slug, mirroring the specstudio:sidekick skill's algorithm so the CLI and the skill produce identical slugs for identical input (cli/sidekick/new#req:slug-derivation). It returns an error when the one-liner contains no slug-safe characters.
func Scaffold ¶
func Scaffold(opts ScaffoldOptions) ([]byte, error)
Scaffold returns a lint-clean sidekick-seed file body: the closed 8-key frontmatter the `sidekick-seed` lint rule enforces, followed by an H1 whose heading is the one-liner verbatim and any optional body. It validates the one-liner, trigger, and body cap, returning an error on violation.
func ValidateSlug ¶ added in v0.7.3
ValidateSlug returns nil when slug is a lowercase, hyphen-separated, URL-safe identifier with no `/` — the same shape DeriveSlug produces. It is used to validate a caller-supplied `--slug` override (cli/sidekick/new#req:slug-override).
Types ¶
type ScaffoldOptions ¶
type ScaffoldOptions struct {
Slug string
OneLiner string // the H1 text; trimmed before use
// CapturedBy defaults to "user" when empty.
CapturedBy string
// CapturedDuring is written verbatim; empty renders the literal `null`.
CapturedDuring string
// Trigger defaults to "explicit" when empty; must be heuristic|explicit.
Trigger string
// Body is optional markdown appended after the H1 line.
Body string
// CapturedAt is an ISO-8601 timestamp; defaults to time.Now().UTC() when empty.
CapturedAt string
}
ScaffoldOptions controls the lint-clean seed file Scaffold emits.