Skip to content

fix(hook): relocate detect.js to skill resource for team compatibility#5

Merged
Soju06 merged 2 commits intomainfrom
feat/relocate-hook-to-skill-resource
Feb 27, 2026
Merged

fix(hook): relocate detect.js to skill resource for team compatibility#5
Soju06 merged 2 commits intomainfrom
feat/relocate-hook-to-skill-resource

Conversation

@Soju06
Copy link
Owner

@Soju06 Soju06 commented Feb 27, 2026

Summary

  • Hook script(detect.js)을 npm 패키지 임시 경로에서 스킬 설치 디렉토리(.agents/skills/knowpatch/bin/)로 이동
  • scope에 따른 훅 커맨드: project scope는 상대경로(팀 공유 가능), user scope는 절대경로
  • 업데이트 시 구형 훅 자동 감지 및 마이그레이션

Changes

File Change
.gitignore skills/knowpatch/bin/ 빌드 아티팩트 제외
package.json detect.ts 빌드 출력을 skills/knowpatch/bin/으로 변경
src/hooks/detect.ts findPackageRoot()import.meta.url 기반 상대 경로 해석
src/core/paths.ts getHookCommand(scope) — project=상대, user=절대
src/core/hooks.ts scope 전달 + isPlatformHookUpToDate() 추가
src/core/status.ts hookUpToDate 필드 추가
src/commands/update.ts stale 훅 감지 → 자동 마이그레이션
tests/paths.test.ts scope별 경로 검증 테스트

Test plan

  • tsc --noEmit 통과
  • bun test 114 tests 통과
  • bun run buildskills/knowpatch/bin/detect.js 생성 확인
  • npm pack --dry-run → 패키지에 포함 확인
  • 빌드된 detect.js 실행 테스트 통과

The hook command previously pointed to the npm package's ephemeral cache
path (e.g. /tmp/bunx-501-knowpatch@latest/...), making it unusable for
other team members in project-scoped installations.

detect.js is now bundled as a skill resource at
.agents/skills/knowpatch/bin/detect.js and copied alongside SKILL.md
and corrections during install. Hook commands use scope-aware paths:
- project scope: relative path (node .agents/skills/knowpatch/bin/detect.js)
- user scope: absolute path (node ~/.agents/skills/knowpatch/bin/detect.js)

The update system detects stale hooks and migrates them automatically.
@Soju06 Soju06 changed the title feat(hook): relocate detect.js to skill resource for team compatibility fix(hook): relocate detect.js to skill resource for team compatibility Feb 27, 2026
The detect.js build output moved from bin/ to skills/knowpatch/bin/.
Update CI and release workflow verification steps to check the new path.
@Soju06 Soju06 merged commit 9ab62e3 into main Feb 27, 2026
5 checks passed
@Soju06 Soju06 deleted the feat/relocate-hook-to-skill-resource branch February 27, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant