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.

来源信息

仓库
irahardianto/awesome-gcli-test
最近来源活动
2026年4月21日 22:43
检测到的 SKILL.md 语言
英语
星标
0
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
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
在 GitHub 查看