1kalin/afrexai-prd-engine/SKILL.md
# PRD Engine — Product Requirements That Ship Complete product requirements methodology: from idea to spec to shipped feature. Not just a JSON template — a full system for writing PRDs that developers actually follow and stakeholders actually approve. ## When to Use This Skill - Turning a vague idea into a buildable specification - Writing PRDs for new features, products, or major refactors - Reviewing/improving existing PRDs before sprint planning - Breaking epics into right-sized user stori
npx skillsauth add openclaw/skills 1kalin/afrexai-prd-engineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete product requirements methodology: from idea to spec to shipped feature. Not just a JSON template — a full system for writing PRDs that developers actually follow and stakeholders actually approve.
Before writing a single requirement, answer these questions. Skip this and you'll rewrite the PRD 3 times.
discovery_brief:
problem:
statement: "" # One sentence. If you need two, you don't understand it yet.
who_has_it: "" # Specific persona, not "users"
frequency: "" # Daily? Weekly? Once? (daily problems > occasional ones)
current_workaround: "" # What do they do today? (no workaround = maybe not a real problem)
evidence:
- type: "" # support_ticket | user_interview | analytics | churned_user | sales_objection
detail: ""
date: ""
impact:
users_affected: "" # Number or percentage
revenue_impact: "" # $ at risk or $ opportunity
strategic_alignment: "" # Which company goal does this serve?
constraints:
deadline: "" # Hard date or flexible?
budget: "" # Engineering weeks available
dependencies: "" # What must exist first?
regulatory: "" # Any compliance requirements?
success_metrics:
primary: "" # ONE metric that defines success
secondary: [] # 2-3 supporting metrics
measurement_method: "" # How will you actually measure this?
target: "" # Specific number, not "improve"
timeframe: "" # When do you expect to see results?
[Persona] needs [capability] because [reason], but currently [blocker], which causes [measurable impact].
Examples:
Before proceeding, check these. If any are true, STOP and push back:
| Signal | Action | |--------|--------| | No evidence of the problem (just someone's opinion) | Demand evidence. Opinions aren't requirements. | | Solution already decided ("just build X") | Rewind to the problem. Solutions without problems = features nobody uses. | | Success metric is unmeasurable | Define how you'll measure it or don't build it. | | Affects <1% of users with no revenue impact | Deprioritize. Small problems with small impact = small returns. | | Scope keeps expanding during discovery | Scope lock. If everything is in scope, nothing is. |
# PRD: [Feature Name]
**Author:** [Name]
**Status:** Draft | In Review | Approved | In Progress | Shipped
**Created:** YYYY-MM-DD
**Last Updated:** YYYY-MM-DD
**Approvers:** [Names + roles]
## 1. Problem & Opportunity
[Problem statement from discovery brief — one paragraph max]
### Evidence
- [Evidence point 1 — with data]
- [Evidence point 2 — with data]
### Impact
- Users affected: [number]
- Revenue impact: [$ amount or % change]
- Strategic goal: [which one]
## 2. Solution Overview
[2-3 paragraphs max. What are we building and why this approach?]
### What This Is
- [Bullet list of what's in scope]
### What This Is NOT
- [Explicit exclusions — this prevents scope creep]
### Key Decisions Made
| Decision | Options Considered | Chosen | Rationale |
|----------|-------------------|--------|-----------|
| [Decision 1] | A, B, C | B | [Why] |
## 3. User Stories
[See Phase 3 below for story writing methodology]
## 4. Design & UX
### User Flow
1. User [action] →
2. System [response] →
3. User sees [outcome]
### Wireframes/Mockups
[Link to Figma/screenshots or describe key screens]
### Edge Cases
| Scenario | Expected Behavior |
|----------|------------------|
| [Edge case 1] | [What happens] |
| [Edge case 2] | [What happens] |
| Empty state | [What user sees with no data] |
| Error state | [What user sees on failure] |
| Slow connection | [Loading behavior] |
## 5. Technical Considerations
### Architecture Notes
- [Key technical decisions]
- [New services/APIs needed]
- [Database changes]
### Dependencies
- [External service X]
- [Team Y's API]
- [Library Z]
### Performance Requirements
- Page load: <[X]ms
- API response: <[X]ms
- Concurrent users: [X]
### Security & Privacy
- [Data handling requirements]
- [Auth/permissions needed]
- [PII considerations]
## 6. Release Plan
### Rollout Strategy
- [ ] Feature flag: [flag name]
- [ ] Beta group: [who]
- [ ] % rollout: [10% → 50% → 100%]
- [ ] Rollback plan: [how]
### Launch Checklist
- [ ] QA sign-off
- [ ] Analytics events implemented
- [ ] Monitoring/alerts configured
- [ ] Documentation updated
- [ ] Support team briefed
- [ ] Stakeholders notified
## 7. Success Criteria
| Metric | Current | Target | Timeframe |
|--------|---------|--------|-----------|
| [Primary metric] | [X] | [Y] | [Z weeks] |
| [Secondary metric] | [X] | [Y] | [Z weeks] |
### Post-Launch Review
- **1-week check:** [What to look at]
- **1-month review:** [What to measure]
- **Kill/iterate decision:** [Criteria for each]
| Dimension | 0-2 (Weak) | 3-4 (Adequate) | 5 (Strong) | Weight | |-----------|-----------|----------------|------------|--------| | Problem clarity | Vague, no data | Clear but thin evidence | Sharp statement + multiple evidence points | x4 | | Scope discipline | Everything in scope | Some boundaries | Explicit in/out + "what this is NOT" | x3 | | Story quality | Vague tasks | Stories with some criteria | INVEST stories + verifiable acceptance criteria | x4 | | Edge cases | None listed | Happy path + 1-2 edges | Comprehensive: empty, error, slow, permissions, concurrent | x3 | | Success metrics | "Improve X" | Metric + target | Metric + baseline + target + timeframe + measurement method | x3 | | Technical feasibility | No tech section | Architecture notes | Dependencies, performance, security, migration plan | x2 | | Release plan | None | "Ship it" | Feature flag + rollout % + rollback + launch checklist | x1 |
Scoring: Sum (score × weight). Max = 100.
story:
id: "US-001"
title: "" # Action-oriented: "Add priority field to tasks table"
persona: "" # Who benefits
narrative: "As a [persona], I want [capability] so that [benefit]"
acceptance_criteria:
- criterion: "" # Verifiable statement
type: "functional" # functional | performance | security | ux
priority: 1 # Execution order (dependencies first)
size: "" # XS | S | M | L | XL
status: "todo" # todo | in_progress | review | done
notes: "" # Runtime observations
depends_on: [] # Story IDs this depends on
blocked_by: [] # External blockers
| Letter | Criterion | Test | |--------|-----------|------| | I — Independent | Can be built without other incomplete stories | No circular dependencies | | N — Negotiable | Details can flex (the "what" is fixed, the "how" is flexible) | Multiple implementation approaches exist | | V — Valuable | Delivers user or business value on its own | Would a user/stakeholder care if only this shipped? | | E — Estimable | Team can size it | No major unknowns (if unknowns exist, add a spike first) | | S — Small | Completable in one sprint (or one context window for AI agents) | 1-3 days of work max | | T — Testable | Has verifiable acceptance criteria | Can write a test for each criterion |
Good criteria are:
| ❌ Bad | ✅ Good |
|--------|---------|
| "Works correctly" | "Returns 200 with JSON body containing id, name, status fields" |
| "Fast enough" | "API responds in <200ms at p95 with 100 concurrent users" |
| "User-friendly" | "Form shows inline validation errors within 100ms of field blur" |
| "Secure" | "Endpoint returns 403 for users without admin role" |
| "Handles errors" | "On network timeout, shows retry button + cached data if available" |
Always include these universal criteria:
Typecheck passes (tsc --noEmit --strict) (for TypeScript projects)All existing tests still passNew functionality has test coverage| Size | Scope | Time | Example | |------|-------|------|---------| | XS | Config change, copy update, env var | <2 hours | "Update error message text" | | S | Single component/function, no new deps | 2-4 hours | "Add date picker to form" | | M | Feature slice: DB + API + UI | 1-2 days | "Add task priority with filter" | | L | Multi-component feature, new patterns | 2-3 days | "Add real-time notifications" | | XL | Too big. Split it. | — | — |
Always order stories bottom-up:
Level 1: Schema & Data (migrations, models, seed data)
↑
Level 2: Backend Logic (services, APIs, business rules)
↑
Level 3: Integration (API routes, auth, middleware)
↑
Level 4: UI Components (forms, tables, modals)
↑
Level 5: UX Polish (animations, empty states, loading)
↑
Level 6: Analytics & Monitoring (events, dashboards)
Each level depends ONLY on levels below it. Never build UI before the API exists.
When a story is too big, split using one of these patterns:
| Strategy | When to Use | Example | |----------|------------|---------| | By layer | Full-stack feature | "Add schema" → "Add API" → "Add UI" | | By operation | CRUD feature | "Create task" → "Read/list tasks" → "Update task" → "Delete task" | | By persona | Multi-role feature | "Admin creates template" → "User fills template" → "Viewer sees results" | | By happy/sad path | Complex flows | "Successful payment" → "Payment declined" → "Payment timeout" | | By platform | Cross-platform | "iOS support" → "Android support" → "Web support" | | Spike + implement | High uncertainty | "Spike: evaluate auth libraries (2h)" → "Implement auth with chosen library" |
When the PRD will be executed by AI agents (Claude Code, Cursor, Copilot Workspace, etc.), add these adaptations:
agent_story:
id: "US-001"
title: "Add priority field to tasks table"
context: |
The tasks table is in src/db/schema.ts using Drizzle ORM.
Priority values should be: high, medium, low (default: medium).
See existing fields for naming conventions.
acceptance_criteria:
- "Add `priority` column to `tasks` table in src/db/schema.ts"
- "Type: enum('high', 'medium', 'low'), default 'medium', not null"
- "Generate migration: `npx drizzle-kit generate`"
- "Run migration: `npx drizzle-kit push`"
- "Verify: `tsc --noEmit --strict` passes"
- "Verify: existing tests pass (`npm test`)"
files_to_touch:
- src/db/schema.ts
- drizzle/ (generated migration)
commands_to_run:
- "npx drizzle-kit generate"
- "npx drizzle-kit push"
- "tsc --noEmit --strict"
- "npm test"
done_when: "All verify commands pass with exit code 0"
npx drizzle-kit push.For AI agent execution, create a PROJECT_CONTEXT.md alongside the PRD:
# Project Context
## Stack
- Framework: [Next.js 14 / Express / etc.]
- Language: [TypeScript strict mode]
- Database: [PostgreSQL via Drizzle ORM]
- Testing: [Vitest + Testing Library]
- Styling: [Tailwind CSS]
## Key Directories
- src/db/ — Database schema and migrations
- src/api/ — API routes
- src/components/ — React components
- src/lib/ — Shared utilities
- tests/ — Test files (mirror src/ structure)
## Conventions
- File naming: kebab-case
- Component naming: PascalCase
- Max file length: 300 lines
- Max function length: 50 lines
- All exports typed, no `any`
## Commands
- `npm run dev` — Start dev server
- `npm test` — Run tests
- `npm run build` — Production build
- `tsc --noEmit --strict` — Type check
- `npx drizzle-kit generate` — Generate migration
- `npx drizzle-kit push` — Apply migration
## Current State
- [What exists today relevant to the PRD]
- [Any tech debt or gotchas the agent should know]
Completeness:
Quality:
Readability:
Author writes PRD
↓
Self-review (score with rubric — must be ≥60)
↓
Peer review (another PM or tech lead)
↓
Engineering review (feasibility + sizing)
↓
Stakeholder approval (PM lead or product director)
↓
Status → Approved
↓
Sprint planning (stories → backlog)
| Feedback | Fix | |----------|-----| | "What problem does this solve?" | Your problem statement is weak. Add evidence. | | "This is too big" | Split into phases. Ship the smallest valuable slice first (MVP). | | "How do we know it worked?" | Your success metrics are vague. Add numbers + timeframe. | | "What about [edge case]?" | Your edge case table is incomplete. Add it. | | "When does this ship?" | Add timeline with milestones, not just a deadline. | | "Who approved this?" | Add approvers field and get explicit sign-offs. |
Draft → In Review → Approved → In Progress → Shipped → Post-Launch Review
↓ ↓
Rejected Iterate / Kill
Track story completion in the PRD itself or a linked tracker:
progress:
total_stories: 12
done: 7
in_progress: 2
blocked: 1
todo: 2
completion: "58%"
blocked_items:
- story: "US-008"
blocker: "Waiting for payments API access from finance team"
since: "2025-01-15"
escalation: "Pinged finance lead, follow up Friday"
velocity:
stories_per_week: 3.5
estimated_completion: "2025-02-01"
post_launch:
shipped_date: ""
review_date: "" # 2-4 weeks after ship
metrics:
primary:
metric: ""
baseline: ""
target: ""
actual: ""
verdict: "" # hit | miss | exceeded
secondary:
- metric: ""
actual: ""
verdict: ""
qualitative:
user_feedback: []
support_tickets: "" # count related to this feature
unexpected_outcomes: []
process_retro:
what_went_well: []
what_didnt: []
estimation_accuracy: "" # actual vs estimated effort
scope_changes: "" # what changed after approval
decision: "" # iterate | maintain | deprecate | expand
next_actions: []
| Command | What It Does | |---------|-------------| | "Write a PRD for [feature]" | Full PRD from discovery through stories | | "Break this into stories" | Takes a feature description → user stories | | "Review this PRD" | Scores against quality rubric + gives specific feedback | | "Make this agent-ready" | Converts PRD stories to agent-optimized format | | "What's missing from this PRD?" | Gap analysis against the template | | "Split this story" | Takes a large story → smaller INVEST-compliant stories | | "Score this PRD" | Quality rubric scoring with dimension breakdown | | "Create project context for [project]" | Generates PROJECT_CONTEXT.md for AI agent execution | | "Post-launch review for [feature]" | Generates review template with metrics | | "Track progress" | Updates completion stats from story statuses |
tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。