feat(recipes): add template recipe and update final summary heading

- Added new template-recipe.md with structure for creating recipes.
- Changed "**Final Summary**" to "### Final Summary" in result-refactor.md for better formatting.
This commit is contained in:
Greg Gauthier 2026-03-07 00:53:38 +00:00
parent 213a9869e6
commit f36722ad2c
2 changed files with 68 additions and 1 deletions

View File

@ -67,5 +67,5 @@ Safely write changes or create reviewable output.
- If false → write the new files (backup originals as .bak).
**Expected output:** Confirmation of what was written + full path to any patch file.
**Final Summary**
### Final Summary
Give me a concise executive summary: number of files changed, any warnings or patterns you noticed, and your recommended next step.

View File

@ -0,0 +1,67 @@
---
name: my-awesome-recipe
description: Short description of what this recipe does
version: 1.0
parameters:
package_path:
type: string
default: internal
description: Directory or package to operate on
dry_run:
type: bool
default: true
description: If true, only generate a patch
project_languages:
- go
extensions:
go:
- .go
search_pattern: "if err != nil"
allowed_shell_commands:
- go test ./...
- go fmt ./...
- go vet ./...
---
# My Awesome Recipe
**Overview**
One-sentence summary of what the whole recipe accomplishes.
## Execution Steps
### Step 1: Discover files
**Objective:** Find every file that needs changing.
**Instructions:** Recursively scan `{{.package_path}}` for files containing the search pattern.
**Expected output:** A clean list of full file paths (one per line). If none, say "No files found matching the criteria."
### Step 2: Do the work
**Objective:** Perform the main task on each discovered file.
**Instructions:** For each file from Step 1:
- Read the full original content.
- Do whatever transformation is needed.
- Return **ONLY** this exact JSON (no extra text, no markdown):
```json
{
"file": "path/to/file.ext",
"content": "the complete new file content here"
}
```
**Expected output:** A JSON array containing one object per file.
### Step 3: Apply or patch
**Objective:** Safely write changes or create reviewable output.
**Instructions:**
- If dry_run is true → create a unified diff patch file for review.
- If false → write the new files (backup originals as .bak).
- Expected output: Confirmation of what was written + full path to any patch file.
### Final Summary
Give me a concise executive summary: number of files changed, any warnings or patterns you noticed, and your recommended next step.