360 Secure SkillHub
360 安全技能中心

pdd-prompting

面向 PDD 项目的开发指南:先编写模块 .prompt.md,再编写 Story 与测试用例,并用 pdd lint/test/simulate 校验行为;包含评审、自动校验和提示词规则。

分类:开发
promptdriven
热度 0.00
最近更新 2026-11-22 23:54:55

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add promptdriven/pdd/pdd-prompting
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
pdd-prompting
description
The PDD Prompting guide. Use when you write, change or review a module prompt (*.prompt.md), a Story or test cases, when the person asks how to write prompts in PDD, or asks to set up real behavior verification for a repository. In PDD, prompts are the source and code follows them.
metadata
{"pdd-skills":"0.1.42"}

PDD prompting

Each module's .prompt.md is the source; code implements it.

Core rules

  • Read RUNBOOK.md first, guide.md in full, and story-guide.md; skip runbook/*.md chapters unless pointed there.
  • Finish Prompt Space (pdd lint --local -> passing pdd test) before code; change no code and start no pdd simulate unless asked.
  • One plain-Markdown prompt per module (no Runtime interface): purpose, ## Domain decisions and failure edges. Give each rule one owner prompt. For a CLI, say if a rule belongs to the whole-CLI prompt or to one module's prompt.
  • Inject outside effects (DB, files, net, clock, RNG, IDs) via inputs or <port>.<op> ports; never use prose counters or link kind: native-only adapters under ## Dependencies (RUNBOOK §21).
  • Interactive UI uses one plain-prose .prompt.md (render + handle_event, inline <style>, data-pdd-op, zero app-map.json); add compact app-map.json for timers, routing or external CSS, and .ui.svg only if asked (RUNBOOK §13).
  • Keep native Short JSON in scenario files (seeds + $use/patch, set for null for parallel steps; chain $step/world only for persistence; 1 check per claim); never copy code output.
  • Show prompt, Story and cases first. Record actual chat approval with --said (RUNBOOK §2), never invent it.
  • Do not run pdd lint right before pdd test; pdd test includes whole-program lint. Report only real output.

Files

  • RUNBOOK.md: concise topic router and core commands.
  • guide.md, story-guide.md: prompting and Story rules.
  • review.md, verification-setup.md, verification-recipe.md, autopilot-job-rules.md: check, code and Autopilot references.

How to write

  1. Name applicable guide.md rules and find the owning prompt.
  2. Write or change the prompt. Use 0 Stories + "No Story:" for internal changes, edit the existing Story, or write 1 cohesive standalone-loop Story in the person's words, with no function calls or type names.
  3. Derive normal, limit and error cases (<= 15 steps; align simulation_overrides ports) and run pdd files + pdd lint --local.
  4. Show drafts and open choices.
  5. After changing prompt, Story and tests, run pdd test as RUNBOOK.md says, and show the person the Prompt tests line(s) and the report link(s). Offer pdd simulate STORY. If a check fails, show it; never change the expected value yourself.

Without prompts, use code, callers and tests as evidence. Change no code until asked.

Workflow skills: pdd-small-change, pdd-bug, pdd-feature and pdd-product.