Agent skill

Counterfact Repo Basics

by counterfact in counterfact/api-simulator

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

MITAuto-check passedBackend & APIs

Install Counterfact Repo Basics

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

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

GitHub CLI
$ gh skill install counterfact/api-simulator counterfact-repo-basics --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/.github/skills/counterfact-repo-basics .claude/skills/counterfact-repo-basics && 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
counterfact-repo-basics
GitHub stars
170
Token cost
~868 tokens
SKILL.md length
211 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

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

  • Tasks that involve OpenAPI specifications
  • SKILL.md covers When to use this skill, What Counterfact is, Repository structure and Essential commands, plus 2 more sections
  • Calls yarn, npx and bash; reaches petstore3.swagger.io
  • Tasks that involve Linting and formatting

What it does

Counterfact Repo Basics is an agent skill from counterfact/api-simulator. Provide Counterfact repository orientation, high-level architecture, and the canonical command reference for install/build/test/lint workflows.

Its SKILL.md is about 870 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 Backend & APIs, covering OpenAPI specifications and Linting and formatting. It works with OpenAPI, GitHub and TypeScript. 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 OpenAPI specifications
  • Tasks that involve Linting and formatting

Example prompts

  • “/counterfact-repo-basics”

Requirements

  • Python 3
  • Node.js
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit 0b42140. 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

    Shell commands in SKILL.md call:

    • yarn
    • npx
    • bash

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • petstore3.swagger.io

    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

Counterfact Repo Basics loads about 868 tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 211 words of instructions outside code blocks.

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

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 0b42140, republished under its MIT licence (© counterfact). 211 words, ~868 tokens.

Download SKILL.mdSave it as .claude/skills/counterfact-repo-basics/SKILL.md (or your agent's skills folder).
name
counterfact-repo-basics
description
Provide Counterfact repository orientation, high-level architecture, and the canonical command reference for install/build/test/lint workflows.
applyTo
**/*

Counterfact Repository Basics Skill

When to use this skill

Use this skill when you need quick repository orientation, command references, or issue-proposal workflow rules.

What Counterfact is

Counterfact is a TypeScript-based mock server generator that turns OpenAPI/Swagger specs into live, stateful mock APIs with hot reload, a REPL, and Swagger UI.

bash
npx counterfact@latest https://petstore3.swagger.io/api/v3/openapi.json api

Repository structure

text
packages/
  counterfact/                # Published package workspace
    src/
      app.ts                  # Main entry point; generation + server + REPL orchestration
      server/                 # Koa server, dispatcher, registry, hot-reload internals
      typescript-generator/   # OpenAPI parsing and TypeScript generation
      repl/                   # Interactive terminal for runtime state control
      migrate/                # Helpers for migrating generated route files
      util/                   # Shared utilities
    bin/counterfact.js        # CLI entry point
    test/                     # Jest unit tests
    templates/                # Generator scaffold templates
    docs/                     # Canonical user documentation
  types/src/                  # Shared types copied into generated projects
test-black-box/               # Gherkin journeys with Python harness and step glue
examples/                     # Checked consumer examples
site/                         # Documentation website

Essential commands

TaskCommand
Install dependenciesyarn install --immutable
Buildyarn build
Type-checkyarn typecheck
Unit testsyarn test
Product black-box testsyarn test:black-box
Installed package smoke testyarn test:packed-consumer
TypeScript type testsyarn build && yarn test:tsd
Lint (check)yarn lint
Lint (auto-fix)yarn lint:fix
Run against Petstoreyarn go:petstore

Development container

The repository's .devcontainer supplies the reproducible Linux development environment used for contributor validation: Node 24, Corepack/Yarn 4, and Python dependencies for black-box tests. Use the non-root node user and keep the container limited to the intended repository mount; do not expose Docker, host credentials, SSH agents, or production secrets.

Run bash .devcontainer/verify.sh inside the container for the Linux CI-equivalent suite. Codex Desktop's native workspace sandbox remains separate from the development container: use the devcontainer for reproducible dependencies and tests, and use a dedicated Git worktree/branch for each task.

New issue proposals

Never create GitHub issues directly. Propose them as Markdown files under .github/issue-proposals/ and follow .github/instructions/issue-proposals.instructions.md.

© 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 .github/skills/counterfact-repo-basics of counterfact/api-simulator.

Open the folder on GitHubat commit 0b42140

Compare with similar skills

Counterfact Repo Basics 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.

Counterfact Repo Basics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Counterfact Repo Basics this skillcounterfact/api-simulator170—~868Automated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Api2clialexknowshtml/api2cli454—~2.9kAutomated safety check: PassMIT
Projectsamchon/nestia2.2k—~3kAutomated safety check: PassMIT
API ContractChenyCHENYU/Robot_Admin1k—~1.9kAutomated safety check: PassMIT
Typescriptscalar/scalar16k—~1.1kAutomated safety check: PassMIT

Similar skills

  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Api2cli

    alexknowshtml/api2cli

    Generate a working CLI from any API, then wrap it in a Claude Code skill.

    454 GitHub stars~2.9k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Project

    samchon/nestia

    Defines the nestia product contract, workspace layout, package boundaries, the Go plugin composition model, and canonical commands.

    2.2k GitHub stars~3k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • API Contract

    ChenyCHENYU/Robot_Admin

    A skill your agent uses when: generating TypeScript API layer (type definitions + request functions) from page-spec JSON or Swagger/OpenAPI docs.

    1k GitHub stars~1.9k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Typescript

    scalar/scalar

    Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

    16k GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Assisted Service Dev Mode

    openshift/assisted-service

    Build and code-generate assisted-service using skipper with podman.

    138 GitHub stars~1.3k tokensUpdated today
    Backend & APIsAuto-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 today
    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 today
    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 today
    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~3.1k tokensUpdated today
    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 today
    Auto-check passed
  • Scenario

    counterfact/api-simulator

    Create and update Counterfact scenario modules that seed or mutate context state through reusable scenario functions.

    170 GitHub stars~356 tokensUpdated today
    Auto-check passed

Categories

Questions about Counterfact Repo Basics

What does Counterfact Repo Basics do?

Provide Counterfact repository orientation, high-level architecture, and the canonical command reference for install/build/test/lint workflows. Counterfact Repo Basics is an agent skill from counterfact/api-simulator. Provide Counterfact repository orientation, high-level architecture, and the canonical command reference for install/build/test/lint workflows.

When should I use Counterfact Repo Basics?

Counterfact Repo Basics fits situations like: tasks that involve OpenAPI specifications; tasks that involve Linting and formatting.

How do I install Counterfact Repo Basics in Claude Code?

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

How do I install Counterfact Repo Basics in Codex?

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

Can I use Counterfact Repo Basics 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 counterfact-repo-basics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/counterfact-repo-basics, .gemini/skills/counterfact-repo-basics, .github/skills/counterfact-repo-basics and .opencode/skills/counterfact-repo-basics in your project.

What does Counterfact Repo Basics need to run?

Going by SKILL.md and its folder, Counterfact Repo Basics needs the command-line tools its instructions call (yarn, npx and bash). Our summary lists: Python 3; Node.js; Docker.

Does Counterfact Repo Basics access the network?

SKILL.md names 1 domain. In commands or code: petstore3.swagger.io; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Counterfact Repo Basics 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 Counterfact Repo Basics use?

Counterfact Repo Basics 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 Counterfact Repo Basics use?

About 868 tokens (SKILL.md is roughly 3.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 Counterfact Repo Basics?

Skills that share tags, products or a category with Counterfact Repo Basics: OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), Api2cli (alexknowshtml/api2cli, 454 stars), Project (samchon/nestia, 2.2k stars) and API Contract (ChenyCHENYU/Robot_Admin, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Counterfact Repo Basics?

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 11, 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.