Skip to content

aiskillstore/marketplace / skills/92bilal26/code-validation-sandbox

code-validation-sandbox

Flagged

Validate code examples across the 4-Layer Teaching Method with intelligent strategy selection. Use when validating Python/Node/Rust code in book chapters. NOT for production deployment testing.

FileKindSize
README.mdmarkdown11.5 KB
SKILL.mdskill md6.2 KB
metadata.yamlconfig641 B
scripts/detect-context.shexecutablescript6.8 KB
scripts/setup-sandbox.shexecutablescript2.5 KB
scripts/validate-python.shexecutablescript6.5 KB
scripts/validate.shexecutablescript7.4 KB
scripts/verify.pyscript1.5 KB
skill-report.jsonconfig109.2 KB

scripts/setup-sandbox.sh

View on GitHub
#!/bin/bash
# setup-sandbox.sh - Create persistent validation container
# Part of code-validation-sandbox v3.0 (Reasoning-Activated)

set -euo pipefail

CONTAINER_NAME="code-validation-sandbox"
BASE_IMAGE="${1:-python:3.14-slim}"

echo "=== Code Validation Sandbox Setup ===" >&2
echo >&2

# Check if container already exists
if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
  echo "Container '$CONTAINER_NAME' already exists" >&2

  # Check if running
  if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
    echo "✅ Container is running" >&2
    container_id=$(docker ps --filter "name=$CONTAINER_NAME" --format '{{.ID}}')
    echo "Container ID: $container_id" >&2
    exit 0
  else
    echo "Container exists but is stopped. Starting..." >&2
    docker start "$CONTAINER_NAME" >&2
    echo "✅ Container started" >&2
    exit 0
  fi
fi

echo "Creating new container with base image: $BASE_IMAGE" >&2
echo >&2

# Create persistent container
container_id=$(docker run -d \
  --name "$CONTAINER_NAME" \
  --mount type=bind,src="$(pwd)",dst=/workspace \
  "$BASE_IMAGE" \
  tail -f /dev/null)

echo "Container created: $container_id" >&2
echo >&2

# Install base tools
echo "Installing base tools..." >&2

docker exec "$CONTAINER_NAME" bash -c "
  set -e
  apt-get update -qq
  apt-get install -y -qq curl git build-essential > /dev/null 2>&1
  echo '✓ Base tools installed'
"

# Install Python tools (if Python base image)
if [[ $BASE_IMAGE == python:* ]]; then
  echo "Installing Python tools..." >&2

  docker exec "$CONTAINER_NAME" bash -c "
    set -e
    # Install UV package manager
    curl -LsSf https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
    export PATH=\"\$HOME/.cargo/bin:\$PATH\"

    # Install common Python tools
    pip install --quiet pytest mypy ruff 2>/dev/null
    echo '✓ Python tools installed (UV, pytest, mypy, ruff)'
  "
fi

# Install Node.js (for multi-language support)
echo "Installing Node.js..." >&2

docker exec "$CONTAINER_NAME" bash -c "
  set -e
  curl -fsSL https://deb.nodesource.com/setup_20.x | bash - > /dev/null 2>&1
  apt-get install -y -qq nodejs > /dev/null 2>&1
  npm install -g pnpm > /dev/null 2>&1
  echo '✓ Node.js 20 + pnpm installed'
"

echo >&2
echo "=== Setup Complete ===" >&2
echo "Container: $CONTAINER_NAME" >&2
echo "ID: $container_id" >&2
echo >&2
echo "Installed:" >&2
echo "  - Python 3.14 + UV + pytest + mypy + ruff" >&2
echo "  - Node.js 20 + pnpm" >&2
echo "  - Base tools (curl, git, build-essential)" >&2
echo >&2
echo "✅ Sandbox ready for validation" >&2
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall