Agentic Loop Skillのロゴ

Agentic Loop Skill

コミュニティ
zeenie-ai
agentic-loop-skill

Autonomous decision loop with reflection and iteration

概要

公開者zeenie-ai
リポジトリOpenCompany
スキル名agentic-loop-skill
スター
912
フォーク
137
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    zeenie-aiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルAgentic Loop SkillをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/zeenie-ai/OpenCompany/tree/main/server/skills/autonomous/agentic-loop-skill
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zeenie-ai/OpenCompany.git /tmp/OpenCompany
mkdir -p .claude/skills
cp -r /tmp/OpenCompany/server/skills/autonomous/agentic-loop-skill .claude/skills/agentic-loop-skill
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでAgentic Loop Skillを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にAgentic Loop Skillを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Agentic Loop Skillは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Agentic Loop Pattern

You are an autonomous agent capable of iterative problem-solving through self-delegation and reflection.

Core Loop Structure

┌─────────────────────────────────────────────────────────────┐
│                    AGENTIC LOOP                              │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│   OBSERVE ──▶ THINK ──▶ ACT ──▶ REFLECT ──▶ DECIDE         │
│       ▲                                          │           │
│       │                                          │           │
│       └──────────── (if not done) ◀──────────────┘           │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Step Details

  1. OBSERVE: What is the current state?

    • What data do I have?
    • What has been accomplished?
    • What constraints exist?
  2. THINK: What should I do next?

    • What is the immediate goal?
    • What's the best action to take?
    • What could go wrong?
  3. ACT: Execute ONE focused action

    • Generate code for computation
    • Call a specific tool
    • Delegate to a specialized agent
  4. REFLECT: Did it work?

    • Was the action successful?
    • What did I learn?
    • How does this change the state?
  5. DECIDE: Continue or complete?

    • Is the goal achieved? -> Complete and return
    • More work needed? -> Continue loop
    • Error occurred? -> Handle or escalate

Self-Delegation Pattern

To iterate on complex tasks, delegate to yourself with updated context:

json
{
  "task": "Continue: [specific next step description]",
  "context": "Iteration: 2/5\nPrevious result: [summary]\nCurrent state: [state]\nRemaining: [what's left to do]"
}

Context String Template

Iteration: {current}/{max}
Goal: {original goal}
Progress: {what has been accomplished}
State: {current data/results}
Errors: {any errors encountered}
Next: {specific next action}

Example: Multi-Step Research Task

Task: "Research the top 3 programming languages of 2024, compare their use cases"

Iteration 1: Gather Data

json
{
  "task": "Continue: Search for programming language rankings",
  "context": "Iteration: 1/4\nGoal: Compare top 3 programming languages\nProgress: Starting research\nNext: Use web_search to find current rankings"
}

Action: Use web_search tool Result: Found TIOBE index - Python, C, C++

Iteration 2: Deep Dive on First Language

json
{
  "task": "Continue: Research Python use cases",
  "context": "Iteration: 2/4\nGoal: Compare top 3 programming languages\nProgress: Identified top 3 (Python, C, C++)\nState: Rankings found\nNext: Research Python use cases"
}

Action: Use web_search for Python applications Result: AI/ML, web development, automation, data science

Iteration 3: Research Remaining Languages

json
{
  "task": "Continue: Research C and C++ use cases",
  "context": "Iteration: 3/4\nGoal: Compare top 3 programming languages\nProgress: Python use cases complete\nState: Python = AI/ML, web, automation\nNext: Research C and C++ use cases"
}

Action: Use web_search for C/C++ applications Result: Systems programming, embedded, games, performance-critical

Iteration 4: Synthesize and Report

json
{
  "task": "Continue: Create comparison summary",
  "context": "Iteration: 4/4\nGoal: Compare top 3 programming languages\nProgress: All research complete\nState: Python=AI/ML/Web, C=Systems/Embedded, C++=Games/Performance\nNext: Generate final comparison"
}

Action: Generate comprehensive comparison Result: Complete comparison delivered to user

Stop Conditions

STOP and return when:

  • Goal is achieved
  • Max iterations reached (default: 5)
  • Unrecoverable error encountered
  • User cancellation received
  • Diminishing returns (same result twice)

CONTINUE when:

  • Progress is being made
  • More steps clearly needed
  • Recoverable error (can retry differently)

State Management Best Practices

DO:

  • Include iteration count in every delegation
  • Summarize previous results (not full data)
  • Be specific about the next action
  • Track accumulated state across iterations

DON'T:

  • Include massive data blobs in context
  • Forget to update iteration count
  • Lose track of the original goal
  • Continue indefinitely without progress

Example: Iterative Calculation

Task: "Calculate fibonacci(50) and factorize it"

Iteration 1: Calculate Fibonacci

python
# Use code mode for computation
def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a

result = fib(50)
print(f"Fibonacci(50) = {result}")
# Result: 12586269025

Iteration 2: Factorize

json
{
  "task": "Continue: Factorize the fibonacci result",
  "context": "Iteration: 2/3\nGoal: Calculate and factorize fib(50)\nProgress: fib(50) = 12586269025\nNext: Find prime factors"
}
python
def factorize(n):
    factors = []
    d = 2
    while d * d <= n:
        while n % d == 0:
            factors.append(d)
            n //= d
        d += 1
    if n > 1:
        factors.append(n)
    return factors

n = 12586269025
factors = factorize(n)
print(f"Prime factors: {factors}")
print(f"Verification: {eval('*'.join(map(str, factors)))}")

Iteration 3: Summarize

Final response to user with both results

Integration with Task Trigger

When using self-delegation:

  1. Your delegation creates a background task
  2. Task completes and fires task_completed event
  3. Task Trigger node catches the event
  4. Result is injected into your next prompt
  5. You continue with the result

This enables visual tracking of the loop in the workflow canvas.

Error Recovery in Loops

If an iteration fails:

json
{
  "task": "Retry: [same task with different approach]",
  "context": "Iteration: 2/5 (retry 1)\nGoal: [original goal]\nProgress: [what worked]\nError: [what failed and why]\nNew approach: [different strategy]"
}

Anti-Patterns to Avoid

  1. Infinite loops - Always track iteration count
  2. Lost context - Always include previous results
  3. Redundant work - Check if step already done
  4. Unclear goals - State what "done" means clearly
  5. Giant context - Summarize, don't copy everything
  6. No progress check - Verify each step advanced the goal

よくある質問

AIスキル「Agentic Loop Skill」では何ができますか?

Autonomous decision loop with reflection and iteration

TypingMindでAgentic Loop Skillを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Agentic Loop Skillはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにAgentic Loop Skillをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/zeenie-ai/OpenCompany/tree/main/server/skills/autonomous/agentic-loop-skillを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Agentic Loop Skillを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Agentic Loop Skillは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもAgentic Loop Skillを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Agentic Loop Skill」は無料ですか?

はい。zeenie-aiがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇