/container-execution
Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.
$ npx -y skills add prime-radiant-inc/greenfield --skill container-execution --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/container-execution
Context preview
The summary Claude sees to decide when to auto-load this skill.
Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.
SKILL.md
container-execution.SKILL.mdname: container-execution
description: Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.
Container Execution
All runtime analysis targets run inside containers. Never execute untrusted code on the host.
Runtime Detection
if command -v docker &>/dev/null; then
RUNTIME="docker"
elif command -v podman &>/dev/null; then
RUNTIME="podman"
else
echo "No container runtime found. Runtime observation unavailable."
# Continue with static analysis modes only
fi
If neither Docker nor Podman is available, skip all agents that require containers. This is not an error — runtime observation is additive.
Container Naming
Container name: `greenfield-${WORKSPACE}-target`
- Deterministic (same workspace = same name)
- Does not leak the target's identity
- Allows multiple concurrent analyses
Container Lifecycle
digraph container_lifecycle {
rankdir=TB;
"Start container lifecycle" [shape=doublecircle];
"Container runtime available?" [shape=diamond];
"Build target image" [shape=box];
"Build succeeded?" [shape=diamond];
"Start container with resource limits" [shape=box];
"Verify container is running" [shape=box];
"Container running?" [shape=diamond];
"Execute agent commands via docker exec" [shape=box];
"Stop and remove container" [shape=box];
"Lifecycle complete" [shape=doublecircle];
"Skip runtime mode, continue static analysis" [shape=ellipse];
"Log failure, skip runtime mode" [shape=ellipse];
"Start container lifecycle" -> "Container runtime available?";
"Container runtime available?" -> "Build target image" [label="yes"];
"Container runtime available?" -> "Skip runtime mode, continue static analysis" [label="no"];
"Build target image" -> "Build succeeded?";
"Build succeeded?" -> "Start container with resource limits" [label="yes"];
"Build succeeded?" -> "Log failure, skip runtime mode" [label="no"];
"Start container with resource limits" -> "Verify container is running";
"Verify container is running" -> "Container running?";
"Container running?" -> "Execute agent commands via docker exec" [label="yes"];
"Container running?" -> "Log failure, skip runtime mode" [label="no"];
"Execute agent commands via docker exec" -> "Stop and remove container";
"Stop and remove container" -> "Lifecycle complete";
}1. Build the Image
The Dockerfile is at `workspace/raw/runtime/Dockerfile`. It is generated based on target type:
**Node.js CLI/Library:**
FROM node:lts-slim
WORKDIR /app
COPY target/ /app/
RUN npm install --production 2>/dev/null || true
RUN npm link 2>/dev/null || true
RUN mkdir -p /output
ENTRYPOINT ["sleep", "infinity"]
**Python:**
FROM python:3.12-slim
WORKDIR /app
COPY target/ /app/
RUN pip install --no-cache-dir -r requirements.txt 2>/dev/null || true
RUN pip install --no-cache-dir -e . 2>/dev/null || true
RUN mkdir -p /output
ENTRYPOINT ["sleep", "infinity"]
**Compiled Binary (Go, Rust, C):**
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates file strace && rm -rf /var/lib/apt/lists/*
COPY target/binary /usr/local/bin/target
RUN chmod +x /usr/local/bin/target
RUN mkdir -p /output
ENTRYPOINT ["sleep", "infinity"]**Web Application:**
FROM node:lts-slim
WORKDIR /app
COPY target/ /app/
RUN npm install --production 2>/dev/null || true
RUN mkdir -p /output
EXPOSE 3000
CMD ["npm", "start"]
Build command:
$RUNTIME build -t greenfield-${WORKSPACE}-target \
-f workspace/raw/runtime/Dockerfile .If the build fails, log the error to `workspace/raw/runtime/build-log.txt` and mark runtime mode as unavailable. The pipeline continues with other modes.
2. Start the Container
**CLI/Library targets:**
$RUNTIME run -d \
--name greenfield-${WORKSPACE}-target \
--memory=2g --cpus=2 --pids-limit=256 \
--network=none --read-only \
--tmpfs /tmp:rw,noexec,nosuid,size=256m \
-v "$(pwd)/workspace/raw/runtime:/output:rw" \
greenfield-${WORKSPACE}-target**Web application targets:**
$RUNTIME run -d \
--name greenfield-${WORKSPACE}-target \
--memory=2g --cpus=2 --pids-limit=256 \
--network=none \
-p 127.0.0.1:3000:3000 \
-v "$(pwd)/workspace/raw/runtime:/output:rw" \
greenfield-${WORKSPACE}-target3. Verify Running
$RUNTIME inspect --format='{{.State.Running}}' greenfield-${WORKSPACE}-target
# Expected: true4. Cleanup
$RUNTIME stop --time=10 greenfield-${WORKSPACE}-target 2>/dev/null || true
$RUNTIME rm greenfield-${WORKSPACE}-target 2>/dev/null || trueCommand Execution
All target interaction goes through `docker exec` (or `podman exec`).
Basic Command
timeout 30 $RUNTIME exec greenfield-${WORKSPACE}-target \
sh -c 'command args 2>&1' \
> workspace/raw/runtime/cli/output.txtWith Timeout Handling
timeout 30 $RUNTIME exec greenfield-${WORKSPACE}-target \
sh -c 'command args 2>&1' > output.txt 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -eq 124 ]; then
echo "TIMEOUT: Command killed after 30 seconds." >> output.txt
fiWith Environment Variables
$RUNTIME exec -e "DEBUG=true" -e "CONFIG_PATH=/app/config.json" \
greenfield-${WORKSPACE}-target sh -c 'target-command 2>&1'With Piped Input
echo "user input here" | \
timeout 30 $RUNTIME exec -i greenfield-${WORKSPACE}-target \
sh -c 'target-command' > output.txt 2>&1Pre-Execution Checklist
Before executing commands, verify:
1. Container is running: `$RUNTIME inspect --format='{{.State.Running}}' greenfield-${WORKSPACE}-target` 2. Output directory is mounted: `$RUNTIME exec greenfield-${WORKSPACE}-target test -d /output`
Exploration Patterns
CLI Exploration
# Help and version discovery
timeout 30 $RUN
Read more
name: container-execution description: Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.
Container Execution
All runtime analysis targets run inside containers. Never execute untrusted code on the host.
Runtime Detection
if command -v docker &>/dev/null; then RUNTIME="docker" elif command -v podman &>/dev/null; then RUNTIME="podman" else echo "No container runtime found. Runtime observation unavailable." # Continue with static analysis modes only fi
If neither Docker nor Podman is available, skip all agents that require containers. This is not an error — runtime observation is additive.
Container Naming
Container name: `greenfield-${WORKSPACE}-target`
- Deterministic (same workspace = same name)
- Does not leak the target's identity
- Allows multiple concurrent analyses
Container Lifecycle
digraph container_lifecycle {
rankdir=TB;
"Start container lifecycle" [shape=doublecircle];
"Container runtime available?" [shape=diamond];
"Build target image" [shape=box];
"Build succeeded?" [shape=diamond];
"Start container with resource limits" [shape=box];
"Verify container is running" [shape=box];
"Container running?" [shape=diamond];
"Execute agent commands via docker exec" [shape=box];
"Stop and remove container" [shape=box];
"Lifecycle complete" [shape=doublecircle];
"Skip runtime mode, continue static analysis" [shape=ellipse];
"Log failure, skip runtime mode" [shape=ellipse];
"Start container lifecycle" -> "Container runtime available?";
"Container runtime available?" -> "Build target image" [label="yes"];
"Container runtime available?" -> "Skip runtime mode, continue static analysis" [label="no"];
"Build target image" -> "Build succeeded?";
"Build succeeded?" -> "Start container with resource limits" [label="yes"];
"Build succeeded?" -> "Log failure, skip runtime mode" [label="no"];
"Start container with resource limits" -> "Verify container is running";
"Verify container is running" -> "Container running?";
"Container running?" -> "Execute agent commands via docker exec" [label="yes"];
"Container running?" -> "Log failure, skip runtime mode" [label="no"];
"Execute agent commands via docker exec" -> "Stop and remove container";
"Stop and remove container" -> "Lifecycle complete";
}1. Build the Image
The Dockerfile is at `workspace/raw/runtime/Dockerfile`. It is generated based on target type:
**Node.js CLI/Library:**
FROM node:lts-slim WORKDIR /app COPY target/ /app/ RUN npm install --production 2>/dev/null || true RUN npm link 2>/dev/null || true RUN mkdir -p /output ENTRYPOINT ["sleep", "infinity"]
**Python:**
FROM python:3.12-slim WORKDIR /app COPY target/ /app/ RUN pip install --no-cache-dir -r requirements.txt 2>/dev/null || true RUN pip install --no-cache-dir -e . 2>/dev/null || true RUN mkdir -p /output ENTRYPOINT ["sleep", "infinity"]
**Compiled Binary (Go, Rust, C):**
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates file strace && rm -rf /var/lib/apt/lists/*
COPY target/binary /usr/local/bin/target
RUN chmod +x /usr/local/bin/target
RUN mkdir -p /output
ENTRYPOINT ["sleep", "infinity"]**Web Application:**
FROM node:lts-slim WORKDIR /app COPY target/ /app/ RUN npm install --production 2>/dev/null || true RUN mkdir -p /output EXPOSE 3000 CMD ["npm", "start"]
Build command:
$RUNTIME build -t greenfield-${WORKSPACE}-target \
-f workspace/raw/runtime/Dockerfile .If the build fails, log the error to `workspace/raw/runtime/build-log.txt` and mark runtime mode as unavailable. The pipeline continues with other modes.
2. Start the Container
**CLI/Library targets:**
$RUNTIME run -d \
--name greenfield-${WORKSPACE}-target \
--memory=2g --cpus=2 --pids-limit=256 \
--network=none --read-only \
--tmpfs /tmp:rw,noexec,nosuid,size=256m \
-v "$(pwd)/workspace/raw/runtime:/output:rw" \
greenfield-${WORKSPACE}-target**Web application targets:**
$RUNTIME run -d \
--name greenfield-${WORKSPACE}-target \
--memory=2g --cpus=2 --pids-limit=256 \
--network=none \
-p 127.0.0.1:3000:3000 \
-v "$(pwd)/workspace/raw/runtime:/output:rw" \
greenfield-${WORKSPACE}-target3. Verify Running
$RUNTIME inspect --format='{{.State.Running}}' greenfield-${WORKSPACE}-target
# Expected: true4. Cleanup
$RUNTIME stop --time=10 greenfield-${WORKSPACE}-target 2>/dev/null || true
$RUNTIME rm greenfield-${WORKSPACE}-target 2>/dev/null || trueCommand Execution
All target interaction goes through `docker exec` (or `podman exec`).
Basic Command
timeout 30 $RUNTIME exec greenfield-${WORKSPACE}-target \
sh -c 'command args 2>&1' \
> workspace/raw/runtime/cli/output.txtWith Timeout Handling
timeout 30 $RUNTIME exec greenfield-${WORKSPACE}-target \
sh -c 'command args 2>&1' > output.txt 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -eq 124 ]; then
echo "TIMEOUT: Command killed after 30 seconds." >> output.txt
fiWith Environment Variables
$RUNTIME exec -e "DEBUG=true" -e "CONFIG_PATH=/app/config.json" \
greenfield-${WORKSPACE}-target sh -c 'target-command 2>&1'With Piped Input
echo "user input here" | \
timeout 30 $RUNTIME exec -i greenfield-${WORKSPACE}-target \
sh -c 'target-command' > output.txt 2>&1Pre-Execution Checklist
Before executing commands, verify:
1. Container is running: `$RUNTIME inspect --format='{{.State.Running}}' greenfield-${WORKSPACE}-target` 2. Output directory is mounted: `$RUNTIME exec greenfield-${WORKSPACE}-target test -d /output`
Exploration Patterns
CLI Exploration
# Help and version discovery timeout 30 $RUN
Showing the first part of this file.
Reverse engineer clean behavioral specs from any codebase. Greenfield reads source code, documentation, SDKs, runtime behavior, and binaries, then produces behavioral specifications, test vectors, acceptance criteria, and a full provenance trail.
Repo: prime-radiant-inc/greenfield
Other skills on greenfield.
- /analysis-pipeline
Reverse engineering - multi-source product intelligence analysis with provenance tracking. Master methodology for all analysis agents.
Open skill - /autonomous-discovery
Layer 1 intelligence source discovery - auto-detect available sources, search for public information, negotiate with user, produce inventory manifest
Open skill - /behavioral-spec-writing
Layer 3 deep documentation methodology. Per-module behavioral specifications, external and behavioral integration contracts, behavior documentation, end-to-end user journey analysis. Transforms Layer 2 synthesis into implementable behavioral specifications. Loaded by the
Open skill - /binary-analysis
Layer 1 methodology for extracting behavioral intelligence from compiled binaries, bytecode archives, managed assemblies, and bundled applications. Covers artifact identification, string extraction strategy, decompilation workflows, provenance requirements, and handoff to source
Open skill - /community-intelligence
Layer 1 skill for community intelligence gathering. Search channels, extraction methodology, consensus analysis, version-aware behavioral changes, structural contamination guard. Loaded by the analyzer agent for community intelligence gathering.
Open skill - /contract-detection
Layer 1 skill for parsing machine-readable API contracts. OpenAPI/Swagger, GraphQL, Protobuf/gRPC, and JSON Schema detection, extraction, and behavioral claim generation. Loaded by the analyzer agent during Layer 1.
Open skill

