원클릭으로
test-and-validate
Run tests, validate output, and verify correctness before marking work complete
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Run tests, validate output, and verify correctness before marking work complete
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | test-and-validate |
| description | Run tests, validate output, and verify correctness before marking work complete |
Use this skill before marking any coding task as complete. Every deliverable must be validated.
cd ~/workspace
PROJECT_DIR=$(pwd)
# Node.js — check package.json for test script
if [ -f package.json ]; then
echo "=== package.json test script ==="
jq -r '.scripts.test // "none"' package.json
echo "=== test framework ==="
jq -r '.devDependencies // .dependencies | keys[]' package.json 2>/dev/null \
| grep -E 'jest|mocha|vitest|tap|ava' || echo "Using node:test (built-in)"
fi
# Python — check for pytest/unittest
if [ -f pyproject.toml ] || [ -f setup.py ] || [ -f requirements.txt ]; then
echo "=== Python test framework ==="
pip list 2>/dev/null | grep -iE 'pytest|unittest2|nose' || echo "Using unittest (built-in)"
fi
# Look for test directories
find . -type d -name 'test*' -maxdepth 3 2>/dev/null
find . -type f -name '*test*' -o -name '*spec*' | head -20
Node.js:
npm test 2>&1 | tee /tmp/test-output.txt
TEST_EXIT=$?
echo "Exit code: $TEST_EXIT"
Python:
python3 -m pytest tests/ -v 2>&1 | tee /tmp/test-output.txt
TEST_EXIT=$?
echo "Exit code: $TEST_EXIT"
Shell scripts:
# Verify script has valid syntax
bash -n script.sh
echo "Syntax check exit code: $?"
# Verify --help works
bash script.sh --help
echo "Help exit code: $?"
# Run with sample input
echo '{"test": true}' | bash script.sh
echo "Sample run exit code: $?"
If tests fail:
# Node.js — run single test
npx jest --testPathPattern="failing-test" 2>&1
# or
node --test tests/failing-test.js 2>&1
# Python — run single test
python3 -m pytest tests/test_module.py::test_function -v 2>&1
SCRIPT="path/to/script.sh"
# Check help/usage
bash "$SCRIPT" --help
echo "--- Exit code: $? (expect 0) ---"
# Test with valid input
bash "$SCRIPT" valid-arg
echo "--- Exit code: $? (expect 0) ---"
# Test with invalid input
bash "$SCRIPT" --nonexistent 2>&1
echo "--- Exit code: $? (expect non-zero) ---"
# Test with empty input
echo "" | bash "$SCRIPT"
echo "--- Exit code: $? (expect non-zero or graceful handling) ---"
# Find recently changed files
CHANGED_FILES=$(find . -name '*.js' -o -name '*.py' -o -name '*.sh' -o -name '*.ts' \
| xargs ls -t 2>/dev/null | head -20)
for f in $CHANGED_FILES; do
case "$f" in
*.js) node --check "$f" && echo "OK: $f" || echo "FAIL: $f" ;;
*.py) python3 -m py_compile "$f" && echo "OK: $f" || echo "FAIL: $f" ;;
*.sh) bash -n "$f" && echo "OK: $f" || echo "FAIL: $f" ;;
*.ts) npx tsc --noEmit "$f" 2>&1 && echo "OK: $f" || echo "FAIL: $f" ;;
esac
done
When updating your task status, include test results:
bash /home/shared/scripts/task.sh update "$TASK_ID" \
--status completed \
--result "All tests passing. 12/12 tests passed. Manual validation of CLI flags confirmed."
Discover team members, delegate tasks, and track progress to completion
Prepare structured meeting agendas and pre-reads from task board, artifacts, and team context
Classify, prioritize, and route incoming incidents based on severity, category, and affected components
Classify incoming requests and route to the appropriate specialist agent
How to communicate with other agents on the system. Use when you need to ask questions, share information, or coordinate.
Compare options against weighted criteria with scored matrix, sensitivity analysis, and quantified recommendation