api-patterns
यह क्या करती है
यह गाइड आपको इस बारे में अहम फैसले लेने में मदद करती है कि अलग-अलग कंप्यूटर प्रोग्राम एक-दूसरे से बात करने के लिए जो 'भाषा' (API) इस्तेमाल करते हैं, उसे कैसे बनाया जाए। यह सिखाती है कि सबसे अच्छा तरीका (जैसे REST या GraphQL) कैसे चुनें और डेटा भेजने व पाने का तरीका कैसे तय करें।
कब इस्तेमाल करें
- ✓यह तय करते समय कि REST, GraphQL या कोई और कम्युनिकेशन तरीका इस्तेमाल करना है।
- ✓यह तय करते समय कि प्रोग्राम्स से डेटा किस तरह वापस आएगा।
- ✓यह योजना बनाते समय कि सिस्टम बहुत सारी एक्सेस या अपडेट को कैसे संभालेगा।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-patterns/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“API का response यूज़र-फ्रेंडली और सुरक्षित बनाने के लिए मुझे उसे कैसे डिज़ाइन करना चाहिए?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह गाइड आपको हर API प्रकार और उसके नियमों की सही जानकारी ढूंढने के लिए एक 'नक्शा' देती है। यह फैसले लेने से पहले आपको API के यूज़र्स की ज़रूरतों के बारे में सोचने पर मजबूर करती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
API Patterns
API design decisions tied to the consumers and deployment constraints. Learn to THINK, not copy fixed patterns.
🎯 Selective Reading Rule
Read ONLY files relevant to the request! Check the content map, find what you need.
📑 Content Map
| File | Description | When to Read |
|---|---|---|
api-style.md |
REST vs GraphQL vs tRPC decision tree | Choosing API type |
rest.md |
Resource naming, HTTP methods, status codes | Designing REST API |
response.md |
Envelope pattern, error format, pagination | Response structure |
graphql.md |
Schema design, when to use, security | Considering GraphQL |
trpc.md |
TypeScript monorepo, type safety | TS fullstack projects |
versioning.md |
URI/Header/Query versioning | API evolution planning |
auth.md |
JWT, OAuth, Passkey, API Keys | Auth pattern selection |
rate-limiting.md |
Token bucket, sliding window | API protection |
documentation.md |
OpenAPI/Swagger best practices | Documentation |
security-testing.md |
OWASP API Top 10, auth/authz testing | Security audits |
🔗 Related Skills
| Need | Skill |
|---|---|
| API implementation | @[skills/backend-architect] |
| Data structure | @[skills/database-design] |
| Security details | @[skills/api-security-best-practices] |
✅ Decision Checklist
Before designing an API:
- Asked user about API consumers?
- Chosen API style for THIS context? (REST/GraphQL/tRPC)
- Defined consistent response format?
- Planned versioning strategy?
- Considered authentication needs?
- Planned rate limiting?
- Documentation approach defined?
❌ Anti-Patterns
DON'T:
- Default to REST for everything
- Use verbs in REST endpoints (/getUsers)
- Return inconsistent response formats
- Expose internal errors to clients
- Skip rate limiting
DO:
- Choose API style based on context
- Ask about client requirements
- Document thoroughly
- Use appropriate status codes
Script
| Script | Purpose | Command |
|---|---|---|
scripts/api_validator.py |
Local heuristic source scan (not schema validation) | python3 skills/api-patterns/scripts/api_validator.py <project_path> |
When to Use
Use when defining a new endpoint contract, selecting REST/GraphQL/tRPC for known consumers, or changing pagination, errors, authentication or compatibility behavior. For a bug inside an existing contract, preserve that contract unless the task authorizes a change.
Inputs and procedure
Record consumers and deployed versions, expected payload size, access rules, compatibility obligations and one concrete operation. Read the relevant files in the map, compare the realistic choices, then specify request/response examples and rejection cases. Types shared at build time do not ensure that independently deployed clients remain compatible.
Worked example
Input: a public order list changes while clients page through it. Choose a bounded page size and cursor over a stable (created_at, id) order. Define the next-cursor format, authorization filter and behavior for a removed record or invalid cursor. Test two equal timestamps and an insertion between pages. Expected: no duplicate IDs within the promised snapshot semantics; document whether newly inserted rows can appear.
Limitations
- The Python helper scans at most 15 matching files using regular expressions and shallow JSON/YAML checks. Its output is a triage hint, not OpenAPI validation, an authorization audit or deployment approval.
- GraphQL query shape, tRPC inference and HTTP method names do not enforce resource authorization or backwards compatibility.
- Rate limiting cannot alone prevent all resource exhaustion; size, concurrency, time and provider-cost bounds depend on the operation.
- Perform security checks only against authorized local/test targets with isolated accounts and a defined scope.
अक्सर पूछे जाने वाले सवाल
API क्या है?
API एक रेस्टोरेंट के मेन्यू जैसा है। यह बताता है कि कौन-कौन सी चीज़ें (जानकारी या कार्रवाई) उपलब्ध हैं और उन्हें कैसे मंगवाया जाए, बिना यह जाने कि किचन (प्रोग्राम) अंदर से कैसे काम करता है।
REST बनाम GraphQL बनाम tRPC, कौन-सा चुनें?
हर एक के अपने फायदे हैं। REST आम और सरल है, GraphQL किसी खास डेटा को लाने में लचीला है, और tRPC उन प्रोजेक्ट्स के लिए अच्छा है जो TypeScript इस्तेमाल करते हैं और type safety चाहते हैं।
API versioning क्यों ज़रूरी है?
Versioning यह सुनिश्चित करता है कि API की 'भाषा' में आगे होने वाले बदलाव उन प्रोग्राम्स को न तोड़ें जो पहले से उसका इस्तेमाल कर रहे हैं। यह वैसा है जैसे किसी ऐप का नया वर्शन निकालना, पर पुराने फीचर्स खराब किए बिना।
जानकारी
लेखक का मूल विवरण
API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #3776
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।