Skip to content

Instantly share code, notes, and snippets.

@herculosh
Last active September 27, 2025 12:16
Show Gist options
  • Save herculosh/4cdc0fbcfcd109d3902d09b7e3701c65 to your computer and use it in GitHub Desktop.
Save herculosh/4cdc0fbcfcd109d3902d09b7e3701c65 to your computer and use it in GitHub Desktop.
Espanso Development triggers for developing Godot with Cursor.ai
# Espanso Development Triggers for Cursor.ai
# A comprehensive collection of development-focused triggers with intelligent file search
global_vars:
- name: file_search_path
type: echo
params:
echo: |
# Path to your development project root
# Change this to your project directory
"C:\\Users\\user\\AppData\\Roaming\\espanso"
matches:
# ===========================================
# CURSOR.AI DEVELOPMENT PROMPTS
# ===========================================
# Code Review and Analysis
- trigger: ".,dev_review"
label: "Dev, Code Review"
replace: "Dev, Code Review: Please review this code and suggest improvements for readability, performance, and best practices."
# Debugging Help
- trigger: ".,dev_debug"
label: "Dev, Debugging"
replace: "Dev, Debugging: Help me debug this issue. What could be causing this problem and how can I fix it?"
# Documentation
- trigger: ".,dev_doc"
label: "Dev, Documentation"
replace: "Dev, Documentation: Add comprehensive documentation including JSDoc comments for functions and classes."
# Testing
- trigger: ".,dev_test"
label: "Dev, Testing"
replace: "Dev, Testing: Write unit tests for this code using Jest/Mocha with good test coverage."
# Performance Analysis
- trigger: ".,dev_perf"
label: "Dev, Performance"
replace: "Dev, Performance: Analyze this code for performance bottlenecks and suggest optimizations."
# ===========================================
# GODOT-SPECIFIC TRIGGERS
# ===========================================
# Godot Signals
- trigger: ".,dev_gd_signal"
label: "Dev, Godot Signals"
replace: "Dev, Godot Signals: Create a proper Godot signal system for this scene. Define the signal, connect it, and emit it appropriately."
# Godot Animation
- trigger: ".,dev_gd_tween"
label: "Dev, Godot Animation"
replace: "Dev, Godot Animation: Add smooth animations using Godot's Tween system for this node. Include easing and duration parameters."
# Godot Scene Structure
- trigger: ".,dev_gd_scene"
label: "Dev, Godot Scene"
replace: "Dev, Godot Scene: Help me structure this Godot scene properly with appropriate nodes, groups, and scene organization."
# Godot Input Handling
- trigger: ".,dev_gd_input"
label: "Dev, Godot Input"
replace: "Dev, Godot Input: Implement proper input handling for this Godot script using Input.is_action_just_pressed() and Input.is_action_pressed()."
# Godot State Machine
- trigger: ".,dev_gd_state"
label: "Dev, Godot State"
replace: "Dev, Godot State: Create a state machine pattern for this Godot script with proper state transitions and state-specific behavior."
# Git Commit
- trigger: ".,dev_gd_commit"
label: "Dev, Git Commit"
replace: "Dev, Git Commit: Commit this code based on the staged files. Generate a meaningful commit message that describes the changes made."
# ===========================================
# INTELLIGENT FILE SEARCH TRIGGERS
# ===========================================
# File Search - Full Path Output
- regex: ":ffs(?P<pattern>.*);"
label: "File Search (Full Path)"
replace: "{{file_list}}"
vars:
- name: file_list
type: shell
params:
cmd: >
try {
$global_search_path = {{file_search_path}};
$files = Get-ChildItem -Path $global_search_path -Recurse -File -verbose |
Where-Object {
if("{{pattern}}".contains(".")) {
$_.Name -match "{{pattern}}" -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
} else {
$_.Name.contains("{{pattern}}") -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
}
}
foreach ($file in $files) {
write-host $file.FullName;
}
}
catch {
Write-host "Error: $($_.Exception.Message)";
}
# Simple file search trigger
- regex: ":fnfs(?P<pattern>.*);"
label: "Regex File Search, returns file name"
replace: "{{file_list}}"
vars:
- name: file_list
type: shell
params:
cmd: >
try {
$searchPattern = "{{pattern}}";
# Convert the file_search_path to a string, otherwise illegal characters will be used
$global_search_path = {{file_search_path}};
$files = Get-ChildItem -Path $global_search_path -Recurse -File -verbose |
Where-Object {
if("{{pattern}}".contains(".")) {
$_.Name -match "{{pattern}}" -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
} else {
$_.Name.contains("{{pattern}}") -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
}
}
write-host "Files found: $($files.count)";
foreach ($file in $files) {
write-host ("{0}" -f $file.Name);
}
}
catch {
Write-host "Error: $($_.Exception.Message)";
write-host "Error occurred: $($_.Exception.Message)";
}
# Directory Search - Full Path Output
- regex: ":dfs(?P<pattern>.*);"
label: "Directory Search (Full Path)"
replace: "{{dir_list}}"
vars:
- name: dir_list
type: shell
params:
cmd: >
try {
$global_search_path = {{file_search_path}};
$dirs = Get-ChildItem -Path $global_search_path -Recurse -Directory -verbose |
Where-Object {
if("{{pattern}}".contains(".")) {
$_.Name -match "{{pattern}}" -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
} else {
$_.Name.contains("{{pattern}}") -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
}
}
foreach ($dir in $dirs) {
write-host $dir.FullName;
}
}
catch {
Write-host "Error: $($_.Exception.Message)";
}
# Directory Search - Name Only Output
- regex: ":dnfs(?P<pattern>.*);"
label: "Directory Search (Name Only)"
replace: "{{dir_list}}"
vars:
- name: dir_list
type: shell
params:
cmd: >
try {
$global_search_path = {{file_search_path}};
$dirs = Get-ChildItem -Path $global_search_path -Recurse -Directory -verbose |
Where-Object {
if("{{pattern}}".contains(".")) {
$_.Name -match "{{pattern}}" -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
} else {
$_.Name.contains("{{pattern}}") -and
(-not $_.FullName.contains(".godot")) -and
(-not $_.FullName.endswith(".uid")) -and
(-not $_.FullName.endswith(".import"))
}
}
foreach ($dir in $dirs) {
write-host $dir.Name;
}
}
catch {
Write-host "Error: $($_.Exception.Message)";
}
# ===========================================
# USAGE EXAMPLES
# ===========================================
#
# CURSOR.AI PROMPTS:
# .,dev_review -> Code review prompt
# .,dev_debug -> Debugging help prompt
# .,dev_doc -> Documentation prompt
# .,dev_test -> Testing prompt
# .,dev_perf -> Performance analysis prompt
#
# GODOT-SPECIFIC:
# .,dev_gd_signal -> Godot signal system prompt
# .,dev_gd_tween -> Godot animation prompt
# .,dev_gd_scene -> Godot scene structure prompt
# .,dev_gd_input -> Godot input handling prompt
# .,dev_gd_state -> Godot state machine prompt
# .,dev_gd_commit -> Git commit prompt
#
# FILE SEARCH (always end with semicolon):
# :ffs04; -> Find files with "04" in name (full path)
# :fnfs.gd; -> Find .gd files (name only)
# :ffsplayer; -> Find files with "player" in name (full path)
# :dfsconfig; -> Find directories with "config" in name (full path)
# :dnfsassets; -> Find directories with "assets" in name (name only)
#
# INTELLIGENT FILTERING:
# - Patterns with dots (.) use regex matching for file extensions
# - Patterns without dots use contains() for substring search
# - Automatically excludes .godot, .uid, .import files
# - Recursive search through all subdirectories
#
# SETUP:
# 1. Change the file_search_path in global_vars to your project directory
# 2. Save this file as _development.yml in your espanso match directory
# 3. Restart espanso to load the new triggers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment