Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add j4flmao/agent-skills --skill core-architecturesgit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/j4flmao/agent-skills/core-architectures)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/core-architectures"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/core-architectures/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/core-architectures"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/core-architectures.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.01991 |
| Opus 5.5 | $0.00035 | $0.00796 |
| Sonnet 5.5 | $0.00017 | $0.00398 |
| Haiku 4.5 | $0.00009 | $0.00199 |
Grade A, and why
ai-agent-core-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 17d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Core Loop
Purpose
Every agent reduces to a loop: build context from state, ask the model for the next action, execute it, record the observation, decide whether to stop. Reliability comes from the parts around the model call: how context is assembled, how actions are validated, how progress is measured, and when the loop terminates. This skill covers those mechanics and the trade-offs between ReAct, plan-and-solve, and reflection variants.
Agent Protocol
Trigger
"agent loop", "ReAct", "plan-and-solve", "re-planning", "self-reflection", "Reflexion", "agent stuck in a loop", "termination condition", "max iterations".
Input Context
- Current loop code or framework config.
- Typical task length and failure transcripts (where it loops, stalls, or stops early).
- Tool list with side-effect classification.
Output Artifact
Loop specification or patch: state object, step function, termination rules, reflection policy.
Response Format
Variant: {react|plan-and-solve|plan-execute-replan|reflexion}
State: {fields}
Step: assemble_context -> decide -> validate -> execute -> observe -> update
Stop when: {success test} OR steps>={n} OR no_progress>={k} OR budget>={usd}
Reflection: {trigger, input signal, where lessons are stored}
Completion Criteria
- Success is a checkable predicate, not "model says done".
- Explicit caps and a no-progress detector.
- Actions validated before execution.
- Reflection uses an external signal (test result, error, evaluator), not introspection alone.
The Loop as a State Machine
flowchart TD
Start([Goal]) --> Ctx[Assemble context: goal, plan, recent observations]
Ctx --> Decide[Model proposes action or final answer]
Decide --> Check{Final answer?}
Check -- yes --> Verify{Success predicate holds?}
Verify -- yes --> Done([Return])
Verify -- no --> Reflect[Record failure reason] --> Ctx
Check -- no --> Validate{Schema + policy valid?}
Validate -- no --> Ctx
Validate -- yes --> Exec[Execute tool] --> Obs[Append observation, update state]
Obs --> Guard{Caps or no-progress hit?}
Guard -- yes --> Abort([Abort with partial result])
Guard -- no --> Ctx
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 17d ago Changed · +10 lines · -50 tokens per session 2c8e71d14926
- 1mo ago Changed · +140 lines · +111 tokens per session ba10f0733fee
- 3mo ago First seen · 42 lines · 26 tokens per session scan A 525d37b94e9b
ai-agent-core-loop is a skill published in the GitHub repository j4flmao/agent-skills (47 stars, last pushed 17d ago), licensed MIT. It adds 87 tokens to every session and 1,991 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
ai-agent-core-loop compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ai-agent-core-loopj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 87 | Claude Code, Codex |
| frontend-ui-dark-tsmicrosoft/skills | Skill | 3.3k | yesterday | MIT | A | 48 | Claude Code |
| nextjs-on-cloudflarecloudflare/skills | Skill | 3.6k | yesterday | Apache-2.0 | A | 96 | Claude Code |
| react-flow-node-tsmicrosoft/skills | Skill | 3.3k | yesterday | MIT | A | 43 | Claude Code |
| zustand-store-tsmicrosoft/skills | Skill | 3.3k | yesterday | MIT | A | 42 | Claude Code |
| implementing-command-palettesAgentWorkforce/relay | Skill | 1.2k | today | Apache-2.0 | A | 48 | Claude Code |
| formkitformkit/formkit | Skill | 4.8k | 10d ago | MIT | A | 28 | Codex |