@mytechtoday/augment-extensions 0.1.1 → 0.2.0

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.
Files changed (79) hide show
  1. package/augment-extensions/domain-rules/wordpress/README.md +163 -0
  2. package/augment-extensions/domain-rules/wordpress/module.json +32 -0
  3. package/augment-extensions/domain-rules/wordpress/rules/coding-standards.md +617 -0
  4. package/augment-extensions/domain-rules/wordpress/rules/directory-structure.md +270 -0
  5. package/augment-extensions/domain-rules/wordpress/rules/file-patterns.md +423 -0
  6. package/augment-extensions/domain-rules/wordpress/rules/gutenberg-blocks.md +493 -0
  7. package/augment-extensions/domain-rules/wordpress/rules/performance.md +568 -0
  8. package/augment-extensions/domain-rules/wordpress/rules/plugin-development.md +510 -0
  9. package/augment-extensions/domain-rules/wordpress/rules/project-detection.md +251 -0
  10. package/augment-extensions/domain-rules/wordpress/rules/rest-api.md +501 -0
  11. package/augment-extensions/domain-rules/wordpress/rules/security.md +564 -0
  12. package/augment-extensions/domain-rules/wordpress/rules/theme-development.md +388 -0
  13. package/augment-extensions/domain-rules/wordpress/rules/woocommerce.md +441 -0
  14. package/augment-extensions/domain-rules/wordpress-plugin/README.md +139 -0
  15. package/augment-extensions/domain-rules/wordpress-plugin/examples/ajax-plugin.md +1599 -0
  16. package/augment-extensions/domain-rules/wordpress-plugin/examples/custom-post-type-plugin.md +1727 -0
  17. package/augment-extensions/domain-rules/wordpress-plugin/examples/gutenberg-block-plugin.md +428 -0
  18. package/augment-extensions/domain-rules/wordpress-plugin/examples/gutenberg-block.md +422 -0
  19. package/augment-extensions/domain-rules/wordpress-plugin/examples/mvc-plugin.md +1623 -0
  20. package/augment-extensions/domain-rules/wordpress-plugin/examples/object-oriented-plugin.md +1343 -0
  21. package/augment-extensions/domain-rules/wordpress-plugin/examples/rest-endpoint.md +734 -0
  22. package/augment-extensions/domain-rules/wordpress-plugin/examples/settings-page-plugin.md +1350 -0
  23. package/augment-extensions/domain-rules/wordpress-plugin/examples/simple-procedural-plugin.md +503 -0
  24. package/augment-extensions/domain-rules/wordpress-plugin/examples/singleton-plugin.md +971 -0
  25. package/augment-extensions/domain-rules/wordpress-plugin/module.json +53 -0
  26. package/augment-extensions/domain-rules/wordpress-plugin/rules/activation-hooks.md +770 -0
  27. package/augment-extensions/domain-rules/wordpress-plugin/rules/admin-interface.md +874 -0
  28. package/augment-extensions/domain-rules/wordpress-plugin/rules/ajax-handlers.md +629 -0
  29. package/augment-extensions/domain-rules/wordpress-plugin/rules/asset-management.md +559 -0
  30. package/augment-extensions/domain-rules/wordpress-plugin/rules/context-providers.md +709 -0
  31. package/augment-extensions/domain-rules/wordpress-plugin/rules/cron-jobs.md +736 -0
  32. package/augment-extensions/domain-rules/wordpress-plugin/rules/database-management.md +1057 -0
  33. package/augment-extensions/domain-rules/wordpress-plugin/rules/documentation-standards.md +463 -0
  34. package/augment-extensions/domain-rules/wordpress-plugin/rules/frontend-functionality.md +478 -0
  35. package/augment-extensions/domain-rules/wordpress-plugin/rules/gutenberg-blocks.md +818 -0
  36. package/augment-extensions/domain-rules/wordpress-plugin/rules/internationalization.md +416 -0
  37. package/augment-extensions/domain-rules/wordpress-plugin/rules/migration.md +667 -0
  38. package/augment-extensions/domain-rules/wordpress-plugin/rules/performance-optimization.md +878 -0
  39. package/augment-extensions/domain-rules/wordpress-plugin/rules/plugin-architecture.md +693 -0
  40. package/augment-extensions/domain-rules/wordpress-plugin/rules/plugin-structure.md +352 -0
  41. package/augment-extensions/domain-rules/wordpress-plugin/rules/rest-api.md +818 -0
  42. package/augment-extensions/domain-rules/wordpress-plugin/rules/scaffolding-workflow.md +624 -0
  43. package/augment-extensions/domain-rules/wordpress-plugin/rules/security-best-practices.md +866 -0
  44. package/augment-extensions/domain-rules/wordpress-plugin/rules/testing-patterns.md +1165 -0
  45. package/augment-extensions/domain-rules/wordpress-plugin/rules/testing.md +414 -0
  46. package/augment-extensions/domain-rules/wordpress-plugin/rules/vscode-integration.md +751 -0
  47. package/augment-extensions/domain-rules/wordpress-plugin/rules/woocommerce-integration.md +949 -0
  48. package/augment-extensions/domain-rules/wordpress-plugin/rules/wordpress-org-submission.md +458 -0
  49. package/augment-extensions/examples/gutenberg-block-plugin/README.md +101 -0
  50. package/augment-extensions/examples/gutenberg-block-plugin/examples/testimonial-block.md +428 -0
  51. package/augment-extensions/examples/gutenberg-block-plugin/module.json +40 -0
  52. package/augment-extensions/examples/rest-api-plugin/README.md +98 -0
  53. package/augment-extensions/examples/rest-api-plugin/examples/task-manager-api.md +1299 -0
  54. package/augment-extensions/examples/rest-api-plugin/module.json +40 -0
  55. package/augment-extensions/examples/woocommerce-extension/README.md +98 -0
  56. package/augment-extensions/examples/woocommerce-extension/examples/product-customizer.md +763 -0
  57. package/augment-extensions/examples/woocommerce-extension/module.json +40 -0
  58. package/augment-extensions/workflows/wordpress-plugin/README.md +232 -0
  59. package/augment-extensions/workflows/wordpress-plugin/ai-prompts.md +839 -0
  60. package/augment-extensions/workflows/wordpress-plugin/bead-decomposition-patterns.md +854 -0
  61. package/augment-extensions/workflows/wordpress-plugin/examples/complete-plugin-example.md +540 -0
  62. package/augment-extensions/workflows/wordpress-plugin/examples/custom-post-type-example.md +1083 -0
  63. package/augment-extensions/workflows/wordpress-plugin/examples/feature-addition-workflow.md +669 -0
  64. package/augment-extensions/workflows/wordpress-plugin/examples/plugin-creation-workflow.md +597 -0
  65. package/augment-extensions/workflows/wordpress-plugin/examples/secure-form-handler-example.md +925 -0
  66. package/augment-extensions/workflows/wordpress-plugin/examples/security-audit-workflow.md +752 -0
  67. package/augment-extensions/workflows/wordpress-plugin/examples/wordpress-org-submission-workflow.md +773 -0
  68. package/augment-extensions/workflows/wordpress-plugin/module.json +49 -0
  69. package/augment-extensions/workflows/wordpress-plugin/rules/best-practices.md +942 -0
  70. package/augment-extensions/workflows/wordpress-plugin/rules/development-workflow.md +702 -0
  71. package/augment-extensions/workflows/wordpress-plugin/rules/submission-workflow.md +728 -0
  72. package/augment-extensions/workflows/wordpress-plugin/rules/testing-workflow.md +775 -0
  73. package/cli/dist/cli.js +5 -1
  74. package/cli/dist/cli.js.map +1 -1
  75. package/cli/dist/commands/show.d.ts.map +1 -1
  76. package/cli/dist/commands/show.js +41 -0
  77. package/cli/dist/commands/show.js.map +1 -1
  78. package/modules.md +52 -0
  79. package/package.json +1 -1
@@ -0,0 +1,463 @@
1
+ # WordPress Plugin Documentation Standards
2
+
3
+ ## Overview
4
+
5
+ This document defines documentation standards for WordPress plugins, covering inline code documentation (PHPDoc), readme.txt for WordPress.org, README.md for GitHub, and user-facing documentation.
6
+
7
+ ---
8
+
9
+ ## PHPDoc Standards
10
+
11
+ ### File Headers
12
+
13
+ Every PHP file must include a file-level DocBlock:
14
+
15
+ ```php
16
+ <?php
17
+ /**
18
+ * Plugin Name: My Plugin
19
+ * Description: Brief description
20
+ * Version: 1.0.0
21
+ * Author: Author Name
22
+ * License: GPL-2.0+
23
+ * Text Domain: my-plugin
24
+ *
25
+ * @package My_Plugin
26
+ * @subpackage My_Plugin/includes
27
+ * @author Author Name <email@example.com>
28
+ * @license GPL-2.0+ http://www.gnu.org/licenses/gpl-2.0.txt
29
+ * @link https://example.com
30
+ * @since 1.0.0
31
+ */
32
+ ```
33
+
34
+ ### Class Documentation
35
+
36
+ ```php
37
+ /**
38
+ * Main plugin class.
39
+ *
40
+ * Handles plugin initialization, loading dependencies, and defining hooks.
41
+ *
42
+ * @since 1.0.0
43
+ * @package My_Plugin
44
+ * @subpackage My_Plugin/includes
45
+ * @author Author Name <email@example.com>
46
+ */
47
+ class My_Plugin {
48
+
49
+ /**
50
+ * The unique identifier of this plugin.
51
+ *
52
+ * @since 1.0.0
53
+ * @access protected
54
+ * @var string $plugin_name The string used to uniquely identify this plugin.
55
+ */
56
+ protected $plugin_name;
57
+
58
+ /**
59
+ * Initialize the plugin.
60
+ *
61
+ * Sets the plugin name and version, loads dependencies, defines locale,
62
+ * and sets up admin and public hooks.
63
+ *
64
+ * @since 1.0.0
65
+ */
66
+ public function __construct() {
67
+ // Constructor code
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### Function Documentation
73
+
74
+ ```php
75
+ /**
76
+ * Retrieve posts with custom meta query.
77
+ *
78
+ * @since 1.0.0
79
+ * @param array $args Query arguments.
80
+ * @param bool $cache Whether to use cached results. Default true.
81
+ * @return array|WP_Error Array of posts or WP_Error on failure.
82
+ */
83
+ function my_plugin_get_posts( $args = array(), $cache = true ) {
84
+ // Function code
85
+ }
86
+ ```
87
+
88
+ ### Hook Documentation
89
+
90
+ ```php
91
+ /**
92
+ * Fires after plugin initialization.
93
+ *
94
+ * @since 1.0.0
95
+ * @param My_Plugin $plugin The main plugin instance.
96
+ */
97
+ do_action( 'my_plugin_initialized', $this );
98
+
99
+ /**
100
+ * Filters the plugin settings before saving.
101
+ *
102
+ * @since 1.0.0
103
+ * @param array $settings The plugin settings array.
104
+ * @param int $user_id The current user ID.
105
+ */
106
+ $settings = apply_filters( 'my_plugin_settings', $settings, get_current_user_id() );
107
+ ```
108
+
109
+ ### Required PHPDoc Tags
110
+
111
+ - `@since` - Version when introduced (required for all)
112
+ - `@param` - Parameter description (required for functions/methods with parameters)
113
+ - `@return` - Return value description (required for functions/methods that return values)
114
+ - `@access` - Access level (public, protected, private) for properties
115
+ - `@var` - Variable type for properties
116
+ - `@package` - Package name
117
+ - `@author` - Author information
118
+ - `@link` - Related URL
119
+ - `@see` - Related function/class
120
+ - `@deprecated` - Deprecation notice with version and alternative
121
+
122
+ ---
123
+
124
+ ## readme.txt (WordPress.org)
125
+
126
+ ### Structure
127
+
128
+ ```
129
+ === Plugin Name ===
130
+ Contributors: username1, username2
131
+ Donate link: https://example.com/donate
132
+ Tags: tag1, tag2, tag3
133
+ Requires at least: 6.0
134
+ Tested up to: 6.4
135
+ Requires PHP: 7.4
136
+ Stable tag: 1.0.0
137
+ License: GPLv2 or later
138
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
139
+
140
+ Short description (max 150 characters).
141
+
142
+ == Description ==
143
+
144
+ Detailed description of the plugin.
145
+
146
+ **Key Features:**
147
+
148
+ * Feature 1
149
+ * Feature 2
150
+ * Feature 3
151
+
152
+ **Use Cases:**
153
+
154
+ * Use case 1
155
+ * Use case 2
156
+
157
+ == Installation ==
158
+
159
+ 1. Upload the plugin files to `/wp-content/plugins/my-plugin`
160
+ 2. Activate the plugin through the 'Plugins' menu
161
+ 3. Configure settings at Settings > My Plugin
162
+
163
+ == Frequently Asked Questions ==
164
+
165
+ = Question 1? =
166
+
167
+ Answer 1.
168
+
169
+ = Question 2? =
170
+
171
+ Answer 2.
172
+
173
+ == Screenshots ==
174
+
175
+ 1. Screenshot 1 description
176
+ 2. Screenshot 2 description
177
+
178
+ == Changelog ==
179
+
180
+ = 1.0.0 =
181
+ * Initial release
182
+
183
+ == Upgrade Notice ==
184
+
185
+ = 1.0.0 =
186
+ Initial release.
187
+ ```
188
+
189
+ ### Best Practices
190
+
191
+ - **Contributors**: Use WordPress.org usernames
192
+ - **Tags**: Maximum 12 tags, use existing popular tags
193
+ - **Tested up to**: Keep updated with latest WordPress version
194
+ - **Short description**: Clear, concise, under 150 characters
195
+ - **Changelog**: Use semantic versioning, list all changes
196
+ - **Screenshots**: Number them, provide clear descriptions
197
+
198
+ ---
199
+
200
+ ## README.md (GitHub/Repository)
201
+
202
+ ### Structure
203
+
204
+ ```markdown
205
+ # Plugin Name
206
+
207
+ Brief description of the plugin.
208
+
209
+ ## Description
210
+
211
+ Detailed description with features and benefits.
212
+
213
+ ## Features
214
+
215
+ - Feature 1
216
+ - Feature 2
217
+ - Feature 3
218
+
219
+ ## Requirements
220
+
221
+ - WordPress 6.0 or higher
222
+ - PHP 7.4 or higher
223
+
224
+ ## Installation
225
+
226
+ ### From WordPress.org
227
+
228
+ 1. Go to Plugins > Add New
229
+ 2. Search for "Plugin Name"
230
+ 3. Click Install Now
231
+ 4. Activate the plugin
232
+
233
+ ### Manual Installation
234
+
235
+ 1. Download the plugin zip file
236
+ 2. Upload to `/wp-content/plugins/`
237
+ 3. Activate through WordPress admin
238
+
239
+ ### From Source
240
+
241
+ ```bash
242
+ git clone https://github.com/username/plugin-name.git
243
+ cd plugin-name
244
+ composer install
245
+ npm install
246
+ npm run build
247
+ ```
248
+
249
+ ## Usage
250
+
251
+ ### Basic Usage
252
+
253
+ ```php
254
+ // Example code
255
+ ```
256
+
257
+ ### Advanced Usage
258
+
259
+ ```php
260
+ // Advanced example
261
+ ```
262
+
263
+ ## Configuration
264
+
265
+ Configure the plugin at **Settings > Plugin Name**.
266
+
267
+ Available options:
268
+ - Option 1: Description
269
+ - Option 2: Description
270
+
271
+ ## Hooks & Filters
272
+
273
+ ### Actions
274
+
275
+ ```php
276
+ // Hook into plugin initialization
277
+ add_action('my_plugin_init', 'my_custom_function');
278
+ ```
279
+
280
+ ### Filters
281
+
282
+ ```php
283
+ // Filter plugin settings
284
+ add_filter('my_plugin_settings', 'my_custom_filter');
285
+ ```
286
+
287
+ ## Development
288
+
289
+ ### Setup
290
+
291
+ ```bash
292
+ composer install
293
+ npm install
294
+ ```
295
+
296
+ ### Build
297
+
298
+ ```bash
299
+ npm run build
300
+ ```
301
+
302
+ ### Testing
303
+
304
+ ```bash
305
+ composer test
306
+ npm test
307
+ ```
308
+
309
+ ## Contributing
310
+
311
+ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md).
312
+
313
+ ## License
314
+
315
+ GPL-2.0+ - See [LICENSE](LICENSE) for details.
316
+
317
+ ## Support
318
+
319
+ - [Documentation](https://example.com/docs)
320
+ - [Support Forum](https://wordpress.org/support/plugin/plugin-name)
321
+ - [Issue Tracker](https://github.com/username/plugin-name/issues)
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Inline Code Comments
327
+
328
+ ### When to Comment
329
+
330
+ **DO comment:**
331
+ - Complex algorithms or business logic
332
+ - Non-obvious code behavior
333
+ - Workarounds for WordPress/PHP quirks
334
+ - Security-sensitive code
335
+ - Performance optimizations
336
+
337
+ **DON'T comment:**
338
+ - Obvious code (e.g., `// Set variable`)
339
+ - Self-explanatory function names
340
+ - Code that can be refactored to be clearer
341
+
342
+ ### Comment Style
343
+
344
+ ```php
345
+ // Single-line comment for brief explanations
346
+
347
+ /*
348
+ * Multi-line comment for longer explanations
349
+ * that span multiple lines.
350
+ */
351
+
352
+ /**
353
+ * DocBlock comment for functions, classes, and methods.
354
+ * Always use DocBlocks for public APIs.
355
+ */
356
+ ```
357
+
358
+ ---
359
+
360
+ ## User Documentation
361
+
362
+ ### Admin Help Tabs
363
+
364
+ ```php
365
+ add_action('admin_head', 'my_plugin_add_help_tabs');
366
+
367
+ function my_plugin_add_help_tabs() {
368
+ $screen = get_current_screen();
369
+
370
+ $screen->add_help_tab(array(
371
+ 'id' => 'my_plugin_overview',
372
+ 'title' => __('Overview', 'my-plugin'),
373
+ 'content' => '<p>' . __('Help content here.', 'my-plugin') . '</p>',
374
+ ));
375
+
376
+ $screen->set_help_sidebar(
377
+ '<p><strong>' . __('For more information:', 'my-plugin') . '</strong></p>' .
378
+ '<p><a href="https://example.com/docs">' . __('Documentation', 'my-plugin') . '</a></p>'
379
+ );
380
+ }
381
+ ```
382
+
383
+ ### Contextual Help
384
+
385
+ Provide help text near complex settings:
386
+
387
+ ```php
388
+ <p class="description">
389
+ <?php _e('This setting controls...', 'my-plugin'); ?>
390
+ </p>
391
+ ```
392
+
393
+ ---
394
+
395
+ ## Changelog Management
396
+
397
+ ### Format
398
+
399
+ Use [Keep a Changelog](https://keepachangelog.com/) format:
400
+
401
+ ```markdown
402
+ # Changelog
403
+
404
+ All notable changes to this project will be documented in this file.
405
+
406
+ ## [Unreleased]
407
+
408
+ ### Added
409
+ - New feature description
410
+
411
+ ### Changed
412
+ - Changed feature description
413
+
414
+ ### Deprecated
415
+ - Deprecated feature description
416
+
417
+ ### Removed
418
+ - Removed feature description
419
+
420
+ ### Fixed
421
+ - Bug fix description
422
+
423
+ ### Security
424
+ - Security fix description
425
+
426
+ ## [1.0.0] - 2024-01-15
427
+
428
+ ### Added
429
+ - Initial release
430
+ ```
431
+
432
+ ### Version Numbering
433
+
434
+ Follow [Semantic Versioning](https://semver.org/):
435
+
436
+ - **MAJOR** (1.0.0 → 2.0.0): Breaking changes
437
+ - **MINOR** (1.0.0 → 1.1.0): New features, backward compatible
438
+ - **PATCH** (1.0.0 → 1.0.1): Bug fixes, backward compatible
439
+
440
+ ---
441
+
442
+ ## Best Practices
443
+
444
+ ### Documentation Checklist
445
+
446
+ - [ ] All public functions have PHPDoc comments
447
+ - [ ] All classes have PHPDoc comments
448
+ - [ ] All hooks (actions/filters) are documented
449
+ - [ ] readme.txt is complete and up-to-date
450
+ - [ ] README.md includes installation and usage instructions
451
+ - [ ] Changelog is updated for each release
452
+ - [ ] Code comments explain "why", not "what"
453
+ - [ ] Admin help tabs provide contextual assistance
454
+ - [ ] All user-facing strings are translatable
455
+
456
+ ### Maintenance
457
+
458
+ - Update `Tested up to` with each WordPress release
459
+ - Keep changelog current with each version
460
+ - Review and update documentation quarterly
461
+ - Remove outdated screenshots and examples
462
+ - Update code examples to use current best practices
463
+