Help us shape the future of Go! Take the 2026 Go Developer Survey

molecules

package
v0.48.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package molecules handles loading template molecules from molecules.jsonl catalogs.

Template molecules are read-only issue templates that can be instantiated as work items. They live in a separate molecules.jsonl file, distinct from work items in issues.jsonl.

Hierarchical Loading

Molecules are loaded from multiple locations in priority order (later overrides earlier):

  1. Built-in molecules (shipped with bd binary)
  2. Town-level: $GT_ROOT/.beads/molecules.jsonl (if orchestrator detected via GT_ROOT)
  3. User-level: ~/.beads/molecules.jsonl
  4. Project-level: .beads/molecules.jsonl in the current project

Key Properties

  • Templates are marked with is_template: true
  • Templates are read-only (mutations are rejected)
  • bd list excludes templates by default
  • bd molecule list shows the catalog

Index

Constants

View Source
const MoleculeFileName = "molecules.jsonl"

MoleculeFileName is the canonical name for molecule catalog files.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadResult

type LoadResult struct {
	Loaded       int      // Number of molecules successfully loaded
	Skipped      int      // Number of molecules skipped (already exist or errors)
	Sources      []string // Paths that were loaded from
	BuiltinCount int      // Number of built-in molecules loaded
}

LoadResult contains statistics about the molecule loading operation.

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader handles loading molecule catalogs from hierarchical locations.

func NewLoader

func NewLoader(store storage.Storage) *Loader

NewLoader creates a new molecule loader for the given storage.

func (*Loader) LoadAll

func (l *Loader) LoadAll(ctx context.Context, beadsDir string) (*LoadResult, error)

LoadAll loads molecules from all available catalog locations. Molecules are loaded in priority order: built-in < town < user < project. Later sources override earlier ones if they have the same ID.

Jump to

Keyboard shortcuts

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