specification-techniques
Techniques for writing clear product specifications, user stories, and acceptance criteria. Use when defining feature requirements, writing user stories, creating acceptance criteria, or reducing spec ambiguity. Trigger on: 'write a spec', 'acceptance criteria for this feature', 'user story format', 'define requirements', 'Given-When-Then'.
What this skill does
# Specification Techniques Structured methods for translating product vision into clear, actionable requirements that align teams, reduce ambiguity, and enable successful execution. ## Overview Specification techniques help you answer "what" and "why" clearly while leaving "how" flexible for the team to determine. They create shared understanding without being prescriptive about implementation. **Core Principle:** The value of specifications isn't in comprehensive documentation—it's in the conversations and shared understanding they create. A 3-sentence user story that everyone understands is better than a 30-page spec no one reads. **Origin:** Modern specification techniques evolved from software engineering (Karl Wiegers), agile methodologies (Mike Cohn), and design thinking (Alan Cooper). **Key Insight:** Good specifications enable teams to build the right thing, while bad specifications constrain teams and lead to rework. --- ## When to Use This Skill **Auto-loaded by agents**: - `requirements-engineer` - For PRDs, user stories, acceptance criteria, and NFRs **Use when you need to**: - Write product requirements documents (PRDs) - Create user stories with acceptance criteria - Define feature requirements clearly - Document edge cases and error handling - Specify non-functional requirements (performance, security) - Align cross-functional teams on scope - Translate product vision into development tasks --- ## Product Requirements Documents (PRDs) ### Core Structure A well-structured PRD contains: 1. **Overview** - Problem, goals, non-goals, success metrics 2. **Background** - Context, user research, competitive analysis 3. **User Personas** - Primary/secondary users, use cases 4. **Requirements** - Functional and non-functional requirements 5. **User Experience** - Flows, wireframes, interaction details 6. **Technical Considerations** - Architecture, APIs, performance 7. **Success Criteria** - Launch criteria, key metrics 8. **Timeline & Resources** - Milestones, team, risks **Complete Template:** See `assets/prd-structure-template.md` for full PRD structure with examples and best practices. --- ### Essential PRD Components **Problem Statement:** ``` What: Clear description of the problem Who: Who experiences this problem Impact: Business/user impact with data Current: What users do today ``` **Goals and Non-Goals:** - **Goals:** What you want to achieve (measurable) - **Non-Goals:** What you're explicitly not doing (sets boundaries) **Success Metrics:** - Specific, measurable outcomes - Baseline → Target values - Timeline for achievement **Example:** ``` Problem: Users miss critical alerts when not in app, leading to 40% missed events. Goal: Reduce missed alerts from 40% to <15% via email notifications. Non-Goals: - SMS notifications (future scope) - Customizable notification frequency (v1: fixed) Success Metrics: - 60% opt-in to email notifications - 25% reduction in missed alerts - <2% unsubscribe rate ``` --- ## User Stories ### The Standard Format ``` As a [user type] I want [capability] So that [benefit] ``` **Purpose:** Placeholder for conversation, not complete specification. **Example:** ``` As a project manager I want to assign tasks to team members So that everyone knows their responsibilities ``` --- ### INVEST Criteria Framework for evaluating user story quality (Mike Cohn): - **I - Independent:** Can be developed in any order - **N - Negotiable:** Details flexible, not a contract - **V - Valuable:** Delivers user or business value - **E - Estimable:** Team can estimate effort - **S - Small:** Fits within one sprint (1-5 days) - **T - Testable:** Clear acceptance criteria **Complete Guide:** See `references/user-story-writing-guide.md` for detailed explanations, examples, and story splitting patterns. **Template:** See `assets/user-story-template.md` for comprehensive user story template with INVEST checklist. --- ### The 3 Cs Framework (Ron Jeffries) **Card:** Brief story description (placeholder) **Conversation:** Discuss details during planning/refinement (most important) **Confirmation:** Acceptance criteria (how to verify done) **Key Insight:** The conversation is more valuable than the written artifact. --- ## Acceptance Criteria ### Three Formats **Format 1: Given-When-Then (Gherkin/BDD)** ``` Given [precondition/context] When [action/event] Then [expected outcome] And [additional outcome] ``` **Best for:** Behavior-driven development, sequential workflows, automated testing **Example:** ``` Given I am on the login page When I enter valid credentials and click "Login" Then I am redirected to my dashboard And I see a welcome message with my name ``` --- **Format 2: Checklist Style** ``` Acceptance Criteria: - [ ] Criterion 1 - [ ] Criterion 2 - [ ] Criterion 3 ``` **Best for:** Simple features, independent criteria, non-sequential requirements **Example:** ``` - [ ] User can upload JPG, PNG, GIF files - [ ] Maximum file size is 10MB - [ ] Upload progress bar shows percentage - [ ] Error shown if file too large ``` --- **Format 3: Example-Based** ``` Scenario: [Description] Input: [What user provides] Output: [What system produces] ``` **Best for:** Complex calculations, validation rules, data transformations **Example:** ``` Scenario 1: Valid email Input: [email protected] Output: Email accepted Scenario 2: Missing @ symbol Input: userexample.com Output: Error "Email must include @ symbol" ``` **Complete Guide:** See `references/acceptance-criteria-guide.md` for comprehensive guide to writing testable acceptance criteria with all three formats, examples, and best practices. --- ## Job Stories (Jobs-to-be-Done) ### Format ``` When [situation/context] I want to [motivation] So I can [expected outcome] ``` **Difference from User Stories:** - Focuses on context/situation (not persona) - Emphasizes motivation (not implementation) - Better for discovering underlying needs **Example:** ``` When I'm in a meeting and need to reference previous discussions I want to quickly search message history by keyword So I can find relevant context without disrupting the meeting flow ``` **Complete Template:** See `assets/job-story-template.md` for detailed job story structure, examples, and when to use vs. user stories. --- ## Use Cases ### Structure Detailed interaction scenarios documenting step-by-step system behavior. **Components:** - Primary actor and goal - Preconditions and postconditions - Main success scenario (happy path) - Alternative flows (variations) - Exception flows (error handling) **Example Structure:** ``` Use Case: User Registers for Account Primary Actor: New user Goal: Create account to access platform Main Success Scenario: 1. User enters email, password, name 2. System validates inputs 3. System creates account 4. System sends verification email 5. User clicks verification link 6. System activates account ``` **Complete Template:** See `assets/use-case-template.md` for comprehensive use case template with examples of alternative flows, exception handling, and special requirements. --- ## Edge Cases and Error Handling ### Systematic Coverage Document behavior for: **1. Input Validation** - Empty inputs, special characters, invalid formats **2. Permissions** - Unauthenticated, insufficient privileges, expired sessions **3. State Handling** - Empty state, loading state, error state, full state **4. Boundary Conditions** - Zero, one, maximum, just over maximum **5. Time-Based** - Expired tokens, time zones, scheduling **6. Network Issues** - Timeouts, server errors, rate limiting **Example:** ``` Error Scenario: Payment fails due to insufficient funds User Experience: - Error message: "Payment declined - insufficient funds. Please use a different payment method." System Behavior: - Transaction rolled back - User not charged - Order not created - Error logged Recovery Action: - User can update payment method and retry ``` **Com
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.