본문으로 건너뛰기
Skillpedia
에이전트7.6k · #13163

harness-agents

하는 일

이 스킬은 Claude Code, Codex, Cursor 같은 완전한 하네스를 Agent-Native에 고유한 런타임 계층으로 추가하는 방법을 설명합니다. 실행 시작, 세션 상태 저장, 백그라운드 작업 표시를 다룹니다. 이 에이전트들을 앱 안에서 쓰려는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Claude Code나 Codex가 Agent-Native 앱 안에서 작업을 실행하기를 원할 때.
  • ✓외부 에이전트 프로그램의 세션 상태를 턴 사이에 저장해야 할 때.
  • ✓앱에서 백그라운드 에이전트 실행을 보여 주고 싶을 때.

스킬 링크

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/harness-agents/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/harness-agents/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Codex가 내 앱 안에서 코딩 작업을 실행하고, 나중에 이어서 할 수 있도록 세션을 유지하게 해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

개발자는 하네스 어댑터를 등록하고, 실행 관리자를 통해 실행을 시작합니다. 세션 상태는 앱의 데이터베이스에 저장되고, 하네스는 자체 반복 루프를 유지합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Harness Agents

Rule

Full agent harnesses are not AgentEngine providers. Use the AgentHarness substrate in @agent-native/core/agent/harness.

Why

AgentEngine is for one model round trip beneath runAgentLoop. Harnesses like Claude Code, Codex, Pi, Cursor, and Mastra own their own loop, workspace, native tools, session state, compaction, approval model, and sandbox behavior. Putting a harness under AgentEngine.stream() double-runs the loop and loses session lifecycle semantics.

How

  1. Register or resolve a harness adapter.
import {
  registerBuiltinAgentHarnesses,
  resolveAgentHarness,
} from "@agent-native/core/agent/harness";

registerBuiltinAgentHarnesses();
const harness = resolveAgentHarness("ai-sdk-harness:codex");
  1. Start a turn through the run-manager bridge.
import { startAgentHarnessRun } from "@agent-native/core/agent/harness";

startAgentHarnessRun({
  runId,
  threadId,
  adapter: harness,
  input: { prompt },
  createSession: {
    sessionId,
    resumeState,
    instructions,
    sandbox,
    permissionMode: "allow-reads",
  },
  ownerEmail,
  orgId,
});
  1. Persist native session state in SQL.

Use saveAgentHarnessSession, updateAgentHarnessSession, and getLatestAgentHarnessSessionForThread. The resumeState is opaque; Agent Native stores it but does not inspect it.

  1. Surface runs through background agents.

Harness runs are projected into the shared BackgroundAgentRun shape with createAgentHarnessBackgroundAgentController() and are available through the existing run routes as goalId=agent-harness.

ACP Agents

Agent-Native can act as an ACP (Agent Client Protocol) client and drive a local coding agent — Gemini CLI, Claude Code, or any ACP-compliant agent — through this same substrate. This is scoped to local coding: the agent is spawned as a child process speaking newline-delimited JSON-RPC over stdio, and inherits the parent environment so it reuses the user's local CLI login. It is not a hosted/sandboxed transport, and it is not a chat/A2A transport.

import {
  registerBuiltinAgentHarnesses,
  resolveAgentHarness,
} from "@agent-native/core/agent/harness";

registerBuiltinAgentHarnesses();

// Built-in presets (commands overridable via the resolve config):
const gemini = resolveAgentHarness("acp:gemini");
const claude = resolveAgentHarness("acp:claude-code");

// Or any ACP agent by command:
const custom = resolveAgentHarness("acp", {
  command: "gemini",
  args: ["--experimental-acp"],
});
  • The protocol transport (@zed-industries/agent-client-protocol) is an optional dependency loaded lazily; installPackage surfaces a clear install hint.
  • The agent binary (e.g. @google/gemini-cli, @zed-industries/claude-code-acp) is a separate external CLI the user installs; presets launch it through npx by default and the command/args are overridable because agent ACP entry flags still evolve.
  • permissionMode maps onto ACP session/request_permission using the reported tool-call kind: reads always run, edits run under allow-edits, everything risky prompts unless allow-all. Approvals surface as approval-request events; answer them through the harness session's approve().
  • resumeState carries the ACP sessionId; resume works when the agent advertises the loadSession capability and degrades to a fresh session otherwise.
  • fs/read_text_file and fs/write_text_file are served against the session workspace and refuse paths that escape it; terminal methods are not advertised (the agent uses its own shell).

Adapter Guidance

  • Keep harness packages optional. Use dynamic imports in adapters and expose an install hint through installPackage.
  • Use the AI SDK harness adapter as one implementation, not as Agent-Native's public abstraction.
  • For bridge-backed coding harnesses, require a real sandbox/workspace provider. Do not run arbitrary coding agents in the host process by default.
  • Pass only a narrow, intentional set of Agent-Native actions as host tools. Preserve defineAction auth, request context, timeouts, truncation, and read-only metadata.

Code Execution Sandbox

  • The run-code tool executes through a pluggable SandboxAdapter (packages/core/src/coding-tools/sandbox/). The default LocalChildProcessAdapter spawns a locked-down local Node child process; swap it via AGENT_NATIVE_SANDBOX or `registerSandboxAdapt
자주 묻는 질문

하네스는 모델 제공자와 같은 것인가요?

아니요. 완전한 하네스는 자체 루프와 상태를 가지므로, 모델 제공자처럼 연결되지 않는다고 이 스킬은 말합니다.

누가 저장된 세션 상태를 읽을 수 있나요?

프레임워크는 상태를 들여다보지 않고 저장합니다. Agent-Native에게 상태는 불투명하기 때문입니다.

어떤 하네스가 지원되나요?

이 스킬은 Claude Code, Codex, Pi, Cursor, Mastra 등 여러 개를 나열합니다.

상세 정보

작성자의 원본 설명

Add or use full agent harness runtimes like Claude Code, Codex, Pi, Cursor, Mastra, or ACP agents inside Agent-Native.

repo: BuilderIO/agent-native

인기도

GitHub 스타
7.6k
순위
#13163
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬