template

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package template implements the `aiwf template ` verb (per-verb subpackage of M-0116; cmd/aiwf/main.go's newRootCmd wires it via NewCmd).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd() *cobra.Command

NewCmd builds `aiwf template [kind]`: prints the per-kind body template that `aiwf add` would scaffold after the frontmatter. Read-only; produces no commit and does not require a consumer repo.

Companion to `aiwf schema`. Schema describes the *frontmatter* contract; template describes the body shape (section headers). Together they are the full per-kind picture an AI skill scaffolder needs to author files outside the `aiwf add` path.

With no kind: emits every kind, separated by `KIND: <kind>` headers. With a kind: emits just that template, raw and unprefixed — so `aiwf template epic > new_epic_body.md` works as a one-liner.

func Run

func Run(args []string, format string, pretty bool) int

Run executes `aiwf template`. Returns one of the cliutil.Exit* codes.

func WriteTemplateText

func WriteTemplateText(w io.Writer, ts []TemplateOut, single bool) error

WriteTemplateText emits the body templates. When single is true, the body is written raw (no header) so the output can be piped directly into a new file. When single is false, each body is prefixed by a `KIND: <kind>` header so the kinds can be told apart in the stream.

Types

type TemplateOut

type TemplateOut struct {
	Kind entity.Kind `json:"kind"`
	Body string      `json:"body"`
}

TemplateOut is the per-kind payload `aiwf template` emits in both text and JSON modes. Kept at package level so writeTemplateText can take a typed slice rather than an inline struct.

Jump to

Keyboard shortcuts

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