Agent skill

Context

by counterfact in counterfact/api-simulator

Add and evolve Counterfact context classes in .context.ts files, including required unit test coverage for context behavior.

MITAuto-check passedTesting & QA

Install Context

skills CLI
$ npx skills add counterfact/api-simulator --skill context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install counterfact/api-simulator context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/counterfact/api-simulator.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/context .claude/skills/context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
context
GitHub stars
170
Token cost
~384 tokens
SKILL.md length
160 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Add and evolve Counterfact context classes in .context.ts files, including required unit test coverage for context behavior.

  • Works in 4 steps: Update or add methods in… → Keep route files calling these methods… → Add/adjust unit tests for the changed… → …
  • Tasks that involve Unit testing
  • SKILL.md covers Purpose, What _.context.ts is for, Context class API expectations and Required rules, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Context is an agent skill from counterfact/api-simulator. Add and evolve Counterfact context classes in .context.ts files, including required unit test coverage for context behavior.

Its SKILL.md is about 380 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing and OpenAPI specifications. It works with OpenAPI. The repository describes itself as: Turn an OpenAPI spec into a local API in one command. Build and test your frontend with custom responses, shared state, and simulated failures, without waiting for the backend. The licence is MIT.

When your agent uses it

  • Tasks that involve Unit testing
  • Tasks that involve OpenAPI specifications

Example prompts

  • “/context”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Update or add methods in routes/**/_.context.ts.
  2. Keep route files calling these methods via $.context.
  3. Add/adjust unit tests for the changed context methods.
  4. If sample data is needed, add/update a scenario function instead of hardcoding

What it can do on your machine

Read from SKILL.md and the folder at commit 403e3e5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • counterfact.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context loads about 384 tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 160 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~384

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from counterfact/api-simulator at commit 403e3e5, republished under its MIT licence (© counterfact). 160 words, ~384 tokens.

Download SKILL.mdSave it as .claude/skills/context/SKILL.md (or your agent's skills folder).
name
context
description
Add and evolve Counterfact context classes in _.context.ts files, including required unit test coverage for context behavior.
applyTo
**/_.context.{ts,js}, **/routes/**/_.context.ts, **/*context.{ts,js}, packages/counterfact/test/**/*.test.ts

Context Skill

Purpose

Define and maintain stateful business logic in _.context.ts files.

What _.context.ts is for

A _.context.ts file owns state and business rules for a route subtree. Handlers call methods on $.context; they should not implement core logic inline.

Context class API expectations

  • Expose methods for domain actions (create/read/update/delete/query).
  • Keep state private where possible.
  • Return plain values that route handlers can map to HTTP responses.
  • Use clear method names that describe behavior (not transport concerns).

Required rules

  • Any new or modified context method must include unit tests.
  • Test the Context class directly (no server boot required).
  • Do not populate dummy data directly in context changes.
  • Delegate dummy data creation/seeding to scenario modules under scenarios/.

Step-by-step

  1. Update or add methods in routes/**/_.context.ts.
  2. Keep route files calling these methods via $.context.
  3. Add/adjust unit tests for the changed context methods.
  4. If sample data is needed, add/update a scenario function instead of hardcoding defaults in context constructors.

References

© counterfact, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/context of counterfact/api-simulator.

Open the folder on GitHubat commit 403e3e5

Compare with similar skills

Context next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context this skillcounterfact/api-simulator170—~384Automated safety check: PassMIT
API Test Suite Builderborghei/Claude-Skills874—~1.6kAutomated safety check: PassMIT
NestJS ExpertJeffallan/claude-skills12k—~2kAutomated safety check: PassMIT
Cloud Agents Starterscalar/scalar16k—~1.4kAutomated safety check: PassMIT
703 Technologies Fuzzing Testingjabrena/plinth445—~874Automated safety check: PassApache-2.0
Contract Testingpetrkindlmann/qa-skills163—~4.1kAutomated safety check: PassMIT

Similar skills

  • API Test Suite Builder

    borghei/Claude-Skills

    Generate API test suites from route definitions across frameworks: auth, input validation, contract, k6 load testing, mocking, and OpenAPI-driven generation.

    874 GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • NestJS Expert

    Jeffallan/claude-skills

    Scaffolds NestJS modules, controllers, services, DTOs and guards for TypeScript backends, with validation, JWT and Passport auth, Swagger docs and unit and E2E tests.

    12k GitHub stars~2k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Minimal starter runbook for cloud agents to install dependencies, run packages, execute tests, and troubleshoot the Scalar monorepo quickly.

    16k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • A skill your agent uses when you need to add or review fuzz testing for Java APIs with CATS — including contract-driven negative testing, malformed payload validation, boundary input exploration, CI…

    445 GitHub stars~874 tokensUpdated today
    Testing & QAAuto-check passed
  • Contract Testing

    petrkindlmann/qa-skills

    Implement consumer-driven contract testing with Pact-JS (v16).

    163 GitHub stars~4.1k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Type Safety

    idavidov13/agentic-playwright

    TypeScript type safety conventions for the Playwright scaffold — the "no any" rule, Zod 4 schema patterns (z.strictObject, top-level validators like z.uuid / z.email / z.url / z.int / z.enum)…

    223 GitHub stars~3.5k tokensUpdated 6 days ago
    Testing & QAAuto-check passed

More from counterfact/api-simulator

All 12 skills in this repo
  • Counterfact PR Creation

    counterfact/api-simulator

    Create Counterfact pull requests with the required agent-authored acceptance and repository-learning notes; do not use to review another PR.

    170 GitHub stars~918 tokensUpdated yesterday
    Auto-check passed
  • Counterfact Repl

    counterfact/api-simulator

    Interact with Counterfact mock API server programmatically. An agent skill from counterfact/api-simulator.

    170 GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • Build Simulation

    counterfact/api-simulator

    Build a fully simulated API from an OpenAPI spec using Counterfact.

    170 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Counterfact Maintenance

    counterfact/api-simulator

    Keep contributor changes aligned with repository test patterns, diagnostics, black-box test boundaries, release/versioning workflow, documentation requirements, and compatibility.

    170 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Counterfact Repo Basics

    counterfact/api-simulator

    Provide Counterfact repository orientation, high-level architecture, and the canonical command reference for install/build/test/lint workflows.

    170 GitHub stars~868 tokensUpdated yesterday
    Auto-check passed
  • Route

    counterfact/api-simulator

    Edit Counterfact route files to add endpoint behavior while keeping handlers thin and delegating business logic to context classes.

    170 GitHub stars~341 tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Context

What does Context do?

Add and evolve Counterfact context classes in .context.ts files, including required unit test coverage for context behavior. Context is an agent skill from counterfact/api-simulator.ts files, including required unit test coverage for context behavior.

When should I use Context?

Context fits situations like: tasks that involve Unit testing; tasks that involve OpenAPI specifications.

How do I install Context in Claude Code?

Run `npx skills add counterfact/api-simulator --skill context -a claude-code`. Or copy the skill folder (skills/context in counterfact/api-simulator) into .claude/skills/context in your project. Claude Code loads it when a task matches its description.

How do I install Context in Codex?

Run `npx skills add counterfact/api-simulator --skill context -a codex`. Or copy the skill folder (skills/context in counterfact/api-simulator) into .agents/skills/context in your project. Codex loads it when a task matches its description.

Can I use Context in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add counterfact/api-simulator --skill context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context, .gemini/skills/context, .github/skills/context and .opencode/skills/context in your project.

What does Context need to run?

SKILL.md names no scripts, command-line tools or credentials: Context is instructions for the agent only.

Does Context access the network?

SKILL.md names 1 domain. As links in the text: counterfact.dev. This is read from the text; nothing was executed.

Is Context safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Context use?

Context is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Context use?

About 384 tokens (SKILL.md is roughly 1.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Context?

Skills that share tags, products or a category with Context: API Test Suite Builder (borghei/Claude-Skills, 874 stars), NestJS Expert (Jeffallan/claude-skills, 12k stars), Cloud Agents Starter (scalar/scalar, 16k stars) and 703 Technologies Fuzzing Testing (jabrena/plinth, 445 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context?

counterfact (a GitHub organization) maintains it in counterfact/api-simulator, which has 170 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 6, 2026.

Source: counterfact/api-simulator on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.