Skip to content
Agentmart
Submit a tool

agent-loop

Agentic loop discipline.

Skill by ChidiOkoene

IndexedMIT★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/chidiokoene-agent-loop

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Agentic loop discipline. Use when the user wants to loop until done, iterate until tests pass, keep fixing until green, run until verification passes, or mentions red-green-refactor in an iterative fix context.

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/agent-loop

What's inside

Skill name
agent-loop
Description
Agentic loop discipline. Use when the user wants to loop until done, iterate until tests pass, keep fixing until green, run until verification passes, or mentions red-green-refactor in an iterative fix context.
License
MIT
Instructions
60 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • STOP-RULES.md

SKILL.md (first lines)

# Agent Loop

**Plan → Act → Observe → Verify → Stop**

A stateful control cycle for autonomous engineering work. Read `.agent/context/loops.md` first (fallback: `docs/agents/loops.md`); if missing, use conservative defaults (iteration cap 5, no push/deploy/CI changes) and suggest `/setup-agent-loops`.

When exploring the codebase, read `CONTEXT.md` (if it exists) so changes use the project's domain vocabulary.

When you encounter a knowledge gap (unknown terminology, missing concepts, need to ground a decision), reach for `research-from-vault` (or run external research first then synthesize into the vault). Goals of the form "research X using the vault until a synthesis note and learning record exist" are valid and encouraged when the vault is configured.

## 1. Plan

Before the first change:

- State the **goal** and **done signal** (what verifier output means success).
- Read `.agent/context/loops.md` (fallback: `docs/agents/loops.md`) for verification commands, stop rules, and editable scope.
- Read `.agent/context/project-context.md` (fallback: `docs/agents/project-context.md`) when present — project filter over global vault knowledge.
- If building features test-first, reach for the `/tdd` skill.
- Track **iteration count** from 1.

## 2. Act

One **bounded change** per iteration — a vertical slice, not a bulk rewrite.

- Stay within editable paths from `.agent/context/loops.md` (fallback: `docs/agents/loops.md`).
- Prefer the smallest change that could move verification toward green.

## 3. Observe

Run the **after-each-change** verifier(s) from `.agent/context/loops.md` (fallback: `docs/agents/loops.md`).

Paste or summarize the relevant output — pass/fail must be unambiguous from exit code and output.

## 4. Verify

- **Pass** → if the task touched multiple areas, run the **before-stopping** gate (full suite). If that passes, and the change is code, run the `two-axis-review` skill in gate mode; a `FAIL` verdict is a failing verifier. Then stop with success brief.
- **Fail** → proceed to step 5.

## 5. Stop or continue

Apply stop rules from [STOP-RULES.md](STOP-RULES.md):

- Iteration cap hit → stop with brief.
- Same failure N times with no meaningful diff → stop with brief.
- Next step needs forbidden action → stop with brief.
- Fix path unclear after one failed attempt → reach for `/diagnosing-bugs` before blind retries.

If continuing: increment iteration count, return to **Act** with a changed strategy — don't repeat the same fix.

## Completion criterion

The loop is done when verification passes and a success brief is presented, **or** any stop rule fires with an explicit brief to the user.

For **significant** research or engineering goals (multi-step synthesis, architecture changes, non-obvious fixes), emit a decision trace when configured:
- Research: vault `Decision Traces/` (see `setup-knowledge-vault/templates/decision-trace-template.md`)
- Engineering: repo `.agent/context/decision-traces/` (fallback: `docs/agents/decision-traces/`) when that folder exists

**Vault:** when this finishes, update the vault per the `## Vault write-back` block in `AGENTS.md`/`CLAUDE.md`, or run `/vault-sync`.

From ChidiOkoene/optimal-brain, MIT.

More from ChidiOkoene/optimal-brain

Signals

Stars
3
Forks
0
Open issues
0
Last commit (this folder)
Oct 14, 2026 (14 days ago)
Last release
Oct 13, 2026 (15 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ChidiOkoene

Cite this page

agent-loop skill. Agent Mart. https://agentmart.dev/skills/chidiokoene-agent-loop (last updated 2026-10-24)