Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

OpenClaw Claude Code 百炼配置

调用 Claude Code CLI 进行代码开发、代码审查、bug 修复和自动化任务。当用户需要:(1) 代码审查和审查 PR,(2) 重构和性能优化,(3) 编写测试,(4) 自动修复 lint 错误,(5) 创建 commit 和 PR,(6) 复杂的多文件代码修改,(7) 使用自然语言描述编程任务时使用此...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 189 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
high confidence
!
Purpose & Capability
The skill's name and description say it calls the Claude Code CLI, but the registry metadata declares no required binaries or env vars. SKILL.md repeatedly expects the 'claude' binary, Anthropic credentials (ANTHROPIC_AUTH_TOKEN / ANTHROPIC_BASE_URL), Git and GitHub interactions, and ability to modify a %USERPROFILE%\.claude settings file. Those capabilities should have been declared; their absence is an incoherence.
!
Instruction Scope
Runtime instructions tell the agent to run installers, call 'claude' in PTY mode, read git diffs and project files, create commits/PRs, add MCP servers (which may include providing environment variables), and modify local config (.claude/agents, settings.json). Many of these actions access user files and credentials (or would require them) but the skill metadata does not declare that scope or those needs.
!
Install Mechanism
There is no formal install spec in the registry, but the SKILL.md recommends executing remote installers (e.g., 'irm https://claude.ai/install.ps1 | iex') and running npx commands for MCP servers. Piping remote PowerShell into iex is high risk (arbitrary remote code execution). These recommended install steps are unsafe unless the user verifies the source and integrity.
!
Credentials
The document references and shows examples using ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, and passing env VAR=value to MCP servers, but the skill declares no required env vars or primary credential. It also instructs operations that commonly require GitHub tokens (creating PRs) without declaring that need. Requesting or handling such credentials is proportionate to the tool's purpose, but the omission in metadata is a red flag and could lead to surprising credential access.
Persistence & Privilege
always:false (good). However, the instructions expect the skill/agent to write or modify user configuration under %USERPROFILE%\.claude and to add MCP servers and agents (persistent config). This is legitimate for a CLI integration but should be explicit in metadata because it modifies user state and can store tokens or endpoints.
What to consider before installing
What to consider before installing/use: - Metadata is missing: the skill uses the 'claude' CLI and Anthropic-style tokens but does not declare required binaries or env vars. Assume you'll need to provide an Anthropic API key and the 'claude' binary. - Do NOT run remote PowerShell scripts you don't fully trust (the README suggests 'irm https://claude.ai/install.ps1 | iex'). Prefer verified installers (winget) or manual installation after inspecting the script. - The skill instructs creating commits/PRs and adding MCP servers (which may require GitHub or other service tokens). Only provide those credentials if you trust the source and scope. - The instructions modify %USERPROFILE%\.claude and .claude/agents; review those files after changes. - Avoid using flags like --dangerously-skip-permissions and prefer --permission-mode plan when doing security-sensitive audits. - If you want to proceed: (1) verify the claude installer URL and prefer official releases/winget, (2) run installs in a controlled environment first (VM/container), (3) only provide service tokens with least privilege, and (4) request the skill author to update registry metadata to declare required binaries and env vars so the skill's intent and privileges are explicit.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
bailianvk975mv286vb37jejvyz5t6ctph82ha9tclaude-codevk975mv286vb37jejvyz5t6ctph82ha9tlatestvk975mv286vb37jejvyz5t6ctph82ha9tmodel-configvk975mv286vb37jejvyz5t6ctph82ha9topenclawvk975mv286vb37jejvyz5t6ctph82ha9t

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Claude Code Skill

此技能允许 OpenClaw 通过 PTY 调用 Claude Code CLI 来执行各种编码任务。

安装和认证

检查安装状态

claude auth status

安装 Claude Code (Windows PowerShell)

irm https://claude.ai/install.ps1 | iex

或使用 WinGet:

winget install Anthropic.ClaudeCode

登录

claude auth login --email user@example.com
# 支持 SSO
claude auth login --sso

在 OpenClaw 中调用 Claude Code

由于 Claude Code 需要交互式 TTY,OpenClaw 必须使用 PTY 模式调用:

方式一:Print 模式 (非交互式,单次任务)

# 执行单次查询,结果直接输出后退出
claude -p "解释 main.py 中的 auth 函数"

# 指定模型 (sonnet/haiku/opus)
claude -p --model sonnet "审查这个代码"

# 限制执行轮次
claude -p --max-turns 5 "修复这个 bug"

# JSON 输出
claude -p --output-format json "分析代码结构"

方式二:交互式模式 (复杂任务,需要 PTY)

# 启动交互式会话,任务完成后退出
claude

# 带初始提示
claude "解释这个项目的结构"

# 继续最近的会话
claude -c

方式三:管道模式

# 处理日志内容
Get-Content app.log | claude -p "找出异常"

# 审查 git 改动的文件
git diff main --name-only | claude -p "审查这些改动的文件"

完整 CLI 参数参考

参数说明示例
-p, --print非交互式,打印结果后退出claude -p "task"
-c, --continue继续最近会话claude -c
-r, --resume恢复指定会话claude -r session-name
--model指定模型 (sonnet/haiku/opus)--model sonnet
--max-turns限制执行轮次--max-turns 3
--max-budget-usd最大 API 花费 (print 模式)--max-budget-usd 5.00
--dangerously-skip-permissions跳过权限确认 (慎用)
--output-format输出格式 (text/json/stream-json)--output-format json
--input-format输入格式--input-format stream-json
--permission-mode权限模式 (plan/auto/medium)--permission-mode plan
--allowedTools允许的工具 (逗号分隔)--allowedTools Read,Bash
--disallowedTools禁止的工具--disallowedTools Edit
--add-dir添加额外工作目录--add-dir ../lib
--agent指定子代理--agent my-agent
--agents动态定义子代理 (JSON)
--chrome启用 Chrome 集成--chrome
--from-pr从 GitHub PR 恢复会话--from-pr 123
--betas启用 Beta 功能--betas interleaved-thinking
--debug调试模式--debug "api,mcp"
--fallback-model备用模型--fallback-model haiku

权限模式

Claude Code 有三种权限模式:

模式说明适用场景
plan只读分析,不修改文件代码审查、安全检查
auto自动执行,无需确认快速开发 (谨慎使用)
medium执行前确认日常开发 (默认)

使用方式

# Plan 模式 - 安全分析
claude --permission-mode plan -p "分析认证系统的安全问题"

# 交互式切换:Shift+Tab 循环切换模式

常用工作流

1. 代码审查

# 审查改动的文件
git diff | claude -p "审查这些改动"

# 审查 PR
claude --from-pr 123 "审查这个 PR"

# 审查特定文件
claude -p "审查 auth.js 的安全性"

2. Bug 修复

# 描述 bug 症状
claude -p "修复登录页面的 401 错误"

# 交互式修复
claude "用户报告支付失败,错误码 E001"

3. 编写测试

claude -p "为 auth 模块编写单元测试"

# 完整流程:写测试 + 运行 + 修复
claude -p "为 auth 模块编写测试,运行并修复失败"

4. 代码重构

claude -p "重构 utils.js 使用现代 JS 特性"
claude -p "优化这个函数的性能"

5. 理解新代码库

claude "给我这个代码库的整体概览"
claude "查找处理用户认证的相关文件"
claude "追踪从登录到数据库的整个流程"

6. 创建 Commit 和 PR

# 创建 commit
claude -p "用描述性消息提交我的改动"

# 创建分支并提交
claude -p "创建 feature/auth 分支并提交改动"

# 创建 PR
claude "创建 PR 并描述这次改动"

7. 处理文档

claude -p "为 auth.js 添加 JSDoc 注释"
claude -p "查找项目中没有文档的函数"

MCP 集成 (Model Context Protocol)

MCP 让 Claude Code 连接外部工具和服务。

添加 MCP Server

# stdio 模式
claude mcp add server-name --transport stdio -- env VAR=value -- npx -y mcp-server

# HTTP 模式
claude mcp add server-name --transport http https://mcp-server.example.com

# SSE 模式
claude mcp add server-name --transport sse https://mcp-server.example.com

列出 MCP Servers

claude mcp list

常用 MCP Servers

  • GitHub: 代码库管理、PR、Issue
  • Filesystem: 文件系统操作
  • Database: 数据库查询
  • Slack/Discord: 消息通知
  • Jira: 任务管理

子代理 (Sub-agents)

Claude Code 可以调用专门的子代理处理特定任务。

使用子代理

# 自动委托
claude -p "审查我的代码改动中的安全问题"

# 明确指定子代理
claude -p "使用 code-reviewer 子代理审查 auth 模块"

查看可用子代理

claude agents

创建自定义子代理

在项目 .claude/agents/ 目录创建 JSON 配置文件,或在项目根目录使用 /agents 命令。


在 OpenClaw 中的最佳实践

1. 简单任务用 Print 模式

# OpenClaw 调用示例 (使用 exec + pty)
claude -p "审查 src/auth.js 的安全性" --permission-mode plan

2. 复杂任务用交互模式

# 需要多轮交互时
claude "重构整个认证模块,使用 OAuth2"

3. 敏感操作用 Plan 模式

# 代码审查、安全分析
claude --permission-mode plan -p "分析这个 PR 的安全风险"

4. 限制资源使用

# 限制花费
claude -p --max-budget-usd 2.00 "修复这个 bug"

# 限制轮次
claude -p --max-turns 10 "重构这个函数"

5. 继续之前的工作

# 继续最近会话
claude -c

# 继续指定会话
claude -r session-name "继续完成这个任务"

工具调用流程 (OpenClaw)

  1. 检查 Claude Code 是否可用

    claude auth status
    
  2. 选择调用模式

    • 简单任务 → --print 模式
    • 复杂任务 → 交互式模式 (需要 PTY)
    • 继续工作 → --continue / --resume
  3. 选择权限模式

    • 只读分析 → --permission-mode plan
    • 日常开发 → --permission-mode medium (默认)
    • 自动化脚本 → --permission-mode auto (谨慎)
  4. 执行并获取结果


注意事项

  • PTY 必需: Claude Code 交互式模式需要 TTY,OpenClaw 必须使用 pty: true
  • 需要登录: Claude Code 需要 Anthropic 账户
  • Print 模式限制: 能力有限,复杂任务用交互式模式
  • 权限安全: 谨慎使用 --dangerously-skip-permissions
  • 资源限制: 生产环境建议设置 --max-budget-usd
  • 会话管理: 使用 -c / -r 继续之前的工作

第三方模型提供商配置

Claude Code 支持配置第三方兼容的模型 API 服务商,如阿里云百炼。

配置文件位置

%USERPROFILE%\.claude\settings.json

阿里云百炼配置示例

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your-api-key-here",
    "ANTHROPIC_BASE_URL": "https://coding.dashscope.aliyuncs.com/apps/anthropic",
    "API_TIMEOUT_MS": "3000000"
  }
}

配置说明

环境变量说明示例值
ANTHROPIC_AUTH_TOKENAPI Key (百炼控制台获取)sk-sp-xxxxxx
ANTHROPIC_BASE_URLAPI 端点地址https://coding.dashscope.aliyuncs.com/apps/anthropic
API_TIMEOUT_MS请求超时时间 (毫秒)3000000

注意事项

  1. Base URL 格式: 结尾不要包含 /v1,Claude Code 会自动添加

    • ❌ 错误: https://xxx.com/apps/anthropic/v1
    • ✅ 正确: https://xxx.com/apps/anthropic
  2. API Key 获取: 登录阿里云百炼控制台 → 模型服务 → API-KEY

  3. 可用模型: 通过 --model 参数指定,如 MiniMax-M2.5

测试配置

# 使用 curl 测试 API
$body = @{
    model = "MiniMax-M2.5"
    max_tokens = 20
    messages = @(
        @{role = "user"; content = "hi"}
    )
} | ConvertTo-Json -Depth 3

Invoke-RestMethod -Uri "https://coding.dashscope.aliyuncs.com/apps/anthropic/v1/messages" `
    -Method Post `
    -Headers @{
        "Authorization" = "Bearer YOUR_API_KEY"
        "Content-Type" = "application/json"
    } `
    -Body $body

快速命令参考

# 认证
claude auth status          # 检查状态
claude auth login           # 登录
claude auth logout          # 登出

# 会话
claude                      # 新会话
claude "task"               # 带提示的新会话
claude -c                   # 继续最近会话
claude -r "name" "task"     # 恢复指定会话

# Print 模式
claude -p "task"            # 单次任务
claude -p --model sonnet    # 指定模型
claude -p --max-turns 5     # 限制轮次

# 工具
claude agents               # 列出子代理
claude mcp                  # MCP 管理
claude update               # 更新版本

Files

1 total
Select a file
Select a file to preview.

Comments

Loading comments…