control-loop-extractionlisted
Install: claude install-skill aiskillstore/marketplace
# Control Loop Extraction
Extracts and documents the core agent reasoning loop from framework source code.
## Process
1. **Locate the loop** - Find the main agent execution loop
2. **Classify the pattern** - Identify ReAct, Plan-and-Solve, Reflection, or Tree-of-Thoughts
3. **Extract the step function** - Document the LLM → Parse → Decide flow
4. **Map termination** - Catalog all loop exit conditions
## Reasoning Pattern Identification
### Pattern Signatures
**ReAct (Reason + Act)**
```python
# Signature: Thought → Action → Observation cycle
while not done:
thought = llm.generate(prompt) # Reasoning
action = parse_action(thought) # Action selection
observation = execute(action) # Environment feedback
prompt = update_prompt(observation) # Loop continuation
```
**Plan-and-Solve**
```python
# Signature: Upfront planning, then execution
plan = llm.generate("Create a plan for...")
for step in plan.steps:
result = execute_step(step)
if needs_replan(result):
plan = replan(...)
```
**Reflection**
```python
# Signature: Act → Self-critique → Adjust
while not done:
action = llm.generate(prompt)
result = execute(action)
critique = llm.generate(f"Evaluate: {result}")
if critique.needs_adjustment:
prompt = adjust_approach(critique)
```
**Tree-of-Thoughts**
```python
# Signature: Branch → Evaluate → Select
thoughts = [generate_thought() for _ in range(n)]
scores = [evaluate(t) for t in thoughts]
best = sele