视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
create-prd【文档与办公】Use this skill when the user says 'create PRD', 'product requirements', 'write requirements', 'epics and stories', 'acceptance criteria', or when docs/brief.md exists and needs expansion into a full Product Requirements Document. This skill reads the brief, generates 5-8 epics, and for each epic creates 3-5 user stories with Gherkin acceptance criter…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Expand a Product Brief into a comprehensive Product Requirements Document with epics, user stories (Gherkin), non-functional requirements, and Definition of Done. The PRD bridges product strategy and engineering execution by translating business goals into structured, verifiable requirements that the entire team can align on.
The PRD is the contract between product and engineering. It defines what needs to be built with enough precision that engineers can estimate, designers can prototype, and QA can verify. A great PRD is unambiguous, testable, and scoped to the MVP.
Is the product category well-understood by the team?
|-- YES --> Do you have detailed user research?
| |-- YES --> Full PRD with 6-8 epics, 4-5 stories per epic
| |-- NO --> Lean PRD with 5-6 epics, 2-3 stories per epic
|-- NO --> Do you have competitive analysis?
|-- YES --> Standard PRD with 6-8 epics
|-- NO --> Start with create-brief first, then PRD after research
Is the timeline aggressive (< 3 months to MVP)?
|-- YES --> Focus on 3-4 core epics, defer non-critical to V2
|-- NO --> Full scope with all identified epics
How much user research is available?
|-- EXTENSIVE (user interviews, usability tests, analytics) --> Detailed stories with specific acceptance criteria
|-- MODERATE (surveys, support tickets, competitive analysis) --> Standard stories, note assumptions
|-- MINIMAL (assumptions only) --> Lean stories with explicit assumptions, mark for validation
What is the team's maturity with this domain?
|-- HIGH (built similar products before) --> Shorter stories, skip obvious details
|-- MEDIUM (some experience) --> Standard detail level
|-- LOW (new domain) --> Very detailed stories with examples and context
Can this epic be completed in 1-2 sprints (2-4 weeks)?
|-- YES --> Epic is appropriately scoped
|-- NO --> Split the epic. Ask: "What is the smallest valuable increment?"
|-- CORE FUNCTIONALITY --> Create epic for minimum viable version
|-- ENHANCEMENTS --> Defer to V2 or create separate epic
Does this epic describe HOW or WHAT?
|-- WHAT (user-facing feature) --> Keep as epic, write stories
|-- HOW (implementation detail) --> Move to tech spec, not PRD
Exact user phrases: "create PRD", "product requirements", "write requirements", "epics and stories", "acceptance criteria", "expand the brief", "write user stories".
Before activating, verify:
docs/brief-{YYYY-MM-DD}.md exists. Read it. If multiple briefs exist, use the most recent.Writes to docs/prd-{YYYY-MM-DD}.md.
After generation, output exactly:
PRD saved to docs/prd-{YYYY-MM-DD}.md
Epics: {n}
Stories: {n}
Non-functional requirements: {n}
Next skill: create-adr
No preamble. No postamble. No explanations. No filler/hedging/transitions.
Confirmation: 5 lines exactly. Do not output the full PRD content in the response unless the user explicitly asks to review it.
Read docs/brief-{YYYY-MM-DD}.md. Identify and extract:
Brief analysis checklist:
Create 5-8 epics. Each epic covers a logical feature area:
Standard epic categories:
Epic structure:
### Epic: {Epic Name}
**Description:** {2-3 sentences explaining what this epic covers and why it matters}
**Priority:** {P0/P1/P2/P3}
**Dependencies:** {List of other epics this depends on}
**MVP Feature Reference:** {Link to the brief MVP feature this epic implements}
Priority definitions:
Epic scoping rules:
For each epic, create 3-5 user stories.
Story format:
### Story: {Story Title}
**As a** {user role}, **I want to** {action} **so that** {value}.
**Acceptance Criteria:**
- Given {precondition} When {action} Then {result}
- Given {precondition} When {action} Then {result}
- Given {precondition} When {action} Then {result}
**Complexity:** [XS/S/M/L/XL]
Rules for stories:
Story writing heuristics:
Acceptance criteria patterns:
Complexity estimation guide:
| Size | Effort | Example |
|---|---|---|
| XS | < 2 hours | Text change, simple copy update |
| S | 2-4 hours | Single form, simple API call |
| M | 4-8 hours | Feature with moderate logic, 1-2 new screens |
| L | 1-2 days | Complex feature, multiple screens, new services |
| XL | 2-3 days | Large feature, external integrations, data migration |
| Category | Requirement | Target | Verification Method |
|---|---|---|---|
| Performance | API response time | <200ms p95 | Load testing |
| Performance | Page load time | <3s LCP | Lighthouse |
| Security | Authentication | JWT with refresh rotation | Penetration test |
| Security | Data encryption | AES-256 at rest, TLS 1.3 in transit | Audit |
| Scalability | Concurrent users | 10,000 | Load testing |
| Availability | Uptime | 99.9% | Monitoring |
| Compatibility | Browser support | Last 2 major versions | Automated testing |
Non-functional requirement categories to always include:
## Definition of Done
- [ ] Code complete with unit tests (>80% coverage on new code)
- [ ] Integration tests pass
- [ ] All acceptance criteria met
- [ ] No regressions in existing tests
- [ ] Code reviewed and approved
- [ ] Documentation updated (API docs, README)
- [ ] Deployed to staging environment
- [ ] Smoke tests pass on staging
Customizing the DoD:
Write to docs/prd-{YYYY-MM-DD}.md.
File naming convention: docs/prd-{YYYY-MM-DD}.md. If a PRD already exists for today, append a counter: docs/prd-{YYYY-MM-DD}-v2.md.
PRD structure (full document):
# Product Requirements Document: {Project Name}
## Overview
{Brief description of the product, 2-3 sentences}
## Goals and Success Metrics
{From brief, restated with measurable targets}
## Scope
### In Scope (MVP)
{List of MVP features}
### Out of Scope
{List of explicitly excluded features}
## Epics
{All epics with stories}
## Non-Functional Requirements
{Table of NFRs}
## Definition of Done
{DoD checklist}
## Changelog
| Date | Change | Author |
|------|--------|--------|
When: Timeline is aggressive or product category is well-understood Process: 3-4 epics, 2-3 stories per epic, minimal non-functional requirements, brief DoD. Focus on the highest-risk areas with detailed stories; leave well-understood areas as epic-level descriptions. Best for: Internal tools, well-understood domains, 2-month MVP timeline.
When: New product category, external stakeholder sign-off required, or distributed team Process: 6-8 epics, 4-5 stories per epic, comprehensive NFRs, detailed DoD, user role definitions, data model sketches, error state catalog, accessibility requirements. Best for: Regulated industries, outsourced development, first-of-its-kind products.
When: Product is already live and iterating
Process: Write only the epics and stories for the current iteration. Reference the original PRD for context. Add a changelog section. Do not rewrite the entire PRD.
Output: docs/prd-v2.md or docs/prd-{YYYY-MM-DD}.md with only changed/added epics.
When: Product is primarily an API or platform Process: Epics map to API capabilities rather than user-facing features. Stories include consumer personas (third-party developers). Acceptance criteria include request/response examples and error codes. Include rate limiting, versioning, and documentation requirements.
Writing "System uses Redis cache" instead of "Pages load in under 2 seconds." The PRD describes WHAT, not HOW. Implementation belongs in the tech spec.
"Users can search" is not testable. "Given the user types 'blue shoes' When they press Enter Then results containing 'blue' or 'shoes' are displayed" is testable.
Stories that take more than 3 days should be split. If a story says "and" it probably should be two stories. If the engineer says "this is too big to estimate," split it.
Acceptance criteria should include what happens when things go wrong, not just happy path. Error states, empty states, loading states, and edge cases.
Using "Admin" in one story and "Super Admin" in another without defining the difference. Define all user roles and their permissions in a glossary section.
Without explicit quality gates, stories are "done" when the developer says so. The DoD replaces subjective completion with objective criteria.
Stories that do not trace back to any MVP feature or goal in the brief. Every story must serve a purpose defined in the brief.
Including every possible feature, story, and edge case for V1. The PRD should be scoped to the MVP. Defer non-critical items to V2 with explicit "deferred" labels.
See Step 6 full document structure above.
# PRD: {Project Name}
## Overview
{2-3 sentences}
## MVP Features
- {Feature 1}
- {Feature 2}
- {Feature 3}
## Epics
### Epic 1: {Name}
{Description}
**Story 1: {Title}**
As a... I want to... so that...
- Given... When... Then...
- Given... When... Then...
### Epic 2: {Name}
...
When a story is too large, split using these patterns:
| Metric | Target | How to Measure |
|---|---|---|
| Stories per epic | 3-5 | Count |
| Story completion time | 1-3 days | Developer estimate |
| Acceptance criteria per story | 2-5 | Count |
| Epic-to-brief traceability | 100% | Every epic maps to a brief feature |
| PRD-to-implementation deviation | < 20% | Implemented stories vs planned stories |
docs/prd-{YYYY-MM-DD}-v2.md for updates."System uses Redis cache" is implementation, not a requirement. The requirement is "pages load in under 2 seconds." The PRD describes WHAT, the tech spec describes HOW.
"Users can search" is not testable. "Given the user types 'blue shoes' When they press Enter Then results containing 'blue' or 'shoes' are displayed within 2 seconds" is testable.
Stories that take more than 3 days should be split. If a story says "and" it probably should be two stories.
Acceptance criteria should include what happens when things go wrong, not just happy path. Always include at least one error/edge case scenario.
Using "Admin" in one story and "Super Admin" in another without defining the difference. Define all roles upfront.
The team needs explicit quality gates to know when a story is truly done. The DoD should be agreed upon before the first sprint.
Stories without connection to the brief or business goals. Every story should answer: "Which brief feature does this serve?"
40+ stories for a 3-month MVP. Too many stories means they are too granular or scope is too large. Consolidate or trim.
| Artifact | Purpose | Audience | Detail Level |
|---|---|---|---|
| Product Brief | Define vision and scope | Stakeholders | High |
| PRD | Requirements specification | Product, Design, Engineering | Medium |
| Technical Spec | Implementation details | Engineering | High |
| User Stories | Individual features | Dev + QA | Low-Medium |
| Acceptance Tests | Verification criteria | QA, Automation | Precise |
docs/ directory for change tracking.Output: docs/prd-{YYYY-MM-DD}.md
Next skill: create-adr
Carry forward: brief content, epics list, priority order, non-functional requirements.
` interface EventObserver { onEvent(event: T): Promise; }
class EventBus { private observers: Set<EventObserver> = new Set(); subscribe(observer: EventObserver): void { this.observers.add(observer); } unsubscribe(observer: EventObserver): void { this.observers.delete(observer); } async emit(event: T): Promise { const results = Array.from(this.observers).map(o => o.onEvent(event)); await Promise.allSettled(results); } } `
config: defaults: timeout: 30s retryCount: 3 overrides: production: timeout: 60s retryCount: 5 development: timeout: 300s retryCount: 1
| Metric | Threshold | Severity | Action |
|---|---|---|---|
| Error rate | > 1% over 5min | Critical | Page on-call |
| p99 latency | > 2s over 5min | Warning | Investigate |
| Throughput drop | > 50% over 1min | Critical | Check upstream |
| Queue depth | > 1000 over 1min | Warning | Scale consumers |
| Disk usage | > 85% | Warning | Clean or expand |
| Memory usage | > 90% heap | Critical | Restart or scale |
| Anti-Pattern | Symptom | Root Cause | Solution |
|---|---|---|---|
| Premature optimization | Complex code for no measured benefit | Guessing instead of profiling | Measure first, optimize based on data |
| Copy-paste reuse | Duplicate code across codebase | Lack of abstraction | Extract shared logic into libraries |
| Gold-plating | Features with no current requirement | Over-engineering | YAGNI — build what's needed now |
| Magical thinking | Assumptions without validation | Skipping error handling | Handle all failure modes explicitly |
Cache hierarchy: L1 (in-memory local) → L2 (distributed Redis/Memcached) → L3 (CDN/Edge). Cache invalidation: TTL-based (simple, stale), event-based (complex, fresh), write-through (consistent, higher write latency), write-behind (fast writes, eventual consistency).