django-recommender-search-backend-patterns
БесплатноБез исполняемых скриптовНе проверенDjango backend patterns for recommendation services (AWS Personalize, Databricks Model Serving, internal microservices) and OpenSearch-backed search/feed…
от pproenca★ 231 звезда на GitHubОб этом скилле
Experimental Django Recommender + Search Backend Best Practices
Implementation patterns for a Django backend serving mixed-results recommendations (Personalize / Databricks / microservice fan-out) and OpenSearch-backed search/feeds. 48 rules across 8 categories, ordered by execution lifecycle impact — earlier categories cascade through everything downstream.
This is the backend peer of the react-fetch-cache-patterns skill. React handles client-side waterfalls and caching; this skill handles server-side fan-out, downstream protection, OpenSearch query design, and ML-blend orchestration.
When to Apply
- Building or reviewing Django views that fan out to AWS Personalize, Databricks Model Serving, internal microservices, or any ML inference downstream
- Designing OpenSearch query endpoints (search results, infinite feeds, faceted search)
- Implementing a recommendations endpoint that blends multiple ranker outputs
- Investigating "Django backend slow when downstream is degraded" or "Personalize quota exhausted"
- Adding caching, retry, circuit breakers, or rate limiting to outbound calls
- Choosing between sync and async Django views, configuring uvicorn vs gunicorn
- Designing DRF response shapes for paginated feeds, partial results, or degraded paths
Rule Categories by Priority
| # | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Fan-out Orchestration | CRITICAL | orch- |
8 |
| 2 | External Service Protection | CRITICAL | protect- |
7 |
| 3 | OpenSearch Query Patterns | CRITICAL | search- |
8 |
| 4 | Result Blending & Personalization | HIGH | blend- |
5 |
| 5 | Caching Strategy | HIGH | cache- |
5 |
| 6 | Resilience & Partial Results | HIGH | resilience- |
5 |
| 7 | Async & Concurrency | MEDIUM-HIGH | async- |
5 |
| 8 | API Response Design | MEDIUM | api- |
5 |
Quick Reference
1. Fan-out Orchestration (CRITICAL)
orch-parallel-fanout-asyncio-gather— Useasyncio.gatherfor independent downstream calls; never await sequentiallyorch-return-exceptions-on-fanout—return_exceptions=Trueso one failure doesn't poison the whole gatherorch-propagate-request-deadline— Pass a deadline through every downstream call to bound whole-request latencyorch-reuse-async-clients— Onehttpx.AsyncClientper downstream at module scope; never per-requestorch-bounded-fanout-concurrency— Cap per-request fan-out withasyncio.Semaphoreto protect the poolorch-no-blocking-in-async-view— Never block the event loop with sync ORM/IO in async viewsorch-avoid-await-in-loop—for item in items: await ...is serial; useasyncio.gatherwith comprehensionorch-batch-with-bulk-endpoint— Bulk endpoint over N parallel calls; DataLoader pattern for batchers
2. External Service Protection (CRITICAL)
protect-per-downstream-timeout-budget— Different timeouts per service matched to each downstream's p99protect-circuit-breaker-per-downstream— One breaker per downstream so failures stay isolatedprotect-jittered-retry-backoff— Full-jitter exponential backoff to prevent thundering-herd recoveryprotect-no-retry-on-4xx— Skip retry on 4xx and non-idempotent failures; distinguish connect vs read errorsprotect-bulkhead-connection-pool— One connection pool per downstream so one slow service doesn't starve othersprotect-client-side-rate-limit— Token bucket toward each downstream to stay under their quotaprotect-honor-retry-after-header— ParseRetry-After(seconds or HTTP-date) on 429/503
3. OpenSearch Query Patterns (CRITICAL)
search-use-search-after-not-from—search_aftercursor instead offrom/sizefor any paginated endpointsearch-filter-source-fields— Restrict_sourceto fields you render; usedocvalue_fieldsfor sortablesearch-bool-filter-vs-must— Non-scoring clauses infilter(cacheable), scoring clauses inmustsearch-function-score-for-blending— Usefunction_scoreto blend personalization signals in-engine- [`search-stable-tiebr
Установить django-recommender-search-backend-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл django-recommender-search-backend-patterns?
Django backend patterns for recommendation services (AWS Personalize, Databricks Model Serving, internal microservices) and OpenSearch-backed search/feed endpoints. Covers fan-out orchestration (asyncio.gather, deadline propagation, partial results, async client reuse), external service protection (timeouts, circuit breakers, jittered retry, bulkheads, rate limits), OpenSearch query patterns (search_after, _source filtering, function_score, aliases, routing, bool.filter), result blending (score normalization, MMR, dedup, cold-start), Redis caching (stampede protection, model-versioned keys, two-tier, negative), resilience (partial-response envelope, stale-on-error, graceful degradation), async (sync_to_async, async ORM, uvicorn, contextvars, disconnect cancellation), and DRF response shape (cursor pagination, ETag, throttling). Use when building, reviewing, or refactoring such a Django backend. Triggers even without explicit "scale" cues. Includes 5 scaffolding templates.
Как установить скилл django-recommender-search-backend-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл django-recommender-search-backend-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
agent-skill-stack
Find, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
от GitHubbuild-evidence-map
Build an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
от GitHubpinecone-rag
Build production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
от GitHubqdrant-monitoring-debugging
Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…
от GitHub