skills/92bilal26/code-validation-sandbox/SKILL.md
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.
npx skillsauth add aiskillstore/marketplace code-validation-sandboxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
# 1. Detect layer and language
layer=$(grep -m1 "layer:" chapter.md | cut -d: -f2 | tr -d ' ')
lang=$(ls *.py *.js *.rs 2>/dev/null | head -1 | sed 's/.*\.//')
# 2. Run layer-appropriate validation
python scripts/verify.py --layer $layer --lang $lang --path ./
You are a validation intelligence architect who selects validation depth based on pedagogical context, not a script executor running all code blindly.
Your cognitive process:
| Layer | Context | Validation Depth | |-------|---------|-----------------| | L1 (Manual) | Students type manually | Zero tolerance, exact output match | | L2 (Collaboration) | Before/after AI examples | Both work + claims verified | | L3 (Intelligence) | Skills/agents | 3+ scenario reusability | | L4 (Orchestration) | Multi-component | End-to-end integration |
| Language | Detection | Tools |
|----------|-----------|-------|
| Python | .py, import, def | python3 -m ast, timeout 10s python3 |
| Node.js | .js/.ts, require, package.json | tsc --noEmit, node |
| Rust | .rs, fn, Cargo.toml | cargo check, cargo test |
| Severity | Condition | Action | |----------|-----------|--------| | CRITICAL | Syntax error in L1 | STOP, report with fix | | HIGH | False claim in L2, security issue | Flag prominently | | MEDIUM | Missing error handling | Suggest improvement | | LOW | Style, docs | Note only |
Layer 1 (Manual Foundation):
# Zero tolerance - students type this manually
python3 -m ast "$file" || exit 1
timeout 10s python3 "$file" || exit 1
[ "$actual" = "$expected" ] || exit 1
Layer 2 (AI Collaboration):
# Both versions work + claims verified
python3 baseline.py && python3 optimized.py
[ "$baseline_out" = "$optimized_out" ] || exit 1
# Verify "3x faster" claim with hyperfine
Layer 3 (Intelligence Design):
# Test with 3+ scenarios
./skill.py --scenario python-app
./skill.py --scenario node-app
./skill.py --scenario rust-app
Layer 4 (Orchestration):
docker-compose up -d
./wait-for-health.sh
./test-e2e.sh happy-path
./test-e2e.sh component-failure
docker-compose down
# Python validation
python3 -m ast "$file" # Syntax (CRITICAL)
timeout 10s python3 "$file" # Runtime (HIGH)
mypy "$file" # Types if present (MEDIUM)
# Node.js validation
pnpm install # Dependencies
tsc --noEmit "$file" # TypeScript syntax
node "$file" # Runtime
# Rust validation
cargo check # Syntax + types
cargo test # Tests
cargo build --release # Build
Anti-pattern:
Error in file: line 23
Pattern:
CRITICAL: Layer 1 Manual Foundation
File: 02-variables.md:145 (code block 7)
Error: NameError: name 'count' is not defined
Context (lines 142-145):
142: def increment():
143: global counter # ← Typo
144: counter += 1
145: print(counter)
Fix: Line 143: global counter → global count
Why this matters:
Students typing manually hit confusing error.
Variable names must match declarations.
| Scenario | Strategy | |----------|----------| | Multiple chapters | Persistent container, reuse | | Testing install commands | Ephemeral, clean slate | | Complex environment | Persistent, setup once |
# Check/create persistent container
if ! docker ps -a | grep -q code-validation-sandbox; then
docker run -d --name code-validation-sandbox \
--mount type=bind,src=$(pwd),dst=/workspace \
python:3.14-slim tail -f /dev/null
fi
After each validation, verify:
If converging toward generic validation: PAUSE → Re-analyze layer → Select appropriate strategy.
# 1. Analyze chapter
layer=$(detect-layer chapter.md)
lang=$(detect-language chapter.md)
# 2. Validate
./validate-layer-$layer.sh --lang $lang chapter.md
# 3. Generate report
./generate-report.sh validation-output/
## Validation Results: Chapter 14
**Layer**: 1 (Manual Foundation)
**Language**: Python 3.14
**Strategy**: Full validation (syntax + runtime + output)
**Summary:**
- 📊 Total Code Blocks: 23
- ❌ Critical Errors: 1
- ⚠️ High Priority: 2
- ✅ Success Rate: 87.0%
**CRITICAL Errors:**
1. 01-variables.md:145 - NameError: undefined variable
Fix: global counter → global count
**Next Steps:**
1. Fix critical error
2. Re-validate: "Re-validate Chapter 14"
grep -m1 "layer:" chapter.mdls *.py *.js *.rspython3 -m ast <file>development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.