agent-browser
Use Agent Browser for real browser navigation, dynamic pages, and web interaction; also use it as a distinct browser-based path…
当用户希望把 Claude Code 作为 NextClaw 正式会话类型接入,尤其是通过 narp-stdio 配置、安装、修复、doctor、补齐 Runtime default 模型选项或真实冒烟时使用。
$ npx -y skills add peiiii/nextclaw --skill claude-code-narp-runtime --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/claude-code-narp-runtimeContext preview
The summary Claude sees to decide when to auto-load this skill.
当用户希望把 Claude Code 作为 NextClaw 正式会话类型接入,尤其是通过 narp-stdio 配置、安装、修复、doctor、补齐 Runtime default 模型选项或真实冒烟时使用。
name: claude-code-narp-runtime
description: 当用户希望把 Claude Code 作为 NextClaw 正式会话类型接入,尤其是通过 narp-stdio 配置、安装、修复、doctor、补齐 Runtime default 模型选项或真实冒烟时使用。
metadata: {"nextclaw":{"emoji":"C"}}使用这个 skill 时,目标不是让用户自己准备 PATH 或手改配置,而是把 Claude Code 接成 NextClaw 统一 runtime registry 里的正式会话类型。
首选产品路径固定为:
不要把 Claude Code 做成核心系统里的 provider 特判。NextClaw 核心、kernel、service 只感知 `narp-stdio`,不感知 `claude`。
始终区分三层:
安装这个 skill 不等于 Claude Code runtime 已经可用。skill 必须自己检测 launcher,缺失时安装或修复 wrapper,并生成 NextClaw 可稳定调用的绝对路径 shim。
当用户要求“接入 Claude Code”“安装 Claude runtime”“doctor Claude Code runtime”或类似目标时,按下面顺序执行。
先确定 NextClaw 数据目录:
NEXTCLAW_HOME="${NEXTCLAW_HOME:-$HOME/.nextclaw}"需要写入:
如果这是首次接入,先说明 Claude Code runtime 会读取本机工作区并可能执行本地工具;涉及删除、发送、提交、发布等外部可见动作时仍需用户确认。
按优先级解析真实 launcher:
1. 如果当前在 NextClaw 源码仓库,并且存在已构建文件: `packages/extensions/nextclaw-narp-runtime-claude-code-sdk/dist/controllers/claude-code-narp.controller.js` 2. 如果源码存在但 dist 不存在,先构建: `pnpm --filter @nextclaw/nextclaw-narp-runtime-claude-code-sdk build` 3. 如果系统已有 `nextclaw-claude-code-narp`,可作为真实 launcher 来源。 4. 否则安装 wrapper 包到 NextClaw 管理目录:
mkdir -p "$NEXTCLAW_HOME/runtime/claude-code-narp-runtime" npm install --prefix "$NEXTCLAW_HOME/runtime/claude-code-narp-runtime" @nextclaw/nextclaw-narp-runtime-claude-code-sdk@latest
安装后解析:
"$NEXTCLAW_HOME/runtime/claude-code-narp-runtime/node_modules/.bin/nextclaw-claude-code-narp" --help
如果包未发布、npm 不可用或安装失败,报告具体 blocker。不要退化成要求用户手动放 PATH。
把 runtime entry 的 `command` 固定成绝对 shim 路径,而不是裸命令名。
Unix shim 内容形态:
#!/usr/bin/env sh exec "/absolute/path/to/nextclaw-claude-code-narp-or-js" "$@"
如果真实 launcher 是 `.js` 文件或没有执行位,则 shim 应改为:
#!/usr/bin/env sh exec node "/absolute/path/to/claude-code-narp.controller.js" "$@"
写入后执行:
chmod +x "$NEXTCLAW_HOME/bin/nextclaw-claude-code-narp"
用 JSON parser 读写 `$NEXTCLAW_HOME/config.json`,保留现有配置,只补齐或修复 `agents.runtimes.entries.claude`:
{
"enabled": true,
"label": "Claude Code",
"icon": {
"kind": "image",
"src": "app://runtime-icons/claude.ico",
"alt": "Claude"
},
"type": "narp-stdio",
"config": {
"wireDialect": "acp",
"processScope": "per-session",
"modelSelectionMode": "optional",
"command": "/absolute/NEXTCLAW_HOME/bin/nextclaw-claude-code-narp",
"args": [],
"env": {},
"startupTimeoutMs": 10000,
"probeTimeoutMs": 3000,
"requestTimeoutMs": 120000
}
}不要把 provider route、api key、model 写进 runtime entry。模型和 provider 仍由 NextClaw 的 provider/route 配置决定。
`Runtime default` 是明确的用户选择:选中后不传 NextClaw provider route 或 model,并启用 Claude Code 的 user/project/local settings,让 Claude Code 使用自己的配置、鉴权和默认模型;选择其它模型时继续走 NextClaw provider route,不得用失败重试在两条路径之间自动切换。
接入完成必须同时满足:
1. `agents.runtimes.entries.claude.type` 是 `narp-stdio`。 2. `wireDialect` 是 `acp`。 3. `modelSelectionMode` 是 `optional`。 4. `command` 是可执行的绝对 shim 路径。 5. NextClaw runtime probe 能看到 `Claude Code` ready。 6. `Runtime default` 和至少一个显式 NextClaw 模型都能通过 Claude Code NARP 链路返回真实回复。
开发仓库里优先使用已有 smoke 脚本或 NCP chat smoke;不在源码仓库时,使用当前 NextClaw 实例或 CLI 能提供的最近真实会话路径。验证不是看配置文件长得对,而是看真实会话返回。
能力验收至少分三档:
如果用户说“跑通”或“完成”,默认至少跑文本;如果用户明确要求工具/思考或这是 agent runtime 新接入,必须覆盖“思考 + 工具 + 最终文本”的同轮冒烟。
当用户要求 doctor 或报错时,按顺序检查:
1. `$NEXTCLAW_HOME/config.json` 是否存在且 JSON 可解析。 2. `agents.runtimes.entries.claude` 是否存在、enabled 是否为 true。 3. `type`、`wireDialect`、`processScope`、`modelSelectionMode` 是否符合合同。 4. `command` 是否是绝对路径、文件是否存在且可执行。 5. shim 指向的真实 launcher 是否存在,`--help` 是否能启动。 6. NextClaw runtime list/probe 是否显示 Claude Code ready。 7. provider route 是否能解析出模型、apiBase、apiKey、headers。 8. 真实 Claude Code NARP 会话是否能回复。
根据第一个失败点修复。不要在下游事件层伪造成功。
删除 runtime entry、shim 或 wrapper 安装目录属于破坏性配置变更。除非用户明确要求“移除 Claude Code runtime”,否则只做 disable/repair,不删除文件。
只有在以下条件全部满足后,才能说 Claude Code NARP runtime 已可用:
Your long-term personal AI partner. NextClaw's mission is to be a good long-term partner to you. We are building toward a 1.0 that understands you, takes useful initiative, and continuously improves itself.
Use Agent Browser for real browser navigation, dynamic pages, and web interaction; also use it as a distinct browser-based path…
Turn a user request into a scheduled automation by configuring cron jobs, including session-bound follow-ups and periodic checks.
Use when the user asks to keep watching an external state, notify them when something changes or a condition is met, remember…
Use when deciding how to deliver an AI result: reply now, put durable news, reports, recommendations, or articles in the NextClaw…
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced…