Tooluck logoTooluck
SKILL.md

loop-engineering

Agent skill fromhuytieu/COG-second-brain

Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns. Invoke when designing or debugging a skill that iterates (search-verify-retry, scan-until-dry, fetch-retry-gate).

How to install loop-engineering

install loop-engineering
# install the COG-second-brain pack with the skills CLI
npx skills add huytieu/COG-second-brain

# or add only this skill to Claude Code: copy the folder

skills/loop-engineering/

# into

~/.claude/skills/loop-engineering/ (all projects)

.claude/skills/loop-engineering/ (one project)

skills/loop-engineering/SKILL.md

MITFull file
1# COG Loop Engineering
2
3> **TL;DR:** Some COG skills are not one-shot prompts. They are loops: act, observe, verify, decide whether to continue. This skill is the shared vocabulary those skills use. The iron rule: **trust deterministic checks, never the agent's own "looks done" self-report.** Every loop must declare its verifier, its stopping conditions, and which pattern it follows.
4
5This is a reference and design aid, not a content-generating workflow. Skills that loop (daily-brief, knowledge-consolidation, url-dump, weekly-checkin, and research/triage skills like auto-research and scout) link here instead of restating the rules. Invoke it directly when you are building or fixing an iterative skill.
6
7## Why loops
8
9A chain runs fixed steps: A then B then C. A loop is dynamic: the agent takes an action, reads real feedback (a fetched page, a date stamp, a file count), reasons about it, and repeats until a goal is met or a stop condition fires. Most knowledge-work that "keeps going until good enough" is a loop, and COG benefits from naming the loop explicitly rather than hoping a single prompt nails it.
10
11## The COG loop
12
13```
14 ┌──────────────────────────────────────────────┐
15 │ 1. Gather pull context (vault + sources) │
16 │ 2. Act one step: search / fetch / scan │
17 │ 3. Observe read the real result │
18 │ 4. Verify run the deterministic check │
19 │ 5. Update write progress to a vault file │
20…

Excerpt shown under the repository's MIT license.

More skills in COG-second-brain

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates