heraspec 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +187 -0
- package/README.md +140 -107
- package/bin/heraspec.js +1491 -155
- package/bin/heraspec.js.map +4 -4
- package/dist/cli/index.d.ts +2 -0
- package/dist/commands/audit.d.ts +37 -0
- package/dist/commands/create.d.ts +11 -0
- package/dist/commands/explore.d.ts +17 -0
- package/dist/commands/helper.d.ts +13 -0
- package/dist/commands/hotfix.d.ts +9 -0
- package/dist/commands/make-code.d.ts +14 -0
- package/dist/commands/make-docs.d.ts +36 -0
- package/dist/commands/make-test.d.ts +60 -0
- package/dist/commands/memory.d.ts +101 -0
- package/dist/commands/pack.d.ts +17 -0
- package/dist/commands/show.d.ts +8 -0
- package/dist/commands/skill.d.ts +8 -0
- package/dist/commands/suggest.d.ts +32 -0
- package/dist/commands/validate.d.ts +8 -0
- package/dist/core/archive.d.ts +14 -0
- package/dist/core/config.d.ts +33 -0
- package/dist/core/init.d.ts +97 -0
- package/dist/core/list.d.ts +7 -0
- package/dist/core/memory/config-advisor.d.ts +30 -0
- package/dist/core/memory/context-config.d.ts +14 -0
- package/dist/core/memory/context-generator.d.ts +19 -0
- package/dist/core/memory/index.d.ts +12 -0
- package/dist/core/memory/memory-schema.d.ts +34 -0
- package/dist/core/memory/memory-search.d.ts +45 -0
- package/dist/core/memory/memory-store.d.ts +71 -0
- package/dist/core/memory/memory-types.d.ts +159 -0
- package/dist/core/memory/memory-vector.d.ts +23 -0
- package/dist/core/parsers/code-parser.d.ts +53 -0
- package/dist/core/parsers/markdown-parser.d.ts +18 -0
- package/dist/core/restore.d.ts +9 -0
- package/dist/core/schemas/base.schema.d.ts +55 -0
- package/dist/core/schemas/change.schema.d.ts +35 -0
- package/dist/core/schemas/index.d.ts +7 -0
- package/dist/core/schemas/spec.schema.d.ts +50 -0
- package/dist/core/skills/index.d.ts +6 -0
- package/dist/core/skills/skill-manager.d.ts +28 -0
- package/dist/core/skills/skill-parser.d.ts +24 -0
- package/dist/core/sync.d.ts +6 -0
- package/dist/core/templates/index.d.ts +10 -0
- package/dist/core/templates/skills/README.md +44 -38
- package/dist/core/templates/skills/campaign-plan/skill.md +76 -0
- package/dist/core/templates/skills/campaign-plan/skill.vi.md +76 -0
- package/dist/core/templates/skills/campaign-plan-skill.md +76 -0
- package/dist/core/templates/skills/campaign-plan-skill.vi.md +76 -0
- package/dist/core/templates/skills/code-review/skill.md +70 -0
- package/dist/core/templates/skills/code-review/skill.vi.md +70 -0
- package/dist/core/templates/skills/code-review-skill.md +70 -0
- package/dist/core/templates/skills/code-review-skill.vi.md +70 -0
- package/dist/core/templates/skills/content-creation/skill.md +69 -0
- package/dist/core/templates/skills/content-creation/skill.vi.md +69 -0
- package/dist/core/templates/skills/content-creation-skill.md +69 -0
- package/dist/core/templates/skills/content-creation-skill.vi.md +69 -0
- package/dist/core/templates/skills/content-optimization/skill.md +104 -0
- package/dist/core/templates/skills/debug/skill.md +69 -0
- package/dist/core/templates/skills/debug/skill.vi.md +69 -0
- package/dist/core/templates/skills/debug-skill.md +69 -0
- package/dist/core/templates/skills/debug-skill.vi.md +69 -0
- package/dist/core/templates/skills/deploy-documentation/skill.md +408 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/airbnb/DESIGN.md +246 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/airtable/DESIGN.md +89 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/apple/DESIGN.md +313 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/bmw/DESIGN.md +180 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/cal/DESIGN.md +259 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/claude/DESIGN.md +312 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/clay/DESIGN.md +304 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/clickhouse/DESIGN.md +281 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/cohere/DESIGN.md +266 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/coinbase/DESIGN.md +129 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/composio/DESIGN.md +307 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/cursor/DESIGN.md +309 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/elevenlabs/DESIGN.md +265 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/expo/DESIGN.md +281 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/figma/DESIGN.md +220 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/framer/DESIGN.md +246 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/hashicorp/DESIGN.md +278 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/ibm/DESIGN.md +332 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/index.json +72 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/intercom/DESIGN.md +146 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/kraken/DESIGN.md +125 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/linear.app/DESIGN.md +367 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/lovable/DESIGN.md +298 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/minimax/DESIGN.md +257 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/mintlify/DESIGN.md +326 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/miro/DESIGN.md +108 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/mistral.ai/DESIGN.md +261 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/mongodb/DESIGN.md +266 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/notion/DESIGN.md +309 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/nvidia/DESIGN.md +293 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/ollama/DESIGN.md +267 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/opencode.ai/DESIGN.md +281 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/pinterest/DESIGN.md +230 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/posthog/DESIGN.md +256 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/raycast/DESIGN.md +268 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/replicate/DESIGN.md +261 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/resend/DESIGN.md +303 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/revolut/DESIGN.md +185 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/runwayml/DESIGN.md +244 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/sanity/DESIGN.md +357 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/sentry/DESIGN.md +262 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/spacex/DESIGN.md +194 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/spotify/DESIGN.md +246 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/stripe/DESIGN.md +322 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/supabase/DESIGN.md +255 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/superhuman/DESIGN.md +252 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/together.ai/DESIGN.md +263 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/uber/DESIGN.md +295 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/vercel/DESIGN.md +310 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/voltagent/DESIGN.md +323 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/warp/DESIGN.md +253 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/webflow/DESIGN.md +92 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/wise/DESIGN.md +173 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/x.ai/DESIGN.md +257 -0
- package/dist/core/templates/skills/design-system/knowledge/design-systems/zapier/DESIGN.md +328 -0
- package/dist/core/templates/skills/design-system/skill.md +176 -0
- package/dist/core/templates/skills/documents/skill.md +104 -0
- package/dist/core/templates/skills/e2e-test/skill.md +119 -0
- package/dist/core/templates/skills/email-sequence/skill.md +68 -0
- package/dist/core/templates/skills/email-sequence/skill.vi.md +68 -0
- package/dist/core/templates/skills/email-sequence-skill.md +68 -0
- package/dist/core/templates/skills/email-sequence-skill.vi.md +68 -0
- package/dist/core/templates/skills/git-embed/skill.md +57 -0
- package/dist/core/templates/skills/integration-test/skill.md +118 -0
- package/dist/core/templates/skills/knowledge/README.md +63 -63
- package/dist/core/templates/skills/knowledge/design-systems/index.json +72 -72
- package/dist/core/templates/skills/knowledge/frameworks/php/codeigniter/rise-cms/profile.json +27 -27
- package/dist/core/templates/skills/knowledge/frameworks/php/codeigniter/rise-cms/structure.md +137 -137
- package/dist/core/templates/skills/knowledge/frameworks/php/laravel/botble/profile.json +39 -39
- package/dist/core/templates/skills/knowledge/frameworks/php/laravel/botble/structure.md +207 -207
- package/dist/core/templates/skills/knowledge/frameworks/php/wordpress/core/profile.json +51 -51
- package/dist/core/templates/skills/knowledge/frameworks/php/wordpress/core/structure.md +369 -369
- package/dist/core/templates/skills/knowledge/index.json +65 -65
- package/dist/core/templates/skills/perfex-module/code-quality-guidelines/skill.md +130 -0
- package/dist/core/templates/skills/perfex-module/envato-review-guidelines/skill.md +132 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/scripts/scaffold-module.js +151 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/skill.md +204 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/Test_Module.php +79 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/controller-admin.php +71 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/controller-api.php +58 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/deploy.ps1 +97 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/helper.php +97 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/install.php +30 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/model-main.php +94 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/module-main.php +91 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/package.json +30 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/uninstall.php +11 -0
- package/dist/core/templates/skills/perfex-module/module-codebase/templates/webpack.config.js +163 -0
- package/dist/core/templates/skills/perfex-module/skill.md +50 -0
- package/dist/core/templates/skills/project-memory/skill.md +222 -0
- package/dist/core/templates/skills/project-memory/skill.vi.md +223 -0
- package/dist/core/templates/skills/seo-audit/skill.md +75 -0
- package/dist/core/templates/skills/seo-audit/skill.vi.md +75 -0
- package/dist/core/templates/skills/seo-audit-skill.md +75 -0
- package/dist/core/templates/skills/seo-audit-skill.vi.md +75 -0
- package/dist/core/templates/skills/smart-explore/skill.md +141 -0
- package/dist/core/templates/skills/sourcecode-analyzer/skill.md +210 -0
- package/dist/core/templates/skills/sourcecode-analyzer/skill.vi.md +210 -0
- package/dist/core/templates/skills/spec-writer/skill.md +61 -0
- package/dist/core/templates/skills/spec-writer/skill.vi.md +61 -0
- package/dist/core/templates/skills/spec-writer-skill.md +61 -0
- package/dist/core/templates/skills/spec-writer-skill.vi.md +61 -0
- package/dist/core/templates/skills/sql-queries/skill.md +67 -0
- package/dist/core/templates/skills/sql-queries/skill.vi.md +67 -0
- package/dist/core/templates/skills/sql-queries-skill.md +67 -0
- package/dist/core/templates/skills/sql-queries-skill.vi.md +67 -0
- package/dist/core/templates/skills/suggestion/skill.md +118 -0
- package/dist/core/templates/skills/system-design/skill.md +70 -0
- package/dist/core/templates/skills/system-design/skill.vi.md +70 -0
- package/dist/core/templates/skills/system-design-skill.md +70 -0
- package/dist/core/templates/skills/system-design-skill.vi.md +70 -0
- package/dist/core/templates/skills/tech-debt/skill.md +70 -0
- package/dist/core/templates/skills/tech-debt/skill.vi.md +70 -0
- package/dist/core/templates/skills/tech-debt-skill.md +70 -0
- package/dist/core/templates/skills/tech-debt-skill.vi.md +70 -0
- package/dist/core/templates/skills/ui-ux/data/charts.csv +26 -0
- package/dist/core/templates/skills/ui-ux/data/colors.csv +97 -0
- package/dist/core/templates/skills/ui-ux/data/design-systems.csv +54 -0
- package/dist/core/templates/skills/ui-ux/data/landing.csv +31 -0
- package/dist/core/templates/skills/ui-ux/data/pages-proposed.csv +22 -0
- package/dist/core/templates/skills/ui-ux/data/pages.csv +10 -0
- package/dist/core/templates/skills/ui-ux/data/products.csv +97 -0
- package/dist/core/templates/skills/ui-ux/data/prompts.csv +24 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/flutter.csv +53 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/html-tailwind.csv +56 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/nextjs.csv +53 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/react-native.csv +52 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/react.csv +54 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/svelte.csv +54 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/swiftui.csv +51 -0
- package/dist/core/templates/skills/ui-ux/data/stacks/vue.csv +50 -0
- package/dist/core/templates/skills/ui-ux/data/styles.csv +59 -0
- package/dist/core/templates/skills/ui-ux/data/typography.csv +58 -0
- package/dist/core/templates/skills/ui-ux/data/ux-guidelines.csv +100 -0
- package/dist/core/templates/skills/ui-ux/scripts/CODE_EXPLANATION.md +394 -0
- package/dist/core/templates/skills/ui-ux/scripts/SEARCH_ALGORITHMS_COMPARISON.md +421 -0
- package/dist/core/templates/skills/ui-ux/scripts/SEARCH_MODES_GUIDE.md +238 -0
- package/dist/core/templates/skills/ui-ux/scripts/core.py +391 -0
- package/dist/core/templates/skills/ui-ux/scripts/search.py +73 -0
- package/dist/core/templates/skills/ui-ux/skill.md +595 -0
- package/dist/core/templates/skills/ui-ux/templates/accessibility-checklist.md +40 -0
- package/dist/core/templates/skills/ui-ux/templates/example-prompt-full-theme.md +333 -0
- package/dist/core/templates/skills/ui-ux/templates/page-types-guide.md +338 -0
- package/dist/core/templates/skills/ui-ux/templates/pages-proposed-summary.md +273 -0
- package/dist/core/templates/skills/ui-ux/templates/pre-delivery-checklist.md +42 -0
- package/dist/core/templates/skills/ui-ux/templates/prompt-template-full-theme.md +313 -0
- package/dist/core/templates/skills/ui-ux/templates/responsive-design.md +40 -0
- package/dist/core/templates/skills/unit-test/skill.md +111 -0
- package/dist/core/templates/skills/wordpress/plugin-check/skill.md +151 -0
- package/dist/core/templates/skills/wordpress/plugin-directory/skill.md +396 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/skill.md +100 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/admin-dashboard.php +47 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/admin-settings.php +60 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/assets/admin-css.css +22 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/assets/admin-js.js +15 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/plugin-main.php +169 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/readme.txt +41 -0
- package/dist/core/templates/skills/wordpress/plugin-standard/templates/uninstall.php +21 -0
- package/dist/core/templates/skills/wordpress/ux-element/skill.md +83 -0
- package/dist/core/templates/skills/wordpress/ux-element/templates/Controller.php +50 -0
- package/dist/core/templates/skills/wordpress/ux-element/templates/Shortcode.php +23 -0
- package/dist/core/templates/skills/wordpress/ux-element/templates/Template.html +20 -0
- package/dist/core/templates/skills/wordpress/ux-element/templates/Thumbnail.svg +8 -0
- package/dist/core/templates/skills/wordpress/ux-element/templates/View.php +21 -0
- package/dist/core/templates/skills-template-map.d.ts +29 -0
- package/dist/core/validation/validator.d.ts +26 -0
- package/dist/core/view.d.ts +4 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +350 -114
- package/dist/utils/file-system.d.ts +19 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/task-parser.d.ts +26 -0
- package/package.json +2 -2
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Skill: Unit Testing (Cross-Cutting)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This skill is used to create unit tests for code components. Unit tests verify that individual functions, methods, or classes work correctly in isolation.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- When testing individual functions or methods
|
|
10
|
+
- When testing class methods in isolation
|
|
11
|
+
- When testing utility functions
|
|
12
|
+
- When testing business logic
|
|
13
|
+
- When testing data transformations
|
|
14
|
+
- When ensuring code correctness before integration
|
|
15
|
+
|
|
16
|
+
## Step-by-Step Process
|
|
17
|
+
|
|
18
|
+
### Step 1: Identify Test Targets
|
|
19
|
+
- Analyze the code to identify testable units
|
|
20
|
+
- List all public methods/functions
|
|
21
|
+
- Identify edge cases and boundary conditions
|
|
22
|
+
- Determine expected inputs and outputs
|
|
23
|
+
|
|
24
|
+
### Step 2: Set Up Test Framework
|
|
25
|
+
- Choose appropriate testing framework (Jest, PHPUnit, pytest, etc.)
|
|
26
|
+
- Configure test environment
|
|
27
|
+
- Set up test structure matching project conventions
|
|
28
|
+
- Ensure test framework is installed and configured
|
|
29
|
+
|
|
30
|
+
### Step 3: Write Test Cases
|
|
31
|
+
- Create test file matching source file structure
|
|
32
|
+
- Write tests for each function/method
|
|
33
|
+
- Test normal cases (happy path)
|
|
34
|
+
- Test edge cases (null, empty, boundary values)
|
|
35
|
+
- Test error cases (invalid input, exceptions)
|
|
36
|
+
- Use descriptive test names
|
|
37
|
+
|
|
38
|
+
### Step 4: Run and Verify
|
|
39
|
+
- Run tests to ensure they pass
|
|
40
|
+
- Check test coverage if available
|
|
41
|
+
- Refactor if needed
|
|
42
|
+
- Ensure tests are fast and isolated
|
|
43
|
+
|
|
44
|
+
### Step 5: Document Test Cases
|
|
45
|
+
- Add comments for complex test scenarios
|
|
46
|
+
- Document test data and expected outcomes
|
|
47
|
+
- Update test documentation if needed
|
|
48
|
+
|
|
49
|
+
## Required Input
|
|
50
|
+
|
|
51
|
+
- **Source code**: Code to be tested (functions, methods, classes)
|
|
52
|
+
- **Test framework**: Testing framework to use (Jest, PHPUnit, pytest, etc.)
|
|
53
|
+
- **Project structure**: Understanding of where tests should be placed
|
|
54
|
+
- **Dependencies**: List of dependencies that need to be mocked
|
|
55
|
+
|
|
56
|
+
## Expected Output
|
|
57
|
+
|
|
58
|
+
- Complete unit test files
|
|
59
|
+
- Tests covering normal, edge, and error cases
|
|
60
|
+
- Test assertions verifying expected behavior
|
|
61
|
+
- Test data and fixtures if needed
|
|
62
|
+
- Passing test suite
|
|
63
|
+
|
|
64
|
+
## Tone & Rules
|
|
65
|
+
|
|
66
|
+
### Test Naming
|
|
67
|
+
- Use descriptive names: `test_user_registration_with_valid_email()`
|
|
68
|
+
- Follow pattern: `test_<what>_<condition>_<expected_result>`
|
|
69
|
+
- Use clear, readable test names
|
|
70
|
+
|
|
71
|
+
### Test Structure
|
|
72
|
+
- Arrange: Set up test data and dependencies
|
|
73
|
+
- Act: Execute the code being tested
|
|
74
|
+
- Assert: Verify the results
|
|
75
|
+
- Clean up: Reset state if needed
|
|
76
|
+
|
|
77
|
+
### Coverage Goals
|
|
78
|
+
- Aim for high coverage of critical paths
|
|
79
|
+
- Test all public methods
|
|
80
|
+
- Test edge cases and error handling
|
|
81
|
+
- Don't test implementation details
|
|
82
|
+
|
|
83
|
+
### Limitations
|
|
84
|
+
- ❌ DO NOT test private methods directly (test through public interface)
|
|
85
|
+
- ❌ DO NOT write tests that depend on other tests
|
|
86
|
+
- ❌ DO NOT test external dependencies (use mocks)
|
|
87
|
+
- ❌ DO NOT write slow tests (use mocks for I/O)
|
|
88
|
+
- ❌ DO NOT test framework code
|
|
89
|
+
|
|
90
|
+
## Available Templates
|
|
91
|
+
|
|
92
|
+
- `templates/unit-test-template.js` - JavaScript/Jest template
|
|
93
|
+
- `templates/unit-test-template.php` - PHP/PHPUnit template
|
|
94
|
+
- `templates/unit-test-template.py` - Python/pytest template
|
|
95
|
+
|
|
96
|
+
## Available Scripts
|
|
97
|
+
|
|
98
|
+
- `scripts/generate-test-stubs.sh` - Generate test file stubs from source code
|
|
99
|
+
|
|
100
|
+
## Examples
|
|
101
|
+
|
|
102
|
+
See `examples/` directory for reference:
|
|
103
|
+
- `good-unit-test/` - Well-structured unit tests
|
|
104
|
+
- `bad-unit-test/` - Examples to avoid
|
|
105
|
+
|
|
106
|
+
## Links to Other Skills
|
|
107
|
+
|
|
108
|
+
- **integration-test**: Use after unit tests for integration testing
|
|
109
|
+
- **e2e-test**: Use for end-to-end testing
|
|
110
|
+
- **documents**: Use to document test strategy
|
|
111
|
+
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Skill: WordPress Plugin Check (PCP)
|
|
2
|
+
|
|
3
|
+
This skill automates the process of running the WordPress Plugin Check tool and fixing the reported issues.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
To identify and resolve issues flagged by the WordPress Plugin Check (PCP) tool to ensure the plugin meets WordPress.org standards.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Install Plugin Check (PCP)**:
|
|
12
|
+
- You MUST have the [Plugin Check (PCP)](https://wordpress.org/plugins/plugin-check/) plugin installed and active on your WordPress site.
|
|
13
|
+
- CLI command relies on this plugin to generate reports.
|
|
14
|
+
|
|
15
|
+
2. **Configure wp-config.php**:
|
|
16
|
+
- Ensure your `wp-config.php` uses `127.0.0.1` instead of `localhost` for database host if you encounter connection issues with CLI.
|
|
17
|
+
- Example: `define( 'DB_HOST', '127.0.0.1' );`
|
|
18
|
+
|
|
19
|
+
## Required Variables
|
|
20
|
+
|
|
21
|
+
- `{{plugin_folder_name}}`: The actual folder name of the target plugin (e.g., `poly-locations-manager` or `my-awesome-plugin`).
|
|
22
|
+
> **Note**: `polyutilities` in examples is just a placeholder. ALWAYS replace it with the actual plugin slug you are working on.
|
|
23
|
+
|
|
24
|
+
## Agent Usage & Examples
|
|
25
|
+
|
|
26
|
+
### Triggering the Skill
|
|
27
|
+
|
|
28
|
+
Users may ask to "check plugin [name]" or "run plugin check".
|
|
29
|
+
|
|
30
|
+
**Example Prompt (Reference Only):**
|
|
31
|
+
> "Use skill plugin-check to check, then resolve *all* issues mentioned for plugin `[TARGET_PLUGIN_NAME]`. Ensure careful handling and verify that related features still function correctly. If uncertain about any fix, add a TODO note in the code instead of applying a risky change."
|
|
32
|
+
|
|
33
|
+
**CRITICAL INSTRUCTION**:
|
|
34
|
+
- Replace `[TARGET_PLUGIN_NAME]` with the actual plugin folder name provided by the user.
|
|
35
|
+
- IF the user does not specify a name, infer it from the current working directory or the `wp-content/plugins/` structure.
|
|
36
|
+
- **DO NOT** default to `polyutilities` unless the user specifically asked for it.
|
|
37
|
+
|
|
38
|
+
### Process Flow
|
|
39
|
+
|
|
40
|
+
#### Step 1: Run Plugin Check
|
|
41
|
+
|
|
42
|
+
1. **Identify Plugin Folder**: Ensure you are in the root workspace of the project. The plugin folder is usually the one you are currently working on.
|
|
43
|
+
2. **Execute Command**: Run the following command to generate the report. Replace `{{plugin_folder_name}}` with the actual directory name of the plugin.
|
|
44
|
+
```bash
|
|
45
|
+
mkdir -p wp-content/plugins/{{plugin_folder_name}}/_pcp && wp plugin check {{plugin_folder_name}} --exclude-files=.DS_Store,.sh,.md --exclude-directories=documentations,heraspec,node_modules,tests,dist,_pcp --format=table > wp-content/plugins/{{plugin_folder_name}}/_pcp/pcp.txt
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Step 2: Review and Confirm
|
|
49
|
+
|
|
50
|
+
1. **Read Report**: Read the content of `wp-content/plugins/{{plugin_folder_name}}/_pcp/pcp.txt`.
|
|
51
|
+
2. **Notify User**: Inform the user about the number or types of issues found.
|
|
52
|
+
3. **Wait for Confirmation**: Do NOT proceed to fix issues automatically without user confirmation unless explicitly authorized to "fix all".
|
|
53
|
+
|
|
54
|
+
#### Step 3: Fix Issues (Iterative)
|
|
55
|
+
|
|
56
|
+
1. **Target**: Aim to resolve **all** reported errors and warnings, ensuring no new issues are introduced.
|
|
57
|
+
2. **Safety First**: Ensure code changes do not break existing functionality.
|
|
58
|
+
* **Uncertainty**: If a fix is risky or unclear, DO NOT apply it blindly. Instead, add a comment `// TODO: [PCP] Fix this issue manually - [Reason]` and move to the next item.
|
|
59
|
+
3. **Iterate**:
|
|
60
|
+
* Apply fixes for a batch of issues.
|
|
61
|
+
* **Re-run Check**: Run the command from Step 1 again to verify fixes.
|
|
62
|
+
* Repeat until the report is clean or only contains intentional TODOs.
|
|
63
|
+
|
|
64
|
+
## Custom Fix Patterns
|
|
65
|
+
|
|
66
|
+
Use these patterns to address issues that the local PCP tool might miss or flag incorrectly.
|
|
67
|
+
|
|
68
|
+
### MissingVersion Fix
|
|
69
|
+
|
|
70
|
+
**Description**: This skill documents how to address the `WordPress.WP.EnqueuedResourceParameters.MissingVersion` warning. This occurs when `wp_register_style()`, `wp_enqueue_style()`, `wp_register_script()`, or `wp_enqueue_script()` are called without a version number.
|
|
71
|
+
|
|
72
|
+
**Pattern to Identify**: Look for calls where the version argument (the 4th argument) is missing or set to `false`/`null` for local/plugin resources.
|
|
73
|
+
|
|
74
|
+
**Example Warning**:
|
|
75
|
+
> Resource version not set in call to `wp_register_style()`. This means new versions of the style may not always be loaded due to browser caching.
|
|
76
|
+
|
|
77
|
+
**Recommended Fix**: Always provide a version number. Use a global plugin/theme version constant if available, falling back to a default or `filemtime` for local assets.
|
|
78
|
+
|
|
79
|
+
**Implementation Pattern**:
|
|
80
|
+
```php
|
|
81
|
+
// 1. Define the version (Replace <PLUGIN_PREFIX> with your actual plugin/theme prefix)
|
|
82
|
+
$version = defined( '<PLUGIN_PREFIX>_VERSION' ) ? <PLUGIN_PREFIX>_VERSION : '1.0.0';
|
|
83
|
+
|
|
84
|
+
// 2. Pass it to the function
|
|
85
|
+
wp_register_style(
|
|
86
|
+
'my-handle',
|
|
87
|
+
false, // Source (false for inline-only handles)
|
|
88
|
+
array(), // Dependencies
|
|
89
|
+
$version // Version (CRITICAL)
|
|
90
|
+
);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Why this is important**: WordPress uses the version number to generate a query string (e.g., `?ver=1.0.0`) attached to the asset URL. When you update your product, changing the version number forces browsers to download the new files instead of using stale cached versions.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### NonPrefixedHooknameFound Fix
|
|
98
|
+
|
|
99
|
+
**Description**: WordPress Coding Standards require plugin/theme hooks (actions/filters) to be prefixed. However, when using core WP hooks or known third-party hooks, this warning triggers correctly.
|
|
100
|
+
|
|
101
|
+
**Pattern to Identify**:
|
|
102
|
+
> WARNING: Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "the_content".
|
|
103
|
+
|
|
104
|
+
**Recommended Fix**: If using a standard WordPress hook or a known third-party hook, use the `phpcs:disable` / `phpcs:enable` toggle to suppress the warning for that specific instance.
|
|
105
|
+
|
|
106
|
+
```php
|
|
107
|
+
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
|
|
108
|
+
$description = apply_filters( 'the_content', $post_content );
|
|
109
|
+
// phpcs:enable
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### NonPrefixedVariableFound Fix
|
|
115
|
+
|
|
116
|
+
**Description**: Global variables or variables defined in the global scope (like in template files or shared configuration) must be prefixed with a unique slug to prevent collisions.
|
|
117
|
+
|
|
118
|
+
**Pattern to Identify**:
|
|
119
|
+
> WARNING: Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$options".
|
|
120
|
+
|
|
121
|
+
**Recommended Fix**: Rename the variable to include your unique product prefix (e.g., `<plugin_prefix>_`).
|
|
122
|
+
|
|
123
|
+
#### Before
|
|
124
|
+
```php
|
|
125
|
+
$options = array( 'key' => 'value' );
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### After
|
|
129
|
+
```php
|
|
130
|
+
$<plugin_prefix>_options = array( 'key' => 'value' );
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Best Practices
|
|
134
|
+
|
|
135
|
+
- **Placeholders**: Replace `<PLUGIN_PREFIX>` (uppercase) and `<plugin_prefix>` (lowercase) with your actual project prefix throughout the implementation.
|
|
136
|
+
- **Global Scope**: Be especially careful with short variable names in common files like `functions.php` or template parts.
|
|
137
|
+
- **Hook Names**: Always prefix custom hooks. Only disable the check for established external hooks.
|
|
138
|
+
|
|
139
|
+
## Strict Prohibitions
|
|
140
|
+
|
|
141
|
+
1. **DO NOT DELETE Excluded Files**:
|
|
142
|
+
- The command excludes `.sh`, `.md`, `.DS_Store` and directories `heraspec`, `tests`, `docs`.
|
|
143
|
+
- **NEVER** delete or modify these files/directories as part of the fix. They are intentionally excluded because they are development assets, not production garbage.
|
|
144
|
+
- If `wp plugin check` complains about them (it shouldn't if excluded), **IGNORE** those specific errors.
|
|
145
|
+
|
|
146
|
+
2. **Scope**: Only modify files within the plugin directory that are relevant to the actual PHP/JS/CSS code being checked.
|
|
147
|
+
|
|
148
|
+
## Tips
|
|
149
|
+
|
|
150
|
+
- Common issues include missing escaping (`esc_html`, `esc_attr`), missing nonces, or direct DB access without preparation.
|
|
151
|
+
- Always verify that fixes do not break existing functionality.
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# Skill: WordPress Plugin Directory Compliance Check
|
|
2
|
+
|
|
3
|
+
This skill provides a systematic approach to review WordPress plugin source code against the [WordPress Plugin Directory Guidelines](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/).
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
To ensure a WordPress plugin fully complies with all 18 guidelines before submission to WordPress.org Plugin Directory, identifying issues and providing detailed recommendations for user approval before making changes.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. **Identify Plugin Root**: The agent must identify the root directory of the WordPress plugin being reviewed.
|
|
12
|
+
2. **Plugin Main File**: Locate the main plugin file (with `Plugin Name:` header).
|
|
13
|
+
3. **Readme File**: Check for `readme.txt` or `README.md`.
|
|
14
|
+
|
|
15
|
+
## Required Variables
|
|
16
|
+
|
|
17
|
+
- `{{plugin_path}}`: Absolute path to the plugin root directory.
|
|
18
|
+
- `{{plugin_slug}}`: The plugin's slug (folder name).
|
|
19
|
+
|
|
20
|
+
## Process Flow
|
|
21
|
+
|
|
22
|
+
### Step 1: Gather Plugin Information
|
|
23
|
+
|
|
24
|
+
1. **Find Main Plugin File**:
|
|
25
|
+
```bash
|
|
26
|
+
grep -l "Plugin Name:" {{plugin_path}}/*.php
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. **Read Plugin Headers**:
|
|
30
|
+
- Plugin Name
|
|
31
|
+
- Version
|
|
32
|
+
- Author
|
|
33
|
+
- License
|
|
34
|
+
- Text Domain
|
|
35
|
+
|
|
36
|
+
3. **Scan File Structure**:
|
|
37
|
+
```bash
|
|
38
|
+
find {{plugin_path}} -type f \( -name "*.php" -o -name "*.js" -o -name "*.css" \) | head -50
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Step 2: Review All 18 Guidelines
|
|
42
|
+
|
|
43
|
+
Perform systematic checks on each guideline:
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
#### **Guideline 1: GPL Compatibility**
|
|
48
|
+
> "Plugins must be compatible with the GNU General Public License"
|
|
49
|
+
|
|
50
|
+
**Checks:**
|
|
51
|
+
- [ ] Main plugin file has License header?
|
|
52
|
+
- [ ] License is GPL-compatible? (GPLv2 or later recommended)
|
|
53
|
+
- [ ] Third-party libraries have GPL-compatible licenses?
|
|
54
|
+
- [ ] Images and fonts have clear licensing?
|
|
55
|
+
|
|
56
|
+
**Commands:**
|
|
57
|
+
```bash
|
|
58
|
+
grep -r "License:" --include="*.php" {{plugin_path}}
|
|
59
|
+
grep -r "@license" --include="*.php" {{plugin_path}}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
#### **Guideline 2: Developer Responsibility**
|
|
65
|
+
> "Developers are responsible for the contents and actions of their plugins"
|
|
66
|
+
|
|
67
|
+
**Checks:**
|
|
68
|
+
- [ ] No code intentionally bypassing guidelines?
|
|
69
|
+
- [ ] All files have confirmed licensing?
|
|
70
|
+
- [ ] Third-party APIs comply with terms of use?
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
#### **Guideline 3: Stable Version Availability**
|
|
75
|
+
> "A stable version of a plugin must be available from its WordPress Plugin Directory page"
|
|
76
|
+
|
|
77
|
+
**Checks:**
|
|
78
|
+
- [ ] Code on SVN/directory is the latest version?
|
|
79
|
+
- [ ] Not distributing code via alternate methods without updating directory?
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
#### **Guideline 4: Human Readable Code**
|
|
84
|
+
> "Code must be (mostly) human readable"
|
|
85
|
+
|
|
86
|
+
**Checks:**
|
|
87
|
+
- [ ] No obfuscated code (p,a,c,k,e,r, uglify mangle)?
|
|
88
|
+
- [ ] No obscure variable names ($z12sdf813d)?
|
|
89
|
+
- [ ] Source code or link to development location available in readme?
|
|
90
|
+
- [ ] Build tools documented?
|
|
91
|
+
|
|
92
|
+
**Commands:**
|
|
93
|
+
```bash
|
|
94
|
+
# Find eval() that may contain obfuscated code
|
|
95
|
+
grep -r "eval(" --include="*.php" --include="*.js" {{plugin_path}}
|
|
96
|
+
# Find strange variable names
|
|
97
|
+
grep -rE "\$[a-z][0-9]{3,}" --include="*.php" {{plugin_path}}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
#### **Guideline 5: No Trialware**
|
|
103
|
+
> "Trialware is not permitted"
|
|
104
|
+
|
|
105
|
+
**Checks:**
|
|
106
|
+
- [ ] No features locked behind payment?
|
|
107
|
+
- [ ] No time-based trial limits?
|
|
108
|
+
- [ ] No quota restrictions?
|
|
109
|
+
- [ ] No sandbox-only API access?
|
|
110
|
+
|
|
111
|
+
**Commands:**
|
|
112
|
+
```bash
|
|
113
|
+
grep -ri "trial" --include="*.php" {{plugin_path}}
|
|
114
|
+
grep -ri "expired" --include="*.php" {{plugin_path}}
|
|
115
|
+
grep -ri "license_key" --include="*.php" {{plugin_path}}
|
|
116
|
+
grep -ri "is_pro" --include="*.php" {{plugin_path}}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
#### **Guideline 6: Software as a Service**
|
|
122
|
+
> "Software as a Service is permitted"
|
|
123
|
+
|
|
124
|
+
**Checks:**
|
|
125
|
+
- [ ] Service provides real functionality, not just license validation?
|
|
126
|
+
- [ ] Service documented in readme?
|
|
127
|
+
- [ ] Link to Terms of Use provided?
|
|
128
|
+
- [ ] Not just a storefront?
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
#### **Guideline 7: User Tracking Consent**
|
|
133
|
+
> "Plugins may not track users without their consent"
|
|
134
|
+
|
|
135
|
+
**Checks:**
|
|
136
|
+
- [ ] No automatic data collection without consent?
|
|
137
|
+
- [ ] Clear opt-in mechanism?
|
|
138
|
+
- [ ] Privacy policy documented in readme?
|
|
139
|
+
- [ ] Not misleading users to submit information?
|
|
140
|
+
- [ ] Not offloading unrelated assets?
|
|
141
|
+
- [ ] No undocumented external data usage?
|
|
142
|
+
|
|
143
|
+
**Commands:**
|
|
144
|
+
```bash
|
|
145
|
+
# Find external requests
|
|
146
|
+
grep -ri "wp_remote" --include="*.php" {{plugin_path}}
|
|
147
|
+
grep -ri "curl_" --include="*.php" {{plugin_path}}
|
|
148
|
+
grep -ri "file_get_contents.*http" --include="*.php" {{plugin_path}}
|
|
149
|
+
# Find tracking
|
|
150
|
+
grep -ri "analytics" --include="*.php" --include="*.js" {{plugin_path}}
|
|
151
|
+
grep -ri "tracking" --include="*.php" --include="*.js" {{plugin_path}}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
#### **Guideline 8: No External Executable Code**
|
|
157
|
+
> "Plugins may not send executable code via third-party systems"
|
|
158
|
+
|
|
159
|
+
**Checks:**
|
|
160
|
+
- [ ] Not serving updates from external servers?
|
|
161
|
+
- [ ] Not installing plugins/themes/add-ons from outside?
|
|
162
|
+
- [ ] Not calling CDN for JS/CSS (except fonts)?
|
|
163
|
+
- [ ] Not using third-party services to manage data lists?
|
|
164
|
+
- [ ] Not using iframes in admin pages?
|
|
165
|
+
|
|
166
|
+
**Commands:**
|
|
167
|
+
```bash
|
|
168
|
+
grep -ri "cdn" --include="*.php" --include="*.js" {{plugin_path}}
|
|
169
|
+
grep -ri "<iframe" --include="*.php" {{plugin_path}}
|
|
170
|
+
grep -ri "wp_remote_get.*\.js" --include="*.php" {{plugin_path}}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
#### **Guideline 9: Legal and Ethical Conduct**
|
|
176
|
+
> "Developers and their plugins must not do anything illegal, dishonest, or morally offensive"
|
|
177
|
+
|
|
178
|
+
**Checks:**
|
|
179
|
+
- [ ] No keyword stuffing?
|
|
180
|
+
- [ ] No fake reviews/sockpuppeting?
|
|
181
|
+
- [ ] No copying others' plugins?
|
|
182
|
+
- [ ] No automatic legal compliance claims?
|
|
183
|
+
- [ ] No unauthorized server resource usage (botnet, crypto-mining)?
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
#### **Guideline 10: External Links and Credits**
|
|
188
|
+
> "Plugins may not embed external links or credits on the public site without explicitly asking the user's permission"
|
|
189
|
+
|
|
190
|
+
**Checks:**
|
|
191
|
+
- [ ] "Powered By" links are optional and default OFF?
|
|
192
|
+
- [ ] Users must opt-in to display credits?
|
|
193
|
+
- [ ] Plugin doesn't require credit for functionality?
|
|
194
|
+
|
|
195
|
+
**Commands:**
|
|
196
|
+
```bash
|
|
197
|
+
grep -ri "powered by" --include="*.php" {{plugin_path}}
|
|
198
|
+
grep -ri "credit" --include="*.php" {{plugin_path}}
|
|
199
|
+
grep -ri "footer_text" --include="*.php" {{plugin_path}}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
#### **Guideline 11: Admin Dashboard Experience**
|
|
205
|
+
> "Plugins should not hijack the admin dashboard"
|
|
206
|
+
|
|
207
|
+
**Checks:**
|
|
208
|
+
- [ ] Upgrade prompts are limited and contextual?
|
|
209
|
+
- [ ] Notices are dismissible?
|
|
210
|
+
- [ ] Error messages have resolution guidance?
|
|
211
|
+
- [ ] No excessive dashboard advertising?
|
|
212
|
+
- [ ] No tracking in ads (related to Guideline 7)?
|
|
213
|
+
|
|
214
|
+
**Commands:**
|
|
215
|
+
```bash
|
|
216
|
+
grep -ri "admin_notice" --include="*.php" {{plugin_path}}
|
|
217
|
+
grep -ri "is-dismissible" --include="*.php" {{plugin_path}}
|
|
218
|
+
grep -ri "upgrade" --include="*.php" {{plugin_path}}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
#### **Guideline 12: No Spam in Public Pages**
|
|
224
|
+
> "Public facing pages on WordPress.org (readmes) must not spam"
|
|
225
|
+
|
|
226
|
+
**Checks in readme.txt:**
|
|
227
|
+
- [ ] No more than 5 tags?
|
|
228
|
+
- [ ] No undisclosed affiliate links?
|
|
229
|
+
- [ ] No keyword stuffing?
|
|
230
|
+
- [ ] No competitor tags?
|
|
231
|
+
- [ ] Links are direct, not redirected/cloaked?
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
#### **Guideline 13: WordPress Default Libraries**
|
|
236
|
+
> "Plugins must use WordPress' default libraries"
|
|
237
|
+
|
|
238
|
+
**Checks:**
|
|
239
|
+
- [ ] Not including separate jQuery?
|
|
240
|
+
- [ ] Not including libraries already in WordPress?
|
|
241
|
+
- [ ] Using `wp_enqueue_script()` with standard handles?
|
|
242
|
+
|
|
243
|
+
**WordPress Default Libraries:**
|
|
244
|
+
- jQuery, jQuery UI
|
|
245
|
+
- Backbone.js, Underscore.js
|
|
246
|
+
- React, ReactDOM
|
|
247
|
+
- Lodash
|
|
248
|
+
- Moment.js
|
|
249
|
+
- PHPMailer, PHPass
|
|
250
|
+
|
|
251
|
+
**Commands:**
|
|
252
|
+
```bash
|
|
253
|
+
find {{plugin_path}} -name "jquery*.js" -o -name "jquery*.min.js"
|
|
254
|
+
find {{plugin_path}} -name "underscore*.js" -o -name "backbone*.js"
|
|
255
|
+
find {{plugin_path}} -name "react*.js" -o -name "moment*.js"
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
#### **Guideline 14: Commit Frequency**
|
|
261
|
+
> "Frequent commits to a plugin should be avoided"
|
|
262
|
+
|
|
263
|
+
**Checks:**
|
|
264
|
+
- [ ] SVN is release repository, not development?
|
|
265
|
+
- [ ] Meaningful commit messages?
|
|
266
|
+
- [ ] No rapid-fire minor commits?
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
#### **Guideline 15: Version Number Increment**
|
|
271
|
+
> "Plugin version numbers must be incremented for each new release"
|
|
272
|
+
|
|
273
|
+
**Checks:**
|
|
274
|
+
- [ ] Version in main plugin file matches readme.txt?
|
|
275
|
+
- [ ] Correct version format (semantic versioning recommended)?
|
|
276
|
+
- [ ] SVN tag matches version number?
|
|
277
|
+
|
|
278
|
+
**Commands:**
|
|
279
|
+
```bash
|
|
280
|
+
grep -r "Version:" --include="*.php" {{plugin_path}} | head -5
|
|
281
|
+
grep -r "Stable tag:" {{plugin_path}}/readme.txt
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
#### **Guideline 16: Complete Plugin Required**
|
|
287
|
+
> "A complete plugin must be available at the time of submission"
|
|
288
|
+
|
|
289
|
+
**Checks:**
|
|
290
|
+
- [ ] Plugin is fully functional?
|
|
291
|
+
- [ ] Not a placeholder/coming soon?
|
|
292
|
+
- [ ] Not reserving name for future use?
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
#### **Guideline 17: Trademark and Copyright**
|
|
297
|
+
> "Plugins must respect trademarks, copyrights, and project names"
|
|
298
|
+
|
|
299
|
+
**Checks:**
|
|
300
|
+
- [ ] Slug doesn't start with trademarked names (WordPress, WooCommerce, etc.) unless authorized?
|
|
301
|
+
- [ ] Plugin name doesn't cause confusion with other products?
|
|
302
|
+
- [ ] Original branding recommended?
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
#### **Guideline 18: Directory Maintenance Rights**
|
|
307
|
+
> "We reserve the right to maintain the Plugin Directory to the best of our ability"
|
|
308
|
+
|
|
309
|
+
**Notes:** WordPress.org has rights to:
|
|
310
|
+
- Update guidelines at any time
|
|
311
|
+
- Disable/remove plugins for unlisted reasons
|
|
312
|
+
- Grant exceptions
|
|
313
|
+
- Remove developer access
|
|
314
|
+
- Modify plugins without consent for public safety
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
### Step 3: Generate Compliance Report
|
|
319
|
+
|
|
320
|
+
Create a report using this format:
|
|
321
|
+
|
|
322
|
+
```markdown
|
|
323
|
+
# WordPress Plugin Directory Compliance Report
|
|
324
|
+
|
|
325
|
+
## Plugin Information
|
|
326
|
+
- **Name:** [Plugin Name]
|
|
327
|
+
- **Version:** [Version]
|
|
328
|
+
- **Path:** [Path]
|
|
329
|
+
- **Review Time:** [Date/Time]
|
|
330
|
+
|
|
331
|
+
## Summary
|
|
332
|
+
- ✅ Passed: X/18 guidelines
|
|
333
|
+
- ⚠️ Needs Review: X issues
|
|
334
|
+
- ❌ Violations: X issues
|
|
335
|
+
|
|
336
|
+
## Details by Guideline
|
|
337
|
+
|
|
338
|
+
### ❌ Guideline X: [Guideline Name]
|
|
339
|
+
**Issues Found:**
|
|
340
|
+
- [Issue description]
|
|
341
|
+
- **File:** [file path]
|
|
342
|
+
- **Line:** [line number]
|
|
343
|
+
|
|
344
|
+
**Suggested Fix:**
|
|
345
|
+
\`\`\`php
|
|
346
|
+
// Code suggestion
|
|
347
|
+
\`\`\`
|
|
348
|
+
|
|
349
|
+
### ⚠️ Guideline Y: [Guideline Name]
|
|
350
|
+
**Needs Review:**
|
|
351
|
+
- [Description]
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Recommended Actions
|
|
356
|
+
1. [ ] [Action 1]
|
|
357
|
+
2. [ ] [Action 2]
|
|
358
|
+
...
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Step 4: User Confirmation
|
|
362
|
+
|
|
363
|
+
**CRITICAL:** Before making ANY changes, the Agent MUST:
|
|
364
|
+
|
|
365
|
+
1. Present the complete report to the user
|
|
366
|
+
2. Clearly explain each issue with reference to the specific guideline number
|
|
367
|
+
3. Wait for user confirmation on each action item
|
|
368
|
+
4. Only proceed after receiving approval
|
|
369
|
+
|
|
370
|
+
## Useful Commands
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
# Check plugin structure overview
|
|
374
|
+
find {{plugin_path}} -type f \( -name "*.php" -o -name "*.js" -o -name "*.css" \) | head -50
|
|
375
|
+
|
|
376
|
+
# Find all external URLs
|
|
377
|
+
grep -rhoE "https?://[a-zA-Z0-9./?=_-]*" --include="*.php" {{plugin_path}} | sort -u
|
|
378
|
+
|
|
379
|
+
# Check enqueued scripts
|
|
380
|
+
grep -r "wp_enqueue_script\|wp_enqueue_style" --include="*.php" {{plugin_path}}
|
|
381
|
+
|
|
382
|
+
# Find admin notices
|
|
383
|
+
grep -r "add_action.*admin_notices" --include="*.php" {{plugin_path}}
|
|
384
|
+
|
|
385
|
+
# Check AJAX handlers
|
|
386
|
+
grep -r "wp_ajax_" --include="*.php" {{plugin_path}}
|
|
387
|
+
|
|
388
|
+
# Find direct database queries
|
|
389
|
+
grep -r "\$wpdb->" --include="*.php" {{plugin_path}}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## References
|
|
393
|
+
|
|
394
|
+
- [WordPress Plugin Guidelines](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/)
|
|
395
|
+
- [GPL Compatible Licenses](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses)
|
|
396
|
+
- [Default Scripts in WordPress](https://developer.wordpress.org/reference/functions/wp_enqueue_script/#default-scripts-and-js-libraries-included-and-registered-by-wordpress)
|