- Added tests for player animations in animation_archive_tests to ensure all animations are loaded correctly. - Updated entity_dispatch_entry_tests to validate animation direction updates and added tests for sixteen-direction animations. - Expanded isometric_controls_tests with comprehensive key event handling and action requests for various controller states. - Improved map_renderer_tests by adding viewport rendering tests to compare unbounded and bounded views. - Enhanced shape_archive_tests to validate shape frame loading and decoding consistency.
3 KiB
3 KiB
| description | applyTo |
|---|---|
| Shell-operation guardrails for shared PowerShell sessions, tool availability checks, and multiline command workarounds | ** |
Shell Operations
Use these rules when running shell commands from this workspace.
General Rules
- Prefer built-in workspace tools for file search, text search, file reads, and edits before dropping to the terminal.
- Keep terminal commands short and single-line when possible.
- Treat the shared PowerShell session as fragile after any prompt-continuation or escape-sequence artifact appears.
Tool Availability
- Do not assume
rgis installed. - Before using
rg, check availability withGet-Command rg -ErrorAction SilentlyContinue. - If
rgis unavailable, use workspace search tools first. - If shell-side fallback is still needed, use PowerShell-native alternatives:
Get-ChildItem -Recurse -Filefor file discoverySelect-Stringfor text search
Multiline Command Safety
- Do not paste multiline commands directly into the shared PowerShell terminal when a one-line command or script file will do.
- Do not send multiline PowerShell hash tables, arrays, or loops directly to the shared terminal if the same work can be expressed as:
- one single-line command, or
- a temporary
.ps1script file executed withpwsh -File, or - a temporary
.pyfile executed with Python for Python-side work.
- Always write multiline Python to a temporary
.pyfile and execute that file instead of pasting Python into the terminal.
Recovering From Terminal Weirdness
- If the prompt shows continuation markers, partial prompt redraws, or escape-sequence artifacts, stop issuing more complex commands in that shell.
- Try a single
Escfirst to clear unfinished input. - If the shell still looks unhealthy, ask the user to reset or fix the terminal with the ask-questions tool before continuing.
- After recovery, resume with single-line commands or temporary script files instead of retrying the same multiline paste.
Command Style
- Prefer explicit PowerShell cmdlets over aliases in reusable commands.
- Avoid commands that rely on interactive input.
- Prefer one focused command per terminal invocation so failures are easier to attribute.
- When posting HTTP form data from PowerShell, prefer compact one-line request bodies over multiline literal blocks in the shared shell.
GitHub Copilot Instructions for PowerShell
Environment: I am using Windows and all terminal commands must be compatible with PowerShell (or PowerShell Core/PS7).
CRITICAL COMMAND SYNTAX:
- NEVER use
&&for command chaining. - ALWAYS use the semicolon (
;) for chaining or separating multiple commands on a single line.- Good Example:
npm install; npm start - Bad Example (Avoid):
npm install && npm start
- Good Example:
- Prefer built-in PowerShell cmdlets (e.g.,
Get-ChildIteminstead oflsordir) whenever possible, or use common aliases likelsif they are working. - Use Windows-style backslashes for paths and quote paths with spaces.