PDL-Standard 是做什麼的?
一個 Codex 技能,讓你能在 AI 行動前,透過可讀的虛擬碼確認它理解了什麼,以及它打算如何回應。
這是什麼?
PDL(規劃描述語言)是一種輕量級虛擬碼標準,AI 助理可用來向使用者展示其理解與計畫。它會在使用者批准之前,明確解釋 AI 打算做什麼以及為何這麼做。
為什麼有用?
通常,AI 助理在沒有先確認使用者的意圖時,就可能會修改檔案或執行命令。PDL 透過要求核准來防止誤解和意外動作。
支援的平台
- Codex CLI:原生支援
- VS Code Codex 擴充功能:相容
運作方式
當 PDL Std(標準)技能啟用後,AI 會在執行動作前輸出一個 PDL 區塊。該區塊看起來像這樣:
plan "Explain the feature" {
step "Read the codebase" {
action read
path "src/"
}
step "Generate a summary" {
action write
path "FEATURE.md"
}
}
區塊結構
plan:用於分組步驟的容器。step:一個包含特定action的邏輯單元。action:AI 試圖進行的操作(例如read、write、run)。
如何啟用
若要啟用此技能,請在你的 ~/.codex/skills.json 或專案的 skills.json 檔案中加入以下內容:
{
"skills": [
{
"source": "paragon-ux/PDL-Standard",
"settings": {}
}
]
}
範例
使用者: 在 src/main.js 中新增一個記錄檔功能。
AI 的回應(使用 PDL):
plan "Add logging feature" {
step "Read main.js" {
action read
path "src/main.js"
}
step "Add logging statement" {
action write
path "src/main.js"
description "Add console.log at the start of the main function."
}
}
授權條款
MIT