loop-engine
Skill2 starsChanged 53 days agoMITView on GitHub
The Atelier operating loop — understand → clarify → plan → execute → review → compare-vs-done-state. Governs when to stop, when to ask, which model tier runs each phase, and when to think deep or compact. Load for ANY nontrivial task.
In this repository28 other files it gives its agents.
- anime-jsSkill
- apple-designSkill
- asset-pipelineSkill
- atelier-bootstrapSkill
- atelier-buildSkill
- atelier-clarifySkill
- atelier-doctorSkill
- atelier-learnSkill
- atelier-planSkill
- atelier-promoteSkill
- atelier-reviewSkill
- atelier-shipSkill
- atelier-statusSkill
- atelier-updateSkill
- auth-lawSkill
- clean-code-lawSkill
- deploy-advisorSkill
- design-lawSkill
- docs-siteSkill
- gatewaySkill
- living-graphicsSkill
- mcp-makerSkill
- principal-mindSkill
- security-lawSkill
- stack-guidesSkill
- structure-lawSkill
- web-3dSkill
- web-qualitySkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Every task is recursion with a base case: if (done) return;.
- Very specific: line 26
Read BEFORE asking: the repo, applicable host instructions (AGENTS.md on Codex, CLAUDE.md on Claude), workspace/project.md, the store …
- Very specific: line 35
Ask only questions that change what you build — stack choice, auth mode, repo layout, product intent.
- Distinctive: line 56
Read the runtime contract.
- Distinctive: line 72
Use the host's configured model and reasoning effort.
- Distinctive: line 73
After a milestone or before a long build: use host compaction only when available and appropriate — persist state to the store first so …
- Distinctive: line 76
Never poll anything, anywhere.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Loop Engine
Step 0 — before anything: adopt the principal-mind skill. It sets how you decide (no hedging), debug (root cause), secure (reflexes), and speak (outcome-first). Every phase below runs inside that mindset, on every model tier.
Every task is recursion with a base case: if (done) return;. You may not claim
"done" while any done-criterion is unmet.
The loop
Understand → Clarify → Plan → Execute → Review → Compare vs Done-State
▲ │
└────────────── criteria unmet? loop ────────────────┘
all criteria met? STOP1. Understand (always first, never skipped)
Read BEFORE asking: the repo, applicable host instructions (AGENTS.md on Codex, CLAUDE.md on Claude), workspace/project.md, the store
(python <plugin>/db/store.py rules <domain>), code-review-graph if present, and
the web when facts are missing. Don't hunt for framework files — query the
map: python <plugin>/db/store.py map <topic> returns exactly which
skill/tool/agent to load for a topic (one query instead of directory reads). Then write down: assumptions (things you'll take
as true) and unknowns (things only the user can settle).
2. Clarify (once, batched, only unknowns)
Ask only questions that change what you build — stack choice, auth mode,
repo layout, product intent. Never re-ask what intake already answered
(clarifications table). One batch, not a drip. If a default is industrial
standard, state it and proceed unless overridden.
3. Plan (architect tier)
Complex/ambiguous/architectural work → the architect role produces:
the plan, the file map, risks, and a done-state contract — concrete,
checkable criteria written to plans + done_criteria. Planning respects the host's configured reasoning settings. The architect NEVER writes
production code.
4. Execute (builder tier)
The builder role implements plan tasks one at a time, obeying design-law, clean-code-law, structure-law, auth-law, security-law. Independent small tasks may fan out to parallel builders. Trivial mechanical edits and digests go to the summarizer role.
Host routing
Read the runtime contract. Claude agent wrappers retain their model pins. Codex uses the selected model for architect, builder, summarizer, learner and design-scout responsibilities, delegating only where supported and permitted; otherwise run sequentially. The parent coordinates state writes. Never change the user's model configuration.
5. Review (gates, not opinions)
Atelier review: ponytail pass, code-review-graph impact, lint/typecheck,
file-size law, design-token compliance for UI, a11y/perf where relevant. Update
done_criteria.passed with evidence.
6. Compare & terminate
SELECT criterion FROM done_criteria WHERE plan_id=? AND passed=0. Rows remain →
loop (fix, don't restart). Zero rows → report done, with evidence. A manual
criterion passes only when the user says so — log their words as evidence.
Session hygiene
- Use the host's configured model and reasoning effort.
- After a milestone or before a long build: use host compaction only when available and appropriate — persist state to the store first so nothing is lost (plans and criteria live in SQLite, not in chat history).
- Never poll anything, anywhere. Event-driven or one-shot timers only. User instructions and host permissions take precedence. Unmet criteria prevent a completion claim, but do not authorize ignoring a stop or retrying an external blocker indefinitely.
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
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.

