build-game-inventory
できること
このスキルは、ゲームのアイテムと装備のシステムを作る作業をエージェントに案内します。拾得、装備、入れ替えが、アイテムを失ったり複製したりせずに毎回動く必要がある、ゲーム開発者向けです。
使う場面
- ✓ゲームに、アイテム、戦利品、スタック、装備スロットが必要なとき。
- ✓ドラッグ、入れ替え、装備でアイテムを決して失ってはならないとき。
- ✓保存済みのゲームのインベントリデータを、バージョン間で安全に移行する必要があるとき。
スキルのリンク
https://github.com/MengTo/Skills/blob/main/agent-skills/game-development/build-game-inventory/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“装備スロットとドラッグ&ドロップの入れ替えがあるインベントリを私のゲームに追加し、アイテムが失われないようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、型付きのアイテム一覧を一つ保ち、何かを変える前にすべての移動を確認し、各変更を一度だけ確定します。有効な結果を保存し、アイテムの消失、満杯のインベントリ、繰り返し操作を試験します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Build Game Inventory
Use one typed, serializable item source of truth and make every transfer atomic.
Define the item contract
Model stable IDs, item definitions, ownership, stack limits, equipment compatibility, effects, rarity, presentation data, and migration version separately. Runtime UI must reference definitions by ID rather than duplicate stats or descriptions.
Implement transfers as transactions
For pickup, equip, unequip, swap, drag/drop, consume, and sell:
- Validate source ownership and destination legality.
- Compute the entire next inventory/equipment state.
- Commit once or reject without changing either side.
- Persist only after the committed state is valid.
Never remove an item before confirming a legal destination. Preserve item identity across a swap and prevent duplicate effect registration.
Build usable UI
Expose slot compatibility, equipped state, quantity, tooltip facts, and failure feedback. Support keyboard and touch alternatives to drag-only interactions. Keep focus behavior, dialogs, and tooltips accessible.
Test loss boundaries
Cover invalid destinations, full inventory, duplicate pickup, equip swap, mid-action swap, save/load, schema migration, reset/new game, tooltip updates, and repeated dispatch. Validate that total owned item identity is conserved except for explicit consumption or reward rules.
よくある質問
許可されない移動の場合はどうなりますか?
両方の側を変えずに移動を拒否するとスキルで定められています。そのためアイテムは失われません。
アイテムを動かす方法はドラッグ&ドロップだけですか?
いいえ。スキルは、キーボードとタッチの代替操作も必要としています。
セーブはどう扱われますか?
保存されたインベントリデータにはバージョンが付き、古いセーブの移行も扱われます。
詳細
作者による元の説明
Build or repair game inventory, loot, equipment, tooltips, drag-and-drop, persistence, and progression systems. Use for item schemas, pickup flows, stack rules, equipment slots, atomic swaps, save migration, and no-loss regression testing.
repo: MengTo/Skills
人気
- GitHubのスター
- 7.2k
- ランキング
- #13355
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
3d-cloth-material
7.2kThree.js で、糸の織り、柔らかい光沢、自然な襞、裾、縫い目を持つ、本物の織物らしい布を作るようエージェントを支援します。
3d-falling-leaves
7.2k3D のシーンに、回転し、風に流され、カメラの動きに合わせて再利用される、本物らしい落ち葉を加えるようエージェントを支援します。
3d-four-seasons
7.2k3D のシーンに、春、夏、秋、冬の見た目を加え、シーン全体を作り直さずに、茂み、光、空、雪を変えるようエージェントを支援します。
3d-high-poly-models
7.2k滑らかな形と自然な縁をもつ、詳細な3Dモデルを作り、その後、Web で快適に動く軽いバージョンを準備するようエージェントを支援します。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。