一键导入
test-plan-generator
Generate comprehensive E2E test plans from PRDs, task lists, or descriptions with environment-aware prerequisites and issue tracking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate comprehensive E2E test plans from PRDs, task lists, or descriptions with environment-aware prerequisites and issue tracking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Argue against proposed actions to test judgment quality. Not "is the code correct" but "should we be doing this at all?" Aligned with robustness, not performance.
Orchestrate Claude Code agent teams for parallel multi-agent collaboration
Learn and integrate new APIs, creating permanent skills for external service access.
Create and update CHANGELOG.md with entries that include AI model/CLI attribution, PRD context, and task references.
Audit decisions for judgment quality, compliance bias, and manipulation vulnerability. Inspired by Anthropic's Project Vend Phase 2 finding that helpfulness training creates exploitable attack surface.
Extract visual style from reference UI screenshot and codify into reusable design system.
| name | test-plan-generator |
| description | Generate comprehensive E2E test plans from PRDs, task lists, or descriptions with environment-aware prerequisites and issue tracking. |
| category | quality |
Create a detailed, executable End-to-End Test Plan that an AI agent or developer can follow to verify a feature works correctly, track issues, and iterate to completion.
/tasks/[n]-prd-*.md/tasks/tasks-*.md.md)/tasks/testplan-[source].md
testplan-0001-prd-user-auth.mdtestplan-tasks-0001-prd-user-auth.mdtestplan-[feature-slug].mdIdentify Input Source
GATE: Environment Declaration (REQUIRED) Ask the user explicitly:
Which environment is this test plan for?
a) Local/Development
b) Staging
c) Production
Please confirm your environment before I proceed.
Do NOT proceed without explicit confirmation.
If Production Environment:
PRODUCTION TEST PLAN REQUIREMENTS:
Before I generate this test plan, please confirm:
1. What is the current deployed version/commit?
2. When was the last deployment?
3. How do you deploy updates? (document the process)
I need explicit confirmation that the feature under test
is deployed before proceeding.
Codebase Analysis
package.json, bun.lockb, etc.)npm run dev, bun run dev, etc.).env.example, .env.local)Service Discovery
.env.exampleGATE: Test Account Strategy Ask the user:
How should test accounts be handled?
a) Use existing test account (provide credentials location)
b) Create new account via UI signup flow
c) Create new account via CLI/seed script
d) Create new account via direct database insert (dev only)
Where are credentials stored for this project?
(e.g., .env.local, 1Password, AWS Secrets Manager, etc.)
Document the chosen approach in the test plan.
Generate Prerequisites Section
Map Full User Journey Before writing individual test cases, map the complete user journey:
USER JOURNEY MAP (customize per feature):
1. AUTHENTICATION
└─ Login / Session restoration / Token refresh
2. INITIAL STATE
└─ User data loading
└─ Permissions/roles loaded
└─ UI renders correctly
3. NAVIGATION
└─ Navigate to feature
└─ Required data fetched
└─ Loading states handled
4. CORE FUNCTIONALITY
└─ Primary user action (e.g., send message, create item)
└─ Secondary actions
└─ State updates correctly
5. DATA VERIFICATION
└─ Changes persisted
└─ UI reflects changes
└─ Other users see changes (if applicable)
6. ERROR SCENARIOS
└─ Invalid input handling
└─ Network failure handling
└─ Permission denied handling
7. EDGE CASES
└─ Empty states
└─ Maximum limits
└─ Concurrent access
8. CLEANUP (if needed)
└─ Logout
└─ Session cleanup
└─ Test data cleanup
AI Action: Analyze the PRD, task list, or codebase to identify:
Then propose the journey map to the user:
"Based on my analysis, here's the user journey I'll test. Please confirm or correct:
- Login via [method]
- User profile loads from [API]
- Navigate to [feature path]
- [Core action]
- Verify [persistence] ..."
Wait for user confirmation before proceeding.
Generate Test Cases
Generate Troubleshooting Section
Generate Success Criteria
Generate Issue Tracking Template
/tasks/testplan-[source].md# End-to-End Test Plan: [Feature Name]
**Source:** `[PRD/Task List path or "User Description"]`
**Generated:** YYYY-MM-DD
**Environment:** Local | Staging | Production
---
## Environment Declaration
**Target Environment:** [Local/Staging/Production]
**Confirmed by:** [User confirmation timestamp or note]
### If Production
- **Deployed Version:** [commit hash or version]
- **Last Deployment:** [date/time]
- **Deployment Process:**
```bash
# How to deploy updates
[deployment commands]
# How to rollback if needed
[rollback commands]
| Service | Directory | Port | Start Command |
|---|---|---|---|
| Backend API | ./backend | 3012 | PORT=3012 bun run dev |
| Frontend | ./frontend | 3007 | PORT=3007 npm run dev |
| [Service N] | ./path | XXXX | command |
Verify all services are healthy before testing:
# Backend API
curl -f http://localhost:3012/health | jq '.status'
# Expected: "healthy"
# Frontend
curl -f http://localhost:3007 -o /dev/null -w "%{http_code}"
# Expected: 200
# [Service N]
curl -f http://localhost:XXXX/health
⚠️ SECURITY WARNING
.env, .env.local, .env.*.local are in .gitignore.env files# Copy environment template
cp .env.example .env.local
# Required variables (set these):
# - DATABASE_URL=...
# - API_KEY=...
# Verify .gitignore includes environment files
grep -q "\.env" .gitignore || echo "⚠️ WARNING: .env not in .gitignore!"
⚠️ CREDENTIAL SECURITY
.gitignore to ensure credential files are excluded| Credential Type | Location | Notes |
|---|---|---|
| Local dev accounts | .env.local (git-ignored) | MUST be in .gitignore |
| Staging accounts | Team password manager / secrets vault | Shared test accounts |
| Production accounts | Secure vault (1Password, AWS Secrets, etc.) | Requires explicit access, NEVER local |
Choose ONE approach and document it:
Option A: Use Existing Test Account
[existing-test@example.com][where to find it - e.g., "1Password > Team Vault > Staging Accounts"][admin/user/specific roles needed]Option B: Create New Test Account
Via UI signup:
http://localhost:3007/signuptest-[feature]-[date]@example.comVia CLI/seed script:
# Create test user via CLI
bun run db:seed --user test@example.com --password testpass123
# Or via API
curl -X POST http://localhost:3012/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "testpass123"}'
Via database directly (dev only):
# Insert test user (adjust for your DB)
bun run db:query "INSERT INTO users (email, password_hash) VALUES (...)"
bun run db:seedBefore executing individual tests, understand the full user flow:
┌─────────────────────────────────────────────────────────────┐
│ 1. AUTHENTICATION │
│ └─ [Login method: email/OAuth/SSO] │
│ └─ [Session handling: token/cookie] │
├─────────────────────────────────────────────────────────────┤
│ 2. INITIAL STATE │
│ └─ [User profile loads] │
│ └─ [Permissions/roles verified] │
│ └─ [Dashboard/home renders] │
├─────────────────────────────────────────────────────────────┤
│ 3. NAVIGATION │
│ └─ [Navigate to: /path/to/feature] │
│ └─ [Required data fetched: API calls] │
│ └─ [Loading states: spinners/skeletons] │
├─────────────────────────────────────────────────────────────┤
│ 4. CORE FUNCTIONALITY │
│ └─ [Primary action: e.g., send message] │
│ └─ [Secondary actions: e.g., attach file] │
│ └─ [State updates: UI reflects changes] │
├─────────────────────────────────────────────────────────────┤
│ 5. DATA VERIFICATION │
│ └─ [Changes persisted to database] │
│ └─ [UI shows updated state] │
│ └─ [Other users see changes: if real-time] │
├─────────────────────────────────────────────────────────────┤
│ 6. ERROR SCENARIOS │
│ └─ [Invalid input: validation messages] │
│ └─ [Network failure: retry/error UI] │
│ └─ [Permission denied: proper handling] │
├─────────────────────────────────────────────────────────────┤
│ 7. EDGE CASES │
│ └─ [Empty state: first-time user] │
│ └─ [Maximum limits: char limits, file size] │
│ └─ [Concurrent access: if applicable] │
├─────────────────────────────────────────────────────────────┤
│ 8. CLEANUP │
│ └─ [Logout: session cleared] │
│ └─ [Test data: cleaned or noted for manual cleanup] │
└─────────────────────────────────────────────────────────────┘
Coverage Checklist:
Purpose: [What this test verifies]
[Action]
http://localhost:3007/path[Action]
# Optional verification command
curl http://localhost:3012/api/endpoint | jq '.field'
[Continue numbered steps...]
[Same structure as Test 1...]
Symptom: [error message]
Check:
lsof -i :3012bun install.env file existsSolution:
# Kill existing process
kill $(lsof -t -i :3012)
# Restart service
bun run dev
Symptom: Cannot login, "Invalid credentials", or session expired
Check:
Solution:
# Reset password via CLI (if available)
bun run auth:reset-password --email test@example.com
# Check user exists in database
bun run db:query "SELECT * FROM users WHERE email = 'test@example.com'"
# Clear session/cookies and re-login
# [Browser: DevTools > Application > Clear Storage]
Symptom: [description] Check: [diagnostic steps] Solution: [fix]
If an issue would happen in production, it is NOT "unrelated" - fix it NOW.
When ANY issue is encountered during testing:
Signed: _____________ Date: _____________
| Step | Expected | Actual | Status | Logs/Artifacts | Fix Commit |
|---|---|---|---|---|---|
| Test 1.1 | Page loads | ||||
| Test 1.2 | Form submits |
When a test fails, create an issue note:
## Issue: [Brief description]
**Test Case:** [Test N, Step M]
**Environment:** [Local/Staging/Production]
### Repro Steps
1. [Exact commands to reproduce]
### Error Output
\`\`\`
[Paste error logs]
\`\`\`
### Root Cause Hypothesis
[What you think is wrong]
### Proposed Fix
[How to fix it]
### Done When
[What proves it's fixed]
For each failing test:
__tests__/ or *.test.ts*.test.tsxAfter all tests pass:
Test plan generated YYYY-MM-DD by test-plan-generator skill
---
## Interaction Model
1. **Input Detection** - Auto-detect source type
2. **Environment Gate** - ALWAYS ask explicitly, never assume
3. **Production Gate** - BLOCKING confirmation required
4. **Draft Review** - Present for user feedback before saving
5. **Iterative Refinement** - Update based on user corrections
## Key Principles
- **Normalize to actual repo** - Don't assume structure, discover it
- **Executable commands** - Every health check, every start command should be copy-pasteable
- **Issue tracking built-in** - Run log table is mandatory
- **Fix loop defined** - Clear process for handling failures
- **Environment-aware** - Different rigor for prod vs local
---
## CRITICAL: E2E Completion Criteria
**This section MUST be included in every generated test plan.**
### The Production Reality Rule
> **If an issue would happen in production, it is NOT "unrelated" - it MUST be fixed.**
When executing E2E tests, you will encounter issues. The natural instinct is to categorize them:
- "This is a bug in our feature" → Fix it
- "This is an architecture issue" → Defer it
- "This is unrelated to what we're testing" → Ignore it
**THIS IS WRONG.** In E2E testing, there is no such thing as an "unrelated" issue if it blocks the production flow.
### Anti-Patterns (DO NOT DO)
❌ "We've fixed the login issue, but there's an architecture problem with the session handling that's unrelated to our feature."
❌ "The feature works, but the database connection pooling is a separate infrastructure concern."
❌ "This test passes, but I noticed the API rate limiting would cause issues - that's out of scope for this task."
❌ "The happy path works. The error handling issue is a different story that should be addressed separately."
### Correct Behavior (DO THIS)
✅ "The login works, but I discovered a session handling issue that would affect production users. Fixing it now before proceeding."
✅ "While testing, I found the database connection pooling causes timeouts under load. This would happen in production, so I'm addressing it as part of this E2E validation."
✅ "The feature works but would hit API rate limits in production. Implementing proper rate limiting before marking complete."
✅ "The happy path works. Now testing error scenarios and fixing any issues found before marking the E2E test as complete."
### The Completion Standard
A test is **NOT COMPLETE** until:
| Criterion | Question to Ask |
|-----------|-----------------|
| **Happy path works** | Does the primary user flow succeed? |
| **Error paths work** | Do error scenarios fail gracefully? |
| **Edge cases handled** | Do boundary conditions behave correctly? |
| **No blocking issues** | Would a real user encounter any problems? |
| **Production-ready** | Could we deploy this right now with confidence? |
### The Fix-In-Place Protocol
When you encounter ANY issue during E2E testing:
1. **STOP** - Don't mark the current test as passing
2. **ASSESS** - Would this issue occur in production?
3. **If YES → FIX IT NOW**
- Don't defer to a "future task"
- Don't categorize as "out of scope"
- Don't label as "architecture issue" and move on
4. **RE-VALIDATE** - After fixing, re-run the E2E test
5. **REPEAT** - Continue until the full flow works without issues
### Including This in Generated Test Plans
Every test plan generated by this skill MUST include an "E2E Completion Criteria" section that:
1. Lists the specific completion criteria for this feature
2. Explicitly states the "no unrelated issues" rule
3. Includes the fix-in-place protocol
4. Requires sign-off that all encountered issues were addressed
---
## References
- See `reference.md` for template structure details