Example plugin provided
Why it matters
A plugin authoring guide without a working example leaves developers with no reference implementation to validate their understanding. ISO 25010 maintainability.analysability requires that the system behavior be understandable; a worked example is the fastest path from zero to a functioning plugin. Without one, developers commonly misconfigure lifecycle methods, miss required manifest fields, or wire hooks incorrectly — producing broken plugins that erode trust in the system, not in their implementation.
Severity rationale
Low because the absence of a working example plugin forces every plugin author to start from first principles, increasing the error rate on first-time implementations and slowing ecosystem growth.
Remediation
Create a minimal but complete example plugin in examples/hello-world-plugin/ or src/plugins/example/. The example must be runnable, not just a stub.
// examples/hello-world-plugin/src/index.ts
export default {
name: 'hello-world',
version: '1.0.0',
async init(context) { context.logger.info('hello-world: initialized'); },
async activate() { context.hooks.on('before:request', (ctx) => {
context.logger.info(`Request to ${ctx.request.url}`);
}); },
async deactivate() {},
async destroy() {}
};
Detection
-
ID:
example-plugin -
Severity:
low -
What to look for: Check for a working example plugin that demonstrates the plugin system's capabilities. Look for:
- An
examples/orexample-plugins/directory with a complete, working plugin - A plugin template or scaffold command (e.g.,
npx create-my-plugin) - A "Hello World" plugin in the documentation with complete source code
- Template repositories or starter kits for plugin development The example must be complete and runnable — a snippet showing just the interface signature doesn't count. It should demonstrate: manifest creation, lifecycle implementation, hook registration, and ideally testing.
- An
-
Pass criteria: Count all example/reference plugins in the codebase. A complete, working example plugin exists — either in the repository, in documentation with full source code, or as a template/scaffold. The example demonstrates the core plugin capabilities: registration, lifecycle, and hook usage.
-
Fail criteria: No example plugin. Plugin authors must start from scratch with only API reference documentation (if that exists). OR an example exists but is outdated, broken, or incomplete (e.g., only shows the manifest, not the implementation).
-
Skip (N/A) when: The plugin system is so new that example plugins haven't been created yet AND the system has fewer than 3 total plugins. Even then, this should be a priority — mark as fail with a note that it should be created.
-
Detail on fail:
"No example plugin exists in the repository. The docs/ directory mentions plugins but provides no working example. A plugin author would need to study the 3 existing plugins' source code to understand how to structure their own." -
Remediation: Create an example plugin in
src/plugins/example/orexamples/hello-world-plugin/:// examples/hello-world-plugin/src/index.ts export default { name: 'hello-world', version: '1.0.0', onInit: () => console.log('Hello from plugin!') }
External references
- iso-25010:2011 · maintainability.analysability — Analysability — a reference example reduces time-to-understand for new plugin authors
Taxons
History
- 2026-04-18·v1.0.0·Initial import from plugin-extension-architecture·automated