recipes

package
v0.59.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package recipes provides recipe-based configuration for bd setup. Recipes define where beads workflow instructions are written for different AI tools.

Index

Constants

View Source
const Template = `# Beads Issue Tracking

This project uses [Beads (bd)](https://github.com/untoldecay/BeadsLog) for issue tracking.

## Core Rules

- Track ALL work in bd (never use markdown TODOs or comment-based task lists)
- Use ` + "`bd ready`" + ` to find available work
- Use ` + "`bd create`" + ` to track new issues/tasks/bugs
- Use ` + "`bd sync`" + ` at end of session to sync with git remote
- Git hooks auto-sync on commit/merge

## Quick Reference

` + "```bash" + `
bd prime                              # Load complete workflow context
bd ready                              # Show issues ready to work (no blockers)
bd list --status=open                 # List all open issues
bd create --title="..." --type=task   # Create new issue
bd update <id> --status=in_progress   # Claim work
bd close <id>                         # Mark complete
bd dep add <issue> <depends-on>       # Add dependency
bd sync                               # Sync with git remote
` + "```" + `

## Workflow

1. Check for ready work: ` + "`bd ready`" + `
2. Claim an issue: ` + "`bd update <id> --status=in_progress`" + `
3. Do the work
4. Mark complete: ` + "`bd close <id>`" + `
5. Sync: ` + "`bd sync`" + ` (or let git hooks handle it)

## Issue Types

- ` + "`bug`" + ` - Something broken
- ` + "`feature`" + ` - New functionality
- ` + "`task`" + ` - Work item (tests, docs, refactoring)
- ` + "`epic`" + ` - Large feature with subtasks
- ` + "`chore`" + ` - Maintenance (dependencies, tooling)

## Priorities

- ` + "`0`" + ` - Critical (security, data loss, broken builds)
- ` + "`1`" + ` - High (major features, important bugs)
- ` + "`2`" + ` - Medium (default, nice-to-have)
- ` + "`3`" + ` - Low (polish, optimization)
- ` + "`4`" + ` - Backlog (future ideas)

## Context Loading

Run ` + "`bd prime`" + ` to get complete workflow documentation in AI-optimized format.

For detailed docs: see AGENTS.md, QUICKSTART.md, or run ` + "`bd --help`" + `
`

Template is the universal beads workflow template. This content is written to all file-based recipes.

Variables

View Source
var BuiltinRecipes = map[string]Recipe{
	"cursor": {
		Name:        "Cursor IDE",
		Path:        ".cursor/rules/beads.mdc",
		Type:        TypeFile,
		Description: "Cursor IDE rules file",
	},
	"windsurf": {
		Name:        "Windsurf",
		Path:        ".windsurf/rules/beads.md",
		Type:        TypeFile,
		Description: "Windsurf editor rules file",
	},
	"cody": {
		Name:        "Sourcegraph Cody",
		Path:        ".cody/rules/beads.md",
		Type:        TypeFile,
		Description: "Cody AI rules file",
	},
	"kilocode": {
		Name:        "Kilo Code",
		Path:        ".kilocode/rules/beads.md",
		Type:        TypeFile,
		Description: "Kilo Code rules file",
	},
	"claude": {
		Name:        "Claude Code",
		Type:        TypeHooks,
		Description: "Claude Code hooks (SessionStart, PreCompact)",
		GlobalPath:  "~/.claude/settings.json",
		ProjectPath: ".claude/settings.local.json",
	},
	"gemini": {
		Name:        "Gemini CLI",
		Type:        TypeHooks,
		Description: "Gemini CLI hooks (SessionStart, PreCompress)",
		GlobalPath:  "~/.gemini/settings.json",
		ProjectPath: ".gemini/settings.json",
	},
	"factory": {
		Name:        "Factory.ai (Droid)",
		Path:        "AGENTS.md",
		Type:        TypeSection,
		Description: "Factory Droid AGENTS.md section",
	},
	"aider": {
		Name:        "Aider",
		Type:        TypeMultiFile,
		Description: "Aider config and instruction files",
		Paths:       []string{".aider.conf.yml", ".aider/BEADS.md", ".aider/README.md"},
	},
}

BuiltinRecipes contains the default recipe definitions. These are compiled into the binary.

Functions

func GetAllRecipes

func GetAllRecipes(beadsDir string) (map[string]Recipe, error)

GetAllRecipes returns merged built-in and user recipes. User recipes override built-in recipes with the same name.

func IsBuiltin

func IsBuiltin(name string) bool

IsBuiltin returns true if the recipe is a built-in (not user-defined).

func ListRecipeNames

func ListRecipeNames(beadsDir string) ([]string, error)

ListRecipeNames returns sorted list of all recipe names.

func LoadUserRecipes

func LoadUserRecipes(beadsDir string) (map[string]Recipe, error)

LoadUserRecipes loads recipes from .beads/recipes.toml if it exists.

func SaveUserRecipe

func SaveUserRecipe(beadsDir, name, path string) error

SaveUserRecipe adds or updates a recipe in .beads/recipes.toml.

Types

type Recipe

type Recipe struct {
	Name        string     `toml:"name"`        // Display name (e.g., "Cursor IDE")
	Path        string     `toml:"path"`        // Primary file path (for TypeFile)
	Type        RecipeType `toml:"type"`        // How to install
	Description string     `toml:"description"` // Brief description
	// Optional fields for complex recipes
	GlobalPath  string   `toml:"global_path"`  // Global settings path (for hooks)
	ProjectPath string   `toml:"project_path"` // Project settings path (for hooks)
	Paths       []string `toml:"paths"`        // Multiple paths (for multifile)
}

Recipe defines an AI tool integration.

func GetRecipe

func GetRecipe(name string, beadsDir string) (*Recipe, error)

GetRecipe looks up a recipe by name, checking user recipes first.

type RecipeType

type RecipeType string

RecipeType indicates how the recipe is installed.

const (
	// TypeFile writes template to a file path (simple case)
	TypeFile RecipeType = "file"
	// TypeHooks modifies JSON settings to add hooks (claude, gemini)
	TypeHooks RecipeType = "hooks"
	// TypeSection injects a marked section into existing file (factory)
	TypeSection RecipeType = "section"
	// TypeMultiFile writes multiple files (aider)
	TypeMultiFile RecipeType = "multifile"
)

type UserRecipes

type UserRecipes struct {
	Recipes map[string]Recipe `toml:"recipes"`
}

UserRecipes holds recipes loaded from user config file.

Jump to

Keyboard shortcuts

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