# plugin-test > Run local testing workflow for a Claude Code plugin - Author: Edison - Repository: soilmass/claudeutils - Version: 20260127023329 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/soilmass/claudeutils - Web: https://mule.run/skillshub/@@soilmass/claudeutils~plugin-test:20260127023329 --- --- name: plugin-test description: Run local testing workflow for a Claude Code plugin argument-hint: " [--verbose] [--skill ] [--skip-hooks]" user-invocable: true model: sonnet --- # plugin-test Execute local testing workflow for a Claude Code plugin to verify all components work correctly. ## When to Use Use this skill when: - After implementing plugin components - Before packaging for distribution - To verify plugin loads and functions correctly - After making changes to validate nothing is broken ## Prerequisites - Plugin must pass `/plugin-validate` first - Validation must have passed (no errors) ## Arguments | Argument | Required | Description | |----------|----------|-------------| | `plugin-dir` | Yes | Path to the plugin directory | | `--verbose` | No | Show detailed test output | | `--skill` | No | Test specific skill only | | `--skip-hooks` | No | Skip hook testing | ## Example Usage ``` /plugin-test ./my-plugin ``` ``` /plugin-test ./my-plugin --verbose --skill code-review ``` ## Workflow When invoked, follow these steps: ### Step 1: Pre-Test Validation 1. Verify plugin directory exists 2. Check `.claude-plugin/plugin.json` is valid 3. Verify validation has passed (workflow state) 4. If validation not passed, suggest running `/plugin-validate` ### Step 2: Test Plugin Loading Execute: ```bash claude --plugin-dir --debug ``` Verify: - Plugin manifest loads without errors - No missing dependency warnings - All declared components are found ### Step 3: Test Skills For each skill in manifest: 1. Verify skill file exists and loads 2. Check frontmatter is parseable 3. Test skill invocation (dry run) Report: ``` Skills Test: ✓ code-review: loaded successfully ✓ test-runner: loaded successfully ✗ deploy: failed to load (missing dependency) ``` ### Step 4: Test Agents For each agent in manifest: 1. Verify agent file exists 2. Check frontmatter is valid 3. Verify tool restrictions are valid Report: ``` Agents Test: ✓ reviewer: valid configuration ``` ### Step 5: Test Hooks For each hook configuration: 1. Verify hook script exists 2. Check script is executable 3. Test hook with mock input 4. Verify exit codes are correct Test command: ```bash echo '{"tool_name":"Test","tool_input":{}}' | ./hooks/scripts/hook.sh echo "Exit code: $?" ``` Report: ``` Hooks Test: ✓ PreToolUse(Write): exit 0 (allow) ✓ PostToolUse(Write): exit 0 (continue) ``` ### Step 6: Test MCP Servers (if present) For each MCP server: 1. Verify configuration is valid 2. Attempt to start server (if stdio) 3. Check server responds to health check 4. Stop server Report: ``` MCP Test: ✓ api-server: responds to health check ``` ### Step 7: Integration Test Run a simple end-to-end test: 1. Load plugin 2. Invoke a skill 3. Verify hooks fire 4. Check state updates ### Step 8: Generate Test Report Create `state/test--.json`: ```json { "plugin": "", "version": "", "timestamp": "", "results": { "loading": {"passed": true}, "skills": {"passed": true, "count": 3}, "agents": {"passed": true, "count": 1}, "hooks": {"passed": true, "count": 2}, "mcp": {"passed": true, "count": 1}, "integration": {"passed": true} }, "errors": [], "warnings": [] } ``` ### Step 9: Update Workflow State 1. Record test results in workflow state 2. If all tests pass: - Mark test phase as complete - Allow transition to publish phase 3. If tests fail: - Keep in test phase - Record failure details ### Step 10: Report Results **Success:** ``` Plugin Test Report: v ============================================ Loading: ✓ PASSED Skills: ✓ PASSED (3/3) Agents: ✓ PASSED (1/1) Hooks: ✓ PASSED (2/2) MCP Servers: ✓ PASSED (1/1) Integration: ✓ PASSED Overall: ALL TESTS PASSED Next steps: 1. Run /plugin-document to generate documentation 2. Run /plugin-version to set release version 3. Run /plugin-package to create distribution ``` **Failure:** ``` Plugin Test Report: v ============================================ Loading: ✓ PASSED Skills: ✗ FAILED (2/3) - deploy: Module not found: './utils' Agents: ✓ PASSED (1/1) Hooks: ✓ PASSED (2/2) MCP Servers: ⚠ SKIPPED (not configured) Integration: ✗ FAILED - Could not invoke code-review skill Overall: 2 ERRORS, 1 SKIPPED Fix the errors and run /plugin-test again. ``` ## Error Handling - If plugin directory doesn't exist: Report NOTFOUND error - If validation hasn't passed: Block and suggest /plugin-validate - If hook script fails: Report exit code and stderr - If MCP server fails to start: Report connection error ## Test Exit Codes | Code | Meaning | |------|---------| | 0 | All tests passed | | 1 | Some tests failed | | 2 | Critical error (couldn't run tests) | ## Integration Points - Requires validation to pass first (enforced by pre-test-check hook) - Results recorded by post-test-analyze hook - Updates workflow state for phase transitions