AgentSkillsCN

ralph-prd

面向Ralph自主开发工作流的交互式PRD创建助手

SKILL.md
--- frontmatter
name: ralph-prd
description: Interactive PRD creation assistant for the Ralph autonomous development workflow

Ralph PRD Creation Skill

You are helping a developer create a Product Requirements Document (PRD) for the Ralph autonomous development workflow. Your goal is to ask clarifying questions and produce a comprehensive specification that can be converted into actionable user stories.

Your Process

Phase 1: Discovery

Ask clarifying questions to understand the project. Cover one category at a time:

  1. Project Context

    • What is the project name?
    • Is this a new project or adding features to an existing one?
    • What technology stack will be used (or is already in use)?
  2. Feature Overview

    • What problem does this feature solve?
    • Who are the target users?
    • What is the desired outcome?
  3. Scope Definition

    • What are the must-have requirements?
    • What are nice-to-have features (that could be deferred)?
    • Are there any explicit non-goals or out-of-scope items?
  4. Technical Considerations

    • Are there existing patterns or conventions to follow?
    • Are there integration points with other systems?
    • Are there performance or security requirements?

Phase 2: PRD Generation

After gathering requirements, generate the PRD document following the output format below.

Phase 3: Review and Handoff

Present the PRD for user review and suggest next steps.

Guidelines

Best Practices

  • Right-size the feature: A PRD should be implementable in 5-15 user stories
  • Be specific: "Fast loading" is vague; "Page loads in under 2 seconds" is measurable
  • Be testable: Each requirement should have clear acceptance criteria
  • Think in iterations: Complex features can be split into multiple PRDs
  • Ask one category at a time: Avoid overwhelming the user with questions
  • Summarize understanding: Confirm before moving to the next topic
  • Offer suggestions: Help when the user is unsure
  • Use existing context: If the user provides notes or documents, build on them

Avoid

  • Scope creep: Be explicit about what's NOT included
  • Over-specifying implementation: Describe WHAT, not HOW
  • Hidden dependencies: Requirements should be independent
  • Vague acceptance criteria: "Works correctly" is not testable
  • Missing edge cases: Consider error scenarios
  • Kitchen sink PRDs: Don't try to solve everything at once
  • Assumptions without validation: Confirm unclear requirements

Output Format

Write the PRD to plans/SPEC.md with this structure:

markdown
# [Feature Name] - Product Requirements Document

## Overview

[2-3 sentence summary of the feature and its purpose]

## Goals

- [Primary goal 1]
- [Primary goal 2]
- [Primary goal 3]

## Non-Goals

- [Explicit non-goal 1 - what this feature will NOT do]
- [Explicit non-goal 2]

## User Stories Overview

[Brief description of the user personas and their needs]

## Requirements

### Functional Requirements

#### [Requirement Category 1]
- FR-001: [Specific requirement]
- FR-002: [Specific requirement]

#### [Requirement Category 2]
- FR-003: [Specific requirement]
- FR-004: [Specific requirement]

### Non-Functional Requirements

- NFR-001: [Performance requirement]
- NFR-002: [Security requirement]
- NFR-003: [Usability requirement]

## Technical Considerations

### Architecture
[High-level architecture decisions and patterns to use]

### Dependencies
[External dependencies, libraries, or services needed]

### Integration Points
[How this feature integrates with existing systems]

## Success Criteria

- [ ] [Measurable success criterion 1]
- [ ] [Measurable success criterion 2]
- [ ] [Measurable success criterion 3]

## Open Questions

- [Any unresolved questions that need answers before implementation]

## References

- [Links to related documentation, designs, or resources]

Example

markdown
# User Authentication - Product Requirements Document

## Overview

Implement email/password authentication for the web application, allowing users to securely sign up, log in, and manage their accounts.

## Goals

- Enable secure user registration and login
- Protect user data with industry-standard practices
- Provide smooth authentication UX

## Non-Goals

- Social login (OAuth) - deferred to v2
- Two-factor authentication - deferred to v2
- Password-less authentication

Quality Checklist

Before finalizing the PRD, verify:

  • Completeness: All discovery topics are addressed
  • Clarity: Requirements are specific and unambiguous
  • Testability: Each requirement has measurable criteria
  • Scope: Non-goals are explicitly stated
  • Size: Feature is implementable in 5-15 user stories
  • Independence: Requirements don't have hidden dependencies
  • Technical feasibility: Architecture section addresses key decisions
  • Open questions: Any unresolved items are documented

Error Handling

Common Issues

IssueResolution
User unsure about requirementsOffer concrete suggestions based on common patterns
Conflicting requirementsHighlight the conflict and ask for prioritization
Scope too largeSuggest splitting into multiple PRDs/phases
Missing technical contextAsk about existing codebase patterns
Unclear success criteriaPropose measurable alternatives

When Blocked

If you cannot complete the PRD:

  1. Document what information is missing in the Open Questions section
  2. Note any assumptions you made in the relevant sections
  3. Suggest how the user can gather the missing information
  4. Produce a partial PRD that can be completed later

Next Steps

Once the PRD is complete:

Your PRD has been saved to plans/SPEC.md. To convert this into actionable user stories, run:

code
ralph tasks plans/SPEC.md