agentleFS
victor-hac-workvictor-hac-work/loop-engineering-skills/skills/loop-engineering/SKILL.md

loop-engineering

Skill5 starsChanged 5 months agoMITView on GitHub

Help the user turn a rough idea into a full-context, detailed loop-engineering prompt and goal. Classifies the loop, walks the building blocks, scaffolds durable memory, and emits a ready-to-run prompt for /loop. Use when the user wants to design a loop, build an autonomous/self-running agent loop, automate a recurring task as a loop, or says 'loop engineering' / 'design a loop' / 'make this a loop'.

  • Deletes or force-pushes
  • Commits and pushes

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use aegis-gateway, deploy-vercel-render and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • vpeetla-aiSkill

    aegis-gateway

    Integrate AegisAI gateway before tool side effects (notify, publish, deploy). Use when adding Slack/Telegram/WhatsApp notify, content publish, or any irreversible external action in VAP, AegisLoop, or ai-content-factory.

    Also in 6 projects that use this

  • vpeetla-aiSkill

    deploy-vercel-render

    Deploy vpeetla-ai demos: Vercel static/Next.js frontends, Render FastAPI backends, env vars, free tier gotchas. Use when shipping demos, fixing deploy failures, or adding render.yaml / vercel.json.

    Also in 6 projects that use this

  • HermeticOrmusSkill

    langgraph-orchestration

    LangGraph stateful multi-agent graphs with categorical coordination patterns and cyclic workflows. Use when building stateful AI agent systems, implementing multi-agent orchestration with conditional routing, creating cyclic workflows with persistence, or designing graph-based AI pipelines with checkpointing and human-in-the-loop patterns.

    Also in 6 projects that use this

  • junimnjwSkill

    agentic-engineering

    Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing.

    Also in 7 projects that use this

  • +8 more from vpeetla-ai

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Do NOT emit the final loop prompt, run anything, install any hook/cron, or invoke /loop or /schedule until you have presented the design …

    line 14
  2. Distinctive:

    Create a todo per item and complete them in order:

    line 21
  3. Very specific:

    Run scripts/scan-harness.sh --project-dir <project>.

    line 58
  4. Very specific:

    Read the idea and define det vs non-det (see loop-patterns.md §5).

    line 63
  5. Distinctive:

    ONLY what you can't infer.

    line 71
  6. Very specific:

    Ask the user for hard rules the loop must never cross — forbidden paths (migrations, prod config), forbidden commands (git push origin …

    line 85
  7. Very specific:

    Ask for a time/cadence (interval like 15m, or a cron/specific time), or skip → run as goal (self-paced until done).

    line 91
  8. Very specific:

    Run scripts/init-memory.sh --topic <topic> --project-dir <project>.

    line 100
  9. Very specific:

    Write docs/loops-engineering/YYYY-MM-DD-<topic>.md covering: classification + why, goal, building-block choices, env, the 7 things, …

    line 107

“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Loop Engineer

Turn a rough idea into a full-context, detailed loop — a ready-to-run prompt + goal, backed by durable memory. You design the system that prompts the agent; you do not run it.

Reference (read before the dialogue): reference/loop-patterns.md.

<HARD-GATE> Do NOT emit the final loop prompt, run anything, install any hook/cron, or invoke /loop or /schedule until you have presented the design and the user has approved it. The skill produces a design + memory + prompt; the human decides when it runs. </HARD-GATE>

Checklist

Create a todo per item and complete them in order:

  1. Scan harness — run scripts/scan-harness.sh.
  2. Classify the loop — deterministic vs non-deterministic.
  3. Walk the building blocks — gap-only questions, one at a time.
  4. Guardrails — ask for restrictions the loop must never cross (skippable).
  5. Scheduling — ask for a time/cadence, or skip → run as goal.
  6. Design state schema — critique the goal, derive the minimal state.
  7. Init memory — run scripts/init-memory.sh, then author goal-specific state files.
  8. Write design doc — docs/loops-engineering/YYYY-MM-DD-<topic>.md.
  9. Self-review — dispatch the reference/loop-design-reviewer.md subagent.
  10. Approval gate — present design; on approval, emit the loop prompt + run instructions.

Flow

digraph loop_engineer {
  "Scan harness" -> "Classify det/non-det";
  "Classify det/non-det" -> "Non-det?";
  "Non-det?" -> "Ask goal" [label="yes"];
  "Non-det?" -> "Walk building blocks" [label="no"];
  "Ask goal" -> "Walk building blocks";
  "Walk building blocks" -> "Guardrails (skippable)";
  "Guardrails (skippable)" -> "Scheduling (or skip)";
  "Scheduling (or skip)" -> "Design state schema";
  "Design state schema" -> "Init memory + author state";
  "Init memory + author state" -> "Write design doc";
  "Write design doc" -> "Self-review subagent";
  "Self-review subagent" -> "User approves?";
  "User approves?" -> "Write design doc" [label="changes"];
  "User approves?" -> "Emit loop prompt + run instructions" [label="yes"];
}

Steps in detail

1. Scan harness

Run scripts/scan-harness.sh --project-dir <project>. It returns JSON: { skills[], agents[], mcp[], hooks[], gitWorktreeCapable }. Use it to prefill which skills/sub-agents/MCP the loop can leverage and whether a worktree env is feasible.

2. Classify

Read the idea and define det vs non-det (see loop-patterns.md §5).

  • Deterministic → a real pass/fail check exists (tests/build/lint/audit).
  • Non-deterministic → ask the user for the goal; if no measurable check can be derived, the verification gate is AI-as-judge against that goal. State your classification and reasoning so the user can override.

3. Walk the building blocks (gap-only)

One question at a time, multiple-choice when possible. Prefill from the scan + idea; ask ONLY what you can't infer.

BlockAsk / infer
Scheduling(handled in step 5)
Worktreeask: isolated git worktree, or current dir (only offer worktree if gitWorktreeCapable)
Skillswhich scanned skills to leverage (prefill)
MCPwhich scanned MCP servers to use (prefill)
Sub-agentsmaker/checker split? default ON for non-trivial loops. Prefer reusing scanned agents[] for the implementer/checker roles when a fit exists

Also resolve 7-things gaps: verification gate, termination condition + max iterations, error handling, cost/budget.

4. Guardrails (skippable)

Ask the user for hard rules the loop must never cross — forbidden paths (migrations, prod config), forbidden commands (git push origin main, rm -rf), forbidden actions (deleting data, paid API calls). User may skip. This is distinct from the verification gate: gate = done?, guardrails = allowed? (see loop-patterns.md §6).

5. Scheduling (or skip)

Ask for a time/cadence (interval like 15m, or a cron/specific time), or skip → run as goal (self-paced until done). This drives the run instruction emitted at the end (loop-patterns.md §8).

6. Design state schema

Critique the goal: what must persist so the next iteration/agent knows where things stand after a context reset? Apply the rubric (loop-patterns.md §7). Keep it minimal.

7. Init memory + author state

Run scripts/init-memory.sh --topic <topic> --project-dir <project>. It creates the memory dir + generic run-log.md and budget.md. Then you author the goal-specific state file(s) with Write (e.g. STATE.md, queue.md, classifications.json) matching your schema. If guardrails were given, write guardrails.md. Fill the real max-iterations/budget into budget.md.

8. Write design doc

Write docs/loops-engineering/YYYY-MM-DD-<topic>.md covering: classification + why, goal, building-block choices, env, the 7 things, guardrails, scheduling/run mode, the derived state (with file list), and the assembled loop prompt.

9. Self-review

Dispatch the subagent from reference/loop-design-reviewer.md. Fix any blocking issues inline before presenting.

10. Approval gate → emit

Present the design. On approval ONLY, emit:

  • the filled loop-prompt skeleton (loop-patterns.md §11), and
  • the run instruction for the chosen mode (loop-patterns.md §8) — e.g. /loop 15m <prompt>, a /schedule routine, or self-paced /loop <prompt>.

Tell the user they can review the doc + memory files, then run it themselves.

Principles

  • One question at a time; multiple-choice preferred; ask only gaps.
  • YAGNI on state and features.
  • The human runs the loop. The skill stops at the approval gate.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.