xiaohongshu
xiaohongshu
lima-sandbox-testing
Run Claude Code integration tests in isolated Lima VM sandboxes. Use for E2E testing, hook validation, session survival tests, and any scenario requiring isolated Claude execution.
Full skill instructions
Run Claude Code in isolated VMs for reliable integration testing.
Run this in any project to set up Lima VM sandbox testing:
# Install Lima (macOS)
brew install lima
# Clone the integration test framework
mkdir -p .claude && cd .claude
git clone --depth 1 --filter=blob:none --sparse \
https://github.com/hgeldenhuys/claude-code-sdk.git claude-code-sdk
cd claude-code-sdk
git sparse-checkout set integration-tests
cd ../..
# Or copy just the integration-tests folder
curl -fsSL https://raw.githubusercontent.com/hgeldenhuys/claude-code-sdk/main/integration-tests/setup-lima.sh -o .claude/setup-lima.sh
curl -fsSL https://raw.githubusercontent.com/hgeldenhuys/claude-code-sdk/main/integration-tests/run-tests.sh -o .claude/run-tests.sh
curl -fsSL https://raw.githubusercontent.com/hgeldenhuys/claude-code-sdk/main/integration-tests/lib/test-utils.sh -o .claude/lib/test-utils.sh
chmod +x .claude/*.sh
curl -fsSL https://raw.githubusercontent.com/hgeldenhuys/claude-code-sdk/main/scripts/install-lima-tests.sh | bash
cd integration-tests # or .claude if installed there
# Create VM (~5 min, downloads Ubuntu)
./setup-lima.sh create
# Install Claude Code and dependencies in VM
./setup-lima.sh install
# Authenticate Claude (interactive)
limactl shell claude-sdk-test
claude login
exit
# Snapshot authenticated state (for fast restore)
./setup-lima.sh snapshot
# Run all tests
./run-tests.sh
# Run specific test
./run-tests.sh session-survival
# Restore to clean state first
./run-tests.sh --restore session-survival
Create test files in tests/ directory:
#!/bin/bash
# tests/my-feature.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/test-utils.sh"
test_my_feature() {
test_start "Feature works correctly"
# Run Claude headless in VM
claude_headless "Your prompt here" "/tmp/workspace"
# Assert results
assert_exit_code 0 "Should succeed"
assert_contains "$CLAUDE_OUTPUT" "expected" "Should contain expected"
test_pass
}
main() {
test_my_feature
print_summary
}
main "$@"
# Run Claude with prompt
claude_headless "prompt" "/workspace"
# Results in: $CLAUDE_OUTPUT, $CLAUDE_EXIT_CODE
# Resume session by name
claude_resume "session-name" "prompt" "/workspace"
# Run slash command
claude_slash "/compact" "/workspace"
# Get session ID from name
sesh_get_id "brave-elephant"
# Get name from session ID
sesh_get_name "abc-123-def"
# Check if session exists
sesh_exists "session-name"
# List sessions as JSON
sesh_list "--json"
assert_eq "$actual" "$expected" "Values should match"
assert_ne "$actual" "$unexpected" "Values should differ"
assert_not_empty "$value" "Should have value"
assert_contains "$string" "substring" "Should contain"
assert_exit_code 0 "Should succeed"
# Run command in VM
vm_exec "ls -la /home"
# Run and capture output
vm_exec_capture "cat /etc/os-release"
# Results in: $VM_STDOUT, $VM_STDERR, $VM_EXIT_CODE
./setup-lima.sh status # Check VM state
./setup-lima.sh shell # Open interactive shell
./setup-lima.sh restore # Reset to authenticated snapshot
./setup-lima.sh destroy # Delete VM completely
/compactlimactl list
limactl stop claude-sdk-test
limactl start claude-sdk-test
limactl shell claude-sdk-test -- claude login
./setup-lima.sh snapshot # Update snapshot
./setup-lima.sh restore # Reset to clean state
integration-tests/
├── setup-lima.sh # VM lifecycle management
├── run-tests.sh # Test orchestrator
├── lib/
│ └── test-utils.sh # Shared utilities
├── tests/
│ └── *.sh # Test scripts
├── fixtures/ # Test data
└── results/ # JSON test results
The VM provides complete isolation - each test run can restore to a known-good authenticated state, ensuring reproducible results.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience