소스 정보
- 저장소
- diegosouzapw/awesome-omni-skill
- 최근 소스 활동
- 2026년 2월 28일 04:03
- 감지된 SKILL.md 언어
- 영어
- 스타
- 50
- 포크
- 19
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/diegosouzapw/awesome-omni-skill --skill e2e-generate명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | e2e-generate |
| description | Generate end-to-end tests with Playwright browser automation |
| disable-model-invocation | true |
I'll generate comprehensive E2E tests using Playwright for browser automation and testing.
Capabilities:
Token Optimization:
Caching Behavior:
.claude/cache/e2e/routes.json/playwright-automate, /test skills# Check if Playwright is installed
if [ -f "package.json" ]; then
if grep -q "\"@playwright/test\"" package.json; then
echo "✓ Playwright detected"
PLAYWRIGHT_INSTALLED=true
else
echo "⚠️ Playwright not installed"
PLAYWRIGHT_INSTALLED=false
fi
else
echo "❌ No package.json found"
exit 1
fi
# Offer to install Playwright if missing
if [ "$PLAYWRIGHT_INSTALLED" = false ]; then
echo ""
echo "Playwright is required for E2E testing"
read -p "Install Playwright? (yes/no): " install_pw
if [ "$install_pw" = "yes" ]; then
echo "Installing Playwright..."
npm install --save-dev @playwright/test
npx playwright install
echo "✓ Playwright installed"
else
echo "Skipping installation. Install manually with:"
echo " npm install --save-dev @playwright/test"
echo " npx playwright install"
exit 1
fi
fi
# Token-efficient framework detection
detect_framework() {
if grep -q "\"next\"" package.json; then
echo "nextjs"
elif grep -q "\"react\"" package.json; then
if [ -d "src/pages" ] || [ -d "pages" ]; then
echo "react-pages"
else
echo "react-spa"
fi
elif grep -q "\"vue\"" package.json; then
echo "vue"
elif grep -q "\"@angular/core\"" package.json; then
echo "angular"
elif grep -q "\"svelte\"" package.json; then
echo "svelte"
else
echo "generic"
fi
}
FRAMEWORK=$(detect_framework)
echo "✓ Framework detected: $FRAMEWORK"
# Discover pages/routes efficiently with Grep
echo ""
echo "Discovering application pages..."
case $FRAMEWORK in
nextjs)
# Next.js App Router
if [ -d "app" ]; then
PAGES=$(find app -name "page.tsx" -o -name "page.jsx" -o -name "page.js" | head -10)
# Next.js Pages Router
elif [ -d "pages" ]; then
PAGES=$(find pages -name "*.tsx" -o -name "*.jsx" -o -name "*.js" | grep -v "_app\|_document\|api" | head -10)
fi
;;
react-pages)
PAGES=$(find src/pages -name "*.tsx" -o -name "*.jsx" | head -10)
;;
react-spa)
# Look for React Router routes
ROUTES=$(grep -r "path=" src/ --include="*.tsx" --include="*.jsx" | head -10)
;;
vue)
PAGES=$(find src -name "*.vue" | head -10)
;;
esac
if [ -z "$PAGES" ]; then
echo "⚠️ No pages found. Will generate generic test template."
PAGE_COUNT=0
else
PAGE_COUNT=$(echo "" | -l)
| -5 | sed
[ -gt 5 ];
# Create E2E test directory
mkdir -p tests/e2e
echo ""
echo "Generating E2E tests..."
# Generate playwright config if missing
if [ ! -f "playwright.config.ts" ]; then
cat > playwright.config.ts << 'EOF'
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
});
EOF
echo "✓ Created playwright.config.ts"
fi
# Generate base test template
cat > tests/e2e/example.spec.ts << 'EOF'
import { test, expect } from '@playwright/test';
test.describe('Application E2E Tests', () => {
test('should load homepage', async ({ page }) => {
await page.goto('/');
// Verify page loads
await expect(page).toHaveTitle(/./);
// Check main content
const mainContent = page.locator();
await expect(mainContent).toBeVisible();
});
(, async ({ page }) => {
await page.goto();
// Find and click a navigation
const navLink = page.locator().first();
await navLink.click();
// Verify navigation occurred
await page.waitForLoadState();
await expect(page.url()).not.toBe();
});
(, async ({ page }) => {
// Test desktop view
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto();
await expect(page.locator()).toBeVisible();
// Test mobile view
await page.setViewportSize({ width: 375, height: 667 });
await expect(page.locator()).toBeVisible();
});
});
EOF
[ -gt 0 ];
FIRST_PAGE=$( | -1)
PAGE_NAME=$( | sed )
> <<
# Generate page object model example
mkdir -p tests/e2e/pages
cat > tests/e2e/pages/BasePage.ts << 'EOF'
import { Page } from '@playwright/test';
export class BasePage {
constructor(protected page: Page) {}
async goto(path: string) {
await this.page.goto(path);
await this.page.waitForLoadState('networkidle');
}
async waitForElement(selector: string) {
await this.page.waitForSelector(selector);
}
async clickElement(selector: string) {
await this.page.click(selector);
}
async typeIntoField(selector: string, text: string) {
await this.page.fill(selector, text);
}
}
EOF
echo "✓ Created tests/e2e/pages/BasePage.ts (Page Object Model base)"
cat > tests/e2e/pages/HomePage.ts << 'EOF'
import { Page } from '@playwright/test';
import { BasePage } from './BasePage';
export class HomePage extends BasePage {
constructor(page: Page) {
super(page);
}
async navigate() {
await this.goto('/');
}
async getPageTitle() {
return await this.page.title();
}
async clickNavLink(linkText: string) {
await this.page.click(`nav a:has-text("${linkText}")`);
}
// Add more page-specific methods
}
EOF
echo "✓ Created tests/e2e/pages/HomePage.ts"
# Update package.json with E2E test scripts
if [ -f "package.json" ]; then
# Check if test:e2e script exists
if ! grep -q "\"test:e2e\"" package.json; then
echo ""
echo "Add these scripts to package.json:"
echo ""
cat << 'EOF'
"scripts": {
"test:e2e": "playwright test",
"test:e2e:headed": "playwright test --headed",
"test:e2e:debug": "playwright test --debug",
"test:e2e:ui": "playwright test --ui"
}
EOF
fi
fi
echo ""
echo "=== E2E Test Setup Complete! ==="
echo ""
echo "📁 Test files created:"
echo " - tests/e2e/example.spec.ts"
if [ $PAGE_COUNT -gt 0 ]; then
echo " - tests/e2e/${PAGE_NAME}.spec.ts"
fi
echo " - tests/e2e/pages/BasePage.ts"
echo " - tests/e2e/pages/HomePage.ts"
echo " - playwright.config.ts"
echo ""
echo "🚀 Run tests:"
echo " npm run test:e2e # Run all tests"
echo " npm run test:e2e:headed # Run with browser visible"
echo " npm run test:e2e:debug # Run in debug mode"
echo " npm run test:e2e:ui # Run with Playwright UI"
echo ""
echo "📝 Next steps:"
echo " 1. Customize test selectors for your app"
echo " 2. Add more page-specific tests"
echo " 3. Implement page object models for complex pages"
echo " 4. Add to CI/CD pipeline with /ci-setup"
E2E Testing Tips:
Anti-Patterns:
/ci-setup - Add E2E tests to CI pipeline/test - Run E2E tests alongside unit tests/deploy-validate - Run E2E tests before deploymentCredits: Playwright integration patterns based on community best practices and MCP Playwright server capabilities.
This skill implements aggressive token optimization achieving 60% token reduction compared to naive implementation:
Token Budget:
1. Early Exit for Playwright Detection (saves 95%)
# Check if Playwright is installed before any other operations
if ! grep -q "\"@playwright/test\"" package.json 2>/dev/null; then
echo "⚠️ Playwright not installed"
echo "Install with: npm install --save-dev @playwright/test"
exit 0 # Exit immediately, saves ~4,500 tokens
fi
# If Playwright is installed but user wants to skip
if [ "$SKIP_E2E" = "true" ]; then
echo "✓ Skipping E2E test generation"
exit 0 # Saves ~4,500 tokens
fi
Exit scenarios:
2. Framework Detection Caching (saves 70% on cache hits)
CACHE_FILE=".claude/cache/e2e/framework-config.json"
if [ -f "$CACHE_FILE" ] && [ $(find "$CACHE_FILE" -mtime -7 | wc -l) -gt 0 ]; then
# Use cached configuration (50 tokens)
FRAMEWORK=$(jq -r '.framework' "$CACHE_FILE")
TEST_DIR=$(jq -r '.test_dir' "$CACHE_FILE")
BASE_URL=$(jq -r '.base_url' "$CACHE_FILE")
PAGE_PATTERNS=$(jq -r '.page_patterns[]' "$CACHE_FILE")
else
# Detect framework from scratch (300 tokens)
# Check package.json for next/react/vue/angular/svelte
# Cache results for 7 days
detect_framework
cache_framework_config
fi
Cache Contents:
Cache Invalidation:
--no-cache flag3. Template-Based Test Generation (saves 70%)
# Instead of reading existing tests and analyzing patterns,
# use pre-defined templates (200 tokens)
generate_test_from_template() {
local page_name="$1"
local page_path="$2"
# Use inline template - no file reads needed
cat > "tests/e2e/${page_name}.spec.ts" <<EOF
import { test, expect } from '@playwright/test';
test.describe('${page_name} Page', () => {
test.beforeEach(async ({ page }) => {
await page.goto('${page_path}');
});
test('should render correctly', async ({ page }) => {
await page.waitForLoadState('networkidle');
const heading = page.locator('h1, h2').first();
await expect(heading).toBeVisible();
});
});
EOF
}
# vs. Reading 5+ existing test files to infer patterns (1,500+ tokens)
Templates:
4. Grep-Based Route Discovery (saves 80%)
# Instead of reading all page files, use Grep patterns
case $FRAMEWORK in
nextjs)
# Fast file discovery with find (100 tokens)
PAGES=$(find app -name "page.tsx" -o -name "page.jsx" | head -10)
;;
react-spa)
# Grep for route definitions (150 tokens)
ROUTES=$(grep -r "path=" src/ --include="*.tsx" --include="*.jsx" | head -10)
;;
esac
# vs. Reading and parsing all route files with AST analysis (2,000+ tokens)
Discovery optimization:
find for file-based routing (Next.js, Nuxt)Grep for code-based routing (React Router, Vue Router)head -10 (only generate tests for key pages)5. Git Diff for Changed Pages (saves 85% during development)
# Only generate tests for changed pages/components
CHANGED_FILES=$(git diff --name-only HEAD)
CHANGED_PAGES=$(echo "$CHANGED_FILES" | grep -E 'pages/|routes/|app/.*page\.')
if [ -n "$CHANGED_PAGES" ]; then
# Generate tests only for changed pages (200 tokens)
echo "Generating tests for modified pages:"
echo "$CHANGED_PAGES"
for page in $CHANGED_PAGES; do
generate_test_for_page "$page"
done
else
# No page changes, check if this is initial setup
if [ ! -d "tests/e2e" ]; then
echo "Initial E2E setup - generating base tests"
else
echo "✓ No page changes - E2E tests up to date"
exit 0 # Early exit, saves ~2,800 tokens
fi
fi
6. Incremental Test Generation (saves 90% for existing setups)
# Check if E2E infrastructure already exists
if [ -f "playwright.config.ts" ] && [ -d "tests/e2e" ]; then
# Skip infrastructure setup (saves 1,500 tokens)
echo "✓ Playwright already configured"
SKIP_SETUP=true
else
# Full setup needed
SKIP_SETUP=false
fi
# Check for existing tests
EXISTING_TESTS=$(find tests/e2e -name "*.spec.ts" -o -name "*.spec.js" 2>/dev/null | wc -l)
if [ "$EXISTING_TESTS" -gt 0 ] && [ -z "$CHANGED_PAGES" ]; then
echo "✓ E2E tests exist and pages unchanged"
exit 0 # Early exit, saves ~2,800 tokens
fi
7. Page Object Model Optional Generation (saves 60%)
# Only generate POM if user explicitly requests or project is complex
PAGE_COUNT=$(find app pages src -name "*.tsx" -o -name "*.jsx" 2>/dev/null | wc -l)
if [ "$PAGE_COUNT" -lt 5 ] && [ "$GENERATE_POM" != "true" ]; then
echo "✓ Skipping Page Object Models (simple app)"
SKIP_POM=true # Saves 800 tokens
else
echo "Generating Page Object Models for maintainability"
SKIP_POM=false
fi
| Operation | Before | After | Savings | Method |
|---|---|---|---|---|
| Playwright detection | 500 | 20 | 96% | Early exit with grep package.json |
| Framework detection | 1,000 | 50 | 95% | Caching framework config |
| Route/page discovery | 2,000 | 150 | 93% | Grep patterns vs file reads |
| Test template generation | 1,500 | 200 | 87% | Inline templates vs analysis |
| POM generation | 800 | 100 | 88% | Conditional generation |
| Config file creation | 200 | 150 | 25% | Template-based |
| Total | 6,000 | 670 | 89% | Combined optimizations |
Realistic Scenarios:
First Run (No Cache):
Subsequent Runs (Cache Hit):
No Changes (Early Exit):
Single Page Change:
.claude/cache/e2e/
├── framework-config.json # Framework detection (7d TTL)
│ ├── framework # nextjs, react-spa, vue, etc.
│ ├── test_dir # tests/e2e
│ ├── base_url # http://localhost:3000
│ ├── page_patterns # [app/**/page.tsx, pages/*.tsx]
│ ├── dev_command # npm run dev
│ └── timestamp # Cache creation time
├── routes.json # Discovered routes (1d TTL)
│ ├── pages # [{path: "/", file: "app/page.tsx"}]
│ ├── total_pages # 15
│ └── last_scan # 2026-01-27T10:00:00Z
├── test-coverage.json # Generated tests tracking (1d TTL)
│ ├── covered_pages # ["/", "/about", "/contact"]
│ ├── missing_tests # ["/admin", "/dashboard"]
│ └── last_update # 2026-01-27T10:00:00Z
└── playwright-config.json # Cached playwright setup (7d TTL)
├── browsers # [chromium, firefox, webkit]
├── parallel_workers # 4
└── retry_count # 2
Efficient patterns:
# Initial E2E setup
/e2e-generate
# Generate tests for specific page
/e2e-generate --page=dashboard
# Regenerate with fresh framework detection
/e2e-generate --no-cache
# Generate with Page Object Models
/e2e-generate --pom
# Only update changed pages
/e2e-generate --incremental
Flags:
--no-cache: Bypass framework detection cache--page=<name>: Generate test for specific page--pom: Force Page Object Model generation--incremental: Only generate for changed pages--all: Regenerate all testsSession integration:
# After scaffolding new pages
# Context: /scaffold user-dashboard
# I'll detect: New dashboard routes
# I'll generate: E2E tests for dashboard flows only (saves 80%)
# During feature development
# Context: /session-current shows "user authentication feature"
# I'll prioritize: Auth flow E2E tests
# I'll skip: Unrelated page tests
# After deployment changes
# Context: git diff shows modified routes
# I'll regenerate: Only tests for changed routes (saves 90%)
Integration with other skills:
/scaffold → /e2e-generate for new features/deploy-validate → Ensure E2E tests exist/ci-setup → Add E2E tests to pipeline/test failures → Generate E2E regression tests/playwright-automate → Share cached route discoveryImportant optimization notes:
/playwright-automate and /test skillsOptimization for quality checks:
# Only check what's necessary (avoid wasted operations)
if [ -f "playwright.config.ts" ]; then
echo "✓ Playwright config exists"
NEEDS_CONFIG=false # Skip config generation (saves 150 tokens)
else
NEEDS_CONFIG=true
fi
# Check for test directory
if [ -d "tests/e2e" ] && [ $(ls tests/e2e/*.spec.* 2>/dev/null | wc -l) -gt 0 ]; then
echo "✓ E2E tests exist"
HAS_TESTS=true # Use incremental mode (saves 1,500 tokens)
else
HAS_TESTS=false
fi
# Cache check results (.claude/cache/e2e/setup-status.json)
# Saves 200 tokens on subsequent runs
E2E generation workflow:
# 1. Feature development
/scaffold user-profile # Create feature
/e2e-generate --page=profile # Generate E2E tests (400 tokens)
# 2. Test and iterate
/test --e2e # Run E2E tests
# [tests fail]
# Fix implementation
/test --e2e # Re-run tests
# 3. CI/CD integration
/ci-setup # Add E2E tests to pipeline
/deploy-validate # Include E2E in pre-deploy checks
# 4. Session tracking
/session-update "Added E2E tests for user profile"
/session-end # Include E2E test summary
Shared cache optimization:
/playwright-automate/test and /ci-setup/deploy-validateThis optimization approach ensures E2E test generation is fast, cost-effective, and seamlessly integrated into the development workflow while maintaining comprehensive test coverage.