skills/ai-design-patterns/SKILL.md
AI-specific design patterns and system tactics — Feature Store, Champion-Challenger, Shadow Deployment, Drift Detection, Explainability Wrapper, Canary Deployment, Bulkhead, and traditional patterns adapted for AI. This skill should be used when the user asks to "select AI design patterns", "apply ML patterns", "design drift detection", "implement feature store", "plan shadow deployment", "design champion-challenger", "select availability tactics for AI", or mentions AI anti-patterns, maintainability tactics, fault recovery for models, or pattern selection for ML systems. [EXPLICIT]
npx skillsauth add JaviMontano/jm-adk-alfa ai-design-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
AI design patterns define reusable solutions to recurring architectural problems in AI systems. This skill produces a pattern selection analysis covering maintainability tactics, availability tactics, AI-specific patterns (Feature Store, Champion-Challenger, Shadow Deployment, Drift Detection), traditional patterns adapted for AI, anti-pattern detection, and a decision framework that maps system requirements to recommended patterns. [EXPLICIT]
Los patrones son decisiones arquitectónicas, no decoraciones. Cada patrón seleccionado tiene un costo (complejidad, infraestructura, operaciones) y un beneficio (resiliencia, mantenibilidad, seguridad). Seleccionar un patrón sin justificación es tan peligroso como no tener ningún patrón.
The user provides a system or project name as $ARGUMENTS. Parse $1 as the system/project name used throughout all output artifacts. [EXPLICIT]
Parameters:
{MODO}: piloto-auto (default) | desatendido | supervisado | paso-a-paso{FORMATO}: markdown (default) | html | dual{ALCANCE}: ejecutiva (~40% — S3 AI patterns + S6 decision framework) | tecnica (full 6 sections, default)Before generating pattern analysis, detect the codebase context:
Detección automática de contexto:
Escanear el codebase por frameworks ML (PyTorch, TensorFlow, scikit-learn),
orquestadores (Airflow, Dagster, Prefect, Kubeflow), y serving frameworks
(TensorFlow Serving, TorchServe, Triton, vLLM) para adaptar recomendaciones. [EXPLICIT]
Detect existing patterns (feature stores, A/B testing, monitoring, model serving, drift detection). [EXPLICIT]
Load references:
Read ${CLAUDE_SKILL_DIR}/references/ai-patterns-detail.md
Read ${CLAUDE_SKILL_DIR}/references/tactics-catalog.md
Read ${CLAUDE_SKILL_DIR}/references/anti-patterns.md
Identifies tactics that enable the AI system to evolve, be tested, and be configured without fragility. [EXPLICIT]
Tactic categories:
Key decisions:
Identifies tactics that ensure the AI system detects, recovers from, and prevents failures. [EXPLICIT]
Fault detection tactics:
Fault recovery tactics:
Fault prevention tactics:
Key decisions:
Catalogs the patterns purpose-built for AI system challenges. [EXPLICIT]
Patterns:
For each pattern: intent, structure, key decisions, and trade-offs. Detail in references/ai-patterns-detail.md. [EXPLICIT]
Key decisions:
Maps traditional software patterns to AI-specific applications. [EXPLICIT]
Service-oriented:
Load management:
Resilience:
Consensus:
Key decisions:
Identifies known anti-patterns, detects their presence, and prescribes remediation. [EXPLICIT]
Anti-patterns:
For each: symptom, cause, detection signal, and recommended pattern fix. [EXPLICIT]
Key decisions:
Provides a systematic approach for selecting patterns based on system requirements. [EXPLICIT]
Selection dimensions:
Pattern dependency graph:
Feature Store -> Champion-Challenger -> Canary Deployment
Drift Detection -> Model Rollback -> Circuit Breaker
Explainability Wrapper -> Audit Trail -> Compliance
Shadow Deployment -> Canary Deployment -> Blue & Gold CI/CD
Implementation roadmap template:
| Pattern | Enables | Constrains | When to Use | |---|---|---|---| | Feature Store | Consistency, reuse, drift monitoring | Infrastructure overhead, governance cost | Multiple models sharing features | | Champion-Challenger | Evidence-based promotion | Traffic split complexity, experiment duration | Multiple model candidates, sufficient traffic | | Shadow Deployment | Risk-free validation with real traffic | Doubled infrastructure cost, no user feedback | High-risk model changes | | Drift Detection | Early degradation warning | False positive alerts, monitoring overhead | All production AI systems | | Explainability Wrapper | Transparency, compliance, trust | Latency overhead, explanation fidelity | Regulated domains, high-stakes decisions | | Canary Deployment | Gradual risk mitigation | Slower deployment, routing complexity | All model deployments | | Bulkhead | Fault isolation, independent scaling | Resource overhead, operational complexity | Multi-model or multi-tenant systems | | N-Party Voting | Robustness, reduced variance | Latency, compute cost, model diversity | High-stakes or adversarial environments | | Model Distillation | Lower latency, reduced cost | Quality loss, training effort | High-volume inference with latency constraints | | Prompt Caching | Cost reduction, latency improvement | Cache invalidation, storage cost | High-volume systems with repeated query patterns | | Guardrail Pattern | Safety, compliance, brand protection | Added latency, false positives | All production GenAI systems |
Early-Stage System with One Model: Most patterns are overkill for a single-model MVP. Start with Drift Detection and basic monitoring. Add Feature Store only when a second model needs shared features. Add Champion-Challenger only when there are model alternatives to compare. [EXPLICIT]
Real-Time vs. Batch Pattern Selection: Some patterns behave differently in real-time vs. batch contexts. Champion-Challenger in real-time splits live traffic; in batch, it runs parallel jobs on the same dataset. Feature Store online store is for real-time; offline store is for batch. Ensure pattern documentation specifies both modes. [EXPLICIT]
Multi-Team Pattern Governance: Different teams may implement the same pattern differently (e.g., each team builds their own drift detection). Establish shared pattern implementations as platform capabilities. Feature Store and Model Registry are infrastructure-level patterns, not team-level. [EXPLICIT]
Regulated Environment Pattern Requirements: In finance and healthcare, Explainability Wrapper and audit trails are mandatory, not optional. Drift Detection thresholds may be set by regulators. Champion-Challenger experiments may require ethics board approval. Document regulatory pattern mandates separately from optional patterns. [EXPLICIT]
piloto-auto (default).Before finalizing delivery, verify:
El agente que ejecuta este skill debe verificar cada item antes de entregar el output al usuario.
| Format | Default | Description |
|--------|---------|-------------|
| markdown | Yes | Rich Markdown + Mermaid diagrams. Token-efficient. |
| html | On demand | Branded HTML (Design System). Visual impact. |
| dual | On demand | Both formats. |
Primary: A-03_AI_Design_Patterns_Deep.html — Maintainability tactics matrix, availability tactics matrix, AI patterns catalog with diagrams, traditional patterns adapted, anti-pattern detection results, pattern selection decision framework.
Secondary: Pattern decision records (.md), anti-pattern detection checklist, pattern dependency graph (Mermaid/PNG/SVG), implementation roadmap.
Fuente: Avila, R.D. & Ahmad, I. (2025). Architecting AI Software Systems. Packt.
development
This skill should be used when the user asks to "design analytics models", "set up a dbt project", "plan data transformations", "define data contracts", or "model a star schema", or mentions staging models, marts, incremental strategies, or materializations. It produces analytics pipeline designs with dbt-style transformations, data modeling patterns, testing strategies, and documentation plans. [EXPLICIT] Use this skill whenever the user needs source-to-target mapping, materialization decisions, or transformation framework architecture, even if they don't explicitly ask for "analytics engineering". [EXPLICIT]
testing
Alert fatigue prevention, escalation rules, severity classification. [EXPLICIT] Trigger: "alerting strategy"
tools
LLM-in-the-loop workflows, human-AI handoff, approval gates. [EXPLICIT] Trigger: "ai workflow automation"
tools
Comprehensive testing strategy for AI systems — testing scope matrix (6 types x 6 layers), model prediction testing, data quality testing, compliance and fairness testing, integration approaches, and CI/CD test automation. This skill should be used when the user asks to "define AI testing strategy", "test ML models", "design data quality tests", "plan fairness testing", "test AI pipelines", "design integration tests for ML", or mentions adversarial testing, drift simulation, model regression testing, bias testing, explainability testing, or AI test automation. [EXPLICIT]