/harness-claude:test-e2e-strategyfrom harness-claude
Guides test strategy decisions across unit, integration, and E2E layers, with patterns to prevent flaky tests in CI.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:test-e2e-strategy still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Choose the right test layer (unit/integration/E2E) and prevent flaky tests in CI
/ E2E \ — Few: critical user journeys
/ Integration \ — Many: service + database tests
/ Unit Tests \ — Some: pure logic, algorithms
/ Static Analysis \ — Always: TypeScript, ESLint
Choose the right layer:
Write E2E tests for critical paths only:
// Good E2E candidates:
// - User registration and login
// - Checkout and payment flow
// - Core feature happy path
// Bad E2E candidates:
// - Input validation (unit test)
// - API error handling (integration test)
// - Conditional rendering (component test)
// Bad: depends on timing
await page.click('#submit');
await new Promise((r) => setTimeout(r, 2000));
expect(page.getByText('Success')).toBeVisible();
// Good: waits for specific condition
await page.click('#submit');
await expect(page.getByText('Success')).toBeVisible({ timeout: 10000 });
test('user can update their profile', async ({ page }) => {
// Create unique test user — no shared state with other tests
const user = await createTestUser();
await loginAs(page, user);
// ... test continues
});
# .github/workflows/test.yml
jobs:
static:
steps: [typecheck, lint] # 30 seconds
unit:
steps: [vitest --run] # 1-2 minutes
integration:
steps: [vitest --config vitest.integration.ts] # 2-5 minutes
e2e:
steps: [playwright test] # 5-15 minutes
Handle flaky tests:
retries: 2 in CI configtest.fixme() or a tracking issueCoverage targets by layer:
A test strategy defines which behaviors are tested at which layer. The goal is maximum confidence with minimum execution time.
Test trophy vs test pyramid: The traditional test pyramid (many unit, few integration, fewer E2E) optimizes for speed but misses integration bugs. The test trophy (coined by Kent C. Dodds) prioritizes integration tests because they catch the most bugs per test.
Cost of flaky tests:
Common flakiness causes:
Flakiness detection:
--repeat=10 to find intermittent failures--bail=1 to stop at the first failure and investigateTrade-offs:
https://testing-library.com/docs/guiding-principles
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job