gen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gen is the public interface of the gen component: it orchestrates the pipeline spec -> prompt -> claude -> architecture and writes the resulting goforge component to disk.

gen is a non-deterministic brick with input and output effects: it calls the network (via the claude brick) and writes files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Completer

type Completer interface {
	Complete(ctx context.Context, system, user string) (string, error)
}

Completer is the slice of the claude client gen needs: anything that can turn a system+user prompt into a reply. claude.Client satisfies it. Accepting an interface keeps gen testable without the network.

type Request

type Request struct {
	Spec   spec.Spec
	Module string // workspace module path, e.g. goforge.dev/myapp
	Root   string // workspace root directory (contains components/)
	Force  bool   // overwrite scaffolding (interface/internal/yaml) if present
	DryRun bool   // render everything but write nothing
}

Request describes one generation run.

type Result

type Result struct {
	ComponentDir string   // components/<name> under Root
	Written      []string // absolute paths written
	Skipped      []string // scaffold files left untouched (already existed)
	Raw          string   // unmodified model reply
}

Result reports what happened.

func Generate

func Generate(ctx context.Context, cl Completer, req Request) (Result, error)

Generate runs the full pipeline for req using completer cl.

Directories

Path Synopsis
Package internal holds the gen component implementation: writing a rendered brick to disk under a workspace root.
Package internal holds the gen component implementation: writing a rendered brick to disk under a workspace root.

Jump to

Keyboard shortcuts

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