Skip to content

Instantly share code, notes, and snippets.

@silenvx
silenvx / SKILL.md
Created February 23, 2026 03:47
permission-hooks SKILL.md: 承認ダイアログの自動修正スキル — https://zenn.dev/ux_xu/articles/4f57169b0dd820

name: permission-hooks description: Diagnoses and fixes PermissionRequest hook issues when Bash triggers unexpected approval prompts. When called with arguments, treat the argument as the diagnostic target command — never execute it. Use when commands are blocked, user mentions "permission"/"hooks"/"承認", or adding auto-approval patterns. allowed-tools:

  • Bash(python3 -m unittest *)
  • Read hooks: PreToolUse:
    • matcher: "Bash" hooks:
@silenvx
silenvx / SKILL.md
Created February 23, 2026 03:07
ai-debate SKILL.md: 4者構造化議論スキル — https://zenn.dev/ux_xu/articles/4f57169b0dd820

name: ai-debate description: Runs a structured 3-round debate among Claude, Codex (OpenAI), Gemini (Google), and Cursor (Anysphere) as equal participants. Claude also serves as final judge. Sends data to external AIs. Use when the user mentions "議論", "debate", "ディベート", "討論", or wants deeper analysis through adversarial discussion. allowed-tools:

  • Bash(codex exec --skip-git-repo-check -s read-only *)
  • Bash(codex --cd * exec --skip-git-repo-check -s read-only *)
  • Bash(gemini -s -p *)
  • Bash(gemini -s -p * --include-directories *)
  • Bash(cursor-agent -p *)
  • Bash(cursor-agent -p * --workspace *)
@silenvx
silenvx / test_approve_skill_bash.py
Created February 23, 2026 03:07
Tests for approve-skill-bash.py (PreToolUse hook) — https://zenn.dev/ux_xu/articles/4f57169b0dd820
#!/usr/bin/env python3
"""approve-skill-bash.py のテスト."""
import json
import os
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
@silenvx
silenvx / test_approve_safe_commands.py
Created February 23, 2026 03:06
Tests for approve-safe-commands.py (PermissionRequest hook) — https://zenn.dev/ux_xu/articles/4f57169b0dd820
#!/usr/bin/env python3
"""approve-safe-commands.py のテスト."""
import json
import subprocess
import sys
import unittest
from pathlib import Path
HOOK = str(Path(__file__).with_name("approve-safe-commands.py"))
@silenvx
silenvx / approve-skill-bash.py
Created February 23, 2026 03:06
PreToolUse hook: スキル固有の Bash 自動承認 — https://zenn.dev/ux_xu/articles/4f57169b0dd820
#!/usr/bin/env python3
"""PreToolUse hook: スキル固有の Bash コマンドを自動承認する.
SKILL.md の hooks フロントマターから呼び出され、
そのスキルがアクティブな間だけ allowed-tools の Bash パターンを承認する。
使い方:
approve-skill-bash.py <path-to-SKILL.md>
"""
@silenvx
silenvx / approve-safe-commands.py
Created February 23, 2026 03:06
PermissionRequest hook: 複数行コマンドの自動承認 — https://zenn.dev/ux_xu/articles/4f57169b0dd820
#!/usr/bin/env python3
"""PermissionRequest hook: 安全なコマンドパターンを自動承認する.
改行を含むコマンドが permissions.allow のパターンにマッチしない問題の
ワークアラウンド (https://github.com/anthropics/claude-code/issues/11932).
"""
import json
import re
import sys

Claude Code Skills: Codex CLI / Gemini CLI 連携

概要

Claude CodeからOpenAI Codex CLI(@openai/codex)とGoogle Gemini CLI(@google/gemini-cli)を呼び出し、複数AIの意見を収集・比較するためのskillsを作成します。

注意: OpenAI Codex CLIは2025年リリースの新しいツールであり、2023年に廃止された旧Codex APIとは別物です。

主な用途

@silenvx
silenvx / hoge.sh
Last active April 17, 2016 02:58
DDNS update
#!/bin/sh
GLOBAL_IP=` echo $SSH_CONNECTION|cut -f1 -d " "`
HOST_NAME="sub.noter.jp"
TTL="3600"
echo $GLOBAL_IP|grep -E '^((([0-1]?[0-9]|2[0-4])?[0-9]|25[0-5])\.){3}(([0-1]?[0-9]|2[0-4])?[0-9]|25[0-5])$' > /dev/null
if [ $? -eq 0 ];then
echo "
server 127.0.0.1
update delete $HOST_NAME
[ 295.280]
X.Org X Server 1.15.0
Release Date: 2013-12-27
[ 295.280] X Protocol Version 11, Revision 0
[ 295.280] Build Operating System: Linux 3.12.5-1-ARCH i686
[ 295.280] Current Operating System: Linux bootstrap 3.12.8-1-ARCH #1 SMP PREEMPT Thu Jan 16 09:46:30 CET 2014 i686
[ 295.280] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=be3aec12-d413-4333-983a-8aa2b20eee61 rw quiet
[ 295.281] Build Date: 09 January 2014 09:32:33AM
[ 295.281]
[ 295.281] Current version of pixman: 0.32.4
@silenvx
silenvx / gist:7980902
Created December 16, 2013 01:07
debug用
diff -Narup unzip60.orig/zipinfo.c unzip60/zipinfo.c
--- unzip60.orig/zipinfo.c 2009-02-09 02:04:30.000000000 +0900
+++ unzip60/zipinfo.c 2013-12-16 10:04:59.056161870 +0900
@@ -794,18 +794,26 @@ int zipinfo(__G) /* return PK-type err
if (!G.process_all_files) { /* check if specified on command line */
unsigned i;
- if (G.filespecs == 0)
+ if (G.filespecs == 0){
+ printf("1\n");