Skip to main content

command-execution-principles

Safe command execution: input sanitization, timeout handling, output capture, error propagation. For spawning processes, shell commands, system calls.

Datos de origen

Repositorio
irahardianto/awesome-gcli-test
Última actividad en el origen
21 de abril de 2026 a las 22:43
Idioma detectado de SKILL.md
inglés
Estrellas
0
Forks
0

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
command-execution-principles
description
Safe command execution: input sanitization, timeout handling, output capture, error propagation. For spawning processes, shell commands, system calls.
user-invocable
false
## Command Execution Principles ### Security - ❌ `exec(userInput)`, `shell("rm " + userFile)` - ✅ Argument lists (no shell string concat), validate/sanitize all args - Never run as root/admin without explicit human approval. Elevated perms required → STOP and request auth. - Least-privilege service accounts ### Portability - Use language stdlib over shell commands (file I/O APIs instead of cat/cp/mv) - Test on all target OS (path joining functions, not / concatenation) ### Error Handling - Check exit codes (non-zero = failure) - Capture + log stderr - Set timeouts for long-running - Handle "command not found" gracefully ### Checklist - [ ] User input sanitized before commands - [ ] Arguments as lists (no shell concat) - [ ] Minimum permissions - [ ] Exit codes checked - [ ] Timeouts set - [ ] stderr captured + logged ### Related - Security Mandate @.gemini/rules/security-mandate.md - Security Principles @.gemini/rules/security-principles.md
Ver en GitHub