@mytechtoday/augment-extensions 0.1.2 → 0.4.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.
- package/README.md +614 -39
- package/augment-extensions/coding-standards/bash/README.md +196 -0
- package/augment-extensions/coding-standards/bash/module.json +163 -0
- package/augment-extensions/coding-standards/bash/rules/naming-conventions.md +336 -0
- package/augment-extensions/coding-standards/bash/rules/universal-standards.md +289 -0
- package/augment-extensions/coding-standards/css/README.md +40 -0
- package/augment-extensions/coding-standards/css/examples/css-examples.css +550 -0
- package/augment-extensions/coding-standards/css/module.json +44 -0
- package/augment-extensions/coding-standards/css/rules/css-modern-features.md +448 -0
- package/augment-extensions/coding-standards/css/rules/css-standards.md +492 -0
- package/augment-extensions/coding-standards/html/README.md +40 -0
- package/augment-extensions/coding-standards/html/examples/html-examples.html +267 -0
- package/augment-extensions/coding-standards/html/examples/responsive-layout.html +505 -0
- package/augment-extensions/coding-standards/html/module.json +44 -0
- package/augment-extensions/coding-standards/html/rules/html-standards.md +349 -0
- package/augment-extensions/coding-standards/html-css-js/README.md +194 -0
- package/augment-extensions/coding-standards/html-css-js/examples/async-examples.js +487 -0
- package/augment-extensions/coding-standards/html-css-js/examples/css-examples.css +550 -0
- package/augment-extensions/coding-standards/html-css-js/examples/dom-examples.js +667 -0
- package/augment-extensions/coding-standards/html-css-js/examples/html-examples.html +267 -0
- package/augment-extensions/coding-standards/html-css-js/examples/javascript-examples.js +612 -0
- package/augment-extensions/coding-standards/html-css-js/examples/responsive-layout.html +505 -0
- package/augment-extensions/coding-standards/html-css-js/module.json +48 -0
- package/augment-extensions/coding-standards/html-css-js/rules/async-patterns.md +515 -0
- package/augment-extensions/coding-standards/html-css-js/rules/css-modern-features.md +448 -0
- package/augment-extensions/coding-standards/html-css-js/rules/css-standards.md +492 -0
- package/augment-extensions/coding-standards/html-css-js/rules/dom-manipulation.md +439 -0
- package/augment-extensions/coding-standards/html-css-js/rules/html-standards.md +349 -0
- package/augment-extensions/coding-standards/html-css-js/rules/javascript-standards.md +486 -0
- package/augment-extensions/coding-standards/html-css-js/rules/performance.md +463 -0
- package/augment-extensions/coding-standards/html-css-js/rules/tooling.md +543 -0
- package/augment-extensions/coding-standards/js/README.md +46 -0
- package/augment-extensions/coding-standards/js/examples/async-examples.js +487 -0
- package/augment-extensions/coding-standards/js/examples/dom-examples.js +667 -0
- package/augment-extensions/coding-standards/js/examples/javascript-examples.js +612 -0
- package/augment-extensions/coding-standards/js/module.json +49 -0
- package/augment-extensions/coding-standards/js/rules/async-patterns.md +515 -0
- package/augment-extensions/coding-standards/js/rules/dom-manipulation.md +439 -0
- package/augment-extensions/coding-standards/js/rules/javascript-standards.md +486 -0
- package/augment-extensions/coding-standards/js/rules/performance.md +463 -0
- package/augment-extensions/coding-standards/js/rules/tooling.md +543 -0
- package/augment-extensions/coding-standards/php/README.md +248 -0
- package/augment-extensions/coding-standards/php/examples/api-endpoint-example.php +204 -0
- package/augment-extensions/coding-standards/php/examples/cli-command-example.php +206 -0
- package/augment-extensions/coding-standards/php/examples/legacy-refactoring-example.php +234 -0
- package/augment-extensions/coding-standards/php/examples/web-application-example.php +211 -0
- package/augment-extensions/coding-standards/php/examples/woocommerce-extension-example.php +215 -0
- package/augment-extensions/coding-standards/php/examples/wordpress-plugin-example.php +189 -0
- package/augment-extensions/coding-standards/php/module.json +166 -0
- package/augment-extensions/coding-standards/php/rules/api-development.md +480 -0
- package/augment-extensions/coding-standards/php/rules/category-configuration.md +332 -0
- package/augment-extensions/coding-standards/php/rules/cli-tools.md +472 -0
- package/augment-extensions/coding-standards/php/rules/cms-integration.md +561 -0
- package/augment-extensions/coding-standards/php/rules/code-quality.md +402 -0
- package/augment-extensions/coding-standards/php/rules/documentation.md +425 -0
- package/augment-extensions/coding-standards/php/rules/ecommerce.md +627 -0
- package/augment-extensions/coding-standards/php/rules/error-handling.md +336 -0
- package/augment-extensions/coding-standards/php/rules/legacy-migration.md +677 -0
- package/augment-extensions/coding-standards/php/rules/naming-conventions.md +279 -0
- package/augment-extensions/coding-standards/php/rules/performance.md +392 -0
- package/augment-extensions/coding-standards/php/rules/psr-standards.md +186 -0
- package/augment-extensions/coding-standards/php/rules/security.md +358 -0
- package/augment-extensions/coding-standards/php/rules/testing.md +403 -0
- package/augment-extensions/coding-standards/php/rules/type-declarations.md +331 -0
- package/augment-extensions/coding-standards/php/rules/web-applications.md +426 -0
- package/augment-extensions/coding-standards/powershell/README.md +154 -0
- package/augment-extensions/coding-standards/powershell/examples/admin-example.ps1 +272 -0
- package/augment-extensions/coding-standards/powershell/examples/automation-example.ps1 +173 -0
- package/augment-extensions/coding-standards/powershell/examples/cloud-example.ps1 +243 -0
- package/augment-extensions/coding-standards/powershell/examples/cross-platform-example.ps1 +297 -0
- package/augment-extensions/coding-standards/powershell/examples/dsc-example.ps1 +224 -0
- package/augment-extensions/coding-standards/powershell/examples/legacy-migration-example.ps1 +340 -0
- package/augment-extensions/coding-standards/powershell/examples/module-example.psm1 +255 -0
- package/augment-extensions/coding-standards/powershell/module.json +165 -0
- package/augment-extensions/coding-standards/powershell/rules/administrative-tools.md +439 -0
- package/augment-extensions/coding-standards/powershell/rules/automation-scripts.md +240 -0
- package/augment-extensions/coding-standards/powershell/rules/cloud-orchestration.md +384 -0
- package/augment-extensions/coding-standards/powershell/rules/configuration-schema.md +383 -0
- package/augment-extensions/coding-standards/powershell/rules/cross-platform-scripts.md +482 -0
- package/augment-extensions/coding-standards/powershell/rules/dsc-configurations.md +296 -0
- package/augment-extensions/coding-standards/powershell/rules/error-handling.md +314 -0
- package/augment-extensions/coding-standards/powershell/rules/legacy-migrations.md +466 -0
- package/augment-extensions/coding-standards/powershell/rules/modules-functions.md +244 -0
- package/augment-extensions/coding-standards/powershell/rules/naming-conventions.md +266 -0
- package/augment-extensions/coding-standards/powershell/rules/performance-optimization.md +209 -0
- package/augment-extensions/coding-standards/powershell/rules/security-practices.md +314 -0
- package/augment-extensions/coding-standards/powershell/rules/testing-guidelines.md +268 -0
- package/augment-extensions/coding-standards/powershell/rules/universal-standards.md +197 -0
- package/augment-extensions/coding-standards/python/README.md +12 -8
- package/augment-extensions/coding-standards/python/examples/best-practices.py +373 -0
- package/augment-extensions/coding-standards/python/module.json +8 -4
- package/augment-extensions/coding-standards/python/rules/async-patterns.md +884 -0
- package/augment-extensions/coding-standards/python/rules/documentation.md +831 -0
- package/augment-extensions/coding-standards/python/rules/error-handling.md +855 -68
- package/augment-extensions/coding-standards/python/rules/testing.md +409 -0
- package/augment-extensions/coding-standards/python/rules/tooling.md +446 -0
- package/augment-extensions/coding-standards/python/rules/type-hints.md +115 -50
- package/augment-extensions/collections/html-css-js/README.md +82 -0
- package/augment-extensions/collections/html-css-js/collection.json +41 -0
- package/augment-extensions/domain-rules/database/README.md +161 -0
- package/augment-extensions/domain-rules/database/examples/flat-database-example.md +793 -0
- package/augment-extensions/domain-rules/database/examples/hybrid-database-example.md +1132 -0
- package/augment-extensions/domain-rules/database/examples/nosql-document-example.md +868 -0
- package/augment-extensions/domain-rules/database/examples/nosql-graph-example.md +805 -0
- package/augment-extensions/domain-rules/database/examples/relational-schema-example.md +621 -0
- package/augment-extensions/domain-rules/database/examples/vector-database-example.md +965 -0
- package/augment-extensions/domain-rules/database/module.json +28 -0
- package/augment-extensions/domain-rules/database/rules/flat-databases.md +624 -0
- package/augment-extensions/domain-rules/database/rules/nosql-databases.md +588 -0
- package/augment-extensions/domain-rules/database/rules/nosql-document-stores.md +856 -0
- package/augment-extensions/domain-rules/database/rules/nosql-graph-databases.md +778 -0
- package/augment-extensions/domain-rules/database/rules/nosql-key-value-stores.md +963 -0
- package/augment-extensions/domain-rules/database/rules/performance-optimization.md +1076 -0
- package/augment-extensions/domain-rules/database/rules/relational-databases.md +697 -0
- package/augment-extensions/domain-rules/database/rules/relational-indexing.md +671 -0
- package/augment-extensions/domain-rules/database/rules/relational-query-optimization.md +607 -0
- package/augment-extensions/domain-rules/database/rules/relational-schema-design.md +907 -0
- package/augment-extensions/domain-rules/database/rules/relational-transactions.md +783 -0
- package/augment-extensions/domain-rules/database/rules/security-standards.md +980 -0
- package/augment-extensions/domain-rules/database/rules/universal-best-practices.md +485 -0
- package/augment-extensions/domain-rules/database/rules/vector-databases.md +521 -0
- package/augment-extensions/domain-rules/database/rules/vector-embeddings.md +858 -0
- package/augment-extensions/domain-rules/database/rules/vector-indexing.md +934 -0
- package/augment-extensions/domain-rules/mcp/README.md +150 -0
- package/augment-extensions/domain-rules/mcp/examples/compressed-example.md +522 -0
- package/augment-extensions/domain-rules/mcp/examples/graph-augmented-example.md +520 -0
- package/augment-extensions/domain-rules/mcp/examples/hybrid-example.md +570 -0
- package/augment-extensions/domain-rules/mcp/examples/state-based-example.md +427 -0
- package/augment-extensions/domain-rules/mcp/examples/token-based-example.md +435 -0
- package/augment-extensions/domain-rules/mcp/examples/vector-based-example.md +502 -0
- package/augment-extensions/domain-rules/mcp/module.json +49 -0
- package/augment-extensions/domain-rules/mcp/rules/compressed-mcp.md +595 -0
- package/augment-extensions/domain-rules/mcp/rules/configuration.md +345 -0
- package/augment-extensions/domain-rules/mcp/rules/graph-augmented-mcp.md +687 -0
- package/augment-extensions/domain-rules/mcp/rules/hybrid-mcp.md +636 -0
- package/augment-extensions/domain-rules/mcp/rules/state-based-mcp.md +484 -0
- package/augment-extensions/domain-rules/mcp/rules/testing-validation.md +360 -0
- package/augment-extensions/domain-rules/mcp/rules/token-based-mcp.md +393 -0
- package/augment-extensions/domain-rules/mcp/rules/universal-rules.md +194 -0
- package/augment-extensions/domain-rules/mcp/rules/vector-based-mcp.md +625 -0
- package/augment-extensions/domain-rules/wordpress/README.md +163 -0
- package/augment-extensions/domain-rules/wordpress/module.json +32 -0
- package/augment-extensions/domain-rules/wordpress/rules/coding-standards.md +617 -0
- package/augment-extensions/domain-rules/wordpress/rules/directory-structure.md +270 -0
- package/augment-extensions/domain-rules/wordpress/rules/file-patterns.md +423 -0
- package/augment-extensions/domain-rules/wordpress/rules/gutenberg-blocks.md +493 -0
- package/augment-extensions/domain-rules/wordpress/rules/performance.md +568 -0
- package/augment-extensions/domain-rules/wordpress/rules/plugin-development.md +510 -0
- package/augment-extensions/domain-rules/wordpress/rules/project-detection.md +251 -0
- package/augment-extensions/domain-rules/wordpress/rules/rest-api.md +501 -0
- package/augment-extensions/domain-rules/wordpress/rules/security.md +564 -0
- package/augment-extensions/domain-rules/wordpress/rules/theme-development.md +388 -0
- package/augment-extensions/domain-rules/wordpress/rules/woocommerce.md +441 -0
- package/augment-extensions/domain-rules/wordpress-plugin/README.md +139 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/ajax-plugin.md +1599 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/custom-post-type-plugin.md +1727 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/gutenberg-block-plugin.md +428 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/gutenberg-block.md +422 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/mvc-plugin.md +1623 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/object-oriented-plugin.md +1343 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/rest-endpoint.md +734 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/settings-page-plugin.md +1350 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/simple-procedural-plugin.md +503 -0
- package/augment-extensions/domain-rules/wordpress-plugin/examples/singleton-plugin.md +971 -0
- package/augment-extensions/domain-rules/wordpress-plugin/module.json +53 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/activation-hooks.md +770 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/admin-interface.md +874 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/ajax-handlers.md +629 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/asset-management.md +559 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/context-providers.md +709 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/cron-jobs.md +736 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/database-management.md +1057 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/documentation-standards.md +463 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/frontend-functionality.md +478 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/gutenberg-blocks.md +818 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/internationalization.md +416 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/migration.md +667 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/performance-optimization.md +878 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/plugin-architecture.md +693 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/plugin-structure.md +352 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/rest-api.md +818 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/scaffolding-workflow.md +624 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/security-best-practices.md +866 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/testing-patterns.md +1165 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/testing.md +414 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/vscode-integration.md +751 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/woocommerce-integration.md +949 -0
- package/augment-extensions/domain-rules/wordpress-plugin/rules/wordpress-org-submission.md +458 -0
- package/augment-extensions/examples/gutenberg-block-plugin/README.md +101 -0
- package/augment-extensions/examples/gutenberg-block-plugin/examples/testimonial-block.md +428 -0
- package/augment-extensions/examples/gutenberg-block-plugin/module.json +40 -0
- package/augment-extensions/examples/rest-api-plugin/README.md +98 -0
- package/augment-extensions/examples/rest-api-plugin/examples/task-manager-api.md +1299 -0
- package/augment-extensions/examples/rest-api-plugin/module.json +40 -0
- package/augment-extensions/examples/woocommerce-extension/README.md +98 -0
- package/augment-extensions/examples/woocommerce-extension/examples/product-customizer.md +763 -0
- package/augment-extensions/examples/woocommerce-extension/module.json +40 -0
- package/augment-extensions/workflows/beads/module.json +4 -3
- package/augment-extensions/workflows/database/README.md +195 -0
- package/augment-extensions/workflows/database/ai-prompt-testing.md +295 -0
- package/augment-extensions/workflows/database/examples/migration-example.md +498 -0
- package/augment-extensions/workflows/database/examples/optimization-example.md +496 -0
- package/augment-extensions/workflows/database/examples/schema-design-example.md +444 -0
- package/augment-extensions/workflows/database/module.json +42 -0
- package/augment-extensions/workflows/database/rules/data-migration.md +249 -0
- package/augment-extensions/workflows/database/rules/documentation-standards.md +339 -0
- package/augment-extensions/workflows/database/rules/migration-workflow.md +352 -0
- package/augment-extensions/workflows/database/rules/optimization-workflow.md +435 -0
- package/augment-extensions/workflows/database/rules/schema-design-workflow.md +535 -0
- package/augment-extensions/workflows/database/rules/testing-patterns.md +305 -0
- package/augment-extensions/workflows/database/rules/workflow.md +458 -0
- package/augment-extensions/workflows/openspec/module.json +4 -3
- package/augment-extensions/workflows/wordpress-plugin/README.md +232 -0
- package/augment-extensions/workflows/wordpress-plugin/ai-prompts.md +839 -0
- package/augment-extensions/workflows/wordpress-plugin/bead-decomposition-patterns.md +854 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/complete-plugin-example.md +540 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/custom-post-type-example.md +1083 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/feature-addition-workflow.md +669 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/plugin-creation-workflow.md +597 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/secure-form-handler-example.md +925 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/security-audit-workflow.md +752 -0
- package/augment-extensions/workflows/wordpress-plugin/examples/wordpress-org-submission-workflow.md +773 -0
- package/augment-extensions/workflows/wordpress-plugin/module.json +49 -0
- package/augment-extensions/workflows/wordpress-plugin/rules/best-practices.md +942 -0
- package/augment-extensions/workflows/wordpress-plugin/rules/development-workflow.md +702 -0
- package/augment-extensions/workflows/wordpress-plugin/rules/submission-workflow.md +728 -0
- package/augment-extensions/workflows/wordpress-plugin/rules/testing-workflow.md +775 -0
- package/augment-extensions/writing-standards/screenplay/README.md +171 -0
- package/augment-extensions/writing-standards/screenplay/examples/aaa-hollywood-scene.fountain +164 -0
- package/augment-extensions/writing-standards/screenplay/module.json +124 -0
- package/augment-extensions/writing-standards/screenplay/rules/universal-formatting.md +339 -0
- package/cli/MODULES.md +302 -0
- package/cli/dist/cli.js +142 -9
- package/cli/dist/cli.js.map +1 -1
- package/cli/dist/commands/catalog.d.ts +13 -0
- package/cli/dist/commands/catalog.d.ts.map +1 -0
- package/cli/dist/commands/catalog.js +104 -0
- package/cli/dist/commands/catalog.js.map +1 -0
- package/cli/dist/commands/gui.d.ts +6 -0
- package/cli/dist/commands/gui.d.ts.map +1 -0
- package/cli/dist/commands/gui.js +211 -0
- package/cli/dist/commands/gui.js.map +1 -0
- package/cli/dist/commands/init.d.ts.map +1 -1
- package/cli/dist/commands/init.js +12 -0
- package/cli/dist/commands/init.js.map +1 -1
- package/cli/dist/commands/install-rules.d.ts +14 -0
- package/cli/dist/commands/install-rules.d.ts.map +1 -0
- package/cli/dist/commands/install-rules.js +127 -0
- package/cli/dist/commands/install-rules.js.map +1 -0
- package/cli/dist/commands/link.d.ts.map +1 -1
- package/cli/dist/commands/link.js +9 -11
- package/cli/dist/commands/link.js.map +1 -1
- package/cli/dist/commands/list.d.ts.map +1 -1
- package/cli/dist/commands/list.js +11 -28
- package/cli/dist/commands/list.js.map +1 -1
- package/cli/dist/commands/mcp.d.ts +48 -0
- package/cli/dist/commands/mcp.d.ts.map +1 -0
- package/cli/dist/commands/mcp.js +229 -0
- package/cli/dist/commands/mcp.js.map +1 -0
- package/cli/dist/commands/self-remove.d.ts +7 -0
- package/cli/dist/commands/self-remove.d.ts.map +1 -0
- package/cli/dist/commands/self-remove.js +179 -0
- package/cli/dist/commands/self-remove.js.map +1 -0
- package/cli/dist/commands/show.d.ts.map +1 -1
- package/cli/dist/commands/show.js +42 -71
- package/cli/dist/commands/show.js.map +1 -1
- package/cli/dist/commands/skill.d.ts +67 -0
- package/cli/dist/commands/skill.d.ts.map +1 -0
- package/cli/dist/commands/skill.js +513 -0
- package/cli/dist/commands/skill.js.map +1 -0
- package/cli/dist/commands/unlink.d.ts +6 -0
- package/cli/dist/commands/unlink.d.ts.map +1 -0
- package/cli/dist/commands/unlink.js +115 -0
- package/cli/dist/commands/unlink.js.map +1 -0
- package/cli/dist/commands/validate.d.ts +6 -0
- package/cli/dist/commands/validate.d.ts.map +1 -0
- package/cli/dist/commands/validate.js +159 -0
- package/cli/dist/commands/validate.js.map +1 -0
- package/cli/dist/utils/catalog-sync.d.ts +22 -0
- package/cli/dist/utils/catalog-sync.d.ts.map +1 -0
- package/cli/dist/utils/catalog-sync.js +157 -0
- package/cli/dist/utils/catalog-sync.js.map +1 -0
- package/cli/dist/utils/character-count.d.ts +56 -0
- package/cli/dist/utils/character-count.d.ts.map +1 -0
- package/cli/dist/utils/character-count.js +190 -0
- package/cli/dist/utils/character-count.js.map +1 -0
- package/cli/dist/utils/documentation-validator.d.ts +18 -0
- package/cli/dist/utils/documentation-validator.d.ts.map +1 -0
- package/cli/dist/utils/documentation-validator.js +233 -0
- package/cli/dist/utils/documentation-validator.js.map +1 -0
- package/cli/dist/utils/install-rules.d.ts +32 -0
- package/cli/dist/utils/install-rules.d.ts.map +1 -0
- package/cli/dist/utils/install-rules.js +375 -0
- package/cli/dist/utils/install-rules.js.map +1 -0
- package/cli/dist/utils/mcp-integration.d.ts +70 -0
- package/cli/dist/utils/mcp-integration.d.ts.map +1 -0
- package/cli/dist/utils/mcp-integration.js +292 -0
- package/cli/dist/utils/mcp-integration.js.map +1 -0
- package/cli/dist/utils/module-system.d.ts +153 -0
- package/cli/dist/utils/module-system.d.ts.map +1 -0
- package/cli/dist/utils/module-system.js +528 -0
- package/cli/dist/utils/module-system.js.map +1 -0
- package/cli/dist/utils/modules-catalog.d.ts +33 -0
- package/cli/dist/utils/modules-catalog.d.ts.map +1 -0
- package/cli/dist/utils/modules-catalog.js +163 -0
- package/cli/dist/utils/modules-catalog.js.map +1 -0
- package/cli/dist/utils/rule-install-hooks.d.ts +19 -0
- package/cli/dist/utils/rule-install-hooks.d.ts.map +1 -0
- package/cli/dist/utils/rule-install-hooks.js +224 -0
- package/cli/dist/utils/rule-install-hooks.js.map +1 -0
- package/cli/dist/utils/skill-system.d.ts +95 -0
- package/cli/dist/utils/skill-system.d.ts.map +1 -0
- package/cli/dist/utils/skill-system.js +313 -0
- package/cli/dist/utils/skill-system.js.map +1 -0
- package/modules.md +534 -70
- package/package.json +12 -3
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async JavaScript Examples
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates modern async/await patterns, Promise handling,
|
|
5
|
+
* Fetch API usage, error handling, and concurrent operations.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// BASIC ASYNC/AWAIT
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Simple async function that returns a promise
|
|
14
|
+
*/
|
|
15
|
+
async function fetchUserData(userId) {
|
|
16
|
+
// Simulate API delay
|
|
17
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
id: userId,
|
|
21
|
+
name: `User ${userId}`,
|
|
22
|
+
email: `user${userId}@example.com`
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Using async/await with try/catch for error handling
|
|
28
|
+
*/
|
|
29
|
+
async function getUserWithErrorHandling(userId) {
|
|
30
|
+
try {
|
|
31
|
+
const user = await fetchUserData(userId);
|
|
32
|
+
console.log('User fetched:', user);
|
|
33
|
+
return user;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('Error fetching user:', error);
|
|
36
|
+
throw error; // Re-throw if caller needs to handle it
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ============================================================================
|
|
41
|
+
// FETCH API EXAMPLES
|
|
42
|
+
// ============================================================================
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Basic GET request using Fetch API
|
|
46
|
+
*/
|
|
47
|
+
async function fetchUsers() {
|
|
48
|
+
try {
|
|
49
|
+
const response = await fetch('https://api.example.com/users');
|
|
50
|
+
|
|
51
|
+
// Check if response is ok (status 200-299)
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const users = await response.json();
|
|
57
|
+
return users;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error('Failed to fetch users:', error);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* POST request with JSON body
|
|
66
|
+
*/
|
|
67
|
+
async function createUser(userData) {
|
|
68
|
+
try {
|
|
69
|
+
const response = await fetch('https://api.example.com/users', {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: {
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
'Authorization': 'Bearer YOUR_TOKEN_HERE'
|
|
74
|
+
},
|
|
75
|
+
body: JSON.stringify(userData)
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (!response.ok) {
|
|
79
|
+
const errorData = await response.json();
|
|
80
|
+
throw new Error(errorData.message || 'Failed to create user');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const newUser = await response.json();
|
|
84
|
+
return newUser;
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.error('Error creating user:', error);
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* PUT request to update a resource
|
|
93
|
+
*/
|
|
94
|
+
async function updateUser(userId, updates) {
|
|
95
|
+
const response = await fetch(`https://api.example.com/users/${userId}`, {
|
|
96
|
+
method: 'PUT',
|
|
97
|
+
headers: {
|
|
98
|
+
'Content-Type': 'application/json'
|
|
99
|
+
},
|
|
100
|
+
body: JSON.stringify(updates)
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw new Error(`Failed to update user ${userId}`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return response.json();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* DELETE request
|
|
112
|
+
*/
|
|
113
|
+
async function deleteUser(userId) {
|
|
114
|
+
const response = await fetch(`https://api.example.com/users/${userId}`, {
|
|
115
|
+
method: 'DELETE'
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (!response.ok) {
|
|
119
|
+
throw new Error(`Failed to delete user ${userId}`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ============================================================================
|
|
126
|
+
// CONCURRENT OPERATIONS
|
|
127
|
+
// ============================================================================
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Fetch multiple users concurrently using Promise.all
|
|
131
|
+
* All requests run in parallel
|
|
132
|
+
*/
|
|
133
|
+
async function fetchMultipleUsers(userIds) {
|
|
134
|
+
try {
|
|
135
|
+
const promises = userIds.map(id => fetchUserData(id));
|
|
136
|
+
const users = await Promise.all(promises);
|
|
137
|
+
return users;
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error('Error fetching multiple users:', error);
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Promise.allSettled - Get results even if some promises fail
|
|
146
|
+
* Returns array of {status, value/reason} objects
|
|
147
|
+
*/
|
|
148
|
+
async function fetchUsersWithPartialFailure(userIds) {
|
|
149
|
+
const promises = userIds.map(id => fetchUserData(id));
|
|
150
|
+
const results = await Promise.allSettled(promises);
|
|
151
|
+
|
|
152
|
+
const successful = results
|
|
153
|
+
.filter(result => result.status === 'fulfilled')
|
|
154
|
+
.map(result => result.value);
|
|
155
|
+
|
|
156
|
+
const failed = results
|
|
157
|
+
.filter(result => result.status === 'rejected')
|
|
158
|
+
.map(result => result.reason);
|
|
159
|
+
|
|
160
|
+
return { successful, failed };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Promise.race - Return first promise to resolve
|
|
165
|
+
* Useful for timeouts
|
|
166
|
+
*/
|
|
167
|
+
async function fetchWithTimeout(url, timeoutMs = 5000) {
|
|
168
|
+
const fetchPromise = fetch(url);
|
|
169
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
170
|
+
setTimeout(() => reject(new Error('Request timeout')), timeoutMs);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
return Promise.race([fetchPromise, timeoutPromise]);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Promise.any - Return first promise to fulfill (ignore rejections)
|
|
178
|
+
* Useful for trying multiple sources
|
|
179
|
+
*/
|
|
180
|
+
async function fetchFromMultipleSources(urls) {
|
|
181
|
+
const promises = urls.map(url => fetch(url));
|
|
182
|
+
|
|
183
|
+
try {
|
|
184
|
+
const firstResponse = await Promise.any(promises);
|
|
185
|
+
return firstResponse.json();
|
|
186
|
+
} catch (error) {
|
|
187
|
+
// All promises rejected
|
|
188
|
+
throw new Error('All sources failed');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ============================================================================
|
|
193
|
+
// SEQUENTIAL VS PARALLEL EXECUTION
|
|
194
|
+
// ============================================================================
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Sequential execution - one after another
|
|
198
|
+
* Use when operations depend on each other
|
|
199
|
+
*/
|
|
200
|
+
async function processUsersSequentially(userIds) {
|
|
201
|
+
const results = [];
|
|
202
|
+
|
|
203
|
+
for (const userId of userIds) {
|
|
204
|
+
const user = await fetchUserData(userId);
|
|
205
|
+
results.push(user);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return results;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Parallel execution - all at once
|
|
213
|
+
* Use when operations are independent
|
|
214
|
+
*/
|
|
215
|
+
async function processUsersInParallel(userIds) {
|
|
216
|
+
const promises = userIds.map(userId => fetchUserData(userId));
|
|
217
|
+
return Promise.all(promises);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Controlled concurrency - limit number of parallel operations
|
|
222
|
+
*/
|
|
223
|
+
async function fetchWithConcurrencyLimit(userIds, limit = 3) {
|
|
224
|
+
const results = [];
|
|
225
|
+
|
|
226
|
+
for (let i = 0; i < userIds.length; i += limit) {
|
|
227
|
+
const batch = userIds.slice(i, i + limit);
|
|
228
|
+
const batchResults = await Promise.all(
|
|
229
|
+
batch.map(id => fetchUserData(id))
|
|
230
|
+
);
|
|
231
|
+
results.push(...batchResults);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return results;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ============================================================================
|
|
238
|
+
// ERROR HANDLING PATTERNS
|
|
239
|
+
// ============================================================================
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Retry logic with exponential backoff
|
|
243
|
+
*/
|
|
244
|
+
async function fetchWithRetry(url, maxRetries = 3) {
|
|
245
|
+
let lastError;
|
|
246
|
+
|
|
247
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
248
|
+
try {
|
|
249
|
+
const response = await fetch(url);
|
|
250
|
+
if (!response.ok) {
|
|
251
|
+
throw new Error(`HTTP ${response.status}`);
|
|
252
|
+
}
|
|
253
|
+
return response.json();
|
|
254
|
+
} catch (error) {
|
|
255
|
+
lastError = error;
|
|
256
|
+
|
|
257
|
+
if (attempt < maxRetries - 1) {
|
|
258
|
+
// Exponential backoff: 1s, 2s, 4s
|
|
259
|
+
const delay = Math.pow(2, attempt) * 1000;
|
|
260
|
+
console.log(`Retry attempt ${attempt + 1} after ${delay}ms`);
|
|
261
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
throw new Error(`Failed after ${maxRetries} attempts: ${lastError.message}`);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Graceful degradation - return default value on error
|
|
271
|
+
*/
|
|
272
|
+
async function fetchUserOrDefault(userId) {
|
|
273
|
+
try {
|
|
274
|
+
return await fetchUserData(userId);
|
|
275
|
+
} catch (error) {
|
|
276
|
+
console.warn(`Failed to fetch user ${userId}, using default`);
|
|
277
|
+
return {
|
|
278
|
+
id: userId,
|
|
279
|
+
name: 'Unknown User',
|
|
280
|
+
email: 'unknown@example.com'
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Error aggregation - collect all errors
|
|
287
|
+
*/
|
|
288
|
+
async function fetchAllUsersWithErrors(userIds) {
|
|
289
|
+
const results = await Promise.allSettled(
|
|
290
|
+
userIds.map(id => fetchUserData(id))
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
const users = [];
|
|
294
|
+
const errors = [];
|
|
295
|
+
|
|
296
|
+
results.forEach((result, index) => {
|
|
297
|
+
if (result.status === 'fulfilled') {
|
|
298
|
+
users.push(result.value);
|
|
299
|
+
} else {
|
|
300
|
+
errors.push({
|
|
301
|
+
userId: userIds[index],
|
|
302
|
+
error: result.reason
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
if (errors.length > 0) {
|
|
308
|
+
console.error('Some users failed to fetch:', errors);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return { users, errors };
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// ============================================================================
|
|
315
|
+
// ASYNC ITERATION
|
|
316
|
+
// ============================================================================
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Async generator function
|
|
320
|
+
*/
|
|
321
|
+
async function* fetchUsersInBatches(userIds, batchSize = 10) {
|
|
322
|
+
for (let i = 0; i < userIds.length; i += batchSize) {
|
|
323
|
+
const batch = userIds.slice(i, i + batchSize);
|
|
324
|
+
const users = await Promise.all(
|
|
325
|
+
batch.map(id => fetchUserData(id))
|
|
326
|
+
);
|
|
327
|
+
yield users;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Using async iteration with for-await-of
|
|
333
|
+
*/
|
|
334
|
+
async function processUserBatches(userIds) {
|
|
335
|
+
for await (const batch of fetchUsersInBatches(userIds, 5)) {
|
|
336
|
+
console.log(`Processing batch of ${batch.length} users`);
|
|
337
|
+
// Process batch
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// ============================================================================
|
|
342
|
+
// REAL-WORLD PATTERNS
|
|
343
|
+
// ============================================================================
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Fetch with caching
|
|
347
|
+
*/
|
|
348
|
+
class APIClient {
|
|
349
|
+
constructor() {
|
|
350
|
+
this.cache = new Map();
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
async fetchUser(userId, useCache = true) {
|
|
354
|
+
const cacheKey = `user:${userId}`;
|
|
355
|
+
|
|
356
|
+
if (useCache && this.cache.has(cacheKey)) {
|
|
357
|
+
console.log('Returning cached user');
|
|
358
|
+
return this.cache.get(cacheKey);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const user = await fetchUserData(userId);
|
|
362
|
+
this.cache.set(cacheKey, user);
|
|
363
|
+
return user;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
clearCache() {
|
|
367
|
+
this.cache.clear();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Debounced async function (useful for search)
|
|
373
|
+
*/
|
|
374
|
+
function debounceAsync(fn, delay = 300) {
|
|
375
|
+
let timeoutId;
|
|
376
|
+
|
|
377
|
+
return function(...args) {
|
|
378
|
+
clearTimeout(timeoutId);
|
|
379
|
+
|
|
380
|
+
return new Promise((resolve, reject) => {
|
|
381
|
+
timeoutId = setTimeout(async () => {
|
|
382
|
+
try {
|
|
383
|
+
const result = await fn.apply(this, args);
|
|
384
|
+
resolve(result);
|
|
385
|
+
} catch (error) {
|
|
386
|
+
reject(error);
|
|
387
|
+
}
|
|
388
|
+
}, delay);
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// Usage example
|
|
394
|
+
const debouncedSearch = debounceAsync(async (query) => {
|
|
395
|
+
const response = await fetch(`https://api.example.com/search?q=${query}`);
|
|
396
|
+
return response.json();
|
|
397
|
+
}, 300);
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Polling pattern - repeatedly check for updates
|
|
401
|
+
*/
|
|
402
|
+
async function pollForStatus(taskId, interval = 1000, maxAttempts = 30) {
|
|
403
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
404
|
+
const response = await fetch(`https://api.example.com/tasks/${taskId}`);
|
|
405
|
+
const task = await response.json();
|
|
406
|
+
|
|
407
|
+
if (task.status === 'completed') {
|
|
408
|
+
return task;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (task.status === 'failed') {
|
|
412
|
+
throw new Error('Task failed');
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Wait before next poll
|
|
416
|
+
await new Promise(resolve => setTimeout(resolve, interval));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
throw new Error('Polling timeout');
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Batch requests to avoid rate limiting
|
|
424
|
+
*/
|
|
425
|
+
async function batchedFetch(items, batchSize = 5, delayMs = 1000) {
|
|
426
|
+
const results = [];
|
|
427
|
+
|
|
428
|
+
for (let i = 0; i < items.length; i += batchSize) {
|
|
429
|
+
const batch = items.slice(i, i + batchSize);
|
|
430
|
+
|
|
431
|
+
const batchResults = await Promise.all(
|
|
432
|
+
batch.map(item => fetch(item.url).then(r => r.json()))
|
|
433
|
+
);
|
|
434
|
+
|
|
435
|
+
results.push(...batchResults);
|
|
436
|
+
|
|
437
|
+
// Delay between batches (except for last batch)
|
|
438
|
+
if (i + batchSize < items.length) {
|
|
439
|
+
await new Promise(resolve => setTimeout(resolve, delayMs));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return results;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// ============================================================================
|
|
447
|
+
// USAGE EXAMPLES
|
|
448
|
+
// ============================================================================
|
|
449
|
+
|
|
450
|
+
async function demonstrateAsyncPatterns() {
|
|
451
|
+
console.log('=== Async/Await Examples ===');
|
|
452
|
+
|
|
453
|
+
// Basic async/await
|
|
454
|
+
const user = await fetchUserData(1);
|
|
455
|
+
console.log('Single user:', user);
|
|
456
|
+
|
|
457
|
+
// Parallel fetching
|
|
458
|
+
const users = await fetchMultipleUsers([1, 2, 3, 4, 5]);
|
|
459
|
+
console.log('Multiple users:', users);
|
|
460
|
+
|
|
461
|
+
// Fetch with timeout
|
|
462
|
+
try {
|
|
463
|
+
const response = await fetchWithTimeout('https://api.example.com/slow', 3000);
|
|
464
|
+
console.log('Response:', response);
|
|
465
|
+
} catch (error) {
|
|
466
|
+
console.error('Request timed out:', error);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// Retry logic
|
|
470
|
+
try {
|
|
471
|
+
const data = await fetchWithRetry('https://api.example.com/unreliable');
|
|
472
|
+
console.log('Data after retries:', data);
|
|
473
|
+
} catch (error) {
|
|
474
|
+
console.error('All retries failed:', error);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// API client with caching
|
|
478
|
+
const client = new APIClient();
|
|
479
|
+
const cachedUser = await client.fetchUser(1);
|
|
480
|
+
const sameCachedUser = await client.fetchUser(1); // From cache
|
|
481
|
+
|
|
482
|
+
console.log('Async patterns demonstrated successfully!');
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Run examples (uncomment to execute)
|
|
486
|
+
// demonstrateAsyncPatterns().catch(console.error);
|
|
487
|
+
|