Skilllibrary shell-inspection
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/06-agent-role-candidates/shell-inspection" ~/.claude/skills/merceralex397-collab-skilllibrary-shell-inspection && rm -rf "$T"
manifest:
06-agent-role-candidates/shell-inspection/SKILL.mdsource content
Purpose
Run read-only shell commands to diagnose and document the current system state — tool versions, environment variables, running processes, open ports, file permissions, disk and memory usage, and network connectivity. Produce a structured report that downstream agents can use to validate prerequisites or troubleshoot failures.
When to use
- A build or test failure may be caused by environment misconfiguration.
- A new developer needs to verify their local setup matches project requirements.
- An agent needs to confirm runtime prerequisites before executing a plan.
- Debugging a "works on my machine" discrepancy between environments.
- Pre-deployment verification of server state.
Do NOT use when
- The task requires installing packages or modifying system configuration — hand off to a setup skill.
- The investigation is purely about source code, not the runtime environment — use
.repo-evidence-gathering - The user needs a security audit — use
for that scope.security-review - The system is remote and requires SSH — this skill operates on the local shell only.
Operating procedure
- Run
anduname -a
to identify the OS and kernel version.cat /etc/os-release 2>/dev/null || sw_vers 2>/dev/null - Check required tool versions by running
,node --version
,python3 --version
,go version
,rustc --version
,java -version
,docker --version
— skip tools that return "command not found" and note them as missing.git --version - Run
to capture relevant environment variables (redact any values containing "secret", "key", "token", or "password").env | grep -iE 'PATH|HOME|NODE_ENV|PYTHON|RUST|GOPATH|JAVA_HOME|DATABASE_URL|PORT|API' | sort - Check running processes with
to identify active services.ps aux --no-headers | grep -iE 'node|python|java|docker|postgres|redis|nginx|mysql' | head -20 - Inspect open ports with
and list listening ports with their associated PIDs.ss -tlnp 2>/dev/null || netstat -tlnp 2>/dev/null - Check disk usage with
and memory withdf -h /
— flag if disk is above 90% or available memory is below 500MB.free -h 2>/dev/null || vm_stat 2>/dev/null - Verify file permissions on key project files: run
on the repo root, anyls -la
files, and config directories — flag world-readable secrets files..env - Test network connectivity by running
(or equivalent) for package registries the project depends on.curl -sS -o /dev/null -w '%{http_code}' https://registry.npmjs.org/ 2>/dev/null - Check for Docker state if applicable: run
anddocker ps --format 'table {{.Names}} {{.Status}} {{.Ports}}'
.docker compose ps 2>/dev/null - Compile all results into the output format below, marking each check as PASS, WARN, or FAIL.
Decision rules
- Never run commands that modify state — no
,rm
,mv
,install
, orwrite
.stop - Redact any environment variable value that looks like a credential (contains key, secret, token, password).
- If a command times out after 10 seconds, mark it as TIMEOUT and move on.
- Report exact version strings, not just "installed" — downstream agents need precise versions.
- When a check fails, include the raw command output so the user can diagnose further.
Output requirements
- System Info — OS, kernel, architecture.
- Tool Versions Table —
| Tool | Version | Status (OK/Missing/Wrong) | - Environment Variables — relevant vars with redacted secrets.
- Running Services — active processes relevant to the project.
- Port Map —
| Port | PID | Process | Protocol | - Resource Status — disk and memory usage with PASS/WARN/FAIL.
- Permission Flags — any files with insecure permissions.
- Network Connectivity — registry reachability results.
- Overall Readiness — READY / NOT READY with list of blockers.
References
- Project README or AGENTS.md for expected tool versions
engines field,package.json
,.tool-versions
,.nvmrcrust-toolchain.toml- Docker Compose files for expected service dependencies
Related skills
— complements shell inspection with source-level evidencerepo-evidence-gathering
— uses permission and environment findings for security assessmentsecurity-review
— converts environment issues into setup ticketsticket-creator
— may follow shell-inspection when debugging service connectivityapi-debugging
Failure handling
- If a command is not available on the current OS, skip it and note the OS limitation.
- If permission is denied for a check, log the command and error, mark as DENIED, and continue.
- If the environment has no project context (empty directory), report "no project detected" and list only system-level findings.
- If more than 5 checks return FAIL, add a prominent banner: "Environment has critical issues — resolve before proceeding."