新手入門
如何寫出好的需求
Codexe 的需求應該包含什麼,並附上插件、模組、資料包、機器人和網站的好壞範例。
更新於
需求是影響成果品質最大的單一因素。AI 只能做出它推斷得出來的東西,所以具體的需求勝過冗長的需求。
#應該包含什麼
- 平台和版本。 「Paper 1.21.4」、「適用 1.20.1 的 Fabric」、「1.21.1 的資料包」、「discord.py」。
- 行為。 一步一步會發生什麼,包括出錯時會發生什麼。
- 指令和參數。
/home <name>、誰可以執行,以及顯示的訊息。 - 權限。 權限節點名稱和預設值。
- 設定。 伺服器管理員應該能更改哪些東西。
- 儲存。 存在記憶體、YAML 檔案、SQLite 還是 MySQL,以及重新啟動後是否保留。
- 整合。 Vault、PlaceholderAPI、LuckPerms、WorldGuard。請明確寫出名稱。
- 介面。 聊天訊息、GUI(物品欄選單)、計分板、Boss 血條。
- 邊界情況。 離線玩家、物品欄已滿、停用的世界、重新載入。
#不好的寫法與更好的寫法
不好: 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.#大型專案:分步驟打造
不要把一份有五十個功能的規格書全部貼進同一個需求裡。先從核心開始(資料模型、主要指令),讓 Codexe 驗證它,再用後續訊息加入功能。每一步都更小、更便宜、經過驗證,也更容易修正。
#優化
在建立頁面上(建立專案),優化按鈕會把粗略的需求改寫成更完整的版本。它的費用固定是 5,000 個 token。產生之前一定要先讀過優化後的文字:它可能會假設一些你不想要的細節。
#說出你不想要的東西
「不要資料庫,所有東西都放在 config.yml」、「不要用 NMS」、「不要外部相依套件」。限制條件能防止 AI 選擇你無法使用的東西。