build-cli-plugin

Solid

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.

Web & Frontend 26 stars 4 forks Updated today MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
48
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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...

Details

Author
pjt222
Repository
pjt222/agent-almanac
Created
1 years ago
Last Updated
today
Language
R
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category