# Map Agent Control Loops

Agent frameworks hide reasoning loops across scattered files. This skill guides Claude, Codex, and Claude Code to find loops, step functions, and termination conditions.

## Install

```bash
npx skillstore add dowwie/control-loop-extraction
```

## Metadata

- Status: approved
- Slug: dowwie-control-loop-extraction
- Skillstore revision: r1
- Version status: missing
- Tree hash: e4a824eb83c14535083210d5008de2fffe61b9f5425b13fa63c0168040d664e4
- Author: Dowwie
- GitHub username: Dowwie
- License: MIT
- Repository: https://github.com/Dowwie/agent\_framework\_study/tree/main/.claude/skills/control-loop-extraction
- Ref: 72d5025b022c77f7a51bdf5c1637c689c80e89d1
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/dowwie-control-loop-extraction
- Manifest: https://skillstore.pages.dev/api/skills/dowwie-control-loop-extraction/manifest

## Capabilities

- Identifies ReAct, Plan-and-Solve, Reflection, and Tree-of-Thoughts patterns.
- Guides users to locate the main agent execution loop.
- Breaks down step functions into input assembly, model call, parsing, and dispatch.
- Catalogs termination conditions such as step limits, token limits, timeouts, and loop detection.
- Provides a structured report template for documenting loop behavior.

## Use Cases

- Review an Agent Framework: Map the main loop, step function, and stop conditions before making architecture changes.
- Document Execution Flow: Create a clear control loop report for maintainers and reviewers.
- Compare Reasoning Patterns: Classify how different frameworks plan, act, reflect, and terminate.

## Prompt Templates

### Find the Main Loop

```
Use control-loop-extraction on this repository. Find the main agent loop and summarize its purpose, file location, and stop conditions.
```

### Extract the Step Function

```
Analyze these agent files with control-loop-extraction. Break the step function into input assembly, model call, parsing, dispatch, and result handling.
```

### Classify Reasoning Pattern

```
Use control-loop-extraction to classify this framework as ReAct, Plan-and-Solve, Reflection, Tree-of-Thoughts, hybrid, or other. Explain the evidence.
```

### Audit Termination Design

```
Apply control-loop-extraction to audit all termination paths. Identify missing guards, weak loop detection, retry limits, timeout behavior, and recovery paths.
```

## Limitations

- Requires source code access to the agent framework under review.
- Does not execute automated static analysis or build a dependency graph.
- May need another mapping skill to find relevant files in large repositories.
- Does not prove runtime behavior without tests or traces.

## Best Practices

- Start with repository mapping so likely agent files are in scope.
- Cite file locations for every loop, step function, and termination condition.
- Separate observed behavior from inferred design intent.

## Anti Patterns

- Do not classify a framework from naming alone.
- Do not ignore retry, timeout, and error threshold paths.
- Do not treat sample code as proof of runtime behavior.

## Security Audit

- Audited at: 2026-07-06T12:06:45.087\+00:00
- Summary: All static alerts are false positives caused by Markdown code fences and inline examples in SKILL.md. The skill contains documentation for analyzing agent loops, with no executable scripts, network access, shell commands, prompt injection, or data exfiltration intent found.

## Stats

- Views: 248
- Downloads: 10
- Favorites: 0
- Popularity score: 0
