cloud-devops-expert
Cloud and DevOps expert including AWS, GCP, Azure, and Terraform
ai-ml-expert
AI and ML expert covering PyTorch, TensorFlow, Hugging Face, scikit-learn, LLM integration, RAG pipelines, MLOps, and production ML systems
Full skill instructions
When reviewing or writing PyTorch code, apply these guidelines:
torch.nn.Module for all model definitions; avoid raw function-based modelsmodel.to(device), tensor.to(device)model.train() and model.eval() context switches appropriatelyoptimizer.zero_grad() at the top of the training looptorch.no_grad() or @torch.inference_mode() for all inference codepin_memory=True) and use multiple workers in DataLoader for GPU trainingtorch.compile() (PyTorch 2.x) for production inference speedupsF.cross_entropy over manual softmax + NLLLoss (numerically stable)When reviewing or writing TensorFlow code, apply these guidelines:
tf.data.Dataset pipelines over manual batching for scalabilitytf.function for graph execution on performance-critical pathstf.keras.mixed_precision.set_global_policy('mixed_float16')tf.saved_model for portable model export; avoid picklingWhen reviewing or writing Hugging Face code, apply these guidelines:
padding=True and truncation=True when tokenizing batchesAutoModel, AutoTokenizer, and AutoConfig for checkpoint portabilitymodel.gradient_checkpointing_enable() to reduce memory for large modelsTrainer API for standard fine-tuning; use custom loops only when Trainer is insufficientTRANSFORMERS_CACHE environment variable in CI/CD pipelinesWhen reviewing or writing scikit-learn code, apply these guidelines:
Pipeline to chain preprocessing and model steps; prevents data leakageStratifiedKFold for classification tasks with class imbalanceGridSearchCV or RandomizedSearchCV for hyperparameter tuning.fit() only on training data; transform test data with the fitted transformerjoblib.dump / joblib.load (faster than pickle for large arrays)"Think step by step...") for complex reasoning taskstemperature=0 for deterministic, fact-based outputs; increase for creative tasks# Standard RAG pipeline components
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.vectorstores import FAISS # or Chroma, Pinecone, Weaviate
from langchain.chains import RetrievalQA
# 1. Embed and index documents
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
vectorstore = FAISS.from_documents(documents, embeddings)
# 2. Retrieve relevant chunks
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})
# 3. Generate with retrieved context
chain = RetrievalQA.from_chain_type(llm=llm, retriever=retriever)
RAG best practices:
LCEL (LangChain Expression Language) for composable chainsRunnableParallel for concurrent retrieval stepsLangGraph for stateful multi-agent workflows with cyclesRunnableRetry for unreliable external calls# Standard PyTorch training loop with best practices
for epoch in range(num_epochs):
model.train()
for batch in train_dataloader:
optimizer.zero_grad()
inputs, labels = batch["input_ids"].to(device), batch["labels"].to(device)
outputs = model(inputs)
loss = criterion(outputs, labels)
loss.backward()
torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0) # gradient clipping
optimizer.step()
scheduler.step()
# Validation loop
model.eval()
with torch.no_grad():
for batch in val_dataloader:
# evaluate...
Key standards:
max_norm=1.0) for stability in Transformer trainingsmoothing=0.1) to reduce overconfidencefrom peft import LoraConfig, get_peft_model, TaskType
lora_config = LoraConfig(
task_type=TaskType.CAUSAL_LM,
r=16, # LoRA rank
lora_alpha=32, # scaling factor
target_modules=["q_proj", "v_proj"],
lora_dropout=0.05,
)
model = get_peft_model(base_model, lora_config)
model.print_trainable_parameters() # verify < 1% parameters trainable
PEFT guidelines:
r=8 to r=64; higher rank = more capacity, more memoryimport mlflow
with mlflow.start_run():
mlflow.log_params({"learning_rate": lr, "batch_size": bs, "epochs": epochs})
mlflow.log_metrics({"train_loss": loss, "val_accuracy": acc}, step=epoch)
mlflow.pytorch.log_model(model, "model")
import wandb
wandb.init(project="my-project", config={"lr": 1e-4, "epochs": 10})
wandb.log({"train_loss": loss, "val_f1": f1_score})
wandb.finish()
MLOps standards:
torch.manual_seed(42), np.random.seed(42), random.seed(42)| Task | Primary Metrics | Secondary Metrics |
|---|---|---|
| Binary Classification | AUC-ROC, F1, Precision/Recall | Calibration (Brier Score) |
| Multi-class | Macro F1, Weighted F1, Cohen's Kappa | Confusion Matrix |
| Regression | RMSE, MAE, R² | Residual Analysis |
| NLP Generation | BLEU, ROUGE, BERTScore | Human Evaluation |
| Ranking/Retrieval | NDCG@k, MRR, MAP | Hit Rate@k |
| LLM Evaluation | LLM-as-judge, exact match, pass@k | Hallucination Rate |
torch.onnx.export(model, ...)torch.quantization.quantize_dynamic(model, ...)# Example: data drift detection with Evidently
from evidently.report import Report
from evidently.metric_preset import DataDriftPreset
report = Report(metrics=[DataDriftPreset()])
report.run(reference_data=reference_df, current_data=production_df)
report.save_html("drift_report.html")
Monitoring standards:
# Proper train/test split to avoid leakage
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42, stratify=y # stratify for classification
)
# Fit scaler ONLY on training data
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test) # transform only, never fit_transform
Standards:
torch.manual_seed(42), np.random.seed(42), random.seed(42) and log via MLflow/W&B..transform() test; fitting on test causes data leakage and inflated performance estimates.| Anti-Pattern | Problem | Fix |
|---|---|---|
| Ignoring class imbalance | Model biased to majority class | Stratified sampling, class weights, SMOTE |
| No validation set | Overfitting undetected | Hold out 10-20% for validation |
| Optimizing a single metric | Missing failure modes | Multiple metrics (precision, recall, F1, AUC) |
| No baseline comparison | Cannot assess model quality | Establish heuristic baseline before ML |
| Accuracy on imbalanced data | Misleading performance estimate | Use F1, precision-recall curve, ROC-AUC |
| Data leakage (test in train) | Inflated performance estimates | Fit on train only; transform test with fitted obj |
| No error analysis | Cannot improve strategically | Analyze failure cases by error type |
| Training without checkpoints | Lost progress on failure | Save best model by validation metric |
| Mutable global random state | Non-reproducible experiments | Fix all seeds; log in experiment metadata |
| Embedding model in application | Cannot update model independently | Serve model via API (REST, gRPC) |
| No latency budget | Inference too slow for production | Profile and set SLO before deployment |
</instructions>
<examples>Training a Transformer classifier:
from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TrainingArguments
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=3)
def tokenize(batch):
return tokenizer(batch["text"], padding=True, truncation=True, max_length=512)
dataset = dataset.map(tokenize, batched=True)
training_args = TrainingArguments(
output_dir="./results",
num_train_epochs=3,
per_device_train_batch_size=16,
evaluation_strategy="epoch",
save_strategy="epoch",
load_best_model_at_end=True,
metric_for_best_model="f1",
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=dataset["train"],
eval_dataset=dataset["validation"],
compute_metrics=compute_metrics,
)
trainer.train()
Minimal RAG pipeline:
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.chains import RetrievalQA
from langchain.chat_models import ChatOpenAI
vectorstore = Chroma.from_documents(docs, OpenAIEmbeddings())
retriever = vectorstore.as_retriever(search_kwargs={"k": 5})
qa = RetrievalQA.from_chain_type(ChatOpenAI(model="gpt-4o"), retriever=retriever)
answer = qa.run("What is the refund policy?")
</examples>
This skill is used by:
developer — Implements ML models, data pipelines, and LLM integrationsresearcher — Investigates novel architectures and evaluates research papersarchitect — Designs ML system architecture and deployment topologysecurity-architect — Reviews data privacy, model security, and inference safetypython-backend-expert — NumPy, Pandas, async Python patternscode-analyzer — Static analysis and complexity metrics for ML codedebugging — Systematic debugging for training failures and inference errorsBefore starting:
cat .claude/context/memory/learnings.md
Check for:
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Cloud and DevOps expert including AWS, GCP, Azure, and Terraform
Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.
Automated brownfield codebase analysis with weighted keyword scoring, three-stream analysis, and design pattern recognition. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile.
Use when creating, updating, or generating README and documentation files for projects and libraries
Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA/AMA/Vancouver), figure...
Comprehensive Android development expert covering Jetpack Compose, Kotlin coroutines/Flow, Architecture Components, Hilt DI, Navigation, testing, performance, Material Design 3, and modern Android patterns (MVI, Clean Architecture).
Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
Use when the user wants to use Google Gemini for analysis, large files or codebases, sandbox execution, or brainstorming. Uses headless Gemini CLI scripts (no MCP). Triggers on "use Gemini", "analyze with Gemini", "large file", "sandbox", "brainstorm with Gemini".
High-performance toolkit for genomic interval analysis in Rust with Python bindings. Use when working with genomic regions, BED files, coverage tracks, overlap detection, tokenization for ML models, or fragment analysis in computational genomics and machine learning applications.
Defines the structure and implementation of service classes, enforcing the use of interfaces, ServiceImpl classes, DTOs for data transfer, and transactional management.
Diffusion-based molecular docking. Predict protein-ligand binding poses from PDB/SMILES, confidence scores, virtual screening, for structure-based drug design. Not for affinity prediction.
How agents discover and use skills. Use to understand skill invocation protocol.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience