Skip to main content
skill

strict-api — Claude Code skill: verify APIs before calling them

This skill makes the agent confirm that a method, import or class exists in the version you actually run before writing the call. Useful when generated code looks right and dies on the first run.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add alirezarezvani/claude-skills
/plugin install engineering-advanced-skills@claude-code-skills
Open on GitHub

What strict-api does

The skill adds a check layer before any code gets written. There is one rule: for every function call, import or method access, the agent has to answer whether that thing exists in your installed version. "Probably" or "I think so" counts as a no — the agent stops and admits it does not know.

Three failure modes get blocked. Invented methods, such as fs.readFileLines() in Node.js or csv.read_csv() instead of Python's csv module. Framework mix-ups, where render_template from Flask gets used in Django or useForm() is assumed to ship with React. And deprecated APIs that break on the next upgrade. The workflow is short: list every API surface in the code about to be written, check each against your version, and mark anything uncertain with an inline comment. No version stated? The agent asks once.

That version matters, because without it there is nothing to check against — so expect a question before the first line appears. Verbose-but-correct beats terse-but-wrong here. In the repository it sits next to minimalist and zero-hallucination-coder: one trims code volume, the other catches hallucinations beyond API calls.

What it helps with

  • catch a method call that your library version does not have
  • tell two similar framework APIs apart before the code lands
  • spot a deprecated method that breaks on the next upgrade
  • get a version question from the agent instead of a silent guess
  • mark an uncertain call with a comment rather than pass it off as working

Example prompts for the agent

  • Verify the APIs before you write anything — don't invent functions that aren't in my Node.js version
  • Reality check this file: which of these methods might not exist?
  • Rewrite this module without made-up calls, flag anything uncertain in a comment

How to install strict-api

1Plugin marketplace

/plugin marketplace add alirezarezvani/claude-skills
/plugin install engineering-advanced-skills@claude-code-skills

This installs the whole engineering-advanced-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add alirezarezvani/claude-skills --skill strict-api -a claude-code

3Manually: put the files in place

~/.claude/skills/strict-api/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/strict-api/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about strict-api

How do I install strict-api in Claude Code?

Through the marketplace: run /plugin marketplace add alirezarezvani/claude-skills, then /plugin install engineering-advanced-skills@claude-code-skills. A second route is npx skills add alirezarezvani/claude-skills --skill strict-api -a claude-code.

What does strict-api do?

It checks every function call, import and method access against your installed version. When the agent cannot prove an API exists, it stops and asks for the version instead of guessing.

How is strict-api different from minimalist?

minimalist cuts the amount of code, while strict-api makes sure the code that remains actually exists. The two are meant to run together when you want both shorter and verified output.

Source text

SKILL.md · MIT
---
name: "strict-api"
description: "Use when the user says 'no hallucinations', 'verify APIs', 'reality check', or 'don't invent functions'. Prevents the agent from calling methods, imports, or variables that do not provably exist in the user's installed version."
---

# Strict API Verification

Inventing a function that doesn't exist is the opposite of efficiency. You wrote a line that looks minimal. You shipped a bug that takes an hour to debug. The true minimal path is: use only what is provably there.

## Overview

This skill is a reality-check layer applied before any code is written. It is not about being slow — it is about being correct the first time. Use it alongside `minimalist` when the user wants both less code and verified code.

## The Only Rule

Before you write any function call, import, or method access, you must be able to answer:

**"Does this exist in the version the user is running?"**

If the answer is "probably" or "I think so" — **stop**. You don't know. Say so.

## What This Blocks

**Made-up methods:**
- `fs.readFileLines()` does not exist in Node.js.
- `path.combine()` is .NET, not Node.js.
- `csv.read_csv()` is pandas, not Python's `csv` module.

Writing these is not minimal code — it is confident garbage.

**Framework confusion.** Every framework has a twin that sounds like it:
- `render_template` (Flask) vs `render()` (Django)
- `useForm()` (react-hook-form) vs nothing built into React
- `app.listen()` (Express) vs `server.listen()` (raw Node.js `http`)

**Deprecated APIs.** Writing a deprecated method is writing code that will break on the next upgrade.

## Workflow

1. **Identify every API surface** in the code you are about to write: imports, method calls, class instantiations.
2. **Verify each one** against the user's stated version. If no version is stated, ask once.
3. **Flag anything uncertain** with an inline comment rather than silently guessing.
4. **Prefer verbose-but-correct** over terse-but-wrong.

When you are not sure if a method exists, annotate it inline:

    // verify fs.openAsBlob exists in your Node.js version (>= 20.0)
    const blob = await fs.openAsBlob(path);

One comment costs nothing. A silent wrong call costs an hour of the user's time.

If the uncertainty is too high to write correct code without guessing, say:

    "I'd need to check whether X exists in version Y before using it. What version are you on?"

## Anti-Patterns

| Anti-Pattern | What to do instead |
|---|---|
| Writing a method call you vaguely remember | Stop and verify the exact signature |
| Silently using a deprecated API | Use the current API and note the deprecation |
| Assuming API parity across frameworks | Explicitly name the framework and version |
| Guessing import paths | Check the package's actual export structure |
| Using an API from a different language's stdlib | Verify it exists in this language |
| Writing "it should work" without checking | Ask what version the user is on |

## Cross-References

- Related: `engineering/minimalist` — use together: minimalist reduces code volume; strict-api ensures what is written is correct.
- Related: `engineering/zero-hallucination-coder` — similar goal; broader hallucination prevention beyond APIs.
- Related: `engineering/karpathy-coder` — Karpathy-inspired behavioral guardrails for LLM-assisted coding.

© Alireza Rezvani · MIT · alirezarezvani/claude-skills

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set463

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor