dsh-vrc-unity-supporter 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-vrc-unity-supporter contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,128 @@
1
- # Temporary Holding Version
1
+ # dsh-vrc-unity-supporter
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ DeepSeek Harness のエージェントプリセット。**VRChat アバターの改変を AI に任せる**ためのものです。
4
+
5
+ 土台を作る道具ではありません。Unity と VCC/ALCOM が入っていて、VRChat プロジェクトが
6
+ 開ける状態の人を対象にしています。
7
+
8
+ ## これがやること
9
+
10
+ ```
11
+ 読む(Unity不要) → 設計 → C# を書く → バッチ適用 → 検証 → git 差分
12
+ ```
13
+
14
+ 1. **読む** — シーン・プレハブ・`.meta` を解析し、階層・コンポーネント・参照切れを Unity を開かずに報告する
15
+ 2. **設計** — 衣装・髪・トグル・メニュー・SPS・最適化の進め方を、実行順序(MA → VRCFury → AAO)を踏まえて組み立てる
16
+ 3. **適用** — 改変を Editor スクリプトとして書き、バッチモードで Unity に適用する
17
+ 4. **検証** — コンパイル・パフォーマンス試算・非アップロード検証を行い、結果を報告する
18
+
19
+ シーン/プレハブの YAML を直接書き換えることはありません。変更は必ず Unity 経由で、
20
+ `git diff` で全部レビューできます。
21
+
22
+ ## 前提
23
+
24
+ | 必要 | 確認 |
25
+ |---|---|
26
+ | Unity 2022.3.22f1(VRChat 対応版) | `tools/doctor.ps1` |
27
+ | 有効な Unity ライセンス | 同上(無効だとバッチモードが動きません) |
28
+ | VCC または ALCOM | どちらか一方で可 |
29
+ | VRChat プロジェクト(SDK 導入済み) | 同上 |
30
+ | `vrc-get` CLI(**任意**) | あるとパッケージ操作を自動化。無ければ GUI 手順を提示します |
31
+
32
+ ## インストール
33
+
34
+ ### 1. npm(推奨)
35
+
36
+ ```
37
+ plugin_manager install_bundle target: "dsh-vrc-unity-supporter"
38
+ ```
39
+
40
+ または **Plugins** 画面でパッケージ名を入力。更新は Update ボタンから。
41
+
42
+ ### 2. GitHub
43
+
44
+ ```
45
+ plugin_manager install_bundle target: "https://github.com/<owner>/dsh-vrc-unity-supporter"
46
+ ```
47
+
48
+ ### 3. clone
49
+
50
+ ```powershell
51
+ git clone https://github.com/<owner>/dsh-vrc-unity-supporter
52
+ ```
53
+
54
+ **Plugins** > **Add plugin** でそのディレクトリを指定。
55
+
56
+ インストール後、**新しいセッション**を作り、プリセットで `VRChat Avatar` を選んでください。
57
+ 既存のセッションには反映されません。
58
+
59
+ ## プロジェクトへの初期配置
60
+
61
+ プリセットはプロジェクトの中に 3 つ置くものがあります。初回だけコピーしてください。
62
+
63
+ ```
64
+ templates/Editor/*.cs -> <Project>/Assets/DSH/Editor/
65
+ templates/gitignore.template -> <Project>/.gitignore
66
+ templates/AGENTS.template.md -> <Project>/AGENTS.md
67
+ ```
68
+
69
+ `Assets/DSH/Editor/` が無いとバッチモードから `-executeMethod` を呼べません。
70
+ `AGENTS.md` はセッション開始時に読まれ、アバター名・導入済みパッケージ・性能予算を
71
+ エージェントに伝えます(分かる範囲で埋めてください)。
72
+
73
+ ## 最初に試す
74
+
75
+ ```
76
+ このプロジェクトのアバター構成を調べて
77
+ ```
78
+
79
+ ```
80
+ Outfit_Hoodie をメニューから切り替えられるようにして。排他は outfit タグで
81
+ ```
82
+
83
+ ```
84
+ いまの三角形数とマテリアル数から、PC のパフォーマンスランクを試算して
85
+ ```
86
+
87
+ ## やらないこと
88
+
89
+ - Unity / ALCOM / VCC のインストール、ライセンス設定
90
+ - プロジェクトの新規作成・修復
91
+ - ワールド制作(World SDK / UdonSharp / ライティング)
92
+ - **アップロード**(チェックリストを出します。実行は人間が行ってください)
93
+ - アセットのリッピングや VRChat ToS に反する操作
94
+
95
+ ## 仕組み(なぜ YAML を触らないのか)
96
+
97
+ シーンやプレハブの YAML を直接編集すると、GUID と参照が壊れて復旧が難しくなります。
98
+ このプリセットは代わりに **Editor スクリプトを生成して Unity に適用させます**。
99
+
100
+ - 改変がコードとして残る(手作業の順序に依存しない)
101
+ - 失敗したら script ごと revert できる
102
+ - `git diff` で何が変わったか全部見える
103
+
104
+ そのため **git 管理されていることを前提**にしています。管理されていない場合は、
105
+ 最初に `git init` を提案します(勝手には行いません)。
106
+
107
+ ## 公開(メンテナ向け)
108
+
109
+ ```powershell
110
+ npm login
111
+ gh auth login
112
+ powershell -NoProfile -ExecutionPolicy Bypass -File tools\publish.ps1
113
+ ```
114
+
115
+ `publish.ps1` は次を順に実行し、前提が欠けていれば**何も壊さずに止まります**。
116
+
117
+ 1. `verify-package.ps1`(BOM / スキル名 / JSON / `dsh.bundle.patch`)
118
+ 2. `npm pack --dry-run` で同梱内容を確認
119
+ 3. npm / gh の認証確認(未ログインなら実行すべきコマンドを表示して終了)
120
+ 4. `npm publish --access public`(同じ版が既にあれば skip)
121
+ 5. `gh repo create ... --push`、`git tag`、タグ push
122
+
123
+ `-DryRun` を付けると 4 以降を実行せず、何をするかだけ表示します。
124
+
125
+ ## ライセンス
126
+
127
+ MIT。サードパーティの扱いは [THIRD-PARTY.md](THIRD-PARTY.md) を参照してください。
128
+ 本パッケージは VRChat Inc. / Unity Technologies / 各 VPM パッケージ作者とは無関係です。
package/THIRD-PARTY.md ADDED
@@ -0,0 +1,28 @@
1
+ # Third-party notices
2
+
3
+ `dsh-vrc-unity-supporter` ships **no third-party code, binaries, or assets**.
4
+ Everything in this package is original and MIT licensed (see `LICENSE`).
5
+
6
+ ## Not redistributed here
7
+
8
+ The preset drives tools that each user installs and licences themselves. None of
9
+ them are bundled, vendored, or copied into this package:
10
+
11
+ | Component | Licence | How the user obtains it |
12
+ |---|---|---|
13
+ | Unity Editor 2022.3.22f1 | Unity licence | Unity Hub |
14
+ | VRChat SDK (Base / Avatars) | VRChat SDK licence | VCC or ALCOM |
15
+ | Modular Avatar / NDMF | MIT | VPM (`vpm.nadena.dev`) |
16
+ | VRCFury | MIT | VPM (`vcc.vrcfury.com`) |
17
+ | Avatar Optimizer (AAO) | MIT | VPM (`vpm.anatawa12.com`) |
18
+ | lilToon | MIT | VPM (`lilxyzw.github.io`) |
19
+ | TexTransTool | MIT | VPM (`vpm.rs64.net`) |
20
+ | `vrc-get` (optional) | MIT | winget, scoop, or cargo |
21
+
22
+ Avatar, outfit, and hair assets are the user's own purchases and are never
23
+ distributed with this package.
24
+
25
+ ## Naming
26
+
27
+ This package is not affiliated with VRChat Inc., Unity Technologies, or any VPM
28
+ package author. VRChat and Unity are trademarks of their respective owners.
@@ -0,0 +1,92 @@
1
+ # dsh-vrc-unity-supporter
2
+ #
3
+ # One agent preset for VRChat avatar modification. Configuration-only bundle:
4
+ # it carries no runtime JavaScript, only this patch layer, its locale files,
5
+ # icon, skills, tools and templates.
6
+ #
7
+ # Scope: avatar modification in an existing Unity 2022.3.22f1 VRChat project.
8
+ # Out of scope: installing Unity, creating or repairing projects, world
9
+ # creation, and uploading (a human does that).
10
+
11
+ - insert:
12
+ - id: preset-vrc-unity
13
+ name: '@deepseek-ai/dsh-agent-preset'
14
+ config:
15
+ id: vrc-unity
16
+ name: VRChat Avatar
17
+ description: VRChat アバター改変を、読む→設計→C#で適用→検証まで任せる
18
+ order: 5
19
+ plugins:
20
+ - id: persona
21
+ name: '@deepseek-ai/dsh-persona'
22
+ config:
23
+ prefix: |
24
+ You are a VRChat avatar modification engineer working inside an existing Unity 2022.3.22f1 project. The user already has Unity, an activated licence, and VCC or ALCOM; the project already opens as a VRChat project.
25
+
26
+ Scope: avatar modification only — outfits, hair, toggles, menus, PhysBones, contacts/SPS, materials and shaders, optimisation, and verifying the result. Out of scope: installing or repairing Unity and its tooling, creating or repairing projects, world creation, and uploading. Say so plainly when asked for those.
27
+
28
+ Apply every change by writing a Unity Editor script and running it in batch mode with the project's tools. Never edit scene, prefab or asset YAML directly, and never move or delete a file without its .meta. Keep each change reviewable as a git diff, and stop before any destructive step the user has not approved.
29
+
30
+ Never upload, publish, or force-push. When the user asks to upload, produce the pre-upload checklist instead.
31
+
32
+ Answer in Japanese unless the user writes in another language.
33
+ - id: agent-instructions
34
+ name: '@deepseek-ai/dsh-agent-instructions'
35
+ config:
36
+ maxBytes: 65536
37
+ - id: time-context
38
+ name: '@deepseek-ai/dsh-time-context'
39
+ - id: tool-bash
40
+ name: '@deepseek-ai/dsh-tool-bash'
41
+ disabled: !!js process.platform === 'win32'
42
+ - id: tool-pwsh
43
+ name: '@deepseek-ai/dsh-tool-pwsh'
44
+ disabled: !!js process.platform !== 'win32'
45
+ - id: tool-fs
46
+ name: '@deepseek-ai/dsh-tool-fs'
47
+ config:
48
+ applyPatch: false
49
+ - id: tool-fs-search
50
+ name: '@deepseek-ai/dsh-tool-fs-search'
51
+ config:
52
+ sampleOverCapGlobResults: false
53
+ - id: tool-jobs
54
+ name: '@deepseek-ai/dsh-tool-jobs'
55
+ - id: skill-filesystem
56
+ name: '@deepseek-ai/dsh-skill-filesystem'
57
+ config:
58
+ customSkillDirs:
59
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('dsh-vrc-unity-supporter/package.json')), 'skills')
60
+ - id: tool-skill
61
+ name: '@deepseek-ai/dsh-tool-skill'
62
+ - id: tool-todo
63
+ name: '@deepseek-ai/dsh-tool-todo'
64
+ config:
65
+ allowParallelInProgress: true
66
+ - id: tool-ask-user
67
+ name: '@deepseek-ai/dsh-tool-ask-user'
68
+ - id: tool-web
69
+ name: '@deepseek-ai/dsh-tool-web'
70
+ config:
71
+ fetch: true
72
+ searchTimeoutMs: 60000
73
+ - id: planning
74
+ name: cordis:group
75
+ group: true
76
+ isolate:
77
+ planMode: true
78
+ config:
79
+ - id: plan-mode
80
+ name: '@deepseek-ai/dsh-plan-mode'
81
+ - id: compaction
82
+ name: cordis:group
83
+ group: true
84
+ isolate:
85
+ compaction: true
86
+ config:
87
+ - id: compaction-basic
88
+ name: '@deepseek-ai/dsh-compaction-basic'
89
+ - id: command-compact
90
+ name: '@deepseek-ai/dsh-command-compact'
91
+ - id: present
92
+ name: '@deepseek-ai/dsh-tool-present'
@@ -0,0 +1 @@
1
+ ![プロジェクトを開かずに階層を読み、Editor スクリプトを生成して検証まで行う流れ](preview.svg)
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![Offline read of the hierarchy, a generated Editor script, and a verified result](preview.svg)
@@ -0,0 +1,61 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300" role="img" aria-label="Offline read, designed change, applied by an Editor script, verified in batch mode">
2
+ <defs>
3
+ <linearGradient id="card" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0" stop-color="#16223a"/>
5
+ <stop offset="1" stop-color="#0e1728"/>
6
+ </linearGradient>
7
+ <linearGradient id="flow" x1="0" y1="0" x2="1" y2="0">
8
+ <stop offset="0" stop-color="#4cc9f0"/>
9
+ <stop offset="1" stop-color="#7b7cf7"/>
10
+ </linearGradient>
11
+ </defs>
12
+ <rect x="0" y="0" width="640" height="300" rx="20" fill="url(#card)"/>
13
+ <rect x="0.5" y="0.5" width="639" height="299" rx="20" fill="none" stroke="#2b3f63"/>
14
+
15
+ <!-- hierarchy panel -->
16
+ <rect x="32" y="56" width="164" height="188" rx="12" fill="#0b1322" stroke="#2b3f63"/>
17
+ <g fill="#8fb6e8" opacity="0.9">
18
+ <rect x="48" y="76" width="96" height="9" rx="4.5"/>
19
+ <rect x="62" y="102" width="82" height="9" rx="4.5"/>
20
+ <rect x="76" y="128" width="68" height="9" rx="4.5"/>
21
+ <rect x="76" y="154" width="52" height="9" rx="4.5"/>
22
+ </g>
23
+ <rect x="62" y="176" width="122" height="46" rx="9" fill="#152a44" stroke="#4cc9f0" stroke-opacity="0.55"/>
24
+ <rect x="74" y="190" width="58" height="7" rx="3.5" fill="#4cc9f0" opacity="0.85"/>
25
+ <rect x="74" y="203" width="38" height="7" rx="3.5" fill="#4cc9f0" opacity="0.45"/>
26
+
27
+ <!-- flow arrows -->
28
+ <g stroke="url(#flow)" stroke-width="4" stroke-linecap="round" fill="none">
29
+ <path d="M212 150h44"/>
30
+ <path d="M248 142l10 8-10 8"/>
31
+ <path d="M300 150h44"/>
32
+ <path d="M336 142l10 8-10 8"/>
33
+ <path d="M388 150h44"/>
34
+ <path d="M424 142l10 8-10 8"/>
35
+ </g>
36
+
37
+ <!-- script card -->
38
+ <rect x="252" y="86" width="88" height="128" rx="12" fill="#0b1322" stroke="#2b3f63"/>
39
+ <g fill="#7b7cf7">
40
+ <rect x="266" y="104" width="46" height="7" rx="3.5" opacity="0.9"/>
41
+ <rect x="266" y="120" width="60" height="7" rx="3.5" opacity="0.6"/>
42
+ <rect x="272" y="136" width="48" height="7" rx="3.5" opacity="0.6"/>
43
+ <rect x="272" y="152" width="34" height="7" rx="3.5" opacity="0.35"/>
44
+ </g>
45
+ <circle cx="296" cy="186" r="12" fill="none" stroke="#4cc9f0" stroke-width="3"/>
46
+ <path d="M290 186l4 5 8-10" fill="none" stroke="#4cc9f0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
47
+
48
+ <!-- result panel -->
49
+ <rect x="444" y="56" width="164" height="188" rx="12" fill="#0b1322" stroke="#2b3f63"/>
50
+ <g stroke="#4cc9f0" stroke-width="3" fill="none" stroke-linecap="round">
51
+ <path d="M466 88l8 9 15-18"/>
52
+ </g>
53
+ <g fill="#8fb6e8" opacity="0.85">
54
+ <rect x="498" y="82" width="76" height="8" rx="4"/>
55
+ <rect x="466" y="116" width="108" height="8" rx="4" opacity="0.55"/>
56
+ <rect x="466" y="136" width="84" height="8" rx="4" opacity="0.55"/>
57
+ </g>
58
+ <rect x="466" y="164" width="120" height="10" rx="5" fill="#152a44"/>
59
+ <rect x="466" y="164" width="78" height="10" rx="5" fill="url(#flow)"/>
60
+ <circle cx="544" cy="169" r="9" fill="#0b1322" stroke="#4cc9f0" stroke-width="3"/>
61
+ </svg>
package/icon.svg ADDED
@@ -0,0 +1,27 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128" role="img" aria-label="VRChat avatar supporter">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#12203a"/>
5
+ <stop offset="1" stop-color="#0b1526"/>
6
+ </linearGradient>
7
+ <linearGradient id="accent" x1="0" y1="0" x2="1" y2="0">
8
+ <stop offset="0" stop-color="#4cc9f0"/>
9
+ <stop offset="1" stop-color="#7b7cf7"/>
10
+ </linearGradient>
11
+ </defs>
12
+ <rect x="4" y="4" width="120" height="120" rx="26" fill="url(#bg)"/>
13
+ <rect x="4" y="4" width="120" height="120" rx="26" fill="none" stroke="#2b3f63" stroke-width="2"/>
14
+ <g fill="none" stroke="url(#accent)" stroke-width="6" stroke-linecap="round">
15
+ <path d="M44 84c0-20 8-32 20-40 12 8 20 20 20 40"/>
16
+ <path d="M52 92h24"/>
17
+ </g>
18
+ <g fill="url(#accent)">
19
+ <circle cx="40" cy="100" r="7"/>
20
+ <circle cx="88" cy="100" r="7"/>
21
+ <rect x="58" y="70" width="12" height="12" rx="3"/>
22
+ </g>
23
+ <g stroke="#8fb6e8" stroke-width="4" stroke-linecap="round" opacity="0.85">
24
+ <path d="M40 100h12"/>
25
+ <path d="M76 100h12"/>
26
+ </g>
27
+ </svg>
package/locale/en.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "VRChat avatar supporter",
4
+ "description": "Lets the agent do VRChat avatar modification work: it reads scenes and prefabs without opening Unity, designs the change, applies it through generated Editor scripts in batch mode, and verifies the result. Assumes Unity 2022.3.22f1, an activated licence, and VCC or ALCOM, with a project that already opens as a VRChat project. It never uploads and never edits scene YAML directly.",
5
+ "detail": "docs/DETAIL.md"
6
+ }
7
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "VRChat アバター改変サポーター",
4
+ "description": "VRChat アバターの改変をエージェントに任せるプリセットです。Unity を開かずにシーン/プレハブを読み取り、改変を設計し、生成した Editor スクリプトをバッチモードで適用して検証します。Unity 2022.3.22f1・有効なライセンス・VCC または ALCOM が前提で、VRChat プロジェクトとして開ける状態から始めます。アップロードとシーン YAML の直接編集は行いません。",
5
+ "detail": "docs/DETAIL.ja.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "dsh-vrc-unity-supporter",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "DeepSeek Harness agent preset for VRChat avatar modification: read Unity projects without opening the editor, design the change, apply it through generated Editor scripts in batch mode, and verify the result.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "dsh",
9
+ "deepseek-harness",
10
+ "agent-preset",
11
+ "vrchat",
12
+ "unity",
13
+ "avatar",
14
+ "modular-avatar",
15
+ "vrcfury"
16
+ ],
17
+ "exports": {
18
+ "./package.json": "./package.json",
19
+ "./locale/*.json": "./locale/*.json",
20
+ "./icon": "./icon.svg"
21
+ },
22
+ "files": [
23
+ "cordis.patch.yml",
24
+ "locale/*.json",
25
+ "docs",
26
+ "icon.svg",
27
+ "skills",
28
+ "tools",
29
+ "templates",
30
+ "README.md",
31
+ "LICENSE",
32
+ "THIRD-PARTY.md"
33
+ ],
34
+ "dsh": {
35
+ "bundle": {
36
+ "patch": "./cordis.patch.yml"
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: unity-cli
3
+ description: Unity をバッチモードで動かす手順。エディタの解決、コマンド形、ログの読み方、Library ロックとライセンスの失敗、長時間処理をジョブで回す方法を扱う。スクリプトを適用・検証するときに下支えとして読む。
4
+ ---
5
+
6
+ # Unity バッチモード
7
+
8
+ `tools/unity-run.ps1` がこのスキルの内容を実装している。通常はランナーを呼ぶだけでよく、
9
+ このスキルは**失敗したときの読み方**のためにある。
10
+
11
+ ## 1. エディタの解決
12
+
13
+ Unity Hub は `C:\Program Files\Unity\Hub\Editor\<version>\Editor\Unity.exe` に置く。
14
+
15
+ 1. `<project>/ProjectSettings/ProjectVersion.txt` の `m_EditorVersion` を読む
16
+ 2. 上記パスを探す。無ければ Hub の別ドライブ(`%ProgramFiles%` 以外)も探す
17
+ 3. 見つからなければ**止まる**。勝手に別バージョンで開かない(プロジェクトが壊れる)
18
+
19
+ ## 2. コマンド形
20
+
21
+ ```powershell
22
+ & "<Unity.exe>" -batchmode -nographics -quit `
23
+ -projectPath "<project>" `
24
+ -executeMethod "<Namespace.Class.Method>" `
25
+ -logFile "<project>\.dsh\logs\<name>.log"
26
+ ```
27
+
28
+ | 引数 | 意味 |
29
+ |---|---|
30
+ | `-batchmode` | GUI 無し。スクリプトから実行する場合に必須 |
31
+ | `-nographics` | GPU 初期化をしない。重いアセットの描画確認には使えない |
32
+ | `-quit` | メソッド終了後に終了する(`EditorApplication.Exit` を書くなら不要な場合あり) |
33
+ | `-executeMethod` | 静的メソッドを 1 つ実行する |
34
+ | `-logFile` | ログの出力先。`-` で標準出力 |
35
+
36
+ ## 3. 終了コードとログ
37
+
38
+ | 終了コード | 意味 | 見る場所 |
39
+ |---|---|---|
40
+ | 0 | 成功 | 結果 JSON |
41
+ | 1 | 失敗(例外・コンパイルエラー・ライセンス) | ログの末尾 |
42
+ | その他 | Unity 自体の異常終了 | ログ全体 |
43
+
44
+ ログで探す文字列:
45
+
46
+ - `error CS` — コンパイルエラー(スクリプトの誤り)
47
+ - `Exception` / `NullReferenceException` — 実行時例外
48
+ - `No valid Unity Editor license found` — ライセンス未認証
49
+ - `Aborting batchmode due to failure` — 上記いずれかで中断
50
+
51
+ **最初の `error CS` だけ直して再実行**する。1 個直すと連鎖が消えることが多い。
52
+
53
+ ## 4. Library ロック
54
+
55
+ Unity がプロジェクトを開いている間は、別プロセスから同じプロジェクトを開けない。
56
+
57
+ 検出:
58
+
59
+ ```
60
+ <project>/Temp/UnityLockfile ← 存在すれば起動中
61
+ <project>/Library/EditorInstance.json ← pid が入る
62
+ ```
63
+
64
+ ランナーは検出したら**実行せずに終了**する。ユーザーに「Unity を閉じてください」と伝える。
65
+ 無理に消してはいけない(データ破損の原因)。
66
+
67
+ ## 5. ライセンス
68
+
69
+ バッチモードもライセンスを必要とする。未認証なら上のエラーで落ちる。
70
+ この場合 AI は何もできないので、**Unity Hub でサインインしてライセンスを有効化**するよう伝える。
71
+
72
+ ## 6. 長時間処理の扱い
73
+
74
+ アセットのインポートは数分かかることがある。同期で待たない。
75
+
76
+ ```powershell
77
+ # 悪い例: タイムアウトする
78
+ & unity-run.ps1 -Project ... -Method ...
79
+
80
+ # 良い例: ジョブで回してログを追う
81
+ ```
82
+
83
+ DSh のジョブ機能(`tool-jobs`)でバックグラウンド実行し、ログを tail する。
84
+ 初回起動は Library 生成で特に遅い。2 回目以降は速い。
85
+
86
+ ## 7. 初回だけ必要な準備
87
+
88
+ `templates/` から 3 つをプロジェクトへコピーする。
89
+
90
+ ```
91
+ templates/Editor/*.cs -> <project>/Assets/DSH/Editor/
92
+ templates/gitignore.template -> <project>/.gitignore
93
+ templates/AGENTS.template.md -> <project>/AGENTS.md
94
+ ```
95
+
96
+ `Editor` 配下でないと `-executeMethod` が「メソッドが見つからない」で失敗する。
97
+ `doctor.ps1` が配置も確認する。
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: vrc-asset-read
3
+ description: Unity プロジェクトを開かずに読む手順。.meta の GUID 索引、シーン/プレハブの階層、参照切れ、VRChat/MA/VRCFury/AAO コンポーネントの検出を unity_inspect.py で行う。アバターの構造把握や「なぜか動かない」の切り分けに使う。
4
+ ---
5
+
6
+ # プロジェクトを開かずに読む
7
+
8
+ `unity_inspect.py` は Unity を起動せず、`Assets/` と `Packages/` の YAML と `.meta` を読む。
9
+ 速く、Library ロックを取らず、Unity が起動中でも使える。
10
+
11
+ ## 0. ツールの場所
12
+
13
+ このスキルの 2 階層上がパッケージルート。
14
+
15
+ ```powershell
16
+ python <pkg>/tools/unity_inspect.py --help
17
+ ```
18
+
19
+ ## 1. まず全体像: `report`
20
+
21
+ ```powershell
22
+ python <pkg>/tools/unity_inspect.py report "C:\path\to\Project"
23
+ ```
24
+
25
+ 出力(`--json` で機械可読):
26
+
27
+ | 項目 | 意味 |
28
+ |---|---|
29
+ | `unity.version` | `ProjectVersion.txt` の版 |
30
+ | `vpm.packages` | 導入済み VPM パッケージ(3 形式をまとめて検出、下記) |
31
+ | `vpm.lock` | `vpm-lock.json` / `vpm-manifest.json` のどちらがあるか |
32
+ | `avatars` | `VRCAvatarDescriptor`(旧 SDK は `VRC_AvatarDescriptor`)を持つ prefab / シーン |
33
+ | `scripts.missing` | 解決できない `m_Script` GUID(**パッケージ不足の証拠**) |
34
+ | `meta.missing` | `.meta` が無いアセット(Unity が GUID を振り直す危険) |
35
+ | `git` | `.git` の有無 |
36
+
37
+ VPM の検出は 3 形式すべてを見る(クライアントによって書き方が違う):
38
+
39
+ 1. `Packages/manifest.json` の `dependencies` — VCC / ALCOM 2.x
40
+ 2. `Packages/vpm-manifest.json` の `dependencies` — 旧 vrc-get
41
+ 3. `Packages/<id>/package.json` — 埋め込みパッケージ(どちらのクライアントでも)
42
+
43
+ `scripts.missing` が空でないときは、依存パッケージが入っていない。
44
+ インストールを勝手に始めず、まず「何が足りないか」を報告する。
45
+
46
+ ## 2. 階層を見る: `hierarchy`
47
+
48
+ ```powershell
49
+ python <pkg>/tools/unity_inspect.py hierarchy "Assets\Avatar.prefab"
50
+ python <pkg>/tools/unity_inspect.py hierarchy "Assets\Avatar.prefab" --depth 0 # 参照解決なし
51
+ ```
52
+
53
+ 各ノードについて `m_Name`、`fileID`、コンポーネント(スクリプト名に解決できたもの)、
54
+ 有効/無効を出す。プレハブのインスタンスは元 prefab を解決して展開する(既定 `--depth 2`)。
55
+
56
+ **FBX モデルのインスタンスは展開できない。** アバターの prefab が `Salt.fbx` のような
57
+ モデル prefab のインスタンスになっている場合、ボーンとメッシュは FBX の中にあり YAML には
58
+ 現れない。その場合は `unity-cli` の `DshInspect.Dump`(バッチモード)を使う。
59
+
60
+ ## 3. 参照をたどる: `refs`
61
+
62
+ ```powershell
63
+ python <pkg>/tools/unity_inspect.py refs --guid 1a2b3c... --project "C:\path\to\Project"
64
+ ```
65
+
66
+ 「このアセットはどこから参照されているか」を返す。削除や移動の前に必ず使う。
67
+
68
+ ## 4. 索引を作る: `index`
69
+
70
+ ```powershell
71
+ python <pkg>/tools/unity_inspect.py index "C:\path\to\Project"
72
+ ```
73
+
74
+ `<project>/.dsh/guid-index.json` に GUID → パス の対応を書く。`hierarchy` と `refs` は
75
+ 索引があれば高速化される。`Packages/` も含めるので、VRChat SDK のスクリプト名も解決できる。
76
+
77
+ ## 5. この方法で分からないこと
78
+
79
+ | 分からない | 代わりに |
80
+ |---|---|
81
+ | FBX モデル内のボーン・メッシュ | `DshInspect.Dump`(バッチモード) |
82
+ | プレハブ override の最終的な値 | Unity で開く(`DshInspect.cs` のバッチダンプ) |
83
+ | 実際の三角形数・マテリアル数 | `vrc-perf-budget`(バッチダンプで計測) |
84
+ | アニメーターの実効状態・遷移 | `vrc-verify`(Gesture Manager など) |
85
+ | シェーダのコンパイルエラー | Unity のコンソール(バッチログ) |
86
+
87
+ 読み取りで足りないと分かったら、無理に推測せずバッチダンプに切り替える。
88
+
89
+ ## 6. 報告の作法
90
+
91
+ - 数値は必ず出典(どのファイル・どのコマンド)を添える
92
+ - 「参照切れ」を見つけたら、原因(パッケージ未導入 / アセット移動)を切り分けて書く
93
+ - 壊れた箇所を勝手に直さない。まず一覧を出して承認を取る