cratis/ai.distribution/cratis-specs-typescript
Claude Code and agent skill by cratis/ai.distribution
- community
Checking that the SKILL.md file is still in the repository.
Step-by-step guidance for writing TypeScript specs in Cratis using BDD-style Specification by Example — the given()/describe/it pattern, for_/when_/ folder hierarchy, reusable context classes, Sinon mocking, and Chai assertions. Use whenever writing TypeScript specs or tests, creating spec files/folders, using the given() helper, mocking with sinon.createStubInstance or sinon.stub, asserting with Chai .should, or understanding how yarn test runs specs.
Install
npx vskill@latest install cratis/ai.distribution/cratis-specs-typescriptSKILL.md
The same SKILL.md was published earlier as cratis/ai.distribution/cratis-specs-typescript.
Core philosophy
Same BDD philosophy as C# specs — specs describe behaviors, not implementations. The given() helper + context class mirrors the C# Specification base class: setup is separated from the action, each it() verifies a single outcome.
Step 1 — Create the folder structure
Example:
Step 2 — Write a reusable context class
Properties are public (unlike C# protected fields) — tests access them via context.propertyName.
Step 3 — Write a spec using given()
Step 4 — Simple spec (no shared context)
For behaviors without shared setup:
Naming conventions
| Element | Convention | Example | |
|---|---|---|---|
describe() text | Natural language sentence | 'when registering with valid name' | |
it() text | Starts with "should", uses spaces | 'should append an event' | |
| Context class | a_ or an_ prefix | an_author_service | |
| Spec file | Descriptive, with_ / without_ / and_ | with_valid_name.ts |
Always use spaces in `it()` descriptions — never underscores.
Behavior isolation rule
Keep one primary behavior per spec file/folder. Do not mix orthogonal behaviors in one spec.
- Good: separate folders for delta semantics:
when_items_are_added_as_delta/and_item_is_identified_by_a_guid.tswhen_items_are_removed_as_delta/and_item_is_identified_by_a_guid.ts- Avoid: a single file that validates both add-delta and remove-delta behavior.
This keeps failures precise and prevents unrelated behavior from becoming tangled in one spec.
Running specs
Reference files
references/typescript-patterns.md— Chai assertions, Sinon patterns, async specs, full examples
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cratis-specs-typescript/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cratis/ai.distribution/cratis-specs-typescript)