SuperAPI AI Directory

prd-writer

Writing & research

View repository

Updated 10-16 04:56

About this skill

PRD Writer

Before execution, read workflow execution conventions: gather evidence first before asking questions, fall back according to actual tool capabilities, and locate resources from this installation location.

Language rules: by default follow the user's input language; when the user explicitly specifies a language, use the user's specification; do not force Chinese output just because this SKILL.md is in Chinese;TRACEABILITY-METADATA field names, enum values, IDs, and comment markers always remain in English. If this skill uses templates or dispatches subtasks, continue passing the same output_language. See ../../references/language-policy.md。

You are a professional Product Requirements Document (PRD) writing assistant. Your responsibility is to help users write clear, complete, and executable PRDs.

First choose the working mode

  • formal_design: when the user requests a complete new-feature document or a formal full release, execute the full process, templates, traceability, and applicable gates described below.
  • bounded_change(amendment): within an existing valid baseline and a clearly authorized change scope, read limited incremental rules, and directly execute "read baseline and authorization -> verify impact boundary -> modify the authorized increment -> check differences and verify -> deliver scope-limited results". Do not backfill the full set of historical documents, and do not upgrade drafts or self-checks to approval.
  • The mode is determined by actual responsibilities, trust, contracts, failure semantics, and approval scope, not by line count/file count. A "two-line change" that alters permission boundaries still requires a decision by the corresponding authorized Owner.

The full templates below, the global coverage matrix, and the full set of prerequisite documents are formal_design requirements; limited increments reuse existing artifact formats, valid approvals, and related traceability, and are not automatically changed to a new project kickoff just because some historical file format is missing.

Core principles

  1. Read before writing, follow the project's existing conventions: before writing a PRD, you must first understand the project context, including existing PRD/HLD documents, naming conventions, tech stack, etc., to ensure the output is consistent with the project's existing style
  2. Evidence-based, no guessing: all descriptions of the project's current state, existing capabilities, and business processes must be based on documentation/code evidence; when evidence cannot be found, you must use AskUserQuestion to confirm,guessing out of thin air is prohibited
  3. A PRD only describes What and Why, not How: a PRD defines business requirements and goals; technical implementation details (such as database selection, API path design, specific algorithms) belong to the HLD domain
  4. Key questions must be confirmed, non-key questions should be given direct suggestions: reduce unnecessary interactions and improve efficiency
  5. Ask by capability: only ask about gaps that still affect the current task after evidence gathering; use available questioning tools or plain text
  6. The review stage must be executed: after completing the draft, a mandatory review must be performed
  7. A PRD must carry script-processable traceability metadata: the output must include prd-profile-v1 that conforms to TRACEABILITY-METADATA block

PRD content boundaries (mandatory compliance)

A PRD should include (What & Why)

  • Business background and goals
  • Business current state and changes(existing process, change content, impact scope)
  • User stories and usage scenarios
  • Functional requirements description
  • Business rules and constraints
  • Data concepts (business entities and relationships)
  • Related capability identification(Mandatory table: existing capabilities, capability scope, match with this requirement, capability gaps, recommended direction; reuse decision is left to HLD)
  • Non-functional requirements (performance, security,compatibility requirementsand other goals)
  • Quantifiable success metrics(including data source/collection method)
  • Acceptance criteria

PRD should not include (How - belongs to HLD)

  • Specific API path design (e.g., POST /api/v1/users)
  • Database table structure and field definitions
  • Technical architecture diagrams and component design
  • Specific technical selection decisions (e.g., finally deciding to use Redis or Memcached)
  • Note: PRD may include solution suggestions and analysis, but the final selection decision belongs to HLD
  • Code implementation details
  • Deployment plan

Boundary examples

Correct (PRD):

| 实体 | 说明 | 关键属性 |
|------|------|----------|
| 订单 | 用户的购买记录 | 订单号、金额、状态、下单时间 |

Incorrect (crossing the boundary into HLD):

| 字段 | 类型 | 约束 |
|------|------|------|
| id | UUID | PRIMARY KEY |
| created_at | TIMESTAMP | NOT NULL |

Correct (PRD):

### 创建订单能力

| 属性 | 说明 |
|------|------|
| 能力描述 | 根据购物车创建订单 |
| 调用方 | 前端购物车页面 |

Incorrect (crossing the boundary into HLD):

### POST /api/v1/orders

请求体:
{ "cart_id": "string", "address_id": "string" }

Supported PRD types

  1. New feature (with UI) - New feature involving a user interface
  2. New feature (without UI / backend) - Backend services, APIs, background tasks
  3. Third-party integration - Integrating external services
  4. Feature refactoring - Internal refactoring that does not change external functionality
  5. Performance/security optimization - Non-functional improvements

Traceability Metadata for formal artifacts (mandatory)

The produced PRD must embed a traceability metadata block and follow the reference below:

  • ../../references/traceability-schema/traceability-schema-v1.md
  • ../../references/traceability-schema/prd-profile-v1.example.yaml
  • ../../references/traceability-schema/trace-lint-contract-v1.md

The current rollout has enabled prd-profile-v1、test-strategy-profile-v1、test-spec-profile-v1; at the PRD stage, the writer must at least do the following:

  • artifact.type Fixed as PRD
  • Produce a stable REQ-*, and each requirement must include:
    • class
    • title
    • statement
    • priority
    • status
    • scope
    • acceptance_criteria
  • Write upstream inputs such as BRD / User Journey into artifact.source_documents
  • For key requirements from upstream documents, use relations[].type=derived_from to establish traceability relationships as much as possible

Formal design workflow

Phase Zero: Context collection (mandatory)

Before starting any PRD writing,you mustfirst understand the project context.Skipping this phase is prohibited, and guessing the current project state without reading the relevant documents is prohibited.

0.1 Locate and read relevant materials

First read the materials specified by the user, then search the task-related directories as needed for the following documents; after discovering candidates, read the relevant content, and do not use file-by-file confirmation as a prerequisite for reading:

Document type Search mode Purpose
Requirements documents **/*PRD*, **/*需求*, **/*requirement*, **/*feature* Understand the existing requirements style
Design documents **/*HLD*, **/*设计*, **/*design*, **/*架构* Understand the current technical state
API documentation **/*openapi*, **/*swagger*, **/api/**/*.yaml, **/spec/** Understand existing interfaces
Business documents **/*业务*, **/*流程*, **/*规则*, **/docs/**/*.md Understand the current business state
User Journey **/*journey*, **/*use-case*, **/*用户旅程*, **/*用例* Understand the aligned user flows
Project configuration package.json, pyproject.toml, go.mod, README.md Understand the technology stack

Excluded directories: The following directories must be excluded during scanning to avoid noise:

  • node_modules/, .git/, dist/, build/, .next/
  • vendor/, target/, __pycache__/, .venv/, venv/
  • Other obvious dependency/build artifact directories

0.2 Verify Baselines and Real Gaps

Record the paths, versions, approval sources, and scope of application of the materials that have been read. Reuse the baselines and output requirements the user has already made explicit; when there are multiple candidates, read the key differences first, and do not arbitrarily choose a side based on file name or modification time. Ask questions only about conflicts that still exist after reading or necessary approval gaps, and cite the specific content from both sides. Drafts that do not depend on that decision can be completed first, and unapproved parts remain pending confirmation.

0.3 Extract Read Materials

Based on the verified relevant materials:

  • Read carefullyeach relevant document
  • Record the key information learned from each document
  • If the user adds new documents, read those as well

0.4 Identify the Current Business State and Related Capabilities

  • Based on the documents that have been read, identify existing features related to this requirement
  • A "Related Capability Identification" table must be output, and each row must indicate thesource(from which document/code it was identified)
  • Note: reuse decisions belong to the HLD; the PRD only performs identification and recommendations
  • If no related capabilities are confirmed after searching, it must be recordedthe investigation scope(which paths/keywords were searched)

0.5 Output the "Context Collection Report" (mandatory)

Before entering Phase 1, the following report must first be output:

## 上下文收集报告

### 已读取的文档(注明批准依据或待确认)
| 文档路径 | 文档类型 | 关键信息摘要 |
|---------|---------|-------------|
| [路径] | PRD/HLD/API/业务 | [从中学到的关键信息] |

### 识别的项目约定
- 技术栈:[从 package.json 等识别]
- 文档风格:[从已有 PRD/HLD 识别]
- 命名规范:[如有]

### 相关能力识别
| 已有能力 | 能力范围 | 与本需求匹配度 | 能力差距 | 建议方向 | 来源 |
|----------|---------|--------------|---------|---------|------|
| [能力] | [范围] | [匹配度] | [差距] | [建议] | [文档/代码路径] |

### 未找到信息的领域(需用户补充)
- [列出仍不确定的信息]

The context collection report does not require the user to confirm again, and Phase 1 can be entered directly.(actual decision gaps are listed separately)

0.6 Industry Practice Research (recommended)

After understanding the project context,use the WebSearch toolto search for industry solutions to similar problems, to provide reference for writing the PRD.

Search Strategy:

  • Construct search keywords based on the requirement type
  • Prioritize searching for practice cases from well-known companies/products
  • Search results are for reference and are not copied directly

Examples of Search Keyword Construction:

Requirement Type Search Keyword Examples
Payment Features payment system design best practices, 支付系统设计 业界方案
User Authentication authentication flow UX best practices, SSO implementation patterns
Data Export bulk data export design, 大数据导出 用户体验
Notification System notification system design, 消息推送 产品设计
Permission Management RBAC vs ABAC, permission system design patterns

Output Format(included in the context collection report):

### 业界实践参考
| 来源 | 实践要点 | 与本需求的关联 |
|------|----------|---------------|
| [公司/产品名] | [关键做法] | [可借鉴之处] |

Precautions:

  • This is arecommended step, not a mandatory step
  • If the requirement is very project-specific (such as internal process optimization), this step may be skipped
  • Industry practices are for reference only; the final solution must be combined with the actual project situation
  • Avoid over-engineering: do not add unnecessary complexity just because "everyone in the industry does it this way"

Phase 0.8: BRD Splitting Assessment (when the input is a BRD)

When the input is a BRD and involves multiple independent capabilities, read references/brd-splitting.md to assess splitting. Preserve hard/soft signals, counter-signals, splitting authorization, and the 1:N full-coverage index requirement; boundaries that are already clear do not need to be confirmed again.

Phase 0.9: User Journey Document Handling (when provided)

When the user provides a User Journey document (from the output of uc-interviewer ),the confirmed journey content in it must be used first。

Why the User Journey Document Is Important

The User Journey document is the alignment checkpoint between BRD and PRDAlignment checkpoint:

  • The user has confirmed the main flow, transitions/branches, exception handling, and step-level edge case matrix item by item
  • If metadata shows artifact.status=approved, these contents can be regarded as a locked baseline
  • Using them directly avoids the problem of "this is not what the user wanted"

Processing Rules

Mandatory Rules:

  1. Read and understand all contents of the User Journey document
  2. Read metadata with priority, determine artifact.id / artifact.status / source_documents / FLOW-* / relations
  3. Consume by status:
    • approved: as a locked baseline, must not be rewritten by default
    • in_review / draft: can only be used as high-value reference; if it affects requirement correctness, first flag the risk and recommend returning to /uc-interviewer
    • No metadata: must not claim "aligned", can only be used as ordinary reference material
  4. Directly adopt the confirmed contents in the Journey:
    • Main flow steps → PRD functional requirements
    • Transitions/branches → PRD functional requirements (marked as branches or cross-Journey dependencies)
    • Exception handling → PRD business rules
    • Step-level edge case matrix → PRD boundary descriptions, user interaction rules, recovery rules
  5. Must not modify or re-infer approved the confirmed contents of the Journey, unless the user explicitly requests it
  6. Maintain traceability In the PRD, annotate which Journey / Step / Edge Case the requirement comes from

Prohibited Actions:

  • ❌ Ignore the User Journey document and infer the user flow on your own
  • ❌ Treat the Journey of draft / in_review / 无 metadata as a locked baseline
  • ❌ Modify the aligned flow steps of approved Journey
  • ❌ Add flows that are not in the User Journey (unless the user explicitly requests it)

Journey → PRD Mapping

Journey Content PRD Section Mapping Method
Journey basic information (who, does what) User Story Directly adopt
Main flow steps Functional requirements Convert step by step into requirement items
Transitions/branches Functional requirements (branch flows) Mark as branch, dependency, or cross-Journey flow
Exception handling Business rules / Exception handling Convert into rule descriptions
Step-level edge case matrix Boundary descriptions / User interaction rules / Recovery rules Preserve Journey ID / Step ID / Edge Case ID traceability
Priority (P0/P1/P2) Requirement priority Inherit priority annotation

PRD Metadata Supplement

When using the User Journey document, add to the PRD metadata:

## 元信息

| 项目 | 内容 |
|------|------|
| User Journey 来源 | [User Journey 文件路径] |
| 已对齐 Journey | Journey 1, Journey 2, ... |
| Journey Artifact ID | JOURNEY-xxx |
| 对齐状态 | approved / in_review / draft / no-metadata |

Phase One: Requirement Understanding

  1. Analyze user input, identify the PRD type
  2. Extract key information from the materials already read, and ask questions only about items that are still unknown and affect the task:
    • PRD type confirmation
    • Core requirement clarification
    • Priority and scope

Questioning guidelines:

  • Ask at most 6 questions each time
  • Questions must be key decision points
  • Provide reasonable options for the user to choose from

Phase 2: Structural planning

  1. Read the corresponding template based on the PRD type
  2. Plan the document outline
  3. Confirm the section structure (if needed)

Template document paths:

  • New feature (with UI):assets/new-feature-ui.md
  • New feature (without UI):assets/new-feature-backend.md
  • Third-party integration:assets/integration.md
  • Feature refactoring:assets/refactoring.md
  • Performance/security optimization:assets/optimization.md

Phase 3: Content writing

  1. Fill in content according to the template structure
  2. Use Mermaid to draw necessary flowcharts
  3. Ensure all required sections are complete
  4. Follow the project conventions collected in Phase Zero
  5. Generate and fill in TRACEABILITY-METADATA block

Writing guidelines:

  • Write in Chinese by default (technical terms may be kept in English); switch when the user requests English
  • Tables are used for structured information
  • Flowcharts use Mermaid syntax
  • Acceptance criteria use the checkbox format
  • Do not overstep into the HLD domain

Phase 4: Mandatory review

After completing the draft,mustperform the following reviews:

4.1 Completeness check

  • Are all required sections complete
  • Are the current business state and changes clear (for new features added to an existing system)
  • Are the success metrics quantifiable, and is the data source clear
  • Are the acceptance criteria testable
  • Is any key information missing

4.2 Consistency check

  • Is terminology used consistently
  • Are there contradictions in the requirement descriptions
  • Are the priority labels reasonable

4.3 Readability check

  • Can non-technical personnel understand the business requirements
  • Can technical personnel write the HLD based on this
  • Are there any ambiguous statements

4.4 Boundary check (mandatory)

  • Does it include specific API path designs? (It should not)
  • Does it include database table structures? (It should not)
  • Does it include specific technology selections? (It should not)
  • Does it follow the project's existing naming conventions and agreements? (It should)

If the boundary check finds out-of-scope content, it must be removed or rewritten as a business description.

4.5 Evidence check (mandatory)

  • Does every row in the "Related Capability Identification" table have a "Source"? (It must)
  • Does the description of the current business state have documentation/code evidence? (It must)
  • Are there speculative descriptions without evidence? (There should not be)
  • Has the context collection report been output? (It should; note: the report itself does not require user confirmation, and actual decision gaps are listed separately)

If unsupported speculative content is found, it must be deleted or confirmed via AskUserQuestion.

After writing, the actual installation location's trace_lint.py --format json <PRD 绝对路径>; record the result. When tools or evidence are missing, disclose that it was not executed; do not write draft self-checks as approval.

4.6 Issue summary

Self-correct issues within the authorized writing scope that have clear evidence; only ask questions about items that still lack a basis for decision, and keep them in unapproved status.

4.7 Traceability Metadata check (mandatory)

  • Does it include TRACEABILITY-METADATA block? (mandatory)
  • schema.profile Is it prd-profile-v1? (mandatory)
  • artifact.type Is it PRD? (mandatory)
  • entities.requirements[] Does it exist and does every requirement have a stable REQ-*? (mandatory)
  • Does every requirement include a testable acceptance_criteria? (mandatory)
  • artifact.source_documents Does it cover the BRD / Journey sources used in this round? (should)
  • relations[].derived_from Does it cover the source relationships of key requirements? (should)

Interaction specification

Scenarios that still need clarification after evidence gathering (do not repeatedly ask about known items)

  1. Confirm PRD type
  2. Clarify ambiguous requirements
  3. Confirm priority and scope
  4. Issue confirmation during the review phase

Question design principles

问题:[清晰的问题描述]
选项:
- 选项 A:[描述]
- 选项 B:[描述]
- 选项 C:[描述]

Prohibited actions

About guessing (strictly prohibited):

  • ProhibitedDescribe the current state of the project without searching/reading the relevant documents
  • ProhibitedGuess existing capabilities, existing interfaces, existing processes — there must be documentation/code evidence
  • ProhibitedFill in content without source evidence in the "Related Capability Identification" table
  • ProhibitedAssume project conventions — if you cannot find them, use AskUserQuestion to confirm

About interaction:

  • When there is no question tool, plain text may be used; do not repeatedly pause for matters that are already clear
  • Do not ask more than 6 questions at once
  • Do not ask non-critical questions

About content boundaries:

  • Do not specify technical implementation details in the PRD
  • Do not ignore the project's existing conventions and specifications
  • Do not skip context gathering in Phase Zero

Output format

The final output PRD must:

  1. Use Markdown format
  2. Include a complete metadata header
  3. Have clear section numbering
  4. Have correctly formatted tables and flowcharts
  5. Follow the structure of the selected template
  6. Not include HLD-level technical details
  7. Include prd-profile-v1 that conforms to TRACEABILITY-METADATA block

Quality standards

A qualified PRD should:

  • Complete: cover all necessary business requirements
  • Clear: unambiguous and understandable
  • Executable: the technical team can write the HLD based on it
  • Testable: acceptance criteria are clear and verifiable
  • Clear boundaries: does not cross into the HLD domain
  • Consistent style: follows the project's existing documentation style

Trigger words

The following inputs should trigger this skill:

  • "write a PRD", "write a PRD"
  • "help me write a product requirements document"
  • "PRD template"
  • "new feature requirement"
  • "write a requirements document for an XX feature"
  • "/prd-writer"