- name
- command-execution
- description
- Execute terminal commands safely with preflight checks and risk gating.
- metadata
- author
- RedHat Dev
- version
- 1.0.0
- owner
- RedHat Dev Agent
- category
- execution
SKILL: command-execution
Purpose
Execute terminal commands safely with deterministic preflight checks, risk classification, and auditable outputs.
When to Use
- Running tests, builds, linters, or migrations.
- Inspecting the repo (search, list files, check versions).
- Any command execution that could affect the environment.
Inputs
command(required, string): exact command to run.purpose(required, string): why this command is needed.expected_effects(optional, string[]): what should happen (files created, tests run).risk_level(optional, enum:low|medium|high): if known.
Steps
- Classify command risk:
- read-only (safe) - write (moderate) - destructive/network/system (high)
- Block/require confirmation for high-risk patterns:
- recursive deletes (rm -rf, Remove-Item -Recurse -Force) - format/disk ops - piping remote scripts (curl ... | sh)
- If supported, prefer dry-run flags first (e.g.,
--dry-run,-n,--check). - Execute the command and capture:
- exit code - stdout/stderr - elapsed time (if available)
- Interpret results against
expected_effects. - If command failed:
- stop - summarize error - propose next diagnostic steps
Validation
- Exit code is checked (not ignored).
- Output is summarized with the relevant error lines.
- Side effects match expectation (no surprise modifications).
Output
command: "<command>"
purpose: "<purpose>"
result: "success|blocked|failed"
exit_code: <int|null>
highlights: ["<key output lines>"]
next_steps: ["..."]Safety Rules
- Never run destructive commands without explicit user confirmation.
- Never run unknown installers or remote scripts without review.
- Prefer minimal, scoped commands (avoid global state changes).
Example
Run tests:
command:pnpm testpurpose: “Validate behavior after refactorâ€- Output: exit code + failing test names + next diagnostic step.