From image-redactor
This skill should be used when the user asks to '画像を墨消し', 'redact image', 'アカウントIDを隠す', '画像のマスキング', '個人名を消す', 'black out sensitive info', 'スクリーンショットの墨消し', '画像から個人情報を消す', 'mask PII in screenshot', '情報を隠す', or mentions redacting, masking, or hiding AWS account IDs, personal names, IP addresses, or sensitive text from images.
How this skill is triggered — by the user, by Claude, or both
Slash command
/image-redactor:image-redactorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
画像内のAWSアカウントID・個人名・プロダクト名などの機密情報を検出し、黒塗りで墨消しします。
画像内のAWSアカウントID・個人名・プロダクト名などの機密情報を検出し、黒塗りで墨消しします。
diagrams/screenshot.png を墨消ししてください
diagrams/ フォルダ内の画像をすべて墨消し(キーワード: 鈴木, MyProduct)
| 機能 | 説明 |
|---|---|
| 自動検出 | AWSアカウントID(12桁)、IPアドレス、メールアドレス、ARN |
| キーワード指定 | 個人名・プロダクト名など任意のテキストを指定して墨消し |
| 対話的確認 | 検出テキストをユーザーに提示し、追加の墨消し対象を確認 |
| 対応形式 | PNG, JPG/JPEG |
| 出力 | _redacted サフィックス付きの別ファイルとして保存 |
実行前に依存環境を確認する。いずれかが不足している場合はインストールコマンドを実行する。
# Tesseract OCRエンジンの確認
which tesseract || echo "MISSING: brew install tesseract tesseract-lang"
# Python依存の確認
python3 -c "import pytesseract; import PIL" 2>/dev/null || echo "MISSING: pip3 install pytesseract Pillow"
エラーが出た場合のインストール:
brew install tesseract tesseract-lang
pip3 install pytesseract Pillow
ユーザーから以下を確認:
review コマンドで画像をスキャンし、分類済みの結果を取得する。
単一ファイルの場合:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py review "<image_path>"
キーワード指定ありの場合:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py review "<image_path>" --keywords "鈴木" "MyProduct"
review コマンドは以下の3カテゴリに分類したJSONを返す:
auto_detected: 自動検出された機密情報(AWSアカウントID、IPアドレス等)と座標keyword_detected: キーワードにマッチしたテキストと座標other_texts: 上記に該当しない一般テキスト一覧review の結果をユーザーに提示し、以下を確認:
other_texts 一覧から追加で墨消ししたい項目があるか提示フォーマット:
### 検出結果
**自動検出(墨消し候補):**
- `123456789012` - AWSアカウントID
- `192.168.1.1` - IPアドレス
**キーワードマッチ:**
- `鈴木太郎` - keyword: 鈴木
**画像内のその他テキスト:**
1. `AWS Management Console`
2. `us-east-1`
3. ...
上記の中で追加で墨消ししたい項目はありますか?
番号またはキーワードで指定してください。
ユーザーの確認後、状況に応じて適切なコマンドを選択する。
方法A: 自動検出+キーワードで一括処理(最も一般的):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py process "<image_path>" --keywords "鈴木" "MyProduct"
方法B: キーワードなし(自動検出のみ):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py process "<image_path>"
方法C: 特定領域のみ選択的に墨消し(ユーザーが一部を除外/追加した場合):
review コマンドの出力から、ユーザーが承認した領域の座標をJSON配列で渡す:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py redact "<image_path>" --regions '[{"x":10,"y":20,"w":100,"h":30},{"x":200,"y":50,"w":150,"h":25}]'
フォルダ一括の場合:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py batch "<folder_path>" --keywords "鈴木" "MyProduct"
出力先を指定する場合(いずれのコマンドでも使用可):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py process "<image_path>" --output-dir "<output_dir>"
墨消し後の画像をReadツールで読み込み、以下の観点でClaudeが目視検証する。
チェック観点:
問題が見つかった場合の補正:
問題のある領域を特定し、座標を調整して redact コマンドで再墨消しする。
入力は元画像(redacted版ではない)を使い、全領域を再適用する。
# 元のreview結果の座標 + 補正値で再実行
# 漏れがある場合: 該当領域のw/hを拡大、またはx/yをずらす
# 過剰な場合: 該当領域を除外
python3 ${CLAUDE_PLUGIN_ROOT}/skills/image-redactor/scripts/redact.py redact "<元画像パス>" --regions '[補正済みの全領域JSON]' --output-dir "<出力先>"
補正の目安:
w または h を10〜20px拡大、または x/y を5〜10pxずらすw/h を縮小、または領域自体を除外補正後、再度Readツールで確認し、問題がなくなるまで繰り返す(最大3回)。
_redacted ファイルをユーザーに見せる| コマンド | 用途 | 主なオプション |
|---|---|---|
review | 分類済みスキャン結果を取得(対話ワークフロー用) | --keywords, --lang |
process | 自動検出+キーワードで一括墨消し | --keywords, --output-dir, --lang |
redact | 指定座標のみ選択的に墨消し | --regions(必須), --output-dir |
batch | フォルダ内の画像を一括処理 | --keywords, --output-dir, --lang |
scan | 生のOCR結果を取得(デバッグ用) | --lang |
| 項目 | 仕様 |
|---|---|
| ファイル名 | {元のファイル名}_redacted.{拡張子} |
| 保存先 | 元ファイルの親ディレクトリ内の redacted/ フォルダ(output-dir未指定時) |
| 元ファイル | 変更しない |
| パターン | 例 | 説明 |
|---|---|---|
| AWSアカウントID | 123456789012, 1234-5678-9012 | 12桁数字(ハイフン区切り含む) |
| AWSアクセスキーID | AKIA1234567890ABCDEF | AKIA/ASIAで始まる20文字 |
| AWSリソースID | i-0abc123def, vpc-0abc123, sg-0abc123 | EC2, VPC, SG, Subnet等のリソースID |
| Organization/OU ID | o-abc123defg, ou-xxxx-xxxxxxxx | AWS Organizations関連ID |
| IPアドレス (v4) | 192.168.1.1 | IPv4アドレス |
| IPアドレス (v6) | 2001:0db8::1 | IPv6アドレス |
| メールアドレス | [email protected] | 標準的なメール形式 |
| ARN | arn:aws:iam::123456789012:... | AWSリソース識別子 |
_redacted が既にファイル名に含まれるファイルはバッチ処理でスキップされますCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub jun-suzuki1028/cc-plugins --plugin image-redactor