strict-api — скилл для Claude Code: проверка API перед вызовом
Скилл заставляет агента убедиться, что метод, импорт или класс есть в установленной у вас версии, прежде чем писать вызов. Пригодится, когда код выглядит правдоподобно, но падает на первом запуске.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install engineering-advanced-skills@claude-code-skillsЧто делает strict-api
Скилл добавляет слой проверки перед тем, как агент напишет хоть строку. Правило одно: перед каждым вызовом функции, импортом или обращением к методу надо ответить на вопрос, существует ли это в той версии, которая стоит у вас. Ответ «наверное» или «кажется, да» считается отказом — агент останавливается и говорит, что не знает.
Блокирует он в основном три вещи: выдуманные методы вроде fs.readFileLines() в Node.js или csv.read_csv() вместо модуля csv, путаницу между похожими фреймворками (render_template во Flask против render() в Django) и устаревшие API, которые сломаются на следующем обновлении. Работает по шагам: перечислить все поверхности API в будущем коде, сверить каждую с вашей версией, а сомнительное пометить комментарием. Если версия не названа, скилл просит сказать её один раз.
Версия тут ключевая: без неё проверить нечего, поэтому агент спросит её до того, как начнёт писать. Скилл советует предпочитать многословный, но верный код короткому и неверному. В репозитории он лежит рядом с minimalist и zero-hallucination-coder — первый сокращает объём кода, второй ловит выдумки шире, чем только в API.
Какие задачи решает
- поймать вызов метода, которого нет в вашей версии библиотеки
- развести похожие API двух фреймворков до того, как код уйдёт в репозиторий
- заметить устаревший метод, который сломается на следующем апгрейде
- получить от агента вопрос о версии вместо молчаливой догадки
- пометить сомнительный вызов комментарием, а не выдать его за рабочий
Примеры запросов агенту
- Проверь API перед тем, как писать: не выдумывай функции, которых нет в моей версии Node.js
- Сделай reality check по этому файлу — какие методы тут могут не существовать?
- Перепиши этот модуль без выдуманных вызовов, сомнительное помечай комментарием
Как установить strict-api
1Через маркетплейс плагинов
/plugin marketplace add alirezarezvani/claude-skills/plugin install engineering-advanced-skills@claude-code-skillsКоманда ставит плагин engineering-advanced-skills целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add alirezarezvani/claude-skills --skill strict-api -a claude-code3Вручную: положить файлы
~/.claude/skills/strict-api/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/strict-api/
Вручную: положить файлы
.agents/skills/strict-api/SKILL.mdДля всех проектов — ~/.agents/skills/
Вручную: положить файлы
.cursor/skills/strict-api/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install alirezarezvani/claude-skills strict-api2Вручную: положить файлы
.github/skills/strict-api/SKILL.mdКомандой платформы
gemini skills install https://github.com/alirezarezvani/claude-skills --path engineering/strict-apiВручную: положить файлы
.devin/skills/strict-api/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о strict-api
Как установить strict-api в Claude Code?
Через маркетплейс: сначала /plugin marketplace add alirezarezvani/claude-skills, затем /plugin install engineering-advanced-skills@claude-code-skills. Есть и второй путь — npx skills add alirezarezvani/claude-skills --skill strict-api -a claude-code.
Что делает strict-api?
Проверяет каждый вызов функции, импорт и обращение к методу на существование в вашей версии. Если агент не может подтвердить, что API есть, он останавливается и спрашивает версию вместо догадки.
Чем strict-api отличается от minimalist?
minimalist сокращает объём кода, strict-api следит за тем, чтобы написанное существовало. Их советуют ставить вместе, когда нужен и короткий, и проверенный код.
Исходный текст
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