Documentation
¶
Overview ¶
Package core provides the canonical workflow adapter interface.
Package core provides error types for workflow operations.
Package core provides the canonical workflow definition types. Workflows define multi-phase spec creation processes that can be deployed across different AI coding assistants.
Index ¶
Constants ¶
const ( LevelProduct = "product" LevelFeature = "feature" )
WorkflowLevel constants.
const ( ModeInteractive = "interactive" ModeSynthesis = "synthesis" ModeReconciliation = "reconciliation" )
AuthoringMode constants.
const DefaultDirMode = 0755
DefaultDirMode is the default permission for workflow directories.
const DefaultFileMode = 0644
DefaultFileMode is the default permission for workflow files.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(cfg *GenerateConfig) error
Generate generates platform-specific workflow files.
Types ¶
type Adapter ¶
type Adapter interface {
// Name returns the adapter identifier (e.g., "claude", "kiro")
Name() string
// EntryPointFile returns the entry point filename for this platform
// (e.g., "CLAUDE.md" for Claude Code, "core-workflow.md" for Kiro steering)
EntryPointFile() string
// EntryPointDir returns the directory for the entry point
// (e.g., "" for root, ".kiro/steering" for Kiro)
EntryPointDir() string
// RuleDetailsDir returns the directory for rule details
// (e.g., ".spec-workflows" for Claude, ".kiro/spec-workflow-details" for Kiro)
RuleDetailsDir() string
// Generate creates platform-specific files from a Workflow
Generate(workflow *Workflow, outputDir string) error
// GenerateEntryPoint generates just the entry point file content
GenerateEntryPoint(workflow *Workflow) ([]byte, error)
}
Adapter converts between canonical Workflow and platform-specific formats.
type AdapterNotFoundError ¶
type AdapterNotFoundError struct {
Name string
}
AdapterNotFoundError is returned when an adapter is not found.
func (*AdapterNotFoundError) Error ¶
func (e *AdapterNotFoundError) Error() string
type GenerateConfig ¶
type GenerateConfig struct {
// Workflow is the source workflow to generate from
Workflow *Workflow
// SourceRepo is the spec-workflows repository
SourceRepo *SourceRepo
// OutputDir is the target project directory
OutputDir string
// Platform is the target platform (e.g., "claude", "kiro")
Platform string
// Extension is an optional extension to include
Extension string
// CopyRuleDetails copies rule-details to output (vs symlink/reference)
CopyRuleDetails bool
// CopyTemplates copies templates to output
CopyTemplates bool
// CopyRubrics copies rubrics to output
CopyRubrics bool
}
GenerateConfig specifies how to generate workflow files.
type GenerateError ¶
GenerateError is returned when generation fails.
func (*GenerateError) Error ¶
func (e *GenerateError) Error() string
func (*GenerateError) Unwrap ¶
func (e *GenerateError) Unwrap() error
type NotFoundError ¶
type NotFoundError struct {
WorkflowID string
}
NotFoundError is returned when a workflow is not found.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type ParseError ¶
ParseError is returned when parsing fails.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶
func (e *ParseError) Unwrap() error
type Phase ¶
type Phase struct {
// Name is the phase identifier
Name string `json:"name" yaml:"name"`
// SpecType is the spec type created in this phase
SpecType string `json:"specType" yaml:"specType"`
// Mode is the authoring mode: "interactive", "synthesis", or "reconciliation"
Mode string `json:"mode" yaml:"mode"`
// Sources are the spec types used as input (for synthesis mode)
Sources []string `json:"sources,omitempty" yaml:"sources,omitempty"`
// Gate indicates if approval is required before proceeding
Gate bool `json:"gate,omitempty" yaml:"gate,omitempty"`
}
Phase represents a workflow phase.
type SourceRepo ¶
type SourceRepo struct {
// Path is the local filesystem path to the repo
Path string `json:"path" yaml:"path"`
// Workflows maps workflow identifiers to Workflow definitions
Workflows map[string]*Workflow `json:"workflows,omitempty" yaml:"workflows,omitempty"`
}
SourceRepo represents a spec-workflows repository.
func LoadSourceRepo ¶
func LoadSourceRepo(path string) (*SourceRepo, error)
LoadSourceRepo loads a spec-workflows repository from the given path.
func (*SourceRepo) GetWorkflow ¶
func (r *SourceRepo) GetWorkflow(id string) (*Workflow, error)
GetWorkflow returns the workflow with the given ID.
func (*SourceRepo) ListWorkflows ¶
func (r *SourceRepo) ListWorkflows() []string
ListWorkflows returns all available workflow IDs.
type Workflow ¶
type Workflow struct {
// Name is the workflow identifier (e.g., "aws-working-backwards")
Name string `json:"name" yaml:"name"`
// Level is the workflow level: "product" or "feature"
Level string `json:"level" yaml:"level"`
// Description describes the workflow purpose
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// Trigger is the phrase that activates this workflow
Trigger string `json:"trigger,omitempty" yaml:"trigger,omitempty"`
// EntryPoint is the path to the core-workflow.md file
EntryPoint string `json:"entryPoint" yaml:"entryPoint"`
// RuleDetails is the path to the rule-details directory
RuleDetails string `json:"ruleDetails,omitempty" yaml:"ruleDetails,omitempty"`
// Templates is the path to the templates directory
Templates string `json:"templates,omitempty" yaml:"templates,omitempty"`
// Rubrics is the path to the rubrics directory
Rubrics string `json:"rubrics,omitempty" yaml:"rubrics,omitempty"`
// Phases defines the workflow phases in order
Phases []Phase `json:"phases,omitempty" yaml:"phases,omitempty"`
// Extension is an optional extension to apply
Extension string `json:"extension,omitempty" yaml:"extension,omitempty"`
}
Workflow represents a canonical workflow definition. Workflows guide AI assistants through multi-phase spec creation.
func NewWorkflow ¶
NewWorkflow creates a new Workflow with the given name and level.
type WriteError ¶
WriteError is returned when writing fails.
func (*WriteError) Error ¶
func (e *WriteError) Error() string
func (*WriteError) Unwrap ¶
func (e *WriteError) Unwrap() error