← ClaudeAtlas

build-cli-pluginlisted

Build a plugin or adapter for a CLI tool using the abstract base class pattern. Covers defining the contract (static fields, required methods), choosing an installation strategy (symlink, copy, append-to-file), implementing detection, install/uninstall with idempotency, listing, auditing, and registering the plugin. Use when adding support for a new framework to a CLI installer, building a plugin system for any multi-target tool, or extending an existing adapter architecture.
pjt222/agent-almanac · ★ 33 · Web & Frontend · score 81
Install: claude install-skill pjt222/agent-almanac
# Build a CLI Plugin Add a new plugin or adapter to a CLI tool's pluggable architecture using the abstract base class pattern. ## When to Use - Adding support for a new target framework to a CLI installer - Building a plugin system for a multi-target command-line tool - Extending an existing adapter architecture with a new strategy variant - Porting content delivery to a framework that uses a different file layout ## Inputs - **Required**: Framework or target the plugin supports (name, config paths, conventions) - **Required**: Path to the base class or plugin contract - **Required**: Installation strategy: `symlink`, `copy`, `file-per-item`, or `append-to-file` - **Optional**: Content types the plugin handles (e.g., skills only, skills + agents, full support) - **Optional**: Scope support (project-level, global, both) ## Procedure ### Step 1: Define the Contract The base class establishes the interface all plugins must implement: ```javascript export class FrameworkAdapter { static id = 'base'; // Unique identifier static displayName = 'Base'; // Human-readable name static strategy = 'symlink'; // Installation strategy static contentTypes = ['skill']; // What this adapter handles async detect(projectDir) { return false; } getTargetPath(projectDir, scope) { throw new Error('Not implemented'); } async install(item, projectDir, scope, options) { throw new Error('Not implemented'); } async uninstall(item, projectDir, scope, options) { thr