Communitygithub.com

자기 개선 오케스트레이터

토너먼트 선택을 통한 자율적 진화적 코드 개선 엔진

자기 개선 오케스트레이터란 무엇인가요?

이 스킬은 AI 에이전트가 토너먼트 선택 방식을 통해 자율적으로 코드베이스를 반복적으로 개선할 수 있도록 설계된 진화적 코드 개선 엔진입니다. 사용자가 목표와 벤치마크를 설정하면, 시스템은 설정 단계를 거쳐 개선 루프에 진입하며, 연구(research), 계획(planning), 검토(review), 실행(execution), 토너먼트 선택(tournament selection) 단계를 완전히 자동으로 수행합니다. Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 작동하며, 에이전트 실패나 계획 거부 시에도 자동으로 복구하여 계속 진행합니다. 이 스킬은 '게이트 체크' 통과 후 사용자 중단 없이 완전 자율 실행되며, stop 조건(예: 최대 반복 횟수, 성능 정체 등)이 충족될 때까지 루프를 지속합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Yeachan-Heo/oh-my-claudecode/tree/main/skills/self-improve

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

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

문서

자기 개선 오케스트레이터은(는) 무엇을 하나요?

당신은 자기 개선 시스템의 루프 컨트롤러입니다. 설정, 연구, 계획, 실행, 토너먼트 선택, 이력 기록, 시각화, 그리고 중지 조건 평가 등 전체 생애주기를 관리합니다. 전문화된 OMC 에이전트에게 작업을 위임하고, 그들의 입력과 출력을 조정합니다.


자율 실행 정책

개선 루프 중에는 절대 사용자에게 멈추거나 일시 중지하도록 요청하지 마십시오. 게이트 체크가 통과되고 루프가 시작되면 중지 조건이 충족될 때까지 완전히 자율적으로 실행합니다.

  • 반복 사이 또는 반복 내 단계 사이에 확인을 요청하지 마십시오.
  • 요약하고 기다리지 말고 즉시 다음 단계를 실행하십시오.
  • 에이전트 실패 시: 한 번 재시도한 후 해당 에이전트를 건너뛰고 나머지 에이전트로 계속합니다. 실패를 반복 이력에 기록합니다.
  • 모든 계획이 거부된 경우: 기록하고 다음 반복으로 자동 진행합니다.
  • 모든 실행기가 실패한 경우: 기록하고 다음 반복으로 자동 진행합니다.
  • 벤치마크 오류 시: 오류를 기록하고 해당 실행기를 실패로 표시한 후 다른 실행기로 계속합니다.
  • 루프를 중지하는 유일한 것은 11단계의 중지 조건입니다.
  • 신뢰 경계: 루프는 대상 저장소 내에서 벤치마크 명령을 있는 그대로 실행합니다. 사용자는 설정 중에 저장소 경로와 벤치마크 명령을 명시적으로 확인합니다. 루프는 패키지를 설치하거나, 시스템 구성을 수정하거나, 벤치마크 명령이 수행하는 것 이상으로 네트워크 리소스에 접근하지 않습니다.
  • 봉인된 파일: validate.sh는 루프가 벤치마크 코드를 수정할 수 없도록 강제하여 평가의 자기 수정을 방지합니다.

상태 추적

자기 개선 아티팩트는 scripts/resolve-paths.mjs에서 반환된 확인된 루트 아래에 있습니다.

  • 새 실행은 기본적으로 .omc/self-improve/topics/default/로 설정됩니다.
  • 사용자가 주제(topic) 또는 슬러그(slug)를 제공한 경우 .omc/self-improve/topics/{topic_slug}/를 사용합니다.
  • 레거시 단일 트랙 상태 .omc/self-improve/는 명시적인 주제/슬러그가 제공되지 않고 해당 평면 레이아웃이 이미 존재하는 경우에만 호환성 폴백으로 유효합니다.

아래에서 <self-improve-root>/는 확인된 루트를 나타냅니다.

<self-improve-root>/
├── config/                    # 사용자 설정
│   ├── settings.json          # 에이전트, 벤치마크, 임계값, 봉인된 파일
│   ├── goal.md                # 개선 목표 + 대상 메트릭
│   ├── harness.md             # 가드레일 규칙 (H001/H002/H003)
│   └── idea.md                # 사용자 실험 아이디어
├── state/                     # 런타임 상태
│   ├── agent-settings.json    # 반복 횟수, 최고 점수, 상태, 카운터
│   ├── iteration_state.json   # 반복 내 진행 상황 (재개 가능성)
│   ├── research_briefs/       # 라운드별 연구 출력
│   ├── iteration_history/     # 라운드별 전체 이력
│   ├── merge_reports/         # 토너먼트 결과
│   └── plan_archive/          # 보관된 계획 (영구)
├── plans/                     # 활성 계획 (현재 라운드)
└── tracking/                  # 시각화 데이터
    ├── raw_data.json          # 모든 후보 점수
    ├── baseline.json          # 초기 벤치마크 점수
    ├── events.json            # 설정 변경 사항
    └── progress.png           # 생성된 차트

OMC 모드 생애주기: .omc/state/sessions/{sessionId}/self-improve-state.json


에이전트 매핑

모든 증강은 생성 시 Task 설명 컨텍스트를 통해 전달됩니다. 기존 에이전트 .md 파일은 수정하지 않습니다.

단계역할OMC 에이전트모델
연구코드베이스 분석 + 가설 생성general-purpose Agentopus
계획가설 → 구조화된 계획oh-my-claudecode:planneropus
아키텍처 검토6점 계획 검토oh-my-claudecode:architectopus
비평 검토가드레일 규칙 적용oh-my-claudecode:criticopus
실행계획 구현 + 벤치마크 실행oh-my-claudecode:executoropus
Git 작업원자적 병합/태그/PRoh-my-claudecode:git-mastersonnet
목표 설정대화형 인터뷰(이 스킬에서 직접)N/A
벤치마크 설정벤치마크 생성 + 검증custom agentopus

연구 프롬프트: 이 스킬 디렉토리에서 si-researcher.md를 읽고 그 내용을 에이전트 프롬프트로 전달합니다.

벤치마크 빌더: 이 스킬 디렉토리에서 si-benchmark-builder.md를 읽고 그 내용을 에이전트 프롬프트로 전달합니다.

목표 명확화: 이 스킬 디렉토리에서 si-goal-clarifier.md를 읽고 인터뷰를 직접 실행합니다 (대화형, 사용자 필요).


입력

시작 시와 각 반복 시작 시 다음 파일을 읽습니다.

파일목적
<self-improve-root>/config/settings.json사용자 설정: number_of_agents, benchmark_command, benchmark_format, benchmark_direction, max_iterations, plateau_threshold, plateau_window, target_value, primary_metric, sealed_files, regression_threshold, circuit_breaker_threshold, target_branch, current_repo_url, fork_url, upstream_url, topic_slug
<self-improve-root>/state/agent-settings.json런타임: iterations, best_score, plateau_consecutive_count, circuit_breaker_count, status, goal_slug (파생: 목표 목적에서 소문자 밑줄, 세션 간 일관성을 위해 유지)
<self-improve-root>/state/iteration_state.json재개 가능성을 위한 반복별 진행 상황
<self-improve-root>/config/goal.md개선 목표, 대상 메트릭, 범위
<self-improve-root>/config/harness.md가드레일 규칙 (H001, H002, H003)

설정 단계

  1. 대상 저장소 경로가 존재하는지 확인합니다. 설정되지 않은 경우, 사용자에게 개선할 저장소 경로를 요청합니다.
  2. node {skill_dir}/scripts/resolve-paths.mjs --project-root {repo_path} [--topic "..."] [--slug "..."] --ensure-dirs를 실행하여 <self-improve-root>를 확인합니다.
  3. 이 스킬 디렉토리의 templates/에서 확인된 config/ 루트로 복사하여 <self-improve-root>/ 디렉토리 구조를 생성합니다.
  4. <self-improve-root>/state/agent-settings.json을 읽습니다. si_setting_goal, si_setting_benchmark, si_setting_harness를 확인합니다.
  5. 신뢰 확인 (필수, 건너뛸 수 없음): a. trust_confirmed가 agent-settings.json에서 이미 true인 경우 5단계(재개 경로)로 건너<0xE1><0x84><0xB0>니다. b. 대상 저장소 경로를 표시하고 사용자에게 확인을 요청합니다. "자기 개선이 {repo_path} 내부에서 벤치마크 명령을 실행합니다. 이는 해당 저장소에서 임의 코드를 실행하는 것을 의미합니다. 확인하시겠습니까? [yes/no]" c. 사용자가 거부하는 경우: 설정을 중단하고 종료합니다. 진행하지 마십시오. d. 동의를 기록합니다: agent-settings.json에서 trust_confirmed: true를 설정합니다.
  6. 확인된 루트가 주제 범위인 경우 config/settings.json에 topic_slug를 저장하여 향후 재개가 동일한 트랙에 유지되도록 합니다.
  7. 목표가 설정되지 않은 경우 → 이 스킬 디렉토리에서 si-goal-clarifier.md를 읽고 이 컨텍스트에서 직접 4차원 소크라테스 인터뷰(목적, 메트릭, 목표값, 범위)를 실행합니다. 결과를 <self-improve-root>/config/goal.md에 씁니다.
  8. 벤치마크가 설정되지 않은 경우 → 이 스킬 디렉토리에서 si-benchmark-builder.md를 읽고, 해당 내용을 프롬프트로 사용하여 사용자 정의 에이전트(model=opus)를 생성합니다. 에이전트는 저장소를 조사하고, 벤치마크를 생성하거나 래핑하고, 3번 검증하고, 기준선을 기록합니다. 벤치마크가 설정된 후 사용자에게 벤치마크 명령을 확인합니다. "벤치마크 명령: {benchmark_command}. 이 명령은 루프 중에 반복적으로 실행됩니다. 확인하시겠습니까? [yes/no]" 사용자가 거부하는 경우: 설정을 중단하고 종료합니다.
  9. 가드레일이 설정되지 않은 경우 → 기본 가드레일 규칙(H001/H002/H003)을 사용자와 확인하거나 사용자 정의합니다.
  10. 게이트: si_setting_goal, si_setting_benchmark, si_setting_harness, trust_confirmed가 모두 true여야 합니다.
  11. 개선 브랜치 생성 (존재하지 않는 경우):
    git -C {repo_path} checkout -b improve/{goal_slug} {target_branch}
    git -C {repo_path} checkout {target_branch}
    
    여기서 {goal_slug}는 목표 목적에서 파생됩니다(소문자, 밑줄). 브랜치가 이미 존재하는 경우 생성을 건너<0xE1><0x84><0xB0>니다. agent-settings.json에 goal_slug를 저장합니다.
  12. 모드 배타성: state_list_active를 호출합니다. autopilot 또는 ralph가 활성 상태인 경우 시작을 거부합니다.
  13. 초기 상태를 씁니다: state_write(mode='self-improve', active=true, iteration=0, started_at=<now>)

Git 전략

모든 Git 작업은 OMC 프로젝트 루트가 아닌 대상 저장소 내부에서 수행됩니다.

  • 개선 브랜치: improve/{goal_slug} — 승리한 변경 사항만 누적됩니다.
  • 실험 브랜치: experiment/round_{n}_executor_{id} — 단기, 실행기별.
  • 보관 태그: archive/round_{n}_executor_{id} — 패배한 브랜치는 삭제 전에 태깅됩니다.
  • 워크트리 설정 (SKILL.md가 각 실행기 전에 생성):
    git -C {repo_path} worktree add worktrees/round_{n}_executor_{id} -b experiment/round_{n}_executor_{id} improve/{goal_slug}
    
  • 승자 병합은 oh-my-claudecode:git-master를 통해 수행:
    Merge experiment/round_{n}_executor_{winner_id} into improve/{goal_slug} with --no-ff
    Message: "Iteration {n}: {hypothesis} (score: {before} → {after})"
    
  • 병합 후 푸시: git -C {repo_path} push origin improve/{goal_slug} (백업, 비차단)
  • 패자 보관: git-master를 통해 태깅 후 삭제.

개선 루프

게이트: 모든 설정이 true여야 합니다. 게이트가 통과되면 중단 없이 연속적으로 실행합니다.

state_write(mode='self-improve', active=true, status="running")을 업데이트합니다.

0단계 — 오래된 워크트리 정리 (필수, 모든 반복마다 실행)

전제 조건: 이 단계는 재개 로직을 포함한 다른 단계보다 먼저 완료되어야 합니다. 멱등적이며 여러 번 실행해도 안전합니다.

  1. 대상 저장소의 모든 워크트리를 나열합니다: git -C {repo_path} worktree list
  2. worktrees/round_*와 일치하고 현재 반복에 속하지 않는 워크트리를 제거합니다: git -C {repo_path} worktree remove {path} --force
  3. git -C {repo_path} worktree prune을 실행하여 오래된 참조를 정리합니다.
  4. 이는 충돌 복구를 처리합니다 — 중단된 반복에서 남은 고아 워크트리는 새 반복이 시작되기 전에 정리됩니다.

1단계 — 상태 새로고침

state_write(mode='self-improve', active=true, iteration=N)을 실행하여 30분 TTL을 재설정합니다.

2단계 — 중지 요청 확인

state_read(mode='self-improve')를 통해 상태를 읽습니다.

상태가 지워졌거나(cancel이 호출됨) 상태가 user_stopped인 경우: a. <self-improve-root>/state/agent-settings.json에서 status: "user_stopped"를 설정합니다. b. iteration_state.json을 업데이트합니다: status: "interrupted"를 설정하고 current_step을 기록합니다. c. 현재 라운드의 활성 워크트리를 정리합니다(0단계 로직). d. 기록합니다: "사용자가 반복 {N}, 단계 {current_step}에서 자기 개선을 중지했습니다." e. 정상적으로 종료합니다 — /cancel을 다시 호출하지 마십시오(이미 취소됨).

3단계 — 사용자 아이디어 확인

<self-improve-root>/config/idea.md를 읽습니다. 비어 있지 않은 경우, 계획가를 위해 내용을 스냅샷합니다. 계획가가 소비한 후 비웁니다.

4단계 — 연구

si-researcher.md의 내용을 프롬프트로 사용하여 1개의 general-purpose Agent(model=opus)를 생성합니다.

프롬프트에 전달:

  • 현재 반복 번호
  • 대상 저장소 경로
  • <self-improve-root>/config/goal.md 경로
  • <self-improve-root>/state/iteration_history/ 경로 (모든 이전 기록)
  • <self-improve-root>/state/research_briefs/ 경로 (이전 브리프)
  • data_contracts.md 섹션 3 (연구 브리프 스키마) 내용

예상 출력: 연구 브리프 JSON → <self-improve-root>/state/research_briefs/round_{n}.json

연구자가 실패한 경우, 이력만으로 진행합니다.

5단계 — 계획

병렬로 N개의 oh-my-claudecode:planner(model=opus) 에이전트를 생성합니다 (N = 설정의 number_of_agents).

각 계획가의 프롬프트에 전달:

  • 계획가 ID (planner_a, planner_b, planner_c...)
  • 연구 브리프 경로
  • 반복 이력 경로
  • <self-improve-root>/config/harness.md의 가드레일 규칙
  • 계획 문서에 대한 데이터 계약 스키마
  • 재정의 지침: JSON 출력(마크다운 아님), 인터뷰 모드 건너<0xE1><0x84><0xB0>기, 계획당 정확히 하나의 테스트 가능한 가설 생성, approach_family 태그 및 history_reference 포함.
  • 사용자 아이디어 (있는 경우, planner_a가 우선권)

예상 출력: 계획 문서 JSON → <self-improve-root>/plans/round_{n}/plan_planner_{id}.json

6단계 — 검토

각 계획에 대해 순차적으로 (아키텍트가 비평가보다 먼저):

6a. 아키텍처 검토: 계획 + 6점 체크리스트와 함께 oh-my-claudecode:architect를 생성합니다.

  1. 테스트 가능성 — 가설이 테스트 가능한가?
  2. 참신성 — 이전 시도와 다른가?
  3. 범위 — 적절한 크기인가?
  4. 대상 파일 — 존재하고 봉인되지 않았는가?
  5. 구현 명확성 — 실행기가 추측 없이 구현할 수 있는가?
  6. 예상 결과 — 증거에 비추어 현실적인가?

아키텍트 판결은 조언만 제공합니다.

6b. 비평 검토: 계획 + 가드레일 규칙과 함께 oh-my-claudecode:critic을 생성합니다.

  • H001: 정확히 하나의 가설 (0개 또는 여러 개인 경우 거부)
  • H002: approach_family 반복 횟수가 3 미만
  • H003: 라운드 내 다양성 (같은 라운드에서 같은 family의 두 계획 없음)
  • data_contracts.md에 대한 스키마 검증
  • 이력 인식 확인

비평가는 critic_approved: true 또는 false를 설정합니다. false인 계획은 실행에서 제외됩니다.

모든 계획이 거부된 경우 기록하고 9단계로 건너<0xE1><0x84><0xB0>니다.

7단계 — 실행

승인된 각 계획에 대해 병렬로 oh-my-claudecode:executor(model=opus)를 생성합니다.

생성 전에 워크트리를 만듭니다:

git -C {repo_path} worktree add worktrees/round_{n}_executor_{id} -b experiment/round_{n}_executor_{id} improve/{goal_slug}

각 실행기의 프롬프트에 전달:

  • 승인된 계획 JSON
  • 워크트리 디렉토리 경로
  • 설정의 벤치마크 명령
  • 설정의 봉인된 파일 목록
  • 이 스킬 디렉토리의 scripts/validate.sh 경로
  • 벤치마크 결과에 대한 데이터 계약 스키마
  • 재정의 지침: 계획을 충실히 구현하고, 벤치마킹 전에 validate.sh를 실행하고, 벤치마크 명령을 실행하고, 출력으로 벤치마크 결과 JSON을 생성합니다.

예상 출력: 벤치마크 결과 JSON (실행기가 작성하거나 출력으로 반환).

8단계 — 토너먼트 선택

SKILL.md가 직접 수행합니다 (위임되지 않음):

  1. 모든 실행기 결과를 수집

Individual skills in this repo

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

agent-doc-discipline

Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and carrying a why, steps before reference, one meaning in one home, no restating what the environment already says. Mandatory at drydock seed generation and the launch C5 sediment pass; opt-in for any other agent-facing doc edit. The companion of minimal-code-discipline: that one disciplines code, this one disciplines papers.

ai-slop-cleaner

Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode

ask

Process-first advisor routing for Claude, Codex, Gemini, Antigravity, Grok, or Cursor via `omc ask`, with artifact capture and no raw CLI assembly

ask-navigator

Shipyard

autopilot

Full autonomous execution from idea to working code

autoresearch

Stateful single-mission improvement loop with strict evaluator contract, markdown decision logs, and max-runtime stop behavior

cancel

Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state

configure-notifications

Configure notification integrations (Telegram, Discord, Slack) via natural language

debug

Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction

deepinit

Deep codebase initialization with hierarchical AGENTS.md documentation

deep-interview

Socratic deep interview with mathematical ambiguity gating before explicit execution approval

drydock

Lay the keel of the shipyard harness in any repo — the 4-pillar shared environment (Context, Rules, Tools, Standards) across 5 surfaces (CLAUDE.md, skills, design-system, mcp/cli, shared context) so that every human and agent inherits the same design language and anyone can ship. Run once per repo; re-run with --check to audit drift.

execute

Carry an approved task through to working, verified code

external-context

Invoke parallel document-specialist agents for external web searches and documentation lookup

graph

Deterministic orchestration graph runtime - declarative DAG pipelines with journal-based crash recovery

harbor

Harbor intake for external work — the captain only handles unresolved decisions. Sweeps incoming issues and PRs, verifies every claim before disposition, reuses every decision already made, and hands the maintainer a docket whose pending items each carry one question with options, recommendation, impact and evidence. Agent-autonomous for facts and for actions covered by standing authorization; signed for every new judgment. Never merges.

hud

Configure HUD display options (layout, presets, display elements)

launch

Shipyard

loft

Loft the shape before cutting steel — answer a design question that prose cannot settle by building a throwaway artifact: a pure logic module in a clickable shell, or structurally different UI variants behind one route. The captain reacts to the artifact; the answer folds into the decision; the artifact never docks. Use when a design question stalls in words, when a navigator map carries a loft ticket, or when a spec discussion reaches

minimal-code-discipline

YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away

관련 스킬