훅 가드/리마인더 로직 단일화 (#46)#47
Merged
Merged
Conversation
Claude Code hooks(`.claude/hooks/*.py`)와 OpenCode plugins(`.opencode/plugins/*.js`)에 동일한 로직이 두 언어로 중복 구현되어 발생하던 드리프트를 제거. - `hooks/core/`에 단일 진실 소스 (block-dangerous, work-plan-enforcer, plan-completion-guard, plan-update-reminder, layer-doc-reminder) - Claude는 `hooks/adapters/claude/run.mjs` dispatcher가 stdin/exit code 변환 - OpenCode는 `.opencode/plugins/loop-hooks.js`가 인-프로세스 throw로 변환 - OpenCode 측에서도 plan-completion-guard 동작 (이전엔 누락) - 단위 테스트 122건 + OpenCode 어댑터 테스트 7건 통과 포매팅(`markdown_formatter`, `ktlint-format`)은 통합 범위 외로 그대로 유지. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.claude/hooks/*.py)와 OpenCode plugins(.opencode/plugins/*.js)에 두 언어로 중복 구현되어 있던 가드/리마인더 5종을 단일 TypeScript 코어(hooks/core/)로 통합hooks/adapters/claude/run.mjsdispatcher (stdin/exit code), OpenCode:.opencode/plugins/loop-hooks.js(인-프로세스 throw)plan-completion-guard도 자연스럽게 추가됨markdown_formatter,ktlint-format,markdown-formatter.js)은 통합 범위 외로 그대로 유지Changes
hooks/core/: 5개 코어 모듈 +lib/plan-scanner.ts,lib/path.ts공유 라이브러리hooks/adapters/claude/run.mjs: 단일 dispatcherhooks/__tests__/: 122개 단위 테스트.opencode/plugins/loop-hooks.js: 단일 통합 플러그인 + 7개 어댑터 테스트.opencode/lib/삭제CLAUDE.md에 Bun 1.x 런타임 의존성 명시Closes #46
Test plan
cd hooks && bun test— 122 pass / 0 failcd .opencode && bun test plugins/__tests__— 7 pass / 0 failrm -rf /차단,ls -la통과gh pr create/git push차단/허용 라이브 검증 (PR 작성 시점 본 케이스로 확인됨)🤖 Generated with Claude Code