Agent skill

Loop Engineering

by Mark393295827 in Mark393295827/third-brain-v7-skills

A skill your agent uses when a repeatable task must become a bounded Trigger - Execute - Verify - State loop, scheduled automation, goal agent, or metric-driven research cycle.

MITAuto-check passedAgent Workflows

Install Loop Engineering

skills CLI
$ npx skills add Mark393295827/third-brain-v7-skills --skill loop-engineering -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mark393295827/third-brain-v7-skills loop-engineering --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mark393295827/third-brain-v7-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/loop-engineering .claude/skills/loop-engineering && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
loop-engineering
GitHub stars
141
Token cost
~1.9k tokens
SKILL.md length
817 words
Files
4 (incl. scripts, references)
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when a repeatable task must become a bounded Trigger - Execute - Verify - State loop, scheduled automation, goal agent, or metric-driven research cycle.

  • Works in 7 steps: Observe: load durable state, fresh… → Orient: update one hypothesis; choose… → Decide: check scope, permissions,… → …
  • A repeatable task must become a bounded Trigger - Execute - Verify - State loop
  • SKILL.md covers Usage Template, Workflow, Failure Protocol and Output Contract, plus 3 more sections
  • Runs Python scripts from its folder

What it does

Loop Engineering is an agent skill from Mark393295827/third-brain-v7-skills. Use when a repeatable task must become a bounded Trigger - Execute - Verify - State loop, scheduled automation, goal agent, or metric-driven research cycle.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `agents/openai.yaml`, `references/ci-repair-loop-example.md` and `scripts/validate_loop_contract.py`).

It sits in Agent Workflows, covering Autonomous loops. The repository describes itself as: agent wiki +engineering skills. The licence is MIT.

When your agent uses it

  • A repeatable task must become a bounded Trigger - Execute - Verify - State loop
  • Scheduled automation
  • Metric-driven research cycle

Example prompts

  • “/loop-engineering”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Observe: load durable state, fresh environment evidence, budgets, and last error.
  2. Orient: update one hypothesis; choose the smallest action that can change the metric.
  3. Decide: check scope, permissions, expected evidence, and rollback.
  4. Act: execute one bounded action and capture artifact/diff/receipt.
  5. Verify: use a deterministic check or independent checker; compare metric and guardrails.
  6. State: append diagnosis, action, evidence, delta, budget, and next decision atomically.
  7. Stop/continue: stop on success, cap, permission boundary, regression, repeated signature, or no useful work.

What it can do on your machine

Read from SKILL.md and the folder at commit 5a64514. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Loop Engineering loads about 1.9k tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 44 tokens; SKILL.md has 817 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Mark393295827/third-brain-v7-skills at commit 5a64514, republished under its MIT licence (© Mark393295827). 817 words, ~1,882 tokens.

Download SKILL.mdSave it as .claude/skills/loop-engineering/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
loop-engineering
description
Use when a repeatable task must become a bounded Trigger -> Execute -> Verify -> State loop, scheduled automation, goal agent, or metric-driven research cycle.
metadata.version
8.1.0
metadata.updated
2026-08-18
metadata.profile
loop
metadata.assumes
The task has inspectable state, a finite budget, and at least one verifier independent of the builder's opinion.
metadata.conflicts_with
Unbounded retries, self-certification, silent external mutation, or loops whose state cannot be recovered.

Loop Engineering

<skill_contract> <input>A repeatable task with inspectable state, finite budgets, permissions, and an independent verifier.</input> <output>A validated Trigger -> Execute -> Verify -> State contract plus resumable run receipts.</output> <done>The declared metric or stop condition is supported by fresh validator and verifier evidence.</done> <non_goals>Dependency-graph orchestration, unbounded autonomy, or self-certified completion.</non_goals>

Build loops only when repeated execution creates evidence. Every loop needs admission, a validated contract, durable state, independent evaluation, bounded retries, stop/recovery rules, and a final receipt.

Usage Template

Provide: objective, trigger, scope/non-goals, inputs, state/artifact paths, metric, verifier, permissions, budgets, stop condition, recovery, and write-back. See references/ci-repair-loop-example.md for a worked contract.

Workflow

<intake>

Select one mode:

  • Goal: run until a defined end state or cap.
  • Loop: poll/iterate while eligible work exists.
  • Automation: start from an external schedule/event; the trigger is not execution evidence.
  • AutoResearch: vary experiments against an objective metric in a sandbox.

Admit only if work is repeatable, outputs are inspectable, a verifier exists, failures are recoverable, and autonomy is worth the orchestration/review cost. Otherwise use a one-shot workflow.

Use graph-engineering instead when explicit data dependencies, independent branches, typed joins, or node-local recovery create measurable value. A Graph node may use this Loop contract for local repetition; Graph width does not replace finite Loop depth.

</intake>

<unknowns_gate>

Classify unknowns as known, probeable, testable, or blocked. Missing objective, verifier, permission boundary, budget, or recovery is NEEDS_INPUT; do not infer these controls from intent. Unknown implementation details may be resolved inside the loop only when the probe is bounded and reversible.

</unknowns_gate>

<execute>

Write this contract before acting:

text
Objective:                 Mode: Goal | Loop | Automation | AutoResearch
Trigger:                   Scope:                 Non-goals:
Owner:                     Inputs:
Artifacts path:            State path:            Work clock:
Success metric:            Evidence:              Verifier:
Topology: single-agent | maker-checker | manager-workers
Max iterations:            Time limit:            Budget:
Review budget:             Stop condition:
Write-back:                Permission boundary:   Recovery:

Validate it with scripts/validate_loop_contract.py --strict. Then iterate:

  1. Observe: load durable state, fresh environment evidence, budgets, and last error.
  2. Orient: update one hypothesis; choose the smallest action that can change the metric.
  3. Decide: check scope, permissions, expected evidence, and rollback.
  4. Act: execute one bounded action and capture artifact/diff/receipt.
  5. Verify: use a deterministic check or independent checker; compare metric and guardrails.
  6. State: append diagnosis, action, evidence, delta, budget, and next decision atomically.
  7. Stop/continue: stop on success, cap, permission boundary, regression, repeated signature, or no useful work.

Normalize the model/runtime termination signal after every action. complete still requires the declared verifier; tool_request returns proposed arguments to the host permission gate; checkpoint/truncation persists state before any continuation; refusal, error, or unknown escalates. Never infer completion from fluent prose or from the word "stop" alone.

For maintenance and queue loops, declare an allowed NO_OP outcome and its eligibility query. A quiet iteration is successful only when the query proves there was no eligible work, output count is within policy, and no side effect occurred.

Use single-agent by default, maker-checker for ambiguous/high-risk evaluation, and manager-workers only for genuinely independent work with an explicit integration gate.

If a validated Graph owns the dependency topology, this skill owns only the bounded retry behavior inside its declared loop nodes.

</execute>
<evaluate>

The verifier must test the declared result rather than reward activity. Check evidence freshness, metric movement, guardrails, scope, and state replay. For external or consequential actions, require approval and verified rollback before crossing the boundary.

</evaluate>

<retry_policy>

max_attempts equals the contract's finite max iterations. Retry only after a named diagnosis and a changed input, tool, scope, or strategy. Stop on the same failure signature twice, metric regression, exhausted review budget, or NO_PROGRESS.

</retry_policy>

<state_contract>

Persist {run_id, status, attempt, budget, evidence, unknowns, last_error, next_action} plus contract version, trigger receipt, hypothesis, action, normalized termination reason, artifact/diff, metric/guardrail delta, permissions, output count, no-op receipt, work clock, and recovery point. Append iterations; write current state atomically.

</state_contract>

Show full SKILL.md (230 more words)Show less

Failure Protocol

  • NEEDS_INPUT: a mandatory contract field is absent; do not start.
  • BLOCKED_PERMISSION: the next action crosses authority; checkpoint and request approval.
  • VERIFY_FAILED: result or guardrail fails; rollback/regroup before another attempt.
  • NO_PROGRESS: the same signature repeats or the metric is unchanged after a changed attempt.
  • BUDGET_STOP: any iteration, time, tool, cost, or review cap fires. max_attempts is always finite.

Output Contract

Return status, result (metric/end-state decision), evidence (validator and iteration receipts), unknowns, and next_action (stop, retry, approval, recovery, or handoff).

Edge Cases

  • A scheduled job fired but produced no run receipt: status is triggered, not completed; inspect executor state.
  • The model ends because its context or token budget is exhausted: checkpoint and return BUDGET_STOP or resume from state; do not label truncation success.
  • A queue poll returns zero items: accept NO_OP only after the declared query and side-effect check pass.
  • The metric improves while a safety guardrail regresses: rollback and return VERIFY_FAILED; never optimize the headline metric alone.

Success Metrics

  • The strict validator passes before execution.
  • Every iteration changes evidence, state, or diagnosis within finite budgets.
  • A fresh verifier supports the final status and residual risk.

Quality Gates

  • Trigger, owner, topology, budgets, stop, recovery, and write-back are explicit.
  • Builder opinion is not the only verifier.
  • Termination classes and any legal no-op have host-owned routing and evidence.
  • State replay recovers the next decision losslessly.
  • External mutation requires approval and rollback.

</skill_contract>

© Mark393295827, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/loop-engineering of Mark393295827/third-brain-v7-skills.

  • SKILL.md
  • agents/openai.yaml
  • references/ci-repair-loop-example.md
  • scripts/validate_loop_contract.py

Open the folder on GitHubat commit 5a64514

Compare with similar skills

Loop Engineering next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Loop Engineering compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Loop Engineering this skillMark393295827/third-brain-v7-skills141—~1.9kAutomated safety check: PassMIT
Show Me Your Work Decision Logcursor/plugins10k9 repos~1.6kAutomated safety check: PassNone
Autoresearch Iteration Loopuditgoenka/autoresearch6.5k1 repos~2kAutomated safety check: PassMIT
AutopilotYeachan-Heo/oh-my-claudecode40k1 repos~4.4kAutomated safety check: PassMIT
Install Loop Engineeringcobusgreyling/loop-engineering11k1 repos~648Automated safety check: PassMIT
LoopyForward-Future/loopy3.2k—~3.9kAutomated safety check: PassMIT

Similar skills

  • Official

    Keeps a TSV decision log for long or unattended agent runs, one row per decision with what, why, evidence and result, so a reviewer can check the work later.

    10k GitHub starsUsed in 9 repos~1.6k tokens
    Agent WorkflowsAuto-check passed
  • Autoresearch Iteration Loop

    uditgoenka/autoresearch

    Runs an autonomous modify, verify, keep-or-discard loop against any metric, with subcommands for planning, debugging, fixing, security audits, shipping and more.

    6.5k GitHub starsUsed in 1 repo~2k tokens
    Agent WorkflowsAuto-check passed
  • Autopilot

    Yeachan-Heo/oh-my-claudecode

    Takes a short product idea through requirements, design, planning, parallel implementation, QA cycles and multi-reviewer validation to produce working code.

    40k GitHub starsUsed in 1 repo~4.4k tokens
    Agent WorkflowsAuto-check passed
  • Install Loop Engineering

    cobusgreyling/loop-engineering

    Installs Loop Engineering into a project through the single @cobusgreyling/loop CLI, scaffolding a report-only loop and a readiness score.

    11k GitHub starsUsed in 1 repo~648 tokens
    Agent WorkflowsAuto-check passed
  • Loopy

    Forward-Future/loopy

    Discover, find, compare, audit, repair, adapt, craft, run, debrief, save, and prepare repeatable AI-agent loops for publication.

    3.2k GitHub stars~3.9k tokensUpdated 26 days ago
    Agent WorkflowsAuto-check passed
  • Pushes an agent to exhaust every option, investigate before asking and take initiative beyond the literal request, instead of giving up or waiting passively.

    20k GitHub starsUsed in 2 repos~6.9k tokens
    Agent WorkflowsAuto-check passed

More from Mark393295827/third-brain-v7-skills

All 21 skills in this repo
  • Graph Engineering

    Mark393295827/third-brain-v7-skills

    A skill your agent uses when a workflow has explicit data dependencies, independently executable branches, typed joins, or node-local recovery needs that justify a bounded static dependency graph.

    141 GitHub stars~1.9k tokensUpdated 18 days ago
    Auto-check passed
  • Harness Engineering

    Mark393295827/third-brain-v7-skills

    A skill your agent uses when an agent workflow needs production-like runtime controls for context, tools, permissions, observability, scheduling, evaluation, recovery, or maintenance.

    141 GitHub stars~2.2k tokensUpdated 18 days ago
    Auto-check passed
  • Agent Teams Command

    Mark393295827/third-brain-v7-skills

    A skill your agent uses when work has genuinely independent streams or distinct builder, evaluator, domain, and integration roles that require bounded multi-agent command scaled from 5 to 100+ agents.

    141 GitHub stars~1.7k tokensUpdated 18 days ago
    Auto-check passed
  • AI Six Sigma Property Os

    Mark393295827/third-brain-v7-skills

    A skill your agent uses when property-service operations need an AI plus ontology plus DMAIC design for work orders, dispatch, quotes, evidence, CTQ metrics, and control dashboards.

    141 GitHub stars~1.4k tokensUpdated 18 days ago
    Auto-check passed
  • Anthropic Os

    Mark393295827/third-brain-v7-skills

    A skill your agent uses when a personal or team operating system needs a bounded redesign using Four-C, closed-loop controls, 70/30 allocation, 3B creativity, experiments, and prediction-error…

    141 GitHub stars~1.6k tokensUpdated 18 days ago
    Auto-check passed
  • Deep Research

    Mark393295827/third-brain-v7-skills

    A skill your agent uses when a decision-relevant question needs multi-source search, claim-level citations, contradiction handling, uncertainty, or a durable wiki handoff.

    141 GitHub stars~1.5k tokensUpdated 18 days ago
    Auto-check passed

Categories

Questions about Loop Engineering

What does Loop Engineering do?

A skill your agent uses when a repeatable task must become a bounded Trigger - Execute - Verify - State loop, scheduled automation, goal agent, or metric-driven research cycle. Loop Engineering is an agent skill from Mark393295827/third-brain-v7-skills. Use when a repeatable task must become a bounded Trigger - Execute - Verify - State loop, scheduled automation, goal agent, or metric-driven research cycle.

When should I use Loop Engineering?

Loop Engineering fits situations like: A repeatable task must become a bounded Trigger - Execute - Verify - State loop; scheduled automation; metric-driven research cycle.

How do I install Loop Engineering in Claude Code?

Run `npx skills add Mark393295827/third-brain-v7-skills --skill loop-engineering -a claude-code`. Or copy the skill folder (skills/loop-engineering in Mark393295827/third-brain-v7-skills) into .claude/skills/loop-engineering in your project. Claude Code loads it when a task matches its description.

How do I install Loop Engineering in Codex?

Run `npx skills add Mark393295827/third-brain-v7-skills --skill loop-engineering -a codex`. Or copy the skill folder (skills/loop-engineering in Mark393295827/third-brain-v7-skills) into .agents/skills/loop-engineering in your project. Codex loads it when a task matches its description.

Can I use Loop Engineering in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mark393295827/third-brain-v7-skills --skill loop-engineering -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/loop-engineering, .gemini/skills/loop-engineering, .github/skills/loop-engineering and .opencode/skills/loop-engineering in your project.

What does Loop Engineering need to run?

Going by SKILL.md and its folder, Loop Engineering needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Loop Engineering access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Loop Engineering safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Loop Engineering use?

Loop Engineering is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Loop Engineering use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Loop Engineering?

Skills that share tags, products or a category with Loop Engineering: Show Me Your Work Decision Log (cursor/plugins, 10k stars), Autoresearch Iteration Loop (uditgoenka/autoresearch, 6.5k stars), Autopilot (Yeachan-Heo/oh-my-claudecode, 40k stars) and Install Loop Engineering (cobusgreyling/loop-engineering, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Loop Engineering?

Mark393295827 (a GitHub user) maintains it in Mark393295827/third-brain-v7-skills, which has 141 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.

Source: Mark393295827/third-brain-v7-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.