用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/oimiragieo/agent-studio --skill hooks-worker命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | hooks-worker |
| description | Hook system optimization — async conversion, consolidation, deduplication, new hook events |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Features that modify .claude/settings.json hook registrations, create new hook scripts, consolidate existing hooks, or add new hook event categories.
Read the feature description carefully. Understand exactly which hooks to modify, what safety classification to respect, and what the expected settings.json structure should be.
Baseline snapshot. Before ANY changes, read .claude/settings.json and record:
Write tests first (red). Create test file at tests/hooks/<descriptive-name>.test.cjs. Tests should verify:
Implement changes.
'use strict', project-root.cjs, safeParseJSON, formatResult(). Security hooks exit 2 to block; advisory hooks exit 0.Run tests (green). All tests pass. Fix any failures.
Validate settings.json.
node -e "JSON.parse(require('fs').readFileSync('.claude/settings.json','utf8'))"
Run lint and format.
pnpm lint
pnpm format:check
Manual verification. For new hooks, run them manually with sample input to verify behavior. For settings.json changes, diff against baseline to confirm only intended changes were made.
{
"salientSummary": "Converted 22 advisory hooks to async:true in settings.json. Zero security hooks affected. Added timeout_ms to 40 hooks that were missing it. settings.json valid JSON with all 7 event categories preserved. Created tests/hooks/hook-async-classification.test.cjs (15 tests).",
"whatWasImplemented": "Parsed settings.json, classified each hook by reading its source (exit 2 = blocking/sync, exit 0 = advisory/async candidate). Added async:true to 22 advisory hooks across UserPromptSubmit, PostToolUse, PostToolUseFailure. Left all 18 security/blocking hooks as sync. Added timeout_ms to 40 hooks: 5000ms for simple advisory, 10000ms for monitoring, 15000ms for file-scanning, 30000ms for cleanup.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{
"command": "node --test tests/hooks/hook-async-classification.test.cjs",
"exitCode": 0,
"observation": "15 tests passing"
},
{
"command": "node -e \"JSON.parse(require('fs').readFileSync('.claude/settings.json','utf8'))\"",
"exitCode": 0,
"observation"