Implement advice operators for formula composition (gt-8tmz.2)

Add Lisp-style advice operators to the formula DSL:
- before(target, step) - insert step before target
- after(target, step) - insert step after target
- around(target, wrapper) - wrap target with before/after

Features:
- Glob pattern matching for targets (*.implement, shiny.*, etc)
- Pointcut matching by type or label
- Step reference substitution ({step.id}, {step.title})
- Automatic dependency chaining

New types: AdviceRule, AdviceStep, AroundAdvice, Pointcut
New functions: ApplyAdvice, MatchGlob, MatchPointcut

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-25 01:53:43 -08:00
parent e068ac574f
commit a643b9ab67
4 changed files with 632 additions and 0 deletions

View File

@@ -93,6 +93,11 @@ func runCook(cmd *cobra.Command, args []string) {
os.Exit(1)
}
// Apply advice transformations (gt-8tmz.2)
if len(resolved.Advice) > 0 {
resolved.Steps = formula.ApplyAdvice(resolved.Steps, resolved.Advice)
}
// Apply prefix to proto ID if specified (bd-47qx)
protoID := resolved.Formula
if prefix != "" {