acceptance-criteria-writing
Write or audit acceptance criteria for a user story, feature, or requirement. Produces Given/When/Then scenarios with systematic coverage (happy / negative / edge / boundary / accessibility / performance), checks INVEST per story, and splits criteria with SPIDR when the story is too large. Complements user-story-generator.
What this skill does
# Acceptance Criteria Writing
You write or audit acceptance criteria (ACs). Default format is Given/When/Then (Gherkin). Goes beyond `user-story-generator` by providing **systematic coverage** (not just happy path) and **splitting** stories when criteria reveal they're too big.
## Core rules
- **Given/When/Then format** by default (Gherkin): Given [context], When [action], Then [outcome]
- **Scenario coverage systematic**: happy path + ≥1 negative + ≥1 edge + ≥1 boundary + a11y + performance hooks
- **Testable**: each AC expressible as an automated or manual test
- **No implementation leakage**: ACs describe behavior, not how it's built
- **INVEST verified** per story: Independent / Negotiable / Valuable / Estimable / Small / Testable
- **Too-large stories split via SPIDR**: Spike / Path / Interface / Data / Rule
## Input handling
| Dimension | Required | Default |
|---|---|---|
| **Story / feature / requirement** | Yes | — |
| **Mode** (write / audit / split) | No | write (default) |
| **Existing ACs** (audit / split mode) | Only in those modes | — |
| **Format** (Gherkin / rule-based / mixed) | No | Gherkin |
| **Coverage scope** | No | Systematic (happy + negative + edge + boundary + a11y + perf) |
## Phase 1 — Setup
```
**Story / feature / requirement**: [the user story or requirement]
**Mode**: [write / audit / split]
**Format**: [Gherkin / rule-based / mixed]
**Coverage scope**: [minimal / systematic / comprehensive]
```
Ask render mode per `diagram-rendering` mixin and output path (default: `/documentation/[case]/acceptance-criteria-writing/`).
## Phase 2 — Scenario coverage matrix
For systematic coverage, produce ACs across these categories:
| Category | Purpose | Count |
|---|---|---|
| **Happy path** | Main success scenario | ≥1 |
| **Negative** | Invalid input, wrong state | ≥1 |
| **Edge** | Unusual-but-valid (empty, maximum, zero, off-by-one) | ≥1 |
| **Boundary** | At-limits (first/last valid value) | ≥1 |
| **Accessibility** | Keyboard, SR, contrast, target size | ≥1 |
| **Performance** | Timing SLA, responsiveness | Optional — include if critical |
| **Security** | Auth, authorization, injection | If relevant |
| **Data** | Persistence, freshness, consistency | If relevant |
| **Integration** | External system contract | If relevant |
## Phase 3 — Gherkin conventions
### Basic structure
```gherkin
Scenario: [Short descriptive name]
Given [context / preconditions]
And [additional context]
When [action / event]
Then [expected outcome]
And [additional outcome]
```
### Rules
- **Scenario name** is outcome-oriented ("User logs in with valid credentials")
- **Given** states preconditions — state of world before action
- **When** states the triggering action — exactly one per scenario (Gherkin best practice)
- **Then** states expected outcomes — what changed
- **And** / **But** chain additional steps within a clause
- No implementation details ("clicks the blue button" — too UI); behavior level ("submits the form")
- Business vocabulary, not technical
### Scenario outlines (parameterized)
For same logic with different data:
```gherkin
Scenario Outline: Login with invalid credentials shows correct error
Given I am on the login page
When I submit email "<email>" and password "<password>"
Then I see error "<error>"
Examples:
| email | password | error |
| [email protected] | wrong | Invalid credentials |
| notanemail | valid | Email format invalid |
| | valid | Email required |
```
### Background
Shared preconditions for multiple scenarios within a feature:
```gherkin
Background:
Given I am an authenticated user
And I am on the dashboard
```
## Phase 4 — AC-level INVEST check
At the AC level (beyond story level):
| Aspect | Per-AC check |
|---|---|
| **Independent** | Can be tested without requiring other ACs first (or dependencies explicit via Background) |
| **Negotiable** | Describes behavior, not implementation |
| **Valuable** | Tied to a user-visible outcome |
| **Estimable** | Concrete enough that engineer can estimate |
| **Small** | Single focused check; not multi-assertion |
| **Testable** | Automatable or manually verifiable |
If an AC fails INVEST → refactor.
## Phase 5 — Splitting oversized stories (SPIDR)
If ACs reveal the story is too big (>5 scenarios, or >1 week of work), split using SPIDR:
| Split pattern | How | Example |
|---|---|---|
| **Spike** | First iteration is research / learning | "Research payment-gateway options" before "Integrate payment gateway" |
| **Path** | Split by happy / alt / exception paths | "Checkout happy path" vs "Checkout with discount code" vs "Checkout error recovery" |
| **Interface** | Split by platform / channel / UI | "Checkout on web" vs "Checkout on mobile" |
| **Data** | Split by data variation | "Checkout for US customers" vs "Checkout for EU customers" |
| **Rule** | Split by business rule complexity | "Checkout basic" vs "Checkout with coupon + tax + shipping combinations" |
Output: story split proposal with per-sub-story AC allocation.
## Phase 6 — Rule-based ACs (alternative format)
For stories where Gherkin is awkward, rule-based ACs work better:
```
1. User can submit order only when cart is non-empty
2. System validates shipping address against country-specific rules
3. Guest checkout stores order against anonymous session ID
4. Logged-in checkout stores order against user ID
```
Numbered, one rule per line. Use when:
- Complex rules don't fit Given/When/Then naturally
- Multiple combinations need compact expression (consider decision-table-creation for very complex)
## Phase 7 — Mixed format
Combine Gherkin (for scenarios) + rule-based (for invariants):
```
## Rules
1. Orders require authenticated user OR guest session
2. Currency must match user's region
## Scenarios
Scenario: Logged-in user places order
Given I am authenticated
...
```
## Phase 8 — Audit mode (analyzing existing ACs)
For each existing AC:
- **Coverage category** assigned (happy / negative / edge / ...)
- **INVEST assessment** per AC
- **Testability check** — can this be verified?
- **Gaps identified** — missing categories
- **Over-scoping** — AC that should be split
- **Implementation leakage** — AC that's too prescriptive
## Phase 9 — Split mode (too-large story)
Input: a story with many ACs. Output: split proposal.
1. Identify SPIDR pattern that fits
2. Propose sub-story breakdown
3. Assign each existing AC to a sub-story
4. Identify missing ACs per sub-story
5. Validate each sub-story is INVEST-compliant
## Phase 10 — Diagrams
### Coverage summary
```mermaid
pie title AC coverage
"Happy" : 5
"Negative" : 4
"Edge" : 3
"Boundary" : 2
"A11y" : 3
"Performance" : 1
"Security" : 2
```
### Split proposal (if split mode)
Flowchart showing original story + sub-stories with AC allocations.
## Phase 11 — Diagram rendering
Per `diagram-rendering` mixin. File names:
- `ac-coverage.mmd` / `.png`
- `story-split.mmd` / `.png` (if split mode)
## Phase 12 — Report assembly and approval
```markdown
# Acceptance Criteria: [Story / Feature]
**Date**: [date]
**Mode**: [write / audit / split]
**Format**: [Gherkin / rule-based / mixed]
**Coverage**: [minimal / systematic / comprehensive]
## Scope
[Story / feature + mode + format + coverage]
## Story (restated)
[Original user story / requirement]
## Acceptance Criteria
[Gherkin scenarios + rules, organized by coverage category]
## Coverage Matrix
[Category × count + gaps]
## INVEST Check
[Per-story + per-AC]
## Split Proposal (split mode only)
[SPIDR pattern + sub-stories with AC allocations]
## Audit Findings (audit mode only)
[Per existing AC: coverage / INVEST / testability / gaps / leakage]
## Diagrams
[Coverage + split]
## Assumptions & Limitations
[Elicitation gaps, format choice rationale]
```
Present for user approval. Save only after confirmation.
## GeneratioRelated in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.