skills/validate/SKILL.md
Use when running comprehensive project validation including tests, type checking, linting, API connectivity checks, and server startup verification
npx skillsauth add giladresisi/ai-dev-env validateInstall 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.
Run comprehensive validation of the project to ensure all tests, type checks, linting, and deployments are working correctly.
Execute the following commands in sequence and report results:
uv run pytest -v
Expected: All tests pass (currently 34 tests), execution time < 1 second
uv run mypy app/
Expected: "Success: no issues found in X source files"
uv run pyright app/
Expected: "0 errors, 0 warnings, 0 informations"
Verify external API integrations work correctly with real API calls.
Check that all required API configuration is present:
# Check environment variables
env | grep -E "(API_KEY|API_TOKEN|LANGSMITH|OPENAI)"
# Verify config file (if applicable)
cat backend/.env | grep -E "^[A-Z_]*API"
Expected:
If Failed:
Test that each API is accessible and credentials work:
# LangSmith connectivity test
python -c "
from langsmith import Client
client = Client()
projects = list(client.list_projects(limit=1))
print(f'✓ LangSmith: {len(projects)} projects')
"
# OpenAI API test
python -c "
from openai import OpenAI
client = OpenAI()
models = client.models.list(limit=1)
print(f'✓ OpenAI: API accessible')
"
Expected:
If Failed:
Verify API responses match expected format:
# Test actual API call and response structure
python -c "
# Test streaming response event types
# Test data structure
# Verify against documented schema
"
Expected:
If Failed:
Test complete integration flow end-to-end:
# Example: Create trace, verify it appears
# Example: Make API call, verify logging
# Example: Test error handling
Expected:
If Failed:
API Integration Tests:
- Configuration: ✅/❌
- Connectivity: ✅/❌
- Response Format: ✅/❌
- Integration Flow: ✅/❌
Note: Skip this section if no external APIs are used.
uv run ruff check .
Expected: "All checks passed!"
Check for async generators without finally blocks (potential resource leak):
# Find async generators
grep -rn "async def.*yield" --include="*.py" . | grep -v test_ | grep -v "#" > /tmp/async_gens.txt
# For each async generator, check if it has a finally block
if [ -s /tmp/async_gens.txt ]; then
echo "Checking async generators for finally blocks..."
while read -r line; do
file=$(echo "$line" | cut -d: -f1)
linenum=$(echo "$line" | cut -d: -f2)
# Check next 30 lines for finally block
if ! sed -n "${linenum},$((linenum+30))p" "$file" | grep -q "finally:"; then
echo "⚠️ Potential missing finally block: $line"
fi
done < /tmp/async_gens.txt
fi
Expected: No warnings about missing finally blocks (or manual verification that resource cleanup is handled elsewhere)
Why: Async generators need finally blocks to guarantee cleanup (trace closure, DB connections, file handles) even when interrupted
Start the server in background:
uv run uvicorn app.main:app --host 0.0.0.0 --port 8123 &
Wait 3 seconds for startup, then test endpoints:
curl -s http://localhost:8123/ | python3 -m json.tool
Expected: JSON response with app name, version, and docs link
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" http://localhost:8123/docs
Expected: HTTP Status: 200
curl -s -i http://localhost:8123/ | head -10
Expected: Headers include x-request-id and status 200
Stop the server:
lsof -ti:8123 | xargs kill -9 2>/dev/null || true
After all validations complete, provide a summary report with:
Validation Results:
1. Test Suite: ✅/❌ (X tests passed in Y.Zs)
2. Type Checking: ✅/❌ (mypy + pyright passed)
3. API Integration: ✅/❌/⊘ (connectivity + response validation)
4. Linting: ✅/❌ (ruff check passed)
5. Local Server: ✅/❌ (server starts, endpoints respond)
Overall Status: ✅ PASS / ❌ FAIL / ⚠ PARTIAL
Note: ⊘ = Skipped (no external APIs)
Format the report clearly with sections and status indicators (✅/❌)
testing
Creates a new git worktree in the auto-co-trader project for any purpose — optimization, regression, backtesting, brainstorming, etc. Use this skill when the user wants to CREATE or SET UP a new worktree — phrases like "prepare a new worktree", "set up a worktree", "create a new worktree for <purpose>", "prep a new worktree", "new worktree for autoresearch", "prepare optimization from [strategy]", or "create a worktree using [strategy]". Do NOT use this skill when the user is already in a worktree and wants to start/run/begin a task — that is handled by the relevant program file in the worktree session.
research
Use when performing a meta-level analysis of plan adherence after implementation to identify process improvements and suggest CLAUDE.md updates
documentation
Use when investigating a GitHub issue to identify root cause, assess impact, and create a fix strategy document
testing
Use when loading project context and architecture overview before starting implementation work, with optional focus on a specific area