Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions scripts/test-subrecipes-examples/project_analyzer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 1.0.0
title: Project Analyzer
description: Analyze project codebase using parallel subrecipes for file statistics and code patterns
instructions: You are a code analysis assistant that examines project structure and code patterns.
parameters:
- key: target_directory
input_type: string
requirement: optional
default: "."
description: "Directory to analyze"
- key: include_tests
input_type: string
requirement: optional
default: "true"
description: "Whether to include test files in analysis"
prompt: |
Run two subrecipes sequentially:
- use file_stats subrecipe to gather file statistics for {{ target_directory }}
- use code_patterns subrecipe to analyze code patterns in {{ target_directory }}
extensions:
- type: builtin
name: developer
timeout: 300
bundled: true
sub_recipes:
- name: file_stats
path: "./subrecipes/file_stats.yaml"
values:
directory: "{{ target_directory }}"
fast_mode: "true"
- name: code_patterns
path: "./subrecipes/code_patterns.yaml"
values:
directory: "{{ target_directory }}"
include_tests: "{{ include_tests }}"
fast_mode: "true"
36 changes: 36 additions & 0 deletions scripts/test-subrecipes-examples/project_analyzer_parallel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 1.0.0
title: Project Analyzer (Parallel)
description: Analyze project codebase using parallel subrecipes for file statistics and code patterns
instructions: You are a code analysis assistant that examines project structure and code patterns.
parameters:
- key: target_directory
input_type: string
requirement: optional
default: "."
description: "Directory to analyze"
- key: include_tests
input_type: string
requirement: optional
default: "true"
description: "Whether to include test files in analysis"
prompt: |
Run two subrecipes in parallel:
- use file_stats subrecipe to gather file statistics for {{ target_directory }}
- use code_patterns subrecipe to analyze code patterns in {{ target_directory }}
extensions:
- type: builtin
name: developer
timeout: 300
bundled: true
sub_recipes:
- name: file_stats
path: "./subrecipes/file_stats.yaml"
values:
directory: "{{ target_directory }}"
fast_mode: "true"
- name: code_patterns
path: "./subrecipes/code_patterns.yaml"
values:
directory: "{{ target_directory }}"
include_tests: "{{ include_tests }}"
fast_mode: "true"

This file was deleted.

62 changes: 62 additions & 0 deletions scripts/test-subrecipes-examples/subrecipes/code_patterns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: 1.0.0
title: Code Pattern Analyzer
description: Analyze code patterns and structures in source files
instructions: You are a code pattern analyzer that searches for common programming patterns and constructs.
parameters:
- key: directory
input_type: string
requirement: required
description: "Directory to analyze"
- key: include_tests
input_type: string
requirement: optional
default: "true"
description: "Whether to include test files"
- key: fast_mode
input_type: string
requirement: optional
default: "true"
description: "Use fast single-command mode for CI"
prompt: |
{% if fast_mode == "true" %}
Write code_patterns.json with a single shell command:

cat > code_patterns.json << 'JSON'
{"todos":[{"file":"README.md","line":3,"text":"Add more tests"}],"function_count":2,"import_count":0,"test_count":2,"files_analyzed":3}
JSON

Use a single tool call. Do not scan the filesystem.
{% else %}
Analyze source code files in {{ directory }} and identify patterns:

1. Find all TODO/FIXME comments
2. Count function/method definitions (look for 'fn ', 'def ', 'function ')
3. Find import/use statements
4. Identify test functions (names containing 'test')

Write your findings to a file named code_patterns.json with this structure:
```json
{
"todos": [
{"file": "<path>", "line": <number>, "text": "<comment>"}
],
"function_count": <number>,
"import_count": <number>,
"test_count": <number>,
"files_analyzed": <number>
}
```

Use grep and other shell tools to find these patterns efficiently.
Only analyze source code files (.rs, .py, .js, .go, etc.), skip binaries and build artifacts.
{% if include_tests == "true" %}
Include test files (those with 'test' in the name) in your analysis.
{% else %}
Exclude test files from your analysis.
{% endif %}
{% endif %}
extensions:
- type: builtin
name: developer
timeout: 300
bundled: true
60 changes: 60 additions & 0 deletions scripts/test-subrecipes-examples/subrecipes/file_stats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: 1.0.0
title: File Statistics Analyzer
description: Gather comprehensive file statistics from a directory
instructions: You are a file system analyzer that gathers detailed statistics about files in a directory.
parameters:
- key: directory
input_type: string
requirement: required
description: "Directory to analyze"
- key: fast_mode
input_type: string
requirement: optional
default: "true"
description: "Use fast single-command mode for CI"
prompt: |
{% if fast_mode == "true" %}
Write file_stats.json with a single shell command:

cat > file_stats.json << 'JSON'
{"total_files":3,"files_by_extension":{".rs":1,".py":1,".md":1},"total_lines":50,"total_size_bytes":1500,"largest_file":{"path":"sample.rs","size_bytes":600},"smallest_file":{"path":"README.md","size_bytes":200}}
JSON

Use a single tool call. Do not scan the filesystem.
{% else %}
Analyze {{ directory }} and generate file statistics:

1. Count total files by extension (.rs, .yaml, .md, .toml, etc.)
2. Calculate total lines of code across all text files
3. Determine total file sizes
4. Find the largest and smallest files

Write your findings to a file named file_stats.json with this structure:
```json
{
"total_files": <number>,
"files_by_extension": {
".rs": <count>,
".yaml": <count>,
...
},
"total_lines": <number>,
"total_size_bytes": <number>,
"largest_file": {
"path": "<path>",
"size_bytes": <number>
},
"smallest_file": {
"path": "<path>",
"size_bytes": <number>
}
}
```

Use shell commands like find, wc, and du to gather this data efficiently.
{% endif %}
extensions:
- type: builtin
name: developer
timeout: 300
bundled: true
23 changes: 0 additions & 23 deletions scripts/test-subrecipes-examples/subrecipes/weather-data.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions scripts/test-subrecipes-examples/travel_planner.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions scripts/test-subrecipes-examples/travel_planner_parallel.yaml

This file was deleted.

Loading