api-spec
Skill1 starsChanged 5 days agoMITView on GitHub
Từ yêu cầu, user story hoặc luồng nghiệp vụ viết bản nháp API contract - danh sách endpoint (method, đường dẫn, mục đích, xác thực, idempotent), schema request/response kèm ví dụ, mã lỗi HTTP và mã lỗi nghiệp vụ, phân trang/lọc/sắp xếp, idempotency key, webhook nếu có - và xuất file OpenAPI 3.0 YAML import được vào Postman, Swagger/Redoc. Dùng khi BA cần đặc tả API cho dev/đối tác, hoặc tài liệu tích hợp. Trigger - "API spec", "đặc tả API", "OpenAPI", "Swagger", "endpoint", "REST API", "request response", "mã lỗi API", "tài liệu tích hợp", "Postman collection".
4 other projects use a version of this.
Adopted by
Most recently taken up by
- idaibin/skillstheir own version, first seen Nov 8, 2026
- snowfluke/tech-lead-skillstheir own version, first seen Nov 8, 2026
- snowfluke/my-tech-lead-flowtheir own version, first seen Sep 30, 2026
- Leostruka/devin-bundletheir own version, first seen Aug 15, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- snowfluke/my-tech-lead-flow★ 8same name
- snowfluke/tech-lead-skills★ 8same name
- idaibin/skills★ 6same name
- Leostruka/devin-bundle★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ba-diagramsSkill
- bpmn-modelingSkill
- decision-tableSkill
- domain-bankingSkill
- domain-ecommerceSkill
- domain-lendingSkill
- domain-logisticsSkill
- domain-paymentsSkill
- edge-case-finderSkill
- functional-decompositionSkill
- meeting-to-requirementsSkill
- requirements-linterSkill
- screen-specSkill
- user-story-writerSkill
The file
Files
API Spec (bản nháp OpenAPI từ yêu cầu)
Biến yêu cầu nghiệp vụ thành hợp đồng API rõ ràng để dev hai phía và tester cùng đọc. BA làm bản nháp đủ chi tiết về hành vi và dữ liệu nghiệp vụ; kiến trúc sư/dev tinh chỉnh phần kỹ thuật.
Quy trình
- Xác định tài nguyên và hành động: danh từ nghiệp vụ (lịch hẹn, đơn hàng, thanh toán) → tài nguyên; thao tác (đặt, hủy, hoàn) → method hoặc "hành động con" (
POST /appointments/{id}/cancel). Lấy từ cây chức năng (functional-decomposition) và story (user-story-writer) nếu có. - Ai gọi, xác thực thế nào: người dùng cuối, hệ thống nội bộ, đối tác; token, API key; phạm vi quyền.
- Bảng endpoint: method, đường dẫn, mục đích, xác thực, idempotent hay không, mã thành công.
- Schema và ví dụ: trường, kiểu, bắt buộc, ràng buộc (độ dài, enum, định dạng), nullable; mỗi request/response có ví dụ thật. Tiền, ngày, trạng thái theo quy ước trong
references/conventions.md. - Lỗi: mỗi endpoint liệt kê mã HTTP và mã lỗi nghiệp vụ (ví dụ
SLOT_TAKEN) kèm thông điệp; một cấu trúc lỗi chung. - Hành vi đặc biệt: phân trang, lọc, sắp xếp, idempotency-key, giới hạn tốc độ, bất đồng bộ/webhook, phiên bản.
- Xuất OpenAPI 3.0 YAML, tự soát theo checklist bên dưới.
- Câu hỏi mở cho dev/đối tác.
Đầu ra
## API: <tên>
**Phạm vi · Đối tượng gọi · Xác thực · Base URL / phiên bản**
### Bảng endpoint
| Method | Đường dẫn | Mục đích | Auth | Idempotent | Thành công |
### Lỗi nghiệp vụ
| Mã lỗi | HTTP | Khi nào | Thông điệp |
### OpenAPI (YAML) (một khối ```yaml)
### Giả định và câu hỏi mởChecklist soát trước khi giao
- Mọi endpoint có
operationIdduy nhất,summary,tags. - Có response thành công và các lỗi 400/401/403/404, cùng 409/422 cho lỗi nghiệp vụ; 429, 5xx ở mức chung.
- Mọi
$reftrỏ tới schema có thật; mọi tham số đường dẫn được khai báo. - Mọi request/response có
example. - POST gây thay đổi quan trọng (tiền, đơn hàng) có Idempotency-Key.
- Trường tiền dùng kiểu đã thống nhất; ngày giờ ISO 8601; trạng thái là
enum. - Trường nhạy cảm (SĐT, số tài khoản, CCCD) được ghi chú và che khi trả về.
- Không nhúng khóa bí mật, token thật, dữ liệu cá nhân thật trong ví dụ.
Quy tắc
- Không bịa quy tắc nghiệp vụ: giới hạn, thời hạn, mã lỗi chưa có trong yêu cầu thì ghi
[xác nhận]hoặc đưa vào câu hỏi mở. - Ghi rõ giả định về tên trường và cấu trúc; đó là đề xuất để dev phản hồi, không phải hợp đồng cuối cùng.
- Tên trường và đường dẫn nhất quán một kiểu (
camelCasetrường, danh từ số nhiều cho tài nguyên) theoreferences/conventions.md. - Lỗi trả về mã máy đọc được + thông điệp người đọc được; không lộ chi tiết nội bộ.
- Có domain pack: dùng
data-model.mdđể lấy bộ trạng thái (statusenum),integrations.mdđể thấy callback/timeout cần xử lý (domain-payments,domain-banking,domain-ecommerce,domain-lending,domain-logistics). - Skill chỉ viết hợp đồng; việc kiểm thử API và mock server không thuộc phạm vi (xuất YAML rồi dùng công cụ như Postman).
Chuỗi skill
functional-decomposition → user-story-writer → api-spec → edge-case-finder (timeout, trùng, đồng thời) → decision-table (rule nghiệp vụ trong API).
Tham chiếu
| File | Nội dung |
references/conventions.md | Quy ước đặt tên, mã HTTP, cấu trúc lỗi, phân trang, idempotency, tiền và ngày |
LEARN.md | API contract là gì, vì sao BA nên viết bản nháp |
examples/appointments/ | openapi.yaml + bảng endpoint cho đặt lịch khám |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

