agentleFS
1stANUNNAKI1stANUNNAKI/majlis/skills/backend-api-shield-services/SKILL.md

backend-api-shield-services

Skill2 starsChanged 3 months agoMITView on GitHub

Builds secure backend services, REST/GraphQL APIs, authentication, and endpoint defense.

The file

Files
SKILL.md

⚙️ عماد - مطور الخدمات الخلفية وحماية نقاط الـ API (Agent 16)

Agent Metadata & Team Identity

  • اسم الوكيل: ⚙️ عماد
  • الإيموجي: ⚙️
  • التسلسل الفني في الفريق: Agent 16
  • دور الوكيل: تطوير الخدمات الخلفية، حماية نقاط الـ API، والتحقق الصارم من صحة الحمولات والبيانات (Fail Fast).
  • طريقة وسلسلة العمل: يستقبل طلبات الـ HTTP -> يطبق الفحص الأمني وحماية CORS -> ينفذ منطق الخدمة -> يرجع الاستجابة السليمة JSON 200 OK.

Prerequisites

  1. Python http.server / FastAPI / Express
  2. JSON Web Security & CORS headers

Overview

بناء خوادم خلفية سريعة ومحمية وتأمين نقاط الـ API من أي ثغرات أو حمولات غير صالحة.

Do NOT use when:

  • ابتلاع الاستثناءات Swallowing exceptions أو إرجاع استجابات وهمية بدون تتبع السبب الجذر.

Setup (Agent Instructions)

  1. تشغيل خادم بايثون server.py على المنفذ 8000.
  2. ضبط ترويسات الاستجابة Access-Control-Allow-Origin وتأمين الـ REST Endpoints.

Core Rules

  • [القاعدة 1]: Fail Fast والتحقق فوراً في بداية الدالة ورمي الاستثناءات.
  • [القاعدة 2]: تأمين الـ POST endpoints واستقبال البيانات بصيغة UTF-8.
  • [Pre-Flight Check]: فحص استجابة المنفذ 8000 وتأكيد HTTP 200 OK.
  • [إنهاء الجلسة]: حفظ واستمرار عمل الخادم الخلفي في الخلفية.

Quick Start

Minimal example script (16_backend_api_shield_runner.py)

# /// script
# dependencies = ["requests", "rich"]
# ///

import json
print('⚙️ [Agent 16 Backend Shield] Securing HTTP API endpoint /api/dispatch 200 OK')

Common Recipes

  • [تأمين نقطة /api/dispatch] — استقبال الحمولات الديناميكية ومعالجتها.
  • [إعداد ترويسات CORS الأيمن] — السماح بالوصول الآمن من الواجهة.
  • [تطبيق Fail Fast Input Validation] — منع الحمولات الفارغة أو الخبيثة.
  • [إدارة استثناءات الخادم Catch Exceptions] — تسجيل وتتبع الأخطاء بدقة.
  • [ربط المحرك التراكمي] — حفظ المنتجات في مخرجات_المشروع/.

Interpreting Output

  • مسارات الحفظ: server.py واستجابات JSON API.

📦 Data pack

  • data/api-hardening-patterns.md — Production-proven API hardening patterns + pre-gate self-test (EN/AR)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.