← 返回 Skills 市场
onestepat4time

Aegis Bridge

作者 Emanuele · GitHub ↗ · v0.6.6-preview.1 · MIT-0
cross-platform ⚠ suspicious
57
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install onestep-aegis
功能描述
Orchestrate Claude Code sessions via Aegis HTTP/MCP bridge. Use when spawning CC sessions for coding tasks, implementing issues, reviewing PRs, fixing CI, ba...
使用说明 (SKILL.md)

Aegis — CC Session Orchestration

Aegis manages interactive Claude Code sessions via HTTP API (port 9100) or MCP tools. Each session runs CC in tmux with JSONL transcript parsing and bidirectional communication.

Prerequisites

  1. Aegis server running: curl -s http://127.0.0.1:9100/v1/health
  2. MCP configured (optional, for native tool access): see scripts/setup-mcp.sh
  3. Verify health: bash scripts/health-check.sh

Core Workflow

create → send prompt → poll status → handle permissions → read result → quality gate → cleanup

Step 1: Create Session

MCP: create_session(workDir, name?, prompt?) HTTP:

SID=$(curl -s -X POST http://127.0.0.1:9100/v1/sessions \
  -H "Content-Type: application/json" \
  -d '{"workDir":"/path/to/project","name":"task-name"}' \
  | jq -r '.id')

⚠️ workDir must exist on disk or creation fails silently (returns null id).

Wait 8-10s for CC to boot. Check promptDelivery.delivered in the response — if false, resend via send_message after CC boots.

Step 2: Send Prompt

MCP: send_message(sessionId, text) HTTP:

curl -s -X POST http://127.0.0.1:9100/v1/sessions/$SID/send \
  -H "Content-Type: application/json" \
  -d '{"text":"Your task here"}'

Step 3: Poll Until Idle

MCP: get_status(sessionId) — check status field HTTP:

STATUS=$(curl -s http://127.0.0.1:9100/v1/sessions/$SID/read | jq -r '.status')

Step 4: Handle Permission Prompts

While polling, react to non-idle states:

Status Action
idle Done — read result
working Wait (poll every 5s)
permission_prompt POST .../approve (trust folder, tool use)
bash_approval POST .../approve or POST .../reject
plan_mode POST .../approve (option 1) or POST .../escape
ask_question POST .../send with answer
unknown GET .../pane for raw terminal output

Step 5: Read Transcript

MCP: get_transcript(sessionId) HTTP: curl -s http://127.0.0.1:9100/v1/sessions/$SID/read

Returns { messages[], status, statusText }. Each message: { role, contentType, text, timestamp }.

Step 6: Quality Gate

Before accepting output, verify:

  1. Check transcript for tool errors or failed assertions
  2. Run tsc --noEmit and build via send_message if needed
  3. Confirm tests pass (request CC to run them)
  4. Check for common issues: missing imports, hardcoded values, incomplete implementations

Step 7: Cleanup

MCP: kill_session(sessionId) HTTP: curl -s -X DELETE http://127.0.0.1:9100/v1/sessions/$SID

Always cleanup — idle sessions consume tmux windows and memory.

Common Patterns

Implement Issue

create_session(workDir=repo, name="impl-#123", prompt="Implement issue #123. Read the issue description first, then write code. Don't explain, just implement. Run tests when done.")
→ poll → approve permissions → read transcript → verify tests pass → cleanup

Review PR

create_session(workDir=repo, name="review-PR-456", prompt="Review PR #456. Focus on: security issues, test coverage, API design. Be concise.")
→ poll → read transcript → extract review comments

Fix CI

create_session(workDir=repo, name="fix-ci", prompt="CI is failing on main. Run the failing test suite, identify the root cause, and fix it. Don't add skip/only annotations.")
→ poll → approve bash commands → verify CI green → cleanup

Batch Tasks

Spawn multiple sessions in parallel, then poll all:

for task in "task-a" "task-b" "task-c"; do
  curl -s -X POST http://127.0.0.1:9100/v1/sessions \
    -H "Content-Type: application/json" \
    -d "{\"workDir\":\"$REPO\",\"name\":\"$task\",\"prompt\":\"$task description\"}" \
    | jq -r '.id' >> /tmp/session-ids.txt
done
# Poll all until done
while read SID; do ... done \x3C /tmp/session-ids.txt

Stall Detection and Recovery

A session is stalled when working for >5 minutes with no transcript change.

Detection

HASH1=$(curl -s http://127.0.0.1:9100/v1/sessions/$SID/read | jq -r '.messages | length')
sleep 30
HASH2=$(curl -s http://127.0.0.1:9100/v1/sessions/$SID/read | jq -r '.messages | length')
# If HASH1 == HASH2 and status is still "working", likely stalled

Recovery Options (in order)

  1. Nudge — send send_message("Continue. What's blocking you?")
  2. InterruptPOST .../interrupt then resend the task
  3. Refine — send a simplified or decomposed version of the task
  4. Pivot — kill session, create new one with a different approach
  5. Escalate — abandon automated approach, notify human

Troubleshooting

Problem Fix
Connection refused on 9100 Aegis not running. Check scripts/health-check.sh
Session stuck at unknown GET .../pane for raw output. May need POST .../escape
Permission loop (approve keeps coming) Likely bash approval. Check transcript for the command. Reject if unsafe
promptDelivery: "failed" CC didn't boot yet. Wait 10s and resend via send_message
Session not appearing in list_sessions Check workDir filter. Session may have been killed
High memory usage Kill idle sessions. Use list_sessions to find orphans

MCP Tool Reference

When MCP is configured, 24 tools are available natively:

Session Lifecycle

Tool Description
create_session Spawn new CC session (workDir, name, prompt)
list_sessions List sessions, filter by status/workDir
get_status Detailed session status + health
kill_session Kill session + cleanup resources
batch_create_sessions Spawn multiple sessions at once

Communication

Tool Description
send_message Send text to a session
send_bash Execute bash via ! prefix
send_command Send /slash command
get_transcript Read conversation transcript
capture_pane Raw terminal output
get_session_summary Summary with message counts + duration

Permission Handling

Tool Description
approve_permission Approve pending prompt
reject_permission Reject pending prompt
escape_session Send Escape key (dismiss dialogs)
interrupt_session Send Ctrl+C

Monitoring

Tool Description
server_health Server version, uptime, session counts
get_session_metrics Per-session performance metrics
get_session_latency Latency measurements

State (Memory Bridge)

Tool Description
state_set Set a shared state key/value entry
state_get Get a shared state key/value entry
state_delete Delete a shared state key/value entry

Advanced

Tool Description
list_pipelines List multi-step pipelines
create_pipeline Create orchestrated pipeline
get_swarm Swarm status for parallel sessions

For full API reference, see references/api-quick-ref.md. For agent templates, see references/agent-template.md. For heartbeat/dev-loop templates, see references/heartbeat-template.md.

安全使用建议
Install only if you intentionally want Aegis to control local Claude Code sessions. Prefer project-scoped MCP setup, pin or verify the `aegis-bridge` package, disable auto-approval for untrusted workspaces, keep the Aegis port local, and periodically review or delete stored memory and MCP configuration.
功能分析
Type: OpenClaw Skill Name: onestep-aegis Version: 0.6.6-preview.1 The skill bundle facilitates multi-agent orchestration via a local Aegis bridge (127.0.0.1:9100) but promotes an insecure-by-design workflow. Instructions in SKILL.md and logic in heartbeat-template.md explicitly direct the agent to programmatically bypass security checkpoints, such as 'bash_approval' and 'permission_prompt', which removes critical human-in-the-loop protections for local code execution. Additionally, setup-mcp.sh relies on 'npx' to fetch and run the bridge component, introducing standard supply-chain risks.
能力标签
crypto
能力评估
Purpose & Capability
The artifacts consistently describe a localhost Aegis bridge for spawning and managing Claude Code sessions. This is purpose-aligned, but the capability is high-impact because it can create coding agents, send prompts, run bash/tool workflows, manage pipelines, and store memory.
Instruction Scope
The provided heartbeat and workflow examples make auto-approval of permission and bash prompts part of the default automation pattern, which can bypass per-command human review during code-changing sessions.
Install Mechanism
The setup script configures Claude Code to launch the MCP server with an unversioned `npx aegis-bridge` command. This is user-directed and purpose-aligned, but the executable provenance and version are not pinned in the reviewed artifacts.
Credentials
The bridge targets `127.0.0.1:9100` and user-selected working directories, which fits the purpose. Users should still treat spawned sessions as able to mutate the selected repository and run local development commands.
Persistence & Privilege
The setup can add a user-scoped MCP server under `~/.claude/settings.json`, and the API supports persistent memory. Both are disclosed and useful for the purpose, but they expand the blast radius beyond one immediate task unless scoped and cleaned up.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install onestep-aegis
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /onestep-aegis 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.6.6-preview.1
Release v0.6.6-preview.1 - HTTP/MCP Claude Code orchestration
元数据
Slug onestep-aegis
版本 0.6.6-preview.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Aegis Bridge 是什么?

Orchestrate Claude Code sessions via Aegis HTTP/MCP bridge. Use when spawning CC sessions for coding tasks, implementing issues, reviewing PRs, fixing CI, ba... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 57 次。

如何安装 Aegis Bridge?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install onestep-aegis」即可一键安装,无需额外配置。

Aegis Bridge 是免费的吗?

是的,Aegis Bridge 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Aegis Bridge 支持哪些平台?

Aegis Bridge 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Aegis Bridge?

由 Emanuele(@onestepat4time)开发并维护,当前版本 v0.6.6-preview.1。

💬 留言讨论