본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

diagnosing-hooks

ZCode 훅의 설정 위치, 이벤트, 매처, 스크립트, 출력과 실행 로그를 점검해 훅이 실행되지 않거나 세션을 막거나 오류를 내는 원인을 찾고 구체적인 수정 방법을 안내합니다.

원문원문 설명 보기

Use to diagnose and fix ZCode hook configuration problems in the ZCode client. Applies when a hook does not trigger, an event name is wrong, a matcher does not match a tool name, a script is not executable, template variables are not expanded, a timeout unit is mistaken (seconds versus milliseconds), the command and process field styles are mixed, a hook's JSON output fails validation, a hook blocks the session unexpectedly, or configuration-file hooks are not enabled. Provides configuration sources, the hooks.json schema, how to inspect hooks in the client, and a step-by-step localization and repair workflow.

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • 훅이 실행되지 않는 원인을 찾을 때
  • 이벤트 이름과 매처를 확인할 때
  • 시간 초과나 JSON 검증 오류를 고칠 때
  • 예기치 않은 세션 중단을 조사할 때

한국어 소개

할 수 있는 일

이 기술은 ZCode 훅 설정 문제를 조사하고 원인을 구체적인 수정으로 연결합니다. 설정 파일의 활성화 여부, 이벤트 이름, 도구 이름 조건, 스크립트 실행 권한, 템플릿 변수, 시간 초과 단위, command와 process 항목의 차이를 확인합니다. 훅이 반환하는 JSON 형식과 종료 코드도 살펴보고, 클라이언트 설정 화면과 실행 로그를 통해 훅이 실행되지 않은 경우, 시간 초과, 실패, 의도적인 차단을 구분합니다. 등록 상태 확인부터 이벤트와 조건 검증, 수동 실행, 실제 로그 관찰 순서로 점검합니다.

이럴 때 유용합니다

설정한 훅이 실행되지 않거나 특정 도구에서만 작동하거나 세션을 예기치 않게 멈출 때 유용합니다. 설정 항목과 로그를 바탕으로 원인을 단계적으로 좁히려는 경우에 적합합니다.

사용 예시

  • “이 ZCode 훅이 실행되지 않는 원인을 찾아 주세요.”
  • “도구 이름 매처가 일치하지 않는 이유를 확인해 주세요.”
  • “로그에서 훅이 세션을 멈춘 이유를 찾아 주세요.”

주의 사항

이 기술은 ZCode 클라이언트의 훅 설정을 대상으로 합니다. 설정 파일의 훅은 기본적으로 비활성 상태이므로 실행하려면 hooks.enabled: true로 설정해야 합니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
B일부 부족훅 실행과 chmod를 다루지만 훅의 신뢰성을 확인하는 절차는 충분히 설명하지 않습니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
A양호ZCode 클라이언트를 대상으로 하며 설정 훅의 활성화 항목도 명시합니다.

점수에는 넣지 않았습니다. 2026년 10월 24일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md9.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Diagnosing Hook Configuration

Goal: reduce any hook problem to a single concrete fix.

Note on trust: plugin hooks execute regardless of the marketplace they came from — third-party plugin hooks run just like built-in ones. Any "diagnostic-only until trusted" wording you may see for marketplace hooks is stale; a plugin's detail view marks each hook as runnable, and that is now true for all hooks.

1. Configuration sources and merging

  • Configuration-file hooks: the top-level hooks key in ~/.zcode/cli/config.json (or the workspace <repo>/.zcode/config.json / zcode.json), shaped as { enabled?, timeoutMs?, maxOutputBytes?, events: { <Event>: [ { matcher?, hooks: [...] } ] } }. These are disabled by default — configuration-file hooks must set hooks.enabled: true to run.
  • Plugin hooks: each plugin's hooks/hooks.json (or its manifest hooks field). Plugin matchers are appended after configuration matchers. When any plugin contributes a hook, the hook runner is enabled automatically.
  • Non-plugin (user or workspace) configuration hooks have no trust gate; with enabled: true they run unconditionally.

2. hooks.json schema

{ "hooks": { "<Event>": [ { "matcher": "...", "hooks": [ { "type": "command"|"process", ... } ] } ] } }

(A plugin file uses the outer hooks wrapper; the configuration file uses hooks.events.<Event>. The inner array is the same.)

  • Event names (exactly seven): SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Stop. Any other name is an unsupported event. (Events such as Notification, SubagentStop, and PreCompact are not supported.)
  • The matcher is a case-sensitive regular expression, tested against the event's match value:
    • SessionStart → one of startup, resume, clear, compact
    • Tool events (PreToolUse, PostToolUse, PermissionRequest, PostToolUseFailure) → the tool name (Bash, Read, Write, Edit, Agent, …), with aliases Task ↔ Agent and Write/Edit ← ApplyPatch
    • UserPromptSubmit → the prompt text; Stop → the response preview
    • An omitted matcher matches everything; an invalid regular expression never matches (silently)
  • type: "command": command (a shell string); optional shell, timeout (in seconds), timeoutMs (in milliseconds, takes precedence), and statusMessage. Note that async currently has no runtime effect.
  • type: "process": command (an executable) plus args[] (an argument vector run without a shell, the most portable choice), timeoutMs (in milliseconds), and statusMessage.
  • Timeout resolution: timeoutMs → timeout × 1000 → the configuration's timeoutMs → a default of 60000 ms.
  • Template variables (expanded in the command and each argument, and also injected as environment variables): ${CLAUDE_PROJECT_DIR} / ${ZCODE_PROJECT_DIR}, ${CLAUDE_SESSION_ID}; and, for plugin hooks only, ${CLAUDE_PLUGIN_ROOT} / ${ZCODE_PLUGIN_ROOT} and the plugin data directory. Note that a skill-directory variable is not valid in a hook and raises an error.
  • Hook output: standard output is parsed as JSON (a strict schema — any extra key fails validation), or you may use exit codes: 0 passes, 2 blocks (a deny for PreToolUse/PermissionRequest), and any other non-zero raises an error. additionalContext is injected into the conversation; PreToolUse may return a permission decision of allow/ask/deny; Stop may request continuation (up to three times).

3. How to inspect hooks

  • In the client: Settings → Plugin Management → open a plugin's detail view to see the hooks it registers and whether each is runnable.
  • As an agent: read the hooks/hooks.json (or the manifest hooks field) for a plugin, and the hooks block of ~/.zcode/cli/config.json / the workspace config for configuration hooks.
  • Execution (fired, timed out, blocked) is recorded in the ZCode log, with the hook's source, matcher, outcome, duration, and a preview of its error stream — enough to distinguish a timeout from a failure from a block.

4. Common pitfalls (symptom → cause → fix)

  1. Configuration-file hooks do not run — you added hooks.events.* but nothing fires. They are disabled by default and are enabled automatically only when a plugin hook is present. → Set "hooks": { "enabled": true, ... } in the configuration.
  2. Wrong event name — the hook never triggers. → Use exactly one of the seven supported events.
  3. Matcher does not match (tool name, case, or regex) — it is registered but never fires for the tool you expect. The matcher is a case-sensitive regular expression; "bash" will not match Bash, and an invalid expression never matches. → Use the exact tool name or a correct expression (for example "Edit|Write"), or omit the matcher to match all. Remember the aliases Task → Agent and Write/Edit → ApplyPatch.
  4. Script is not executable — permission denied, with a failed outcome. The script was installed without the executable bit. → Run chmod +x on it, or invoke it through an interpreter, e.g. {"type":"command","command":"bash \"${CLAUDE_PLUGIN_ROOT}/hooks/x.sh\""}, so the executable bit is irrelevant.
  5. Template variable not expanded — a literal ${...} or an empty path. Only recognized variables are expanded; a skill-directory variable raises an error inside a hook, and ${CLAUDE_PLUGIN_ROOT} is available only for plugin hooks. → Use only supported variables, and ${CLAUDE_PLUGIN_ROOT} for plugin-relative paths.
  6. Timeout unit mistaken — the hook is killed with a timed-out outcome. command's timeout is in seconds; process's timeoutMs is in milliseconds. timeout: 500 means 500 seconds; timeoutMs: 5 means 5 milliseconds. → Use "timeout": <seconds> for a command hook and "timeoutMs": <milliseconds> for a process hook.
  7. Command and process fields mixed — the hook is dropped. A process hook accepts only command, args, and timeoutMs; a command hook accepts command, shell, timeout, and timeoutMs. → Match the fields to the type.
  8. JSON output fails validation — the hook ran but its effect was discarded and the run marked failed. The output was not valid JSON, contained an extra key (the schema is strict), or its event-specific output named the wrong event. → Emit only the recognized keys with the correct event name, or emit nothing (empty output is fine) and rely on exit codes.
  9. Assuming async runs in the background — you set async: true but the session still waits. The async field has no runtime effect and hooks always run inline. → Do not rely on async; for background work, have the script daemonize itself.
  10. Cross-platform failure — it works on one operating system but not another. A command hook runs through a shell, so POSIX syntax fails on Windows. → Prefer a process hook (an argument vector, no shell), or ship a polyglot wrapper script and keep hook scripts extensionless.
  11. A hook blocks the session unexpectedly — a tool is denied or the run halts. The hook returned a block, exited with code 2, or returned a deny decision. → Inspect the block's reason in the log; fix the script's exit code — return 0 to pass and reserve 2 for a deliberate block.
  12. Believing third-party hooks are "diagnostic only" — a third-party plugin hook did not run and you suspect a trust gate. That is not the cause: all plugin hooks are runnable. → Diagnose via pitfalls 2, 3, 4, and 8.

5. Localization workflow (in order)

  1. Is a runner active? Confirm that either hooks.enabled: true is set in the configuration or at least one plugin contributes a hook; otherwise no runner exists and every hook is skipped.
  2. Enumerate what is registered. In Settings → Plugin Management, open the plugin's detail view and confirm the hook you expect is present and runnable, and that its plugin is enabled. For configuration hooks, read the hooks block directly.
  3. Event name and matcher. Check against the seven events; confirm the match value and the case-sensitive expression; test by omitting the matcher (which matches everything).
  4. Executable and interpreter. Confirm the script has its executable bit, or invoke it explicitly via bash/node.
  5. Run it by hand. Feed a sample hook input to the script and inspect the exit code and output — 0 plus valid JSON is healthy, 2 is a deliberate block, any other non-zero is a failure.
  6. Observe live. Trigger the event and read the hook run records in the log (outcome, duration, error-stream preview) to distinguish a timeout from a failure from a block.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

3d-object

무료요약 있음

three.js로 입체 모델을 만들고 회전 가능한 뷰어에서 모든 각도로 확인합니다. OBJ + MTL이나 GLB로 저장해 다른 3D 제작 소프트웨어에서 사용할 수 있습니다.

  • 입체 모델을 만들고 모든 각도에서 확인하기
  • Blender에서 편집할 모델 만들기
  • 모델의 윤곽과 재질 표현 확인하기
asgeirtj/system_prompts_leaks7만2026년 10월 24일 업데이트

action-items

무료요약 있음

개인 작업 목록에 할 일, 기한, 다음 단계, 답변을 기다리는 대상과 진행을 막는 이유를 기록합니다. 진행 상황과 의존 관계를 갱신하고 중복 및 완료 항목을 정리합니다.

  • 기한이 있는 작업과 약속 기록
  • 답변 대기와 진행을 막는 이유 정리
  • 선행 작업 완료 후 의존 관계 갱신
asgeirtj/system_prompts_leaks7만2026년 10월 24일 업데이트

agents

무료

Coordinate a task from a verifiable goal through completion. Handle work directly or split independent tasks across separate agent sessions, track progress, verify results, and arrange pull request merging when included in the goal.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Split independent tasks across agents
  • Check progress across ongoing tasks
  • Resume a previously started project
asgeirtj/system_prompts_leaks7만2026년 10월 24일 업데이트

animated-video

무료요약 있음

재생, 일시 정지, 시간 위치 지정이 가능한 HTML 애니메이션을 만듭니다. 장면 길이와 속도를 조절하고 가로형·세로형 영상 내보내기를 준비합니다.

  • 제품 조작 과정을 영상으로 제작
  • 글자와 도형으로 내용 설명
  • 세로형 애니메이션 제작
asgeirtj/system_prompts_leaks7만2026년 10월 24일 업데이트

apple_healthkit

무료요약 있음

Apple Health에 동기화된 걸음 수, 심박수, 수면, 운동 기록을 기간별로 확인하고 일상 변화와 동기화 상태, 누락된 데이터를 살펴봅니다.

  • 걸음 수와 심박수의 변화를 확인합니다
  • 수면 단계와 시간, 중간 각성을 확인합니다
  • 운동 시간과 거리, 소모 열량을 돌아봅니다
asgeirtj/system_prompts_leaks7만2026년 10월 24일 업데이트

artifact_document

무료요약 있음

Word 문서와 템플릿을 만들고 편집하며 내용 추출, 이미지 교체, 변경 내용 추적과 메모를 다룹니다. 제목과 목록 구조를 정리하고 모든 페이지의 표시를 확인합니다.

  • 구조를 갖춘 Word 문서 작성
  • 기존 문서의 내용 정리
  • 문서 안의 이미지와 텍스트 교체
asgeirtj/system_prompts_leaks7만2026년 10월 24일 업데이트

asgeirtj의 스킬 모두 보기

이 스킬의 문제 신고