生活分享

提示词、规则与交接范本索引

依工作选择提示词、规则与交接范本,替换必要栏位并知道每段应贴到哪里。

阅读时间约 15 分钟 · 操作 20 分钟

原创流程示意图,非产品界面截图。
图片:Mokaair (© Mokaair)
回总目录:Codex 学习中心:完整教程目录

进阶 · Desktop / CLI / VS Code / JetBrains / cloud

本篇目录
  1. 目标与准备
  2. 步骤 1:建立范本库并分清用途
  3. 步骤 2:把需求改成可验收的任务
  4. 步骤 3:Bug 回报保留原始证据
  5. 步骤 4:分开审查与交接
  6. 步骤 5:规则范本与外部工具范本
  7. 常见错误、还原与小练习

目标与准备

本段提到的教学与资源: ·

步骤 1:建立范本库并分清用途

在自己的练习目录中建立 templates 资料夹,用编辑器新增下列档案。Windows 选另存新档时确认没有变成 .md.txt;macOS 使用纯文字格式;Linux 在熟悉的编辑器保存 UTF-8。三种系统都从练习根目录操作,档名保持一致。这个资料夹没有特殊载入效果,也不需要新增套件、登入其他网站或把范本放进全域设定。

要建立的资料夹与档案 · text
templates/
  task.md
  bug.md
  review.md
  handoff.md
  rules.example.md
  connection-check.md
需要完成的工作使用哪份范本不能取代什么
实作小功能task.md实际档案与验收
修可重现错误bug.md原始错误与重现
审查既有修改review.md测试与人工判读
交接长任务handoff.md最新 Git 状态
拟定专案规则rules.example.md正确位置的 AGENTS.md
检查外部工具connection-check.md真正的工具回应

步骤 2:把需求改成可验收的任务

templates/task.md · markdown
# Task
Goal: Verify the active-task filter and repair it only if the acceptance case fails.
Context: Use the complete reference copy in this practice folder.
Inspect first: index.html, app.js, core.mjs, style.css and core.test.mjs.
Scope: Only files needed for the filter and its focused tests.
Behavior: All shows every task; Active shows tasks whose completed value is false.
Preserve: Existing task IDs, titles, ordering and stored data format.
Acceptance: With three tasks (two complete), Active shows exactly one.
Boundary: An empty list shows a useful empty state and does not throw.
Validation: Run node --test core.test.mjs and verify the browser behavior; report actual results.
If the existing behavior passes, report that evidence without unnecessary edits.
Delivery: Explain changed behavior, tests actually run and remaining limitations.

这份填好的范例对应本系列的 Small Steps 练习,不是任何专案都能直接套用。先在自己的 expected 副本确认五份程式档存在;操作说明在下载包根目录的 README.md,不在 expected 里。其他专案则依自己的 README 核对验证指令。想先讨论可行性时,使用 并把交付改成「先提出步骤及待决定项目」。若已要实作,清楚写明可以修改的范围。

试著把「帮我整理一下网站」改写成这个格式。合格版本应说出改哪个画面、保留什么、用什么资料验收,以及本次是否包含上线。档案名称未知时可以写「先找出负责清单显示的档案再回报」,不要猜一个不存在的路径。自然语言可以使用你的习惯语言,范例中的程式识别码、路径与判断条件则保持原样。

步骤 3:Bug 回报保留原始证据

templates/bug.md · markdown
# Bug report
Environment: <OS, browser/runtime and version>
Practice folder or branch: <actual location>
Starting state: <fixture or steps to create it>
Reproduction:
1. <first action>
2. <next action>
Expected: <observable result>
Actual: <observed result>
Error: <exact message, with secrets removed>
Frequency: <always / intermittent / unknown>
Already tried: <one change and its result, or none>
Fix scope: <allowed behavior and files>
Verification: Reproduce first, fix, rerun the original case and a boundary case.

尖括号内容是待填栏位,不是直接贴给终端机的语法。以练习为例,写出「broken 副本,新增 Read 与 Build,只完成 Read,Completed 却显示 Build」,才能重现同一个错误。Actual 栏只记自己看到的结果;尚未操作就填 NOT RUN,不抄范例当实测。原因未确定时不预填「资料库坏了」;没有错误讯息可写 none observed,再补画面行为与步骤。

修完后把原始步骤重跑一次,再检查空资料或重复标题的边界。测试失败与尚未执行分开填;「预计应该通过」不是结果。若工具无法执行,交付限制及读者能自行重跑的命令即可,不能把范本中的 Verification 当作已完成工作。本篇不预填任何人的测试通过数,让下次使用时不会沿用旧证据。

步骤 4:分开审查与交接

templates/review.md · markdown
# Review request
Compare: <base branch or exact before-state> -> <current change>
Purpose: <user-visible behavior>
Read first: <requirements and relevant files>
Review for: correctness, regressions and missing meaningful tests.
For each finding: give the trigger, impact, file/location and suggested correction.
Evidence: <commands actually run, exit codes and relevant output>
Unknowns: <tests or environments not checked>
Report no findings if none are supported; do not invent issues to fill a quota.
Do not modify files in this review task unless I request a fix.
templates/handoff.md · markdown
# Handoff
Goal:
Working directory and branch:
Current commit:
Existing uncommitted changes and owners:
Completed work with evidence:
Pending work:
Decisions and constraints:
Files to inspect next:
Last command and result:
Known limitations:
Next smallest action:
Before continuing: verify the current files and Git state against this record.

Review 的比较起点要能在目前 Git 储存库解析;如果分支不存在,先查,不要默认 main 一定存在。交接范本则描述「目前在哪里」,每次交接重新读取状态。某人在旧任务说已提交,不代表这个工作目录干净;把尚未提交的修改与归属列出,接手者才不会覆写正在进行的工作。

交接文件可以存在专案内,但写入位置要先确认是否适合共享。私人客户资料、凭证、聊天全文通常不是交接所需;用路径、问题摘要和可验证结果足以带回上下文。档案仍然是提供给模型的资料,保存 handoff.md 不代表新任务一定读过;开始时明确请它阅读,并核对回复描述的下一步。完整恢复流程见。

步骤 5:规则范本与外部工具范本

templates/rules.example.md:规则草稿 · markdown
# Practice project rules
Read index.html, app.js, core.mjs and core.test.mjs before changing this practice app.
Preserve task IDs and the existing data format.
Keep changes within the requested behavior.
Run node --test core.test.mjs and report actual results.
Do not commit credentials or private practice data.
If required files are missing, report the missing paths before making assumptions.

rules.example.md 故意不叫 AGENTS.md,让它先作为待审核的范本。确认内容符合你的专案后,依 教学合并到正确层级;先读现有规则,保留其他人的条件,不要整档覆写。若只用于这次任务,就直接贴在任务要求中。只有常常重复、范围稳定的工作才值得做成 ,不用把所有临时提示词都安装成技能。

templates/connection-check.md · markdown
# Connection check
Surface / host / version:
Plugin or MCP server name and source:
Configured:
Authenticated (if required):
Tool available in a new task:
Read-only target (fictional or public):
Expected marker or source:
Actual tool call and result:
Original data unchanged:
Disconnect or disable action, if performed:
Retest after change:
Never include tokens, passwords or one-time login URLs in this report.

外部工具验收要依序填设定、认证、能力与实际呼叫,不适用的认证可填 not required,未查证的栏位填 not checked。不要把「有设定档」推论为连线正常;也不要预先填 true 让报告看起来完整。使用 或 时,一次只填你这次检查的那个入口与主机,同名伺服器在另一台电脑可能指向不同设定。

把互相冲突的范本改成一个任务

判读这段错误需求:「只读审查 expected,但顺便修好并提交;用 npm test 验证,回报三项全过」。它同时要求只读与改档、在没有 package.json 的教材套用错误命令,还预填未执行的结果。这次选择先做唯读确认,把下方完整版本另存为练习根目录的 adapted-task.md,保留六份原始空白范本。

任务副本:adapted-task.md · markdown
# Read-only practice check
Goal: Verify the existing Active-filter behavior in this expected copy.
Confirm the absolute working directory and the five expected source files first.
Read core.mjs and core.test.mjs; explain the filter condition and test coverage.
Run node --test core.test.mjs and report the actual exit code, passes and failures.
Do not edit, stage, commit, push or deploy anything in this task.
Browser behavior: NOT RUN unless actually checked; core tests do not prove it.
If required files are missing, report the paths and stop before guessing commands.
Delivery: observed evidence, unverified behavior and the next smallest step.

用干净 expected 副本执行时,核心测试的参考结果为 3 过 0 败;你仍要填本次输出,所有程式档保持不变。若拿到 broken 副本,应如实回报 2 过 1 败及起点不同,先修正路径或另立修复任务,不因范本说 expected 就忽略实际故障。这正是官方提示词建议中目标、背景、边界与可使用成果在本教材的具体运用。

常见错误、还原与小练习

第一种错误是保留未填的尖括号:送出前搜寻 <,逐个换成实际资讯或删掉不适用栏位。第二种是旧任务的命令套到新专案:先读 README 并确认工作目录。第三种是把范本写成互相冲突的规则,例如只读审查又要求顺便改档;选一个本次目标再提交。已存在同名范本时保存另一个副本或用 Git 看差异,回复只针对这次新写的范本,不撤回正式专案其他修改。

小练习:选 bug.md 填入一个你已观察到的练习错误,再选 handoff.md 交代下一步。把两份交给没有看过原任务的人阅读:对方应能找到正确资料夹、重现相同现象、知道哪些还没确认。若对方还必须猜你用哪台电脑或哪份资料,补那个栏位即可,不要加长所有范本。保留一份未填写的原始范本,每次另存任务副本,避免上次的结果变成下次的预设答案。

本篇档案与范例为原创教材,没有内建执行权限,也不会改动你的帐号。验收是六份可阅读的范本、一份填好的 Bug 回报与交接,以及至少一项被你找出的含糊条件;不要求模型回复特定句型。下一单元从 开始,把 connection-check.md 用在真实的唯读工具测试。

原创流程示意图,非产品界面截图。
原创流程示意图,非产品界面截图。 · 图片:Mokaair (© Mokaair)
阅读完整文字说明

Three numbered stages: identify the starting point, perform the exercise, and verify the result. Original illustration, not a product screenshot.

回总目录

  • 生活分享

    Codex 学习中心:完整教程目录

    从安装、第一个任务到 MD 规则与进阶集成,规划 60 篇 Codex 教程、十个单元。按程度、平台、需求或命令搜索下一篇;尚未公开的教程会标示状态,方便安排学习路线。

  • 生活分享

    Worktree 与多任务隔离

    Worktree 让同一个 Git 程式库有不同的工作目录,各自承接不同分支。它适合让两项工作分开改档,但资料库、连接埠与外部服务仍可能共用,不能把档案隔离当成所有资源隔离。

  • 生活分享

    实战:制作小网站

    从 brief.md 规划并制作 Small Steps 待办网站,完成新增、完成、删除、筛选与本机资料保存。将 HTML、CSS、资料函式、画面事件与测试分开,以 Node 测试和浏览器操作验收,并留下可重新启动与还原的交接纪录。

  • 生活分享

    用量与效率:减少重工

    记录任务条件、模型选项、时间与成果,找出能减少无效重试和过多上下文的调整。

最新旅游情报攻略

资料来源

生活分享