Communitygithub.com

루프 설계 및 검토

목표 지향 에이전트 루프를 설계하고, 루프가 잘못 작동하는 방식(토큰 소진, Goodhart 게이밍, 잘못된 답변 완료)을 검토합니다. (1) 루프 작성 (2) 루프 검토의 두 가지 액션을 제공합니다.

루프 설계 및 검토란 무엇인가요?

이 스킬은 LLM 기반 에이전트가 반복 작업을 수행할 때 사용하는 피드백 루프를 올바르게 설계하고 검토하는 방법을 알려줍니다. LLM은 본질적으로 피드포워드 방식이므로, 목표 지향적으로 행동하게 하려면 외부 루프가 필수적입니다. 이 스킬은 크게 두 가지 액션으로 구성됩니다. 첫 번째 '루프 작성'은 루프를 실제로 구축해야 할지 결정하는 게이트(Step 0)부터 시작하여, 기계가 판단 가능한 목표를 정의하고(Step 1), 적절한 루프 유형(서보/레귤레이터)과 스켈레톤(문서 기반 디스패치 또는 계획/구축/판사)을 선택한 후(Step 2~3), 댐핑과 단계적 배포 전략을 적용합니다(Step 4~5). 두 번째 '루프 검토'는 기존 루프를 다섯 가지 실패 모드(목표 모호, 검증 주체 오염, 경계 조건 부재, 사전 명확화 부족, 메모리 부패)와 세 가지 레드 라인(인간의 판단 유지, 책임 전가 금지, 자가 개선 루프에 대한 엄격한 통제)에 따라 점검합니다. 이 스킬은 `autonomous-loops`, `continuous-agent-loop` 같은 메커니즘 계층 스킬을 보완하며, 목표 정의와 루프 이탈 방지에 집중합니다. Cursor, Claude Code, Codex 등 다양한 에이전트 플랫폼에서 활용 가능합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/loop-design-check

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

루프 설계 + 검토

전제. LLM은 피드포워드 시스템입니다. 프롬프트 입력 → 토큰 출력, 턴을 넘나들며 '목표를 향해 조종'하는 내장 기능은 없습니다. LLM이 목표 지향 시스템처럼 행동하게 하려면 주위에 피드백 루프를 감싸야 합니다. 이 스킬은 그 루프를 올바르게 작성하고, 검토하여 루프가 통제 불능이 되지 않도록 도와줍니다.

사용 시기 / 사용하지 말아야 할 때

이런 경우에 사용하세요:

  • 반복되는 작업을 에이전트에 맡기고 싶을 때 (작성→테스트, 테스트→수정, 수정→검증…).
  • 이미 루프가 있는데, 루프가 무한 반복되거나, 속임수를 쓰거나, 잘못된 답변을 끝까지 실행할까 걱정될 때.

이런 경우에는 사용하지 마세요:

  • 일회성 작업 → 그냥 직접 수행하고, 굳이 루프로 감쌀 필요 없습니다.
  • 단순 타이머/폴링 → /loop를 사용하면 되며, 별도 설계가 필요하지 않습니다.
  • 루프 아키텍처 배선 방법 (파이프라인 → DAG, 장기 실행 복구) → 이는 메커니즘 계층입니다. autonomous-loops / continuous-agent-loop를 참조하세요. 이 스킬은 '목표가 올바른지, 루프가 통제 불능이 될지'만 다루며, 메커니즘을 다시 설명하지 않습니다.

레드라인 전제: 두 수준의 피드백

수준소유자역할
실행 (하위)기계/에이전트'문자 그대로의 목표로부터 얼마나 떨어져 있는지' 측정하고 0으로 만듭니다. 기계가 강력한 영역입니다.
판단 (상위)인간'이 목표 자체가 올바른지, 변경해야 하는지, 중단해야 하는지' 결정합니다. 기계는 자신의 루프 밖으로 나가 목표에 의문을 제기할 수 없습니다.

온도 조절기는 '26°C에서 얼마나 떨어졌는지' 피드백할 수 있지만, 당신이 열이 나서 28°C를 원할 때 26°C가 올바른 목표인지 판단할 수 없습니다. 그저 26°C를 향해 갈 뿐입니다. '오늘은 몇 도로 설정할지'는 항상 인간의 결정입니다. 판단/최종 승인/마지막 스위치를 기계에 넘기는 것은 상위 피드백을 제거하는 것과 같습니다. 그러면 기계는 아무도 의문을 제기하지 않은 목표를 향해 빠르고 강하게 질주하여 잘못된 결과를 냅니다.


액션 1 — 루프 작성 (5단계)

0단계 · 먼저 차감: 과연 구축해야 할까? (4가지 조건 게이트, 하나라도 빗나가면 거부)

① 작업이 주 단위 이상으로 반복됨 ② 검증을 자동화할 수 있음 ③ 토큰 예산이 감당 가능함 ④ 에이전트가 실제로 실행하고 결과를 확인하는 도구를 가짐

하나라도 빗나가면 → 루프를 만들지 마세요; 직접 하거나 다른 방법을 사용하세요.

대부분의 사람을 막는 것은 '루프를 작성할 수 있느냐'가 아니라 '내 저장소에 루프가 필요하냐'입니다. 루프가 필요한 저장소는 조정 기준선(골든 샘플/업스트림 총계) + 테스트 + 린트 가드가 갖춰져 있습니다. 루프가 필요 없는 저장소는 루프로 인해 오류만 증폭될 뿐입니다.

1단계 · 기계가 판단 가능한 목표를 정의하라 (어려운 부분 — 루프의 성패가 여기서 결정)

루프 전체는 비교기의 '아직 끝났나요?' 판단에 달려 있습니다. 비교기는 종료 조건을 기계가 예/아니오로 판단할 수 있을 때만 작동합니다.

  • 나쁨: 모호함 ('좋게 만들어', '더 날카롭게 작성해') → 비교기가 판단 불가 → 끝나지 않거나 (갇혀서 재시도) 추측함 (무작위로 통과/차단).
  • 좋음: 판단 가능 ('96개 단위 테스트 모두 통과 AND 변경 목록 생성됨', '모듈-02 필드 채워짐, pytest 통과, 비즈니스 로직 변경 없음') → 한 번 확인으로 해결됨; 루프가 깔끔하게 수렴함.

5가지 목표 프레임워크:

  1. 완료 기준이 기계 검증 가능해야 함.
  2. 완료 기준과 함께 경계 조건이 정의되어야 함 (

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

관련 스킬