スキル Hook Development
📦

Hook Development

v0.1.0 コンテンツリビジョン r1 高リスク ⚙️ 外部コマンド📁 ファイルシステムへのアクセス🔑 環境変数🌐 ネットワークアクセス

بناء Claude Code Hooks

تحتاج سير عمل hooks إلى تحقق آمن، وأحداث واضحة، واختبار قابل للتكرار. توفر هذه المهارة أنماطًا، وسكربتات، وإرشادات ترحيل لإعدادات Claude Code hook.

対応: Claude Codex Code(CC)
Maintain this Skill? Claim it ⚠️ 38 不十分

自分のエージェントでインストール

このリクエストをエージェントにコピーしてください。正規の Skill ページとマニフェストが含まれています。

エージェントリクエスト
Review the Skillstore skill "Hook Development" from https://skillstore.io/skills/davila7-hook-development.md and its manifest at https://skillstore.io/api/skills/davila7-hook-development/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.

エージェントは引き続き計画を提示し、セキュリティポリシーで必要な確認を求める必要があります。

エージェントが読めるリソース

AI エージェント、クローラー、スクリプトがページ全体ではなく整理されたコンテキストを必要とする場合は、これらのリンクを使ってください。

テストする

「Hook Development」を使用しています。 أنشئ hook يحظر عمليات كتابة الملفات الخطرة.

期待される結果:

  • خطة PreToolUse hook لعمليات Write وEdit.
  • معايير السلامة لمسارات النظام، والتنقل بين المسارات، وملفات بيانات الاعتماد.
  • سلوك allow وask وdeny المتوقع للحالات الشائعة.

「Hook Development」を使用しています。 رحّل Bash validation hook الخاص بي إلى prompt hook.

期待される結果:

  • تصميم prompt hook يحافظ على هدف السياسة الأصلي.
  • مقارنة بين حالات shell الحدية التي تمت إزالتها والمخاطر الجديدة المعتمدة على النموذج.
  • قائمة تحقق للطرح من أجل الاختبار قبل تفعيل hook.

「Hook Development」を使用しています。 اختبر hook قبل نشر plugin.

期待される結果:

  • تسلسل تحقق لإعدادات hook، والمدخلات النموذجية، وسلوك الخروج المتوقع.
  • قائمة بحالات المهلة، والمدخلات غير الصالحة، والمخرجات المشوهة التي يجب اختبارها.
  • ملخص موجز لجاهزية النشر.

セキュリティ監査

高リスク

Of 308 static alerts, most are false positives caused by Markdown formatting, defensive checks, and documented shell examples. Confirmed risks include shell injection, unsafe temporary files, raw SQL construction, and unredacted audit logging. Recommended prompt and command validators also contain bypass and injection weaknesses.

11
スキャンされたファイル
2,781
解析済み行数
17
レビュー項目
0
誤検知を無視

確認済みのセキュリティ上の懸念 (6)

高
Prompt Decisions Consume Untrusted Instructions
Recommended prompt hooks interpolate tool input directly without delimiters or an explicit untrusted-data rule. Crafted commands can manipulate approval decisions.
Both recommended templates place attacker-controlled command text directly inside decision prompts. No injection-resistant framing or deterministic fallback is shown.
高
Destructive Command Denylist Is Bypassable
The Bash validator denies only exact substrings and approves every unmatched command. Equivalent destructive syntax or alternate tools bypass the hook.
The code returns success after several literal substring checks. Variants such as separated flags are not covered and reach the approval path.
高
Protected Path Checks Ignore Symlinks
The write validator checks raw path strings without canonicalization, then approves other paths. Symlinked paths can reach protected or sensitive files.
The validator performs only substring and prefix comparisons. It never resolves the target or verifies that the canonical path remains within an allowed root.
高
Raw Hook Input Is Embedded in SQL
The database logging example places raw hook input inside a SQL statement. Crafted input can alter the query or expose database data.
The psql command inserts the complete input inside a single-quoted SQL literal. No parameter binding or SQL escaping is present.
高
Audit Log Stores Complete Hook Payloads
The audit example writes complete hook input to a persistent home-directory log. Tool arguments may contain source code, credentials, or user prompts.
The input is captured from stdin and appended without filtering or redaction. The documented log path is persistent and no restrictive permissions are set.
中
Hook Output Allows JSON Injection
The write validator concatenates an unescaped tool path into JSON output. Quotes or control characters can corrupt or alter the decision response.
file_path comes from tool input and is inserted directly between JSON quotes. No JSON encoder escapes attacker-controlled characters.
機能レビュー項目 (17)

これらは、このスキルに期待される可能性のある実際のローカル機能であるため、レビューが必要ですが、確認済みの悪意ある動作としてはカウントされません。

高
Hidden file in home directory
echo "$timestamp | $USER | $tool_name | $input" >> ~/.claude/audit.log
The example persistently appends complete hook input to a hidden file in the user home directory. That payload can contain credentials, prompts, or source data.
高
Hidden file access
echo "$timestamp | $USER | $tool_name | $input" >> ~/.claude/audit.log
The example writes unredacted hook input into a hidden audit log. The documented access creates a real local disclosure and retention risk.
高
Temp directory access
export CLAUDE_PROJECT_DIR="/tmp/test-project"
The integration example uses a fixed shared temporary project path and later removes it recursively. Existing data at that path can be modified or deleted.
高
Database connection strings
psql "$DATABASE_URL" -c "INSERT INTO hook_logs (event, data) VALUES ('PreToolUse', '$input')" \
The example uses DATABASE_URL and inserts raw hook input into a database command. It exposes a connection secret to a fragile logging path with injection risk.
高
Shell command substitution
output=$(timeout "$TIMEOUT" bash -c "cat '$TEST_INPUT' | $HOOK_SCRIPT" 2>&1)
The runner interpolates user-supplied hook and input paths into bash -c. Shell metacharacters in either path can execute unintended commands.
中
Temp directory access
echo "$risk_level" > /tmp/hook-state-$$
The example writes state to a predictable PID-based path in a shared temporary directory. A precreated symlink can redirect or corrupt the write.
中
Temp directory access
risk_level=$(cat /tmp/hook-state-$$ 2>/dev/null || echo "unknown")
The example reads state from a predictable shared temporary path without ownership checks. Another local process can prepopulate the file and influence hook decisions.
中
Temp directory access
cache_file="/tmp/hook-cache-$cache_key"
The cache filename is deterministic and placed in a shared temporary directory without secure creation. Local file poisoning or symlink redirection is possible.
中
Temp directory access
echo "0" > /tmp/test-count-$$
The example creates a predictable PID-based state file in a shared temporary directory. It does not use exclusive creation or verify file ownership.
中
Temp directory access
echo "0" > /tmp/build-count-$$
The example creates another predictable PID-based state file in a shared temporary directory. A local attacker can redirect the write through a symlink.
中
Temp directory access
count=$(cat /tmp/test-count-$$ 2>/dev/null || echo "0")
The counter is read from a predictable shared temporary path without ownership or type checks. File poisoning can alter cross-event enforcement.
中
Temp directory access
echo $((count + 1)) > /tmp/test-count-$$
The counter is written to a predictable shared temporary path without secure creation. Symlink redirection can overwrite an unintended file.
中
Temp directory access
test_count=$(cat /tmp/test-count-$$ 2>/dev/null || echo "0")
The Stop hook trusts a predictable temporary counter file. Another process can spoof the value and bypass the documented test-enforcement decision.
中
Temp directory access
rate_file="/tmp/hook-rate-$$"
The rate-limit state uses a predictable shared temporary path. File poisoning or symlink replacement can bypass limits or redirect later writes.
中
Temp directory access
if [ -f "/tmp/session-initialized" ]; then
The test trusts a fixed marker path in a shared temporary directory. Another process can create that marker and produce a false successful result.
中
Temp directory access
export CLAUDE_PROJECT_DIR="${CLAUDE_PROJECT_DIR:-/tmp/test-project}"
The test runner supplies a fixed shared temporary project directory to the executed hook. Tests can unintentionally interact with preexisting files at that path.
中
Temp directory access
export CLAUDE_ENV_FILE="${CLAUDE_ENV_FILE:-/tmp/test-env-$$}"
The environment file uses a predictable PID-based path that the child hook writes and the runner later reads and removes. Symlink attacks are possible.

リスク要因

⚙️ 外部コマンド (50)
📁 ファイルシステムへのアクセス (45)
🔑 環境変数 (1)
🌐 ネットワークアクセス (1)
監査者: codex 監査履歴を表示 →
このレポートを共有・引用

バージョン付き評価レポート、中立的なバッジ、埋め込みカード、引用を共有できます。Skillstore は証拠を報告しますが、この Skill が安全かどうかは判断しません。

バージョン別レポートを開く
セキュリティ評価

レポートリンクをコピー

https://skillstore.io/skills/davila7-hook-development/audits/10?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report

Markdownバッジ

[![Skillstore security assessment](https://skillstore.io/badges/skills/davila7-hook-development/security.svg)](https://skillstore.io/skills/davila7-hook-development?utm_source=security_passport_badge)

HTMLバッジ

<a href="https://skillstore.io/skills/davila7-hook-development?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/davila7-hook-development/security.svg" alt="Skillstore security assessment" loading="lazy"></a>

埋め込みカード

<iframe src="https://skillstore.io/embed/skills/davila7-hook-development.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>
学術引用 (APA · BibTeX · CFF)

APA形式の引用

davila7. (2026). Hook Development security audit report (audit version 10) [Author version 0.1.0]. Skillstore. https://skillstore.io/skills/davila7-hook-development/audits/10

BibTeX形式の引用

@techreport{davila7-davila7-hook-development-2026, author = {davila7}, title = {Hook Development security audit report (audit version 10)}, institution = {Skillstore}, year = {2026}, number = {10}, url = {https://skillstore.io/skills/davila7-hook-development/audits/10}, note = {Author version 0.1.0} }

CITATION.cff

cff-version: 1.2.0 message: "If you use this Skill, cite its author and this versioned security audit report." title: "Hook Development security audit report (audit version 10)" version: "0.1.0" type: report authors: - name: "davila7" date-released: "2026-07-19" url: "https://skillstore.io/skills/davila7-hook-development/audits/10" identifiers: - type: other value: "skillstore:davila7-hook-development:audit:10" description: "Skillstore immutable audit report identifier"

バリアントを比較

インストール可能なバリアント 3 件

各作者のスキルは個別のインストール項目として維持されます。推奨バリアントは Skillstore の証拠で順位付けされます。

このバリアントが首位の理由

Skillstore での利用が多い
anthropics 推奨

hook-development

Skillstore スコア 38
証拠の信頼度 中
Skillstore 利用状況 26
更新済み

2026-09-09

anthropics-hook-development

Skillstore スコア 38
証拠の信頼度 中
Skillstore 利用状況 24
更新済み

2026-10-24

davila7 現在

davila7-hook-development

Skillstore スコア 38
証拠の信頼度 中
Skillstore 利用状況 19
更新済み

2026-09-09

Skillstore スコア

このスコアの理由 証拠の信頼度: 中
68
アーキテクチャ
100
保守性
87
コンテンツ
70
コミュニティ
65
仕様準拠

作成できるもの

إنشاء Safety Hooks

صمم PreToolUse hooks تراجع عمليات كتابة الملفات، وأوامر Bash، والمسارات الحساسة قبل تشغيل الأدوات.

ترحيل Shell Hooks

حوّل فحوصات Bash الهشة إلى prompt hooks يمكنها التفكير في السياق والحالات الحدية.

اختبار سلوك Hook

استخدم سكربتات التحقق والاختبار المضمنة لفحص إعدادات hook والمخرجات والمهلة وسلوك الفشل.

これらのプロンプトを試す

إنشاء Hook أساسي
أنشئ Claude Code PreToolUse hook يتحقق من عمليات Write وEdit. اشرح matcher ونوع hook ومخرجات القرار المتوقعة.
إضافة التحقق من الأوامر
صمم Bash command validation hook لـ Claude Code. احظر الأوامر المدمرة، واطلب التأكيد قبل الأوامر ذات الامتيازات، وتضمّن إعدادات مهلة آمنة.
الترحيل إلى Prompt Hooks
راجع منطق hook الحالي هذا واقترح إصدار prompt hook. حافظ على هدف الأمان واسرد مخاطر الترحيل.
بناء خطة اختبار Hook
أنشئ خطة اختبار لحزمة Claude Code hook. تضمّن التحقق من schema، ومدخلات نموذجية، ومخارج متوقعة، وفحوصات المهلة، وحالات الفشل.

ベストプラクティス

  • فضّل prompt hooks لقرارات السلامة السياقية وcommand hooks للفحوصات الحتمية الصغيرة.
  • ضع متغيرات shell بين علامات اقتباس، وتحقق من مدخلات JSON، واضبط مهلًا صارمة لكل command hook.
  • اختبر hooks بحالات تمثيلية تشمل allow وask وdeny والمهلة والمدخلات المشوهة قبل النشر.

回避

  • لا تنسخ أمثلة تسجل مدخلات hook الخام دون تنقيح أو موافقة المستخدم.
  • لا تبنِ أوامر shell عبر إدراج مسارات ملفات أو أسماء سكربتات غير موثوقة.
  • لا تعتمد فقط على قوائم deny بسيطة لاكتشاف الأوامر المدمرة أو الملفات الحساسة.

よくある質問

ما الذي تساعدني هذه المهارة في بنائه؟
تساعد في بناء Claude Code hooks للتحقق، والأتمتة، وسياق الجلسة، وفحوصات الإكمال.
هل تركز على prompt hooks أم command hooks؟
تغطي كليهما، لكنها توصي باستخدام prompt hooks للقرارات الواعية بالسياق عندما تكون مدعومة.
هل يمكنها التحقق من ملفات إعدادات hook؟
نعم. تتحقق إرشادات schema validation المضمنة من الأحداث، وmatchers، وأنواع hook، والأوامر، وprompts، والمهل.
هل يمكنني استخدام الأمثلة في الإنتاج مباشرة؟
لا. راجع الأمثلة وقوّها واختبرها لأن العديد منها أنماط تعليمية وليست ضوابط جاهزة للإنتاج.
ما الأدوات المشار إليها في قائمة marketplace؟
تستهدف القائمة البحث عن Claude وCodex وClaude Code، بينما يتعلق المحتوى التقني بـ Claude Code hooks.
ما الذي يجب أن أختبره قبل تفعيل hooks؟
اختبر المدخلات الصالحة، والعمليات المرفوضة، وJSON المشوه، وسلوك المهلة، وتنسيق المخرجات قبل النشر.

開発者情報

作成者

davila7

ライセンス

MIT

作者バージョン

v0.1.0

Skillstore リビジョン

r1

参照

dbe0e719813583400773166a0621f8a9b8185c72

メンテナンスの新しさ

2026/7/18

利用状況

9 ダウンロード · 211 閲覧