Harness Engineering
10xChengTu/harness-engineering
Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.
Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns.
$ npx skills add huytieu/COG-second-brain --skill loop-engineering -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install huytieu/COG-second-brain loop-engineering --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/loop-engineering .claude/skills/loop-engineering && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "loop-engineering" agent skill from https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineering into .claude/skills/loop-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loop-engineering", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineeringType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add huytieu/COG-second-brain --skill loop-engineering -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install huytieu/COG-second-brain loop-engineering --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/loop-engineering .agents/skills/loop-engineering && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "loop-engineering" agent skill from https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineering into .agents/skills/loop-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loop-engineering", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add huytieu/COG-second-brain --skill loop-engineering -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install huytieu/COG-second-brain loop-engineering --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/loop-engineering .cursor/skills/loop-engineering && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "loop-engineering" agent skill from https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineering into .cursor/skills/loop-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loop-engineering", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/huytieu/COG-second-brain.git --path skills/loop-engineering--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add huytieu/COG-second-brain --skill loop-engineering -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install huytieu/COG-second-brain loop-engineering --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/loop-engineering .gemini/skills/loop-engineering && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "loop-engineering" agent skill from https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineering into .gemini/skills/loop-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loop-engineering", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install huytieu/COG-second-brain loop-engineeringInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add huytieu/COG-second-brain --skill loop-engineering -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/loop-engineering .github/skills/loop-engineering && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "loop-engineering" agent skill from https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineering into .github/skills/loop-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loop-engineering", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add huytieu/COG-second-brain --skill loop-engineering -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install huytieu/COG-second-brain loop-engineering --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/loop-engineering .opencode/skills/loop-engineering && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "loop-engineering" agent skill from https://github.com/huytieu/COG-second-brain/tree/main/skills/loop-engineering into .opencode/skills/loop-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loop-engineering", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
loop-engineeringShared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns.
Loop Engineering is an agent skill from huytieu/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).
Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Agent Workflows, covering Autonomous loops and Context engineering. The repository describes itself as: Self-evolving second brain with 35 AI skills, 10 agents, and people CRM. Closed-loop harness: a V-model verification lifecycle where the worker never grades its own homework… The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 36ac9d7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Loop Engineering loads about 1.5k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 747 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from huytieu/COG-second-brain at commit 36ac9d7, republished under its MIT licence (© huytieu). 747 words, ~1,511 tokens.
.claude/skills/loop-engineering/SKILL.md (or your agent's skills folder).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.
This 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.
A 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.
┌──────────────────────────────────────────────┐
│ 1. Gather pull context (vault + sources) │
│ 2. Act one step: search / fetch / scan │
│ 3. Observe read the real result │
│ 4. Verify run the deterministic check │
│ 5. Update write progress to a vault file │
│ 6. Decide continue? → loop │
│ stop? → finish + report │
└──────────────────────────────────────────────┘Step 4 is the load-bearing one. A loop without a verifier is just a chain that repeats.
A robust loop needs several exits so it always halts:
| Exit | What it is | Example |
|---|---|---|
| Deterministic verifier | A mechanical pass/fail that confirms the goal | "Publication date is within 7 days" |
| Hard iteration cap | Max passes, no matter what | "Stop after 5 searches per topic" |
| Budget guard | Max time / tool calls / tokens | "Stop after 20 fetches total" |
| No-progress detection | Recent passes changed nothing | "2 searches in a row found nothing new" |
| Human escalation | Hand a stuck loop back to the user | "Asked twice, still unclear: ask the user" |
Pick the verifier plus at least one safety exit (cap or budget) for every loop. No-progress detection is what stops the quiet infinite loops that a cap alone misses.
COG is verification-first: no hallucinations, sources required. Inside a loop that means:
Long loops fill the window with old tool output and start to drift ("context rot"). Counter it:
agent_mode: team, give each worker only the slice it needs and take back only its conclusion, so one subtask runs in a clean window. Never paste one worker's raw output into the next worker's prompt.| Pattern | Shape | Where COG uses it |
|---|---|---|
| Act-observe (ReAct) | reason → act → observe → repeat | base of every COG loop |
| Reflect-retry (Reflexion) | on failure, write the lesson, retry differently | url-dump / scout fetch retries, daily-brief re-search |
| Plan-execute-verify | plan steps, run them, verify each | knowledge-consolidation passes |
| Evaluator-optimizer | generate, score against criteria, repeat until it passes | daily-brief item verify, url-dump quality gate |
| Orchestrator-workers | split into subtasks, run in fresh windows, synthesize | team-mode scans, auto-research threads, team-brief |
| Loop-until-dry | keep going until K passes in a row surface nothing new | knowledge-consolidation theme extraction |
| Human-in-the-loop | escalate or ask when the loop is stuck or the call is the user's | weekly-checkin reflection, onboarding |
| Failure | Fix |
|---|---|
| Context overflow / drift | compact, prune, externalize to vault, isolate sub-agents |
| Silent infinite loop | no-progress detection plus a hard cap |
| Hallucinated success | trust the deterministic verifier, never self-report |
| Compounding errors | verify early and every pass, not only at the end |
| Cost blowup | budget guard, and stop at "good enough", not "perfect" |
| Goal drift | keep the goal and stop conditions written at the top of the loop's state |
A skill's ## Loop Engineering section should be short and concrete. It names:
It does not restate this skill. It points here.
© huytieu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/loop-engineering of huytieu/COG-second-brain.
Open the folder on GitHubat commit 36ac9d7
Loop Engineering next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Loop Engineering this skillhuytieu/COG-second-brain | 1.3k | — | ~1.5k | Automated safety check: Pass | MIT | |
| Harness Engineering10xChengTu/harness-engineering | 102 | 1 repos | ~1k | Automated safety check: Pass | None | |
| Harness Long-Running Task LoopChachamaru127/claude-code-harness | 3.2k | — | ~2.3k | Automated safety check: Notes | MIT | |
| Session Handoffdavila7/claude-code-templates | 32k | 2 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Harness Engineeringmagnus919/agent-skills | 111 | — | ~3.5k | Automated safety check: Pass | MIT | |
| Agents Best PracticesDenisSergeevitch/agents-best-practices | 2.4k | — | ~7.4k | Automated safety check: Pass | MIT |
10xChengTu/harness-engineering
Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.
Chachamaru127/claude-code-harness
Repeats a long task as a series of scheduled wake-ups, each re-entering with fresh context and calling harness-work for one task per cycle.
davila7/claude-code-templates
Creates comprehensive handoff documents for seamless AI agent session transfers.
magnus919/agent-skills
Design, build, diagnose, and evolve agent harnesses: instructions, tools, execution environments, durable state, context management, verification, recovery, and bounded autonomous loops.
DenisSergeevitch/agents-best-practices
A skill your agent uses when designing, generating an MVP blueprint for, auditing, troubleshooting, refactoring, or explaining an agentic harness for any domain.
mvschwarz/openrig
Re-grounds a long-running agent in the current product outcome by running a path-based trace to the root of its topology and work trees.
huytieu/COG-second-brain
Measure your own writing corpus for the words and sentence shapes you over-use, so an agent writing in your voice stops amplifying your tics into a style.
huytieu/COG-second-brain
A passive daily work journal that Claude keeps FOR you so you never have to write it yourself.
huytieu/COG-second-brain
Generate meaning-carrying editorial data-illustrations in the monotykamary / Linear aesthetic (near-black grayscale, Inter display + mono labels, hairline framed figures) with a single coral accent.
huytieu/COG-second-brain
Build frameworks from scattered insights across all braindumps and notes
huytieu/COG-second-brain
Turn a product release (the list of shipped items plus real screen recordings) into a motion recap video and one explained demo per feature, with sound effects tied to on-screen motion and a…
huytieu/COG-second-brain
Personalize COG for your workflow - creates profile, interests, and watchlist files with guided setup (run this first!)
Categories
Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns. Loop Engineering is an agent skill from huytieu/COG-second-brain. Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns.
Loop Engineering fits situations like: tasks that involve Autonomous loops; tasks that involve Context engineering.
Run `npx skills add huytieu/COG-second-brain --skill loop-engineering -a claude-code`. Or copy the skill folder (skills/loop-engineering in huytieu/COG-second-brain) into .claude/skills/loop-engineering in your project. Claude Code loads it when a task matches its description.
Run `npx skills add huytieu/COG-second-brain --skill loop-engineering -a codex`. Or copy the skill folder (skills/loop-engineering in huytieu/COG-second-brain) into .agents/skills/loop-engineering in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add huytieu/COG-second-brain --skill loop-engineering -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/loop-engineering, .gemini/skills/loop-engineering, .github/skills/loop-engineering and .opencode/skills/loop-engineering in your project.
SKILL.md names no scripts, command-line tools or credentials: Loop Engineering is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Loop Engineering is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Loop Engineering: Harness Engineering (10xChengTu/harness-engineering, 102 stars), Harness Long-Running Task Loop (Chachamaru127/claude-code-harness, 3.2k stars), Session Handoff (davila7/claude-code-templates, 32k stars) and Harness Engineering (magnus919/agent-skills, 111 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
huytieu (a GitHub user) maintains it in huytieu/COG-second-brain, which has 1,260 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on October 2, 2026.
Source: huytieu/COG-second-brain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.