marimo
Assistant for creating, editing, and debugging reactive Python notebooks with marimo. Use when you need to build marimo notebooks, debug reactive execution, add interactive UI elements, or convert traditional notebooks to marimo format. Provides code patterns, utility functions, and best practices for marimo development.
What this skill does
# Marimo Notebook Assistant
## Instructions
1. **Assess User's Need**: Understand what kind of marimo notebook the user wants to create:
- Data analysis and visualization
- Interactive dashboard or web app
- Machine learning workflow
- Report generation
- Database integration
- Conversion from traditional notebooks
2. **Guide Project Setup**:
- Create new marimo notebook structure with proper imports
- Set up basic app configuration (title, width, layout)
- Initialize data loading and processing cells
- Ensure proper reactive dependency structure
3. **Provide Appropriate Patterns**:
- Use utility scripts to validate notebook structure
- Apply common patterns for the specific use case
- Integrate appropriate UI elements for interactivity
- Implement proper data flow between cells
4. **Assist with Code Implementation**:
- Generate appropriate cell structures with @app.cell decorators
- Help with reactive variable dependencies
- Integrate plotly for visualizations
- Add SQL integration if needed
- Include proper error handling and validation
5. **Debug and Optimize**:
- Validate notebook syntax and structure
- Identify potential circular dependencies
- Suggest performance optimizations
- Provide troubleshooting guidance
## Capabilities
- Create new marimo notebooks with proper structure
- Convert Jupyter notebooks to marimo format
- Debug existing marimo notebooks and fix common issues
- Provide code patterns for common use cases
- Assist with interactive UI element implementation
- Help with SQL integration and database operations
- Optimize performance for large datasets
- Validate notebook syntax and dependencies
- Generate reusable utility functions and patterns
## Marimo Fundamentals
### Core Concepts
Marimo notebooks eliminate hidden state through reactive execution:
- **Pure Python Files**: Notebooks are executable Python scripts
- **Reactive Cells**: Automatic dependency tracking and execution
- **No Hidden State**: All variables and state are explicit
- **Git-Friendly**: Version control works seamlessly
- **Deployable**: Can be run as interactive web applications
### Basic Structure
```python
import marimo
import numpy as np
app = marimo.App(
title="Your App Title",
width="full"
)
@app.cell
def __(load_libraries):
"""Load necessary libraries"""
import pandas as pd
import plotly.express as px
import marimo as mo
return pd, px, mo
@app.cell
def __(pd):
"""Load or create data"""
df = pd.DataFrame({
'x': range(100),
'y': np.random.randn(100)
})
return df
@app.cell
def __(df, px):
"""Create visualization"""
fig = px.scatter(df, x='x', y='y')
return fig
if __name__ == "__main__":
app.run()
```
## Common Use Cases and Patterns
### Data Analysis Workflow
1. **Data Loading**: Use appropriate loaders (CSV, Excel, SQL, API)
2. **Data Cleaning**: Handle missing values, type conversions, validation
3. **Interactive Filtering**: Add dropdowns, sliders, date ranges
4. **Analysis**: Statistical analysis, aggregations, correlations
5. **Visualization**: Interactive charts that respond to filters
### Dashboard Creation
1. **UI Controls**: Create comprehensive filtering interface
2. **KPI Display**: Show key metrics and summaries
3. **Charts**: Multiple visualizations with drill-down capability
4. **Export**: Allow users to download filtered data or reports
### Machine Learning Workflow
1. **Data Preparation**: Load, clean, and preprocess data
2. **Feature Engineering**: Create derived variables and transformations
3. **Model Training**: Add controls for hyperparameters
4. **Evaluation**: Display metrics and validation results
5. **Prediction**: Interface for making predictions on new data
## Code Patterns and Snippets
Use the bundled snippets library for ready-to-use patterns.
## Code Patterns Library
### Available Patterns
```python
from snippets.patterns import MarimoPatterns
# Get basic app structure
basic_app = MarimoPatterns.BASIC_APP
# Data loading patterns
csv_loader = MarimoPatterns.CSV_LOADER
sql_loader = MarimoPatterns.SQL_LOADER
# UI control patterns
controls = MarimoPatterns.BASIC_CONTROLS
filters = MarimoPatterns.FILTER_CONTROLS
# Visualization patterns
line_chart = MarimoPatterns.PLOTLY_LINE
bar_chart = MarimoPatterns.PLOTLY_BAR
# Dashboard layouts
dashboard = MarimoPatterns.DASHBOARD_LAYOUT
tabs = MarimoPatterns.TABS_LAYOUT
```
## Interactive Development Workflow
### 1. Notebook Creation
When creating a new marimo notebook:
1. **Understand Requirements**:
- What type of data/analysis?
- What visualizations needed?
- What interactivity required?
- Any specific data sources?
2. **Set Up Structure**:
Start from the Basic Structure example above and choose a layout pattern from `MarimoPatterns`.
3. **Customize Based on Needs**:
- Modify data loading section
- Add specific UI controls
- Implement domain-specific analysis
- Create appropriate visualizations
### 2. Debugging Existing Notebooks
When issues arise with a marimo notebook:
1. **Review Structure**: Check cell boundaries and dependencies
2. **Analyze Dependencies**: Ensure variables flow top-to-bottom without cycles
3. **Apply Fixes**:
- Fix circular dependencies
- Correct syntax errors
- Optimize performance
- Improve UI layout
### 3. Converting from Jupyter
When converting existing notebooks, manually refactor:
1. **Manual Refactoring**:
- Break down large cells
- Add reactive dependencies
- Replace print statements with UI elements
- Add interactive controls
## Best Practices
### Notebook Structure
- **Clear Cell Separation**: Each cell should have a single responsibility
- **Explicit Dependencies**: Make variable dependencies clear through function signatures
- **Progressive Complexity**: Start simple and build complexity incrementally
- **Documentation**: Include docstrings and comments for each cell
### UI/UX Guidelines
- **Responsive Design**: Use appropriate widths and layouts
- **Intuitive Controls**: Use clear labels and reasonable defaults
- **Performance**: Avoid excessive recalculations in reactive chains
- **Error Handling**: Provide clear error messages and validation
### Performance Optimization
- **Use Caching**: Decorate expensive functions with @marimo.cache
- **Lazy Loading**: Load data only when needed
- **Efficient Data Types**: Use appropriate pandas dtypes
- **Chunk Processing**: Handle large datasets in chunks
### Code Quality
- **Type Hints**: Include type annotations for clarity
- **Error Handling**: Implement try-catch blocks for external dependencies
- **Testing**: Validate data and expected outputs
- **Modularity**: Extract reusable functions to separate modules
## Common Issues and Solutions
### Circular Dependencies
**Problem**: Cell A depends on Cell B, Cell B depends on Cell A
**Research Validation**: Most common marimo issue (GitHub #1234, #987)
**Solutions**:
- **Prevention**: Map dependencies before coding (use top-to-bottom flow)
- **Break Cycles**: Extract common dependencies to separate cell
- **Use Tools**: `mo.md()` for debugging dependency chains
- **Prevent Execution**: `mo.stop()` to stop execution when conditions met
- **Validation**: Use our validation tool to detect cycles early
- **Community Pattern**: Linear data flow from loading → processing → visualization
### Performance Issues
**Problem**: Notebook runs slowly with large datasets
**Research Validation**: Documented in performance benchmarks and case studies
**Solutions**:
- **Built-in Caching**: Use `@marimo.cache` for expensive computations
- **Lazy Loading**: Implement data loading only when needed (common pattern in production)
- **Memory Management**: Use efficient pandas dtypes and chunking for large datasets
- **Loading Indicators**: Add progress feedback for long-running operations
- **Performance Profiling**: Use marimo's built-in tools and ouRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.