feat: implement robust plugin hook execution pipeline#51
Merged
Conversation
- Add comprehensive plugin system with 32 hook points across CLI lifecycle - Implement PluginSystem class with hookable library for robust hook management - Add plugin discovery, loading, and validation with priority-based execution - Support both local (.polyglot/plugins/) and external (npm packages) plugins - Add CLI commands for plugin management: list, info, enable, disable, configure - Integrate hooks throughout scaffold, dev, admin, and service management - Add comprehensive test coverage (22 test cases) for all plugin functionality - Add detailed documentation with examples and best practices - Fix service controls test race condition for better stability Features: - Plugin discovery in .polyglot/plugins/ directory - Hook execution with rich context data passing - Error handling for malformed plugins and hook failures - Plugin configuration management with JSON persistence - External plugin support via npm packages - Priority-based plugin loading order - Comprehensive CLI interface for plugin operations Hooks available: before:init, after:init, before:service:add, after:service:add, before:dev:start, after:dev:start, before:admin:start, after:admin:start, and 24 additional hook points for complete lifecycle coverage.
kaifcoder
approved these changes
Nov 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features:
Hooks available: before:init, after:init, before:service:add, after:service:add, before:dev:start, after:dev:start, before:admin:start, after:admin:start, and 24 additional hook points for complete lifecycle coverage.
Summary
Explain the change in 1–3 sentences. Reference any related issues (e.g. Closes #123).
Type of Change
Motivation / Context
Why is this change needed? What problem does it solve or what capability does it add?
Approach
Briefly describe how you implemented the change. Note any notable design decisions, trade-offs, or alternatives considered.
CLI Impact
If this alters user-facing CLI behavior:
Generated Output Impact
List any new / modified scaffold files or structural differences (e.g. new template folder, changed Dockerfile pattern, compose changes, new preset behaviors).
Tests
Describe test coverage:
If you ran the smoke scaffold locally, paste the command & confirm success:
Result: ✅ / ❌
Screenshots / Logs (Optional)
Add any helpful output (chalk-styled CLI messages, error reproduction, etc.).
Docs
README.mdif needed.github/copilot-instructions.mdif internal conventions changedChecklist
templates/Open Questions / Follow-ups
List any TODOs or future enhancements not in this PR.
Thanks for contributing! 🎉