Context-Engineering-Intro-ZH: Command for Claude Code

.claude/commands/generate-prp.md

generate-prp is a command for Claude Code from sabernagato/Context-Engineering-Intro-ZH. It costs 0 tokens per session (661 once invoked), scanned A, original, MIT.

A command that researches a codebase and writes a Product Requirements Prompt (PRP), a detailed implementation brief for an AI coding agent. It includes existing code patterns, external references, an implementation plan, and checks for verifying the result.

In plain words
What is it for?
Use it to investigate a requested feature, document relevant files and research, create an ordered implementation blueprint, define validation commands, and save the brief as a PRP file.
Why use it?
It gathers the context an agent needs before coding, reducing the chance that the implementation misses project conventions, dependencies, error handling, or tests.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is sabernagato/Context-Engineering-Intro-ZH's own configuration. It tells Claude Code how to work on Context-Engineering-Intro-ZH itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Context-Engineering-Intro-ZH configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sabernagato/Context-Engineering-Intro-ZH. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sabernagato/Context-Engineering-Intro-ZH/master/.claude/commands/generate-prp.md
Clone the repo
git clone --depth 1 https://github.com/sabernagato/Context-Engineering-Intro-ZH

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-prp

README.md
[![agentmods](https://agentmods.dev/badge/commands/sabernagato/context-engineering-intro-zh/generate-prp.svg)](https://agentmods.dev/commands/sabernagato/context-engineering-intro-zh/generate-prp)
Your own site
<a href="https://agentmods.dev/commands/sabernagato/context-engineering-intro-zh/generate-prp"><img src="https://agentmods.dev/badge/commands/sabernagato/context-engineering-intro-zh/generate-prp.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00661
Opus 5 $0.00000 $0.00331
Sonnet 5 $0.00000 $0.00132
Haiku 4.5 $0.00000 $0.00066

Measured 8d ago against content hash ff0122c1957b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

generate-prp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/generate-prp.md · 69 lines

What it actually says

创建 PRP

功能文件:$ARGUMENTS

为通用功能实现生成完整的 PRP,并进行彻底的研究。确保将上下文传递给 AI 代理,以实现自我验证和迭代改进。首先阅读功能文件,了解需要创建什么、提供的示例如何帮助以及任何其他考虑事项。

AI 代理只能获得您附加到 PRP 的上下文和训练数据。假设 AI 代理可以访问代码库并具有与您相同的知识截止日期,因此将您的研究发现包含或引用在 PRP 中非常重要。代理具有网络搜索功能,因此请传递文档和示例的 URL。

研究过程

  1. 代码库分析

    • 在代码库中搜索类似的功能/模式
    • 识别要在 PRP 中引用的文件
    • 注意要遵循的现有约定
    • 检查测试模式以了解验证方法
  2. 外部研究

    • 在线搜索类似的功能/模式
    • 库文档(包含具体的 URL)
    • 实现示例(GitHub/StackOverflow/博客)
    • 最佳实践和常见陷阱
  3. 用户澄清(如果需要)

    • 要镜像的特定模式以及在哪里找到它们?
    • 集成要求以及在哪里找到它们?

PRP 生成

使用 PRPs/templates/prp_base.md 作为模板:

要包含并作为 PRP 一部分传递给 AI 代理的关键上下文

  • 文档:包含特定部分的 URL
  • 代码示例:来自代码库的真实代码片段
  • 陷阱:库的怪癖、版本问题
  • 模式:要遵循的现有方法

实施蓝图

  • 从展示方法的伪代码开始
  • 引用真实文件以获取模式
  • 包含错误处理策略
  • 列出完成 PRP 所需完成的任务,按应完成的顺序排列

验证门(必须可执行)例如对于 python

# 语法/风格
ruff check --fix && mypy .

# 单元测试
uv run pytest tests/ -v

*** 关键:在您完成研究和探索代码库之后,开始编写 PRP 之前 ***

*** 深入思考 PRP 并规划您的方法,然后开始编写 PRP ***

输出

保存为:PRPs/{功能名称}.md

质量清单

  • 包含所有必要的上下文
  • 验证门可由 AI 执行
  • 引用现有模式
  • 清晰的实施路径
  • 记录错误处理

在 1-10 的范围内对 PRP 进行评分(使用 claude codes 一次性实现成功的置信度水平)

请记住:目标是通过全面的上下文实现一次性实施成功。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 69 lines · 0 tokens per session scan A ff0122c1957b

Subscribe to this mod's changes

generate-prp is a command published in the GitHub repository sabernagato/Context-Engineering-Intro-ZH (56 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 661 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.