Token导航 LogoToken导航

Agent Skill · 研究检索

codebolt-agent-development(codeboltAgent 开发)

codebolt-agent-development 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

codebolt-agent-development 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 58,786。

总安装 404周安装 17GitHub Stars 公开资料未说明下载 141核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/codeboltai/codeboltjs --skill codebolt-agent-development

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

codebolt-agent-development 提供 Codebolt SDK v2 的开发文档和最佳实践。适合在 Codex、Claude、Cursor、Gemini CLI 中使用 Codebolt 平台进行开发时参考。包含消息处理、连接管理和工具调用的 TypeScript SDK 使用说明。

安装前建议确认 SDK 版本兼容性,注意 waitForConnection() 方法已在新版本中移除。提供核心工具命名空间和使用案例的完整参考文档。

来源仓库内路径:skills/codebolt-agent-development

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/codeboltai/codeboltjs --skill codebolt-agent-d…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

codebolt-agent-development 怎么安装?

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

codebolt-agent-development 支持哪些 AI 工具?

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

codebolt-agent-development 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/codeboltai/codeboltjs --skill codebolt-agent-development 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

codebolt-agent-development 是免费的吗?

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

codebolt-agent-development 用的人多吗?

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

codebolt-agent-development 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

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

值得选的地方

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

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
codebolt-agent-development

codeboltAgent 开发 · 本页

404—执行命令未明确有提醒

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

SKILL.md 原文

Codebolt Agent Development

SDK Version 2 - This documentation covers Codebolt SDK v2.
⚠️ IMPORTANT: Do NOT use codebolt.waitForConnection() In SDK v2, waitForConnection() has been removed. Connection handling is now automatically managed inside codebolt.onMessage(). If you're migrating from v1 or see old examples using waitForConnection(), simply remove those calls. ``typescript // ❌ OLD (SDK v1) - Do NOT use await codebolt.waitForConnection(); codebolt.onMessage(async (msg:FlatUserMessage) => { ... }); // ✅ NEW (SDK v2) - Use this codebolt.onMessage(async (msg:FlatUserMessage) => { ... }); ``
⚠️ IMPORTANT: Use Strict Typings & Always Check for Errors Always use strict TypeScript typings when developing agents. You do NOT need to create custom typings — types for most Codebolt functionality are already provided by the packages (@codebolt/codeboltjs, @codebolt/agent, @codebolt/types). Just use the existing types. After writing any agent code, always run type checking and linting to catch errors before running the agent. ``bash # Always run after writing code npx tsc --noEmit # Check for type errors npx eslint src/ # Check for code quality issues ``

First Decision: What Type of Agent Do You Need?

When creating an agent, the first thing you need to decide is what type of agent you want. There are three main types, each giving you progressively more control:

┌──────────────────────────────────────────────────────────────────────┐
│                    CHOOSE YOUR AGENT TYPE                            │
├──────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  Don't need a full agentic loop? Just want a simple prompt agent?    │
│  ──► CodeboltAgent Wrapper (Level 3)                                 │
│      Just provide instructions — the framework handles everything.   │
│                                                                      │
│  Need to modify or customize the agentic loop?                       │
│  ──► Base Components (Level 2)                                       │
│      Compose InitialPromptGenerator + AgentStep + ResponseExecutor.  │
│      Add custom modifiers and processors at each stage.              │
│                                                                      │
│  Want to go deeper and build advanced behavior from scratch?         │
│  ──► Core API (Level 1)                                              │
│      Use codebolt.llm, codebolt.fs, codebolt.mcp directly.          │
│      Full control over every aspect of the agent.                    │
│                                                                      │
└──────────────────────────────────────────────────────────────────────┘
TypeWhen to UseWhat You ControlCode Needed
CodeboltAgent WrapperSimple agents, standard behavior, quick setupJust the instructions and allowed toolsMinimal (~10 lines)
Base ComponentsCustom processors, specialized message handling, modified loopThe entire pipeline: modifiers, processors, loop logicModerate (~50 lines)
Core APINon-standard flows, advanced orchestration, utility scriptsEverything from scratchFull implementation

Important: Permissions Are Handled by the Application

Agents do NOT need to implement permission logic. The Codebolt application handles all permissions automatically:

  • Tool execution permissions: When a tool is executed via codebolt.mcp.executeTool(), the application intercepts and can prompt the user for approval. Tools return [didUserReject, result] — if rejected, the agent gracefully skips remaining tools.
  • Tool whitelisting: Agents declare allowedTools in config. The ToolInjectionModifier filters the tool list before sending to the LLM — only allowed tools are visible.
  • File system access: All file operations go through the application layer which enforces workspace boundaries.
  • User rejection propagation: If a user rejects a tool call, the agent automatically stops executing subsequent tools in that batch.
// You do NOT write permission code in your agent:
// ❌ if (hasPermission('writeFile')) { ... }

// Just call tools normally. The application handles approval:
// ✅ const result = await codebolt.mcp.executeTool('codebolt', 'writeFile', { path, content });
// The application prompts the user if needed and returns [didUserReject, result]

What the application handles for you:

  • User approval/rejection dialogs for tool execution
  • Workspace boundary enforcement
  • Tool availability filtering based on agent configuration
  • Graceful handling when users deny operations
  • Session-level permission state management

Detailed Examples: All Three Agent Types

Type 1 — CodeboltAgent Wrapper (Simple Prompt-Based)

If you don't need a full custom agentic loop and just want to run an agent using a simple prompt, use the CodeboltAgent wrapper. You provide instructions, optionally restrict tools, and call processMessage(). The framework handles the entire loop — prompt generation, LLM calls, tool execution, and completion detection.

import codebolt from '@codebolt/codeboltjs';
import { CodeboltAgent } from '@codebolt/agent/unified';
import { FlatUserMessage } from '@codebolt/types/sdk';

// 1. Define your instructions
const systemPrompt = `
You are a helpful coding assistant. You help users with:
- Reading and understanding code
- Writing new code and fixing bugs
- Running terminal commands

Always explain what you're doing before taking action.
`;

// 2. Create the agent — that's it!
const agent = new CodeboltAgent({
  instructions: systemPrompt,
  enableLogging: true,
  // Optional: restrict which tools the agent can use
  allowedTools: [
    'codebolt--readFile',
    'codebolt--writeFile',
    'codebolt--executeCommand',
    'codebolt--listFiles',
    'codebolt--searchFiles'
  ]
});

// 3. Listen for messages and process them
codebolt.onMessage(async (reqMessage: FlatUserMessage) => {
  try {
    const result = await agent.processMessage(reqMessage);
    if (!result.success) {
      codebolt.chat.sendMessage(`Error: ${result.error}`, {});
    }
  } catch (error) {
    console.error('Agent error:', error);
  }
});

What happens internally:

  • Default modifiers inject chat history, environment context, directory structure, IDE context, system prompt, tools, and @file mentions
  • The LLM is called in a loop — if it returns tool calls, they're executed and results fed back
  • The loop continues until the LLM calls attempt_completion or returns without tool calls

Continuing from previous context:

const result1 = await agent.processMessage('Read the package.json file');

// Pass previous context to continue the conversation
const agent2 = new CodeboltAgent({
  instructions: systemPrompt,
  context: result1.context  // Preserves conversation history
});
const result2 = await agent2.processMessage('Now update the version to 2.0.0');

Type 2 — Base Components (Custom Agentic Loop)

If you need to modify or customize the agentic loop, use the three base components directly. This gives you control over every stage of the pipeline while still using the framework's building blocks.

import codebolt from '@codebolt/codeboltjs';
import {
  InitialPromptGenerator,
  AgentStep,
  ResponseExecutor
} from '@codebolt/agent/unified';
import {
  ChatHistoryMessageModifier,
  EnvironmentContextModifier,
  DirectoryContextModifier,
  IdeContextModifier,
  CoreSystemPromptModifier,
  ToolInjectionModifier,
  AtFileProcessorModifier
} from '@codebolt/agent/processor-pieces';
import { ChatCompressionModifier } from '@codebolt/agent/processor-pieces';
import { ConversationCompactorModifier } from '@codebolt/agent/processor-pieces';
import { FlatUserMessage } from '@codebolt/types/sdk';
import { AgentStepOutput, ProcessedMessage } from '@codebolt/types/agent';

const systemPrompt = `You are an advanced coding assistant.`;

codebolt.onMessage(async (reqMessage: FlatUserMessage) => {
  try {
    // --- Stage 1: Build the initial prompt ---
    // Each modifier adds context to the prompt sent to the LLM.
    // You can add, remove, or reorder modifiers to customize what context the LLM sees.
    const promptGenerator = new InitialPromptGenerator({
      processors: [
        new ChatHistoryMessageModifier({ enableChatHistory: true }),
        new EnvironmentContextModifier({ enableFullContext: true }),
        new DirectoryContextModifier(),
        new IdeContextModifier({
          includeActiveFile: true,
          includeOpenFiles: true,
          includeCursorPosition: true,
          includeSelectedText: true
        }),
        new CoreSystemPromptModifier({ customSystemPrompt: systemPrompt }),
        new ToolInjectionModifier({ includeToolDescriptions: true }),
        new AtFileProcessorModifier({ enableRecursiveSearch: true })
      ],
      baseSystemPrompt: systemPrompt
    });

    let prompt: ProcessedMessage = await promptGenerator.processMessage(reqMessage);
    let completed = false;

    // --- Stage 2: The agentic loop ---
    do {
      // AgentStep handles: PreInferenceProcessors → LLM call → PostInferenceProcessors
      const agentStep = new AgentStep({
        preInferenceProcessors: [
          new ChatCompressionModifier({ enableCompression: true })
        ],
        postInferenceProcessors: []
      });

      const stepResult: AgentStepOutput = await agentStep.executeStep(reqMessage, prompt);
      prompt = stepResult.nextMessage;

      // ResponseExecutor handles: PreToolCallProcessors → Tool execution → PostToolCallProcessors
      const responseExecutor = new ResponseExecutor({
        preToolCallProcessors: [],
        postToolCallProcessors: [
          new ConversationCompactorModifier({
            compactStrategy: 'smart',
            compressionTokenThreshold: 0.5
          })
        ]
      });

      const executionResult = await responseExecutor.executeResponse({
        initialUserMessage: reqMessage,
        actualMessageSentToLLM: stepResult.actualMessageSentToLLM,
        rawLLMOutput: stepResult.rawLLMResponse,
        nextMessage: stepResult.nextMessage
      });

      completed = executionResult.completed;
      prompt = executionResult.nextMessage;

    } while (!completed);

  } catch (error) {
    console.error('Agent error:', error);
    codebolt.chat.sendMessage(`Error: ${error}`, {});
  }
});

Writing a custom MessageModifier:

import { BaseMessageModifier } from '@codebolt/agent/processor-pieces/base';
import { ProcessedMessage } from '@codebolt/types/agent';
import { FlatUserMessage } from '@codebolt/types/sdk';

class DatabaseSchemaModifier extends BaseMessageModifier {
  async modify(
    originalRequest: FlatUserMessage,
    createdMessage: ProcessedMessage
  ): Promise<ProcessedMessage> {
    const schemaInfo = await fetchDatabaseSchema(); // Your custom logic
    createdMessage.message.messages.push({
      role: 'system',
      content: `Database Schema:\n${schemaInfo}`
    });
    return createdMessage;
  }
}

// Use it alongside built-in modifiers
const promptGenerator = new InitialPromptGenerator({
  processors: [
    new ChatHistoryMessageModifier({ enableChatHistory: true }),
    new CoreSystemPromptModifier({ customSystemPrompt: 'You are a DB expert.' }),
    new DatabaseSchemaModifier(),  // Your custom modifier
    new ToolInjectionModifier({ includeToolDescriptions: true })
  ],
  baseSystemPrompt: 'You are a DB expert.'
});

Writing a custom PostToolCallProcessor:

import { BasePostToolCallProcessor } from '@codebolt/agent/processor-pieces/base';
import {
  PostToolCallProcessorInput,
  PostToolCallProcessorOutput
} from '@codebolt/types/agent';

class ErrorCheckProcessor extends BasePostToolCallProcessor {
  async modify(input: PostToolCallProcessorInput): Promise<PostToolCallProcessorOutput> {
    const { nextPrompt, toolResults } = input;

    if (toolResults) {
      for (const result of toolResults) {
        if (typeof result.content === 'string' && result.content.includes('CRITICAL_ERROR')) {
          return { nextPrompt, shouldExit: true };  // Stop the loop
        }
      }
    }

    return { nextPrompt, shouldExit: false };  // Continue
  }
}

Type 3 — Core API (Advanced / Full Control)

When you want to go deeper into agent functionality and build more advanced behavior, use Codebolt's Core API directly. This gives you full control — you make LLM calls, read files, run commands, and orchestrate everything yourself.

import codebolt from '@codebolt/codeboltjs';
import { FlatUserMessage } from '@codebolt/types/sdk';

codebolt.onMessage(async (reqMessage: FlatUserMessage) => {
  const userMessage = reqMessage.userMessage;

  // Step 1: Classify the task using an LLM call
  const analysis = await codebolt.llm.inference({
    messages: [
      {
        role: 'system',
        content: 'Classify the user request as: "code_change", "question", or "debug". Respond with only the classification.'
      },
      { role: 'user', content: userMessage }
    ]
  });

  const taskType = analysis.completion?.choices?.[0]?.message?.content?.trim() || 'question';
  codebolt.chat.sendMessage(`Task type: ${taskType}`, {});

  // Step 2: Handle based on classification
  if (taskType === 'code_change') {
    await handleCodeChange(userMessage);
  } else if (taskType === 'debug') {
    await handleDebug(userMessage);
  } else {
    await handleQuestion(userMessage);
  }
});

async function handleCodeChange(task: string) {
  // Read the workspace files
  const files = await codebolt.fs.listFiles('/');
  codebolt.chat.sendMessage(`Found ${files.length} files`, {});

  // Ask LLM to plan which files to change
  const planResponse = await codebolt.llm.inference({
    messages: [
      {
        role: 'system',
        content: 'Given the file list and task, output a JSON array of files to modify: [{"file": "path", "action": "create|modify|delete"}]'
      },
      { role: 'user', content: `Files: ${JSON.stringify(files)}\nTask: ${task}` }
    ]
  });

  const plan = JSON.parse(planResponse.completion?.choices?.[0]?.message?.content || '[]');

  // Execute the plan file by file
  for (const step of plan) {
    if (step.action === 'modify') {
      const content = await codebolt.fs.readFile(step.file);

      const editResponse = await codebolt.llm.inference({
        messages: [
          { role: 'system', content: 'Apply the requested change. Return the complete updated file.' },
          { role: 'user', content: `File: ${step.file}\nContent:\n${content}\nTask: ${task}` }
        ]
      });

      const newContent = editResponse.completion?.choices?.[0]?.message?.content || '';
      await codebolt.fs.updateFile(step.file, step.file, newContent);
      codebolt.chat.sendMessage(`Updated ${step.file}`, {});
    }
  }
}

async function handleDebug(task: string) {
  // Run tests and capture output
  const testOutput = await codebolt.terminal.executeCommand('npm test', true);

  // Use LLM to analyze failures
  const debugResponse = await codebolt.llm.inference({
    messages: [
      { role: 'system', content: 'Analyze the test output and suggest fixes.' },
      { role: 'user', content: `Output:\n${testOutput}\nIssue: ${task}` }
    ]
  });

  codebolt.chat.sendMessage(
    debugResponse.completion?.choices?.[0]?.message?.content || 'Unable to debug.',
    {}
  );
}

async function handleQuestion(question: string) {
  // Search the codebase for context
  const searchResults = await codebolt.fs.searchFiles(question, '/');

  // Answer with LLM using codebase context
  const answer = await codebolt.llm.inference({
    messages: [
      { role: 'system', content: 'Answer based on the codebase search results.' },
      { role: 'user', content: `Question: ${question}\nResults:\n${JSON.stringify(searchResults)}` }
    ]
  });

  codebolt.chat.sendMessage(
    answer.completion?.choices?.[0]?.message?.content || 'No answer found.',
    {}
  );
}

Using MCP Tools Directly:

// List available tools from MCP servers
const { data: tools } = await codebolt.mcp.listMcpFromServers(['codebolt']);

// Execute a specific tool — permissions handled by the application
const { data } = await codebolt.mcp.executeTool('codebolt', 'readFile', { path: '/src/index.ts' });
const [didUserReject, fileContent] = data;
if (!didUserReject) {
  console.log('File content:', fileContent);
}

Core API modules available:

ModuleKey Methods
codebolt.llminference(params)
codebolt.fsreadFile, createFile, updateFile, deleteFile, listFiles, searchFiles
codebolt.terminalexecuteCommand, executeCommandRunUntilError
codebolt.gitinit, status, add, commit, push, pull, checkout, diff, clone
codebolt.browsergoToPage, screenshot, click, type, getMarkdown
codebolt.chatsendMessage, getHistory
codebolt.mcpexecuteTool, listMcpFromServers, getTools
codebolt.agentfindAgent, startAgent, getAgentsList
codebolt.threadcreateThreadInBackground
codebolt.memoryMemory storage
codebolt.todogetAllIncompleteTodos
codebolt.stateState persistence

Side-by-Side: Same Task, Three Types

The same task — "Read a file and summarize it" — using all three approaches:

Type 1 (CodeboltAgent — simplest):

const agent = new CodeboltAgent({
  instructions: 'You are a file summarizer. Read files and provide concise summaries.'
});
codebolt.onMessage(async (msg) => await agent.processMessage(msg));

Type 2 (Base Components — custom loop):

codebolt.onMessage(async (msg) => {
  const gen = new InitialPromptGenerator({
    processors: [
      new CoreSystemPromptModifier({ customSystemPrompt: 'Summarize files.' }),
      new ToolInjectionModifier({ includeToolDescriptions: true, allowedTools: ['codebolt--readFile'] })
    ],
    baseSystemPrompt: 'Summarize files.'
  });
  let prompt = await gen.processMessage(msg);
  let done = false;
  do {
    const step = await new AgentStep({}).executeStep(msg, prompt);
    const exec = await new ResponseExecutor({
      preToolCallProcessors: [], postToolCallProcessors: []
    }).executeResponse({
      initialUserMessage: msg, actualMessageSentToLLM: step.actualMessageSentToLLM,
      rawLLMOutput: step.rawLLMResponse, nextMessage: step.nextMessage
    });
    done = exec.completed;
    prompt = exec.nextMessage;
  } while (!done);
});

Type 3 (Core API — full control):

codebolt.onMessage(async (msg) => {
  const filePath = extractFilePath(msg.userMessage);
  const content = await codebolt.fs.readFile(filePath);
  const response = await codebolt.llm.inference({
    messages: [
      { role: 'system', content: 'Summarize the following file.' },
      { role: 'user', content: `File: ${filePath}\n\n${content}` }
    ]
  });
  codebolt.chat.sendMessage(response.completion?.choices?.[0]?.message?.content || '', {});
});

Getting Started: Codebolt CLI

Use the codebolt-cli command-line tool to generate templates for agents and MCP tools. This is the recommended starting point for creating new agents or tools.

Create an Agent Template

# Interactive mode (recommended)
npx codebolt-cli createagent

# Quick mode with name
npx codebolt-cli createagent -n "MyAgent" --quick

This generates a complete agent project structure with:

  • codeboltagent.yaml - Agent configuration
  • package.json - Dependencies
  • src/index.ts - Entry point with boilerplate code

Create an MCP Tool Template

# Interactive mode
npx codebolt-cli createtool

# With options
npx codebolt-cli createtool -n "MyTool" -i "my-tool-id" -d "Tool description"

This generates an MCP tool project with:

  • codebolttool.yaml - Tool configuration
  • package.json - Dependencies
  • src/index.ts - MCP server boilerplate

Other Useful CLI Commands

CommandDescription
npx codebolt-cli loginAuthenticate with Codebolt platform
npx codebolt-cli publishagent [path]Publish agent to registry
npx codebolt-cli publishtool [path]Publish MCP tool to registry
npx codebolt-cli listagentsList your published agents
npx codebolt-cli listtoolsList your published MCP tools
npx codebolt-cli startagent [path]Start agent locally for testing
npx codebolt-cli cloneagent <id> [path]Clone an existing agent
npx codebolt-cli inspecttool <file>Debug tool with MCP inspector

Project Structure

my-agent/
├── codeboltagent.yaml    # Agent configuration (required)
├── package.json          # Dependencies
├── src/
│   └── index.ts          # Agent entry point
└── dist/                 # Compiled output

Building the Agent

IMPORTANT: After creating or modifying an agent, you MUST build it before running.

# Install dependencies first
npm install

# Build the agent (compiles TypeScript to JavaScript)
npm run build

# Or use webpack directly if configured
npx webpack

The build process:

  1. Compiles TypeScript files from src/ to JavaScript in dist/
  2. Bundles all dependencies (usually via webpack)
  3. Creates the entry point specified in codeboltagent.yaml (typically dist/index.js)

Always run these commands after creating an agent:

# Complete setup flow
npm install && npm run build

# Verify the build succeeded
ls -la dist/

Common build issues:

  • Missing dependencies: Run npm install first
  • Type errors: Run npx tsc --noEmit to check
  • Webpack errors: Check webpack.config.js exists and is valid

Package.json scripts should include:

{
  "scripts": {
    "build": "npx webpack",
    "dev": "npx tsx src/index.ts",
    "typecheck": "npx tsc --noEmit",
    "lint": "npx eslint src/"
  }
}

Architecture Overview

Codebolt provides a layered architecture for building AI agents. The three main types (described above with detailed examples) plus no-code Remix Agents and reusable ActionBlocks:

┌─────────────────────────────────────────────────────────────────┐
│  REMIX AGENTS: No-Code Configuration                            │
│  Markdown files with YAML frontmatter + custom instructions     │
│  → Use when: You want agents without writing any code           │
├─────────────────────────────────────────────────────────────────┤
│  CodeboltAgent Wrapper (Level 3): High-Level Abstractions       │
│  CodeboltAgent, Agent, Workflow, Tools                          │
│  → Use when: Simple prompt-based agent, no custom loop needed   │
├─────────────────────────────────────────────────────────────────┤
│  Base Components (Level 2): Custom Agentic Loop                 │
│  InitialPromptGenerator, AgentStep, ResponseExecutor            │
│  → Use when: You need to customize the agentic loop             │
├─────────────────────────────────────────────────────────────────┤
│  Core API (Level 1): Full Control                               │
│  codebolt.llm, codebolt.fs, codebolt.terminal, etc.            │
│  → Use when: Advanced behavior, build everything from scratch   │
└─────────────────────────────────────────────────────────────────┘
         ↑↓ Mix & Match ↑↓
┌─────────────────────────────────────────────────────────────────┐
│  ActionBlocks: Reusable logic units invoked from any level      │
└─────────────────────────────────────────────────────────────────┘

Remember: Permissions, tool approval, and access control are ALL
handled by the Codebolt application — your agent code does not
need to implement any permission logic.

Remix Agents (No-Code)

Remix Agents let you create agents without writing any code. They're stored as markdown files with YAML frontmatter in .codebolt/agents/remix/.

File Format

---
name: my-code-reviewer
description: A specialized code review agent
model: claude-sonnet-4-20250514
provider: anthropic
tools:
  - codebolt--readFile
  - codebolt--writeFile
  - codebolt--search
maxSteps: 100
reasoningEffort: medium
skills:
  - code-review
remixedFromId: base-coding-agent
remixedFromTitle: Base Coding Agent
version: 1.0.0
---

# Custom Instructions

You are a code review specialist. When reviewing code:

1. Check for security vulnerabilities
2. Identify performance issues
3. Suggest improvements
4. Note style inconsistencies

Always provide constructive feedback with examples.

MarkdownAgent Fields

FieldTypeDescription
namestringAgent identifier (becomes filename)
descriptionstringBrief description
modelstringModel to use (e.g., "claude-sonnet-4-20250514")
providerstringProvider name (e.g., "anthropic", "openai")
toolsstring[]Tools available to the agent
maxStepsnumberMax agentic iterations
reasoningEffort'low' \'medium' \'high'For reasoning models
skillsstring[]Skills to auto-load
remixedFromIdstringOriginal agent ID (when remixing)
additionalSubAgentSubAgentConfig[]Sub-agents to include

When to Use Remix Agents

  • Quick customization of existing agents
  • Non-developers creating agents
  • Prototyping before building full code agents
  • Sharing agents as portable markdown files
  • Compatible with external tools (OpenCode, Factory.ai, Claude Code)

See: references/remix-agents.md

Mixing and Matching Levels

Levels are NOT exclusive. You can combine them based on your needs:

// Example: Level 3 agent + Level 1 direct API calls outside the loop
import { CodeboltAgent } from '@codebolt/agent/unified';
import codebolt from '@codebolt/codeboltjs';
import { FlatUserMessage } from "@codebolt/types/sdk";

codebolt.onMessage(async (msg:FlatUserMessage) => {
  // Level 1: Send initial status message
  codebolt.chat.sendMessage('Starting analysis...');

  // Level 1: Do pre-processing with direct APIs
  const files = await codebolt.fs.listFile('./src', true);

  // Level 3: Use high-level agent for the main work
  const agent = new CodeboltAgent({ instructions: 'You are a code reviewer.' });
  const result = await agent.processMessage(msg);

  // Level 1: Post-processing with direct APIs
  await codebolt.memory.json.save({ review: result, files: files.data });
  codebolt.chat.sendMessage('Review complete and saved!');
});

Common mixing patterns:

PatternDescription
Level 3 + Level 1 outside loopUse CodeboltAgent but add direct API calls before/after
Level 2 + custom loop logicUse base components but add custom iteration control
Level 3 + ActionBlocksUse CodeboltAgent with ActionBlocks for reusable subtasks
Workflow + ActionBlocksWorkflow steps that invoke ActionBlocks

The Agent Loop Pattern

Codebolt agents follow a standard execution pattern:

┌────────────────────────────────────────────────────────────────┐
│  1. onMessage() receives user message                          │
│  2. Process into initial prompt (attach context, tools, etc.)  │
│  3. AGENT LOOP:                                                │
│     ├─► Send prompt to LLM                                     │
│     ├─► Get response (may include tool_calls)                  │
│     ├─► If tool_calls: execute tools, add results to prompt    │
│     ├─► Check for async events (child agents, completions)     │
│     └─► Repeat until no tool_calls AND no pending events       │
│  4. Return final response                                      │
└────────────────────────────────────────────────────────────────┘

Basic Pattern

import type { ProcessedMessage, AgentStepOutput, ResponseExecutorResult } from '@codebolt/types/agent';

codebolt.onMessage(async (reqMessage: FlatUserMessage): Promise<void> => {
  // 1. Process message into prompt
  let prompt: ProcessedMessage = await promptGenerator.processMessage(reqMessage);

  // 2. Agent loop
  let completed: boolean = false;
  let execResult: ResponseExecutorResult;
  while (!completed) {
    const stepResult: AgentStepOutput = await agentStep.executeStep(reqMessage, prompt);
    execResult = await responseExecutor.executeResponse({
      initialUserMessage: reqMessage,
      actualMessageSentToLLM: stepResult.actualMessageSentToLLM,
      rawLLMOutput: stepResult.rawLLMResponse,
      nextMessage: stepResult.nextMessage
    });

    completed = execResult.completed;
    prompt = execResult.nextMessage;
  }

  return execResult!.finalMessage;
});

With Async Event Handling (Orchestrator Pattern)

const eventQueue = codebolt.agentEventQueue;
const agentTracker = codebolt.backgroundChildThreads;

codebolt.onMessage(async (reqMessage:FlatUserMessage) => {
  let prompt = await promptGenerator.processMessage(reqMessage);
  let continueLoop = true;

  do {
    // Run agent loop until no tool calls
    const result = await runAgentLoop(reqMessage, prompt);
    prompt = result.prompt;

    // Check for events from child agents
    if (agentTracker.getRunningAgentCount() > 0 ||
        eventQueue.getPendingExternalEventCount() > 0) {
      const events = await eventQueue.getPendingQueueEvents();
      // Process events, add to prompt
      continueLoop = true;
    } else {
      continueLoop = false;
    }
  } while (continueLoop);
});

Long-Running Orchestrator (Never Exits)

// For orchestrators that wait for child agents indefinitely
while (true) {
  const event = await eventQueue.waitForAnyExternalEvent();
  // Process event...
}

See: references/level2-base-components.md for full details.

ActionBlocks

ActionBlocks are reusable, independently executable units of logic that can be invoked from agents, workflows, or other ActionBlocks.

⚠️ CRITICAL: Do NOT Write Inline Action Block Logic in Agents When generating agent code, NEVER write action block logic inline within the agent code. ActionBlocks are designed as separate, reusable components that exist independently in the /action-blocks/ directory. ``typescript import type { FlatUserMessage } from '@codebolt/types/sdk'; // ❌ WRONG - Do NOT write inline action block logic in agents codebolt.onMessage(async (msg: FlatUserMessage): Promise<void> => { // Don't implement planning logic directly here const plan = await createPlanInline(msg); // BAD! const jobs = await breakIntoJobsInline(plan); // BAD! // ...inline implementation... }); // ✅ CORRECT - Invoke existing ActionBlocks by name codebolt.onMessage(async (msg: FlatUserMessage): Promise<void> => { // Call the reusable ActionBlock const planResult = await codebolt.actionBlock.start('create-plan-for-given-task', { userMessage: msg }); if (planResult.success) { const jobsResult = await codebolt.actionBlock.start('break-task-into-jobs', { plan: planResult.result }); } }); ` **Why?** ActionBlocks are: - **Reusable** across multiple agents and workflows - **Independently testable** and deployable - **Discoverable** via codebolt.actionBlock.list() - **Documented** with typed inputs/outputs in actionblock.yml`

When to Use ActionBlocks

  • Extract complex logic into reusable components
  • Share functionality across multiple agents
  • Create modular, testable units of work
  • Build orchestration pipelines with Workflows
  • Always invoke existing ActionBlocks instead of reimplementing their logic inline

Quick Start

// Invoke an ActionBlock
const result = await codebolt.actionBlock.start('create-plan-for-given-task', {
  userMessage: reqMessage
});

if (result.success) {
  console.log('Plan created:', result.result.planId);
}

Creating an ActionBlock

// src/index.ts
import codebolt from '@codebolt/codeboltjs';

// Define types for ActionBlock invocation (see references/action-blocks.md for full definitions)
interface ThreadContext {
  params?: Record<string, unknown>;
  [key: string]: unknown;
}

interface ActionBlockInvocationMetadata {
  sideExecutionId: string;
  threadId: string;
  parentAgentId: string;
  parentAgentInstanceId: string;
  timestamp: string;
}

codebolt.onActionBlockInvocation(async (threadContext: ThreadContext, metadata: ActionBlockInvocationMetadata) => {
  const params = threadContext?.params || {};
  const { task, options } = params;

  // Validate
  if (!task) {
    return { success: false, error: 'task is required' };
  }

  // Send status
  codebolt.chat.sendMessage(`Processing: ${task.name}`);

  // Do work
  const result = await processTask(task, options);

  // Return structured result
  return { success: true, data: result };
});

ActionBlocks + Workflows

import { Workflow } from '@codebolt/agent/unified';
import codebolt from '@codebolt/codeboltjs';
import type { FlatUserMessage } from '@codebolt/types/sdk';
import type { WorkflowStepResult, WorkflowContext } from '@codebolt/types/agent';

interface OrchestrationContext extends WorkflowContext {
  userMessage: FlatUserMessage;
  planId?: string;
  jobs?: Array<{ id: string; name: string }>;
}

const orchestrationWorkflow: Workflow = new Workflow({
  name: 'Task Orchestration',
  steps: [
    {
      id: 'create-plan',
      execute: async (ctx: OrchestrationContext): Promise<WorkflowStepResult<{ planId: string }>> => {
        const result = await codebolt.actionBlock.start('create-plan-for-given-task', {
          userMessage: ctx.userMessage
        });
        return { success: result.success, data: { planId: result.result?.planId } };
      }
    },
    {
      id: 'create-jobs',
      execute: async (ctx: OrchestrationContext): Promise<WorkflowStepResult<{ jobs: Array<{ id: string; name: string }> }>> => {
        const result = await codebolt.actionBlock.start('create-jobs-from-plan', {
          planId: ctx.planId
        });
        return { success: result.success, data: { jobs: result.result?.jobs } };
      }
    }
  ]
});

See: references/action-blocks.md

Choosing the Right Level

NeedTypeWhat to Use
No-code agent creationRemixMarkdown file with YAML frontmatter
Simple prompt-based agent, no custom loopCodeboltAgent WrapperCodeboltAgent with instructions
Custom agent loop logicBase ComponentsInitialPromptGenerator + AgentStep + ResponseExecutor
Full manual control, advanced behaviorCore APIDirect codebolt.* APIs
Multi-step orchestrationCodeboltAgent WrapperWorkflow with steps
Orchestrator with child agentsBase ComponentsAgent loop + agentEventQueue
Long-running orchestratorBase ComponentswaitForAnyExternalEvent() loop
Reusable logic unitsActionBlockscodebolt.actionBlock.start() (invoke, don't inline!)
Tools for single agentCodeboltAgent WrappercreateTool() with Zod schemas
Shared tools across agentsMCPMCPServer from @codebolt/mcp
Custom context injectionAnyExtend BaseMessageModifier
Remember: When an ActionBlock exists for a task (planning, job creation, etc.), always invoke it via codebolt.actionBlock.start('action-block-name', params) rather than implementing the logic inline in your agent. Remember: Permissions (tool approval, file access, workspace boundaries) are handled by the Codebolt application. Your agent does not need to implement any permission logic.

Tool Execution Architecture

ResponseExecutor automatically handles tool execution from LLM responses. You should use it instead of manually parsing and executing tools.

Built-in Tool Routes

The ResponseExecutor routes tools based on naming conventions:

Tool PatternRouteExecution
toolbox--toolnameMCPcodebolt.mcp.executeTool(toolbox, toolname, args)
subagent--agentnameSubagentcodebolt.agent.startAgent(agentname, task)
codebolt--thread_managementThreadcodebolt.thread.createThreadInBackground(options)
attempt_completionCompletionMarks task as complete

When to Use What

NeedApproach
Standard MCP toolsJust use ResponseExecutor - it handles them automatically
Custom local toolsAdd a PreToolCallProcessor to intercept and handle
Enhance tool resultsAdd a PostToolCallProcessor to modify results
Manual controlLevel 1 direct APIs (not recommended for production)

Adding Custom/Local Tools

Use PreToolCallProcessor to intercept tool calls and execute custom logic:

import { BasePreToolCallProcessor } from '@codebolt/agent/processor-pieces';
import type { PreToolCallProcessorInput, ProcessedMessage } from '@codebolt/types/agent';

class MyLocalToolProcessor extends BasePreToolCallProcessor {
  async modify(input: PreToolCallProcessorInput): Promise<{
    nextPrompt: ProcessedMessage;
    shouldExit: boolean;
  }> {
    const toolCalls = input.rawLLMResponseMessage.choices?.[0]?.message?.tool_calls || [];

    for (const toolCall of toolCalls) {
      if (toolCall.function.name === 'my_local_tool') {
        // Execute your custom tool
        const args = JSON.parse(toolCall.function.arguments);
        const result = await myLocalHandler(args);

        // Add result to message history
        input.nextPrompt.message.messages.push({
          role: 'tool',
          tool_call_id: toolCall.id,
          content: JSON.stringify(result)
        });
      }
    }

    return { nextPrompt: input.nextPrompt, shouldExit: false };
  }
}

// Register with ResponseExecutor
const responseExecutor = new ResponseExecutor({
  preToolCallProcessors: [new MyLocalToolProcessor()],
  postToolCallProcessors: []
});

See: references/level2-base-components.md for complete examples, references/processors.md for processor details.

Agent Configuration (codeboltagent.yaml)

Every code-based agent requires a codeboltagent.yaml file that defines how Codebolt reads and presents the agent.

Basic Structure

title: My Agent
unique_id: my-agent
version: 1.0.0
author: your-name

initial_message: Hello! How can I help you today?
description: Short description of the agent
longDescription: >
  A longer description explaining what this agent does,
  its capabilities, and use cases.

tags:
  - coding
  - review

avatarSrc: https://example.com/avatar.png
avatarFallback: MA

metadata:
  agent_routing:
    worksonblankcode: true
    worksonexistingcode: true
    supportedlanguages:
      - typescript
      - javascript
    supportedframeworks:
      - react
      - node
    supportRemix: true

  defaultagentllm:
    strict: true
    modelorder:
      - claude-sonnet-4-20250514
      - gpt-4-turbo

  llm_role:
    - name: documentationllm
      description: LLM for documentation tasks
      strict: false
      modelorder:
        - gpt-4-turbo
        - claude-sonnet-4-20250514

actions:
  - name: Review
    description: Review code for issues
    detailDescription: Performs comprehensive code review
    actionPrompt: Please review this code
  - name: Refactor
    description: Refactor selected code
    detailDescription: Improves code structure
    actionPrompt: Please refactor this code

Key Fields

FieldTypeDescription
titlestringDisplay name of the agent
unique_idstringUnique identifier (used internally)
versionstringSemantic version (e.g., "1.0.0")
initial_messagestringFirst message shown to user
descriptionstringShort description (shown in agent list)
longDescriptionstringDetailed description
tagsstring[]Categorization tags
avatarSrcstringURL to agent avatar image
avatarFallbackstringFallback text for avatar
authorstringAgent author/creator

Metadata Fields

FieldDescription
agent_routing.worksonblankcodeCan work on new projects
agent_routing.worksonexistingcodeCan work on existing projects
agent_routing.supportedlanguagesList of supported languages
agent_routing.supportedframeworksList of supported frameworks
agent_routing.supportRemixAllow users to remix this agent
defaultagentllm.strictRequire exact model match
defaultagentllm.modelorderPreferred models in order
llm_roleRole-specific LLM configurations

Actions

Actions are quick commands users can trigger:

actions:
  - name: ActionName
    description: Short description shown in UI
    detailDescription: Longer explanation
    actionPrompt: The prompt sent to the agent

See: references/agent-yaml.md for full reference.

Level 1: Direct APIs

For building agents manually without any framework.

Use the existing skills:

  • codebolt-api-access - TypeScript SDK calls (codebolt.fs, codebolt.llm, etc.)
  • codebolt-mcp-access - MCP tool execution (codebolt.tools.executeTool)

See: references/level1-direct-apis.md

Level 2: Base Components

For custom agent loop with helper functions.

import { InitialPromptGenerator, AgentStep, ResponseExecutor } from '@codebolt/agent/unified';
import { ChatHistoryMessageModifier, CoreSystemPromptModifier } from '@codebolt/agent/processor-pieces';
import type { FlatUserMessage } from '@codebolt/types/sdk';
import type { ProcessedMessage, AgentStepOutput, ResponseExecutorResult } from '@codebolt/types/agent';

const promptGenerator: InitialPromptGenerator = new InitialPromptGenerator({
  processors: [new ChatHistoryMessageModifier(), new CoreSystemPromptModifier()]
});
const agentStep: AgentStep = new AgentStep({});
const responseExecutor: ResponseExecutor = new ResponseExecutor({});

let prompt: ProcessedMessage = await promptGenerator.processMessage(userMessage);
let completed: boolean = false;
while (!completed) {
  const stepResult: AgentStepOutput = await agentStep.executeStep(userMessage, prompt);
  const execResult: ResponseExecutorResult = await responseExecutor.executeResponse({
    initialUserMessage: userMessage,
    actualMessageSentToLLM: stepResult.actualMessageSentToLLM,
    rawLLMOutput: stepResult.rawLLMResponse,
    nextMessage: stepResult.nextMessage
  });
  completed = execResult.completed;
  prompt = execResult.nextMessage;
}

See: references/level2-base-components.md

Level 3: High-Level Abstractions

For production-ready agents with minimal setup.

import { CodeboltAgent } from '@codebolt/agent/unified';
import type { AgentResult } from '@codebolt/types/agent';

const agent: CodeboltAgent = new CodeboltAgent({
  instructions: 'You are a coding assistant.',
  enableLogging: true
});

const result: AgentResult = await agent.processMessage({
  userMessage: 'Help me write a function',
  threadId: 'thread-123',
  messageId: 'msg-456'
});

if (result.success) {
  console.log('Result:', result.result);
} else {
  console.error('Error:', result.error);
}

See: references/level3-high-level.md

Creating Custom Tools

Two approaches for adding custom tools:

ApproachPackageUse Case
Local Tools@codebolt/agentTools used within your agent code
MCP Servers@codebolt/mcpStandalone tool servers, shared across agents

Local Tools (Quick)

import { createTool } from '@codebolt/agent/unified';
import { z } from 'zod';

const searchTool = createTool({
  id: 'search-files',
  description: 'Search for files matching a pattern',
  inputSchema: z.object({ pattern: z.string(), directory: z.string().optional() }),
  execute: async ({ input }) => ({ files: ['file1.ts', 'file2.ts'] })
});

Custom MCP Servers (Shared)

import { MCPServer } from '@codebolt/mcp';
import { z } from 'zod';

interface GreetArgs {
  name: string;
}

const server: MCPServer = new MCPServer({ name: 'my-tools', version: '1.0.0' });

server.addTool({
  name: 'greet',
  description: 'Greet someone',
  parameters: z.object({ name: z.string() }),
  execute: async (args: GreetArgs): Promise<string> => {
    return 'Hello, ' + args.name + '!';
  }
});

await server.start({ transportType: 'stdio' });

See: references/tools.md

Creating Custom Modifiers & Processors

import { BaseMessageModifier } from '@codebolt/agent/processor-pieces';
import type { FlatUserMessage } from '@codebolt/types/sdk';
import type { ProcessedMessage } from '@codebolt/types/agent';

class MyModifier extends BaseMessageModifier {
  async modify(
    originalRequest: FlatUserMessage,
    createdMessage: ProcessedMessage
  ): Promise<ProcessedMessage> {
    createdMessage.message.messages.push({ role: 'system', content: 'Custom context' });
    return createdMessage;
  }
}

See: references/processors.md

Building Workflows

import { Workflow } from '@codebolt/agent/unified';
import type { WorkflowStepResult, WorkflowContext } from '@codebolt/types/agent';

const workflow: Workflow = new Workflow({
  name: 'Code Review',
  steps: [
    { id: 'lint', execute: async (ctx: WorkflowContext): Promise<WorkflowStepResult<object>> => ({ success: true, data: {} }) },
    { id: 'test', execute: async (ctx: WorkflowContext): Promise<WorkflowStepResult<object>> => ({ success: true, data: {} }) }
  ]
});

const result = await workflow.executeAsync();

See: references/workflows.md

Key Imports

// Level 3 - High-level
import { CodeboltAgent, Agent, Workflow, createTool } from '@codebolt/agent/unified';

// Level 2 - Base components
import { InitialPromptGenerator, AgentStep, ResponseExecutor } from '@codebolt/agent/unified';

// Processors & Modifiers
import {
  BaseMessageModifier, CoreSystemPromptModifier, ChatHistoryMessageModifier,
  ToolInjectionModifier, EnvironmentContextModifier, DirectoryContextModifier,
  IdeContextModifier, BasePreInferenceProcessor, BasePostInferenceProcessor,
  BasePreToolCallProcessor, BasePostToolCallProcessor
} from '@codebolt/agent/processor-pieces';

// Custom MCP Servers
import { MCPServer } from '@codebolt/mcp';

// Level 1 - Direct APIs, ActionBlocks & Event Queue
import codebolt from '@codebolt/codeboltjs';
// codebolt.actionBlock.start(), codebolt.actionBlock.list()
// codebolt.agentEventQueue.getPendingQueueEvents()
// codebolt.agentEventQueue.waitForAnyExternalEvent()
// codebolt.backgroundChildThreads.getRunningAgentCount()

// SDK Types (from @codebolt/types/sdk)
import type {
  FlatUserMessage,          // User message input
  LLMCompletion,            // Raw LLM response
  ChatMessage,              // Message in conversation
  ToolCall,                 // Tool call from LLM
  MessageObject             // Generic message object
} from '@codebolt/types/sdk';

// Agent Types (from @codebolt/types/agent)
import type {
  ProcessedMessage,         // Output from InitialPromptGenerator
  AgentStepOutput,          // Output from AgentStep.executeStep()
  ResponseExecutorResult,   // Output from ResponseExecutor.executeResponse()
  AgentResult,              // Output from CodeboltAgent.processMessage()
  WorkflowStepResult,       // Result from workflow step execute()
  WorkflowContext,          // Workflow execution context
  PreToolCallProcessorInput,  // Input to pre-tool call processor
  PostToolCallProcessorInput  // Input to post-tool call processor
} from '@codebolt/types/agent';

References

TopicFile
Agent YAML Configurationreferences/agent-yaml.md
Remix Agents (No-Code)references/remix-agents.md
Mixing & Matching LevelsThis file (above)
Level 1: Direct APIsreferences/level1-direct-apis.md
Level 2: Base Componentsreferences/level2-base-components.md
Level 3: High-Levelreferences/level3-high-level.md
ActionBlocksreferences/action-blocks.md
Toolsreferences/tools.md
Processors & Modifiersreferences/processors.md
Workflowsreferences/workflows.md
Examplesreferences/examples.md

Code Quality: Linting & Error Checking

IMPORTANT: After writing or modifying agent code, ALWAYS lint and check for errors before running. This is a critical step that should never be skipped.

Use Strict Typings

You do NOT need to create custom typings. Types for most Codebolt functionality are already provided by the packages:

  • @codebolt/codeboltjs - Types for direct SDK APIs
  • @codebolt/agent - Types for agent components, workflows, tools
  • @codebolt/types - Shared type definitions

Simply use the existing types — they are automatically available when you import from these packages:

// Types are included with the packages - no separate install needed
import codebolt from '@codebolt/codeboltjs';
import { CodeboltAgent, Workflow, createTool } from '@codebolt/agent/unified';

// Common SDK types
import type { FlatUserMessage, MessageObject, LLMCompletion } from '@codebolt/types/sdk';
import type { ProcessedMessage, AgentConfig } from '@codebolt/types/agent';

Run Error Checks

# Run TypeScript compiler to check for type errors
npx tsc --noEmit

# Run ESLint to check for code quality issues
npx eslint src/

# Or if the project has npm scripts configured
npm run lint
npm run typecheck

Common Checks to Perform

  1. Type errors - Ensure all TypeScript types are correct (use @codebolt/types)
  2. Import errors - Verify all imports resolve correctly
  3. Unused variables - Remove or use declared variables
  4. Missing dependencies - Install required packages
  5. Schema validation - Validate codeboltagent.yaml structure
  6. Async/await errors - Ensure proper handling of promises

Tip: Configure your IDE to show errors inline, or run npx tsc --watch during development for real-time feedback.

Best Practices for Agent Development

1. Always Invoke ActionBlocks, Never Inline Their Logic

This is the most important rule when generating agent code:

// ✅ DO: Invoke existing ActionBlocks by name
const result = await codebolt.actionBlock.start('create-plan-for-given-task', {
  userMessage: msg
});

// ❌ DON'T: Implement action block logic inline in your agent
// const prompt = new InitialPromptGenerator({...});
// const plan = await generatePlanInline(msg); // BAD!

2. Discover Before Implementing

Before writing any complex logic, check if an ActionBlock already exists:

// List available ActionBlocks
const blocks = await codebolt.actionBlock.list();

// Check if there's one for your use case
const planningBlock = blocks.data.find(b => b.name.includes('plan'));
if (planningBlock) {
  // Use it instead of writing inline logic
  const result = await codebolt.actionBlock.start(planningBlock.name, params);
}

3. Keep Agents Thin

Agents should be orchestrators, not implementors:

  • Use ActionBlocks for complex logic (planning, job creation, task decomposition)
  • Use Workflows for multi-step orchestration
  • Keep agent code focused on flow control and user interaction

4. Type-Safe ActionBlock Calls

// Define expected response type
interface PlanResult {
  planId: string;
  tasks: Array<{ id: string; name: string }>;
}

// Use typed response
const result = await codebolt.actionBlock.start<PlanResult>('create-plan-for-given-task', {
  userMessage: msg
});

if (result.success && result.result) {
  const planId = result.result.planId;  // TypeScript knows this exists
}

Related Skills

Use these skills to get detailed information about Codebolt APIs and MCP tools:

  • codebolt_api_access - Access detailed documentation for all direct TypeScript SDK APIs (codebolt.fs, codebolt.llm, codebolt.terminal, codebolt.chat, etc.). Use this skill when you need to understand the exact method signatures, parameters, and return types for Level 1 direct API calls.
  • codebolt-mcp-access - Access documentation for MCP (Model Context Protocol) functions and tool execution (codebolt.tools.executeTool, codebolt.tools.getTools, etc.). Use this skill when you need to understand how to execute MCP tools, list available tools, or build custom MCP servers.

平台分布

Codex

38.12%
按下载量换算54

Claude

31.79%
按下载量换算45

Cursor

18.69%
按下载量换算26

Gemini CLI

9.38%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/codeboltai/codeboltjs --skill codebolt-agent-development 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

继续浏览同类 Skills