Skip to content

Instantly share code, notes, and snippets.

@silenvx
silenvx / SKILL.md
Last active April 25, 2026 11:27
worktree-addのskills

name: worktree-add maturity: stable description: Creates a git worktree with config files (.env etc.) copied. Use when the user asks to create a worktree, parallel branch, or isolated working environment. argument-hint: " [base-ref]" allowed-tools:

  • Bash(cp * .worktrees/*)
  • Bash(printenv CLAUDE_SKILL_WORKTREE_SETUP_CMD) hooks: PreToolUse:

Autonomy

ユーザーに逐一確認を取らず、自律的に作業を進めること。ツールの承認プロンプトが自然な確認ポイントとなるため、それ以外でユーザーの判断を仰ぐ必要はない。判断に迷う場合も、まず最善と思われる方針で進め、問題があればユーザーが指摘する。ただし、同じ操作で繰り返し失敗する場合は、自律的な判断を中断し、問題をユーザーに報告すること。

Task Completion

作業が完了するまで完了感を出さないこと。中間成果(テスト通過、コード修正完了等)の報告時に後続ステップ(PR 作成、CI 確認、/babysit-pr 開始等)が残っている場合は、そのまま後続ステップに進むこと。ただし、ユーザーが明示的に停止点やスコープを指定している場合はそれに従う。

Cross-Project の後続ステップ

@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