ak-dev-new-framework-integration

ak-dev-new-framework-integration is a skill for Claude Code, Codex from yaalalabs/agent-kernel. It costs 84 tokens per session (4,459 once invoked), scanned A, original, Apache-2.0.

A step-by-step development guide for connecting a new agent framework to Agent Kernel, a software system for running AI agents.

In plain words
What is it for?
Use it to create the framework module, add session state when needed, and implement the framework-specific agent and runner classes.
Why use it?
It explains the adapter work needed when the framework you want to use is not already supported.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/yaalalabs/agent-kernel/ak-dev-new-framework-integration
Any agent
npx skills add yaalalabs/agent-kernel --skill ak-dev-new-framework-integration
Clone the repo
git clone --depth 1 https://github.com/yaalalabs/agent-kernel

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ak-dev-new-framework-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/yaalalabs/agent-kernel/ak-dev-new-framework-integration.svg)](https://agentmods.dev/skills/yaalalabs/agent-kernel/ak-dev-new-framework-integration)
Your own site
<a href="https://agentmods.dev/skills/yaalalabs/agent-kernel/ak-dev-new-framework-integration"><img src="https://agentmods.dev/badge/skills/yaalalabs/agent-kernel/ak-dev-new-framework-integration.svg" alt="Measured on agentmods" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,459 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00084 $0.04459
Opus 5 $0.00042 $0.02230
Sonnet 5 $0.00017 $0.00892
Haiku 4.5 $0.00008 $0.00446

Measured 4d ago against content hash 822705a7994b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ak-dev-new-framework-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/ak-dev-new-framework-integration/SKILL.md · 428 lines

How it starts

The opening of the file, as written. The whole thing — 428 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding a New Framework Integration

This guide walks through adding support for a new agent framework to Agent Kernel. Use the existing OpenAI adapter (ak-py/src/agentkernel/framework/openai/) as the canonical reference implementation.

Prerequisites

  • Understand the architecture skill (.agents/skills/ak-dev-architecture/SKILL.md)
  • Familiarity with the target framework's API
  • The target framework must support async execution (or provide an async wrapper)

Step-by-Step

1. Create the Framework Adapter Directory

ak-py/src/agentkernel/framework/<name>/
├── __init__.py
└── <name>.py

Replace <name> with the framework's lowercase identifier (e.g., openai, langgraph).

2. Implement the Session State Class (if needed)

If the framework requires per-session state (e.g., conversation history), create a session data class:

class <Name>Session:
    """Stores framework-specific session data."""
    def __init__(self):
        self._history = []  # or whatever state the framework needs

    def get_history(self):
        return self._history

    def add_to_history(self, item):
        self._history.append(item)

    def clear_session(self):
        self._history.clear()

The session data is stored in the Agent Kernel Session via session.set("<name>", <Name>Session()) and retrieved via session.get("<name>"). This key must be the same string passed as your Runner's name (see Step 3) — hook authors reach it via Session.get_framework_session(), which resolves Agent.current().runner.name under the hood.

3. Implement the Runner

Subclass Runner from agentkernel.core.base:

from agentkernel.core.base import Runner, Session
from agentkernel.core.model import AgentReply, AgentReplyText, AgentRequest, AgentRequestText
from agentkernel.core.tool import ToolContext

FRAMEWORK = "<name>"

class <Name>Runner(Runner):
    def __init__(self):
        # must match the session key below — Session.get_framework_session() resolves it
        # via Agent.current().runner.name
        super().__init__(FRAMEWORK)

    def _session(self, session: Session) -> <Name>Session:
        """Get or create framework-specific session data."""
        data = session.get(FRAMEWORK)
        if data is None:
            data = <Name>Session()
            session.set(FRAMEWORK, data)
        return data

    async def run(self, agent, session: Session, requests: list[AgentRequest]) -> AgentReply:
        # 1. Create ToolContext for tool functions to access
        tool_context = ToolContext(
            runtime=Runtime.current(),
            agent=agent,
            session=session,
            requests=requests
        )

        with tool_context:
            tool_context.set()
            try:
                # 2. Get framework-specific session state
                fw_session = self._session(session)

                # 3. Convert AgentRequest models to framework-native format
                # e.g., extract text from AgentRequestText
                prompt = ""
                for req in requests:
                    if isinstance(req, AgentRequestText):
                        prompt = req.prompt

                # 4. Call the framework's execution API
                result = await self._execute(agent, fw_session, prompt)  # framework-specific

                # 5. Update session state
                fw_session.add_to_history({"input": prompt, "output": result})

                # 6. Return as AgentReply
                return AgentReplyText(response=str(result), prompt=prompt)
            finally:
                tool_context.reset()

Read the full file on GitHub · 428 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 428 lines · 84 tokens per session scan A 822705a7994b

Subscribe to this mod's changes

ak-dev-new-framework-integration is a skill published in the GitHub repository yaalalabs/agent-kernel (166 stars, last pushed today), licensed Apache-2.0. It adds 84 tokens to every session and 4,459 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.