Communitygithub.com

自主智能体工具箱

将 Claude Code 转变为完全自主的智能体系统,具备持久记忆、定时调度、计算机操作和任务排队功能。取代独立智能体框架(Hermes、AutoGPT),充分利用 Claude Code 的能力。

自主智能体工具箱 是什么?

该工具包将 Claude Code 增强为一个完全自主的智能体系统,集成了持久记忆、定时调度、计算机操作和任务排队等核心功能。它严格遵循用户同意与安全边界,确保自主操作仅在用户显式授权和指定范围内执行。支持多种平台(Claude Code、CI 环境、外部调度器),通过 MCP 服务器提供记忆层、工具注册和上下文管理。工作原理包括:利用 Claude Code 内置记忆和 MCP 记忆服务器实现跨会话持久化;通过原生定时任务和外部调度器实现循环操作;通过认证的 CI 作业或 webhook 触发远程代理;以及可选配置隔离的计算机控制环境。该工具包旨在替代 Hermes、AutoGPT 等独立智能体框架,为开发者提供一套轻量、灵活、安全的自主智能体架构模式。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/autonomous-agent-harness

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

自主智能体工具箱 是做什么的?

将 Claude Code 的会话工具与独立配置的调度、记忆和计算机操作集成。这是一个设置模式,而非打包的始终运行运行时。

同意与安全边界

自主操作必须由用户显式请求并限定范围。除非用户已批准该能力及当前设置的与目标工作区,否则不得创建计划、派遣远程智能体、写入持久记忆、使用计算机控制、对外发布、修改第三方资源或处理私人通信。

在启用定期或事件驱动操作前,优先使用预演计划和本地队列文件。将凭证、私有工作区导出、个人数据集和特定账户的自动化内容排除在可复用的 ECC 制品之外。

何时激活

  • 用户希望一个持续运行或按计划运行的智能体
  • 设置定期触发的自动化工作流
  • 构建能跨会话记住上下文的个人 AI 助手
  • 用户说“每天运行这个”、“定期检查这个”、“持续监控”
  • 希望复制 Hermes、AutoGPT 或类似自主智能体框架的功能
  • 需要将计算机操作与定时执行结合使用

架构

┌──────────────────────────────────────────────────────────────┐
│                    Claude Code 运行时                        │
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌─────────────┐ │
│  │ 定时任务  │  │ 远程派遣 │  │ 记忆存储 │  │ 计算机操作  │ │
│  │ 调度器   │  │ 智能体   │  │          │  │             │ │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └──────┬──────┘ │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              ECC 技能 + 智能体层                      │    │
│  │                                                      │    │
│  │  skills/     agents/     commands/     hooks/        │    │
│  └──────────────────────────────────────────────────────┘    │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              MCP 服务器层                            │    │
│  │                                                      │    │
│  │  memory    github    exa    supabase    browser-use  │    │
│  └──────────────────────────────────────────────────────┘    │
└──────────────────────────────────────────────────────────────┘

核心组件

1. 持久记忆

使用 Claude Code 内置的记忆系统,并通过 MCP 记忆服务器增强以处理结构化数据。

内置记忆 (~/.claude/projects/*/memory/):

  • 用户偏好、反馈、项目上下文
  • 存储为带有前置数据的 Markdown 文件
  • 会话启动时自动加载

MCP 记忆服务器(结构化知识图谱):

  • 实体、关系、观察
  • 可查询的图谱结构
  • 跨会话持久化

记忆模式:

# 短期:当前会话上下文
使用 TodoWrite 进行会话内任务跟踪

# 中期:项目记忆文件
写入 ~/.claude/projects/*/memory/ 以实现跨会话回忆

# 长期:MCP 知识图谱
使用 mcp__memory__create_entities 创建永久结构化数据
使用 mcp__memory__create_relations 建立关系映射
使用 mcp__memory__add_observations 添加关于已知实体的新事实

2. 定时操作(定时任务)

使用 Claude Code 原生的定时任务在交互式会话中实现循环提示。这些任务作用域仅限于会话;对于需要独立于打开会话运行的工作,需要使用外部调度器。/loop 不需要定时 MCP 服务器。

设置定时任务:

# 在交互式 Claude Code 会话中
/loop 30m 审查此仓库中的开放 PR 并总结 CI 失败信息。

如需从 shell 运行一次性任务,请在调用 CLI 前设置工作目录:

cd "/path/to/repo" && claude -p "审查开放 PR 并总结"

当没有交互式会话运行时,使用操作系统调度器或 CI 计划重复调用该命令。分别配置运行时的认证和工具权限。

有用的定时任务模式:

模式计划用例
每日站会0 9 * * 1-5审查 PR、议题、部署状态
每周回顾0 10 * * 1代码质量指标、测试覆盖率
每小时监控0 * * * *生产环境健康度、错误率检查
夜间构建0 2 * * *运行完整测试套件、安全扫描
会前准备*/30 * * * *为即将举行的会议准备上下文

3. 派遣 / 远程智能体

让经过认证的 CI 作业或 webhook 接收器在其拥有的工作区中调用 Claude Code。支持的入口点是编程式 CLI 模式,而非公开的 Anthropic 派遣端点。

派遣模式:

# 在 CI 工作区内运行
cd "/path/to/repo" && claude -p "主分支构建失败。诊断故障原因。"

# 从 webhook 触发
# GitHub webhook -> 认证 CI 运行器 -> claude -p -> 可审查的结果

# 从其他智能体触发
claude -p "分析安全扫描的输出,并针对发现的问题创建议题"

4. 计算机操作

计算机控制需要单独配置集成。Anthropic 的计算机操作工具和参考环境需要应用程序在隔离的桌面环境中执行工具调用。仅添加 MCP 包名并不能提供该环境。

能力:

  • 浏览器自动化(导航、点击、填写表单、截图)
  • 桌面控制(打开应用、输入、鼠标控制)
  • 超越 CLI 的文件系统操作

在工具箱中的用例:

  • Web UI 的自动化测试
  • 表单填写和数据录入
  • 基于截图的监控
  • 多应用工作流

5. 任务队列

管理一个跨越会话边界的持久任务队列。

实现:

# 通过记忆实现任务持久化
将任务队列写入 ~/.claude/projects/*/memory/task-queue.md

# 任务格式
---
name: task-queue
type: project
description: 用于自主操作的持久任务队列
---

## 活动任务
- [ ] PR #123:审查,如果 CI 通过则批准
- [ ] 监控部署:每 30 分钟检查 /health,持续 2 小时
- [ ] 调研:在 AI 工具空间中找到 5 个潜在客户

## 已完成
- [x] 每日站会:审查了 3 个 PR,2 个议题

替代 Hermes

Hermes 组件ECC 等效项方式
网关/路由器CLI + 外部调度器认证运行器启动智能体会话
记忆系统Claude 记忆 + MCP 记忆服务器内置持久化 + 知识图谱
工具注册表MCP 服务器动态加载工具提供者
编排ECC 技能 + 智能体技能定义指导智能体行为
计算机操作单独配置的集成隔离环境中的浏览器或桌面控制
上下文管理器会话管理 + 记忆ECC 2.0 会话生命周期
任务队列记忆持久化的任务列表TodoWrite + 记忆文件

设置指南

步骤 1:配置 MCP 服务器

记忆 MCP 是可选的。MCP 参考记忆服务器 以 @modelcontextprotocol/server-memory 发布;版本 2026.8.31 已于 2026-09-07 在公开 npm 注册表中验证。这是一个参考实现,不是 ECC 捆绑的服务。

在审查该包并批准使用后,将此条目合并到用户作用域的 MCP 配置 ~/.claude.json 中,保留现有设置。将 MEMORY_FILE_PATH 替换为您拥有的私有目录中的绝对路径。有关 CLI 注册和 Windows cmd /c npx 配置,请参见 Claude Code MCP 配置。

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/[email protected]"],
      "env": {
        "MEMORY_FILE_PATH": "/absolute/path/to/private/memory.jsonl"
      }
    }
  }
}

不要注册猜测或未发布的 npm 包:npx -y 将执行之后以该名称发布的任何内容。在添加另一个服务器之前,请验证确切的包名称、发布者及版本。调度和计算机操作不需要之前在此列出的三个未发布的包名。

步骤 2:创建基础定时任务

对于交互式会话期间的轮询,请输入:

/loop 30m 审查此仓库中的开放 PR 并总结 CI 失败信息。

对于需要跨已关闭会话持续运行的每日或每周工作,请配置外部调度器(例如操作系统 cron 作业或 GitHub Actions)以运行来自核心组件步骤 2 的一次性命令。调用 claude -p 请求计划并不会提供一个始终运行的调度器。在启用之前,请显式选择计划、工作区和允许的操作。

步骤 3:初始化记忆图谱

# 引导您的身份和上下文
claude -p "创建记忆实体:我(用户资料)、我的项目、我的主要联系人。添加关于当前优先级的观察。"

步骤 4:启用计算机操作(可选)

按照上面链接的计算机操作参考环境,或您已审查的特定浏览器集成文档进行操作。仅授予所需权限,并在添加到定时工作流之前,在隔离环境中验证无害操作。

示例工作流

自主 PR 审阅者

定时任务:工作时间内每 30 分钟
1. 检查受监控仓库的新 PR
2. 对于每个新 PR:
   - 在本地拉取分支
   - 运行测试
   - 使用代码审阅智能体审阅更改
   - 通过 GitHub MCP 发布审阅评论
3. 使用审阅状态更新记忆

个人研究智能体

定时任务:每天上午 6 点
1. 检查记忆中保存的搜索查询
2. 对每个查询运行 Exa 搜索
3. 总结新发现
4. 与昨天的结果进行比较
5. 将摘要写入记忆
6. 标记高优先级项目供早晨审阅

会议准备智能体

触发:每个日历事件前 30 分钟
1. 读取日历事件详情
2. 搜索记忆中关于与会者的上下文
3. 拉取与会者的最新电子邮件/Slack 线程
4. 准备谈话要点和议程建议
5. 将准备文档写入记忆

约束

  • 原生定时提示共享其交互式会话。除非显式恢复,否则外部调度器调用将启动独立会话。
  • 计算机操作需要显式授予权限。不要假定有访问权限。
  • CLI 自动化仍然消耗模型用量,受限于配置提供商的限制。选择合适的调度器间隔。
  • 记忆文件应保持简洁。归档旧数据,不要无限制地增长文件。
  • 始终验证定时任务是否成功完成。为定时提示添加错误处理。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能