사용 방법
- 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
- 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
- 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/iteam-company/claude-code-boilerplates --skill create-hook시작 전 확인
- 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
- 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.
Create Hook
Analyze a component or file and determine if any inline logic can be extracted into a reusable hook. Proposes the hook API and asks before implementing -- never writes code without confirmation.
When to use this skill
Invoke when:
- A component feels too large or mixes concerns (state + effects + layout)
- You spot a pattern repeated across more than one component
- Inline
useEffect+useStatelogic is complex enough to have a name - The user asks "can this be a hook?" or "should I extract this?"
Steps
- Read the target file(s).
- Identify extraction candidates -- inline logic blocks that:
- Combine state + side effects (timers, listeners, observers, storage)
- Access browser APIs (scroll, resize, matchMedia, localStorage, IntersectionObserver)
- Would have a clear, reusable name independent of the component's UI
- Check
hooks/for existing hooks before proposing a new one:
useDebounce<T>(value, delay)-- debounces any valueuseClickOutside<T extends HTMLElement>(callback)-- fires callback on outside click, returns refuseActiveSection(ids)-- tracks which section id is centered in the viewportuseAuth()-- reads JWT token, exposes user + helpersuseOrg()-- current org from OrgProvider context
If the existing hook already covers the case, suggest using it instead.
- For each candidate, propose:
- Hook name (
useprefix, describes what it returns) - Signature: inputs and return value
- Which component(s) would benefit
- Whether it is worth extracting (skip trivial single-
useStatewrappers)
- Ask the user: "Should I extract [hookName]?" before writing any code.
Only implement after confirmation.
- If confirmed, write the hook to
hooks/<hookName>.tsand refactor the component to use it.
Hook design rules (apply when implementing)
- Named export only, no default export
'use client';at the top- Generic when return type depends on input
- Clean up all effects (timers, listeners, observers)
- Wrap callback args in
useRefso callers don't needuseCallback - No comments unless the WHY is non-obvious
Usage
/create-hook <file or component path>
Examples: /create-hook components/blog/BlogSearch.tsx /create-hook components/layout/header.tsx /create-hook app/(layout)/blog/page.tsx


