Claude 助手
- 作者仓库星标 0
- 作者仓库 skills-registry
When to use
Use this skill when the research task requires:
- Writing and running non-trivial code that needs iteration to get right
- Analysing a codebase (clone a repo, understand its structure, answer questions about it)
- Generating a working implementation of something described in a paper or spec
- Running experiments where the code needs to adapt based on intermediate results
- Any coding task where a single
generate_code+executecycle would not be enough
Do NOT use for trivial one-shot scripts — code_execution alone is faster and sufficient.
How to execute
Step 1 — Check which backend is available
Always run this check first:
import os, subprocess
has_anthropic_key = bool(os.environ.get("ANTHROPIC_API_KEY"))
claude_available = False
if has_anthropic_key:
r = subprocess.run(["claude", "--version"], capture_output=True, text=True)
claude_available = r.returncode == 0
print("backend:", "claude_code" if claude_available else "gemini_fallback")
Execute this with execute(). Then follow the matching path below.
Path A — Claude Code (when claude_available is True)
claude -p runs non-interactively and exits when done.
import subprocess
task = """
<describe the coding task in full detail>
Output the result as plain text or JSON.
"""
result = subprocess.run(
["claude", "-p", task],
capture_output=True,
text=True,
timeout=300,
)
print("exit:", result.returncode)
print(result.stdout)
if result.stderr:
print("stderr:", result.stderr[:2000])
If the output is incomplete, make a follow-up call with the prior output as context:
result2 = subprocess.run(
["claude", "-p", f"Previous output:\n{result.stdout}\n\nContinue: <remaining task>"],
capture_output=True, text=True, timeout=300,
)
print(result2.stdout)
Path B — Gemini fallback (when claude_available is False)
Use generate_code to produce the implementation, then execute to run it. Iterate up to 3 times.
Iteration pattern:
- Call
generate_code("full task description")— returns working Python - Call
execute(code)— run it, read stdout/stderr - If it fails or output is wrong: call
generate_code("fix this: <error> in this code: <code>")and execute again - After 3 iterations, accept the best result and record what remains incomplete
For codebase analysis without Claude Code:
import subprocess, tempfile
with tempfile.TemporaryDirectory() as tmpdir:
subprocess.run(["git", "clone", "--depth=1", repo_url, tmpdir], check=True, timeout=120)
# Then use generate_code + execute to analyse the cloned repo
Output contract
Include in proof:
backend_used:"claude_code"or"gemini_fallback"task_given: the coding task descriptionoutput: the final result (stdout or generated artefact)iterations: number of attempts madeexit_code(Claude Code path): 0 = successerror_output(if any): stderr or exception text
List produced files in artefacts.
Quality bar
- Always run the Step 1 backend check — do not assume which is available
- Claude Code path: capture both stdout and stderr; stderr shows tool use logs
- Gemini fallback path: do not exceed 3 iterations — accept partial results and note gaps in proof
- Never pass secrets or credentials in the task string
- Set timeout ≥ 120s on all subprocess calls
Pairs with
web_browse— fetch specs or docs first, then pass them to the coding agentdataset_inspection— inspect a dataset's schema, then delegate cleaning/analysis herecode_execution— this skill IS the advanced form of code_execution; use plain code_execution for simple one-shot scripts
<!-- tomevault:4.0:skill_md:2026-05-23 -->Source: ai-agents-for-humans/slow-ai — distributed by TomeVault.
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 需要 · Anthropic
- 检测到的系统要求
- 未声明
- 底层运行要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Use this skill when the research task requires: Writing and running non-trivial code that needs iteration to get right Analysing a codebase (clone a repo, understand its structure, answer questions about it)
How to execute
Always run this check first: Execute this with execute(). Then follow the matching path below.
claude -p runs non-interactively and exits when done. If the output is incomplete, make a follow-up call with the prior output as context:
Use generatecode to produce the implementation, then execute to run it. Iterate up to 3 times. Iteration pattern: Call generatecode("full task description") — returns working Python
Include in proof: backendused: "claudecode" or "geminifallback" taskgiven: the coding task description
## When to use
Use this skill when the research task requires:
- Writing and running non-trivial code that needs iteration to get right
- Analysing a codebase (clone a repo, understand its structure, answer questions about it)
- Generating a working implementation of something described in a paper or spec
- Running experiments where the code needs to adapt based on intermediate results
- Any coding task where a single `generate_code` + `execute` cycle would not be enough
Do NOT use for trivial one-shot scripts — `code_execution` alone is faster and sufficient.
## How to execute
### Step 1 — Check which backend is available
Always run this check first:
```python
import os, subprocess
has_anthropic_key = bool(os.environ.get("ANTHROPIC_API_KEY"))
claude_available = False
if has_anthropic_key:
r = subprocess.run(["claude", "--version"], capture_output=True, text=True)
claude_available = r.returncode == 0
print("backend:", "claude_code" if claude_available else "gemini_fallback")
```
Execute this with `execute()`. Then follow the matching path below.
---
### Path A — Claude Code (when `claude_available` is True)
`claude -p` runs non-interactively and exits when done.
```python
import subprocess
task = """
<describe the coding task in full detail>
Output the result as plain text or JSON.
"""
result = subprocess.run(
["claude", "-p", task],
capture_output=True,
text=True,
timeout=300,
)
print("exit:", result.returncode)
print(result.stdout)
if result.stderr:
print("stderr:", result.stderr[:2000])
```
If the output is incomplete, make a follow-up call with the prior output as context:
```python
result2 = subprocess.run(
["claude", "-p", f"Previous output:\n{result.stdout}\n\nContinue: <remaining task>"],
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> When to use → How to execute → Step 1 — Check which backend is available → Path A — Claude Code (when claudeavailable is True) → Path B — Gemini fallback (when claudeavailable is False) → Output contract
要点 -> Iteration pattern · Do NOT use for trivial one-shot scripts — codeexecution alone is faster and sufficient. · Execute this with execute(). · claude -p runs non-interactively and exits when done. · task = """ <describe the coding task in full detail> Output the result as plain text or JSON. · Use generatecode to produce the implementation, then execute to run it. · Iteration pattern: 1. · List produced files in artefacts.
文件/命令 -> generatecode · execute · codeexecution · execute() · claudeavailable · claude -p · generatecode("full task description") · execute(code)
内容 SHA-256 -> 94b9eef1aba5
方法与流程
适用与边界
原文中的明确线索
generatecode、execute、codeexecution、execute()、claudeavailable、claude -p、generatecode("full task description")、execute(code)