Skillpedia
واجهات API والخوادم (backend)13k · #11384

effect-program-design

ما الذي تفعله

يرشد هذا الدليل الوكيل إلى بناء تطبيقات Effect لـ TypeScript بخدمات واضحة وأخطاء مُنمذجة وطبقات سهلة الاختبار. وهي موجهة للمطورين الذين يستخدمون مكتبة Effect ويريدون كودًا قابلًا للصيانة.

متى تستخدمها

  • ✓عندما تبني خدمة أو طبقة في تطبيق Effect أو تغيّرها.
  • ✓عندما تحتاج إلى أخطاء مُنمذجة أو إعدادات أو عمال خلفيين في برنامج Effect.
  • ✓عندما تريد اختبارات تستبدل التبعيات الوهمية عند الحدود الحقيقية.

رابط المهارة

https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/effect-program-design/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/effect-program-design/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“ساعدني في إضافة خدمة إرسال بريد إلكتروني إلى تطبيق Effect الخاص بي، مع معالجة صحيحة للأخطاء واختبارات.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يفحص الوكيل أولًا أعراف مشروعك ونسخة Effect المثبتة، ثم يكتب كودًا يتبع أنماط المكتبة. ويستخدم واجهات خدمة صغيرة ليسهل اختبار كل جزء.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Effect Program Design

Build production Effect v4 programs with small domain-shaped interfaces, typed success and error channels, declared dependencies, observable operation boundaries, and tests that substitute layers at real seams. This skill combines broad Effect mechanics with HumanLayer's deep-module, capture-before-narrow, and real-seam design standards.

Source rule

Check these before guessing:

  1. the nearest CLAUDE.md / AGENTS.md and project-local conventions;
  2. the installed effect, @effect/*, and related package versions and declarations;
  3. the Effect v4 docs at https://effect-ts-effect-smol.mintlify.app/;
  4. the pinned/upstream source (~/projects/effect-smol) when docs do not settle an API.

unstable-tagged modules (effect/http, effect/rpc, effect/process, ...) can change between beta/minor versions. Typecheck examples against the installed version. Local project conventions take precedence unless the task explicitly changes them.

References

Read only the references relevant to the task; read all matching branches when work crosses concerns.

  • Public module depth and domain-shaped APIs: references/DEEP_MODULES.md. Read this any time you are modifying or creating services or layers - this is the core of our effect philosophy!
  • Service tags, live layers, file placement, Effect.fn, or runtime composition: references/SERVICES_LAYERS.md.
  • Tagged errors, capture-before-narrow, spans, logs, or Sentry: references/ERRORS_OBSERVABILITY.md.
  • Records, schemas, variants, optionality, brands, decoding, or construction: references/SCHEMA_DATA_MODELING.md.
  • Config, env vars, providers, or secrets: references/CONFIG_SECRETS.md.
  • HTTP/SDK/DB boundaries, Drizzle rows, JSONB, or transactions: references/BOUNDARIES_PERSISTENCE.md.
  • Scopes, acquisition, concurrency, best-effort work, or workflow transitions: references/RESOURCES_CONCURRENCY.md.
  • Retry, repeat, polling, pacing, backoff, or workers: references/SCHEDULING_WORKERS.md.
  • Streams, queues, pubsub, pagination, backpressure, or long-lived consumers: references/STREAMS.md.
  • Memoization, TTL caches, request dedupe, or batching: references/CACHING_BATCHING.md.
  • Outgoing HTTP, provider adapters, status/decode handling, or HTTP retry: references/HTTP_CLIENTS.md.
  • Effect tests, test services, clocks, synchronization, fakes, or real seams: references/TESTING.md.
  • Platform-neutral services and the native-API boundary: references/PLATFORM.md.
  • Node runtime, filesystem, path, crypto, child processes, sockets/WebSocket, Redis, or workers: references/PLATFORM_NODE.md.
  • Effect Atom or React reactive Effect state: references/EFFECT_ATOM.md.
  • TypeScript safety, Predicate refinements, Match dispatch, naming, collections, imports, and escape hatches: references/TYPESCRIPT_CONTRACTS.md.
  • Local exemplars and foils: references/REPOSITORY_EXAMPLES.md.

The creed

  1. Deep modules. The interface is the cost and the hidden implementation is the benefit. Public operations use domain inputs and outputs; callers do not supply credentials, clients, rows, or other internals.

  2. Everything stays in Effect. Keep expected failures in E, dependencies in R, and resources in scopes. Do not pass services, layers, effects, or errors as ordinary values when composition expresses the relationship.

  3. Two-tier errors. Classify rich internal failures, capture them, then narrow to a small caller-actionable union. Prefer typed catchTag/catchTags; never recover with instanceof, Match, or manual _tag comparisons. Respect the error channel! Errors stay in the error channel and are not passed as values

  4. Observe operations. Every public operation has a stable Effect.fn("domain.operation"), an explicit Effect.withSpan, or both. Capture raw actionable/unexpected failures before narrowing or swallowing them.
    Use Effect's logger to log info, errors, etc - yield* Effect.logError - do NOT pass in external loggers. Errors MUST also be captured to sentry as soon as they surface before they are re-mapped or transformed.

    someEffect.pipe(
    Effect.tapError(Effect.logError),
    Effect.tapError((e) => Effect.sync(() => Sentry.captureException(e))),
    )
    
  5. Test at real seams. Use @effect/vitest, layers, deterministic test services, and real infrastructure where behavior depends on it. Assert both the result/error and externally v

الأسئلة الشائعة

هل يجب أن أعرف Effect مسبقًا؟

تساعد بعض معرفة TypeScript، لكن المهارة ترشد الوكيل خلال أنماط Effect.

هل ستطابق نسخة Effect المثبتة لدي؟

نعم. تتحقق من النسخة المثبتة وتفحص الأمثلة على أنواعها، لأن بعض الوحدات تتغير بين الإصدارات.

أي أجزاء من Effect تغطيها؟

تغطي الخدمات والمخططات والأخطاء والإعدادات والتزامن والتدفقات والتخزين المؤقت وعملاء HTTP.

التفاصيل

الوصف الأصلي من المؤلف

Design, write, review, and test production Effect v4 programs: deep services and layers, schemas, tagged errors, observability, Config, persistence, resources, concurrency, schedules, workers, streams, caches, HTTP clients, Effect platform services (Node filesystem/path/crypto/process/socket), and Effect Atom integrations. Use for any Effect application or adapter work.

repo: humanlayer/humanlayer

الشعبية

نجوم GitHub
13k
الترتيب
#11384
الترخيص
Apache-2.0
آخر تحديث
31‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة