بنقرة واحدة
hooks-creator
Use when the user wants to customize Gemini CLI behavior using hooks (events, blockers, loggers).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when the user wants to customize Gemini CLI behavior using hooks (events, blockers, loggers).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when the user asks to create, combine, split, preview, or extract content from PDF files. Triggers include "markdown to pdf", "mermaid in pdf", "merge PDFs", "split a PDF", "extract text from pdf", "fill AcroForm", "preview pdf as image", and similar PDF generation or manipulation tasks.
Use when summarizing meeting transcripts OR articles, papers, and threads into structured Markdown or wiki note-JSON. Model-agnostic meta-skill: auto-detects content type, selects a template, and produces a two-level pyramid (or opt-in structured note-JSON) optimized for people, AI agents, RAG, and Obsidian.
Use when converting a web page (URL) or a saved .html/.htm/.mhtml/.webarchive into clean Markdown — a web-clipper for Obsidian notes and a universal HTML→Markdown step for agent workflows. Triggers include "html to markdown", "url to markdown", "web page to obsidian", "webarchive to markdown", "mhtml to markdown", "scrape page to notes", "clip this article".
Use when the user asks to create, edit, convert, validate, preview, or password-protect Microsoft Word .docx documents. Triggers include "markdown to docx", "docx to markdown", "fill Word template", "accept tracked changes", "validate docx", "preview docx as image", "encrypt/decrypt docx", and related .docx round-trip or template-fill tasks.
Use to DRIVE the running Obsidian desktop app from the shell via its official CLI: link-safe rename/move, typed properties, task toggles, daily-note capture, template insertion, Base queries, file-history restore, open notes/panes. Triggers: "rename/move the note", "open in Obsidian", "daily note", "set a property", "query the base", "restore a version", "obsidian cli". NOT for knowledge lookup — for anything ABOUT vault content use wiki-ingest query mode first.
Use when the user asks to create, edit, convert, preview, clean, or password-protect Microsoft PowerPoint .pptx presentations. Triggers include "markdown to pptx", "pptx to markdown", "slides from outline", "mermaid in slides", "pptx to pdf", "slide thumbnails", "drop orphan slides", "OCR slide images", "encrypt/decrypt pptx", and related presentation or OOXML round-trip tasks.
| name | hooks-creator |
| description | Use when the user wants to customize Gemini CLI behavior using hooks (events, blockers, loggers). |
| tier | 2 |
| version | 1 |
Purpose: Create robust, secure, and compliant Gemini CLI hooks that intercept and customize the agent's lifecycle (e.g., blocking tools, injecting context, logging).
[!WARNING] SECURITY CRITICAL:
- Strict JSON: Printing to
stdoutbreaks the CLI. Usestderrfor logs.- Injection Risks: BASH hooks MUST use
jq. Never usegrepon raw input.- Dependency Checks: Scripts MUST fail gracefully (exit 2) if deps like
jqare missing.
STOP and READ THIS if you are thinking:
grep to parse JSON in Bash because it's faster" -> WRONG. This is a security vulnerability. You MUST use jq.stderr.jq or node modules.exit 1 for a denial" -> WRONG. Use exit 0 with {"decision": "deny"} for structured feedback, or exit 2 for system errors.jq).settings.json with correct matchers and event types.BeforeTool (triggered on write_file).BeforeAgent (or SessionStart).BeforeAgent (or SessionStart).stdout except the final JSON object.stderr (e.g., echo "Debug" >&2).stderr (e.g., echo "Debug" >&2).jq availability AND functionality.
command -v jq >/dev/null 2>&1 || { echo "jq is required" >&2; exit 2; }input to eval or exec.jq to extract fields safely before processing.settings.json snippet:
write_file|replace_...) instead of * to optimize performance.type is "command".chmod +x <script>.cat test.json | ./hook.sh.You MUST read these files for API details:
references/Gemini CLI Hooks.md (Core Concepts)references/reference.md (JSON Schema & Exit Codes)references/best-practices.md (Security)See examples/security_gate.sh for full implementation.
Use when: Blocking unsafe content or tools.
See examples/security_gate.sh for full implementation.
Use when: Blocking unsafe content or tools.
See examples/tool_filter.js for full implementation.
Use when: Restricting tools based on user prompt/intent.
See examples/settings_snippet.json.
See examples/log_tools.sh.
Use when: Debugging or auditing tool usage.
See examples/inject_context.sh.
Use when: Adding environment data (Git, DB) to agent context.
See examples/validate_response.js.
Use when: Enforcing quality checks (e.g., "Must include Summary:") before showing output.
| Agent Excuse | Reality / Counter-Argument |
|---|---|
"I'll skip the jq check" | Systems without jq will crash unpredictably. |
"Users know not to echo" | No they don't. You must enforce it in the code. |
| "I'll use Python" | Node.js/Bash are preferred for minimal runtime deps, but Python is allowed if requested. |