Documentation
¶
Overview ¶
Package recipes turns the "Recipes" section of an app's guide (docs/lidza-guide.md) into task recipes: prompts served by `lidza mcp`, and skills for Claude Code (.claude/skills) and for Codex and Gemini CLI (.agents/skills, the Agent Skills layout both read; Gemini offers each as a /<name> command). The guide is the only source; everything else is rewritten from it by `lidza gen`.
Index ¶
Constants ¶
const ( SkillsDir = ".claude/skills" AgentsSkillsDir = ".agents/skills" // GeminiCommandsDir held a TOML command per recipe (/lidza:<name>) // before Gemini CLI read .agents/skills, which made each recipe // appear twice there; lidza gen removes the generated ones. GeminiCommandsDir = ".gemini/commands/lidza" )
SkillsDir is where Claude Code reads skills, relative to the project root; AgentsSkillsDir is the Agent Skills layout Codex and Gemini CLI read. Both get the same SKILL.md files.
const ( Heading = "## Recipes" AppHeading = "## App recipes" )
Heading is the guide section that holds the framework's recipes, which `lidza gen` refreshes from the template; AppHeading holds the app's own, which nothing but the app's developers touch.
const ( ScopeFramework = "framework" ScopeApp = "app" )
Scopes of a recipe.
const GuideFile = "docs/lidza-guide.md"
GuideFile is the app guide, relative to the project root.
Variables ¶
var OutputDirs = []string{SkillsDir, AgentsSkillsDir, GeminiCommandsDir}
OutputDirs lists every directory lidza gen writes recipes to or clears generated files from.
Functions ¶
func RefreshGuide ¶
RefreshGuide replaces the guide with guide (the framework's, rendered for this app) keeping the app's own: the body of its "## App recipes" section. It reports whether anything changed; an app without a guide is left alone.
func ReplaceFramework ¶
ReplaceFramework replaces the body of the "## Recipes" section of the guide with body (the framework's current recipes) and reports whether anything changed. A guide without the section is left alone.
func Slug ¶
Slug lowercases a title, drops articles and joins the words with dashes: "Add an API route" is "add-api-route".
func WriteSkills ¶
WriteSkills writes every recipe as a skill for Claude Code and for Codex and Gemini CLI, removes generated files whose recipe is gone and the Gemini commands lidza wrote before, and returns the paths it wrote, relative to dir.
Types ¶
type Recipe ¶
type Recipe struct {
// Name is the slug of the title: the prompt name and the skill
// directory ("add-api-route").
Name string `json:"name"`
Title string `json:"title"`
// Description is the first paragraph of the body on one line.
Description string `json:"description"`
// Body is the markdown under the heading, trimmed.
Body string `json:"body"`
// Scope is "framework" (under "## Recipes") or "app" (under
// "## App recipes").
Scope string `json:"scope"`
}
Recipe is one task: a level-3 heading under "## Recipes" and its text.
func Add ¶
Add appends a recipe to the guide's "## App recipes" section, creating the section after "## Recipes" when the guide has none. Steps become a numbered list; an empty list leaves the steps to fill in. It returns the recipe as parsed back.