New agents and instructions for AI have been added

This commit is contained in:
Divarion-D
2026-03-09 17:31:12 +03:00
parent e18c507098
commit 02a0a915f7
13 changed files with 569 additions and 7 deletions
@@ -0,0 +1,33 @@
---
description: "Use when writing or editing shell scripts in tools/, src/bin/, or src/infrastructure/. Covers bash conventions for XC_VM."
applyTo: "**/*.sh"
---
# Bash Script Conventions — XC_VM
## Required Header
```bash
#!/bin/bash
set -euo pipefail
```
## Style
- Indent with 4 spaces (not tabs — unlike PHP)
- Quote all variables: `"$var"` not `$var`
- Use `[[ ]]` for conditionals, not `[ ]`
- Use `$()` for command substitution, not backticks
## Error Handling
- `set -e` — exit on first error
- `set -u` — treat unset variables as error
- `set -o pipefail` — catch errors in pipes
- Use `trap` for cleanup on exit when creating temp files
## Security
- Never pass secrets via command-line arguments (visible in `ps`)
- Use environment variables or files with restricted permissions (0600)
- Validate external input before using in commands
- Avoid `eval` unless absolutely necessary
## Paths
- Use absolute paths for system binaries: `/usr/bin/php8.2`, `/usr/sbin/nginx`
- Reference project root via variable, not hardcoded paths