Communitygithub.com

自律エージェントハーネス

Claude Codeを、永続メモリ、スケジュール操作、コンピュータ操作、タスクキューを備えた完全自律エージェントシステムに変身させます。スタンドアロンのエージェントフレームワーク(Hermes、AutoGPT)をClaude Codeで置き換えます。

自律エージェントハーネス とは?

このスキルは、Claude Codeのセッションツールを、スケジューリング、メモリ、コンピュータ操作などの個別設定された統合機能と組み合わせて、完全自律エージェントシステムを構築するためのパターンです。常時稼働するバンドルランタイムではなく、ユーザーが明示的に設定とスコープを定義することで、自律的な動作を安全に制御します。主な機能には、MCPメモリサーバーを使用した永続メモリ、Claude Codeのネイティブスケジュール機能(/loop)やOSスケジューラを使用した定期的なタスク実行、外部認証CIジョブを介したリモートエージェントのディスパッチ、隔離環境でのコンピュータ操作、そしてメモリファイルに永続化されたタスクキューが含まれます。HermesやAutoGPTなどの既存の自律エージェントフレームワークの代替として設計されており、セッションをまたいだコンテキスト記憶、定期的な監視、自動化されたワークフローを必要とするユースケースに最適です。設定はMCPサーバー構成、メモリグラフの初期化、スケジュール設定、およびオプションのコンピュータ使用統合を含むステップバイステップガイドに従います。

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

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

自律エージェントハーネス は何をしますか?

Claude Codeのセッションツールを、個別に設定されたスケジューリング、メモリ、およびコンピュータ操作の統合機能と組み合わせます。これはバンドルされた常時稼働ランタイムではなく、セットアップパターンです。

同意と安全境界

自律操作は、ユーザーが明示的に要求し、その範囲を定義する必要があります。ユーザーがその機能と現在のセットアップのターゲットワークスペースを承認していない限り、スケジュールの作成、リモートエージェントの派遣、永続メモリへの書き込み、コンピュータ制御の使用、外部への投稿、サードパーティリソースの変更、またはプライベート通信に対する行動を行わないでください。

定期的またはイベント駆動型のアクションを有効にする前に、ドライランプランとローカルキューファイルを優先してください。資格情報、プライベートワークスペースのエクスポート、個人データセット、アカウント固有の自動化は、再利用可能なECC成果物から除外してください。

いつアクティブ化するか

  • ユーザーが継続的またはスケジュールに従って実行されるエージェントを希望する場合
  • 定期的にトリガーされる自動化ワークフローをセットアップする場合
  • セッションをまたいでコンテキストを記憶するパーソナルAIアシスタントを構築する場合
  • ユーザーが「これを毎日実行して」、「これを定期的にチェックして」、「監視を続けて」と言った場合
  • Hermes、AutoGPT、または同様の自律エージェントフレームワークの機能を再現したい場合
  • スケジュール実行と組み合わせたコンピュータ使用が必要な場合

アーキテクチャ

┌──────────────────────────────────────────────────────────────┐
│                    Claude Code ランタイム                    │
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌─────────────┐ │
│  │  Crons   │  │ Dispatch │  │ Memory   │  │ Computer    │ │
│  │ スケジュール│  │ リモート │  │ ストア   │  │ 使用       │ │
│  │ タスク    │  │ エージェント│  │          │  │             │ │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └──────┬──────┘ │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              ECC スキル + エージェントレイヤー        │    │
│  │                                                      │    │
│  │  skills/     agents/     commands/     hooks/        │    │
│  └──────────────────────────────────────────────────────┘    │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              MCP サーバーレイヤー                     │    │
│  │                                                      │    │
│  │  memory    github    exa    supabase    browser-use  │    │
│  └──────────────────────────────────────────────────────┘    │
└──────────────────────────────────────────────────────────────┘

コアコンポーネント

1. 永続メモリ

Claude Codeの組み込みメモリシステムを、構造化データ用のMCPメモリサーバーで拡張して使用します。

組み込みメモリ(~/.claude/projects/*/memory/):

  • ユーザー設定、フィードバック、プロジェクトコンテキスト
  • フロントマター付きのマークダウンファイルとして保存
  • セッション開始時に自動的に読み込まれる

MCPメモリサーバー(構造化ナレッジグラフ):

  • エンティティ、リレーション、観測結果
  • クエリ可能なグラフ構造
  • セッションをまたいだ永続性

メモリパターン:

# 短期:現在のセッションコンテキスト
TodoWriteを使用してセッション内のタスク追跡

# 中期:プロジェクトメモリファイル
~/.claude/projects/*/memory/ に書き込んでセッション間の想起

# 長期:MCPナレッジグラフ
永続的な構造化データには mcp__memory__create_entities を使用
関係マッピングには mcp__memory__create_relations を使用
既知のエンティティに関する新しい事実には mcp__memory__add_observations を使用

2. スケジュール操作(Crons)

インタラクティブセッション内での定期的なプロンプトには、Claude Codeのネイティブスケジュールタスクを使用します。これらのタスクはセッションスコープです。開いているセッションとは独立して実行する必要がある作業には、外部スケジューラが必要です。/loop にスケジューリングMCPサーバーは必要ありません。

cronの設定:

# インタラクティブなClaude Codeセッション内で
/loop 30m このリポジトリのオープンPRをレビューし、CIの失敗を要約してください。

シェルからの単発実行の場合は、CLIを呼び出す前に作業ディレクトリを設定します。

cd "/path/to/repo" && claude -p "オープンPRをレビューして要約してください"

インタラクティブセッションが実行されていない場合にそのコマンドを繰り返し実行するには、OSスケジューラまたはCIスケジュールを使用します。ランナーの認証とツール権限は個別に設定してください。

便利なcronパターン:

パターンスケジュールユースケース
毎日の朝会0 9 * * 1-5PR、課題、デプロイステータスを確認
毎週レビュー0 10 * * 1コード品質メトリクス、テストカバレッジ
毎時モニター0 * * * *プロダクションヘルス、エラーレートチェック
夜間ビルド0 2 * * *フルテストスイート実行、セキュリティスキャン
会議前*/30 * * * *今後の会議のコンテキストを準備

3. ディスパッチ/リモートエージェント

認証されたCIジョブまたはWebhookレシーバーが、所有するワークスペースでClaude Codeを呼び出すようにします。サポートされているエントリポイントは、プログラムCLIモードであり、パブリックなAnthropicディスパッチエンドポイントではありません。

ディスパッチパターン:

# CIワークスペース内で実行
cd "/path/to/repo" && claude -p "mainブランチでのビルドが失敗しました。失敗を診断してください。"

# 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がグリーンならレビューして承認
- [ ] デプロイ監視: 2時間、30分ごとに /health をチェック
- [ ] 調査: 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年9月7日にパブリック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は、その名前で後で公開されたものを実行します。別のサーバーを追加する前に、正確なパッケージ、発行者、バージョンを確認してください。スケジューリングとコンピュータ使用には、以前ここにリストされていた3つの未公開パッケージ名は必要ありません。

ステップ2: ベースCronの作成

インタラクティブセッション中のポーリングについては、次のように入力します。

/loop 30m このリポジトリのオープンPRをレビューし、CIの失敗を要約してください。

閉じたセッションを超えて存続する必要がある毎日または毎週の作業については、OSのcronジョブやGitHub Actionsなどの外部スケジューラを設定し、Core Componentsのステップ2から単発コマンドを実行します。claude -pを呼び出してスケジュールを要求しても、常時稼働スケジューラはプロビジョニングされません。有効にする前に、スケジュール、ワークスペース、許可されるアクションを明示的に選択してください。

ステップ3: メモリグラフの初期化

# 自分のアイデンティティとコンテキストをブートストラップ
claude -p "自分(ユーザープロファイル)、自分のプロジェクト、自分の主要な連絡先のメモリエンティティを作成してください。現在の優先事項に関する観測結果を追加してください。"

ステップ4: コンピュータ使用の有効化(オプション)

上記のコンピュータ使用リファレンス環境、または確認済みの特定のブラウザ統合のドキュメントに従ってください。必要な権限のみを付与し、スケジュールされたワークフローに追加する前に、隔離環境で無害なアクションを確認してください。

ワークフロー例

自律PRレビュアー

Cron: 勤務時間中は30分ごと
1. 監視対象リポジトリの新しいPRを確認
2. 各新規PRに対して:
   - ブランチをローカルにプル
   - テストを実行
   - code-reviewerエージェントで変更をレビュー
   - GitHub MCPを介してレビューコメントを投稿
3. メモリをレビューステータスで更新

個人調査エージェント

Cron: 毎朝6時
1. メモリに保存された検索クエリを確認
2. 各クエリに対してExa検索を実行
3. 新しい発見を要約
4. 昨日の結果と比較
5. ダイジェストをメモリに書き込み
6. 朝のレビュー用に優先度の高いアイテムにフラグを付ける

会議準備エージェント

トリガー: 各カレンダーイベントの30分前
1. カレンダーイベントの詳細を読み取る
2. 参加者のコンテキストについてメモリを検索
3. 参加者との最近のメール/Slackスレッドを取得
4. 議論のポイントと議題の提案を準備
5. 準備ドキュメントをメモリに書き込む

制約事項

  • ネイティブのスケジュールプロンプトは、そのインタラクティブセッションを共有します。外部スケジューラの呼び出しは、明示的に再開されない限り、個別のセッションを開始します。
  • コンピュータ使用には明示的な権限付与が必要です。アクセスを想定しないでください。
  • CLI自動化は依然としてモデル使用量を消費し、設定されたプロバイダーの制限の対象となります。適切なスケジューラ間隔を選択してください。
  • メモリファイルは簡潔に保つ必要があります。ファイルが無制限に大きくならないように、古いデータはアーカイブしてください。
  • スケジュールされたタスクが正常に完了したことを常に確認してください。cronプロンプトにエラーハンドリングを追加してください。

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.

関連スキル