universal-command
Define commands once, deploy to CLI, API, and MCP automatically. Use when building new commands/tools for Supernal — ensures consistent interfaces across all surfaces. DO NOT rebuild this pattern — use this package.
Why use this skill?
Learn how to use universal-command to define tools once and deploy them across CLI, API, and MCP layers. Streamline your AI agent development with this unified Supernal framework.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ianderrington/universal-commandWhat This Skill Does
The universal-command package acts as a foundational architecture for building and deploying AI agent tools within the Supernal ecosystem. It solves the fragmentation problem in modern development where the same functional business logic must be rewritten or refactored for different access layers—specifically CLI, API, and MCP (Model Context Protocol). By defining a command structure once using this universal interface, the developer ensures that the input validation, logic handler, and response formatting remain consistent across all distribution channels. This eliminates interface drift and significantly reduces the maintenance overhead for agents and tools.
Installation
To integrate this into your development workflow, use the OpenClaw CLI to install the dependency directly into your skill project:
clawhub install openclaw/skills/skills/ianderrington/universal-command
Alternatively, for standard Node.js projects:
npm install @supernal/universal-command
Use Cases
This skill is essential for platform engineers and developers creating multi-modal AI agents. Primary use cases include:
- Developing unified SDKs where the same command logic drives a terminal-based CLI tool and an MCP server for AI context.
- Building microservices where internal API routes must share validation schemas with external agent tools.
- Maintaining complex backend operations that require consistent authorization and performance characteristics (like cache control) regardless of how the command is invoked.
- Managing large registries of tools that need to be dynamically registered or exposed to LLMs via the Model Context Protocol.
Example Prompts
- "Initialize a new universal command for a user management system that handles creating, listing, and deleting records using the @supernal/universal-command pattern."
- "Refactor my existing API route for generating reports to use the UniversalCommand structure so it can also be triggered via the MCP interface."
- "Set up a CommandRegistry for my CLI tool that automatically maps all defined universal-command handlers to the corresponding CLI subcommands and MCP tool declarations."
Tips & Limitations
- Tip: Always define your input schemas with strict TypeScript types to leverage full autocompletion across your API and CLI implementations.
- Tip: Use the optional
cli,api, andmcpblocks within the configuration object to fine-tune interface-specific behavior like streaming or custom authentication scopes without polluting your core handler logic. - Limitation: This package assumes your environment is Node.js-based. It is not intended for client-side browser logic unless wrapped in a suitable server-side proxy.
- Critical: Never implement custom logic to bridge CLI or API layers if a UniversalCommand can be used; this package is the standardized approach for Supernal compatibility.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ianderrington-universal-command": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution, external-api
Related Skills
apple-notes
Extract and monitor Apple Notes content for workflow integration. Supports bulk extraction, real-time monitoring, and export to various formats.
supernal-interface
Universal AI Interface framework for making applications AI-controllable. Use when adding AI tool decorators, setting up chat adapters, creating AI-callable functions, or integrating CopilotKit.
Si
Skill by ianderrington
clawx
Agent verification via ClawX OAuth system. Use when checking agent verification status, embedding verification widgets, or working with agent identity/trust tiers.
sc
Supernal Coding CLI for development workflows - task management, requirements tracking, testing, git automation, ralph loops, compliance, and documentation. Use for task management (sc task), project health checks, traceability, spec management, or autonomous task execution.