はじめに
良いリクエストの書き方
Codexeのリクエストに入れるべき内容を、プラグイン、MOD、データパック、ボット、ウェブサイトの良い例と悪い例とともに紹介します。
更新日
結果の品質を左右するいちばん大きな要素はリクエストです。AIは読み取れるものしか作れないので、長いリクエストより具体的なリクエストのほうが良い結果になります。
#入れるべき内容
- プラットフォームとバージョン。「Paper 1.21.4」「1.20.1向けのFabric」「1.21.1向けのデータパック」「discord.py」など。
- 動作。何が起きるかを順に書きます。うまくいかなかったときに何が起きるかも含めます。
- コマンドと引数。
/home <name>、誰が実行できるか、表示されるメッセージ。 - 権限。ノード名とデフォルト値。
- 設定。サーバーのオーナーが変更できるようにすべき項目。
- 保存方法。メモリ、YAMLファイル、SQLite、MySQLのどれか、そして再起動後も残るかどうか。
- 連携。Vault、PlaceholderAPI、LuckPerms、WorldGuard。名前をはっきり書いてください。
- UI。チャットメッセージ、GUI(インベントリのメニュー)、スコアボード、ボスバー。
- エッジケース。オフラインのプレイヤー、満杯のインベントリ、無効化されたワールド、リロード。
#悪い例と良い例
悪い例: make a factions plugin
良い例:
A Paper 1.21.x factions plugin.
- /f create <name>, /f invite <player>, /f join <name>, /f leave, /f disband (owner only).
- Max 10 members per faction (configurable).
- Chunk claiming with /f claim and /f unclaim; claimed chunks block building by non-members.
- Faction power: +1 per online member, claims limited to power x 2.
- Data saved to SQLite, loaded on startup.
- Vault economy: creating a faction costs 1000 (configurable).
- Permissions: factions.use (default true), factions.admin (op) for /f admin bypass.悪い例: a mod with new swords
良い例:
A Fabric mod for Minecraft 1.20.1.
- Adds three swords: Ember Blade (sets targets on fire for 3s), Frost Edge (Slowness II for 2s), Void Cutter (5% chance to teleport the target 8 blocks).
- Crafting recipes using blaze rods, packed ice and ender pearls with a netherite sword.
- English lang file and item models (textures can be placeholders).
- No client-only code on the server side.悪い例: custom recipes
良い例:
A datapack for Minecraft 1.21.1.
- Shaped recipe: 8 rotten flesh around a leather = 1 leather.
- Shapeless recipe: 9 nether wart = 1 nether wart block, and the reverse.
- A function that runs every tick and gives Speed I to players standing on gold blocks.悪い例: moderation bot
良い例:
A discord.py bot with slash commands.
- /warn <user> <reason>: stores warnings in SQLite, DMs the user.
- /warnings <user>: lists warnings with dates.
- /timeout <user> <minutes> <reason>: applies a Discord timeout; only for members with Moderate Members.
- Logs every action to a channel set with /setlog.
- Token read from an environment variable.#大きなプロジェクト: 段階的に作る
50個もの機能を並べた仕様を1つのリクエストに貼り付けないでください。まず中核(データモデル、主なコマンド)から始めてCodexeに検証させ、そのあと追加のメッセージで機能を足していきます。1ステップずつ小さく、安く、検証済みで、修正もしやすくなります。
#プロンプトを強化
作成(プロジェクトの作成)にあるプロンプトを強化ボタンは、大まかなリクエストをより完全なものに書き直します。料金は一律5,000トークンです。生成する前に、強化されたテキストを必ず読んでください。望まない詳細が勝手に補われていることがあります。
#望まないことも書く
「データベースは使わず、すべてconfig.ymlに入れる」「NMSは使わない」「外部の依存関係なし」。制約を書いておけば、使えないものをAIが選ぶのを防げます。