skills/testing-patterns/SKILL.md
Testing patterns and principles. Unit, integration, mocking strategies.
npx skillsauth add melikhanmutlu/web_ar testing-patternsInstall 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.
Principles for reliable test suites.
/\ E2E (Few)
/ \ Critical flows
/----\
/ \ Integration (Some)
/--------\ API, DB queries
/ \
/------------\ Unit (Many)
Functions, classes
| Step | Purpose | |------|---------| | Arrange | Set up test data | | Act | Execute code under test | | Assert | Verify outcome |
| Type | Best For | Speed | |------|----------|-------| | Unit | Pure functions, logic | Fast (<50ms) | | Integration | API, DB, services | Medium | | E2E | Critical user flows | Slow |
| Principle | Meaning | |-----------|---------| | Fast | < 100ms each | | Isolated | No external deps | | Repeatable | Same result always | | Self-checking | No manual verification | | Timely | Written with code |
| Test | Don't Test | |------|------------| | Business logic | Framework code | | Edge cases | Third-party libs | | Error handling | Simple getters |
| Area | Focus | |------|-------| | API endpoints | Request/response | | Database | Queries, transactions | | External services | Contracts |
| Phase | Action | |-------|--------| | Before All | Connect resources | | Before Each | Reset state | | After Each | Clean up | | After All | Disconnect |
| Mock | Don't Mock | |------|------------| | External APIs | The code under test | | Database (unit) | Simple dependencies | | Time/random | Pure functions | | Network | In-memory stores |
| Type | Use | |------|-----| | Stub | Return fixed values | | Spy | Track calls | | Mock | Set expectations | | Fake | Simplified implementation |
| Pattern | Example | |---------|---------| | Should behavior | "should return error when..." | | When condition | "when user not found..." | | Given-when-then | "given X, when Y, then Z" |
| Level | Use | |-------|-----| | describe | Group related tests | | it/test | Individual case | | beforeEach | Common setup |
| Approach | Use | |----------|-----| | Factories | Generate test data | | Fixtures | Predefined datasets | | Builders | Fluent object creation |
| Practice | Why | |----------|-----| | One assert per test | Clear failure reason | | Independent tests | No order dependency | | Fast tests | Run frequently | | Descriptive names | Self-documenting | | Clean up | Avoid side effects |
| ❌ Don't | ✅ Do | |----------|-------| | Test implementation | Test behavior | | Duplicate test code | Use factories | | Complex test setup | Simplify or split | | Ignore flaky tests | Fix root cause | | Skip cleanup | Reset state |
Remember: Tests are documentation. If someone can't understand what the code does from the tests, rewrite them.
tools
# AI Marketing Suite — Main Orchestrator You are a comprehensive AI marketing analysis and content generation system for Claude Code. You help entrepreneurs, agency builders, and solopreneurs analyze websites, generate marketing content, audit funnels, create client proposals, and build marketing strategies — all from the command line. ## Command Reference | Command | Description | Output | |---------|-------------|--------| | `/market audit <url>` | Full marketing audit (parallel subagents)
testing
# Social Media Content Calendar & Generation You are the social media engine for `/market social <topic/url>`. You generate a complete 30-day content calendar with platform-specific posts, hooks, hashtags, and a content repurposing strategy. Every post is ready to publish or hand to a social media manager. ## When This Skill Is Invoked The user runs `/market social <topic/url>`. If a URL is provided, fetch the site to understand the brand, audience, and content themes. If a topic is provided,
development
# SEO Content Audit ## Skill Purpose Perform a comprehensive SEO audit of a webpage or website, covering on-page SEO, content quality (E-E-A-T), keyword analysis, technical SEO, and content strategy. This skill combines automated analysis via `scripts/analyze_page.py` with expert-level manual review to produce an actionable SEO audit document. ## When to Use - User provides a URL and asks for SEO analysis, audit, or recommendations - User wants to improve organic search rankings and traffic -
tools
# Marketing Report Generator (Markdown Format) ## Skill Purpose Generate a comprehensive, professionally formatted marketing report in Markdown. This skill compiles data from all previous audit and analysis results into a single, client-ready document with scores, findings, recommendations, and a prioritized action plan with revenue impact estimates. ## When to Use - User wants a full marketing report for a client or their own business - User has completed one or more audit skills and wants a