Communitygithub.com

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

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

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

このスキルは、Claude Codeのセッションツールと、個別に設定されたスケジューリング、メモリ、コンピュータ操作の統合を組み合わせるためのセットアップパターンです。バンドルされた常時稼働ランタイムではなく、必要に応じて自律的な動作を明示的にリクエストしスコープを設定することで、意図しない動作を防ぎます。永続メモリ(Claude CodeのビルトインメモリとMCPメモリサーバ)、スケジュール操作(Claude CodeのネイティブスケジュールタスクとOSスケジューラの両方をサポート)、リモートエージェントディスパッチ、コンピュータ操作、タスクキュー管理の5つのコアコンポーネントで構成されています。CLIモードを介してCIワークフローやWebhookからも呼び出せ、HermesやAutoGPTなどのスタンドアロンエージェントフレームワークを置き換える実用的な方法を提供します。

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

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

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

ドキュメント

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

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

同意と安全の境界

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

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

アクティブ化のタイミング

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

アーキテクチャ

┌──────────────────────────────────────────────────────────────┐
│                    Claude Code ランタイム                    │
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌─────────────┐ │
│  │ Crons    │  │ 派遣     │  │ メモリ   │  │ コンピュータ│ │
│  │ スケ     │  │ リモート │  │ ストア   │  │ 操作        │ │
│  │ ジュール │  │ エージェント│  │          │  │             │ │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └──────┬──────┘ │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              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. スケジュール操作 (Crons)

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

cronの設定:

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

シェルからの1回限りの実行には、CLIを呼び出す前に作業ディレクトリを設定します:

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

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

便利なcronパターン:

パターンスケジュール使用例
日次スタンドアップ0 9 * * 1-5PR、Issue、デプロイ状況の確認
週次レビュー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 "セキュリティスキャンの出力を分析し、問題に対するIssueを作成してください"

4. コンピュータ操作

コンピュータ制御には、個別に設定された統合が必要です。Anthropicのcomputer-useツールとリファレンス環境は、隔離されたデスクトップ環境でツールコールを実行するためのアプリケーションを必要とします。MCPパッケージ名を追加しても、その環境は提供されません。

機能:

  • ブラウザ自動化 (ナビゲート、クリック、フォーム入力、スクリーンショット)
  • デスクトップ制御 (アプリを開く、タイピング、マウス制御)
  • CLIを超えたファイルシステム操作

ハーネス内でのユースケース:

  • Web UIの自動テスト
  • フォーム入力とデータエントリ
  • スクリーンショットベースの監視
  • マルチアプリワークフロー

5. タスクキュー

セッション境界を超えて存続するタスクの永続キューを管理します。

実装:

# メモリを介したタスク永続化
タスクキューを ~/.claude/projects/*/memory/task-queue.md に書き込む

# タスク形式
---
name: task-queue
type: project
description: 自律動作のための永続タスクキュー
---

## アクティブタスク
- [ ] PR #123: CIがグリーンならレビューして承認
- [ ] デプロイ監視: 30分ごとに2時間 /health をチェック
- [ ] 調査: AIツール分野で5つのリードを見つける

## 完了済み
- [x] 日次スタンドアップ: 3つのPR、2つのIssueをレビュー

Hermesの置き換え

HermesコンポーネントECC同等機能方法
Gateway/RouterCLI + 外部スケジューラ認証済みランナーがエージェントセッションを開始
Memory SystemClaudeメモリ + MCPメモリサーバービルトイン永続化 + ナレッジグラフ
Tool RegistryMCPサーバー動的に読み込まれるツールプロバイダー
OrchestrationECCスキル + エージェントスキル定義がエージェントの動作を指示
Computer Use個別に設定された統合隔離環境でのブラウザまたはデスクトップ制御
Context Managerセッション管理 + メモリECC 2.0セッションライフサイクル
Task Queueメモリ永続化されたタスクリストTodoWrite + メモリファイル

セットアップガイド

ステップ 1: MCPサーバーの設定

メモリMCPはオプションです。MCPリファレンスメモリサーバーは @modelcontextprotocol/server-memory として公開されています。バージョン 2026.8.31 は2026-09-07に公開npmレジストリで確認されました。これはリファレンス実装であり、ECCバンドルサービスではありません。

そのパッケージを確認し、使用を承認した後、このエントリを ~/.claude.json のユーザースコープのMCP設定にマージし、既存の設定を保持します。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などの外部スケジューラを設定して、コアコンポーネントのステップ2からワンショットコマンドを実行します。スケジュールを要求するために claude -p を呼び出しても、常時稼働スケジューラはプロビジョニングされません。有効にする前に、スケジュール、ワークスペース、および許可されるアクションを明示的に選択してください。

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

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

ステップ 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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

関連スキル