rest-graphql-debug
यह क्या करती है
यह स्किल आपके AI को वेब APIs की समस्याएँ पहचानने में मदद करती है, जैसे गलत status codes, विफल लॉगिन या गलत लगने वाला डेटा। यह उन डेवलपर्स के लिए है जो सॉफ़्टवेयर को ऑनलाइन सेवा से जोड़ रहे हैं।
कब इस्तेमाल करें
- ✓जब कोई API अनपेक्षित त्रुटि या status code दे और आपको कारण जानना हो।
- ✓जब token रिफ़्रेश के बाद या API key से प्रमाणीकरण विफल हो।
- ✓जब कोई अनुरोध Postman में काम करे पर आपके कोड में विफल हो।
Skill का लिंक
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/software-development/rest-graphql-debug/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी API कॉल Postman में काम करती है, पर मेरी स्क्रिप्ट में 401 त्रुटि देती है। क्या आप पता लगाने में मदद कर सकते हैं कि ऐसा क्यों है?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल हर परत क्रम से जाँचती है: कनेक्शन, timeouts, TLS प्रमाणपत्र, लॉगिन, अनुरोध फ़ॉर्मैट, जवाब का पार्सिंग और डेटा का अर्थ। परीक्षण चलाने के लिए वह curl और Python requests इस्तेमाल करती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
API Testing & Debugging
Drive REST and GraphQL diagnosis through Hermes tools — terminal for curl, execute_code for Python requests, web_extract for vendor docs. Isolate the failing layer before guessing at the fix.
When to Use
- API returns unexpected status or body
- Auth fails (401/403 after token refresh, OAuth, API key)
- Works in Postman but fails in code
- Webhook / callback integration debugging
- Building or reviewing API integration tests
- Rate limiting or pagination issues
Skip for UI rendering, DB query tuning, or DNS/firewall infra (escalate).
Core Principle
Isolate the layer, then fix. A 200 OK can hide broken data. A 500 can mask a one-character auth typo. Walk the chain in order; never skip a step.
1. Connectivity → can we reach the host at all?
1.5 Timeouts → connect-slow vs read-slow?
2. TLS/SSL → cert valid and trusted?
3. Auth → credentials correct and unexpired?
4. Request format → payload shape match server expectations?
5. Response parse → does our code accept what came back?
6. Semantics → does the data mean what we assume?
5-Minute Quickstart
REST via terminal
# Verbose request/response exchange
terminal('curl -v https://api.example.com/users/1')
# POST with JSON
terminal("""curl -X POST https://api.example.com/users \\
-H 'Content-Type: application/json' \\
-H "Authorization: Bearer $TOKEN" \\
-d '{"name":"test","email":"test@example.com"}'""")
# Headers only
terminal('curl -sI https://api.example.com/health')
# Pretty-print JSON
terminal('curl -s https://api.example.com/users | python -m json.tool')
GraphQL via terminal
terminal("""curl -X POST https://api.example.com/graphql \\
-H 'Content-Type: application/json' \\
-H "Authorization: Bearer $TOKEN" \\
-d '{"query":"{ user(id: 1) { name email } }"}'""")
GraphQL gotcha: servers often return HTTP 200 even when the query failed. Always inspect the errors field regardless of status code:
execute_code('''
import os, requests
resp = requests.post(
"https://api.example.com/graphql",
json={"query": "{ user(id: 1) { name email } }"},
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
timeout=10,
)
data = resp.json()
if data.get("errors"):
for err in data["errors"]:
print(f"GraphQL error: {err['message']} (path: {err.get('path')})")
print(data.get("data"))
''')
Python (requests) via execute_code
execute_code('''
import requests
resp = requests.get(
"https://api.example.com/users/1",
headers={"Authorization": "Bearer <TOKEN>"},
timeout=(3.05, 30), # (connect, read)
)
print(resp.status_code, dict(resp.headers))
print(resp.text[:500])
''')
Layered Debug Flow
Step 1 — Connectivity
terminal('nslookup api.example.com')
terminal('curl -v --connect-timeout 5 https://api.example.com/health')
Failures: DNS not resolving, firewall, VPN required, proxy missing.
Step 1.5 — Timeouts
Distinguish can't reach from reaches but slow:
terminal('''curl -w "dns:%{time_namelookup}s connect:%{time_connect}s tls:%{time_appconnect}s ttfb:%{time_starttransfer}s total:%{time_total}s\\n" \\
-o /dev/null -s https://api.example.com/endpoint''')
In Python, always pass a tuple timeout — requests has no default and will hang forever:
execute_code('''
import requests
from requests.exceptions import ConnectTimeout, ReadTimeout
try:
requests.get(url, timeout=(3.05, 30))
except ConnectTimeout:
print("Cannot reach host — DNS, firewall, VPN")
except ReadTimeout:
print("Connected but server is slow")
''')
Diagnosis: high time_connect is network/firewall; high time_starttransfer with low time_connect is a slow server.
Step 2 — TLS/SSL
terminal('curl -vI https://api.example.com 2>&1 | grep -E "SSL|subject|expire|issuer"')
Failures: expired cert, self-signed, hostname mismatch, missing CA bundle. Use -k only for ad-hoc debug, never in code.
Step 3 — Authentication
# Token validity check
terminal('curl -s -o /dev/null -w "%{http_code}\\n" -H "Authorization: Bearer $TOKEN" https://api.example.com/me')
# Decode JWT exp claim — handles base64url padding correctly
execute_code('''
import json, base64, os
tok = os.environ["TOKEN"]
payload = tok.split(".")[1]
payload += "=" * (-len(payload) % 4)
print(json.dumps(json.loads(base64.urlsafe_b64decode(payload)),
अक्सर पूछे जाने वाले सवाल
क्या यह UI या डेटाबेस की समस्याएँ ठीक करती है?
नहीं। स्किल कहती है कि यह API समस्याओं के लिए है, UI रेंडरिंग, डेटाबेस ट्यूनिंग या नेटवर्क इंफ़्रास्ट्रक्चर के लिए नहीं।
परतें क्रम से क्यों जाँचें?
स्किल कहती है कि 200 जवाब खराब डेटा छिपा सकता है और 500 एक छोटी auth गलती छिपा सकता है, इसलिए हर परत बारी से जाँची जाती है।
यह कौन से टूल इस्तेमाल करती है?
टर्मिनल से curl, Python requests, और विक्रेता दस्तावेज़ों के लिए web extract।
जानकारी
लेखक का मूल विवरण
Debug REST/GraphQL APIs: status codes, auth, schemas, repro.
लोकप्रियता
- GitHub स्टार
- 260k
- रैंकिंग में स्थान
- #575
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-merge-conflict-arbiter
260kदो एजेंट्स की branches के बीच git merge conflict को एक निष्पक्ष तीसरे पक्ष के रूप में सुलझाती है और रिपॉज़िटरी के लिए एक merged नतीजा बनाती है।
antigravity-cli
260kAntigravity कमांड-लाइन टूल को इंस्टॉल करने, अपडेट करने और उसकी दिक्कतें सुलझाने में मार्गदर्शन देती है, जिसमें प्लगइन, साइन-इन और sandbox शामिल हैं।
blackbox
260kआपके एजेंट को कोडिंग काम Blackbox AI कमांड-लाइन टूल को सौंपने देती है, जो कई AI मॉडल चलाकर सबसे अच्छा नतीजा चुनता है।
dynamic-workflow
260kआपके एजेंट को बड़े बैच के एक जैसे कामों को सेव की गई स्क्रिप्ट के रूप में चलाना सिखाती है, ताकि मुख्य बातचीत में केवल जांचे गए नतीजे लौटें।
मिलती-जुलती 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 करने के लिए उपयोगी है।