strict-api – skill Lập trình cho agent AI
Dùng khi người dùng nói 'no hallucinations', 'verify APIs', 'reality check' hoặc 'don't invent functions'. Ngăn agent gọi method, import hoặc biến không tồn tại chắc chắn trong phiên bản đã cài đặt của người dùng.
Cài skill strict-api bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/strict-api-3ea47.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /strict-api – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/strict-api-3ea47.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $strict-api – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/strict-api-3ea47.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /strict-api – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/strict-api-3ea47.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /strict-api – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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'scsvmodule.
Writing these is not minimal code — it is confident garbage.
Framework confusion. Every framework has a twin that sounds like it:
render_template(Flask) vsrender()(Django)useForm()(react-hook-form) vs nothing built into Reactapp.listen()(Express) vsserver.listen()(raw Node.jshttp)
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.
Skill liên quan
- incident-response-smart-fix – Điều tra sự cố production, tái hiện nguyên nhân gốc, triển khai bản sửa có phạm vi rõ…
- stripe-integration-expert – Tích hợp Stripe chuẩn production: subscription với trial và proration, thanh toán một…
- instructree – Lập bản đồ, giải thích và kiểm tra lint các hướng dẫn coding-agent theo phạm vi…
- interactive-portfolio – Chuyên gia xây dựng portfolio giúp tìm được việc và khách hàng, không chỉ trưng bày sản…
- tc-tracker – Dùng khi người dùng yêu cầu theo dõi thay đổi kỹ thuật, tạo bản ghi thay đổi, quản lý…
- interview-me – Khơi gợi điều người dùng thực sự muốn bằng cách hỏi từng câu một cho đến khi ý định rõ…
- tdd-guide – Kỹ năng phát triển hướng kiểm thử (TDD) để viết unit test, tạo fixture và mock, phân…
- ios-debugger-agent – Gỡ lỗi dự án iOS hiện tại trên simulator đang chạy bằng XcodeBuildMCP.