sub-agent
它能做什么
这项技能把编程任务委派给一个在后台无需交互运行的独立编程助手。它适合希望在自己继续工作的同时,完成功能开发、代码审查或重构的开发者。
适用场景
- ✓当你希望由另一个编程助手在后台完成一项独立功能的时候。
- ✓当代码审查或重构需要大量查看文件时。
- ✓当你希望以非交互模式运行编程助手,使其无需提示即可完成的时候。
技能链接
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/sub-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我把账单模块的重构交给后台编程助手,并稍后帮我检查进度。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会用非交互命令启动所选的编程助手,并给出清晰的任务,然后追踪后台进程直到其完成。它使用进程工具检查进度并收集结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Sub-Agent (opensquilla process tools)
Generic "spawn a sub-Agent" entry point for delegating self-contained tasks to Codex / Claude Code / OpenCode / Pi via background process. Use this playbook for self-contained coding and file-editing tasks.
Use OpenSquilla's exec_command and process tools for coding agent work. exec_command starts both short and long commands; use yield_time_ms=0 for a long run and keep the returned execution handle. OpenSquilla does not expose a bash tool; do not use the legacy bash tool-call DSL.
Non-Interactive CLI Mode
OpenSquilla's process tools do not expose a pty parameter. Prefer non-interactive command modes that run and exit cleanly:
# ✅ Correct for Codex/Pi/OpenCode
exec_command(command="codex exec 'Your prompt'")
For Claude Code (claude CLI), use --print --permission-mode bypassPermissions instead.
--dangerously-skip-permissions with PTY can exit after the confirmation dialog.
--print mode keeps full tool access and avoids interactive confirmation:
# ✅ Correct for Claude Code (no PTY needed)
cd /path/to/project && claude --permission-mode bypassPermissions --print 'Your task'
# For background execution: use exec_command(yield_time_ms=0, ...)
# ❌ Wrong for Claude Code
exec_command(command="claude --dangerously-skip-permissions 'task'")
OpenSquilla Tool Parameters
| Tool | Key parameters | Description |
|---|---|---|
exec_command |
command, workdir, timeout, yield_time_ms |
Start a shell command; use yield_time_ms=0 for a long run and keep the returned execution handle. |
process |
action, session_id, data, offset, limit |
Poll, log, write to, or stop a background process. |
Process Tool Actions (for background sessions)
| Action | Description |
|---|---|
list |
List all running/recent sessions |
poll |
Check if session is still running |
log |
Get session output (with optional offset/limit) |
write |
Send raw data to stdin |
submit |
Send data + newline (like typing and pressing Enter) |
eof |
Close stdin |
remove |
Remove a finished session from the process list |
kill |
Terminate the session |
Quick Start: One-Shot Tasks
For quick prompts/chats, create a temp git repo and run:
# Quick chat (Codex needs a git repo!)
SCRATCH=$(mktemp -d) && cd $SCRATCH && git init && codex exec "Your prompt here"
# Or in a real project
exec_command(workdir="~/Projects/myproject", command="codex exec 'Add error handling to the API calls'")
Why git init? Codex refuses to run outside a trusted git directory. Creating a temp repo solves this for scratch work.
The Pattern: workdir + exec_command + process
For longer tasks, use exec_command(yield_time_ms=0, ...):
# Start agent in target directory.
exec_command(yield_time_ms=0, workdir="~/project", command="codex exec --full-auto 'Build a snake game'")
# Returns an execution handle (the current compatibility field is `session_id`)
# Wait for it to finish — blocks until the process exits (or the timeout
# elapses, in which case just call wait again). Prefer this over polling in a
# loop: a looped process(action="poll") burns a full turn + tokens each time.
process(action="wait", session_id="XXX")
# Peek at output without blocking (optional, for progress)
process(action="log", session_id="XXX")
# Send input (if agent asks a question)
process(action="write", session_id="XXX", data="y")
# Submit with Enter (like typing "yes" and pressing Enter)
process(action="submit", session_id="XXX", data="yes")
# Kill if needed
process(action="kill", session_id="XXX")
Why workdir matters: Agent wakes up in a focused directory, doesn't wander off reading unrelated files (like your soul.md 😅).
Codex CLI
Model: gpt-5.2-codex is the default (set in ~/.codex/config.toml)
Flags
| Flag | Effect |
|---|---|
exec "prompt" |
One-shot execution, exits when done |
--full-auto |
Sandboxed but auto-approves in workspa |
常见问题
它支持哪些助手?
该技能提到了 Codex、Claude Code、OpenCode 和 Pi。
它需要交互式终端吗?
不需要。该技能使用可以运行后干净退出的非交互模式。
它能运行长时间的任务吗?
可以。它可以启动长时间运行的命令,并保留句柄以便之后检查。
详情
作者的原始描述
Delegate a self-contained task to a coding assistant through a non-interactive background process. Use for feature development, code review, refactoring, and tasks requiring substantial file exploration.
repo: TokenRhythm/opensquilla
热度
- GitHub 星标
- 7.1k
- 排名
- #13593
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
browser-use
7.1k让你的智能体在 OpenSquilla Desktop 侧边栏浏览器中打开、阅读和操作网页,包括填写表单和进行视觉检查。
deep-research
7.1k教你的智能体进行多轮研究,使用已保存的计划、已追踪的来源,并生成带引用的长篇报告。
docx
7.1k帮你的智能体阅读、编辑或创建 Word .docx 文件,同时保持格式、修订记录和结构完整。
html-coder
7.1k帮你的智能体编写结构清晰的 HTML 页面,包含无障碍表单、媒体和 HTML5 功能,并可作为网页预览打开。