मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)48k · #3776

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-patterns/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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.

repo: sickn33/agentic-awesome-skills

लोकप्रियता

GitHub स्टार
48k
रैंकिंग में स्थान
#3776
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

00-andruia-consultant

48k

आपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।

AI और एजेंटएजेंट

007

48k

आपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।

कोडिंगसिक्योरिटी

10-andruia-skill-smith

48k

आपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।

AI और एजेंटएजेंट

20-andruia-niche-intelligence

48k

आपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।

लेखन और डॉक्यूमेंटरिसर्च

मिलती-जुलती skills