Skip to content
Agentmart
Submit a tool

goal-loop

Execute the spec-tests-implement-verify cycle for one atomic task at a time.

Skill by MILTONADINA

IndexedMIT
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/miltonadina-goal-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

Execute the spec-tests-implement-verify cycle for one atomic task at a time. Use after plan-decomposition has produced a task list. This is the workhorse loop - the agent implements, runs tests, reflects on failure, retries with bounded iteration. Halts at the iteration ceiling, and when a budget, loop-detection or scratchpad-stasis hook fires where the host wires one. See constitution/LOOP.md for full protocol.

Use cases: productivity, finance, 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. Checked Oct 25, 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/goal-loop

What's inside

Skill name
goal-loop
Description
Execute the spec-tests-implement-verify cycle for one atomic task at a time. Use after plan-decomposition has produced a task list. This is the workhorse loop - the agent implements, runs tests, reflects on failure, retries with bounded iteration. Halts at the iteration ceiling, and when a budget, loop-detection or scratchpad-stasis hook fires where the host wires one. See constitution/LOOP.md for full protocol.
License
MIT
Instructions
109 lines in SKILL.md · view on GitHub

Files (3)

  • SKILL.md
  • SKILL.md.bundle
  • SKILL.md.sig

SKILL.md (first lines)

# Goal Loop

> The execution engine for spec-anchored work. Implements the loop in
> `constitution/LOOP.md`.

**Tradeoff:** Single-task focus is slower than batch implementation. Worth it:
each iteration is verifiable, failures are bounded, and partial progress is
durable.

---

## When to invoke

After:
- Spec is approved
- Plan exists at `.workflow/state/plans/<spec-id>.md`
- A specific task `T-NNN` is the current focus

Per task. Not per session. One task ≠ one session necessarily.

---

## Protocol (see constitution/LOOP.md for full diagram)

```
1. Load task T-NNN. Read AC mapping. Read related code directly (or via Claude Code's native Explore agent for wide searches).
2. Write failing test(s). Confirm they fail.
3. Implement minimum change to make test pass.
4. Run verification command.
   - PASS: emit proof-of-work, mark task complete, move to next.
   - FAIL: write reflection (specific test names + error messages),
           retry with different approach, increment iteration count.
5. If iteration count >= N (default 5): write blocker, halt.
6. If budget cap hit: halt (budget-brake hook fires).
7. If loop-detection fires: halt.
8. If scratchpad-stasis fires: halt.
```

---

## Reflection requirements

The reflection step is not optional. Before retrying, write to
`.workflow/state/loop-<task-id>.jsonl`:

```json
{
  "iteration": 3,
  "timestamp": "2026-05-22T10:42:13Z",
  "action_taken": "<what was just done>",
  "verification_command": "<command>",
  "exit_code": <code>,
  "failing_tests": ["test name 1", "test name 2"],
  "error_messages": ["actual error from output"],
  "reflection": "<specific hypothesis about why it failed>",
  "next_action": "<concrete next change>"
}
```

A reflection that says "try again with different approach" without specifics
is a constitution violation.

---

## Exit conditions

### Success
- All tests for the task pass
- No regression in other tests
- Lint, type check, format all clean
- Emit proof-of-work artifact
- Move to next task or write baton

### Bounded failure (blocker)
- Iteration count exceeded → write blocker, halt
- Budget cap hit → write blocker, halt
- Loop detected → write blocker, halt
- User intervention required → write open question, halt

NEVER:
- Skip the test
- Mark task complete without proof
- Modify acceptance tests during the loop
- Lower the spec to match the code

---

## Anti-patterns

**Test deletion**: if a test is "wrong," update the spec first, then regenerate
the test. Never edit tests mid-loop.

**Spec mutation**: if the spec is unclear, halt with a blocker. Don't reinterpret
mid-implementation.

**Success masking**: a non-zero exit code means the test did not pass, however
close the output looks. Record the real exit code and treat the iteration as a
FAIL.

**Hidden context**: every iteration must reference specific failing tests and
error messages. No vague reflections.

---

**This skill is working when:** sessions reach `done` state through verification
rather than assertion. Target: verified_done / claimed_done > 0.95. The
intended record is `governance/telemetry/done-ratio.jsonl`. Nothing writes it yet, so check by hand.

From MILTONADINA/DevOPs, MIT.

More from MILTONADINA/DevOPs

Signals

Stars
0
Forks
0
Open issues
12
Last commit (this folder)
Oct 12, 2026 (17 days ago)
Last release
Sep 23, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

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

More from MILTONADINA

Cite this page

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