[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71J6E2ZY0RFFRNF4P2SWKDW":3,"skill-same:01M71J6E2ZY0RFFRNF4P2SWKDW":91},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":52,"commitSha":53,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M71J6E2ZY0RFFRNF4P2SWKDW","shap",null,"Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model.","agency-black\u002FSkills","agency-black","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F234862658?v=4","01M6HWVFPNGNR5N2CX9ECSAD57","agencia.black","01M719WF77BF3HN0N9FK1APEFY",0,"MIT","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fshap\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"model","tree","linear","Interpretability","analyzing","predictions","when","debugging","pytorch","deep learning","models","use","bias","learning","random","random forest","black","implementing","deep","2026-11-10 10:12:30",false,"---\nname: shap\ndescription: Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model.\nlicense: MIT license\nmetadata:\n  version: \"1.0\"\n  skill-author: K-Dense Inc.\n---\n\n# SHAP (SHapley Additive exPlanations)\n\n## Overview\n\nSHAP is a unified approach to explain machine learning model outputs using Shapley values from cooperative game theory. This skill provides comprehensive guidance for:\n\n- Computing SHAP values for any model type\n- Creating visualizations to understand feature importance\n- Debugging and validating model behavior\n- Analyzing fairness and bias\n- Implementing explainable AI in production\n\nSHAP works with all model types: tree-based models (XGBoost, LightGBM, CatBoost, Random Forest), deep learning models (TensorFlow, PyTorch, Keras), linear models, and black-box models.\n\n## When to Use This Skill\n\n**Trigger this skill when users ask about**:\n- \"Explain which features are most important in my model\"\n- \"Generate SHAP plots\" (waterfall, beeswarm, bar, scatter, force, heatmap, etc.)\n- \"Why did my model make this prediction?\"\n- \"Calculate SHAP values for my model\"\n- \"Visualize feature importance using SHAP\"\n- \"Debug my model's behavior\" or \"validate my model\"\n- \"Check my model for bias\" or \"analyze fairness\"\n- \"Compare feature importance across models\"\n- \"Implement explainable AI\" or \"add explanations to my model\"\n- \"Understand feature interactions\"\n- \"Create model interpretation dashboard\"\n\n## Quick Start Guide\n\n### Step 1: Select the Right Explainer\n\n**Decision Tree**:\n\n1. **Tree-based model?** (XGBoost, LightGBM, CatBoost, Random Forest, Gradient Boosting)\n   - Use `shap.TreeExplainer` (fast, exact)\n\n2. **Deep neural network?** (TensorFlow, PyTorch, Keras, CNNs, RNNs, Transformers)\n   - Use `shap.DeepExplainer` or `shap.GradientExplainer`\n\n3. **Linear model?** (Linear\u002FLogistic Regression, GLMs)\n   - Use `shap.LinearExplainer` (extremely fast)\n\n4. **Any other model?** (SVMs, custom functions, black-box models)\n   - Use `shap.KernelExplainer` (model-agnostic but slower)\n\n5. **Unsure?**\n   - Use `shap.Explainer` (automatically selects best algorithm)\n\n**See `references\u002Fexplainers.md` for detailed information on all explainer types.**\n\n### Step 2: Compute SHAP Values\n\n```python\nimport shap\n\n# Example with tree-based model (XGBoost)\nimport xgboost as xgb\n\n# Train model\nmodel = xgb.XGBClassifier().fit(X_train, y_train)\n\n# Create explainer\nexplainer = shap.TreeExplainer(model)\n\n# Compute SHAP values\nshap_values = explainer(X_test)\n\n# The shap_values object contains:\n# - values: SHAP values (feature attributions)\n# - base_values: Expected model output (baseline)\n# - data: Original feature values\n```\n\n### Step 3: Visualize Results\n\n**For Global Understanding** (entire dataset):\n```python\n# Beeswarm plot - shows feature importance with value distributions\nshap.plots.beeswarm(shap_values, max_display=15)\n\n# Bar plot - clean summary of feature importance\nshap.plots.bar(shap_values)\n```\n\n**For Individual Predictions**:\n```python\n# Waterfall plot - detailed breakdown of single prediction\nshap.plots.waterfall(shap_values[0])\n\n# Force plot - additive force visualization\nshap.plots.force(shap_values[0])\n```\n\n**For Feature Relationships**:\n```python\n# Scatter plot - feature-prediction relationship\nshap.plots.scatter(shap_values[:, \"Feature_Name\"])\n\n# Colored by another feature to show interactions\nshap.plots.scatter(shap_values[:, \"Age\"], color=shap_values[:, \"Education\"])\n```\n\n**See `references\u002Fplots.md` for comprehensive guide on all plot types.**\n\n## Core Workflows\n\nThis skill supports several common workflows. Choose the workflow that matches the current task.\n\n### Workflow 1: Basic Model Explanation\n\n**Goal**: Understand what drives model predictions\n\n**Steps**:\n1. Train model and create appropriate explainer\n2. Compute SHAP values for test set\n3. Generate global importance plots (beeswarm or bar)\n4. Examine top feature relationships (scatter plots)\n5. Explain specific predictions (waterfall plots)\n\n**Example**:\n```python\n# Step 1-2: Setup\nexplainer = shap.TreeExplainer(model)\nshap_values = explainer(X_test)\n\n# Step 3: Global importance\nshap.plots.beeswarm(shap_values)\n\n# Step 4: Feature relationships\nshap.plots.scatter(shap_values[:, \"Most_Important_Feature\"])\n\n# Step 5: Individual explanation\nshap.plots.waterfall(shap_values[0])\n```\n\n### Workflow 2: Model Debugging\n\n**Goal**: Identify and fix model issues\n\n**Steps**:\n1. Compute SHAP values\n2. Identify prediction errors\n3. Explain misclassified samples\n4. Check for unexpected feature importance (data leakage)\n5. Validate feature relationships make sense\n6. Check feature interactions\n\n**See `references\u002Fworkflows.md` for detailed debugging workflow.**\n\n### Workflow 3: Feature Engineering\n\n**Goal**: Use SHAP insights to improve features\n\n**Steps**:\n1. Compute SHAP values for baseline model\n2. Identify nonlinear relationships (candidates for transformation)\n3. Identify feature interactions (candidates for interaction terms)\n4. Engineer new features\n5. Retrain and compare SHAP values\n6. Validate improvements\n\n**See `references\u002Fworkflows.md` for detailed feature engineering workflow.**\n\n### Workflow 4: Model Comparison\n\n**Goal**: Compare multiple models to select best interpretable option\n\n**Steps**:\n1. Train multiple models\n2. Compute SHAP values for each\n3. Compare global feature importance\n4. Check consistency of feature rankings\n5. Analyze specific predictions across models\n6. Select based on accuracy, interpretability, and consistency\n\n**See `references\u002Fworkflows.md` for detailed model comparison workflow.**\n\n### Workflow 5: Fairness and Bias Analysis\n\n**Goal**: Detect and analyze model bias across demographic groups\n\n**Steps**:\n1. Identify protected attributes (gender, race, age, etc.)\n2. Compute SHAP values\n3. Compare feature importance across groups\n4. Check protected attribute SHAP importance\n5. Identify proxy features\n6. Implement mitigation strategies if bias found\n\n**See `references\u002Fworkflows.md` for detailed fairness analysis workflow.**\n\n### Workflow 6: Production Deployment\n\n**Goal**: Integrate SHAP explanations into production systems\n\n**Steps**:\n1. Train and save model\n2. Create and save explainer\n3. Build explanation service\n4. Create API endpoints for predictions with explanations\n5. Implement caching and optimization\n6. Monitor explanation quality\n\n**See `references\u002Fworkflows.md` for detailed production deployment workflow.**\n\n## Key Concepts\n\n### SHAP Values\n\n**Definition**: SHAP values quantify each feature's contribution to a prediction, measured as the deviation from the expected model output (baseline).\n\n**Properties**:\n- **Additivity**: SHAP values sum to difference between prediction and baseline\n- **Fairness**: Based on Shapley values from game theory\n- **Consistency**: If a feature becomes more important, its SHAP value increases\n\n**Interpretation**:\n- Positive SHAP value → Feature pushes prediction higher\n- Negative SHAP value → Feature pushes prediction lower\n- Magnitude → Strength of feature's impact\n- Sum of SHAP values → Total prediction change from baseline\n\n**Example**:\n```\nBaseline (expected value): 0.30\nFeature contributions (SHAP values):\n  Age: +0.15\n  Income: +0.10\n  Education: -0.05\nFinal prediction: 0.30 + 0.15 + 0.10 - 0.05 = 0.50\n```\n\n### Background Data \u002F Baseline\n\n**Purpose**: Represents \"typical\" input to establish baseline expectations\n\n**Selection**:\n- Random sample from training data (50-1000 samples)\n- Or use kmeans to select representative samples\n- For DeepExplainer\u002FKernelExplainer: 100-1000 samples balances accuracy and speed\n\n**Impact**: Baseline affects SHAP value magnitudes but not relative importance\n\n### Model Output Types\n\n**Critical Consideration**: Understand what your model outputs\n\n- **Raw output**: For regression or tree margins\n- **Probability**: For classification probability\n- **Log-odds**: For logistic regression (before sigmoid)\n\n**Example**: XGBoost classifiers explain margin output (log-odds) by default. To explain probabilities, use `model_output=\"probability\"` in TreeExplainer.\n\n## Common Patterns\n\n### Pattern 1: Complete Model Analysis\n\n```python\n# 1. Setup\nexplainer = shap.TreeExplainer(model)\nshap_values = explainer(X_test)\n\n# 2. Global importance\nshap.plots.beeswarm(shap_values)\nshap.plots.bar(shap_values)\n\n# 3. Top feature relationships\ntop_features = X_test.columns[np.abs(shap_values.values).mean(0).argsort()[-5:]]\nfor feature in top_features:\n    shap.plots.scatter(shap_values[:, feature])\n\n# 4. Example predictions\nfor i in range(5):\n    shap.plots.waterfall(shap_values[i])\n```\n\n### Pattern 2: Cohort Comparison\n\n```python\n# Define cohorts\ncohort1_mask = X_test['Group'] == 'A'\ncohort2_mask = X_test['Group'] == 'B'\n\n# Compare feature importance\nshap.plots.bar({\n    \"Group A\": shap_values[cohort1_mask],\n    \"Group B\": shap_values[cohort2_mask]\n})\n```\n\n### Pattern 3: Debugging Errors\n\n```python\n# Find errors\nerrors = model.predict(X_test) != y_test\nerror_indices = np.where(errors)[0]\n\n# Explain errors\nfor idx in error_indices[:5]:\n    print(f\"Sample {idx}:\")\n    shap.plots.waterfall(shap_values[idx])\n\n    # Investigate key features\n    shap.plots.scatter(shap_values[:, \"Suspicious_Feature\"])\n```\n\n## Performance Optimization\n\n### Speed Considerations\n\n**Explainer Speed** (fastest to slowest):\n1. `LinearExplainer` - Nearly instantaneous\n2. `TreeExplainer` - Very fast\n3. `DeepExplainer` - Fast for neural networks\n4. `GradientExplainer` - Fast for neural networks\n5. `KernelExplainer` - Slow (use only when necessary)\n6. `PermutationExplainer` - Very slow but accurate\n\n### Optimization Strategies\n\n**For Large Datasets**:\n```python\n# Compute SHAP for subset\nshap_values = explainer(X_test[:1000])\n\n# Or use batching\nbatch_size = 100\nall_shap_values = []\nfor i in range(0, len(X_test), batch_size):\n    batch_shap = explainer(X_test[i:i+batch_size])\n    all_shap_values.append(batch_shap)\n```\n\n**For Visualizations**:\n```python\n# Sample subset for plots\nshap.plots.beeswarm(shap_values[:1000])\n\n# Adjust transparency for dense plots\nshap.plots.scatter(shap_values[:, \"Feature\"], alpha=0.3)\n```\n\n**For Production**:\n```python\n# Cache explainer\nimport joblib\njoblib.dump(explainer, 'explainer.pkl')\nexplainer = joblib.load('explainer.pkl')\n\n# Pre-compute for batch predictions\n# Only compute top N features for API responses\n```\n\n## Troubleshooting\n\n### Issue: Wrong explainer choice\n**Problem**: Using KernelExplainer for tree models (slow and unnecessary)\n**Solution**: Always use TreeExplainer for tree-based models\n\n### Issue: Insufficient background data\n**Problem**: DeepExplainer\u002FKernelExplainer with too few background samples\n**Solution**: Use 100-1000 representative samples\n\n### Issue: Confusing units\n**Problem**: Interpreting log-odds as probabilities\n**Solution**: Check model output type; understand whether values are probabilities, log-odds, or raw outputs\n\n### Issue: Plots don't display\n**Problem**: Matplotlib backend issues\n**Solution**: Ensure backend is set correctly; use `plt.show()` if needed\n\n### Issue: Too many features cluttering plots\n**Problem**: Default max_display=10 may be too many or too few\n**Solution**: Adjust `max_display` parameter or use feature clustering\n\n### Issue: Slow computation\n**Problem**: Computing SHAP for very large datasets\n**Solution**: Sample subset, use batching, or ensure using specialized explainer (not KernelExplainer)\n\n## Integration with Other Tools\n\n### Jupyter Notebooks\n- Interactive force plots work seamlessly\n- Inline plot display with `show=True` (default)\n- Combine with markdown for narrative explanations\n\n### MLflow \u002F Experiment Tracking\n```python\nimport mlflow\n\nwith mlflow.start_run():\n    # Train model\n    model = train_model(X_train, y_train)\n\n    # Compute SHAP\n    explainer = shap.TreeExplainer(model)\n    shap_values = explainer(X_test)\n\n    # Log plots\n    shap.plots.beeswarm(shap_values, show=False)\n    mlflow.log_figure(plt.gcf(), \"shap_beeswarm.png\")\n    plt.close()\n\n    # Log feature importance metrics\n    mean_abs_shap = np.abs(shap_values.values).mean(axis=0)\n    for feature, importance in zip(X_test.columns, mean_abs_shap):\n        mlflow.log_metric(f\"shap_{feature}\", importance)\n```\n\n### Production APIs\n```python\nclass ExplanationService:\n    def __init__(self, model_path, explainer_path):\n        self.model = joblib.load(model_path)\n        self.explainer = joblib.load(explainer_path)\n\n    def predict_with_explanation(self, X):\n        prediction = self.model.predict(X)\n        shap_values = self.explainer(X)\n\n        return {\n            'prediction': prediction[0],\n            'base_value': shap_values.base_values[0],\n            'feature_contributions': dict(zip(X.columns, shap_values.values[0]))\n        }\n```\n\n## Reference Documentation\n\nThis skill includes comprehensive reference documentation organized by topic:\n\n### references\u002Fexplainers.md\nComplete guide to all explainer classes:\n- `TreeExplainer` - Fast, exact explanations for tree-based models\n- `DeepExplainer` - Deep learning models (TensorFlow, PyTorch)\n- `KernelExplainer` - Model-agnostic (works with any model)\n- `LinearExplainer` - Fast explanations for linear models\n- `GradientExplainer` - Gradient-based for neural networks\n- `PermutationExplainer` - Exact but slow for any model\n\nIncludes: Constructor parameters, methods, supported models, when to use, examples, performance considerations.\n\n### references\u002Fplots.md\nComprehensive visualization guide:\n- **Waterfall plots** - Individual prediction breakdowns\n- **Beeswarm plots** - Global importance with value distributions\n- **Bar plots** - Clean feature importance summaries\n- **Scatter plots** - Feature-prediction relationships and interactions\n- **Force plots** - Interactive additive force visualizations\n- **Heatmap plots** - Multi-sample comparison grids\n- **Violin plots** - Distribution-focused alternatives\n- **Decision plots** - Multiclass prediction paths\n\nIncludes: Parameters, use cases, examples, best practices, plot selection guide.\n\n### references\u002Fworkflows.md\nDetailed workflows and best practices:\n- Basic model explanation workflow\n- Model debugging and validation\n- Feature engineering guidance\n- Model comparison and selection\n- Fairness and bias analysis\n- Deep learning model explanation\n- Production deployment\n- Time series model explanation\n- Common pitfalls and solutions\n- Advanced techniques\n- MLOps integration\n\nIncludes: Step-by-step instructions, code examples, decision criteria, troubleshooting.\n\n### references\u002Ftheory.md\nTheoretical foundations:\n- Shapley values from game theory\n- Mathematical formulas and properties\n- Connection to other explanation methods (LIME, DeepLIFT, etc.)\n- SHAP computation algorithms (Tree SHAP, Kernel SHAP, etc.)\n- Conditional expectations and baseline selection\n- Interpreting SHAP values\n- Interaction values\n- Theoretical limitations and considerations\n\nIncludes: Mathematical foundations, proofs, comparisons, advanced topics.\n\n## Usage Guidelines\n\n**When to load reference files**:\n- Load `explainers.md` when user needs detailed information about specific explainer types or parameters\n- Load `plots.md` when user needs detailed visualization guidance or exploring plot options\n- Load `workflows.md` when user has complex multi-step tasks (debugging, fairness analysis, production deployment)\n- Load `theory.md` when user asks about theoretical foundations, Shapley values, or mathematical details\n\n**Default approach** (without loading references):\n- Use this SKILL.md for basic explanations and quick start\n- Provide standard workflows and common patterns\n- Reference files are available if more detail is needed\n\n**Loading references**:\n```python\n# To load reference files, use the Read tool with appropriate file path:\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Fexplainers.md\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Fplots.md\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Fworkflows.md\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Ftheory.md\n```\n\n## Best Practices Summary\n\n1. **Choose the right explainer**: Use specialized explainers (TreeExplainer, DeepExplainer, LinearExplainer) when possible; avoid KernelExplainer unless necessary\n\n2. **Start global, then go local**: Begin with beeswarm\u002Fbar plots for overall understanding, then dive into waterfall\u002Fscatter plots for details\n\n3. **Use multiple visualizations**: Different plots reveal different insights; combine global (beeswarm) + local (waterfall) + relationship (scatter) views\n\n4. **Select appropriate background data**: Use 50-1000 representative samples from training data\n\n5. **Understand model output units**: Know whether explaining probabilities, log-odds, or raw outputs\n\n6. **Validate with domain knowledge**: SHAP shows model behavior; use domain expertise to interpret and validate\n\n7. **Optimize for performance**: Sample subsets for visualization, batch for large datasets, cache explainers in production\n\n8. **Check for data leakage**: Unexpectedly high feature importance may indicate data quality issues\n\n9. **Consider feature correlations**: Use TreeExplainer's correlation-aware options or feature clustering for redundant features\n\n10. **Remember SHAP shows association, not causation**: Use domain knowledge for causal interpretation\n\n## Installation\n\n```bash\n# Basic installation\nuv pip install shap\n\n# With visualization dependencies\nuv pip install shap matplotlib\n\n# Latest version\nuv pip install -U shap\n```\n\n**Dependencies**: numpy, pandas, scikit-learn, matplotlib, scipy\n\n**Optional**: xgboost, lightgbm, tensorflow, torch (depending on model types)\n\n## Additional Resources\n\n- **Official Documentation**: https:\u002F\u002Fshap.readthedocs.io\u002F\n- **GitHub Repository**: https:\u002F\u002Fgithub.com\u002Fslundberg\u002Fshap\n- **Original Paper**: Lundberg & Lee (2017) - \"A Unified Approach to Interpreting Model Predictions\"\n- **Nature MI Paper**: Lundberg et al. (2020) - \"From local explanations to global understanding with explainable AI for trees\"\n\nThis skill provides comprehensive coverage of SHAP for model interpretability across all use cases and model types.\n\n","# SHAP (SHapley Additive exPlanations)\n\n## Overview\n\nSHAP is a unified approach to explain machine learning model outputs using Shapley values from cooperative game theory. This skill provides comprehensive guidance for:\n\n- Computing SHAP values for any model type\n- Creating visualizations to understand feature importance\n- Debugging and validating model behavior\n- Analyzing fairness and bias\n- Implementing explainable AI in production\n\nSHAP works with all model types: tree-based models (XGBoost, LightGBM, CatBoost, Random Forest), deep learning models (TensorFlow, PyTorch, Keras), linear models, and black-box models.\n\n## When to Use This Skill\n\n**Trigger this skill when users ask about**:\n- \"Explain which features are most important in my model\"\n- \"Generate SHAP plots\" (waterfall, beeswarm, bar, scatter, force, heatmap, etc.)\n- \"Why did my model make this prediction?\"\n- \"Calculate SHAP values for my model\"\n- \"Visualize feature importance using SHAP\"\n- \"Debug my model's behavior\" or \"validate my model\"\n- \"Check my model for bias\" or \"analyze fairness\"\n- \"Compare feature importance across models\"\n- \"Implement explainable AI\" or \"add explanations to my model\"\n- \"Understand feature interactions\"\n- \"Create model interpretation dashboard\"\n\n## Quick Start Guide\n\n### Step 1: Select the Right Explainer\n\n**Decision Tree**:\n\n1. **Tree-based model?** (XGBoost, LightGBM, CatBoost, Random Forest, Gradient Boosting)\n   - Use `shap.TreeExplainer` (fast, exact)\n\n2. **Deep neural network?** (TensorFlow, PyTorch, Keras, CNNs, RNNs, Transformers)\n   - Use `shap.DeepExplainer` or `shap.GradientExplainer`\n\n3. **Linear model?** (Linear\u002FLogistic Regression, GLMs)\n   - Use `shap.LinearExplainer` (extremely fast)\n\n4. **Any other model?** (SVMs, custom functions, black-box models)\n   - Use `shap.KernelExplainer` (model-agnostic but slower)\n\n5. **Unsure?**\n   - Use `shap.Explainer` (automatically selects best algorithm)\n\n**See `references\u002Fexplainers.md` for detailed information on all explainer types.**\n\n### Step 2: Compute SHAP Values\n\n```python\nimport shap\n\n# Example with tree-based model (XGBoost)\nimport xgboost as xgb\n\n# Train model\nmodel = xgb.XGBClassifier().fit(X_train, y_train)\n\n# Create explainer\nexplainer = shap.TreeExplainer(model)\n\n# Compute SHAP values\nshap_values = explainer(X_test)\n\n# The shap_values object contains:\n# - values: SHAP values (feature attributions)\n# - base_values: Expected model output (baseline)\n# - data: Original feature values\n```\n\n### Step 3: Visualize Results\n\n**For Global Understanding** (entire dataset):\n```python\n# Beeswarm plot - shows feature importance with value distributions\nshap.plots.beeswarm(shap_values, max_display=15)\n\n# Bar plot - clean summary of feature importance\nshap.plots.bar(shap_values)\n```\n\n**For Individual Predictions**:\n```python\n# Waterfall plot - detailed breakdown of single prediction\nshap.plots.waterfall(shap_values[0])\n\n# Force plot - additive force visualization\nshap.plots.force(shap_values[0])\n```\n\n**For Feature Relationships**:\n```python\n# Scatter plot - feature-prediction relationship\nshap.plots.scatter(shap_values[:, \"Feature_Name\"])\n\n# Colored by another feature to show interactions\nshap.plots.scatter(shap_values[:, \"Age\"], color=shap_values[:, \"Education\"])\n```\n\n**See `references\u002Fplots.md` for comprehensive guide on all plot types.**\n\n## Core Workflows\n\nThis skill supports several common workflows. Choose the workflow that matches the current task.\n\n### Workflow 1: Basic Model Explanation\n\n**Goal**: Understand what drives model predictions\n\n**Steps**:\n1. Train model and create appropriate explainer\n2. Compute SHAP values for test set\n3. Generate global importance plots (beeswarm or bar)\n4. Examine top feature relationships (scatter plots)\n5. Explain specific predictions (waterfall plots)\n\n**Example**:\n```python\n# Step 1-2: Setup\nexplainer = shap.TreeExplainer(model)\nshap_values = explainer(X_test)\n\n# Step 3: Global importance\nshap.plots.beeswarm(shap_values)\n\n# Step 4: Feature relationships\nshap.plots.scatter(shap_values[:, \"Most_Important_Feature\"])\n\n# Step 5: Individual explanation\nshap.plots.waterfall(shap_values[0])\n```\n\n### Workflow 2: Model Debugging\n\n**Goal**: Identify and fix model issues\n\n**Steps**:\n1. Compute SHAP values\n2. Identify prediction errors\n3. Explain misclassified samples\n4. Check for unexpected feature importance (data leakage)\n5. Validate feature relationships make sense\n6. Check feature interactions\n\n**See `references\u002Fworkflows.md` for detailed debugging workflow.**\n\n### Workflow 3: Feature Engineering\n\n**Goal**: Use SHAP insights to improve features\n\n**Steps**:\n1. Compute SHAP values for baseline model\n2. Identify nonlinear relationships (candidates for transformation)\n3. Identify feature interactions (candidates for interaction terms)\n4. Engineer new features\n5. Retrain and compare SHAP values\n6. Validate improvements\n\n**See `references\u002Fworkflows.md` for detailed feature engineering workflow.**\n\n### Workflow 4: Model Comparison\n\n**Goal**: Compare multiple models to select best interpretable option\n\n**Steps**:\n1. Train multiple models\n2. Compute SHAP values for each\n3. Compare global feature importance\n4. Check consistency of feature rankings\n5. Analyze specific predictions across models\n6. Select based on accuracy, interpretability, and consistency\n\n**See `references\u002Fworkflows.md` for detailed model comparison workflow.**\n\n### Workflow 5: Fairness and Bias Analysis\n\n**Goal**: Detect and analyze model bias across demographic groups\n\n**Steps**:\n1. Identify protected attributes (gender, race, age, etc.)\n2. Compute SHAP values\n3. Compare feature importance across groups\n4. Check protected attribute SHAP importance\n5. Identify proxy features\n6. Implement mitigation strategies if bias found\n\n**See `references\u002Fworkflows.md` for detailed fairness analysis workflow.**\n\n### Workflow 6: Production Deployment\n\n**Goal**: Integrate SHAP explanations into production systems\n\n**Steps**:\n1. Train and save model\n2. Create and save explainer\n3. Build explanation service\n4. Create API endpoints for predictions with explanations\n5. Implement caching and optimization\n6. Monitor explanation quality\n\n**See `references\u002Fworkflows.md` for detailed production deployment workflow.**\n\n## Key Concepts\n\n### SHAP Values\n\n**Definition**: SHAP values quantify each feature's contribution to a prediction, measured as the deviation from the expected model output (baseline).\n\n**Properties**:\n- **Additivity**: SHAP values sum to difference between prediction and baseline\n- **Fairness**: Based on Shapley values from game theory\n- **Consistency**: If a feature becomes more important, its SHAP value increases\n\n**Interpretation**:\n- Positive SHAP value → Feature pushes prediction higher\n- Negative SHAP value → Feature pushes prediction lower\n- Magnitude → Strength of feature's impact\n- Sum of SHAP values → Total prediction change from baseline\n\n**Example**:\n```\nBaseline (expected value): 0.30\nFeature contributions (SHAP values):\n  Age: +0.15\n  Income: +0.10\n  Education: -0.05\nFinal prediction: 0.30 + 0.15 + 0.10 - 0.05 = 0.50\n```\n\n### Background Data \u002F Baseline\n\n**Purpose**: Represents \"typical\" input to establish baseline expectations\n\n**Selection**:\n- Random sample from training data (50-1000 samples)\n- Or use kmeans to select representative samples\n- For DeepExplainer\u002FKernelExplainer: 100-1000 samples balances accuracy and speed\n\n**Impact**: Baseline affects SHAP value magnitudes but not relative importance\n\n### Model Output Types\n\n**Critical Consideration**: Understand what your model outputs\n\n- **Raw output**: For regression or tree margins\n- **Probability**: For classification probability\n- **Log-odds**: For logistic regression (before sigmoid)\n\n**Example**: XGBoost classifiers explain margin output (log-odds) by default. To explain probabilities, use `model_output=\"probability\"` in TreeExplainer.\n\n## Common Patterns\n\n### Pattern 1: Complete Model Analysis\n\n```python\n# 1. Setup\nexplainer = shap.TreeExplainer(model)\nshap_values = explainer(X_test)\n\n# 2. Global importance\nshap.plots.beeswarm(shap_values)\nshap.plots.bar(shap_values)\n\n# 3. Top feature relationships\ntop_features = X_test.columns[np.abs(shap_values.values).mean(0).argsort()[-5:]]\nfor feature in top_features:\n    shap.plots.scatter(shap_values[:, feature])\n\n# 4. Example predictions\nfor i in range(5):\n    shap.plots.waterfall(shap_values[i])\n```\n\n### Pattern 2: Cohort Comparison\n\n```python\n# Define cohorts\ncohort1_mask = X_test['Group'] == 'A'\ncohort2_mask = X_test['Group'] == 'B'\n\n# Compare feature importance\nshap.plots.bar({\n    \"Group A\": shap_values[cohort1_mask],\n    \"Group B\": shap_values[cohort2_mask]\n})\n```\n\n### Pattern 3: Debugging Errors\n\n```python\n# Find errors\nerrors = model.predict(X_test) != y_test\nerror_indices = np.where(errors)[0]\n\n# Explain errors\nfor idx in error_indices[:5]:\n    print(f\"Sample {idx}:\")\n    shap.plots.waterfall(shap_values[idx])\n\n    # Investigate key features\n    shap.plots.scatter(shap_values[:, \"Suspicious_Feature\"])\n```\n\n## Performance Optimization\n\n### Speed Considerations\n\n**Explainer Speed** (fastest to slowest):\n1. `LinearExplainer` - Nearly instantaneous\n2. `TreeExplainer` - Very fast\n3. `DeepExplainer` - Fast for neural networks\n4. `GradientExplainer` - Fast for neural networks\n5. `KernelExplainer` - Slow (use only when necessary)\n6. `PermutationExplainer` - Very slow but accurate\n\n### Optimization Strategies\n\n**For Large Datasets**:\n```python\n# Compute SHAP for subset\nshap_values = explainer(X_test[:1000])\n\n# Or use batching\nbatch_size = 100\nall_shap_values = []\nfor i in range(0, len(X_test), batch_size):\n    batch_shap = explainer(X_test[i:i+batch_size])\n    all_shap_values.append(batch_shap)\n```\n\n**For Visualizations**:\n```python\n# Sample subset for plots\nshap.plots.beeswarm(shap_values[:1000])\n\n# Adjust transparency for dense plots\nshap.plots.scatter(shap_values[:, \"Feature\"], alpha=0.3)\n```\n\n**For Production**:\n```python\n# Cache explainer\nimport joblib\njoblib.dump(explainer, 'explainer.pkl')\nexplainer = joblib.load('explainer.pkl')\n\n# Pre-compute for batch predictions\n# Only compute top N features for API responses\n```\n\n## Troubleshooting\n\n### Issue: Wrong explainer choice\n**Problem**: Using KernelExplainer for tree models (slow and unnecessary)\n**Solution**: Always use TreeExplainer for tree-based models\n\n### Issue: Insufficient background data\n**Problem**: DeepExplainer\u002FKernelExplainer with too few background samples\n**Solution**: Use 100-1000 representative samples\n\n### Issue: Confusing units\n**Problem**: Interpreting log-odds as probabilities\n**Solution**: Check model output type; understand whether values are probabilities, log-odds, or raw outputs\n\n### Issue: Plots don't display\n**Problem**: Matplotlib backend issues\n**Solution**: Ensure backend is set correctly; use `plt.show()` if needed\n\n### Issue: Too many features cluttering plots\n**Problem**: Default max_display=10 may be too many or too few\n**Solution**: Adjust `max_display` parameter or use feature clustering\n\n### Issue: Slow computation\n**Problem**: Computing SHAP for very large datasets\n**Solution**: Sample subset, use batching, or ensure using specialized explainer (not KernelExplainer)\n\n## Integration with Other Tools\n\n### Jupyter Notebooks\n- Interactive force plots work seamlessly\n- Inline plot display with `show=True` (default)\n- Combine with markdown for narrative explanations\n\n### MLflow \u002F Experiment Tracking\n```python\nimport mlflow\n\nwith mlflow.start_run():\n    # Train model\n    model = train_model(X_train, y_train)\n\n    # Compute SHAP\n    explainer = shap.TreeExplainer(model)\n    shap_values = explainer(X_test)\n\n    # Log plots\n    shap.plots.beeswarm(shap_values, show=False)\n    mlflow.log_figure(plt.gcf(), \"shap_beeswarm.png\")\n    plt.close()\n\n    # Log feature importance metrics\n    mean_abs_shap = np.abs(shap_values.values).mean(axis=0)\n    for feature, importance in zip(X_test.columns, mean_abs_shap):\n        mlflow.log_metric(f\"shap_{feature}\", importance)\n```\n\n### Production APIs\n```python\nclass ExplanationService:\n    def __init__(self, model_path, explainer_path):\n        self.model = joblib.load(model_path)\n        self.explainer = joblib.load(explainer_path)\n\n    def predict_with_explanation(self, X):\n        prediction = self.model.predict(X)\n        shap_values = self.explainer(X)\n\n        return {\n            'prediction': prediction[0],\n            'base_value': shap_values.base_values[0],\n            'feature_contributions': dict(zip(X.columns, shap_values.values[0]))\n        }\n```\n\n## Reference Documentation\n\nThis skill includes comprehensive reference documentation organized by topic:\n\n### references\u002Fexplainers.md\nComplete guide to all explainer classes:\n- `TreeExplainer` - Fast, exact explanations for tree-based models\n- `DeepExplainer` - Deep learning models (TensorFlow, PyTorch)\n- `KernelExplainer` - Model-agnostic (works with any model)\n- `LinearExplainer` - Fast explanations for linear models\n- `GradientExplainer` - Gradient-based for neural networks\n- `PermutationExplainer` - Exact but slow for any model\n\nIncludes: Constructor parameters, methods, supported models, when to use, examples, performance considerations.\n\n### references\u002Fplots.md\nComprehensive visualization guide:\n- **Waterfall plots** - Individual prediction breakdowns\n- **Beeswarm plots** - Global importance with value distributions\n- **Bar plots** - Clean feature importance summaries\n- **Scatter plots** - Feature-prediction relationships and interactions\n- **Force plots** - Interactive additive force visualizations\n- **Heatmap plots** - Multi-sample comparison grids\n- **Violin plots** - Distribution-focused alternatives\n- **Decision plots** - Multiclass prediction paths\n\nIncludes: Parameters, use cases, examples, best practices, plot selection guide.\n\n### references\u002Fworkflows.md\nDetailed workflows and best practices:\n- Basic model explanation workflow\n- Model debugging and validation\n- Feature engineering guidance\n- Model comparison and selection\n- Fairness and bias analysis\n- Deep learning model explanation\n- Production deployment\n- Time series model explanation\n- Common pitfalls and solutions\n- Advanced techniques\n- MLOps integration\n\nIncludes: Step-by-step instructions, code examples, decision criteria, troubleshooting.\n\n### references\u002Ftheory.md\nTheoretical foundations:\n- Shapley values from game theory\n- Mathematical formulas and properties\n- Connection to other explanation methods (LIME, DeepLIFT, etc.)\n- SHAP computation algorithms (Tree SHAP, Kernel SHAP, etc.)\n- Conditional expectations and baseline selection\n- Interpreting SHAP values\n- Interaction values\n- Theoretical limitations and considerations\n\nIncludes: Mathematical foundations, proofs, comparisons, advanced topics.\n\n## Usage Guidelines\n\n**When to load reference files**:\n- Load `explainers.md` when user needs detailed information about specific explainer types or parameters\n- Load `plots.md` when user needs detailed visualization guidance or exploring plot options\n- Load `workflows.md` when user has complex multi-step tasks (debugging, fairness analysis, production deployment)\n- Load `theory.md` when user asks about theoretical foundations, Shapley values, or mathematical details\n\n**Default approach** (without loading references):\n- Use this SKILL.md for basic explanations and quick start\n- Provide standard workflows and common patterns\n- Reference files are available if more detail is needed\n\n**Loading references**:\n```python\n# To load reference files, use the Read tool with appropriate file path:\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Fexplainers.md\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Fplots.md\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Fworkflows.md\n# \u002Fpath\u002Fto\u002Fshap\u002Freferences\u002Ftheory.md\n```\n\n## Best Practices Summary\n\n1. **Choose the right explainer**: Use specialized explainers (TreeExplainer, DeepExplainer, LinearExplainer) when possible; avoid KernelExplainer unless necessary\n\n2. **Start global, then go local**: Begin with beeswarm\u002Fbar plots for overall understanding, then dive into waterfall\u002Fscatter plots for details\n\n3. **Use multiple visualizations**: Different plots reveal different insights; combine global (beeswarm) + local (waterfall) + relationship (scatter) views\n\n4. **Select appropriate background data**: Use 50-1000 representative samples from training data\n\n5. **Understand model output units**: Know whether explaining probabilities, log-odds, or raw outputs\n\n6. **Validate with domain knowledge**: SHAP shows model behavior; use domain expertise to interpret and validate\n\n7. **Optimize for performance**: Sample subsets for visualization, batch for large datasets, cache explainers in production\n\n8. **Check for data leakage**: Unexpectedly high feature importance may indicate data quality issues\n\n9. **Consider feature correlations**: Use TreeExplainer's correlation-aware options or feature clustering for redundant features\n\n10. **Remember SHAP shows association, not causation**: Use domain knowledge for causal interpretation\n\n## Installation\n\n```bash\n# Basic installation\nuv pip install shap\n\n# With visualization dependencies\nuv pip install shap matplotlib\n\n# Latest version\nuv pip install -U shap\n```\n\n**Dependencies**: numpy, pandas, scikit-learn, matplotlib, scipy\n\n**Optional**: xgboost, lightgbm, tensorflow, torch (depending on model types)\n\n## Additional Resources\n\n- **Official Documentation**: https:\u002F\u002Fshap.readthedocs.io\u002F\n- **GitHub Repository**: https:\u002F\u002Fgithub.com\u002Fslundberg\u002Fshap\n- **Original Paper**: Lundberg & Lee (2017) - \"A Unified Approach to Interpreting Model Predictions\"\n- **Nature MI Paper**: Lundberg et al. (2020) - \"From local explanations to global understanding with explainable AI for trees\"\n\nThis skill provides comprehensive coverage of SHAP for model interpretability across all use cases and model types.\n\n",{"name":5,"license":48,"metadata":49,"description":7},"MIT license",{"version":50,"skill-author":51},"1.0","K-Dense Inc.","main","681496e0662f4c45c4758fae9d4510ae87311bf2","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills","https:\u002F\u002Fgithub.com\u002Fagency-black","http:\u002F\u002Fwww.dogma.black","Las grandes ideas merecen una ejecución impecable. Construimos plataformas web, aplicaciones y ecosistemas digitales completos. Esta Trinidad es nuestro dogma.","2026-05-29 16:13:55",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add agency-black\u002FSkills --skill shap",{"tool":65,"command":66},"bunx","bunx skills add agency-black\u002FSkills --skill shap",{"tool":68,"command":69},"pnpm","pnpm dlx skills add agency-black\u002FSkills --skill shap","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fshap\u002FSKILL.md",true,[73,79,83,87],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fexplainers.md","REFERENCE","参考文档",12907,"https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fshap\u002Freferences\u002Fexplainers.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fplots.md",16552,"https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fshap\u002Freferences\u002Fplots.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Ftheory.md",17030,"https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fshap\u002Freferences\u002Ftheory.md",{"path":88,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fworkflows.md",19789,"https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fshap\u002Freferences\u002Fworkflows.md",[92,118,147,176,201,224],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":43},"01M71JZVZ0TVW7Z5DQBRWSBG8A","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fzarr-python\u002FSKILL.md",[],[99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,35,114,115,116,117],"zarr python","python","zarr","arrays","Cloud Storage","remote","workflows","scientific","read","write","edit","parallel","dask","for","s3fs","numpy","s3","scientific computing","scale",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":122,"sourceHtmlUrl":123,"categories":124,"keywords":128,"publishedAt":43},"01M71JYXC5VAEJT8KXN5GRK32S","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fxvary-stock-research\u002FSKILL.md",[125],{"categoryNo":126,"categoryName":127,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[129,130,131,132,133,134,135,100,136,105,137,138,139,140,141,142,143,144,145,146],"xvary","stock","research","xvary stock research","sec edgar","community","equity","thesis","analysis","code","Market","compare","market data","analyze","with","codex","cursor","2026",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":151,"licenseFileUrl":152,"sourceHtmlUrl":153,"categories":154,"keywords":161,"publishedAt":43},"01M71JVSDPDQ5040YBN6J1ASKY","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[155,158],{"categoryNo":156,"categoryName":157,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":159,"categoryName":160,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[162,163,164,112,165,166,167,31,168,169,170,143,171,172,173,174,175],"webapp","testing","webapp testing","applications","local","frontend","toolkit","logs","browser","playwright","web","behavior","ui","screenshots",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":151,"licenseFileUrl":180,"sourceHtmlUrl":181,"categories":182,"keywords":184,"publishedAt":43},"01M71JV64CW7R6FYYK9JWWGW0X","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FSKILL.md",[183],{"categoryNo":159,"categoryName":160,"taxonomyType":21,"taxonomyTypeDesc":22},[185,186,187,172,188,189,190,112,191,192,167,193,35,194,195,196,197,198,199,200],"builder","artifacts builder","artifacts","web artifacts builder","single-file","css","Tailwind","ui components","single","file","components","react","multi","state","routing","state management",{"skillNo":202,"name":203,"nameZh":6,"description":204,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":205,"categories":206,"keywords":208,"publishedAt":43},"01M71JS4X2FRY41DE84DEP06MN","vercel-react-view-transitions","Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fvercel-react-view-transitions\u002FSKILL.md",[207],{"categoryNo":159,"categoryName":160,"taxonomyType":21,"taxonomyTypeDesc":22},[196,209,210,211,212,213,214,215,216,190,217,218,219,41,30,195,220,221,222,223],"vercel react view transitions","view","react view transitions","vercel","transitions","shared","back","Animation","types","states","element","api","route","create","libraries",{"skillNo":225,"name":226,"nameZh":6,"description":227,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":228,"categories":229,"keywords":231,"publishedAt":43},"01M71JS1WZ1J4F9YVC2203JBJW","vercel-react-native-skills","React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.","https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fvercel-react-native-skills\u002FSKILL.md",[230],{"categoryNo":159,"categoryName":160,"taxonomyType":21,"taxonomyTypeDesc":22},[212,232,196,233,234,235,236,237,238,112,239,41,240,35,241,242,30,243,244,195],"vercel react native skills","react native","native","react native skills","modules","platform","animations","performance","triggers","react native components","apps","best practices","tasks"]