cratis-specifications-typescript

cratis-specifications-typescript is a skill for Claude Code, Codex from Cratis/AI. It costs 91 tokens per session (1,709 once invoked), scanned A, original, MIT.

A testing guide for writing TypeScript behavior specifications in Cratis's given/when style. It uses Vitest, Chai, and Sinon to set up examples, perform an action, and check one result.

In plain words
What is it for?
Use it to add or restructure Cratis TypeScript specifications, create reusable test setup classes, and organize tests into for/when folders.
Why use it?
It gives tests a consistent structure that describes what the code should do rather than how it is implemented. This reduces confusion when adding or reorganizing TypeScript tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { <ClassName> } from '../../../<ClassName>';.

Good fit Use it to add or restructure Cratis TypeScript specifications, create reusable test setup classes, and organize tests into for/when folders.

Compare 6 skills from other repositories ↓
View source ↗ Cratis/AI
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Cratis/AI
agentmods
npx agentmods add skills/cratis/ai/cratis-specifications-typescript

Made for: Claude Code, Codex.

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 cratis-specifications-typescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/cratis/ai/cratis-specifications-typescript.svg)](https://agentmods.dev/skills/cratis/ai/cratis-specifications-typescript)
Your own site
<a href="https://agentmods.dev/skills/cratis/ai/cratis-specifications-typescript"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-specifications-typescript.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,709 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.
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.00091 $0.01709
Opus 5 $0.00046 $0.00855
Sonnet 5 $0.00018 $0.00342
Haiku 4.5 $0.00009 $0.00171

Measured today against content hash 0fc8b86d37c0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

cratis-specifications-typescript 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 today.

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.

skills/cratis-specifications-typescript/SKILL.md · 203 lines

How it starts

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

Cratis TypeScript specifications

Specifications describe behavior, not implementation. The given() helper and its context class are the TypeScript counterpart of the C# Specification base: setup is separated from the action, and each it() verifies one outcome.

Verified product sources

This skill is verified against the frameworks these specifications run on:

Framework Role
Vitest Test runner (yarn test from the package root)
Mocha-style structure describe, it, beforeEach, afterEach
Chai Assertions, always through the .should fluent interface
Sinon Stubbing and call verification

The given() helper is supplied by the Cratis TypeScript package under specification and is imported from that package root. Reverify the helper's location and signature against the owning repository before relying on a different import path.

Route near misses

  • The specification is C#: use cratis-specifications-csharp instead.
  • The subject is an application view model or React component rather than a Cratis TypeScript package: the plain describe/beforeEach frontend style applies, not the given() helper in this skill.
  • The question is what the code under specification should do: resolve the behavior first; this skill only specifies already decided behavior.

Step 1 — Create the folder structure

Specifications live alongside the source they describe:

for_<ClassName>/
├── given/
│   └── a_<system_under_test>.ts   ← reusable context class
├── when_<behavior>/               ← a behavior with multiple outcomes
│   ├── with_<condition>.ts
│   ├── without_<condition>.ts
│   └── and_<condition>.ts
└── when_<simple_behavior>.ts      ← a single outcome is a single file

Paths read as English sentences. Allowed outcome prefixes are and_, with_, without_, having_, and given_.

when belongs only in a when_<behavior> folder name. A specification file or non-when_ folder must never contain the word when. Fold the context into the when_ folder name and use preposition files for the outcomes. Add a sub-folder under when_ only when that condition has its own multiple outcomes.

Read the full file on GitHub · 203 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today First seen · 203 lines · 91 tokens per session scan A 0fc8b86d37c0

Subscribe to this mod's changes

cratis-specifications-typescript is a skill published in the GitHub repository Cratis/AI (2 stars, last pushed today), licensed MIT. It adds 91 tokens to every session and 1,709 once invoked, about $0.0005 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-09-06.

Related

Other skills, from other repositories

Event Sourcing Testing

Testing event sourcing patterns including event store validation, projection testing, saga orchestration, and event versioning compatibility.

PramodDutta/qaskills · 27 tokens

author-test

Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.

Azure/azure-sdk-for-net · 68 tokens

migrate-xunit-to-mstest

Convert .NET tests from xUnit.net v2/v3 to MSTest v4 while preserving VSTest or MTP. Use for replacing xunit packages, Fact/Theory/InlineData/MemberData, assertions, IClassFixture/ICollectionFixture, ITestOutputHelper, TestContext cancellation, traits/Owner, skips, timeouts, and xUnit parallelization. Also use when a…

managedcode/dotnet-skills · 141 tokens

nunit

Write, run, or repair .NET tests that use NUnit. Use when a repo uses NUnit, [Test], [TestCase], [TestFixture], or NUnit3TestAdapter for VSTest or Microsoft.Testing.Platform execution. USE FOR: writing or reviewing NUnit tests; using [Test], [TestCase], [TestFixture], [SetUp], [TearDown] attributes; configuring…

managedcode/dotnet-skills · 146 tokens

crap-score

Calculates CRAP (Change Risk Anti-Patterns) for a named .NET method, class, or file. USE FOR: explicit CRAP calculation or coverage-and-complexity risk within that named target, including which tests to prioritize. DO NOT USE FOR: project-wide coverage/CRAP, plateaus, or project-wide blockers/priorities…

managedcode/dotnet-skills · 99 tokens

tunit

Write, run, or repair .NET tests that use TUnit. Use when a repo uses TUnit, TUnit.Playwright, [Test], [Arguments], ClassDataSource, SharedType.PerTestSession, or Microsoft.Testing.Platform-based execution. Preserve TUnit's parallel-by-default model and constrain only destructive shared-state collisions. DO NOT USE…

managedcode/dotnet-skills · 89 tokens