spec-driven-spock
Use Spock 2.x metadata annotations (@Title, @Narrative, @Subject, @See, @Issue, @PendingFeature, @Unroll, @Snapshot) to make Spock specs act as executable design documentation — each spec tied to the ADR, ticket, or design doc it exercises. Use this skill whenever the user is writing or refactoring a Spock test, drafting an ADR that should ship with an executable contract, pinning design decisions to tests, splitting a large spec, marking unimplemented behaviour as pending, or wants the test suite to read as a self-documenting checklist of what the design promises — even if they do not explicitly mention Spock annotations.
What this skill does
# Spec-driven Spock
Spock has a small but underused set of metadata annotations that turn an
ordinary `Specification` into living design documentation:
| Annotation | What it pins |
| ----------------- | ------------------------------------------------------------------------ |
| `@Title` | One-line statement of what the spec is about (class) |
| `@Narrative` | Multi-line "given / so that" backstory (class) |
| `@Subject` | The class under test (class or field) |
| `@See` | URL(s) to external references — ADR, RFC, ticket, docs (class or method) |
| `@Issue` | URL(s) to issues / tickets specifically (class or method) |
| `@PendingFeature` | Marker for a not-yet-implemented behaviour — see below |
| `@Unroll` | Per-row report names for data-driven specs |
| `@Snapshot` | Inject a snapshot for snapshot-driven tests (Spock 2.4+) |
Spock renders these into HTML reports and surfaces them in IDE plugins,
which is why they pay rent. Stuffing the same information into Groovydoc
comments is invisible to the runtime.
For the per-annotation cheat sheet, read [references/annotations.md](references/annotations.md).
## When to reach for this skill
- A spec exists but a reader can't tell _why_ it's there. Add `@Title` + `@Narrative` + `@See`.
- A design decision (ADR, RFC, issue) lands and you want a test that fails if the decision is silently abandoned. Use the **executable contract** pattern.
- A class spec has grown past ~250 lines and now mixes audiences. Split by concern, give each new file its own `@Title`/`@Narrative`.
- A flag matrix or exit-code table is duplicated across N specs. Collapse with `@Unroll`.
- A behaviour is documented but not yet implemented. Pin it as `@PendingFeature` — Spock fails CI if the implementation lands without the marker being removed.
## Pattern 1 — Class-level scaffold
Every non-trivial spec should open with this header:
```groovy
@Title("One sentence — what is this spec asserting?")
@Narrative('''
Given/so-that prose. Two or three short paragraphs at most. Explain
the *audience* for this spec and what kind of change should make this
spec evolve.
''')
@See([
"https://github.com/<org>/<repo>/blob/master/adr/YYYYMMDD-<title>.md",
"https://github.com/<org>/<repo>/pull/<n>"
])
@Subject(ClassUnderTest)
class MyFeatureSpec extends Specification { ... }
```
The `@See` URLs render as links in Spock HTML reports and most IDE
plugins, so prefer stable URLs (a merged file path, a PR number, an
issue URL) over local paths.
## Pattern 2 — Per-method `@See`
Each feature method links to _its_ design source:
```groovy
@See("https://github.com/<org>/<repo>/blob/master/adr/2026-foo.md#d3--checksum-only")
def 'file outputs are compared by recorded checksum only'() {
expect: ...
}
```
Use `@Issue` instead of `@See` when the link is specifically a bug or
ticket. Both accept a single String or a list of Strings, and both can
be repeated on the same target (Spock allows multiple `@See` annotations
on one feature).
Don't add a `@See` if the only reasonable link is the file the test is
already in — that's noise.
## Pattern 3 — The executable contract
When an ADR / RFC lands, ship an executable contract alongside it: every
numbered decision becomes a `@PendingFeature` stub that runs but stays
skipped until the implementation fills it in.
```groovy
@PendingFeature
@See("https://github.com/.../adr/foo.md#d7--auto-detect-ci")
def 'CI=true switches default output mode to --json'() {
expect: false
}
```
Why `expect: false`?
- Spock's `@PendingFeature` skips a test that fails and **fails the build if it passes**.
- A body of `expect: false` always fails, so the stub stays skipped — green CI.
- When a dev implements the behaviour, they replace the body with a real assertion. If they forget to remove `@PendingFeature`, the now-passing test triggers Spock's unexpected-pass and CI goes red — that's the signal.
- A bare empty body won't compile (Spock requires at least one `expect`/`then`/`when` block).
This is the killer pattern for ADR-driven development. See
[references/adr-contract-pattern.md](references/adr-contract-pattern.md)
for a full worked example (a 4-file split of an 18-decision ADR), and
[assets/contract-spec-template.groovy](assets/contract-spec-template.groovy)
for a copy-pasteable skeleton.
## Pattern 4 — `@Unroll` for table-driven contracts
When the ADR / design pins a matrix (exit codes, format flags, status
columns), use one `@Unroll` spec instead of N copy-pasted methods:
```groovy
@Unroll
@PendingFeature
@See("https://.../adr/foo.md#d6--exit-codes")
def 'exit code is #code when #scenario'() {
expect: false
where:
code | scenario
0 | 'runs are semantically equivalent'
1 | 'runs differ in any failing category'
2 | 'load failure or schema mismatch'
}
```
Spock renders each row as a separately-named test (`exit code is 0 when runs are semantically equivalent`), so the HTML report reads as if you wrote three methods, but the source stays DRY.
## Pattern 5 — Splitting large contracts
If a contract spec passes ~250 lines or mixes audiences, split it.
Naming heuristic: one file per concern, one concern per audience.
For the lineage-validate ADR (18 decisions / 46 stubs), the split was:
| File | Decisions | Audience |
| -------------------------------- | ---------------------- | ------------------- |
| `LineageValidateCliFlagsSpec` | flags, env, exit codes | pipeline authors |
| `LineageValidateEquivalenceSpec` | equivalence rules | reviewers |
| `LineageValidateBaselineSpec` | resolver SPI, schema | plugin authors |
| `LineageValidateReportingSpec` | diff shape, categories | tooling integrators |
Each file gets its own `@Title` / `@Narrative` / class-level `@See`.
Each method keeps its own `@See` to the specific decision.
The split is _organisational_, not structural — the implementation
side stays a single shared core. Resist proliferating implementation
classes to match the spec split.
## Pattern 6 — `@Snapshot` for snapshot-driven specs
Spock 2.4 ships first-class snapshot support. Inject a `Snapshotter`
into the spec, point it at a directory, assert against it:
```groovy
@Snapshot
Snapshotter snapshotter
def 'renders the report as documented'() {
expect:
snapshotter.assertThat(actualReport).matchesSnapshot()
}
```
Set `spock.snapshots.update=true` (or run with `-Dspock.snapshots.update=true`) to refresh snapshots when the contract intentionally changes. Keep the snapshot files in version control next to the spec so a PR's diff shows the contract change explicitly.
## Pitfalls
- **Don't reference a `static final String` URL inside `@See` or `@Issue`.** Annotation values must be compile-time constants, and Java/Groovy reject `STATIC + "#section"` concatenation in annotation arguments. Inline the full literal URL.
- **Don't put `@Subject` on a field that isn't actually the SUT.** It's a documentation hint, not a wiring directive — claiming the wrong subject misleads readers.
- **Don't use `@PendingFeature` as a way to silence a flaky test.** The marker is for "designed but not yet implemented", not "we know it's broken." Use `@Ignore` (with a reason) for flake.
- **Don't lose the safeguard.** If you remove `@PendingFeature` from a stub _without_ replacing the body, you get a normal red build — that's fine. But never leave a `@PendingFeature` stub with a body that always passes (e.g., `expect: true`); Spock will fail the build immediately, which defeats the contract.
- **GitHub anchors are fragile.** Section headers change, anchor slugs drift. When the ADR is in the same repo, prefer linking toRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.