.cursor/skills/testing-pyramid/SKILL.md
Test Distribution Analysis Command 🧪
npx skillsauth add usrrname/cursorrules testing-pyramidInstall 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.
This command guides the AI agent to analyze test distribution across unit, integration, and E2E tests, and provide recommendations for increasing test coverage and improving test distribution in line with business and technical strategy.
package.json for test framework dependencies:
jest or @jest/core in dependencies/devDependenciesvitest in dependencies/devDependencies@playwright/test in dependencies/devDependenciescypress in dependencies/devDependenciesmocha in dependencies/devDependenciespackage.json:
test:coverage, coverage, or scripts with --coverage flagsUse framework-specific commands to list all test files:
npx jest --listTests (lists all test files without running)npx vitest list (lists all test files)npx playwright test --list (lists all test specs)cypress.config.js for specPattern or run npx cypress run --dry-runCheckpoint: Verify all test files are discovered and no test directories are missed.
Classify each test file as unit, integration, or E2E based on multiple indicators:
File Path Indicators:
e2e/, tests/e2e/, __e2e__/ → E2E testsintegration/, tests/integration/, __integration__/ → Integration testsunit/, tests/unit/, __tests__/ → Unit tests (if not in e2e/integration folders)Content Keywords:
playwright, cypress, page.goto, browser, user journey, visit, click, filldatabase, api, service, repository, endpoint, http, fetch, axios, click, fillmock, stub, spy, jest.fn(), vi.fn(), isolated function testingTest Framework Indicators:
Checkpoint: Review classification accuracy by sampling test files from each category.
Calculate test distribution:
Count tests by category:
Calculate percentages:
(unit tests / total tests) × 100(integration tests / total tests) × 100(e2e tests / total tests) × 100Compare to ideal ratios:
Checkpoint: Present distribution findings and highlight significant deviations.
Evaluate test quality indicators:
Identify common violations:
Provide actionable recommendations:
Characteristics:
Best Practices:
Example Structure:
describe("User Processing", () => {
it("should process valid user data correctly", () => {
// Arrange
const mockUser = createMockUser()
// Act
const result = processUserData(mockUser)
// Assert
expect(result).toEqual(expected)
})
})
Characteristics:
Best Practices:
Example Structure:
describe("User Authentication Integration", () => {
it("should successfully authenticate valid user", async () => {
// Arrange
const user = await createTestUser()
// Act
const result = await authService.authenticate(user.credentials)
// Assert
expect(result.authenticated).toBe(true)
})
})
Characteristics:
Best Practices:
Example Structure:
describe("Critical User Journey", () => {
it("should allow user to complete checkout process", async () => {
// Arrange
await loginAsTestUser()
// Act
await navigateToProducts()
await addItemToCart()
await proceedToCheckout()
await fillShippingDetails()
await completePayment()
// Assert
await expect(page.locator("#order-confirmation")).toBeVisible()
})
})
When presenting analysis results, include:
## Test Distribution Analysis
### Framework Information
- **Primary Framework**: [Framework name]
- **Coverage Tool**: [Tool name]
- **Total Test Files**: [Number]
### Distribution Breakdown
- **Unit Tests**: [Count] ([Percentage]%) - Target: 70%
- **Integration Tests**: [Count] ([Percentage]%) - Target: 20%
- **E2E Tests**: [Count] ([Percentage]%) - Target: 10%
### Findings
- [Finding 1]
- [Finding 2]
- [Finding 3]
### Violations Detected
1. [Violation description]
2. [Violation description]
### Recommendations
1. [Actionable recommendation]
2. [Actionable recommendation]
3. [Actionable recommendation]
### Priority Actions
- **High Priority**: [Actions]
- **Medium Priority**: [Actions]
- **Low Priority**: [Actions]
# Discover tests
npx jest --listTests
# Run analysis
# Classify tests by path and content
# Calculate distribution
# Provide recommendations
# Discover unit/integration tests
npx vitest list
# Discover E2E tests
npx playwright test --list
# Combine results and analyze
development
Agent rule for refactoring existing code blocks or a feature by identifying language and applying only when refactor/improvement is requested
development
This skill guides a user to draft and clarify the intent and scope of a change or feature to be implemented. This skill can be used to create user stories, tasks, plans or other artifacts that will be used to implement code changes.
development
--- name: git-commit-push description: Enforces Git commit standards and conventions when committing and pushing code in Agent Mode. This rule is crucial for keeping track of changes made by agents, and should run whenever the user expresses they want to commit or push code changes made by the agent. This rule should be followed when: 1. the user wants to commit code, the git aliases, 'gpu' or 'gc', 'gcm' were submitted by the user. This rule will ask the user if they would prefer to auto-run th
development
This rule defines the workflow for AI agents to follow when implementing features from user stories, focusing on lean development principles and agile methodologies.