karenina-adapter-create

Guides creation of karenina adapters implementing AgentPort, LLMPort, and ParserPort interfaces.

13|3|Updated Jun 27, 2025
One-click install
npx skills add https://github.com/biocypher/karenina --skill karenina-adapter-create-biocypher
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: karenina-adapter-create
Source: https://github.com/biocypher/karenina/tree/main/skills/karenina-adapter-create
Command: npx skills add https://github.com/biocypher/karenina --skill karenina-adapter-create-biocypher

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding support for a new LLM SDK or agentic framework to karenina's verification pipeline requires implementing three port interfaces, registering with the AdapterRegistry, and passing conformance tests, which is error-prone without a structured process. ## Core Features & Use Cases - Five-Phase Lifecycle: Orchestrates context gathering, design, implementation, testing, and review through dedicated phase skills. - Three Distribution Models: Supports manual registration, built-in adapters under karenina/src/karenina/adapters/, and installable plugins via entry points. - Canonical Package Structure: Defines the standard adapter layout including agent.py, llm.py, parser.py, messages.py, trace.py, and registration.py. - Pitfall Prevention: Documents eight systematic bugs found across existing adapters, such as JSON serialization of structured output and MCP session lifetime handling. - Use Case: A developer wants karenina to evaluate agents built on a new SDK; this skill walks them from SDK capability analysis to a tested, registry-integrated adapter package. ## Quick Start Run /karenina-adapter-gather-context with the target SDK name to begin Phase 1 of the adapter creation lifecycle.

Frequently Asked Questions about karenina-adapter-create

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

FAQPage Schema
How do I create a new karenina adapter for an LLM SDK?

Follow the five-phase lifecycle: gather SDK context, produce a design spec, implement the adapter package, run conformance and adapter-specific tests, then review. Start by running /karenina-adapter-gather-context with the SDK name.

What interfaces must a karenina adapter implement?

Each adapter implements three port interfaces: AgentPort, LLMPort, and ParserPort. All three must provide aclose() and a capabilities property returning PortCapabilities, and LLMPort must define astream() and stream_invoke().

How are karenina adapters registered and distributed?

All adapters call AdapterRegistry.register(), differing only in how registration is imported: manually in user code, via _load_builtins() for built-in adapters, or through a karenina.adapters entry point for installable plugin packages.

What files belong in a karenina adapter package?

The canonical package includes registration.py, agent.py, llm.py, parser.py, messages.py, trace.py, usage.py, errors.py, and a prompts directory. initialization.py and mcp.py are only needed for LangChain model creation or MCP tools.

Why does my karenina adapter crash when called without tools?

Adapters crash with tools=None and mcp_servers=None unless a no-tools fallback path exists. That fallback must also honor config.timeout so timeouts apply to all execution paths.

How should agent timeouts be handled in a karenina adapter?

When config.timeout fires mid-run and at least one message was collected, return AgentResult with timeout_reached=True instead of raising AgentTimeoutError. The pipeline propagates this into VerificationResult.response_timeout_partial for partial scoring.