| name | test-plan |
| description | Create a structured test plan with specific test cases and expected results |
Test Plan
When to Use
Use this skill when tasked with writing a test plan, validating a feature, or when you need to systematically verify that a component works correctly.
Output Template
# Test Plan: [Feature/Component Name]
**Date:** YYYY-MM-DD
**Author:** [agent name]
**Target:** [file or component under test]
**Status:** Draft | Executing | Complete
## Scope
[What is being tested. What is explicitly NOT being tested.]
## Prerequisites
- [Dependency or setup step 1]
- [Dependency or setup step 2]
## Test Cases — Normal Operation
| ID | Description | Input | Expected Output | Status |
|----|-------------|-------|-----------------|--------|
| N1 | [typical use] | [specific input] | [specific output] | Pass/Fail/Blocked |
| N2 | ... | ... | ... | ... |
## Test Cases — Boundary Conditions
| ID | Description | Input | Expected Output | Status |
|----|-------------|-------|-----------------|--------|
| B1 | [edge case] | [specific input] | [specific output] | Pass/Fail/Blocked |
| B2 | ... | ... | ... | ... |
## Test Cases — Error Conditions
| ID | Description | Input | Expected Output | Status |
|----|-------------|-------|-----------------|--------|
| E1 | [invalid input] | [specific input] | [specific error] | Pass/Fail/Blocked |
| E2 | ... | ... | ... | ... |
## Results Summary
| Category | Total | Passed | Failed | Blocked |
|----------|-------|--------|--------|---------|
| Normal | N | N | N | N |
| Boundary | N | N | N | N |
| Error | N | N | N | N |
| **Total** | **N** | **N** | **N** | **N** |
Procedure
1. Read the Specification
bash /home/shared/scripts/task.sh get "$TASK_ID" | jq -r '.description'
cat ~/workspace/src/target-module.js
find ~/workspace/tests/ -name '*target*' -exec cat {} \;
2. Identify Normal Cases
These are the "happy path" scenarios — typical, expected usage:
SCRIPT="~/workspace/scripts/tool.sh"
bash "$SCRIPT" add --name "test-item" --type "task"
echo "Exit: $?"
bash "$SCRIPT" add --name "item-1" --type "task"
bash "$SCRIPT" add --name "item-2" --type "task"
bash "$SCRIPT" list
echo "Exit: $?"
3. Identify Boundary Conditions
Test the edges of valid input:
bash "$SCRIPT" add --name "" --type "task"
echo "Exit: $?"
bash "$SCRIPT" add --name "$(python3 -c 'print("a"*10000)')" --type "task"
echo "Exit: $?"
bash "$SCRIPT" add --name 'test "with" <special> & chars' --type "task"
echo "Exit: $?"
bash "$SCRIPT" add --name "test-unicode-cafe" --type "task"
echo "Exit: $?"
4. Identify Error Conditions
Test invalid input and failure scenarios:
bash "$SCRIPT" add 2>&1
echo "Exit: $?"
bash "$SCRIPT" add --nonexistent "value" 2>&1
echo "Exit: $?"
bash "$SCRIPT" get --id "nonexistent-id" 2>&1
echo "Exit: $?"
chmod 000 /tmp/test-file
bash "$SCRIPT" read --file /tmp/test-file 2>&1
echo "Exit: $?"
chmod 644 /tmp/test-file
5. Execute All Test Cases
Run each test case and record the actual result:
PASS=0
FAIL=0
BLOCKED=0
run_test() {
local id="$1"
local desc="$2"
local cmd="$3"
local expected_exit="$4"
echo -n "Test $id: $desc ... "
eval "$cmd" > /tmp/test-output-$id.txt 2>&1
actual_exit=$?
if [ "$actual_exit" -eq "$expected_exit" ]; then
echo "PASS"
PASS=$((PASS + 1))
else
echo "FAIL (expected exit $expected_exit, got $actual_exit)"
FAIL=$((FAIL + 1))
echo " Output: $(cat /tmp/test-output-$id.txt | head -5)"
fi
}
run_test "N1" "Basic valid input" "bash $SCRIPT add --name test --type task" 0
run_test "E1" "Missing required arg" "bash $SCRIPT add" 1
echo ""
echo "Results: $PASS passed, $FAIL failed, $BLOCKED blocked"
6. Record Test Plan and Results
TESTPLAN_FILE="/home/shared/testplan-$(date +%Y%m%d)-${COMPONENT}.md"
bash /home/shared/scripts/artifact.sh register \
--name "testplan-${COMPONENT}" \
--type "test-plan" \
--path "$TESTPLAN_FILE" \
--description "Test plan and results for $COMPONENT"
Quality Checklist