openapi-spec-generator
ما الذي تفعله
تنشئ هذه المهارة مستندًا تقنيًا (يُسمى مواصفات OpenAPI أو Swagger) يصف طريقة عمل واجهة برمجية، أي الخدمة التي تستخدمها البرامج للتواصل. ويمكنها توليد هذا المستند من أوصاف بلغة طبيعية، أو من الكود، أو من مستند غير مكتمل.
متى تستخدمها
- ✓عندما تحتاج إلى وصف واجهة برمجية لمطورين آخرين.
- ✓عندما تنشئ التوثيق التقني لخدمة ويب.
- ✓إذا كانت لديك مسودة لواجهتك وتريد تحويلها إلى معيار رسمي.
رابط المهارة
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/openapi-spec-generator/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أنشئ مواصفات OpenAPI لواجهة برمجية تدير المهام، مع نقاط نهاية لعرض المهام وإنشائها وتحديثها. استخدم صيغة YAML.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يحلل الذكاء الاصطناعي وصفك أو الكود لفهم تفاصيل واجهتك، مثل البيانات التي تستخدمها والإجراءات التي تستطيع تنفيذها. ثم يجمّع مستندًا تقنيًا كاملًا وفق معايير OpenAPI أو Swagger.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
OpenAPI / Swagger Specification Generator
When to Use
Use this skill when you need generate complete, production-ready OpenAPI 3.x and Swagger 2.0 specifications from natural language descriptions, code, or partial specs. Use this skill whenever the user mentions OpenAPI, Swagger, API spec, REST API documentation, YAML/JSON API schema, endpoint documentation, API...
Generate complete, valid OpenAPI 3.x or Swagger 2.0 specifications from descriptions, code, or partial specs.
Workflow
Step 1 — Gather Context
Before writing any YAML/JSON, ask (or infer from context) the following:
| Question | Why it matters |
|---|---|
| OpenAPI 3.x or Swagger 2.0? | Different info, servers/host, components/definitions structure |
| Output format: YAML or JSON? | YAML default unless user specifies JSON |
| What does this API do? | Sets info.title, info.description, tags |
| List of endpoints (or code to extract from)? | Core paths object |
| Authentication type(s)? | securitySchemes — see reference |
| Common data models or entities? | components/schemas / definitions |
| Any existing partial spec to extend? | Merge rather than overwrite |
If the user provides code (Express routes, FastAPI, Django URLs, Spring controllers, etc.), extract endpoints automatically — do not ask what the user already told you.
Step 2 — Build the Spec
Follow the structure guide for the chosen version. Always produce a complete, valid spec — never leave placeholder comments like # TODO: add schema.
OpenAPI 3.x Skeleton
openapi: "3.1.0"
info:
title: <API Title>
version: "1.0.0"
description: <Short description>
contact:
name: <Team or Author>
email: <contact@example.com>
servers:
- url: https://api.example.com/v1
description: Production
- url: https://staging-api.example.com/v1
description: Staging
tags:
- name: <Tag>
description: <Tag description>
paths:
/resource:
get:
summary: List resources
operationId: listResources
tags: [<Tag>]
parameters: []
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/ResourceList"
example:
items: []
total: 0
"401":
$ref: "#/components/responses/Unauthorized"
"500":
$ref: "#/components/responses/InternalError"
security:
- BearerAuth: []
components:
schemas: {}
responses:
Unauthorized:
description: Authentication required
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
InternalError:
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
securitySchemes: {}
Swagger 2.0 Skeleton
swagger: "2.0"
info:
title: <API Title>
version: "1.0.0"
description: <Short description>
host: api.example.com
basePath: /v1
schemes: [https]
consumes: [application/json]
produces: [application/json]
tags: []
paths: {}
definitions: {}
securityDefinitions: {}
Step 3 — Schemas and Models
- Always use
$reffor any schema used in more than one place. - Include
exampleorexampleson every schema and response body. - Mark required fields with the
requiredarray. - Use
nullable: true(OAS 3.0) orx-nullable: true(Swagger 2.0) for optional nullable fields. - Prefer
formatkeywords:int32,int64,float,date,date-time,uuid,email,uri,byte,binary.
Common schema patterns:
# Pagination wrapper
PagedResult:
type: object
required: [items, total, page, pageSize]
properties:
items:
type: array
items:
$ref: "#/components/schemas/Resource"
total:
type: integer
format: int64
example: 100
page:
type: integer
format: int32
example: 1
pageSize:
type: integer
format: int32
example: 20
# Standard error
Error:
type: object
required: [code, message]
properties:
code:
type: string
example: RESOURCE_NOT_FOUND
message:
type: string
example: The requested resource was not found.
details:
type: object
additionalProperties: true
# Timestamps mixin (use allOf)
Timestamps:
type: object
properties:
createdAt:
…
الأسئلة الشائعة
ما هما OpenAPI وSwagger؟
هما معياران لوصف واجهات البرمجة. يساعدان على توثيق طريقة عمل خدمة الويب، مما يسهّل تكامل البرامج المختلفة معها.
ما الفرق بين OpenAPI وSwagger؟
OpenAPI هو اسم المعيار الحالي. أما Swagger فهو أداة شائعة تطبّق هذا المعيار، وتشير أيضًا إلى إصدارات أقدم منه.
هل أحتاج إلى معرفة البرمجة لاستخدام هذه المهارة؟
ليس بالضرورة. يمكنك وصف الواجهة بلغة طبيعية، وستحوّلها المهارة إلى مستند تقني.
التفاصيل
الوصف الأصلي من المؤلف
Generate complete, production-ready OpenAPI 3.x and Swagger 2.0 specifications from natural language descriptions, code, or partial specs.
الشعبية
- نجوم GitHub
- 48k
- الترتيب
- #5377
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
00-andruia-consultant
48kيساعد وكيلك على بدء مشاريع الذكاء الاصطناعي أو تحسينها. يحلل الكود ويقترح الأدوات ويُعد خطط عمل بالإسبانية.
007
48kيتيح لوكيلك إجراء تدقيقات أمنية ونمذجة التهديدات. مفيد لحماية المشاريع من الهجمات والثغرات الأمنية.
10-andruia-skill-smith
48kيساعد وكيلك على إنشاء أدوات الذكاء الاصطناعي أو تحسينها. يحدد طريقة عملها، ويكتب توثيقها، ويتحقق من بنيتها.
20-andruia-niche-intelligence
48kيتيح لوكيلك إعداد ملخص عن صناعة محددة. مفيد لفهم السياق والقواعد وأنماط الاستخدام والمخاطر لمشروع ما، باستخدام مصادر موثوقة.
مهارات مشابهة
api-connector-builder
280kيبني وكيلك اتصالات API جديدة على النمط الموجود، ويفيد عندما تحتاج إلى تكامل إضافي دون ابتكار طريقة جديدة للعمل.
api-design
280kيساعد وكيلك على تصميم واجهات REST API وفق أفضل الممارسات، ويوضح كيف تتواصل وكيف تُعرض الأخطاء وكيف تُنظَّم البيانات.
backend-patterns
280kيساعد وكيلك على أنماط بنية الخادم وتحسين قاعدة البيانات، ويفيد في بناء الشيفرة التي تعمل على الخادم أو مراجعتها.