From d2ec9ff8cd56f84ce82fbc4a3c4a68836ab78758 Mon Sep 17 00:00:00 2001 From: valkyrie Date: Thu, 1 Jan 2026 17:31:28 -0800 Subject: [PATCH] fix(formula): Convert code-review.formula.toml from Handlebars to Go template syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The convoy formula's base prompt was using Handlebars syntax ({{#if}}, {{#each}}, {{this.field}}) but Go's text/template uses different syntax ({{if .}}, {{range .}}, {{.field}}). Changes: - {{variable}} → {{.variable}} (dot prefix for variable access) - {{#if var}} → {{if .var}} - {{#each items}} → {{range .items}} - {{this.field}} → {{.field}} - {{/if}}, {{/each}} → {{end}} Also added a comment noting the template uses Go text/template syntax. Fixes: gt-2dndm 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .beads/formulas/code-review.formula.toml | 43 ++++++++++++------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.beads/formulas/code-review.formula.toml b/.beads/formulas/code-review.formula.toml index 6a717f0e..dc09c950 100644 --- a/.beads/formulas/code-review.formula.toml +++ b/.beads/formulas/code-review.formula.toml @@ -51,6 +51,7 @@ type = "string" required_unless = ["pr", "files"] # Base prompt template - injected into all leg prompts +# NOTE: Uses Go text/template syntax (not Handlebars) [prompts] base = """ # Code Review Assignment @@ -58,34 +59,34 @@ base = """ You are a specialized code reviewer participating in a convoy review. ## Context -- **Formula**: {{formula_name}} -- **Review target**: {{target_description}} -- **Your focus**: {{leg.focus}} -- **Leg ID**: {{leg.id}} +- **Formula**: {{.formula_name}} +- **Review target**: {{.target_description}} +- **Your focus**: {{.leg.focus}} +- **Leg ID**: {{.leg.id}} ## Files Under Review -{{#if pr_number}} -PR #{{pr_number}}: {{pr_title}} +{{if .pr_number -}} +PR #{{.pr_number}}: {{.pr_title}} Changed files: -{{#each changed_files}} -- {{this.path}} (+{{this.additions}}/-{{this.deletions}}) -{{/each}} -{{else}} -{{#each files}} -- {{this}} -{{/each}} -{{/if}} +{{range .changed_files -}} +- {{.path}} (+{{.additions}}/-{{.deletions}}) +{{end -}} +{{else -}} +{{range .files -}} +- {{.}} +{{end -}} +{{end}} ## Your Task -{{leg.description}} +{{.leg.description}} ## Output Requirements -Write your findings to: **{{output_path}}** +Write your findings to: **{{.output_path}}** Structure your output as follows: ```markdown -# {{leg.title}} Review +# {{.leg.title}} Review ## Summary (1-2 paragraph overview of findings) @@ -114,8 +115,8 @@ Use specific file:line references. Be actionable. Prioritize impact. # Output configuration [output] -directory = ".reviews/{{review_id}}" -leg_pattern = "{{leg.id}}-findings.md" +directory = ".reviews/{{.review_id}}" +leg_pattern = "{{.leg.id}}-findings.md" synthesis = "review-summary.md" # Leg definitions - each spawns a parallel polecat @@ -299,10 +300,10 @@ description = """ Combine all leg findings into a unified, prioritized review. **Your input:** -All leg findings from: {{output.directory}}/ +All leg findings from: {{.output.directory}}/ **Your output:** -A synthesized review at: {{output.directory}}/{{output.synthesis}} +A synthesized review at: {{.output.directory}}/{{.output.synthesis}} **Structure:** 1. **Executive Summary** - Overall assessment, merge recommendation