feature/recipe_implementation #5

Merged
gmgauthier merged 54 commits from feature/recipe_implementation into master 2026-03-07 23:17:54 +00:00
3 changed files with 11 additions and 10 deletions
Showing only changes of commit 2cc728eed4 - Show all commits

View File

@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
"gmgauthier.com/grokkit/internal/recipe" // adjust if your module name differs
"gmgauthier.com/grokkit/internal/recipe"
)
var recipeCmd = &cobra.Command{
@ -25,7 +25,7 @@ var runCmd = &cobra.Command{
func init() {
recipeCmd.AddCommand(runCmd)
rootCmd.AddCommand(recipeCmd) // this is how every other command is wired in your project
rootCmd.AddCommand(recipeCmd)
}
func runRecipe(cmd *cobra.Command, args []string) error {
@ -84,8 +84,7 @@ func resolveRecipePath(nameOrPath string) (string, error) {
if _, err := os.Stat(global); err == nil {
fmt.Printf("Recipe %q not found in project.\nFound globally at %s\nUse this one? [y/N] ", nameOrPath, global)
var answer string
_, err := fmt.Scanln(&answer)
if err != nil {
if _, err := fmt.Scanln(&answer); err != nil {
return "", err
}
if strings.HasPrefix(strings.ToLower(answer), "y") {

View File

@ -15,8 +15,7 @@ var (
// stepRe finds every "### Step N: Title" heading
stepRe = regexp.MustCompile(`(?m)^### Step (\d+): (.+)$`)
// subRe finds the three labelled sections inside each step.
// We use a simple non-capturing group + word-boundary approach instead of lookahead.
// subRe finds the three labelled sections inside each step (no Perl lookahead)
subRe = regexp.MustCompile(`(?m)^(\*\*(?:Objective|Instructions|Expected output):\*\*)\s*(.+?)(?:\n\n|\n###|\z)`)
)

View File

@ -11,12 +11,15 @@ func NewRunner(r *Recipe) *Runner {
}
func (r *Runner) Run() error {
fmt.Printf("🍳 Starting recipe: %s v%s\n", r.Recipe.Name, r.Recipe.Version)
fmt.Printf("🍳 Starting recipe: %s v%s\n\n", r.Recipe.Name, r.Recipe.Version)
for _, step := range r.Recipe.Steps {
fmt.Printf("Step %d/%d: %s\n", step.Number, len(r.Recipe.Steps), step.Title)
// TODO: here we will send step.Instructions to the LLM
// and handle the response according to Expected
// TODO: here we will send step.Instructions (plus Objective/Expected) to the LLM
// and handle the response according to Expected output
fmt.Println(" → (LLM call coming soon)")
}
fmt.Println("✅ Recipe complete.")
fmt.Println("\n✅ Recipe complete.")
return nil
}