internal/skills/content/create-prd/SKILL.md
Product Requirements Document (PRD) creation workflow. Use when defining implementation requirements for complex features, new subsystems, or any task affecting more than 10 files.
npx skillsauth add ar4mirez/samuel create-prdInstall 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.
Structured approach to defining complex features before implementation.
Use When: COMPLEX mode triggered (affects >10 files, new subsystem, unclear scope) 4D Phase: Deconstruct → Diagnose (planning stage)
Guide AI in creating a detailed Product Requirements Document (PRD) in Markdown format based on user's feature request. The PRD should be clear, actionable, and suitable for junior developers to understand and implement.
✅ Use PRD workflow when:
❌ Skip PRD for:
User provides brief description or request for new feature.
Example:
"Build user authentication with email/password and OAuth"
Before asking questions, AI should:
Read CLAUDE.md (if exists) for:
Scan codebase for:
Review relevant guardrails from CLAUDE.md:
IMPORTANT: Ask clarifying questions to gather detail. Focus on "what" and "why", not "how" (developer figures that out).
Provide numbered/lettered options for easy user responses.
1. Problem/Goal
2. Target Users
3. Core Functionality
4. User Stories
5. Acceptance Criteria
6. Scope/Boundaries
7. Data Requirements
8. UI/UX Expectations
9. Integration Points
10. Edge Cases & Errors
11. Performance & Scale
12. Security Requirements
Based on initial request and clarifying question answers, generate PRD using structure below.
Target audience: Junior developer (clear, explicit, no jargon)
Before presenting PRD, check:
Save as: .claude/tasks/[NNNN]-prd-[feature-name].md
Numbering: Zero-padded 4-digit sequence (0001, 0002, etc.)
Examples:
.claude/tasks/0001-prd-user-authentication.md.claude/tasks/0002-prd-dashboard-analytics.mdAfter saving PRD:
.claude/tasks/NNNN-prd-feature-name.md"@.claude/skills/generate-tasks/SKILL.md with this PRD."The generated PRD must include these sections:
Example:
## Introduction
This feature adds user authentication to the platform, allowing users to create accounts, log in securely, and access personalized content. Currently, the application has no user identity management, limiting personalization and security.
**Goal**: Enable secure user authentication with email/password and social OAuth providers.
List specific, measurable objectives for this feature.
Format: Numbered list, actionable, measurable
Example:
## Goals
1. Allow users to create accounts with email and password
2. Enable login via Google and GitHub OAuth
3. Implement secure session management with JWT
4. Achieve <200ms authentication response time
5. Support password reset flow
6. Maintain >95% test coverage for auth logic
Detail user narratives describing feature usage and benefits.
Format: "As a [user type], I want to [action] so that [benefit]"
Example:
## User Stories
**US-001**: As a new user, I want to create an account with my email and password so that I can access personalized features.
**US-002**: As a returning user, I want to log in quickly with my Google account so that I don't have to remember another password.
**US-003**: As a user who forgot their password, I want to reset it via email so that I can regain access to my account.
**US-004**: As an admin, I want to view user authentication logs so that I can monitor security events.
List specific functionalities the feature must have.
Format: Numbered, clear, concise (e.g., "The system must allow X")
Example:
## Functional Requirements
### Authentication
FR-001: The system must allow users to register with email and password
FR-002: The system must validate email format and password strength (min 8 chars, 1 number, 1 special char)
FR-003: The system must support OAuth login via Google and GitHub
FR-004: The system must generate and validate JWT tokens for session management
FR-005: The system must implement token refresh mechanism (1h expiration, 7d refresh)
### Password Management
FR-006: The system must hash passwords using bcrypt (cost factor: 12)
FR-007: The system must provide password reset via email link (1h expiration)
FR-008: The system must prevent password reuse (last 3 passwords)
### Security
FR-009: The system must implement rate limiting (5 failed attempts = 15min lockout)
FR-010: The system must validate all inputs against XSS and SQL injection
FR-011: The system must log all authentication events (success, failure, logout)
Clearly state what this feature will NOT include to manage scope.
Example:
## Non-Goals
- ❌ Two-factor authentication (2FA) - Deferred to v2
- ❌ Single Sign-On (SSO) integration - Future enhancement
- ❌ Biometric authentication - Not in scope
- ❌ Account deletion workflow - Separate feature
- ❌ Social media posting permissions - OAuth login only
Mention technical constraints, dependencies, or implementation suggestions.
Check CLAUDE.md for existing tech stack before suggesting
Example:
## Technical Considerations
### Tech Stack Integration
- Backend: Use existing Express.js framework
- Database: Add `users` and `sessions` tables to PostgreSQL
- ORM: Use Prisma (already in project)
- Validation: Use Zod for input validation (project standard)
### Architecture
- Follow repository pattern (existing project convention)
- Create `/api/auth` route group
- Implement middleware for JWT validation
- Use existing error handling patterns
### Dependencies
- New: `bcrypt`, `jsonwebtoken`, `passport`, `passport-google-oauth20`, `passport-github2`
- Check: All dependencies for known vulnerabilities before adding
### File Organization (respecting guardrails)
- `src/auth/` - Main auth module (<300 lines per file)
- `auth.controller.ts` - Route handlers
- `auth.service.ts` - Business logic
- `auth.middleware.ts` - JWT validation
- `auth.types.ts` - TypeScript types
- `src/db/schemas/` - Database schemas
- `user.schema.ts`
- `session.schema.ts`
- Tests alongside each file
Link to mockups, describe UI/UX requirements, or mention components/styles.
Example:
## Design Considerations
### UI Components
- Use existing `<Form>`, `<Input>`, `<Button>` components from design system
- Create new `<AuthLayout>` component for login/register pages
- Follow existing color scheme and spacing guidelines
### User Flow
1. Landing → Click "Sign Up"
2. Registration form (email, password, confirm password)
3. Email verification sent
4. Verify email → Redirect to dashboard
5. OR: Click "Continue with Google" → OAuth flow → Dashboard
### Error Handling
- Show validation errors inline below each field
- Display auth errors in toast notifications (existing pattern)
- Provide clear, actionable error messages
### Accessibility
- All forms keyboard navigable
- Proper ARIA labels
- Focus management on error states
Identify which CLAUDE.md guardrails are critical for this feature.
Example:
## Guardrails Affected
### Security (CRITICAL)
- ✓ All user inputs validated before processing
- ✓ All API boundaries have input validation (Zod schemas)
- ✓ All database queries parameterized (use Prisma)
- ✓ All environment variables have secure defaults (JWT_SECRET, OAuth keys)
- ✓ All file operations validate paths (password reset token validation)
- ✓ Dependencies checked for vulnerabilities
### Testing (CRITICAL)
- ✓ Coverage targets: >95% for auth logic (business-critical)
- ✓ All public APIs have unit tests
- ✓ All bug fixes include regression tests
- ✓ Edge cases tested (null, empty, invalid tokens, expired sessions)
### Code Quality
- ✓ No file exceeds 300 lines (split auth.service.ts if needed)
- ✓ Cyclomatic complexity ≤ 10 per function
- ✓ All exported functions have type signatures and JSDoc
### Performance
- ✓ API responses < 200ms for login/register
- ✓ No N+1 queries (eager load user data with sessions)
How will success be measured?
Example:
## Success Metrics
### Technical Metrics
- Authentication response time < 200ms (p95)
- Test coverage >95% for auth module
- Zero critical security vulnerabilities
- <1% authentication failure rate (excluding incorrect credentials)
### Business Metrics
- 80% of users complete registration flow
- 50% of users choose OAuth over email/password
- <5% password reset requests (indicates good UX)
### Security Metrics
- Zero successful brute force attacks
- 100% of authentication events logged
- Password reset links expire correctly (100% success rate)
Rough complexity estimate (tokens, not time)
Example:
## Implementation Estimate
### Complexity Analysis
- **Backend Auth Logic**: ~15,000 tokens (COMPLEX)
- **OAuth Integration**: ~10,000 tokens (FEATURE)
- **UI Components**: ~8,000 tokens (FEATURE)
- **Tests**: ~12,000 tokens (FEATURE)
- **Documentation**: ~3,000 tokens (ATOMIC)
**Total**: ~48,000 tokens (COMPLEX mode justified)
### Recommended Approach
1. Use COMPLEX mode with full task breakdown
2. Implement in phases (email auth → OAuth → password reset)
3. Each phase with its own task list
4. Frequent checkpoints after each subtask
List remaining questions or areas needing clarification.
Example:
## Open Questions
1. **Email Service**: Which provider? (SendGrid, AWS SES, Mailgun)
2. **Session Storage**: Redis for sessions or JWT-only?
3. **User Roles**: Do we need RBAC (roles/permissions) in this version?
4. **Profile Data**: What user profile fields beyond email/name?
5. **Existing Users**: Migration strategy for existing data (if any)?
**Action**: Clarify these before generating task list.
File: .claude/tasks/NNNN-prd-feature-name.md
Format: Markdown
Audience: Junior developer + AI assistant
CLAUDE.md (maintain consistency).claude/tasks/NNNN-prd-feature-name.md@.claude/skills/generate-tasks/SKILL.md with this PRD."Remember: A good PRD prevents scope creep, aligns stakeholders, and makes implementation straightforward. Invest time here to save time later.
development
Zig language guardrails, patterns, and best practices for AI-assisted development. Use when working with Zig files (.zig), build.zig, or when the user mentions Zig. Provides comptime patterns, allocator conventions, C interop guidelines, and testing standards specific to this project's coding standards.
tools
WordPress framework guardrails, patterns, and best practices for AI-assisted development. Use when working with WordPress projects, or when the user mentions WordPress. Provides theme development, plugin architecture, REST API, blocks, and security guidelines.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs. Use when testing web apps, automating browser interactions, or debugging frontend issues.
tools
Suite of tools for creating elaborate, multi-component web applications using modern frontend technologies (React, Tailwind CSS, shadcn/ui). Use for complex projects requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX pages.