デザイン&モーション · yang0/handraw-style

handdraw-style-prompter

001〜261の手描きスタイル番号と画像テーマをバイリンガルプロンプトに変換するか、対応する番号の画像がスタイル参照として必要かどうかをモデル機能に基づいて判断した上で画像を生成します。

L4 高権限 · 段階的認可と監査V1 コミット固定コマンド実行ファイル書き込みDual-pass Audit
Author yang0GitHub yang0/handraw-style ↗Stars 1855License 仓库内未发现 LICENSE 文件(git ls-files 未列 LICENSE/COPYING),GitHub API license 字段为 null —— 未声明许可,若需商用请先联系作者确认Commit 70bf51d6b4
管理レベルは Skill の能力と推奨統制措置を示すものであり、品質や安全性の認証、利用可否の判定ではありません。使用の可否はユーザーおよび管理者が決定します。Agent 環境によって制約が異なるため、自動保護を仮定しないでください。第三者製 Skill の著作権は原著作者に帰属し、利用リスクは利用者が負います。

1仕組みと動作原理

機能の核となるのは「スタイルの番号管理」です。ルートの styles_200_reorganized.md から261件のスタイル情報(番号+元参照名+生成名+主要な視覚特徴)を解析して references/styles.json を生成し、build_library.py によってオフライン検索可能なギャラリーHTMLを構築します。

handdraw-style-prompter/SKILL.md
Users can browse `gallery/index.html` for the numbered contact sheets. The authoritative style content is `../styles_200_reorganized.md`; `references/styles.json` is a generated index and must be refreshed with `python scripts/build_library.py` after the Markdown changes.
ここでの処理内容:ユーザーが番号を1つ覚えるだけで済むようにします(README原文:「このスタイルライブラリは『感覚で画像を選ぶ』を『番号を1つ覚える』に変えます」)。build_library.py は `^\|\s*(\d{3})\s*·\s*([^|]+)\|\s*([^|]+)\|\s*(.*)\|\s*$` を用いてMarkdownの表行を解析し、gallery/index.html を同時に生成します。ローカル検証:styles.json は正確に261件あり、番号は001〜261まで連続しています。

出力規約は極めてシンプルかつ厳格です。固定の4段構成(選択スタイル/中国語プロンプト/英語プロンプト/1行説明)とし、プロンプト本文の冒頭は `风格名称:#{编号} · {generation_name}。` および `Style name: #{number} · {generation_name}.` で始めることを義務付けています。

handdraw-style-prompter/SKILL.md
For a valid request, return these four parts: 1. Selected style: number and generated style name. Do not output a core-visual-traits field by default for ordinary prompt-only requests. 2. Chinese prompt: begin the copyable prompt itself with `风格名称:#{编号} · {generation_name}。`; describe only the user's theme and constraints explicitly provided by the user, and always include the indexed author/style name as a short `参考作者/风格名称` label. Do not append core traits, the fixed style anchor, extra style adjectives, generic composition advice, quality claims, or negative prompts. 3. English prompt: begin the copyable prompt itself with `Style name: #{number} · {generation_name}.`; describe only the same theme and user-provided constraints, and always include the indexed author/style name as `Reference author/style name`. Do not append visual-trait prose, generic composition advice, quality claims, negative prompts, or the fixed style anchor. 4. A brief note: the prompt can be pasted into any image AI; generation is controlled by that AI.
ここでの処理内容:「スタイル名+番号」を再現可能なアンカーとしてプロンプト冒頭に記述しつつ、主要特徴、固定スタイルアンカー、追加のスタイル形容詞、一般的な構図の提案、品質宣言、ネガティブプロンプトの追加を禁止しています。この出力規律こそが、本スキルと「適当にモデルへ指示出ししてプロンプトを書かせる」こととの最大の違いです。

デフォルトでは画像を生成しません。ユーザーが生成/レンダリング/プレビューを明示的に要求した場合のみ画像生成モードへ移行し、作者の知名度や存命状況ではなく「送信テキスト全体」(インデックス作者名+生成スタイル名)を用いて現在の画像モデルの能力を判定します。

handdraw-style-prompter/SKILL.md
When the user explicitly requests image generation, first resolve the current image model (or model family) against `references/model_capabilities.json` or the equivalent runtime capability metadata. The decision uses the complete text that will be sent to the model: the indexed author name plus the generated style name. It is not based on the author's fame or life status.
3段階の判断ロジック:name_activation=strong → 作者名+スタイル名+テーマのみ送信。それ以外で traits_activation=strong かつ主要特徴がある場合 → ポジティブな具体的視覚特徴のみ追加。いずれも該当しない場合 → 対応する番号の参照画像を送信。未知のモデルはすべて unknown として画像を送信する安全なフォールバックを行います。

モデル能力リストはハードコードではなくデータ管理されています。references/model_capabilities.json は schema_version/description/default/models 構造を用いて「特定モデルが名称のみで特定番号を再現可能か」を記述し、デフォルト値は強制的に unknown + 画像参照必須となっています。

handdraw-style-prompter/references/model_capabilities.json
"description": "Model-specific ability to activate a numbered style from its name. Unknown models must use the image fallback.", "default": { "name_activation": "unknown", "use_reference_image": true, "note": "No verified model capability is available. Pass the numbered image."
ローカル検証:default.name_activation='unknown'、use_reference_image=true。現在は gpt-image-2 の検証リスト(123番号分:name_activation=strong が78件、none が45件)のみが存在し、残りの番号は自動的に traits または reference-image ブランチにフォールバックします。データの欠落がエラーを引き起こすことはなく、より安全な画像送信ルートへ縮退動作します。

判断ロジックはスクリプトで実装され再現可能です。resolve_reference.resolve() が番号範囲と値のドメイン(ALLOWED = strong/weak/none/unknown)を検証し、activation_source(name+style / name+style+traits / reference-image)およびフィルタリング済みの prompt_traits を出力します。

handdraw-style-prompter/scripts/resolve_reference.py
return ";".join(kept) def get_reference_path(number: str) -> str: reference_grid = grid_path(number) return str(reference_grid if reference_grid.exists() else single_path(number)) def resolve(model: str, style: str, policy: dict | None = None) -> dict:
ここでの処理内容:「参照画像を渡すかどうか」を出力可能なJSONによる決定論的判断へと変換し、モデルが毎回自由に振る舞うのを防ぎます。なお、positive_traits() は「回避/不要/禁止」等を含む節を除外します(SKILL.md 29行目の同義要件)。現在このスクリプトはルートの scripts/ モジュール欠落により実行できません(verification.second_pass の不整合項目を参照)。

参照画像を渡す際は「参照画像隔離ブロック」の挿入が必須です。線画、筆致、画材、質感、色調などのスタイル特徴のみを抽出し、主体、人物、衣装、小道具、ポーズ、シーン、構図、文字、ストーリーを複製してはならず、テーマのみがコンテンツの唯一のソースであることを中英バイリンガルで明記します。

handdraw-style-prompter/SKILL.md
- When an image is passed, inject the following reference-isolation block into the actual image-generation prompt. It is required for every reference-image generation and is not added to ordinary prompt-only output: Chinese: `所附图片仅用于参考画风。只提取参考图的风格特征,例如线条、笔触、媒介、材质、色彩倾向和整体视觉语言;不要使用、复制或延续参考图中的任何主体、人物、动物、服装、道具、动作、姿态、场景、背景、构图、布局、文字或故事。最终画面内容完全以用户提供的主题为准。` English: `Use the attached image only as a style reference. Extract only its stylistic qualities, such as linework, brushwork, medium, material texture, color tendencies, and overall visual language. Do not use, copy, or carry over any subject, person, animal, clothing, prop, action, pose, setting, background, composition, layout, text, or story from the reference image. The user's written theme is the sole source for the image content.` - The user's theme is the sole source for subjects and narrative; the reference image must never override or add content to the theme.
これは「Image-to-Image で参照画像の内容まで固定化されてしまう」という実際の失敗パターンに対する対策です。SKILL.md の24/26行目にそのまま貼り付け可能な中英ブロックが記載されており、実際に画像を渡す場合のみ挿入し、通常のプロンプト出力のみの場合は含めないよう規定されています。

セッションの初期化はホストMCPに依存します。Codexのタスク/スレッドで初回呼び出しされた際に、視覚インデックスとしてローカルギャラリー(file:///E:/handraw-style/handdraw-style-prompter/gallery/index.html)を開き、失敗時はローカルリンクへフォールバックします。再オープンや状態ファイルの書き出しは行いません。

handdraw-style-prompter/SKILL.md
1. If this task has not already displayed the gallery, call `mcp__codex_app__open_in_codex` with `target: { type: "browser", url: "file:///E:/handraw-style/handdraw-style-prompter/gallery/index.html" }` so the rendered gallery opens in the in-app browser. 2. Continue with the user's request after the browser call; opening the gallery must not block prompt generation or an explicitly requested image-generation follow-up. 3. Do not repeat the browser call on later turns in the same task/thread. Use the conversation context (not a persistent state file) to determine whether initialization already happened. 4. If the browser call is unavailable or fails, provide this fallback link: [打开手绘风格编号画廊](file:///E:/handraw-style/handdraw-style-prompter/gallery/index.html), then continue normally.
ここでの処理内容:セッション開始時に「番号ギャラリーの閲覧」を先行させることで、ユーザーがスタイルを言語化する負担を軽減します。39行目では状態管理にファイルではなく会話コンテキストを使用することが明記されており('Use the conversation context (not a persistent state file) to determine whether initialization already happened')、ディスクの汚染を防いでいます。

リソース解決ルールを内蔵しています。同一番号の4分割グリッド参照画像は単体画像より優先され、パスは200番号ごとのバケット(例: 201-400)に分かれています。画像が存在しない場合は制約を報告してテキストのみのプロンプトへフォールバックし、参照画像の捏造や勝手な代替は一切行いません。

handdraw-style-prompter/SKILL.md
- If the numbered image is missing or cannot be passed, report that limitation and provide the normal text prompts; never invent or substitute a reference image.
ローカル検証:images/individual/001-200 に200枚、201-400 に61枚(201〜261)の単体画像があり、さらに45枚の *_grid.jpg(番号 217〜261)が存在します。SKILL.md 内の Windows 絶対パス(E:\handraw-style\…)はリポジトリ内の実際の相対パスと異なっており、作成者固有のローカルパス設定となっています。

2コア機能

01001〜261の番号 → バイリンガルプロンプト変換(中国語は「风格名称:#编号 · 生图名。」、英語は「Style name: …」で開始し、参照作者/スタイル名タグを付与)
02オフライン対応の番号別ギャラリー:単一HTMLファイルで構成され、番号/スタイル名/元参照名で絞り込み可能。画像はリポジトリ内の結合画像をリンク
03モデル能力に応じた参照画像戦略(name+style → name+style+traits → reference-image の3段階 + unknown 時の安全な画像送信フォールバック)
04参照画像隔離テキスト(中英バイリンガル)の強制挿入により、参照画像の内容がテーマを固定化するのを防止
05決定論的なCLIドラフト生成:prompt_style.py により番号+テーマから4段落のバイリンガルプロンプトを直接出力(ローカルで単独実行可能な唯一のCLI)
06インデックス再構築と不変条件の検証スクリプト:build_library.py(styles.json とギャラリーを出力)および validate_library.py(番号連続性、018マッピング、deceasedの出典必須、能力値のドメイン、unknownモデル時の画像必須を検証)
07初回呼び出し時のローカルギャラリー自動起動(ホストMCPブラウザ経由)によるセッション初期化、失敗時のローカルリンク提示フォールバック
08ネガティブ特徴のフィルタリング:traits 使用時に視覚的にポジティブな特徴のみを保持し、「回避/不要/禁止」等の表現を含む文節を除外

3外部依存関係

KindDependency / Endpoint
api宿主 MCP 工具 mcp__codex_app__open_in_codex(在 Codex 应用内浏览器打开本地 file:// 画廊;skill 自身不含网络调用)
api外部图像生成工具(由宿主/用户提供;传参考图时使用其 referenced_image_paths 参数)——skill 只产出提示词与路径建议,不调用任何图像 API
clipython3(运行 build_library.py / prompt_style.py;split_contact_sheets.py 另需 Pillow/PIL)
packagePillow(PIL)——仅 split_contact_sheets.py 用于切分拼图为编号单图;非运行提示词所需

4推奨統制措置と判定根拠

安全運用のための推奨統制措置
Agent 向け
段階的・都度認可、サンドボックス推奨
管理者向け
承認フロー、ロールバック可能、全履歴監査
判定根拠(ファイルパスと抜粋)
  • scripts/: ローカルスクリプトまたはコマンドの実行: scripts/build_library.py(styles.json および gallery/index.html を再構築 — references/ への書き込み
  • 本地工作目录: ファイルの読み書きおよび成果物の出力: build_library.py は handdraw-style-prompter/references/styles.json および handd
監査ノート: 実体はMarkdown指示書+ローカルPythonツールです。ネットワーク通信や認証情報の読み込みは行わず、ファイル書き込みもリポジトリ自体の生成物(styles.json、gallery/index.html、分割画像)に限定されています。外部との対話は、ホストMCPがアプリ内ブラウザでローカル file:// ギャラリーを開く処理と、外部画像ツールへパスを引き渡す処理のみです。実行可能スクリプトおよびローカル書き込みを含むため、GreenではなくBlue(ローカルツール/ローカル読み書きのみ)に分類されます。

5二重目の独立検証

  • [ok] style 索引与编号连续性 — styles.json 261 条,首条 001 Gemma Correll / Playful Deadpan Doodle,末条 261 OscarAI;validate_library.py 亦硬断言 [number] == 连续 001–261 且 018 必须映射 'Minimal Deadpan Dialogue Cartoon'。
  • [ok] 画廊离线自足 — gallery/index.html 中 http(s):// 字面量 0 命中,img/button data-src 全部为 ../../images/<sheet>.png 相对路径,无 CDN/字体/统计外链。
  • [discrepancy] SKILL.md 的 Utilities 命令可运行性 — `python scripts/resolve_reference.py --model <model> --style <number>` 实跑报 ModuleNotFoundError: No module named 'style_asset_paths'(脚本把仓库根 <repo>/scripts 插入 sys.path,但该目录与模块不存在,git ls-tree 全仓库无该文件)。同一缺失还被 split_contact_sheets.py 与 validate_library.py 引用(后者另需 contact_sheet_registry)。故 SKILL.md「Utilities」5 条命令中,仅 build_library.py 与 prompt_style.py 当前可运行;这是仓库在 pin commit 上的真实缺陷,非本报告的定位问题。
  • [ok] 模型能力清单的覆盖面 — model_capabilities.json 仅 gpt-image-2 一轮清单、123 条编号条目(strong 78 / none 45);未列编号走 resolve() 的 entry 继承 default(unknown + 传图),即保守回退。SKILL.md 第 12-19 行的三级决策与代码分支逐条对应(name+style / name+style+traits / reference-image)。
  • [ok] 「与作者名气无关」的声明与代码一致 — 决策只读 name_activation/traits_activation 两个字段,代码中不存在任何依赖 attribution.json(名气/在世状态)的分支;attribution 仅被 validate_library.py 用于「deceased 必须带 source」的完整性断言。
  • [discrepancy] 图片资产覆盖与文档一致性 — 实跑 find 统计:images/ 下 19 张分组拼图 + 单图 200 张(001–200 桶)+ 61 张(201–400 桶 = 201–261)+ 45 张 *_grid.jpg(编号 217–261),合计 325 个受控图片文件=git ls-files 中 images/ 的条目数。但 MANIFEST.md 的「已收录图片」只登记 16 张拼图(止于 G_201-216.png),且仍写「images/individual/201-400/201.png–217.png:201–217 的编号单图」「风格编号覆盖:001–217」「当前无缺失编号段」,README/SKILL.md 已按 001–261 描述。判定:MANIFEST.md 为滞后文档,能力面以 261 为准。
  • [discrepancy] 路径可移植性 — SKILL.md 第 21 行把参考图根写死为 `E:\handraw-style\images\individual\{bucket}\{number}.png`,第 37/40 行画廊链接为 `file:///E:/handraw-style/...`;这两处只在作者本机成立(本仓库实际位置为 <repo>/images/individual/...)。跨平台使用需按仓库根改写这三处。
  • [ok] 无网络外发与凭证读取 — 对 5 个脚本与 SKILL.md/agents/openai.yaml 扫描 http/fetch/requests/urllib/socket/api_key/token/secret:脚本侧 0 命中;SKILL.md 唯一外部动作为宿主 MCP 打开 file:// 本地文件与把路径交给图像工具。resolve_reference 的能力数据来自本地 JSON,不需要联网查询模型能力。

6結論

  • 極めてシンプルなユーザー体験:1つの番号に完全なスタイル定義(元参照名+生成名+主要特徴)が集約されており、付属のオフラインギャラリーで検索できるため、美術用語の知識がなくてもスタイル選定が可能です。
  • 厳格なプロンプト出力規律によるプロンプト肥大化の防止:スタイルの修飾詞、構図の提案、品質強調ワード、ネガティブプロンプトの追加を禁止し、主題の描写のみに集中させます。
  • 「参照画像を送信すべきか」をデータに基づき決定論的に判断し、未知のモデルでは感覚に頼らず保守的に画像送信を選択します。
  • 画像送信時に参照画像隔離テキストを必須とし、テーマがコンテンツの唯一のソースであることを明示することで、画像生成特有の「元画像コンテンツの意図せぬ引き継ぎ」を防止します。
  • 完全で再構築可能なデータ資産:編集済みの261件のスタイル特徴、261枚の番号付き単体画像、45枚の4分割参照画像が同梱され、再構築/検証スクリプト(連続性、deceasedの出典、能力値ドメイン等の検証ルール)も完備しています。
  • 最適な用途: スタイルを番号で一元管理し、安定したバイリンガルプロンプトを出力したいコンテンツクリエイター(SNS、動画、ブランド制作など);mcp__codex_app__open_in_codex を利用可能な Codex 環境のユーザー(初回ギャラリー起動を活用可能);「スタイルライブラリのデータ化+モデル能力リストに基づく参照画像戦略」の構成を研究したいスキル開発者。
    不向きな用途: 導入後すぐに自動検証パイプラインを実行したい環境(Utilities 内の3つのコマンドは現在モジュール欠落のため実行不可、ルート scripts/ の整備が必要);ハードコードされた Windows 絶対パスの変更を望まない非 Windows ユーザー;明確なオープンソースライセンスを必須とする商用利用(LICENSE ファイルなし);プロンプトだけでなく画像そのものの直接生成を期待するユーザー(デフォルトはプロンプト出力のみ、生成には外部ツールが必要);Codex 以外の環境でギャラリーの自動起動を期待するユーザー。
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload handdraw-style-prompter.tar.gz
    sha256: b025e1b5b2a3616d…
    Option B · Copy Guide for Agent
    install.json
    Agent はこの JSON ガイドから自動的にダウンロードして検証します。
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 70bf51d6b4.