adapter-factory

Create CLI and HTTP adapters for integrating AI models into AI Counsel.

Updated Dec 14, 2025
One-click install
npx skills add https://github.com/Raudbjorn/cognitive-construct --skill adapter-factory-raudbjorn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adapter-factory
Source: https://github.com/Raudbjorn/cognitive-construct/tree/main/rhetoric/scripts/ai-counsel/.claude/skills/adapter-factory
Command: npx skills add https://github.com/Raudbjorn/cognitive-construct --skill adapter-factory-raudbjorn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrating new AI models or services into an existing deliberation system can be a complex and error-prone process, requiring deep architectural understanding and careful implementation. This Skill provides a structured guide to streamline that integration.

Core Features & Use Cases

  • CLI & HTTP Adapter Guides: Step-by-step instructions for creating both command-line and HTTP API adapters.
  • Base Class Utilization: Leverage provided base classes (BaseCLIAdapter, BaseHTTPAdapter) to handle common logic like subprocess execution, HTTP requests, and retry mechanisms.
  • Configuration & Schema Updates: Learn how to correctly update system configuration (config.yaml) and data schemas (models/schema.py) to recognize new adapters.
  • Testing Patterns: Includes comprehensive guidance on writing unit, integration, and VCR-based tests to ensure robust and reliable integrations.
  • Use Case: You want to add support for a new, custom fine-tuned local LLM (e.g., running on Ollama) to participate in multi-model debates within AI Counsel. This skill guides you through creating the necessary HTTP adapter and integrating it into the system.

Quick Start

To add a new command-line AI tool, create adapters/your_cli.py and implement the parse_output() method to extract the model's response.

Frequently Asked Questions about adapter-factory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new AI model to an existing deliberation system?

Adding a new AI model involves creating an adapter using the factory pattern. Implement either a CLI adapter by extending `BaseCLIAdapter` and defining `parse_output()`, or an HTTP adapter by extending `BaseHTTPAdapter`, then update `config.yaml` and `models/schema.py` to register the new adapter.

Can I integrate a local LLM like Ollama into a multi-model debate system?

Yes. Create an HTTP adapter for your local LLM, implement request/response parsing, configure environment variables for the endpoint, and register it in the system schema. This enables the local model to participate alongside other AI models in deliberations.

What's the difference between CLI and HTTP adapters for model integration?

CLI adapters wrap command-line tools by executing subprocesses and parsing text output; HTTP adapters call remote or local API endpoints. Choose CLI for locally installed tools and HTTP for network-accessible services or APIs.

Do I need to write tests when integrating a new model adapter?

Yes. The Skill provides testing patterns including unit tests for adapter logic, integration tests for system participation, and VCR-based tests for HTTP interactions to ensure reliable model integration and prevent regressions.

What setup is required before creating a model adapter?

Understand the deliberation system architecture, have access to the target AI model or service, know its input/output format, and be able to modify `config.yaml` and `models/schema.py`. The Skill guides configuration and schema updates needed for adapter recognition.

Can I validate prompt length when integrating a new model?

Yes. The adapter factory supports optional prompt length validation, allowing you to enforce constraints on input size before sending requests to the new model adapter.