skills/self-optimize/SKILL.md
Self-optimization loop that analyzes system performance, identifies failure patterns, and improves skill prompts autonomously. Triggers on "자기 최적화", "self-optimize", "시스템 개선", "성능 분석", "optimize yourself", "improve yourself", "evolve", "자가 개선", "스스로 개선해" and similar requests. Also runs weekly via cron. Reads error/success logs from memory, identifies weak skills, rewrites prompts, commits changes, and tracks improvement over time. Includes automatic rollback if metrics worsen.
npx skillsauth add Kit4Some/Oh-my-ClaudeClaw self-optimizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Continuously improve the OpenClaw-CC system by analyzing its own performance, identifying failure patterns, and modifying skill prompts, hooks, and workflows to reduce errors and increase success rates. This is a closed-loop optimization cycle: measure → analyze → modify → verify → commit or rollback.
mcp-servers/ — MCP 서버 코드는 손대지 않음 (테스트 깨짐 위험).mcp.json — 서버 설정 변경 금지memory-store/_memory.db — DB 직접 조작 금지skills/*/SKILL.md — 스킬 프롬프트 개선scripts/hooks/*.mjs — 훅 로직 개선.claude/agents/*.md — 에이전트 프롬프트 개선CLAUDE.md — 시스템 지시문 미세 조정 (구조 변경 금지, 문구 개선만)memory_search(tag: "error", limit: 50) → 최근 에러 로그
memory_search(tag: "done", limit: 50) → 최근 성공 로그
memory_search(tag: "bug", limit: 20) → 버그 이력
memory_search_date(start_date: "{7d_ago}") → 이번 주 전체 활동
memory_stats → 전체 시스템 통계
각 실패를 분류:
| 실패 유형 | 원인 분석 | 개선 대상 | |----------|----------|----------| | Skill 실행 실패 | 프롬프트 불명확, 도구 매핑 오류 | SKILL.md | | 에이전트 위임 실패 | 컨텍스트 부족, 잘못된 에이전트 선택 | agent .md 또는 SKILL.md | | 메모리 검색 미스 | 태그/카테고리 불일치, 인덱스 부재 | hook 또는 memory-ops | | Hook 타임아웃 | 처리 시간 초과, 무거운 로직 | hook .mjs | | 잘못된 결과 | 프롬프트 모호성, 검증 부재 | SKILL.md |
결과를 구조화:
## Failure Report — Week of {date}
### Top Failure Patterns
1. **{skill_name}**: {failure_count}회 실패
- 공통 원인: {root_cause}
- 영향받은 워크플로우: {workflows}
- 제안 수정: {proposed_fix}
2. **{skill_name}**: ...
각 실패 패턴에 대해 구체적 가설 수립:
### Hypothesis #{n}
- **문제**: {skill}이 {situation}에서 {failure_mode}
- **원인**: 프롬프트의 {section}이 {reason}
- **수정안**: "{old_text}" → "{new_text}"
- **예상 효과**: {failure_type} {X}% 감소
- **검증 방법**: {how_to_measure}
우선순위: 실패 빈도 × 영향도 순으로 정렬. 상위 3개만 수정.
# 1. 롤백 포인트 생성
git checkout -b self-optimize/{date}
# 2. 현재 파일 백업을 메모리에 저장
memory_store(
category: "knowledge",
subcategory: "self-optimize",
title: "Backup: {file} before optimization {date}",
content: "{original_content}",
tags: ["self-optimize", "backup", "{cycle_id}"],
importance: 5
)
수정 적용:
For each hypothesis (max 3):
1. Read target file
2. Apply minimal, focused edit
3. Document change reason in commit message
# MCP 서버 테스트 (변경하지 않았지만 사이드이펙트 확인)
cd mcp-servers/memory-manager && npx vitest run
cd mcp-servers/knowledge-engine && npx vitest run
| 결과 | 액션 |
|------|------|
| 모든 테스트 통과 | Step 6으로 진행 |
| 1개라도 실패 | 즉시 git checkout . 롤백, 실패 원인 기록 |
git add {modified_files}
git commit -m "self-optimize: {summary}
Cycle: {cycle_id}
Changes:
- {file1}: {what_changed}
- {file2}: {what_changed}
Metrics before:
- Error rate: {before}%
- Top failure: {before_top}
Expected improvement: {prediction}
Constraint: Only skill/hook/agent prompts modified
Confidence: medium
Scope-risk: narrow
Not-tested: Long-term effectiveness (measured next cycle)"
메신저 알림:
messenger_send(platform: "telegram", message: "
🔧 **Self-Optimize Cycle #{n}**
📅 {date}
수정 사항:
{change_list}
예상 개선: {prediction}
브랜치: self-optimize/{date}
⚠️ 1주 후 자동 성과 비교 예정
확인 후 main 머지: `git merge self-optimize/{date}`
")
다음 주 사이클 시작 시 이전 사이클 성과 측정:
memory_search(tag: "error", date_range: "this_week") → 이번 주 에러
memory_search(tag: "self-optimize", limit: 1) → 지난 사이클 예측
Compare:
before_error_rate vs after_error_rate
before_top_failure vs after_top_failure
| 결과 | 액션 |
|------|------|
| 에러율 감소 | 성공 기록, main 머지 권고 |
| 변화 없음 | 수정 유지, 다른 접근 시도 |
| 에러율 증가 | 자동 롤백: git revert, 원인 분석 |
성과 기록:
memory_store(
category: "knowledge",
subcategory: "self-optimize",
title: "Optimization Result: Cycle #{n}",
tags: ["self-optimize", "metrics", "{cycle_id}"],
importance: 7,
content: "
## Cycle #{n} Results
- Error rate: {before}% → {after}%
- Changes: {file_list}
- Verdict: {SUCCESS|NEUTRAL|ROLLBACK}
- Lessons: {what_worked_or_didnt}
"
)
memory_link(source: result_id, target: previous_cycle_id, relation: "derived")
| 우선순위 | 대상 | 최적화 방법 | |---------|------|-----------| | 1 | Skill 프롬프트 | 실패 원인에 맞게 지시문 명확화, 예시 추가, 제약조건 강화 | | 2 | Agent 프롬프트 | 컨텍스트 로딩 개선, 도구 사용 가이드 강화 | | 3 | Hook 로직 | 타임아웃 최적화, 에러 핸들링 강화 | | 4 | CLAUDE.md 라우팅 | 에이전트-태스크 매핑 정확도 개선 |
모든 최적화 사이클의 결과는 영구 기록:
memory_store(category: "knowledge", subcategory: "self-optimize")
memory_link(relation: "derived") → 이전 사이클과 연결
memory_daily_log(type: "done", entry: "Self-optimize cycle #{n}: {verdict}")
시간이 지나면 memory_graph(depth: 4)로 최적화 이력 전체를 순회하여
어떤 변경이 효과적이었는지 메타 분석 가능.
| Code | Meaning | |------|---------| | OPTIMIZED | 수정 적용 + 테스트 통과 + 커밋 완료 | | NO_ACTION | 분석 결과 개선 필요 없음 (에러율 충분히 낮음) | | ROLLED_BACK | 이전 사이클 수정이 악화 → 롤백 완료 | | BLOCKED | 테스트 실패 → 수정 취소, 수동 검토 필요 |
development
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly. Run: node scripts/gen-skill-docs.mjs --> --- name: web-researcher description: > Web research with OMC team parallel execution. Triggers on "웹에서 찾아", "최신 정보", "리서치해", "동향", "web research", "find online", "latest info", "look up", "search the web", "trend analysis" and similar. v3: Spawns research-agent in parallel for multi-angle search. Deduplicates via memory_similar. Builds knowledge graph connections. For comprehensive
tools
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly. Run: node scripts/gen-skill-docs.mjs --> --- name: unfreeze description: > Remove edit scope restriction set by /freeze or /guard. Triggers on "unfreeze", "편집 제한 해제", "잠금 해제", "remove freeze", "unlock edits". allowed-tools: - Bash - Read --- # /unfreeze — Remove Edit Restrictions ## Preamble Before executing this skill: 1. **Load context from memory**: ``` memory_search(query: "{skill-relevant-query}", associative:
tools
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly. Run: node scripts/gen-skill-docs.mjs --> --- name: task-analyzer allowed-tools: - Bash - Read - Write - Edit - Glob - Grep - Agent - AskUserQuestion - WebSearch description: > Autonomously analyzes and executes tasks with a structured plan. Triggers on "분석해", "작업 계획", "이거 해줘", "자동으로 처리해", "계획 세워", "workflow 만들어", "analyze", "task plan", "do this", "handle automatically", "make a plan", "create a workflow",
development
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly. Run: node scripts/gen-skill-docs.mjs --> --- name: ship description: > Automated release workflow with comprehensive quality gates. Triggers on "배포", "릴리스", "ship it", "PR 만들어", "release", "deploy", "create PR", "push this", "ship". Non-interactive: user says /ship, next thing they see is the PR URL. Delegates commit organization to OMC git-master, review to code-reviewer, verification to verifier. Sends PR notification vi