agent-loops
Skill10 starsChanged 56 days agoMITView on GitHub
Design agent goals, loops, checkpoints, recovery, and stop conditions.
In this repository101 other files it gives its agents.
- AGENTS.mdAGENTS.md
- dot_agents/AGENTS.mdAGENTS.md
- skills/agent-project/templates/AGENTS.mdAGENTS.md
- skills/repository-docs/references/agents.mdAGENTS.md
- chezmoiSkill
- dot-developmentSkill
- dot-releaseSkill
- dot-skillsSkill
- dot-verifySkill
- acliSkill
- agent-evaluationSkill
- agent-frameworksSkill
- agent-harnessesSkill
- agent-projectSkill
- agent-protocolsSkill
- agent-usageSkill
- agySkill
- airflowSkill
- ai-security-assessmentSkill
- api-clientSkill
- ast-grepSkill
- auth-statusSkill
- awsSkill
- benchmarkSkill
- bfSkill
- chrome-devtoolsSkill
- cli-developmentSkill
- clipboardSkill
- cloud-runSkill
- code-securitySkill
- colabSkill
- containerizeSkill
- course-developmentSkill
- databricksSkill
- data-migrationSkill
- delegate-tasksSkill
- diagrams-as-codeSkill
- dockerSkill
- documentation-siteSkill
- dot-cliSkill
- dprintSkill
- draft-mailSkill
- duckdbSkill
- fact-checkSkill
- fmind-visualsSkill
- full-reviewSkill
- gcloudSkill
- ghSkill
- git-deliverySkill
- github-actionsSkill
- github-issuesSkill
- github-pull-requestSkill
- github-repositorySkill
- git-worktreeSkill
- google-developerSkill
- gwsSkill
- handoffSkill
- hfSkill
- implementation-planSkill
- incident-responseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Challenge the topology: Keep a layer only when it closes a distinct feedback horizon.
- Distinctive: line 23
Write the agent skills: Create one narrowly routed skill per retained loop using the loop skill contracts.
- Distinctive: line 25
Add helpers only for demonstrated mechanics: After a recurring mechanical operation is demonstrated, build a one-shot typed CLI per …
- Distinctive: line 28
Review for deletion: Start with skills and plain files.
- Distinctive: line 37
Private provenance stays private: When generalizing a private workflow, retain only reusable invariants.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Agent Loops
Design the smallest durable system that can learn, resume, stop, and prove what happened. This skill owns loop architecture; product-loop owns product discovery and launch decisions.
Workflow
- Define the decisions: State the objective, evidence that can change direction, authority, budget or horizon, external side effects, and hard stop conditions. Separate scientific or task success from operational completion.
- Make the goal the driver: Use the active harness's native
/goalwhen the user requests a sustained goal. Define whether completion means an evidenced objective, a finished time window, or an objective bounded by a deadline. Follow goals, prompts and continuation; verify actual host capabilities instead of implementing another goal engine. - Challenge the topology: Keep a layer only when it closes a distinct feedback horizon. Merge any layer that merely renames another role. Read loop topology when several decision horizons are needed.
- Choose minimal durable state: Prefer a human-readable portfolio checkpoint, one checkpoint per work item, an append-only event log, concise sourced lessons, and derived reports. Give every fact one owner; do not create a second task database. For explicitly assigned concurrent sessions, record disjoint work scope, session identity, shared writer and account-wide resource allocation before writes.
- Write the agent skills: Create one narrowly routed skill per retained loop using the loop skill contracts. Put research, critique, implementation, and reflection inside the loop step that needs them instead of scheduling role-shaped loops.
- Keep entry prompts thin: Project
prompts/run.mdandprompts/improve.mdreadAGENTS.md, load the owning skill and pass the goal scope, per thin project prompts; skills own procedure and stop rules. Add a named start prompt only for a real session assignment or distinct scenario. - Add helpers only for demonstrated mechanics: After a recurring mechanical operation is demonstrated, build a one-shot typed CLI per deterministic helpers; it never makes the loop's judgment calls.
- Engineer recovery before continuity: A process, local ledger row, queued job, or successful request proves only that stage. Refresh the authoritative local and live state before acting, claiming completion, or retrying; reconcile an interrupted or timed-out external mutation before retrying it, record unknown outcomes explicitly, and use only the active harness's native continuation or bounded wait when continuity is authorized.
- Test the failure boundaries: Unit-test parsing, transitions, locking, idempotency, exact identity checks, and malformed evidence. Replay success, negative evidence, interruption, ambiguous timeout, exhausted capacity, stale wake-up, and explicit stop with offline fakes; keep live proof separate.
- Review for deletion: Start with skills and plain files; remove supervisors, duplicate roles, receipt layers, and workflow state machines that do not protect a concrete invariant.
Gotchas
- Authority does not compose: Invoking a loop skill does not authorize spending, submissions, publication, deployment, commits, or other external effects absent from the current request.
- Stop is a state transition: Cancel waits, retries, successors, and new work promptly; checkpoint in-flight facts. A stale continuation must read the stopped state and perform no work.
- Time is not success: A deadline proves a window ended, not continuous execution or domain success. A result, report, compaction or empty queue is not the end of a still-active campaign; continue useful work or an actual bounded wait.
- Budgets are ceilings: Available tokens, compute or time do not justify unchanged queries, unsupported experiments or lower admission gates. Stable blockers need a reopening signal and evidence-review cadence.
- Outer means intentional: The outer loop is owner-invoked by default. Do not hide it in a timer or let it weaken domain rules, evidence thresholds, or authority boundaries.
- Private provenance stays private: When generalizing a private workflow, retain only reusable invariants; remove names, targets, providers, paths, measurements, budgets, credentials, and copied logs.
Documentation
- Companion skills: skillify (package authoring), prompt-design (instruction and tool boundaries), quality-assurance (risk-based scenario validation).
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.

