Token导航 LogoToken导航

Agent Skill · 前端设计

koog(koog 命令行)

koog 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

koog 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,暂无第三方扫描结果,按安装量在前端设计类的 10,216 个 Skill 里排第 8,571。

总安装 275周安装 11GitHub Stars 2下载 89核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:koog(koog 命令行)
来源仓库:https://github.com/andvl1/claude-plugin
仓库路径:skills/koog
安装命令:
npx skills add https://github.com/andvl1/claude-plugin --skill koog
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/andvl1/claude-plugin --skill koog

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于处理 GitHub 仓库、Issue 和 Pull Request 信息。适合围绕代码变更、协作事项或仓库状态进行整理。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。可结合原始 README 进一步验证功能细节与使用方式。

安装前需确认权限范围及是否涉及网络请求或文件操作。koog 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/koog

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/andvl1/claude-plugin --skill koog;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

koog 怎么安装?

在终端执行 npx skills add https://github.com/andvl1/claude-plugin --skill koog。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

koog 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

koog 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

koog 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

koog 用的人多吗?

公开数据是累计安装 275 次,近一周安装 11 次,下载 89 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

koog 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
koog

koog 命令行 · 本页

2752调用外部服务未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Koog AI Agent Framework

Kotlin Multiplatform framework for AI agents. Published on Maven Central under ai.koog group.

Current version: 0.7.3

Dependencies

koog-agents is the umbrella module — it transitively includes all sub-modules (agents-core, agents-ext, all provider clients, tools, prompt DSL, etc.).

// build.gradle.kts — minimal setup (JVM project)
repositories { mavenCentral() }

val koogVersion = "0.7.3"

dependencies {
    implementation("ai.koog:koog-agents:$koogVersion")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
}

No need to add individual sub-modules like prompt-executor-openrouter-client — they come via koog-agents.

For Spring Boot, also add: implementation("ai.koog:koog-ktor:$koogVersion")

Import Paths (verified from 0.7.3 JARs)

// Agent
ai.koog.agents.core.agent.AIAgent
ai.koog.agents.core.agent.config.AIAgentConfig
ai.koog.agents.core.agent.GraphAIAgent         // graph-based agent
ai.koog.agents.core.agent.FunctionalAIAgent    // functional agent
ai.koog.agents.planner.PlannerAIAgent           // GOAP planner agent

// Tools
ai.koog.agents.core.tools.ToolRegistry
ai.koog.agents.core.tools.annotations.Tool
ai.koog.agents.core.tools.annotations.LLMDescription
ai.koog.agents.core.tools.reflect.ToolSet       // interface for annotation-based tools
ai.koog.agents.core.tools.reflect.tools          // extension for ToolRegistry DSL

// Strategies (predefined)
ai.koog.agents.ext.agent.chatAgentStrategy       // chat agent with tool loop
ai.koog.agents.ext.agent.reActStrategy           // ReAct pattern
ai.koog.agents.core.agent.singleRunStrategy      // single LLM call + tools
ai.koog.agents.core.agent.ToolCalls              // enum: SEQUENTIAL, PARALLEL, SINGLE_RUN_SEQUENTIAL
ai.koog.agents.ext.agent.singleRunStrategyWithHistoryCompression  // with auto history compression
ai.koog.agents.ext.agent.HistoryCompressionConfig

// GOAP Planner Strategy
ai.koog.agents.planner.AIAgentPlannerStrategy
ai.koog.agents.planner.AIAgentPlannerStrategyBuilder
ai.koog.agents.planner.GOAPStrategyBuilder
ai.koog.agents.planner.goap.GoapAgentState

// Strategy DSL (custom strategies)
ai.koog.agents.core.dsl.builder.strategy
ai.koog.agents.core.dsl.builder.forwardTo
ai.koog.agents.core.dsl.extension.nodeLLMRequest
ai.koog.agents.core.dsl.extension.nodeLLMRequestMultiple      // multiple responses
ai.koog.agents.core.dsl.extension.nodeLLMRequestStreaming      // streaming
ai.koog.agents.core.dsl.extension.nodeExecuteTool
ai.koog.agents.core.dsl.extension.nodeExecuteMultipleTools     // parallel tool execution
ai.koog.agents.core.dsl.extension.nodeLLMSendToolResult
ai.koog.agents.core.dsl.extension.nodeLLMSendMultipleToolResults
ai.koog.agents.core.dsl.extension.nodeSetStructuredOutput
ai.koog.agents.core.dsl.extension.nodeLLMCompressHistory
ai.koog.agents.core.dsl.extension.onAssistantMessage
ai.koog.agents.core.dsl.extension.onMultipleAssistantMessages
ai.koog.agents.core.dsl.extension.onToolCall
ai.koog.agents.core.dsl.extension.onMultipleToolCalls
ai.koog.agents.core.dsl.extension.HistoryCompressionStrategy   // WholeHistory, FromLastNMessages, Chunked, etc.

// Prompt
ai.koog.prompt.dsl.Prompt
ai.koog.prompt.dsl.prompt

// Executor
ai.koog.prompt.executor.llms.SingleLLMPromptExecutor

// Providers — see references/providers.md for full list
ai.koog.prompt.executor.clients.openrouter.OpenRouterLLMClient
ai.koog.prompt.executor.clients.openrouter.OpenRouterModels
ai.koog.prompt.executor.clients.openrouter.OpenRouterParams
ai.koog.prompt.executor.clients.openai.OpenAILLMClient
ai.koog.prompt.executor.clients.openai.OpenAIModels
ai.koog.prompt.executor.llms.all.simpleOpenAIExecutor

// Structured Output — see references/structured-output.md for full reference
ai.koog.prompt.structure.StructuredRequest          // sealed: Manual, Native
ai.koog.prompt.structure.StructuredRequestConfig     // replaces old StructuredOutputConfig
ai.koog.prompt.structure.StructuredResponse
ai.koog.prompt.structure.Structure                   // base interface (was StructuredData)
ai.koog.prompt.structure.json.JsonStructure          // was JsonStructuredData
ai.koog.prompt.executor.model.StructureFixingParser  // MOVED from prompt.structure package
ai.koog.agents.ext.agent.structuredOutputWithToolsStrategy

// Streaming
ai.koog.prompt.streaming.StreamFrame                 // sealed: TextDelta, TextComplete, ReasoningDelta, ReasoningComplete, ToolCallDelta, ToolCallComplete, End

// LLModel (custom model definitions)
ai.koog.prompt.llm.LLModel
ai.koog.prompt.llm.LLMProvider       // subclasses: OpenRouter, OpenAI, Anthropic, Google, etc.
ai.koog.prompt.llm.LLMCapability     // singletons: Completion, Temperature, Tools, Schema.JSON.Basic, etc.

// Response Processing
ai.koog.prompt.processor.ResponseProcessor           // NEW: post-process LLM responses (extract tool calls from text)

// MCP Integration
ai.koog.agents.mcp.McpToolRegistryProvider           // fromClient, fromTransport, fromSseUrl
ai.koog.agents.mcp.metadata.McpServerInfo

AIAgent Constructor

The simplest String→String overload:

AIAgent(
    promptExecutor: PromptExecutor,
    llmModel: LLModel,
    responseProcessor: ResponseProcessor? = null,     // NEW in 0.7.x: post-process LLM responses
    strategy: AIAgentGraphStrategy<String, String> = singleRunStrategy(),
    toolRegistry: ToolRegistry = ToolRegistry.EMPTY,
    id: String? = null,
    systemPrompt: String? = null,                     // CHANGED: now nullable
    temperature: Double? = null,                      // CHANGED: now nullable
    numberOfChoices: Int = 1,
    maxIterations: Int = 50,
    installFeatures: FeatureContext.() -> Unit = {}
): AIAgent<String, String>

AIAgentConfig-based overload:

AIAgent(
    promptExecutor: PromptExecutor,
    agentConfig: AIAgentConfig,
    strategy: AIAgentGraphStrategy<Input, Output>,
    toolRegistry: ToolRegistry = ToolRegistry.EMPTY,
    id: String? = null,
    clock: Clock = Clock.System,
    installFeatures: FeatureContext.() -> Unit = {},
): AIAgent<Input, Output>

AIAgentConfig constructor:

AIAgentConfig(
    prompt: Prompt,
    model: LLModel,
    maxAgentIterations: Int,
    missingToolsConversionStrategy: MissingToolsConversionStrategy = MissingToolsConversionStrategy.Missing(ToolCallDescriber.JSON),
    responseProcessor: ResponseProcessor? = null,
    serializer: JSONSerializer = KotlinxSerializer(),
)

// Convenience factory:
AIAgentConfig.withSystemPrompt(
    prompt = "You are a helpful assistant",
    llm = OpenAIModels.Chat.GPT4o,
    id = "koog-agents",
    maxAgentIterations = 3
)

Agent Types

TypeStrategyUse case
GraphAIAgent<I, O>AIAgentGraphStrategyCustom strategy graphs (most common)
FunctionalAIAgent<I, O>AIAgentFunctionalStrategySimple functional agents
PlannerAIAgent<I, O>AIAgentPlannerStrategy (GOAP)Goal-oriented planning

Java Builder API

AIAgent<String, String> agent = AIAgent.builder()
    .promptExecutor(executor)
    .systemPrompt("You are a helpful assistant.")
    .llmModel(OpenAIModels.Chat.GPT4o)
    .toolRegistry(toolRegistry)
    .build();

Annotation-Based Tools

import ai.koog.agents.core.tools.annotations.LLMDescription
import ai.koog.agents.core.tools.annotations.Tool
import ai.koog.agents.core.tools.reflect.ToolSet

@LLMDescription("Tools for file operations")
class FileTools : ToolSet {

    @Tool
    @LLMDescription("Read file contents")
    fun readFile(
        @LLMDescription("Path to file") path: String
    ): String {
        return java.io.File(path).readText()
    }

    @Tool
    @LLMDescription("List files in directory")
    fun listFiles(
        @LLMDescription("Directory path") dir: String
    ): String {
        return java.io.File(dir).listFiles()?.joinToString("\n") { it.name } ?: "empty"
    }
}

Register in ToolRegistry:

import ai.koog.agents.core.tools.ToolRegistry
import ai.koog.agents.core.tools.reflect.tools

val toolRegistry = ToolRegistry {
    tools(FileTools())         // register all @Tool methods from ToolSet
    tools(AnotherToolSet())    // can register multiple
}

Predefined Strategies

StrategyImportUse case
chatAgentStrategy()ai.koog.agents.ext.agentChat with tool calling loop (most common)
reActStrategy(reasoningInterval, name)ai.koog.agents.ext.agentReAct: reason→act→observe loop
singleRunStrategy(runMode)ai.koog.agents.core.agentSingle LLM request + tool execution
singleRunStrategyWithHistoryCompression(config)ai.koog.agents.ext.agentSingle run with auto history compression

singleRunStrategy run modes

import ai.koog.agents.core.agent.ToolCalls

singleRunStrategy(ToolCalls.SEQUENTIAL)          // multiple tools per call, executed sequentially (default)
singleRunStrategy(ToolCalls.PARALLEL)             // multiple tools per call, executed in parallel
singleRunStrategy(ToolCalls.SINGLE_RUN_SEQUENTIAL)  // one tool per LLM call

History Compression Strategy

import ai.koog.agents.ext.agent.singleRunStrategyWithHistoryCompression
import ai.koog.agents.ext.agent.HistoryCompressionConfig
import ai.koog.agents.core.dsl.extension.HistoryCompressionStrategy

val strategy = singleRunStrategyWithHistoryCompression(
    config = HistoryCompressionConfig(
        isHistoryTooBig = { prompt -> prompt.messages.size > 50 },
        compressionStrategy = HistoryCompressionStrategy.WholeHistory,
        retrievalModel = null  // uses agent's model by default
    ),
    runMode = ToolCalls.SEQUENTIAL
)

Available compression strategies:

  • HistoryCompressionStrategy.NoCompression — no-op
  • HistoryCompressionStrategy.WholeHistory — TL;DR of entire history
  • HistoryCompressionStrategy.WholeHistoryMultipleSystemMessages — handles multiple system messages
  • HistoryCompressionStrategy.FromLastNMessages(n) — keep last N messages, summarize rest
  • HistoryCompressionStrategy.FromTimestamp(instant) — keep messages after timestamp
  • HistoryCompressionStrategy.Chunked(chunkSize) — chunk and summarize

Complete Example: Agent with OpenRouter

import ai.koog.agents.core.agent.AIAgent
import ai.koog.agents.core.tools.ToolRegistry
import ai.koog.agents.core.tools.annotations.LLMDescription
import ai.koog.agents.core.tools.annotations.Tool
import ai.koog.agents.core.tools.reflect.ToolSet
import ai.koog.agents.core.tools.reflect.tools
import ai.koog.agents.ext.agent.chatAgentStrategy
import ai.koog.prompt.executor.clients.openrouter.OpenRouterLLMClient
import ai.koog.prompt.executor.clients.openrouter.OpenRouterModels
import ai.koog.prompt.executor.llms.SingleLLMPromptExecutor
import kotlinx.coroutines.runBlocking

@LLMDescription("Math tools")
class MathTools : ToolSet {
    @Tool
    @LLMDescription("Add two numbers")
    fun add(@LLMDescription("First number") a: Int, @LLMDescription("Second number") b: Int): String {
        return "Result: ${a + b}"
    }
}

fun main() = runBlocking {
    val client = OpenRouterLLMClient(apiKey = System.getenv("OPENROUTER_API_KEY"))
    val executor = SingleLLMPromptExecutor(client)

    val agent = AIAgent(
        promptExecutor = executor,
        llmModel = OpenRouterModels.DeepSeekV30324,
        strategy = chatAgentStrategy(),
        toolRegistry = ToolRegistry { tools(MathTools()) },
        systemPrompt = "You are a helpful assistant. Use tools when needed.",
        temperature = 0.7,
        maxIterations = 10
    )

    val result = agent.run("What is 42 + 58?")
    println(result)
}

Streaming Example

import ai.koog.agents.core.dsl.extension.nodeLLMRequestStreaming
import ai.koog.prompt.streaming.StreamFrame
import kotlinx.coroutines.flow.Flow

val streamingStrategy = strategy<String, Flow<StreamFrame>>("streaming") {
    val nodeStream by nodeLLMRequestStreaming()
    edge(nodeStart forwardTo nodeStream)
    edge(nodeStream forwardTo nodeFinish)
}

// In event handler — capture streaming frames
val agent = AIAgent(
    promptExecutor = executor,
    llmModel = model,
    strategy = chatAgentStrategy(),
    toolRegistry = ToolRegistry.EMPTY,
    systemPrompt = "You are a helpful assistant."
) {
    handleEvents {
        onLLMStreamingFrameReceived { ctx ->
            when (val frame = ctx.streamFrame) {
                is StreamFrame.TextDelta -> print(frame.text)
                is StreamFrame.ReasoningDelta -> { /* reasoning text */ }
                is StreamFrame.ToolCallComplete -> { /* tool call received */ }
                is StreamFrame.End -> println("\n[Done: ${frame.finishReason}]")
                else -> {}
            }
        }
    }
}

Prompt DSL (without agent)

import ai.koog.prompt.dsl.prompt
import ai.koog.prompt.executor.llms.SingleLLMPromptExecutor

val prompt = prompt("my-prompt") {
    system("You are a helpful assistant")
    user("Explain coroutines")
}

// Direct execution without agent
val response = executor.execute(prompt, model)

Structured Output

For full reference, see references/structured-output.md.

Quick Start: StructureFixingParser (standalone, most compatible)

Parse LLM text into typed data class, with auto-fix via a secondary model:

import ai.koog.prompt.executor.model.StructureFixingParser  // NOTE: moved in 0.7.x
import ai.koog.prompt.structure.json.JsonStructure           // NOTE: renamed from JsonStructuredData

// 1. Define structure from @Serializable class
val structure = JsonStructure.create<MyResponse>()
// or explicit:
val structure = JsonStructure.create(
    id = "MyResponse",
    serializer = MyResponse.serializer()
)

// 2. Create fixing parser with a cheap model
val fixingParser = StructureFixingParser(
    fixingModel = myModel,  // any LLModel
    retries = 3
)

// 3. Parse raw text (tries direct parse first, then fixes with LLM)
val result: MyResponse = fixingParser.parse(executor, structure, rawText)

Custom LLModel (models not in predefined catalogs)

import ai.koog.prompt.llm.LLModel
import ai.koog.prompt.llm.LLMProvider
import ai.koog.prompt.llm.LLMCapability

val customModel = LLModel(
    provider = LLMProvider.OpenRouter,       // singleton objects
    id = "z-ai/glm-4.5-air",                // exact model ID from provider
    capabilities = listOf(
        LLMCapability.Completion,            // ALL are singletons — no ()
        LLMCapability.Temperature,
        LLMCapability.Schema.JSON.Basic
    ),
    contextLength = 128_000L,
    maxOutputTokens = 8_000L                 // nullable
)

structuredOutputWithToolsStrategy (native, model-dependent)

Returns typed output directly from agent. Caveat: not all models support this via OpenRouter (DeepSeek breaks tool calling format).

import ai.koog.agents.ext.agent.structuredOutputWithToolsStrategy
import ai.koog.prompt.structure.StructuredRequestConfig       // NOTE: was StructuredOutputConfig
import ai.koog.prompt.structure.StructuredRequest

val config = StructuredRequestConfig<MyResponse>(
    default = StructuredRequest.Manual(structure),     // prompt-based (most compatible)
    byProvider = mapOf(
        LLMProvider.OpenAI to StructuredRequest.Native(structure)  // use native response_format
    )
)

val agent = AIAgent(
    promptExecutor = executor,
    llmModel = OpenRouterModels.GPT4o,
    strategy = structuredOutputWithToolsStrategy(
        config = config,
        fixingParser = fixingParser,      // optional
        parallelTools = false             // parallel tool execution
    ),
    toolRegistry = toolRegistry,
    systemPrompt = "..."
)

val typed: MyResponse = agent.run("input")

Provider Quick Reference

For detailed provider configuration, see references/providers.md.

ProviderClient classModels objectKey env var
OpenRouterOpenRouterLLMClientOpenRouterModelsOPENROUTER_API_KEY
OpenAIOpenAILLMClientOpenAIModels.ChatOPENAI_API_KEY
AnthropicAnthropicLLMClientAnthropicModelsANTHROPIC_API_KEY
GoogleGoogleLLMClientGoogleModelsGOOGLE_API_KEY
DeepSeekDeepSeekLLMClientDeepSeekModelsDEEPSEEK_API_KEY
AWS BedrockBedrockLLMClient—AWS credentials
Mistral AIMistralAILLMClient—MISTRAL_API_KEY
DashScopeDashscopeLLMClient—DASHSCOPE_API_KEY
OllamaOllamaLLMClient——

Note: AbstractOpenAILLMClient is the base for OpenAI, DeepSeek, OpenRouter, MistralAI, DashScope. Anthropic, Google, Ollama implement LLMClient directly. Bedrock uses AWS Converse API (JVM only).

Custom Strategy DSL

For when predefined strategies aren't enough. Full reference: references/strategies.md.

import ai.koog.agents.core.dsl.builder.forwardTo
import ai.koog.agents.core.dsl.builder.strategy
import ai.koog.agents.core.dsl.extension.*

val myStrategy = strategy<String, String>("my-agent") {
    val nodeLLM by nodeLLMRequest()
    val nodeExec by nodeExecuteTool()
    val nodeSend by nodeLLMSendToolResult()

    edge(nodeStart forwardTo nodeLLM)
    edge(nodeLLM forwardTo nodeFinish onAssistantMessage { true })
    edge(nodeLLM forwardTo nodeExec onToolCall { true })
    edge(nodeExec forwardTo nodeSend)
    edge(nodeSend forwardTo nodeFinish onAssistantMessage { true })
    edge(nodeSend forwardTo nodeExec onToolCall { true })
}

Key concepts (details in strategies.md):

  • Nodes: nodeLLMRequest, nodeLLMRequestMultiple, nodeLLMRequestStreaming, nodeExecuteTool, nodeExecuteMultipleTools, nodeLLMSendToolResult, nodeLLMSendMultipleToolResults, nodeSetStructuredOutput, nodeLLMCompressHistory, custom node<In, Out>
  • Edges: forwardTo + conditions (onAssistantMessage, onMultipleAssistantMessages, onToolCall, onMultipleToolCalls, onCondition) + transformed
  • Subgraphs: isolated sections with own tools/model — subgraph, subgraphWithTask, subgraphWithVerification, subgraphWithRetry
  • Parallel: parallel(nodeA, nodeB, nodeC) {selectByMax {it}}
  • Sequential: nodeStart then subgraphA then subgraphB then nodeFinish
  • Structured output: nodeLLMRequestStructured<MyDataClass>(examples = [...]) or nodeLLMRequestStructured(config = structuredRequestConfig)
  • Streaming: nodeLLMRequestStreaming() returns Flow<StreamFrame>

GOAP Planner Strategy

Goal-Oriented Action Planning — agent decomposes tasks into action sequences:

import ai.koog.agents.planner.AIAgentPlannerStrategy
import ai.koog.agents.planner.goap.GoapAgentState

abstract class MyState(input: String, output: String?) : GoapAgentState<String, String>(input, output) {
    // define state properties and goals
}

val strategy = AIAgentPlannerStrategy.goap<String, String, MyState>(
    name = "my-goap",
    initializeState = { input -> MyInitialState(input) }
) {
    // define actions and goals
}

val agent = AIAgent(
    promptExecutor = executor,
    llmModel = model,
    strategy = strategy,
    toolRegistry = toolRegistry,
    systemPrompt = "..."
)

Agent Features & Built-in Tools

Features are installed in the AIAgent constructor's trailing lambda. Each has a dedicated reference:

  • Structured Output — typed responses via StructuredRequestConfig, StructureFixingParser, JsonStructure, custom LLModel creation, structuredOutputWithToolsStrategy
  • EventHandler — lifecycle callbacks (onAgentStarting, onToolCallCompleted, onLLMCallCompleted, streaming events), custom AIAgentFeature with pipeline interceptors
  • Memory — store/retrieve facts across conversations (Concept, Fact, MemoryScope, encrypted storage, memory nodes for strategy DSL)
  • Tracing & Persistence — trace events to log/file/remote; checkpoint/restore agent state with rollback strategies
  • Built-in Tools — AskUser, SayToUser, ExitTool, ReadFileTool, WriteFileTool, EditFileTool, ListDirectoryTool, ExecuteShellCommandTool, SimpleTool class
val agent = AIAgent(...) {
    handleEvents {
        onAgentStarting { ctx -> println("Starting: ${ctx.agent.id}") }
        onToolCallCompleted { ctx -> println("Tool done") }
    }
    install(Tracing) { addMessageProcessor(TraceFeatureMessageLogWriter(logger)) }
    install(AgentMemory) { memoryProvider = LocalFileMemoryProvider(...) }
}

val registry = ToolRegistry {
    tool(AskUser)                                          // ai.koog.agents.ext.tool
    tool(SayToUser)
    tool(ReadFileTool(JVMFileSystemProvider.ReadOnly))      // ai.koog.agents.ext.tool.file
    tool(ExecuteShellCommandTool(BraveModeConfirmationHandler)) // ai.koog.agents.ext.tool.shell
    tools(MyToolSet())
}

MCP Integration

import ai.koog.agents.mcp.McpToolRegistryProvider
import ai.koog.agents.mcp.metadata.McpServerInfo

// From SSE URL (simplest)
val toolRegistry = McpToolRegistryProvider.fromSseUrl("http://localhost:8931/sse")

// From existing MCP client
val toolRegistry = McpToolRegistryProvider.fromClient(
    mcpClient = existingMcpClient,
    serverInfo = McpServerInfo(url = "http://localhost:8931")
)

// From custom transport (stdio, SSE)
val transport = McpToolRegistryProvider.defaultSseTransport("http://localhost:8931/sse")
val toolRegistry = McpToolRegistryProvider.fromTransport(
    transport = transport,
    serverInfo = McpServerInfo(url = "http://localhost:8931")
)

// Use with agent
val agent = AIAgent(
    promptExecutor = executor,
    llmModel = model,
    strategy = singleRunStrategy(),
    toolRegistry = toolRegistry  // MCP tools work like any other tools
)

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

平台分布

Codex

38.15%
按下载量换算34

Claude

31.37%
按下载量换算28

Cursor

17.69%
按下载量换算16

Gemini CLI

9.67%
按下载量换算9

安全审计

暂无安全审计结果可展示。

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills