sidekick

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

View Source
const (
	// 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

This section is empty.

Functions

func DeriveSlug

func DeriveSlug(oneLiner string) (string, error)

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 minimal `{captured_by, status}` frontmatter the `sidekick-seed` lint rule enforces, followed by an H1 whose heading is the one-liner verbatim and any optional body. The `type: sidekick-seed` key is NOT written here — captured seeds in spec/ideas/seeds/ are identified by location; `type` is added only when a seed is archived. It validates the one-liner and body cap, returning an error on violation.

func ValidateSlug added in v0.7.3

func ValidateSlug(slug string) error

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 {
	OneLiner string // the H1 text; trimmed before use
	// CapturedBy defaults to "user" when empty.
	CapturedBy string
	// Body is optional markdown appended after the H1 line.
	Body string
}

ScaffoldOptions controls the lint-clean seed file Scaffold emits.

Jump to

Keyboard shortcuts

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