← 返回 Skills 市场
onestepat4time

Aegis Bridge

作者 Emanuele · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
445
总下载
0
收藏
0
当前安装
45
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (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, 21 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

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.

安全使用建议
This skill is coherent for its stated purpose, but exercise caution before installing/running its setup scripts: 1) Backup ~/.claude/settings.json (or the project .mcp.json) before running setup-mcp.sh; the script will add an 'aegis' MCP entry. 2) Review and remove or change any auto-approve behavior in heartbeat.sh and the SKILL.md workflow if you do not want unattended approval of permission prompts or automatic execution of bash commands. 3) Note that the MCP entry executes 'npx aegis-bridge mcp'—verify the package and its source before allowing it to be fetched/executed. 4) Run health-check.sh first to validate a running local Aegis server; do not run setup scripts on machines or repos you don't trust. 5) If you need higher assurance, run the setup and any npx executions in a sandboxed environment or container and inspect the remote package code before use.
功能分析
Type: OpenClaw Skill Name: aegis-bridge Version: 0.1.0 The aegis-bridge skill orchestrates Claude Code sessions via a local HTTP/MCP bridge. It contains instructions in SKILL.md and heartbeat-template.md that explicitly direct the agent to automatically approve bash commands and permission prompts within sub-sessions, effectively bypassing security boundaries designed for human oversight. Additionally, scripts/setup-mcp.sh modifies Claude Code configuration files (~/.claude/settings.json) to register the bridge as a persistent MCP server. While these behaviors facilitate the stated goal of multi-agent automation, the systematic auto-approval of arbitrary shell commands creates a significant risk of unauthorized execution.
能力标签
crypto
能力评估
Purpose & Capability
The name/description (Aegis Bridge for orchestrating Claude Code sessions) aligns with the files and instructions: HTTP endpoints on localhost:9100, session lifecycle commands, heartbeat loop, and MCP setup scripts. The README and SKILL.md reference AEGIS_HOST/AEGIS_PORT (defaults used) even though the registry metadata did not declare required env vars; this is a minor documentation mismatch but not a fundamental incoherence.
Instruction Scope
Several instructions implicitly or explicitly instruct automatic approval of permission and bash prompts (heartbeat loop auto-approves permission_prompt/bash_approval/plan_mode, default 'Proceed with your best judgment' replies). That behavior escalates the skill's authority: it can cause remote agents to execute shell commands in the user's workDir with little human oversight. The SKILL.md also recommends auto-approving permission prompts in the core workflow. These are scope-creep risks because they instruct the agent to grant broad runtime privileges (approve commands, run bash) that are not harmless for arbitrary repos.
Install Mechanism
There is no formal install spec (instruction-only), which lowers risk. However setup-mcp.sh registers an MCP entry that will run 'npx aegis-bridge mcp --port ...' (either via claude CLI or by writing this as the command in ~/.claude/settings.json). That means invoking the registered MCP may cause npx to fetch and run a package at runtime. It's common for tool integration, but it does allow remote/registry-fetched code execution when the MCP is invoked—worth noting and verifying the source of the package before use.
Credentials
The skill does not request secrets or cloud credentials. It does reference AEGIS_HOST/AEGIS_PORT environment variables and uses $HOME for ~/.claude/settings.json; those env vars are reasonable for a local integration but were not declared in the registry metadata. No unexplained credentials are required, so the env/credential footprint is proportionate, but the scripts will read/write user config files.
Persistence & Privilege
setup-mcp.sh will modify user or project Claude configuration (writing to ~/.claude/settings.json or .mcp.json) to add an 'aegis' MCP server. This is persistent and modifies the agent platform configuration. Modifying platform/user settings is explainable for integrating an MCP, but it is a privilege that can affect future agent behavior (and registers an npx invocation). Combined with the skill's auto-approve instructions, this persistent change increases blast radius and should be explicitly reviewed and consented to before running.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install aegis-bridge
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /aegis-bridge 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Release v0.1.0 - HTTP/MCP Claude Code orchestration
v2.18.0
Release v2.18.0 - HTTP/MCP Claude Code orchestration
v2.17.4
Release v2.17.4 - HTTP/MCP Claude Code orchestration
v2.17.3
Release v2.17.3 - HTTP/MCP Claude Code orchestration
v2.17.2
Release v2.17.2 - HTTP/MCP Claude Code orchestration
v2.17.1
Release v2.17.1 - HTTP/MCP Claude Code orchestration
v2.17.0
Release v2.17.0 - HTTP/MCP Claude Code orchestration
v2.16.1
Release v2.16.1 - HTTP/MCP Claude Code orchestration
v2.16.0
Release v2.16.0 - HTTP/MCP Claude Code orchestration
v2.15.7
Release v2.15.7 - HTTP/MCP Claude Code orchestration
v2.15.6
Release v2.15.6 - HTTP/MCP Claude Code orchestration
v2.15.5
Release v2.15.5 - HTTP/MCP Claude Code orchestration
v2.15.4
Release v2.15.4 - HTTP/MCP Claude Code orchestration
v2.15.3
Release v2.15.3 - HTTP/MCP Claude Code orchestration
v2.15.2
Release v2.15.2 - HTTP/MCP Claude Code orchestration
v2.15.1
Release v2.15.1
v2.15.0
Release v2.15.0
v2.14.0
Release v2.14.0
v2.13.1
Release v2.13.1
v2.13.0
Release v2.13.0
元数据
Slug aegis-bridge
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 45
常见问题

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 插件,目前累计下载 445 次。

如何安装 Aegis Bridge?

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

Aegis Bridge 是免费的吗?

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

Aegis Bridge 支持哪些平台?

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

谁开发了 Aegis Bridge?

由 Emanuele(@onestepat4time)开发并维护,当前版本 v0.1.0。

💬 留言讨论