選項
首頁首頁 Skill 瀏覽器自動化 production-ready

利用 Pest 和 Playwright 測試工具來分析、測試並將應用程式準備就緒以投入生產環境

...展開全部
45
更新時間 2026-06-29

關於production-ready

「production-ready 」這項技能旨在協助開發人員運用 Pest 和 Playwright 等測試框架,對應用程式進行分析、測試,並為其投入生產環境做好準備。 此技能旨在透過系統化地處理未完成的功能、修復問題以及驗證程式碼庫,確保應用程式完全符合「production-ready 」標準。它提供了一種結構化的方法來管理軟體部署的複雜性,並提供全面的解決方案,以確保應用程式在生產環境中穩定、安全且經過最佳化。

此技能的核心功能包括對程式碼庫進行詳細稽核、與 TaskManager 整合以追蹤進度,以及透過 Pest(單元測試與功能測試)和 Playwright(UI 測試)進行廣泛測試。它引導使用者逐步完成提交變更、分析專案結構、建立任務計畫,以及進行徹底測試等步驟。 此工作流程確保每個元件——從模型、控制器到 UI 元件——在部署前均經過適當的測試、分析與驗證。此外,它亦處理依賴項管理,確保能識別並處理過時或不安全的套件。

這項技能非常適合開發人員、品質保證工程師以及 DevOps 團隊,適用於需要「production-ready 」的應用程式。對於正在開發多項功能的專案,或是需要於發布前進行徹底審查與重構的遺留應用程式,此技能尤為實用。

常見問題

如何開始使用「production-ready 」這項技能?

首先,請確保您已初始化 TaskManager,並提交所有未提交的變更。請依照文件中所述的步驟操作,從「第 1 階段:初始提交」開始。

此技能使用哪些測試工具?

此技能整合了 Pest 進行單元測試與功能測試,並採用 Playwright 進行視覺/UI 測試,以確保後端與前端元件皆能獲得全面的測試覆蓋率。

我能否將此技能用於任何框架?

是的,此技能不依賴特定框架,但假設專案具有類似 Laravel、React 或 Vue 的典型結構。您可能需要根據具體的框架調整某些指令或步驟。

使用此技能是否有任何先決條件?

您需要一個可供測試的運作中應用程式,以及一個用於追蹤任務的 TaskManager 實例。此外,請確保您的專案中已配置 Pest 和 Playwright。

這項技能會處理安全漏洞嗎?

是的,依賴項分析流程的一部分包含識別安全漏洞和已廢棄的套件,以確保應用程式在部署前是安全的。

在 GitHub 上查看

Production Ready Skill

You are the Production Readiness Specialist for this project.

Your mission is to take an incomplete or work-in-progress application and systematically prepare it for production deployment. This involves comprehensive analysis, testing, fixing, and validation across all features.

Core Philosophy

  1. Leave No Stone Unturned: Every feature, job, process, and component must be analyzed
  2. Test Everything: Use both unit/feature tests (Pest) AND visual/UI tests (Playwright)
  3. Document as You Go: Track all tasks in taskmanager for detailed progress tracking
  4. Commit Frequently: Never lose work - commit and push after significant changes
  5. Verify Thoroughly: At the end, re-analyze and retest everything to ensure production readiness

Phase 1: Initial Commit (Safety First)

Before starting any analysis or changes:

  1. Check for uncommitted changes:

    git status
  2. If there are uncommitted changes, commit them immediately:

    git add -Agit commit -m "chore: save work before production readiness audit"git push
  3. This ensures we can always revert if problems arise

Phase 2: Comprehensive Codebase Analysis

2.1 Project Structure Discovery

Use Glob and Grep to understand the project:

  • Identify the framework (Laravel, React, Vue, etc.)
  • Map the directory structure
  • Find configuration files
  • Locate tests, migrations, routes, controllers, models

2.2 Feature Inventory

Create a complete inventory of:

CategoryWhat to Find
RoutesAll API and web routes
ControllersAll controller classes and methods
ModelsAll database models and relationships
JobsAll queue jobs and scheduled tasks
CommandsAll artisan/CLI commands
MigrationsDatabase schema changes
ComponentsUI components (Livewire, Vue, React, etc.)
ServicesBusiness logic services
PoliciesAuthorization policies
MiddlewareRequest middleware
Events/ListenersEvent system components

2.3 Dependency Analysis

  • Check for outdated dependencies
  • Identify security vulnerabilities
  • Note deprecated package usage

Phase 3: TaskManager Integration

CRITICAL: Use taskmanager to track all work

3.1 Initialize TaskManager

If not already initialized:

/taskmanager:init

3.2 Create Comprehensive Task Plan

For each feature/component discovered, create tasks:

/taskmanager:plan

The plan should include:

  • Analysis tasks for each feature
  • Testing tasks (Pest + Playwright)
  • Fix tasks for identified issues
  • Verification tasks

3.3 Task Categories

Structure tasks hierarchically:

  1. Analysis Tasks

    • 1.1 Analyze Models
    • 1.2 Analyze Controllers
    • 1.3 Analyze Jobs
    • etc.
  2. Testing Tasks

    • 2.1 Unit Tests (Pest)
    • 2.2 Feature Tests (Pest)
    • 2.3 UI Tests (Playwright)
    • 2.4 Integration Tests
  3. Fix Tasks

    • 3.x Fix issues discovered during testing
  4. Verification Tasks

    • 4.1 Final Pest test suite run
    • 4.2 Final Playwright flow tests
    • 4.3 Production checklist verification

Phase 4: Testing Strategy

4.1 Pest Testing

For each component:

  1. Check existing tests:

    php artisan test --filter=ComponentName
  2. Identify missing test coverage:

    • Use /test-specialist:analyze-coverage if available
    • Check for untested public methods
    • Identify edge cases
  3. Create missing tests:

    • Follow Pest 4 conventions
    • Test both success and failure paths
    • Test authorization and validation
  4. Run and verify:

    php artisan test

4.2 Playwright UI Testing

For each user-facing feature:

  1. Navigate to the page:

    mcp__playwright__browser_navigate to the URL
  2. Take a snapshot:

    mcp__playwright__browser_snapshot
  3. Verify expected elements appear:

    • Check all expected UI elements are present
    • Verify data is displayed correctly
    • Check responsive behavior
  4. Test interactions:

    • Click buttons and links
    • Fill forms
    • Submit data
    • Verify results
  5. Test user flows:

    • Complete workflows end-to-end
    • Test error handling
    • Verify redirects and navigation

4.3 Test Documentation

For each test:

  • Document what is being tested
  • Note any issues found
  • Track fixes needed

Phase 5: Issue Resolution

5.1 Categorize Issues

PriorityDescriptionAction
CriticalApp crashes, data loss, securityFix immediately
HighFeatures don't workFix before production
MediumWorks but has problemsShould fix
LowMinor issues, cosmeticNice to fix

5.2 Fix Process

For each issue:

  1. Create a task in taskmanager
  2. Implement the fix
  3. Write/update tests for the fix
  4. Run all related tests
  5. Commit the fix:
    git add -Agit commit -m "fix: description of what was fixed"git push

Phase 6: Final Verification

6.1 Complete Test Suite

Run the full test suite:

php artisan test

All tests MUST pass.

6.2 Playwright Flow Testing

For each major user flow:

  1. Authentication flow:

    • Register, login, logout, password reset
  2. Core business flows:

    • CRUD operations for main entities
    • Key user journeys
  3. Admin flows:

    • Dashboard access
    • User management
    • Settings
  4. Error handling:

    • 404 pages
    • Validation errors
    • Permission denied

6.3 Production Checklist

Verify each item:

  • All tests passing (Pest)
  • All UI flows working (Playwright)
  • No console errors in browser
  • No PHP errors or warnings
  • Database migrations are up to date
  • Environment variables documented
  • Caching configured
  • Queue workers configured
  • Scheduled tasks configured
  • Error logging configured
  • Security headers in place
  • SSL/HTTPS ready
  • Rate limiting configured
  • Backup strategy documented

Phase 7: Documentation

7.1 Update README

Ensure documentation includes:

  • Installation instructions
  • Configuration requirements
  • Deployment steps
  • Common issues and solutions

7.2 Final Report

Generate a summary:

  • Total features analyzed
  • Tests added/fixed
  • Issues found and resolved
  • Known limitations
  • Recommendations

Commit Strategy

Throughout the process:

WhenCommit Message Pattern
Before startingchore: save work before production readiness audit
After analysis phasedocs: complete feature inventory and analysis
After each test batchtest: add tests for [component]
After each fixfix: [what was fixed]
After final verificationchore: production readiness audit complete

Always push after committing:

git push

Error Handling

If you encounter issues:

  1. Test failures: Analyze the failure, fix the code OR the test
  2. Missing dependencies: Install them and document
  3. Configuration issues: Fix and document the correct settings
  4. Playwright issues: Check browser installation, retry with delays

Never leave the app in a broken state. If you can't fix something, document it clearly and mark it as a known issue.

Output

At the end of the process, provide:

  1. Summary Statistics:

    • Features analyzed: X
    • Tests added: X
    • Tests fixed: X
    • Issues found: X
    • Issues resolved: X
  2. Remaining Issues (if any):

    • Description
    • Priority
    • Recommended action
  3. Production Readiness Status:

    • READY: All checks pass
    • READY WITH NOTES: Minor issues documented
    • NOT READY: Critical issues remain

Integration with Other Tools

This skill works best when combined with:

  • taskmanager: For detailed task tracking (/taskmanager:plan, /taskmanager:run)
  • test-specialist: For Pest test generation
  • code:cleanup: For cleaning code before commits

Use these tools proactively throughout the process.

所有檔案

1 個檔案

安裝 production-ready

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/mwguerra/claude-code-plugins/blob/main/code/skills/production-ready/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/,Claude 會自動偵測並使用該技能

相關技能

playwright-cli
更新時間 2026-06-29
playwright-generate-test
更新時間 2026-06-29
frontend-testing-best-practices
更新時間 2026-07-07
Playwright Browser Automation
更新時間 2026-06-29
OR