requirement-patterns
This skill should be used when writing requirements, specifications, or user stories. Triggers on phrases like "write requirements", "create spec", "define user stories", "document feature", "specify behavior", "what should the system do", or when reviewing specification quality. Provides patterns for clear, testable, unambiguous requirements.
What this skill does
# Requirement Writing Patterns Write requirements that are clear, testable, and unambiguous. Good requirements prevent implementation confusion and reduce clarification cycles. ## Quick Reference ### The INVEST Criteria for User Stories | Letter | Criterion | Test | |--------|-----------|------| | **I** | Independent | Can be implemented without other stories | | **N** | Negotiable | Details can be discussed, not locked | | **V** | Valuable | Delivers user/business value | | **E** | Estimable | Team can estimate effort | | **S** | Small | Fits in one sprint/iteration | | **T** | Testable | Has clear acceptance criteria | ### Requirement Levels | Level | Format | Use When | |-------|--------|----------| | **Epic** | High-level capability | Planning roadmaps | | **Feature** | User-facing functionality | Release planning | | **User Story** | As a [role], I want [goal], so that [benefit] | Sprint planning | | **Acceptance Criterion** | Given/When/Then | Implementation guidance | ## Writing Testable Requirements ### The "Shall" Pattern For formal requirements, use "shall" for mandatory and "should" for recommended: ```markdown REQ-001: The system shall authenticate users via OAuth 2.0. REQ-002: The system shall reject requests without valid tokens with HTTP 401. REQ-003: The system should cache tokens for up to 1 hour. ``` ### The User Story Pattern For agile contexts, use the standard format: ```markdown As a [specific role], I want [concrete action], So that [measurable benefit]. ``` **Good example:** ```markdown As a registered user, I want to reset my password via email link, So that I can regain access within 5 minutes without contacting support. ``` **Bad example:** ```markdown As a user, I want better security, So that things work properly. ``` ### Acceptance Criteria (Given/When/Then) Every requirement needs testable acceptance criteria: ```markdown **Given** a registered user with a valid email **When** they request a password reset **Then** they receive an email within 30 seconds **And** the link expires after 24 hours **And** clicking the link allows setting a new password ``` ## Ambiguity Markers to Avoid These words indicate vague requirements that need refinement: | Marker | Problem | Fix | |--------|---------|-----| | "properly" | Undefined correctness | Specify exact behavior | | "quickly" | No metric | Add time constraint (e.g., "<200ms") | | "user-friendly" | Subjective | Define specific UX criteria | | "secure" | Vague | List specific security controls | | "etc." | Incomplete list | Enumerate all items or state "including but not limited to" | | "appropriate" | Undefined standard | Specify the standard | | "as needed" | Undefined trigger | Define when/what triggers | | "may/might" | Uncertain scope | Decide: is it in scope or not? | ## Requirement Identifiers Use consistent ID schemes for traceability: ```markdown REQ-001 # Simple sequential FR-001 # Functional requirement NFR-001 # Non-functional requirement SEC-001 # Security requirement PERF-001 # Performance requirement ``` ## Constraints vs Requirements **Requirements** = What the system must DO **Constraints** = Limits on HOW it's built ```markdown ## Requirements - REQ-001: System shall support 1000 concurrent users ## Constraints - CON-001: Must use PostgreSQL 14+ - CON-002: Must deploy to AWS - CON-003: Budget limit $500/month infrastructure ``` ## Common Anti-Patterns | Anti-Pattern | Example | Fix | |--------------|---------|-----| | **Solution masquerading as requirement** | "Use Redis for caching" | "Response time < 100ms for cached data" | | **Compound requirement** | "System shall authenticate and authorize" | Split into REQ-001 (auth) and REQ-002 (authz) | | **Unmeasurable quality** | "System shall be fast" | "95th percentile latency < 200ms" | | **Missing actor** | "Data shall be validated" | "System shall validate user input before storage" | | **Assumed knowledge** | "Standard security practices" | List specific practices or reference standard | ## Integration with SpecKit When writing specs for `/speckit.plan`: 1. **Use REQ-XXX identifiers** - Enables traceability to tasks 2. **Include acceptance criteria** - Becomes task verification 3. **Mark unknowns as [TBD]** - `/speckit.clarify` will find them 4. **Group by domain** - Enables domain-specific plans ## Additional Resources For detailed patterns and examples, see: - **`references/anti-patterns.md`** - Common mistakes with fixes - **`references/examples.md`** - Complete requirement examples by domain ## Verification Checklist Before finalizing requirements: - [ ] Every requirement has a unique identifier - [ ] No vague adjectives (properly, quickly, appropriately) - [ ] Each requirement is testable with clear criteria - [ ] Requirements are independent (no hidden dependencies) - [ ] Constraints are separated from requirements - [ ] Unknowns are marked [TBD] for clarification
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.