Agentic Loop Skill logo

Agentic Loop Skill

Community
zeenie-ai
agentic-loop-skill

Autonomous decision loop with reflection and iteration

Overview

Publisherzeenie-ai
RepositoryOpenCompany
Skill nameagentic-loop-skill
Stars
912
Forks
137
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by zeenie-ai on GitHub. Read the source before you install it.

Installation

Install the Agentic Loop Skill AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agentic Loop Skill in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agentic Loop Skill on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agentic Loop Skill is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Frequently asked questions

What does the Agentic Loop Skill AI skill do?

Autonomous decision loop with reflection and iteration

Why use Agentic Loop Skill on TypingMind?

Because you install it once and use it with any model. Agentic Loop Skill is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agentic Loop Skill in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zeenie-ai/OpenCompany/tree/main/server/skills/autonomous/agentic-loop-skill. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Agentic Loop Skill?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agentic Loop Skill?

As many as you like. As long as a model supports skills, you can use Agentic Loop Skill with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agentic Loop Skill AI skill free?

Yes. It is published on GitHub by zeenie-ai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇