Communitygithub.com

Agentic OS

Claude Code上に永続的なマルチエージェントOSを構築します。カーネルアーキテクチャ、専門エージェント、スラッシュコマンド、ファイルベースのメモリ、スケジュール自動化、外部データベース不要の状態管理をカバーします。独自のメモリ、コマンド、スケジューリングを持つ永続的なマルチエージェントシステムをClaude Code上に構築する際に使用します。

Agentic OS とは?

Agentic OSスキルは、Claude Codeをチャットセッションではなく、永続的なランタイム/オペレーティングシステムとして扱うためのアーキテクチャとパターンを提供します。このスキルは、プロダクションで使用されるエージェントシステムの設計を具体化したもので、タスクを専門エージェントにルーティングするカーネル設定(CLAUDE.md)、ファイルベースの永続メモリ(data/)、スケジュール自動化、JSON/マークダウンデータレイヤーで構成されます。主な利点は、外部データベース(PostgreSQLやベクトルDBなど)を必要とせず、ファイルシステムのみで状態を管理できる点であり、シンプルで監査可能なシステムを実現します。macOS、Linux、pm2などのプラットフォームで cron や LaunchAgent、systemd によるスケジュールタスクをサポートし、スラッシュコマンド(/daily-sync など)と専門エージェント(@dev, @writer など)の協調動作により、複雑なワークフローを効率的に処理します。カーネルのルーティングロジックはマークダウンテーブルで宣言的に記述され、コードを書かずにシステムの動作を編集・検証できる点が特徴です。

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

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

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

ドキュメント

Agentic OS は何をしますか?

Claude Codeをチャットセッションではなく、永続的なランタイム/オペレーティングシステムとして扱います。このスキルは、プロダクションで使用されるエージェントシステムのアーキテクチャを具体化したものです。タスクを専門エージェントにルーティングするカーネル設定、永続的なファイルベースのメモリ、スケジュール自動化、JSON/マークダウンデータレイヤーで構成されます。

有効化するタイミング

  • Claude Code内でマルチエージェントワークフローを構築する場合
  • セッションを再起動しても状態が持続する永続的なClaude Code自動化を設定する場合
  • 反復タスク用の「パーソナルOS」または「エージェントOS」を作成する場合
  • ユーザーが「agentic OS」「personal OS」「multi-agent」「agent coordinator」「persistent agent」と発言した場合
  • コンテキストがセッション間で保持される必要がある長期実行プロジェクトを構成する場合

アーキテクチャ概要

Agentic OSは4つのレイヤーで構成されます。各レイヤーはプロジェクトルート内のディレクトリです。

project-root/
├── CLAUDE.md          # カーネル: アイデンティティ、ルーティングルール、エージェントレジストリ
├── agents/            # 専門エージェント定義(マークダウンプロンプト)
├── .claude/commands/  # スラッシュコマンド: ユーザー向けCLI
├── scripts/           # デーモンスクリプト: スケジュールまたはイベント駆動タスク
└── data/              # 状態: JSON/マークダウンファイルシステム、外部DBなし

レイヤーの役割

レイヤー目的永続性
カーネル (CLAUDE.md)アイデンティティ、ルーティング、モデルポリシー、エージェントレジストリGit管理
エージェント (agents/)スコープ付きツールとメモリを持つ専門家としてのアイデンティティGit管理
コマンド (.claude/commands/)ユーザー向けスラッシュコマンド(/daily-sync、/outreach)Git管理
スクリプト (scripts/)cronまたはwebhookでトリガーされるPython/JSデーモンGit管理
状態 (data/)追記専用ログ、プロジェクト状態、決定記録Git無視または追跡

カーネル

CLAUDE.md がカーネルです。COO / オーケストレーターとして機能します。Claudeはセッション開始時にこれを読み、作業のルーティングに使用します。

カーネル構造

# CLAUDE.md - Agentic OS カーネル

## アイデンティティ
あなたは [プロジェクト名] のCOOです。タスクを専門エージェントにルーティングします。
あなたはコードを直接書きません。適切なエージェントに委任し、結果を統合します。

## エージェントレジストリ

| エージェント | 役割 | トリガー |
|---|---|---|
| @dev | コード、アーキテクチャ、デバッグ | ユーザーが「build」「fix」「refactor」と言った場合 |
| @writer | ドキュメント、コンテンツ、メール | ユーザーが「write」「draft」「blog」と言った場合 |
| @researcher | 調査、分析、ファクトチェック | ユーザーが「research」「analyze」「compare」と言った場合 |
| @ops | DevOps、デプロイ、インフラ | ユーザーが「deploy」「CI」「server」と言った場合 |

## ルーティングルール
1. ユーザーリクエストから意図キーワードを解析する
2. エージェントレジストリのトリガー列にマッチングする
3. `agents/<name>.md` から対応するエージェントファイルを読み込む
4. 完全なコンテキストとともに実行を引き継ぐ
5. 結果を統合してユーザーに提示する

## モデルポリシー
- デフォルトモデル: リポジトリまたはハーネスのデフォルトを使用する
- @dev タスク: 複雑なアーキテクチャには推論能力の高いモデルを優先する
- @researcher タスク: 設定された調査用モデルと承認された検索ツールを使用する
- コスト上限: プロジェクトの設定された支出しきい値を超える前に警告する

主要原則

カーネルは小さく宣言的であるべきです。ルーティングロジックはコードではなく、プレーンマークダウンのテーブルに記述します。これにより、デバッグを必要とせずにシステムを検査・編集できます。

専門エージェント

各エージェントは agents/ 内の独立したマークダウンファイルです。Claudeはタスクのルーティング時に関連するエージェントファイルを読み込みます。

エージェント定義形式

# @dev - ソフトウェアエンジニア

## アイデンティティ
あなたはシニアソフトウェアエンジニアです。クリーンでテスト済みのプロダクション品質のコードを書きます。
シンプルなソリューションを好みます。要件があいまいな場合は明確化の質問をします。

## メモリスコープ
- コンテキストとして `data/projects/<current-project>.md` を読む
- アーキテクチャ決定として `data/decisions/` を読む
- 実行ログを `data/logs/<date>[email protected]` に追記する

## ツールアクセス
- プロジェクトルート内の完全なファイルシステムアクセス
- Git操作(status、diff、commit、branch)
- テストランナーへのアクセス
- `.claude/mcp.json` で設定されたMCPサーバー

## 制約
- 新機能には常にテストを書く
- `main` に直接コミットしない。フィーチャーブランチを使用する
- 新しいファイルを作成するよりも既存ファイルを編集することを優先する
- 可能な限り関数は50行未満に抑える

マルチエージェント連携パターン

タスクが複数のエージェントにまたがる場合、カーネルはそれらを順次または並列で実行します:

ユーザー: 「ランディングページを作成し、ローンチブログ記事を書いてください」

カーネルルーティング:
1. @dev - 「[要件]に従ってランディングページを構築してください」
2. @writer - 「ランディングページのコピーを使用して、[製品]のローンチブログ記事を書いてください」
3. カーネルが両方の出力を統合して統一された応答にする

並列実行には、Claude Codeのバックグラウンドタスク機能、または特定のエージェントコンテキストでClaude Codeを呼び出すシェルスクリプトを使用します。

コマンドと日次ワークフロー

スラッシュコマンドは .claude/commands/ 内のマークダウンファイルです。再利用可能なワークフローを定義します。

コマンド構造

# /daily-sync

モーニングブリーフィングを実行します:

1. コンテキストとして `data/logs/last-sync.md` を読む
2. プロジェクトステータスを確認: `git status`、保留中のPR、CIの健全性
3. `data/inbox/` で新しいタスクや必要な決定事項を確認する
4. ブロッカー、優先事項、次のアクションのサマリーを生成する
5. ブリーフィングを `data/logs/daily/<date>.md` に追記する

標準コマンドセット

コマンド目的
/daily-syncモーニングブリーフィング: ステータス、ブロッカー、優先事項
/outreachアウトリーチワークフローを実行(メール、LinkedInなど)
/research <topic>引用追跡付きの詳細調査
/apply-jobsターゲットロールに合わせてレジュメとカバーレターを調整
/analyticsStripe、GitHub、またはカスタムソースからメトリクスを取得
/interview-prepフラッシュカードや模擬面接質問を生成
/decision <topic>賛否両論と選択したパスで決定を記録

コマンドの有効化

コマンドファイルを .claude/commands/<command-name>.md に配置します。Claude Codeが自動的に検出します。ユーザーは /<command-name> で呼び出します。

永続メモリ

メモリはファイルベースです。ベクトルDB、Redis、PostgreSQLはありません。data/ 内のJSONおよびマークダウンファイルがデータベースです。

メモリディレクトリ構造

data/
├── daily-logs/         # 追記専用の日次アクティビティログ
├── projects/           # プロジェクトごとのコンテキストファイル
├── decisions/          # アーキテクチャおよびビジネス上の決定(ADR形式)
├── inbox/              # トリアージ待ちの新しいタスクやアイデア
├── contacts/           # 人、会社、関係性のメモ
└── templates/          # 再利用可能なプロンプトと形式

日次ログ形式

# 2026-04-22 - 日次ログ

## セッション
- 09:00 - セッション1: authモジュールのリファクタリング (@dev)
- 11:30 - セッション2: 投資家向けアップデートのドラフト作成 (@writer)

## 決定事項
- JWTからセッションクッキーに切り替え(`data/decisions/2026-04-22-auth.md` を参照)

## ブロッカー
- ベンダーからのAPIキー待ち(2026-04-24 にフォローアップ)

## 次のアクション
- [ ] authリファクタリングPRをマージする
- [ ] 投資家向けアップデートをレビューに送る

自動振り返りパターン

各セッションの終わりに、カーネルが振り返りを追記します:

## 振り返り - セッション3
- うまくいったこと: 並列エージェント実行により20分節約
- うまくいかなかったこと: @researcher がペイウォールのあるソースに遭遇、より優れたソースランキングが必要
- 変更すべきこと: 調査メモに `source-tier` フィールドを追加(A/B/C 信頼性)

これにより、コード変更なしで時間の経過とともにシステムを改善するフィードバックループが作成されます。

スケジュール自動化

Agentic OSタスクは、外部のcronを使用してスケジュール実行されます(Claude Codeの組み込みcronはセッション終了時に停止します)。

macOS: LaunchAgent

<!-- ~/Library/LaunchAgents/com.agentic.daily-sync.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ...>
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.agentic.daily-sync</string>
    <key>ProgramArguments</key>
    <array>
        <string>/claude</string>
        <string>--cwd</string>
        <string>/path/to/project</string>
        <string>--command</string>
        <string>/daily-sync</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>8</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
    <key>StandardOutPath</key>
    <string>/tmp/agentic-daily-sync.log</string>
</dict>
</plist>

Linux: systemd タイマー

# ~/.config/systemd/user/agentic-daily-sync.service
[Unit]
Description=Agentic OS Daily Sync

[Service]
Type=oneshot
ExecStart=/usr/local/bin/claude --cwd /path/to/project --command /daily-sync
# ~/.config/systemd/user/agentic-daily-sync.timer
[Unit]
Description=毎朝日次同期を実行

[Timer]
OnCalendar=*-*-* 8:00:00
Persistent=true

[Install]
WantedBy=timers.target

クロスプラットフォーム: pm2

# ecosystem.config.js
module.exports = {
  apps: [{
    name: 'agentic-daily-sync',
    script: 'claude',
    args: '--cwd /path/to/project --command /daily-sync',
    cron_restart: '0 8 * * *',
    autorestart: false
  }]
};

データレイヤー

データレイヤーはファイルシステムです。構造化データにはJSON、ナラティブコンテンツにはマークダウンを使用します。

構造化状態のJSON

// data/projects/website-v2.json
{
  "name": "Website v2",
  "status": "in-progress",
  "milestone": "beta-launch",
  "agents_involved": ["@dev", "@writer"],
  "files": {
    "spec": "docs/website-v2-spec.md",
    "design": "designs/website-v2.fig"
  },
  "metrics": {
    "commits": 47,
    "last_session": "2026-04-22T11:30:00Z"
  }
}

ナラティブ用のマークダウン

人間が読むもの(決定事項、ログ、調査メモ、連絡先記録)にはマークダウンを使用します。

スキーマ進化

既存のフィールドの名前を決して変更しないでください。新しいフィールドを追加し、古いものを非推奨としてマークします:

{
  "name": "Website v2",
  "status": "in-progress",
  "milestone": "beta-launch",
  "_deprecated_priority": "high",
  "priority_v2": { "level": "high", "rationale": "投資家デモをブロックするため" }
}

これにより、移行スクリプトなしで履歴データを読み取り可能に保ちます。

アンチパターン

モノリシック単一エージェント

# 悪い例 - 1つのエージェントがすべてを行う
あなたはフルスタック開発者、ライター、研究者、DevOpsエンジニアです。

専門エージェントに分割してください。カーネルがルーティングを処理します。

ステートレスセッション

# 悪い例 - セッション間でメモリがない
Claude Codeを開くたびに毎回新たに開始する。

セッション開始時には常に data/ を読み、セッション終了時には書き戻します。

ハードコードされた認証情報

# 悪い例 - APIキーがエージェントファイルやCLAUDE.mdに直接書かれている
あなたのOpenAI APIキーは sk-xxxxxxxx です

環境変数またはスクリプトで読み込まれる .env ファイルを使用してください。エージェントは process.env.API_KEY を参照します。

単純な状態のための外部データベース

# 悪い例 - 単一ユーザーのエージェントOSにPostgreSQLを使用

複数の同時ユーザーやGB単位のデータが発生するまでは、JSON/マークダウンファイルを使用してください。

過剰に設計されたルーティング

# 悪い例 - ルーティングロジックがコード内にあり、マークダウンテーブルではない
if (intent.includes('deploy')) { agent = opsAgent; }

ルーティングは CLAUDE.md のマークダウンテーブルで宣言的に保ってください。検査、編集、デバッグが容易です。

ベストプラクティス

  • CLAUDE.md は200行未満でコンテキストウィンドウに収まる
  • 各エージェントファイルは100行未満で1つのドメインに焦点を当てる
  • data/ は機密ログ用にgit無視、決定事項や仕様用にgit追跡する
  • コマンドは命令形の名前を使用する: /run-daily-sync ではなく /daily-sync
  • ログは追記専用。過去の日次ログは決して編集しない
  • すべてのエージェントに、どのファイルを読むかを定義する Memory Scope セクションがある
  • 振り返りは毎セッションの終了時に書かれる
  • スケジュールタスクには、Claude Codeのセッションcronではなく、外部cron(LaunchAgent、systemd、pm2)を使用する
  • コスト追跡: セッションごとのAPI支出を data/logs/<date>-costs.json に記録する
  • 1プロジェクト = 1 Agentic OS。無関係なプロジェクトで単一の CLAUDE.md を共有しない

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

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

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-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.

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.

関連スキル