rlpatrao/claude_harness_forge/test-patterns
Claude Code and agent skill by rlpatrao/claude_harness_forge
- community
Checking that the SKILL.md file is still in the repository.
Test planning, test case design, test data generation, and Playwright E2E automation. Use when creating test plans, writing test cases, generating test data, setting up Playwright, or automating end-to-end tests.
Install
npx vskill@latest install rlpatrao/claude_harness_forge/test-patternsSKILL.md
The same SKILL.md was published earlier as rlpatrao/claude_harness_forge/test-patterns.
Testing Skill
Test Strategy Layers
CLI / Terminal App E2E (PTY-based)
For non-web projects (CLI tools, terminal games, scripts), use PTY-based E2E testing instead of Playwright. Uses only Python stdlib (pty, os, subprocess, select, fcntl).
Pattern:
- Launch the app in a pseudo-terminal via
pty.openpty()+subprocess.Popen - Set terminal size via
fcntl.ioctl(fd, termios.TIOCSWINSZ, struct.pack('HHHH', rows, cols, 0, 0)) - Send keystrokes by writing to the master fd:
os.write(master, b'\n')for ENTER,os.write(master, b'\x1b[A')for arrow keys - Read screen output via
select.select([master], [], [], timeout)+os.read(master, 4096) - Assert expected text appears in output (menu items, game elements, status messages)
- Always kill the process in
try/finally— never leave zombies
Required test scenarios for CLI apps:
- App launches and shows initial screen
- User input is accepted and produces visible response
- App exits cleanly (return code 0, terminal state restored)
- At least one full user workflow (start → interact → complete → exit)
- Real production data loaded (not just test fixtures)
Skip on Windows: pytest.mark.skipif(sys.platform == 'win32', reason='PTY not available')
Test Case Design
From each acceptance criterion, generate 1-3 test cases:
For detailed test data patterns, see references/test-data.md. For Playwright patterns, see references/playwright.md. For test case templates, see examples/test-case-template.md.
Output Structure
Gotchas
- CSS class selectors in Playwright. Never use them. Use
getByRole(),getByLabel(),getByText(), orgetByTestId()(last resort). - Tests depending on other tests' state. Every test must be independent. If test B fails when test A doesn't run first, the tests are coupled.
- Random data in tests. Tests must be deterministic — same input, same output. No
random.choice()orDate.now()in test data. - Missing boundary tests. If a criterion says "up to 50MB," there must be a test at exactly 50MB AND one at 51MB.
- Playwright timeouts on CI. Default 30s is often too short. Use
toBeVisible({ timeout: 10000 })for elements that depend on network requests. - Forgetting empty state tests. Every list/table component needs a test with zero items.
- Testing implementation details. Don't assert on internal state or method calls — assert on observable behavior.
Verification
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/test-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rlpatrao/claude_harness_forge/test-patterns)