Skill站外收录 @skilllib/skill-2117939930272417329
terminals
提供终端环境的自动化创建与管理能力,支持基于工作树的并行任务隔离、Claude 工作实例的启动与调度、依赖环境的智能初始化,以及通过统一命名规范实现问题 ID 与终端、分支、工作目录的全程映射。
效率工具 AI 技能
Skills.MD
# Terminals - Worker Spawning
Spawn and manage Claude workers via TabzChrome API.
## MCP Tools (Preferred)
| Tool | Purpose |
|------|---------|
| `tabz_spawn_profile` | Spawn using saved profile |
| `tabz_list_profiles` | List available profiles |
| `tabz_list_categories` | List profile categories |
```python
# Spawn worker with profile
tabz_spawn_profile(
profileId="claude-worker",
workingDir="~/projects/.worktrees/ISSUE-ID",
name="ISSUE-ID"
)
```
## REST API
### Spawn Terminal
```bash
TOKEN=$(cat /tmp/tabz-auth-token)
PROJECT_DIR="/home/user/projects/myapp" # Main repo path
curl -X POST http://localhost:8129/api/spawn \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $TOKEN" \
-d "{
\"name\": \"ISSUE-ID\",
\"workingDir\": \"$PROJECT_DIR/.worktrees/ISSUE-ID\",
\"command\": \"BEADS_WORKING_DIR=$PROJECT_DIR claude\"
}"
```
### Find Worker
```bash
# By name
curl -s http://localhost:8129/api/agents | jq -r '.data[] | select(.name == "ISSUE-ID")'
# Get session ID
SESSION=$(curl -s http://localhost:8129/api/agents | jq -r '.data[] | select(.name == "ISSUE-ID") | .id')
```
### Kill Worker
```bash
curl -s -X DELETE "http://localhost:8129/api/agents/$SESSION" \
-H "X-Auth-Token: $TOKEN"
```
## Git Worktrees
Worktrees enable parallel workers on same repo.
```bash
# REQUIRED for beads projects - creates .beads/redirect for MCP tools
bd worktree create .worktrees/ISSUE-ID --branch feature/ISSUE-ID
# Remove
git worktree remove ".worktrees/ISSUE-ID" --force
git branch -d "feature/ISSUE-ID"
```
**Critical:** Always use `bd worktree create` for beads projects. It creates `.beads/redirect` which points MCP tools to the main database. Without this file, MCP tools fail silently and workers must use CLI only.
Fallback (non-beads projects only):
```bash
git worktree add ".worktrees/ISSUE-ID" -b "feature/ISSUE-ID"
```
### Dependency Initialization
Worktrees share git but NOT node_modules. Initialize before spawning:
```bash
INIT_SCRIPT=$(find ~/plugins ~/.claude/plugins -name "init-worktree.sh" -path "*spawner*" 2>/dev/null | head -1)
$INIT_SCRIPT ".worktrees/ISSUE-ID"
```
| Detected | Action |
|----------|--------|
| package.json | npm ci / pnpm / yarn / bun |
| pyproject.toml | uv pip install -e . |
| requirements.txt | uv pip install -r |
| Cargo.toml | cargo fetch |
| go.mod | go mod download |
## Sending Prompts
Wait for Claude to boot (8+ seconds), then:
```bash
# Find safe-send-keys.sh
SAFE_SEND_KEYS=$(find ~/plugins ~/.claude/plugins -name "safe-send-keys.sh" -path "*spawner*" 2>/dev/null | head -1)
# Send prompt
"$SAFE_SEND_KEYS" "$SESSION" "Complete beads issue $ISSUE_ID. Run: bd show $ISSUE_ID --json"
```
Fallback:
```bash
tmux send-keys -t "$SESSION" -l "$PROMPT"
sleep 1
tmux send-keys -t "$SESSION" C-m
```
## Worker Naming
**Use issue ID as terminal name:**
- Easy lookup via `/api/agents`
- Clear dashboard display
- Correlation: terminal = issue = branch = worktree
## Critical Settings
| Setting | Value | Why |
|---------|-------|-----|
| `BEADS_WORKING_DIR` | Main repo path | Beads MCP finds database |
| Wait time | 8+ seconds | Claude boot time |
## Dashboard
Monitor workers with tmuxplexer:
```bash
curl -s -X POST http://localhost:8129/api/spawn \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $TOKEN" \
-d '{
"name": "Worker Dashboard",
"workingDir": "~/projects/tmuxplexer",
"command": "./tmuxplexer --watcher"
}'
```
Shows: status, context usage, working directory, git branch.
## References
- [handoff-format.md](references/handoff-format.md) - Worker handoff notes
- [model-routing.md](references/model-routing.md) - Model selection
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「terminals」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次