From 8e62514eefeb6c07cb2f061806fb24a332f8f5b9 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 13 Dec 2025 01:34:48 +0900 Subject: [PATCH] docs: reorder features section and add background task documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reorder: Agents β†’ Tools β†’ Hooks β†’ Claude Code Compatibility - Add Background Task section under Tools with usage examples πŸ€– GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- README.ko.md | 111 +++++++++++++++++++++++++++++++-------------------- README.md | 109 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 133 insertions(+), 87 deletions(-) diff --git a/README.ko.md b/README.ko.md index 0f05003..b15c728 100644 --- a/README.ko.md +++ b/README.ko.md @@ -8,13 +8,14 @@ - [LLM Agentλ₯Ό μœ„ν•œ μ•ˆλ‚΄](#llm-agentλ₯Ό-μœ„ν•œ-μ•ˆλ‚΄) - [Why OpenCode & Why Oh My OpenCode](#why-opencode--why-oh-my-opencode) - [κΈ°λŠ₯](#κΈ°λŠ₯) - - [Hooks](#hooks) - [Agents](#agents) - [Tools](#tools) - [λ‚΄μž₯ LSP Tools](#λ‚΄μž₯-lsp-tools) - [λ‚΄μž₯ AST-Grep Tools](#λ‚΄μž₯-ast-grep-tools) - [Grep](#grep) - [λ‚΄μž₯ MCPs](#λ‚΄μž₯-mcps) + - [Background Task](#background-task) + - [Hooks](#hooks) - [Claude Code ν˜Έν™˜μ„±](#claude-code-ν˜Έν™˜μ„±) - [기타 편의 κΈ°λŠ₯](#기타-편의-κΈ°λŠ₯) - [μ„€μ •](#μ„€μ •) @@ -199,49 +200,6 @@ OpenCode λŠ” μ•„μ£Ό ν™•μž₯κ°€λŠ₯ν•˜κ³  μ•„μ£Ό μ»€μŠ€ν„°λ§ˆμ΄μ €λΈ”ν•©λ‹ˆλ‹€. ## κΈ°λŠ₯ -### Hooks - -- **Todo Continuation Enforcer**: μ—μ΄μ „νŠΈκ°€ λ©ˆμΆ”κΈ° μ „ λͺ¨λ“  TODO ν•­λͺ©μ„ μ™„λ£Œν•˜λ„λ‘ κ°•μ œν•©λ‹ˆλ‹€. LLM의 고질적인 "쀑도 포기" 문제λ₯Ό λ°©μ§€ν•©λ‹ˆλ‹€. -- **Context Window Monitor**: [μ»¨ν…μŠ€νŠΈ μœˆλ„μš° λΆˆμ•ˆ 관리](https://agentic-patterns.com/patterns/context-window-anxiety-management/) νŒ¨ν„΄μ„ κ΅¬ν˜„ν•©λ‹ˆλ‹€. - - μ‚¬μš©λŸ‰μ΄ 70%λ₯Ό λ„˜μœΌλ©΄ μ—μ΄μ „νŠΈμ—κ²Œ 아직 토큰이 μΆ©λΆ„ν•˜λ‹€κ³  μƒκΈ°μ‹œμΌœ, κΈ‰ν•˜κ²Œ λΆˆμ™„μ „ν•œ μž‘μ—…μ„ ν•˜λŠ” 것을 μ™„ν™”ν•©λ‹ˆλ‹€. -- **Session Notification**: μ—μ΄μ „νŠΈκ°€ μž‘μ—…μ„ 마치면 OS λ„€μ΄ν‹°λΈŒ μ•Œλ¦Όμ„ λ³΄λƒ…λ‹ˆλ‹€ (macOS, Linux, Windows). -- **Session Recovery**: API μ—λŸ¬λ‘œλΆ€ν„° μžλ™μœΌλ‘œ λ³΅κ΅¬ν•˜μ—¬ μ„Έμ…˜ μ•ˆμ •μ„±μ„ 보μž₯ν•©λ‹ˆλ‹€. λ„€ κ°€μ§€ μ‹œλ‚˜λ¦¬μ˜€λ₯Ό μ²˜λ¦¬ν•©λ‹ˆλ‹€: - - **Tool Result Missing**: `tool_use` 블둝이 μžˆμ§€λ§Œ `tool_result`κ°€ 없을 λ•Œ (ESC μΈν„°λŸ½νŠΈ) β†’ "cancelled" tool result μ£Όμž… - - **Thinking Block Order**: thinking 블둝이 첫 λ²ˆμ§Έμ—¬μ•Ό ν•˜λŠ”λ° 아닐 λ•Œ β†’ 빈 thinking 블둝 μΆ”κ°€ - - **Thinking Disabled Violation**: thinking 이 λΉ„ν™œμ„±ν™”μΈλ° thinking 블둝이 μžˆμ„ λ•Œ β†’ thinking 블둝 제거 - - **Empty Content Message**: λ©”μ‹œμ§€κ°€ thinking/meta λΈ”λ‘λ§Œ 있고 μ‹€μ œ λ‚΄μš©μ΄ 없을 λ•Œ β†’ νŒŒμΌμ‹œμŠ€ν…œμ„ 톡해 "(interrupted)" ν…μŠ€νŠΈ μ£Όμž… -- **Comment Checker**: μ½”λ“œ μˆ˜μ • ν›„ λΆˆν•„μš”ν•œ 주석을 κ°μ§€ν•˜μ—¬ λ³΄κ³ ν•©λ‹ˆλ‹€. BDD νŒ¨ν„΄, μ§€μ‹œμ–΄, λ…μŠ€νŠΈλ§ λ“± μœ νš¨ν•œ 주석은 λ˜‘λ˜‘ν•˜κ²Œ μ œμ™Έν•˜κ³ , AIκ°€ 남긴 흔적을 μ œκ±°ν•˜μ—¬ μ½”λ“œλ₯Ό κΉ¨λ—ν•˜κ²Œ μœ μ§€ν•©λ‹ˆλ‹€. -- **Directory AGENTS.md Injector**: νŒŒμΌμ„ 읽을 λ•Œ `AGENTS.md` λ‚΄μš©μ„ μžλ™μœΌλ‘œ μ£Όμž…ν•©λ‹ˆλ‹€. 파일 디렉토리뢀터 ν”„λ‘œμ νŠΈ λ£¨νŠΈκΉŒμ§€ νƒμƒ‰ν•˜λ©°, 경둜 μƒμ˜ **λͺ¨λ“ ** `AGENTS.md` νŒŒμΌμ„ μˆ˜μ§‘ν•©λ‹ˆλ‹€. μ€‘μ²©λœ 디렉토리별 지침을 μ§€μ›ν•©λ‹ˆλ‹€: - ``` - project/ - β”œβ”€β”€ AGENTS.md # ν”„λ‘œμ νŠΈ 전체 μ»¨ν…μŠ€νŠΈ - β”œβ”€β”€ src/ - β”‚ β”œβ”€β”€ AGENTS.md # src μ „μš© μ»¨ν…μŠ€νŠΈ - β”‚ └── components/ - β”‚ β”œβ”€β”€ AGENTS.md # μ»΄ν¬λ„ŒνŠΈ μ „μš© μ»¨ν…μŠ€νŠΈ - β”‚ └── Button.tsx # 이 νŒŒμΌμ„ 읽으면 μœ„ 3개 AGENTS.md λͺ¨λ‘ μ£Όμž… - ``` - `Button.tsx`λ₯Ό 읽으면 μˆœμ„œλŒ€λ‘œ μ£Όμž…λ©λ‹ˆλ‹€: `project/AGENTS.md` β†’ `src/AGENTS.md` β†’ `components/AGENTS.md`. 각 λ””λ ‰ν† λ¦¬μ˜ μ»¨ν…μŠ€νŠΈλŠ” μ„Έμ…˜λ‹Ή ν•œ 번만 μ£Όμž…λ©λ‹ˆλ‹€. Claude Code의 CLAUDE.md κΈ°λŠ₯μ—μ„œ μ˜κ°μ„ λ°›μ•˜μŠ΅λ‹ˆλ‹€. -- **Directory README.md Injector**: νŒŒμΌμ„ 읽을 λ•Œ `README.md` λ‚΄μš©μ„ μžλ™μœΌλ‘œ μ£Όμž…ν•©λ‹ˆλ‹€. AGENTS.md Injector와 λ™μΌν•˜κ²Œ λ™μž‘ν•˜λ©°, 파일 디렉토리뢀터 ν”„λ‘œμ νŠΈ λ£¨νŠΈκΉŒμ§€ νƒμƒ‰ν•©λ‹ˆλ‹€. LLM μ—μ΄μ „νŠΈμ—κ²Œ ν”„λ‘œμ νŠΈ λ¬Έμ„œ μ»¨ν…μŠ€νŠΈλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. 각 λ””λ ‰ν† λ¦¬μ˜ READMEλŠ” μ„Έμ…˜λ‹Ή ν•œ 번만 μ£Όμž…λ©λ‹ˆλ‹€. -- **Rules Injector**: νŒŒμΌμ„ 읽을 λ•Œ `.claude/rules/` λ””λ ‰ν† λ¦¬μ˜ κ·œμΉ™μ„ μžλ™μœΌλ‘œ μ£Όμž…ν•©λ‹ˆλ‹€. - - 파일 디렉토리뢀터 ν”„λ‘œμ νŠΈ λ£¨νŠΈκΉŒμ§€ 상ν–₯ νƒμƒ‰ν•˜λ©°, `~/.claude/rules/` (μ‚¬μš©μž) κ²½λ‘œλ„ ν¬ν•¨ν•©λ‹ˆλ‹€. - - `.md` 및 `.mdc` νŒŒμΌμ„ μ§€μ›ν•©λ‹ˆλ‹€. - - Frontmatter의 `globs` ν•„λ“œ(glob νŒ¨ν„΄)λ₯Ό 기반으둜 λ§€μΉ­ν•©λ‹ˆλ‹€. - - 항상 μ μš©λ˜μ–΄μ•Ό ν•˜λŠ” κ·œμΉ™μ„ μœ„ν•œ `alwaysApply: true` μ˜΅μ…˜μ„ μ§€μ›ν•©λ‹ˆλ‹€. - - κ·œμΉ™ 파일 ꡬ쑰 μ˜ˆμ‹œ: - ```markdown - --- - globs: ["*.ts", "src/**/*.js"] - description: "TypeScript/JavaScript coding rules" - --- - - Use PascalCase for interface names - - Use camelCase for function names - ``` -- **Think Mode**: ν™•μž₯된 사고(Extended Thinking)κ°€ ν•„μš”ν•œ 상황을 μžλ™μœΌλ‘œ κ°μ§€ν•˜κ³  λͺ¨λ“œλ₯Ό μ „ν™˜ν•©λ‹ˆλ‹€. μ‚¬μš©μžκ°€ κΉŠμ€ 사고λ₯Ό μš”μ²­ν•˜λŠ” ν‘œν˜„(예: "think deeply", "ultrathink")을 κ°μ§€ν•˜λ©΄, μΆ”λ‘  λŠ₯λ ₯을 κ·ΉλŒ€ν™”ν•˜λ„λ‘ λͺ¨λΈ 섀정을 λ™μ μœΌλ‘œ μ‘°μ •ν•©λ‹ˆλ‹€. -- **Anthropic Auto Compact**: Anthropic λͺ¨λΈ μ‚¬μš© μ‹œ μ»¨ν…μŠ€νŠΈ ν•œκ³„μ— λ„λ‹¬ν•˜λ©΄ λŒ€ν™” 기둝을 μžλ™μœΌλ‘œ μ••μΆ•ν•˜μ—¬ 효율적으둜 κ΄€λ¦¬ν•©λ‹ˆλ‹€. -- **Empty Task Response Detector**: μ„œλΈŒ μ—μ΄μ „νŠΈκ°€ μˆ˜ν–‰ν•œ μž‘μ—…μ΄ λΉ„μ–΄μžˆκ±°λ‚˜ λ¬΄μ˜λ―Έν•œ 응닡을 λ°˜ν™˜ν•˜λŠ” 경우λ₯Ό κ°μ§€ν•˜μ—¬, 였λ₯˜ 없이 μš°μ•„ν•˜κ²Œ μ²˜λ¦¬ν•©λ‹ˆλ‹€. -- **Grep Output Truncator**: Grep 검색 κ²°κ³Όκ°€ λ„ˆλ¬΄ κΈΈμ–΄ μ»¨ν…μŠ€νŠΈλ₯Ό μž₯μ•…ν•΄λ²„λ¦¬λŠ” 것을 λ°©μ§€ν•˜κΈ° μœ„ν•΄, κ³Όλ„ν•œ 좜λ ₯을 μžλ™μœΌλ‘œ μžλ¦…λ‹ˆλ‹€. - ### Agents - **oracle** (`openai/gpt-5.2`): μ•„ν‚€ν…μ²˜, μ½”λ“œ 리뷰, μ „λž΅ μˆ˜λ¦½μ„ μœ„ν•œ μ „λ¬Έκ°€ μ‘°μ–Έμž. GPT-5.2의 λ›°μ–΄λ‚œ 논리적 μΆ”λ‘ κ³Ό κΉŠμ€ 뢄석 λŠ₯λ ₯을 ν™œμš©ν•©λ‹ˆλ‹€. AmpCode μ—μ„œ μ˜κ°μ„ λ°›μ•˜μŠ΅λ‹ˆλ‹€. @@ -314,6 +272,71 @@ OpenCode λŠ” μ•„μ£Ό ν™•μž₯κ°€λŠ₯ν•˜κ³  μ•„μ£Ό μ»€μŠ€ν„°λ§ˆμ΄μ €λΈ”ν•©λ‹ˆλ‹€. } ``` +#### Background Task + +μž₯μ‹œκ°„ μ‹€ν–‰λ˜λŠ” μž‘μ—…μ΄λ‚˜ λ³΅μž‘ν•œ 뢄석을 메인 μ„Έμ…˜μ„ μ°¨λ‹¨ν•˜μ§€ μ•Šκ³  λ°±κ·ΈλΌμš΄λ“œμ—μ„œ μ‹€ν–‰ν•©λ‹ˆλ‹€. μž‘μ—…μ΄ μ™„λ£Œλ˜λ©΄ μ‹œμŠ€ν…œμ΄ μžλ™μœΌλ‘œ μ•Œλ¦Όμ„ λ³΄λƒ…λ‹ˆλ‹€. + +- **background_task**: λ°±κ·ΈλΌμš΄λ“œ μ—μ΄μ „νŠΈ μž‘μ—…μ„ μ‹œμž‘ν•©λ‹ˆλ‹€. μ„€λͺ…, ν”„λ‘¬ν”„νŠΈ, μ—μ΄μ „νŠΈ νƒ€μž…μ„ μ§€μ •ν•˜λ©΄ μ¦‰μ‹œ task IDλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€. +- **background_output**: μž‘μ—… μ§„ν–‰ 상황 확인(`block=false`) λ˜λŠ” κ²°κ³Ό λŒ€κΈ°(`block=true`). μ΅œλŒ€ 10λΆ„κΉŒμ§€ μ»€μŠ€ν…€ νƒ€μž„μ•„μ›ƒμ„ μ§€μ›ν•©λ‹ˆλ‹€. +- **background_cancel**: task ID둜 μ‹€ν–‰ 쀑인 λ°±κ·ΈλΌμš΄λ“œ μž‘μ—…μ„ μ·¨μ†Œν•©λ‹ˆλ‹€. + +μ£Όμš” κΈ°λŠ₯: +- **비동기 μ‹€ν–‰**: λ³΅μž‘ν•œ λΆ„μ„μ΄λ‚˜ 연ꡬ μž‘μ—…μ„ λ°±κ·ΈλΌμš΄λ“œμ—μ„œ μ²˜λ¦¬ν•˜λ©΄μ„œ λ‹€λ₯Έ μž‘μ—… 계속 κ°€λŠ₯ +- **μžλ™ μ•Œλ¦Ό**: λ°±κ·ΈλΌμš΄λ“œ μž‘μ—… μ™„λ£Œ μ‹œ 메인 μ„Έμ…˜μ— μžλ™ μ•Œλ¦Ό +- **μƒνƒœ 좔적**: 도ꡬ 호좜 횟수, λ§ˆμ§€λ§‰ μ‚¬μš© 도ꡬ λ“± μ‹€μ‹œκ°„ μ§„ν–‰ 상황 λͺ¨λ‹ˆν„°λ§ +- **μ„Έμ…˜ 격리**: 각 μž‘μ—…μ€ λ…λ¦½λœ μ„Έμ…˜μ—μ„œ μ‹€ν–‰ + +μ‚¬μš© μ˜ˆμ‹œ: +``` +1. μ‹œμž‘: background_task β†’ task_id="bg_abc123" λ°˜ν™˜ +2. λ‹€λ₯Έ μž‘μ—… 계속 μ§„ν–‰ +3. μ‹œμŠ€ν…œ μ•Œλ¦Ό: "Task bg_abc123 completed" +4. κ²°κ³Ό 쑰회: background_output(task_id="bg_abc123") β†’ 전체 κ²°κ³Ό νšλ“ +``` + +### Hooks + +- **Todo Continuation Enforcer**: μ—μ΄μ „νŠΈκ°€ λ©ˆμΆ”κΈ° μ „ λͺ¨λ“  TODO ν•­λͺ©μ„ μ™„λ£Œν•˜λ„λ‘ κ°•μ œν•©λ‹ˆλ‹€. LLM의 고질적인 "쀑도 포기" 문제λ₯Ό λ°©μ§€ν•©λ‹ˆλ‹€. +- **Context Window Monitor**: [μ»¨ν…μŠ€νŠΈ μœˆλ„μš° λΆˆμ•ˆ 관리](https://agentic-patterns.com/patterns/context-window-anxiety-management/) νŒ¨ν„΄μ„ κ΅¬ν˜„ν•©λ‹ˆλ‹€. + - μ‚¬μš©λŸ‰μ΄ 70%λ₯Ό λ„˜μœΌλ©΄ μ—μ΄μ „νŠΈμ—κ²Œ 아직 토큰이 μΆ©λΆ„ν•˜λ‹€κ³  μƒκΈ°μ‹œμΌœ, κΈ‰ν•˜κ²Œ λΆˆμ™„μ „ν•œ μž‘μ—…μ„ ν•˜λŠ” 것을 μ™„ν™”ν•©λ‹ˆλ‹€. +- **Session Notification**: μ—μ΄μ „νŠΈκ°€ μž‘μ—…μ„ 마치면 OS λ„€μ΄ν‹°λΈŒ μ•Œλ¦Όμ„ λ³΄λƒ…λ‹ˆλ‹€ (macOS, Linux, Windows). +- **Session Recovery**: API μ—λŸ¬λ‘œλΆ€ν„° μžλ™μœΌλ‘œ λ³΅κ΅¬ν•˜μ—¬ μ„Έμ…˜ μ•ˆμ •μ„±μ„ 보μž₯ν•©λ‹ˆλ‹€. λ„€ κ°€μ§€ μ‹œλ‚˜λ¦¬μ˜€λ₯Ό μ²˜λ¦¬ν•©λ‹ˆλ‹€: + - **Tool Result Missing**: `tool_use` 블둝이 μžˆμ§€λ§Œ `tool_result`κ°€ 없을 λ•Œ (ESC μΈν„°λŸ½νŠΈ) β†’ "cancelled" tool result μ£Όμž… + - **Thinking Block Order**: thinking 블둝이 첫 λ²ˆμ§Έμ—¬μ•Ό ν•˜λŠ”λ° 아닐 λ•Œ β†’ 빈 thinking 블둝 μΆ”κ°€ + - **Thinking Disabled Violation**: thinking 이 λΉ„ν™œμ„±ν™”μΈλ° thinking 블둝이 μžˆμ„ λ•Œ β†’ thinking 블둝 제거 + - **Empty Content Message**: λ©”μ‹œμ§€κ°€ thinking/meta λΈ”λ‘λ§Œ 있고 μ‹€μ œ λ‚΄μš©μ΄ 없을 λ•Œ β†’ νŒŒμΌμ‹œμŠ€ν…œμ„ 톡해 "(interrupted)" ν…μŠ€νŠΈ μ£Όμž… +- **Comment Checker**: μ½”λ“œ μˆ˜μ • ν›„ λΆˆν•„μš”ν•œ 주석을 κ°μ§€ν•˜μ—¬ λ³΄κ³ ν•©λ‹ˆλ‹€. BDD νŒ¨ν„΄, μ§€μ‹œμ–΄, λ…μŠ€νŠΈλ§ λ“± μœ νš¨ν•œ 주석은 λ˜‘λ˜‘ν•˜κ²Œ μ œμ™Έν•˜κ³ , AIκ°€ 남긴 흔적을 μ œκ±°ν•˜μ—¬ μ½”λ“œλ₯Ό κΉ¨λ—ν•˜κ²Œ μœ μ§€ν•©λ‹ˆλ‹€. +- **Directory AGENTS.md Injector**: νŒŒμΌμ„ 읽을 λ•Œ `AGENTS.md` λ‚΄μš©μ„ μžλ™μœΌλ‘œ μ£Όμž…ν•©λ‹ˆλ‹€. 파일 디렉토리뢀터 ν”„λ‘œμ νŠΈ λ£¨νŠΈκΉŒμ§€ νƒμƒ‰ν•˜λ©°, 경둜 μƒμ˜ **λͺ¨λ“ ** `AGENTS.md` νŒŒμΌμ„ μˆ˜μ§‘ν•©λ‹ˆλ‹€. μ€‘μ²©λœ 디렉토리별 지침을 μ§€μ›ν•©λ‹ˆλ‹€: + ``` + project/ + β”œβ”€β”€ AGENTS.md # ν”„λ‘œμ νŠΈ 전체 μ»¨ν…μŠ€νŠΈ + β”œβ”€β”€ src/ + β”‚ β”œβ”€β”€ AGENTS.md # src μ „μš© μ»¨ν…μŠ€νŠΈ + β”‚ └── components/ + β”‚ β”œβ”€β”€ AGENTS.md # μ»΄ν¬λ„ŒνŠΈ μ „μš© μ»¨ν…μŠ€νŠΈ + β”‚ └── Button.tsx # 이 νŒŒμΌμ„ 읽으면 μœ„ 3개 AGENTS.md λͺ¨λ‘ μ£Όμž… + ``` + `Button.tsx`λ₯Ό 읽으면 μˆœμ„œλŒ€λ‘œ μ£Όμž…λ©λ‹ˆλ‹€: `project/AGENTS.md` β†’ `src/AGENTS.md` β†’ `components/AGENTS.md`. 각 λ””λ ‰ν† λ¦¬μ˜ μ»¨ν…μŠ€νŠΈλŠ” μ„Έμ…˜λ‹Ή ν•œ 번만 μ£Όμž…λ©λ‹ˆλ‹€. Claude Code의 CLAUDE.md κΈ°λŠ₯μ—μ„œ μ˜κ°μ„ λ°›μ•˜μŠ΅λ‹ˆλ‹€. +- **Directory README.md Injector**: νŒŒμΌμ„ 읽을 λ•Œ `README.md` λ‚΄μš©μ„ μžλ™μœΌλ‘œ μ£Όμž…ν•©λ‹ˆλ‹€. AGENTS.md Injector와 λ™μΌν•˜κ²Œ λ™μž‘ν•˜λ©°, 파일 디렉토리뢀터 ν”„λ‘œμ νŠΈ λ£¨νŠΈκΉŒμ§€ νƒμƒ‰ν•©λ‹ˆλ‹€. LLM μ—μ΄μ „νŠΈμ—κ²Œ ν”„λ‘œμ νŠΈ λ¬Έμ„œ μ»¨ν…μŠ€νŠΈλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. 각 λ””λ ‰ν† λ¦¬μ˜ READMEλŠ” μ„Έμ…˜λ‹Ή ν•œ 번만 μ£Όμž…λ©λ‹ˆλ‹€. +- **Rules Injector**: νŒŒμΌμ„ 읽을 λ•Œ `.claude/rules/` λ””λ ‰ν† λ¦¬μ˜ κ·œμΉ™μ„ μžλ™μœΌλ‘œ μ£Όμž…ν•©λ‹ˆλ‹€. + - 파일 디렉토리뢀터 ν”„λ‘œμ νŠΈ λ£¨νŠΈκΉŒμ§€ 상ν–₯ νƒμƒ‰ν•˜λ©°, `~/.claude/rules/` (μ‚¬μš©μž) κ²½λ‘œλ„ ν¬ν•¨ν•©λ‹ˆλ‹€. + - `.md` 및 `.mdc` νŒŒμΌμ„ μ§€μ›ν•©λ‹ˆλ‹€. + - Frontmatter의 `globs` ν•„λ“œ(glob νŒ¨ν„΄)λ₯Ό 기반으둜 λ§€μΉ­ν•©λ‹ˆλ‹€. + - 항상 μ μš©λ˜μ–΄μ•Ό ν•˜λŠ” κ·œμΉ™μ„ μœ„ν•œ `alwaysApply: true` μ˜΅μ…˜μ„ μ§€μ›ν•©λ‹ˆλ‹€. + - κ·œμΉ™ 파일 ꡬ쑰 μ˜ˆμ‹œ: + ```markdown + --- + globs: ["*.ts", "src/**/*.js"] + description: "TypeScript/JavaScript coding rules" + --- + - Use PascalCase for interface names + - Use camelCase for function names + ``` +- **Think Mode**: ν™•μž₯된 사고(Extended Thinking)κ°€ ν•„μš”ν•œ 상황을 μžλ™μœΌλ‘œ κ°μ§€ν•˜κ³  λͺ¨λ“œλ₯Ό μ „ν™˜ν•©λ‹ˆλ‹€. μ‚¬μš©μžκ°€ κΉŠμ€ 사고λ₯Ό μš”μ²­ν•˜λŠ” ν‘œν˜„(예: "think deeply", "ultrathink")을 κ°μ§€ν•˜λ©΄, μΆ”λ‘  λŠ₯λ ₯을 κ·ΉλŒ€ν™”ν•˜λ„λ‘ λͺ¨λΈ 섀정을 λ™μ μœΌλ‘œ μ‘°μ •ν•©λ‹ˆλ‹€. +- **Anthropic Auto Compact**: Anthropic λͺ¨λΈ μ‚¬μš© μ‹œ μ»¨ν…μŠ€νŠΈ ν•œκ³„μ— λ„λ‹¬ν•˜λ©΄ λŒ€ν™” 기둝을 μžλ™μœΌλ‘œ μ••μΆ•ν•˜μ—¬ 효율적으둜 κ΄€λ¦¬ν•©λ‹ˆλ‹€. +- **Empty Task Response Detector**: μ„œλΈŒ μ—μ΄μ „νŠΈκ°€ μˆ˜ν–‰ν•œ μž‘μ—…μ΄ λΉ„μ–΄μžˆκ±°λ‚˜ λ¬΄μ˜λ―Έν•œ 응닡을 λ°˜ν™˜ν•˜λŠ” 경우λ₯Ό κ°μ§€ν•˜μ—¬, 였λ₯˜ 없이 μš°μ•„ν•˜κ²Œ μ²˜λ¦¬ν•©λ‹ˆλ‹€. +- **Grep Output Truncator**: Grep 검색 κ²°κ³Όκ°€ λ„ˆλ¬΄ κΈΈμ–΄ μ»¨ν…μŠ€νŠΈλ₯Ό μž₯μ•…ν•΄λ²„λ¦¬λŠ” 것을 λ°©μ§€ν•˜κΈ° μœ„ν•΄, κ³Όλ„ν•œ 좜λ ₯을 μžλ™μœΌλ‘œ μžλ¦…λ‹ˆλ‹€. + ### Claude Code ν˜Έν™˜μ„± Oh My OpenCodeλŠ” Claude Code μ„€μ •κ³Ό μ™„λ²½ν•˜κ²Œ ν˜Έν™˜λ©λ‹ˆλ‹€. Claude Codeλ₯Ό μ‚¬μš©ν•˜μ…¨λ‹€λ©΄, κΈ°μ‘΄ 섀정을 κ·ΈλŒ€λ‘œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. diff --git a/README.md b/README.md index 8320900..482db72 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,14 @@ English | [ν•œκ΅­μ–΄](README.ko.md) - [For LLM Agents](#for-llm-agents) - [Why OpenCode & Why Oh My OpenCode](#why-opencode--why-oh-my-opencode) - [Features](#features) - - [Hooks](#hooks) - [Agents](#agents) - [Tools](#tools) - [Built-in LSP Tools](#built-in-lsp-tools) - [Built-in AST-Grep Tools](#built-in-ast-grep-tools) - [Grep](#grep) - [Built-in MCPs](#built-in-mcps) + - [Background Task](#background-task) + - [Hooks](#hooks) - [Claude Code Compatibility](#claude-code-compatibility) - [Other Features](#other-features) - [Configuration](#configuration) @@ -197,48 +198,6 @@ I believe in the right tool for the job. For your wallet's sake, use CLIProxyAPI ## Features -### Hooks - -- **Todo Continuation Enforcer**: Forces the agent to complete all tasks before exiting. Eliminates the common LLM issue of "giving up halfway". -- **Context Window Monitor**: Implements [Context Window Anxiety Management](https://agentic-patterns.com/patterns/context-window-anxiety-management/). When context usage exceeds 70%, it reminds the agent that resources are sufficient, preventing rushed or low-quality output. -- **Session Notification**: Sends a native OS notification when the job is done (macOS, Linux, Windows). -- **Session Recovery**: Automatically recovers from API errors, ensuring session stability. Handles four scenarios: - - **Tool Result Missing**: When `tool_use` block exists without `tool_result` (ESC interrupt) β†’ injects "cancelled" tool results - - **Thinking Block Order**: When thinking block must be first but isn't β†’ prepends empty thinking block - - **Thinking Disabled Violation**: When thinking blocks exist but thinking is disabled β†’ strips thinking blocks - - **Empty Content Message**: When message has only thinking/meta blocks without actual content β†’ injects "(interrupted)" text via filesystem -- **Comment Checker**: Detects and reports unnecessary comments after code modifications. Smartly ignores valid patterns (BDD, directives, docstrings, shebangs) to keep the codebase clean from AI-generated artifacts. -- **Directory AGENTS.md Injector**: Automatically injects `AGENTS.md` contents when reading files. Searches upward from the file's directory to project root, collecting **all** `AGENTS.md` files along the path hierarchy. This enables nested, directory-specific instructions: - ``` - project/ - β”œβ”€β”€ AGENTS.md # Project-wide context - β”œβ”€β”€ src/ - β”‚ β”œβ”€β”€ AGENTS.md # src-specific context - β”‚ └── components/ - β”‚ β”œβ”€β”€ AGENTS.md # Component-specific context - β”‚ └── Button.tsx # Reading this injects ALL 3 AGENTS.md files - ``` - When reading `Button.tsx`, the hook injects contexts in order: `project/AGENTS.md` β†’ `src/AGENTS.md` β†’ `components/AGENTS.md`. Each directory's context is injected only once per session. Inspired by Claude Code's CLAUDE.md feature. -- **Directory README.md Injector**: Automatically injects `README.md` contents when reading files. Works identically to the AGENTS.md Injector, searching upward from the file's directory to project root. Provides project documentation context to the LLM agent. Each directory's README is injected only once per session. -- **Rules Injector**: Automatically injects rules from `.claude/rules/` directory when reading files. - - Searches upward from the file's directory to project root, plus `~/.claude/rules/` (user). - - Supports `.md` and `.mdc` files. - - Frontmatter-based matching with `globs` field (glob patterns). - - `alwaysApply: true` option for rules that should always apply. - - Example rule file structure: - ```markdown - --- - globs: ["*.ts", "src/**/*.js"] - description: "TypeScript/JavaScript coding rules" - --- - - Use PascalCase for interface names - - Use camelCase for function names - ``` -- **Think Mode**: Automatic extended thinking detection and mode switching. Detects when user requests deep thinking (e.g., "think deeply", "ultrathink") and dynamically adjusts model settings for enhanced reasoning. -- **Anthropic Auto Compact**: Automatically compacts conversation history when approaching context limits for Anthropic models. -- **Empty Task Response Detector**: Detects when subagent tasks return empty or meaningless responses and handles gracefully. -- **Grep Output Truncator**: Prevents grep output from overwhelming the context by truncating excessively long results. - ### Agents - **oracle** (`openai/gpt-5.2`): The architect. Expert in code reviews and strategy. Uses GPT-5.2 for its unmatched logic and reasoning capabilities. Inspired by AmpCode. - **librarian** (`anthropic/claude-haiku-4-5`): Multi-repo analysis, documentation lookup, and implementation examples. Haiku is chosen for its speed, competence, excellent tool usage, and cost-efficiency. Inspired by AmpCode. @@ -312,6 +271,70 @@ Don't need these? Disable them via `oh-my-opencode.json`: } ``` +#### Background Task + +Run long-running or complex tasks in the background without blocking your main session. The system automatically notifies you when tasks complete. + +- **background_task**: Launch a background agent task. Specify description, prompt, and agent type. Returns immediately with a task ID. +- **background_output**: Check task progress (`block=false`) or wait for results (`block=true`). Supports custom timeout up to 10 minutes. +- **background_cancel**: Cancel a running background task by task ID. + +Key capabilities: +- **Async Execution**: Offload complex analysis or research while you continue working +- **Auto Notification**: System notifies the main session when background tasks complete +- **Status Tracking**: Real-time progress with tool call counts and last tool used +- **Session Isolation**: Each task runs in an independent session + +Example workflow: +``` +1. Launch: background_task β†’ returns task_id="bg_abc123" +2. Continue working on other tasks +3. System notification: "Task bg_abc123 completed" +4. Retrieve: background_output(task_id="bg_abc123") β†’ get full results +``` + +### Hooks + +- **Todo Continuation Enforcer**: Forces the agent to complete all tasks before exiting. Eliminates the common LLM issue of "giving up halfway". +- **Context Window Monitor**: Implements [Context Window Anxiety Management](https://agentic-patterns.com/patterns/context-window-anxiety-management/). When context usage exceeds 70%, it reminds the agent that resources are sufficient, preventing rushed or low-quality output. +- **Session Notification**: Sends a native OS notification when the job is done (macOS, Linux, Windows). +- **Session Recovery**: Automatically recovers from API errors, ensuring session stability. Handles four scenarios: + - **Tool Result Missing**: When `tool_use` block exists without `tool_result` (ESC interrupt) β†’ injects "cancelled" tool results + - **Thinking Block Order**: When thinking block must be first but isn't β†’ prepends empty thinking block + - **Thinking Disabled Violation**: When thinking blocks exist but thinking is disabled β†’ strips thinking blocks + - **Empty Content Message**: When message has only thinking/meta blocks without actual content β†’ injects "(interrupted)" text via filesystem +- **Comment Checker**: Detects and reports unnecessary comments after code modifications. Smartly ignores valid patterns (BDD, directives, docstrings, shebangs) to keep the codebase clean from AI-generated artifacts. +- **Directory AGENTS.md Injector**: Automatically injects `AGENTS.md` contents when reading files. Searches upward from the file's directory to project root, collecting **all** `AGENTS.md` files along the path hierarchy. This enables nested, directory-specific instructions: + ``` + project/ + β”œβ”€β”€ AGENTS.md # Project-wide context + β”œβ”€β”€ src/ + β”‚ β”œβ”€β”€ AGENTS.md # src-specific context + β”‚ └── components/ + β”‚ β”œβ”€β”€ AGENTS.md # Component-specific context + β”‚ └── Button.tsx # Reading this injects ALL 3 AGENTS.md files + ``` + When reading `Button.tsx`, the hook injects contexts in order: `project/AGENTS.md` β†’ `src/AGENTS.md` β†’ `components/AGENTS.md`. Each directory's context is injected only once per session. Inspired by Claude Code's CLAUDE.md feature. +- **Directory README.md Injector**: Automatically injects `README.md` contents when reading files. Works identically to the AGENTS.md Injector, searching upward from the file's directory to project root. Provides project documentation context to the LLM agent. Each directory's README is injected only once per session. +- **Rules Injector**: Automatically injects rules from `.claude/rules/` directory when reading files. + - Searches upward from the file's directory to project root, plus `~/.claude/rules/` (user). + - Supports `.md` and `.mdc` files. + - Frontmatter-based matching with `globs` field (glob patterns). + - `alwaysApply: true` option for rules that should always apply. + - Example rule file structure: + ```markdown + --- + globs: ["*.ts", "src/**/*.js"] + description: "TypeScript/JavaScript coding rules" + --- + - Use PascalCase for interface names + - Use camelCase for function names + ``` +- **Think Mode**: Automatic extended thinking detection and mode switching. Detects when user requests deep thinking (e.g., "think deeply", "ultrathink") and dynamically adjusts model settings for enhanced reasoning. +- **Anthropic Auto Compact**: Automatically compacts conversation history when approaching context limits for Anthropic models. +- **Empty Task Response Detector**: Detects when subagent tasks return empty or meaningless responses and handles gracefully. +- **Grep Output Truncator**: Prevents grep output from overwhelming the context by truncating excessively long results. + ### Claude Code Compatibility Oh My OpenCode provides seamless Claude Code configuration compatibility. If you've been using Claude Code, your existing setup works out of the box.