# Loop Engineering

Shared loop-engineering reference for COG skills - the agent loop, deterministic...

- Repository: https://github.com/huytieu/COG-second-brain (1331 stars)
- Category: Design
- License: MIT
- Last updated: 2026-10-23
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add huytieu/COG-second-brain --skill loop-engineering -g -a claude-code -y`
Codex: `npx skills add huytieu/COG-second-brain --skill loop-engineering -g -a codex -y`
Cursor: `npx skills add huytieu/COG-second-brain --skill loop-engineering -g -a cursor -y`
Gemini CLI: `npx skills add huytieu/COG-second-brain --skill loop-engineering -g -a gemini-cli -y`

## Description

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).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

Read `.claude/skills/loop-engineering/SKILL.md` and execute it exactly as written, that file is the authoritative
playbook. Then follow `.agents/rules/cog.md`.

Antigravity substitution: where the playbook delegates to a `.claude/agents/<name>`
worker, invoke `.agents/agents/<name>.md` via `invoke_subagent` instead.

