writing-specs

writing-specs is a skill for Claude Code from onsi/ginkgo. It costs 120 tokens per session (2,039 once invoked), scanned A, original, MIT.

A guide to writing Ginkgo test specifications in Go, using nested descriptions, test examples, setup, cleanup, and assertions. Ginkgo is a testing framework, and each example is an individual test.

In plain words
What is it for?
Use it to structure suites, choose container and test nodes, initialize fresh data, separate configuration from creation, and build reusable test helpers.
Why use it?
It helps avoid shared test state and makes test names and setup behavior easier to understand.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ginkgo plugin — 13 skills shipped together

Good fit Use it to structure suites, choose container and test nodes, initialize fresh data, separate configuration from creation, and build reusable test helpers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/onsi/ginkgo/writing-specs
About the project

Ginkgo is a Go testing framework for writing organized, expressive specifications, including unit, integration, and performance tests. Go developers use it with the Gomega matcher library to describe behavior and run test suites.

onsi/ginkgo · 9,051 stars · on GitHub · onsi.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add onsi/ginkgo --skill writing-specs
Clone the repo
git clone --depth 1 https://github.com/onsi/ginkgo

Made for: Claude Code.

Or install ginkgo, the plugin that ships this one along with the rest of its 13 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-specs

README.md
[![agentmods](https://agentmods.dev/badge/skills/onsi/ginkgo/writing-specs.svg)](https://agentmods.dev/skills/onsi/ginkgo/writing-specs)
Your own site
<a href="https://agentmods.dev/skills/onsi/ginkgo/writing-specs"><img src="https://agentmods.dev/badge/skills/onsi/ginkgo/writing-specs.svg" alt="Measured on agentmods" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00120 $0.02039
Opus 5 $0.00060 $0.01019
Sonnet 5 $0.00024 $0.00408
Haiku 4.5 $0.00012 $0.00204

Measured 9d ago against content hash 45acbd3bd354, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

writing-specs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ginkgo/skills/writing-specs/SKILL.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing Ginkgo specs

Assumes Ginkgo is wired into the suite (ginkgo:setup) and you know the two-phase model (ginkgo:overview). Docs: https://onsi.github.io/ginkgo/#writing-specs.

The shape of a spec

var _ = Describe("Books", func() {
	var book *books.Book          // declare here...

	BeforeEach(func() {
		book = &books.Book{        // ...initialize here, fresh per spec
			Title:  "Les Miserables",
			Author: "Victor Hugo",
			Pages:  2783,
		}
		Expect(book.IsValid()).To(BeTrue()) // assertions in setup are fine
	})

	Describe("categorizing", func() {
		Context("with more than 300 pages", func() {
			It("is a novel", func() {
				Expect(book.Category()).To(Equal(books.CategoryNovel))
			})
		})
	})
})
  • Containers (Describe/Context/When) organize; they're identical — pick the one that reads as a sentence. Subjects (It/Specify) hold the assertions; one spec runs per It.
  • The spec's full name is the concatenation of every container text plus the It text — write them to read as a phrase.

The rule that prevents most bugs: declare in container, initialize in setup

Container bodies run once, at tree-construction time (ginkgo:overview). So:

  • Declare shared variables in the container body (var book *books.Book).
  • Initialize them in BeforeEach so each spec gets a clean copy.
// WRONG — runs once at construction; every spec shares & pollutes one book
var _ = Describe("Books", func() {
	book := &books.Book{Pages: 2783}   // initialized at construction time
	It("mutates", func() { book.Pages = 0 })
	It("expects 2783", func() { Expect(book.Pages).To(Equal(2783)) }) // flaky under randomization
})

The same trap explains: no assertions in container bodies (they fire at construction, with no spec active) and no expensive/stateful work in container bodies. If you see logic directly inside a Describe/Context/When body, it almost always belongs in a BeforeEach.

Setup and cleanup nodes — and their ordering

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 155 lines · 120 tokens per session scan A 45acbd3bd354

Subscribe to this mod's changes

writing-specs is a skill published in the GitHub repository onsi/ginkgo (9,051 stars, last pushed 28d ago), licensed MIT. It adds 120 tokens to every session and 2,039 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

write-fixture

Write Java/Kotlin tests with Fixture Monkey — enumerate the cases a method can produce, pick the ones worth testing, and build each fixture pinning only the properties that force the expected outcome.

naver/fixture-monkey · 42 tokens

Codeception Testing

Expert-level Codeception testing skill for PHP applications. Covers acceptance, functional, and unit testing with the Actor pattern, BDD-style syntax, Page Objects, API testing, and database helpers.

PramodDutta/qaskills · 42 tokens

Jasmine Testing

BDD-style JavaScript testing with Jasmine covering spies, async patterns, custom matchers, clock manipulation, and comprehensive test organization for frontend and Node.js applications.

PramodDutta/qaskills · 35 tokens

plugin-test

A testing guide for Zhin.js plugins using Vitest, a JavaScript and TypeScript testing framework. It focuses on checking command and tool behavior, ordinary business logic, and the plugin package’s required structure.

zhinjs/zhin · 51 tokens

testing-expert

Expert-level software testing with unit tests, integration tests, E2E tests, TDD/BDD, and testing best practices. Use when the user mentions TDD, BDD, unit tests, integration tests, or end-to-end tests, or when the task involves Testing Fundamentals, Unit Testing, Integration Testing, or End-to-End Testing.

personamanagmentlayer/pcl · 73 tokens

testing-strategies

Use when writing tests, setting up test frameworks, implementing mocking strategies, or establishing testing best practices (unit, integration, E2E) across any technology stack.

MadAppGang/claude-code · 38 tokens