with one click
agentic-loop-skill
Autonomous decision loop with reflection and iteration
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Autonomous decision loop with reflection and iteration
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Use this skill to generate well-branded interfaces and assets for OpenCompany (zeenie.ai), either for production or throwaway prototypes/mocks/etc. Contains essential design guidelines, colors, type, fonts, assets, and UI kit components for prototyping.
Launch Android applications by package name. Open any installed app programmatically.
Get list of installed Android applications with package names, versions, and metadata.
Control Android audio - get/set volume, mute/unmute for media, ringtone, notification, and call volumes.
Monitor Android device battery status, level, charging state, temperature, and health.
Control Android Bluetooth - enable, disable, get status, and list paired devices.
| name | agentic-loop-skill |
| description | Autonomous decision loop with reflection and iteration |
| allowed-tools | delegate_to_ai_agent python_executor check_delegated_tasks |
| metadata | {"author":"opencompany","version":"1.0","category":"autonomous"} |
You are an autonomous agent capable of iterative problem-solving through self-delegation and reflection.
┌─────────────────────────────────────────────────────────────┐
│ AGENTIC LOOP │
├─────────────────────────────────────────────────────────────┤
│ │
│ OBSERVE ──▶ THINK ──▶ ACT ──▶ REFLECT ──▶ DECIDE │
│ ▲ │ │
│ │ │ │
│ └──────────── (if not done) ◀──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
OBSERVE: What is the current state?
THINK: What should I do next?
ACT: Execute ONE focused action
REFLECT: Did it work?
DECIDE: Continue or complete?
To iterate on complex tasks, delegate to yourself with updated context:
{
"task": "Continue: [specific next step description]",
"context": "Iteration: 2/5\nPrevious result: [summary]\nCurrent state: [state]\nRemaining: [what's left to do]"
}
Iteration: {current}/{max}
Goal: {original goal}
Progress: {what has been accomplished}
State: {current data/results}
Errors: {any errors encountered}
Next: {specific next action}
Task: "Research the top 3 programming languages of 2024, compare their use cases"
{
"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++
{
"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
{
"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
{
"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 and return when:
CONTINUE when:
Task: "Calculate fibonacci(50) and factorize it"
# 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
{
"task": "Continue: Factorize the fibonacci result",
"context": "Iteration: 2/3\nGoal: Calculate and factorize fib(50)\nProgress: fib(50) = 12586269025\nNext: Find prime factors"
}
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)))}")
Final response to user with both results
When using self-delegation:
task_completed eventThis enables visual tracking of the loop in the workflow canvas.
If an iteration fails:
{
"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]"
}