From b656648cd71d81ff7d455b1946a82aef31c667b2 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 18 Sep 2025 22:59:36 -0700 Subject: [PATCH 01/25] docs: add Netlify MCP + Continue Hub cookbook - Add comprehensive guide for Netlify MCP integration with Continue CLI - Cover deployment workflows, environment management, and CI/CD setup - Include GitHub Actions workflow for automated deployments - Add troubleshooting and security best practices - Update navigation in overview.mdx and docs.json Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/docs.json | 1 + .../netlify-mcp-continuous-deployment.mdx | 585 ++++++++++++++++++ docs/guides/overview.mdx | 1 + 3 files changed, 587 insertions(+) create mode 100644 docs/guides/netlify-mcp-continuous-deployment.mdx diff --git a/docs/docs.json b/docs/docs.json index 2d8fca1ae..4e45df976 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -234,6 +234,7 @@ "guides/cli", "guides/continuous-ai", "guides/posthog-github-continuous-ai", + "guides/netlify-mcp-continuous-deployment", "guides/continuous-ai-readiness-assessment", "guides/plan-mode-guide", "guides/ollama-guide", diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx new file mode 100644 index 000000000..bdd6a0e1b --- /dev/null +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -0,0 +1,585 @@ +--- +title: "Building a Continuous Deployment Workflow with Netlify MCP and Continue CLI" +description: "Build an automated system that uses Continue CLI with Netlify MCP to deploy sites, manage environments, and automate deployment workflows through natural language commands." +sidebarTitle: "Netlify Deployment with Continue CLI" +--- + + + A fully automated workflow that uses Continue CLI with Netlify MCP to create + sites, deploy code changes, manage environment variables, and monitor + deployments - all through natural language commands + + +## Prerequisites + +Before starting, ensure you have: + +- GitHub repository with a web project (React, Vue, Next.js, etc.) +- Netlify account (free tier works) +- Node.js 22+ installed locally +- Continue CLI account with **active credits** (required for API usage) +- Continue Hub account to install Netlify MCP + + + + ```bash + npm i -g @continuedev/cli + ``` + + + + ```bash + npm i -g netlify-cli + ``` + + + + 1. Visit [Continue Organizations](https://hub.continue.dev/settings/organizations) + 2. Sign up or log in to your Continue account + 3. Navigate to your organization settings + 4. Click **"API Keys"** and then **"+ New API Key"** + 5. Copy the API key immediately (you won't see it again!) + 6. Login to the CLI: `cn login` + + + + Visit [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) and follow the installation instructions for your preferred editor, or add to your MCP config manually. + + + + + Netlify MCP gives Continue CLI direct access to Netlify's API and CLI + commands, enabling powerful deployment automation through natural language! + + +## Step 1: Set Up Your Credentials + +First, you'll need to gather your API credentials and configure both Netlify CLI and Continue CLI. + +### Get Your Netlify Personal Access Token + +1. Go to [Netlify Personal Access Tokens](https://app.netlify.com/user/applications#personal-access-tokens) +2. Click **"New access token"** +3. Name it "Continue CLI Deployment" +4. Copy the token immediately (you won't see it again!) + +### Authenticate Netlify CLI + +```bash +netlify login +``` + +This will open your browser for authentication. Alternatively, you can use your Personal Access Token: + +```bash +export NETLIFY_AUTH_TOKEN="your-personal-access-token" +``` + +### Configure MCP with Netlify + +Add Netlify MCP to your MCP configuration file (usually `~/.config/mcp/config.json` or similar): + +```json +{ + "mcpServers": { + "netlify": { + "command": "npx", + "args": ["-y", "@netlify/mcp"], + "env": { + "NETLIFY_PERSONAL_ACCESS_TOKEN": "your-pat-here" + } + } + } +} +``` + + + **Security Note**: Never commit your Personal Access Token to version control. + Consider using environment variables or secure secret management. + + +### Test Your Setup + +Use Continue CLI to verify Netlify MCP is working: + +```bash +cn -p "Using the Netlify MCP server, please: +1. Check if I'm authenticated with Netlify +2. List my current Netlify sites (if any) +3. Show my Netlify account information +4. Confirm the MCP connection is working properly + +Please provide a summary of the connection status and any sites found." +``` + +## Step 2: Create and Deploy Your First Site + +Now you'll use Continue CLI with Netlify MCP to create a new site and deploy your project. + +### Create a New Netlify Site + +```bash +cn -p "Using Netlify MCP, I need to create and deploy a new site. Please: + +1. Create a new Netlify site with these specifications: + - Name: my-continue-cli-demo-{random-id} + - Use the current directory as the project root + - Detect the build settings automatically + +2. Link the site to my current Git repository if one exists + +3. Set up the following build configuration: + - Build command: Detect automatically or use 'npm run build' + - Publish directory: Detect automatically or use 'dist' or 'build' + - Node version: 22.x + +4. Deploy the site immediately after creation + +5. Provide me with: + - The site URL + - The site ID for future reference + - Build status + - Any deployment logs + +Please execute these steps and show me the results." +``` + + + **What Netlify MCP Does:** + - Creates a new site in your Netlify account + - Automatically detects framework settings (React, Vue, Next.js, etc.) + - Links to your Git repository for continuous deployment + - Triggers an initial deployment + - Provides live site URL + + +## Step 3: Manage Environment Variables + +Use Continue CLI to manage your site's environment variables securely: + +```bash +cn -p "Using Netlify MCP, help me manage environment variables for my site. Please: + +1. List all current environment variables for site: {your-site-id} + +2. Add these new environment variables: + - API_KEY: 'demo-api-key-123' + - NODE_ENV: 'production' + - ENABLE_FEATURE_FLAGS: 'true' + +3. Create these build-time only variables: + - BUILD_TIMESTAMP: Current ISO timestamp + - GIT_COMMIT_SHA: Latest commit SHA if available + +4. Set up these sensitive variables (mark as secret): + - DATABASE_URL: 'postgresql://user:pass@host:5432/db' + - JWT_SECRET: Generate a secure random string + +5. Verify all variables are set correctly + +6. Trigger a new deployment to apply the changes + +Please execute these operations and confirm the environment variables are properly configured." +``` + + + Environment variables set through Netlify MCP are encrypted and only + accessible during build time and runtime, keeping your secrets secure. + + +## Step 4: Set Up Continuous Deployment Workflow + +Create an automated workflow that deploys on code changes and monitors build status. + +### Create Deployment Automation Script + +Create a file called `deploy-with-continue.sh`: + +```bash +#!/bin/bash + +# Deploy with Continue CLI and Netlify MCP +cn -p "Using Netlify MCP, perform a production deployment: + +1. Check the current deployment status of my Netlify site + +2. If there are uncommitted changes: + - Show me what files have changed + - Ask if I want to commit them first + +3. Create a new deployment with: + - Clear build cache if needed + - Production context + - Auto-publish enabled + +4. Monitor the deployment: + - Show build logs in real-time + - Report any errors immediately + - Notify when deployment is complete + +5. After successful deployment: + - Show the preview URL + - Run basic smoke tests (check if site is accessible) + - Report Core Web Vitals if available + +6. If deployment fails: + - Show error logs + - Suggest potential fixes + - Option to rollback to previous deployment + +Please execute this deployment workflow and keep me updated on progress." +``` + +Make it executable: +```bash +chmod +x deploy-with-continue.sh +``` + +## Step 5: Advanced Netlify Operations + +### Manage Multiple Environments + +```bash +cn -p "Using Netlify MCP, help me set up a staging environment: + +1. Create a branch deploy for 'staging' branch: + - Enable automatic deploys from staging branch + - Use different environment variables for staging + - Create unique URL: staging--{site-name}.netlify.app + +2. Set up deploy previews: + - Enable for all pull requests + - Add comment to PR with preview URL + - Run tests on preview deploys + +3. Configure split testing: + - Create A/B test between main and staging + - Split traffic 50/50 + - Track performance metrics + +Please set up these deployment environments and provide the configuration details." +``` + +### Enable Netlify Functions + +```bash +cn -p "Using Netlify MCP, help me set up serverless functions: + +1. Enable Netlify Functions for my site + +2. Create a sample function at netlify/functions/hello-world.js: + - Simple JSON response + - Handle GET and POST requests + - Include CORS headers + +3. Create an API endpoint function at netlify/functions/api.js: + - Connect to environment variables + - Handle multiple routes + - Include error handling + +4. Deploy the functions and provide: + - Function endpoints + - Invocation URLs + - Test commands + +Please set up these serverless functions and show me how to invoke them." +``` + +### Set Up Form Handling + +```bash +cn -p "Using Netlify MCP, configure form handling for my site: + +1. Enable Netlify Forms + +2. Set up form notifications: + - Email notifications to: admin@example.com + - Webhook to: https://api.example.com/form-webhook + - Slack notifications if possible + +3. Configure spam filtering: + - Enable reCAPTCHA + - Set up honeypot field + - Configure Akismet if available + +4. Create form submission handling: + - Store submissions in Netlify + - Export endpoint for submissions + - Set up auto-response emails + +Please configure these form features and provide integration instructions." +``` + +## Step 6: Monitoring and Analytics + +### Set Up Deployment Monitoring + +```bash +cn -p "Using Netlify MCP, help me monitor my site's performance: + +1. Get deployment analytics: + - Build times over last 30 days + - Success/failure rate + - Average deploy time + +2. Check current site metrics: + - Bandwidth usage + - Request count + - Form submission count + +3. Set up monitoring alerts: + - Build failures + - High bandwidth usage + - Form spam detection + +4. Generate a deployment report: + - Last 10 deployments + - Git commits for each + - Build duration trends + +Please gather this monitoring data and create a comprehensive report." +``` + +## Step 7: GitHub Actions Integration + +Create a GitHub Actions workflow that uses Continue CLI with Netlify MCP for automated deployments. + +### Add GitHub Secrets + +1. Go to **Repository Settings → Secrets and variables → Actions** +2. Add these secrets: + - `CONTINUE_API_KEY`: Your Continue API key + - `NETLIFY_AUTH_TOKEN`: Your Netlify Personal Access Token + - `NETLIFY_SITE_ID`: Your Netlify site ID + +### Create GitHub Actions Workflow + +Create `.github/workflows/netlify-deploy.yml`: + +```yaml +name: Deploy to Netlify with Continue CLI + +on: + push: + branches: [main, staging] + pull_request: + types: [opened, synchronize] + workflow_dispatch: + inputs: + environment: + description: 'Deployment environment' + required: true + default: 'preview' + type: choice + options: + - production + - staging + - preview + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install dependencies + run: | + npm ci + npm install -g @continuedev/cli netlify-cli + + - name: Authenticate Continue CLI + env: + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} + run: | + cn auth login --api-key "$CONTINUE_API_KEY" + echo "✅ Continue CLI authenticated" + + - name: Deploy with Netlify MCP + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + DEPLOY_ENV: ${{ github.event.inputs.environment || 'preview' }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + COMMIT_SHA: ${{ github.sha }} + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + run: | + cat > deploy_prompt.txt << 'EOF' + Using Netlify MCP, deploy my site with these specifications: + + 1. Site ID: $NETLIFY_SITE_ID + 2. Environment: $DEPLOY_ENV + 3. Branch: $BRANCH_NAME + 4. Commit: $COMMIT_SHA + + Deployment steps: + 1. Build the project with production optimizations + 2. Deploy to Netlify with appropriate context + 3. If PR, create preview deployment with comment + 4. If main branch, deploy to production + 5. If staging branch, deploy to staging environment + + After deployment: + - Provide deployment URL + - Show build logs summary + - Report Core Web Vitals if available + - Add deployment status to GitHub commit + + Please execute this deployment and provide detailed feedback. + EOF + + cn < deploy_prompt.txt + + - name: Comment on PR + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const message = `🚀 **Netlify Preview Deployment Ready!** + + Preview URL: https://deploy-preview-${{ github.event.number }}--${{ secrets.NETLIFY_SITE_ID }}.netlify.app + + Deployment triggered by Continue CLI with Netlify MCP.`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + }); +``` + +## Step 8: Testing Your Workflow + +### Local Testing + +Test your Netlify MCP integration locally: + +```bash +# Test site creation +cn -p "Using Netlify MCP, create a test site and immediately delete it to verify my setup works" + +# Test deployment +cn -p "Using Netlify MCP, deploy my current project to Netlify and show me the deployment logs" + +# Test environment variables +cn -p "Using Netlify MCP, list and update environment variables for my site" +``` + +### Production Testing Checklist + + + **Deployment Checklist:** + - Site builds successfully without errors + - Environment variables are properly set + - Custom domain is configured (if applicable) + - SSL certificate is active + - Forms are working (if used) + - Functions are accessible (if used) + - Analytics tracking is enabled + - Performance metrics meet targets + + +## Troubleshooting + +### Common Issues and Solutions + +```bash +cn -p "Help me troubleshoot my Netlify deployment. Please: + +1. Check Netlify MCP connection status +2. Verify my authentication is working +3. List recent deployment failures and their causes +4. Check for common configuration issues: + - Missing environment variables + - Incorrect build commands + - Wrong publish directory + - Node version mismatches +5. Suggest fixes for any issues found + +Please diagnose and help me resolve any problems." +``` + +### Debug Build Failures + +```bash +cn -p "Using Netlify MCP, help me debug a build failure: + +1. Get the latest failed build logs +2. Identify the error message and stack trace +3. Check for: + - Missing dependencies + - Build command errors + - Environment variable issues + - Memory limit exceeded +4. Suggest specific fixes +5. Attempt to redeploy with fixes + +Show me the full diagnostic process." +``` + +## What You've Built + +After completing this guide, you have a complete **Continuous Deployment system** that: + +✅ **Automates deployments** - Deploy sites through natural language commands +✅ **Manages environments** - Handle production, staging, and preview deployments +✅ **Configures infrastructure** - Set up forms, functions, and environment variables +✅ **Monitors performance** - Track build times, success rates, and site metrics +✅ **Integrates with Git** - Automatic deployments on push with GitHub Actions + + + Your system now operates at **[Level 2 Continuous AI](https://blog.continue.dev/what-is-continuous-ai-a-developers-guide/)** - + AI handles deployment tasks while maintaining human oversight through + PR reviews and deployment approvals. + + +## Security Best Practices + + + **Protect Your Credentials:** + - Store Netlify tokens as GitHub Secrets + - Use Continue CLI's secure authentication + - Rotate Personal Access Tokens regularly + - Enable 2FA on your Netlify account + - Audit deployment logs regularly + - Use environment-specific variables + + +## Advanced Use Cases + + + + "Set up blue-green deployments with instant rollback capabilities using + Netlify's split testing features" + + + "Deploy edge functions for personalization and A/B testing at the CDN level" + + + "Configure geo-distributed deployments for optimal global performance" + + + "Run Lighthouse tests on every deployment and block if scores drop" + + + +## Next Steps + +1. **Deploy your first site** - Use Continue CLI to deploy a real project +2. **Set up staging** - Create a complete deployment pipeline +3. **Add monitoring** - Configure alerts for build failures and performance issues +4. **Optimize builds** - Implement caching and incremental builds +5. **Scale your workflow** - Add more sites and team collaboration features + +## Resources + +- [Netlify MCP Documentation](https://docs.netlify.com/welcome/build-with-ai/netlify-mcp-server/) +- [Continue CLI Documentation](https://docs.continue.dev/cli) +- [Model Context Protocol](https://modelcontextprotocol.org) +- [Netlify CLI Reference](https://docs.netlify.com/cli/get-started/) \ No newline at end of file diff --git a/docs/guides/overview.mdx b/docs/guides/overview.mdx index 306804c3f..71cebe323 100644 --- a/docs/guides/overview.mdx +++ b/docs/guides/overview.mdx @@ -15,6 +15,7 @@ description: "Comprehensive collection of practical guides for Continue includin - [How to Use Continue CLI (cn)](/guides/cli) - Command-line interface for Continue - [Continuous AI Readiness Assessment](/guides/continuous-ai-readiness-assessment) - Evaluate team readiness for Continuous AI adoption - [PostHog Session Analysis with Continue CLI](/guides/posthog-github-continuous-ai) - Analyze user behavior data to optimize your codebase with automatic issue creation +- [Netlify Deployment with Continue CLI](/guides/netlify-mcp-continuous-deployment) - Build automated deployment workflows using Netlify MCP for seamless site management ## What Advanced Tutorials Are Available From 3343f8ff42c0b3d3abfa66bfefa096f5c9f8b56c Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 18 Sep 2025 23:32:12 -0700 Subject: [PATCH 02/25] docs: remove alternative PAT setup from Netlify guide - Simplify authentication flow to only show CLI method - Remove export NETLIFY_AUTH_TOKEN alternative Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/docs.json | 10 ++++++++-- docs/guides/netlify-mcp-continuous-deployment.mdx | 6 +----- docs/guides/overview.mdx | 9 +++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/docs.json b/docs/docs.json index 4e45df976..0be8ff446 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -233,8 +233,6 @@ "guides/codebase-documentation-awareness", "guides/cli", "guides/continuous-ai", - "guides/posthog-github-continuous-ai", - "guides/netlify-mcp-continuous-deployment", "guides/continuous-ai-readiness-assessment", "guides/plan-mode-guide", "guides/ollama-guide", @@ -243,6 +241,14 @@ "guides/custom-code-rag", "guides/how-to-self-host-a-model" ] + }, + { + "group": "Cookbooks", + "icon": "book-open-cover", + "pages": [ + "guides/posthog-github-continuous-ai", + "guides/netlify-mcp-continuous-deployment" + ] } ] }, diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index bdd6a0e1b..80e0f7c39 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -69,11 +69,7 @@ First, you'll need to gather your API credentials and configure both Netlify CLI netlify login ``` -This will open your browser for authentication. Alternatively, you can use your Personal Access Token: - -```bash -export NETLIFY_AUTH_TOKEN="your-personal-access-token" -``` +This will open your browser for authentication. ### Configure MCP with Netlify diff --git a/docs/guides/overview.mdx b/docs/guides/overview.mdx index 71cebe323..c7df37478 100644 --- a/docs/guides/overview.mdx +++ b/docs/guides/overview.mdx @@ -14,8 +14,13 @@ description: "Comprehensive collection of practical guides for Continue includin - [Continuous AI: A Developer's Guide](/guides/continuous-ai) - Integrating AI into development workflows - [How to Use Continue CLI (cn)](/guides/cli) - Command-line interface for Continue - [Continuous AI Readiness Assessment](/guides/continuous-ai-readiness-assessment) - Evaluate team readiness for Continuous AI adoption -- [PostHog Session Analysis with Continue CLI](/guides/posthog-github-continuous-ai) - Analyze user behavior data to optimize your codebase with automatic issue creation -- [Netlify Deployment with Continue CLI](/guides/netlify-mcp-continuous-deployment) - Build automated deployment workflows using Netlify MCP for seamless site management + +## MCP Integration Cookbooks + +Step-by-step guides for integrating Model Context Protocol (MCP) servers with Continue: + +- [PostHog Session Analysis Cookbook](/guides/posthog-github-continuous-ai) - Analyze user behavior data to optimize your codebase with automatic issue creation +- [Netlify Performance Optimization Cookbook](/guides/netlify-mcp-continuous-deployment) - Optimize web performance with A/B testing and automated monitoring using Netlify MCP ## What Advanced Tutorials Are Available From 45e65747726bc07608b35faede35abf37e290f02 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 18 Sep 2025 23:36:57 -0700 Subject: [PATCH 03/25] docs: refocus Netlify guide on performance optimization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Transform guide to focus on performance optimization instead of deployment - Replace all cn -p examples with TUI mode for better user experience - Simplify prompts to be more human-readable and leverage Netlify rules - Add A/B testing and performance monitoring workflows - Include GitHub Actions for automated performance checks - Create dedicated Cookbooks section in sidebar for MCP guides - Add PostHog integration note for enhanced analytics 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../netlify-mcp-continuous-deployment.mdx | 732 ++++++------------ 1 file changed, 256 insertions(+), 476 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 80e0f7c39..22b50e629 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -1,24 +1,33 @@ --- -title: "Building a Continuous Deployment Workflow with Netlify MCP and Continue CLI" -description: "Build an automated system that uses Continue CLI with Netlify MCP to deploy sites, manage environments, and automate deployment workflows through natural language commands." -sidebarTitle: "Netlify Deployment with Continue CLI" +title: "Netlify Performance Optimization Cookbook" +description: "Optimize web performance with A/B testing, automated monitoring, and data-driven improvements using Netlify MCP and Continue." +sidebarTitle: "Using Netlify MCP for Performance Optimization" --- - - A fully automated workflow that uses Continue CLI with Netlify MCP to create - sites, deploy code changes, manage environment variables, and monitor - deployments - all through natural language commands + + Use AI to automatically monitor performance metrics, run A/B tests between + branches, and get actionable optimization suggestions based on real user data + from Netlify Analytics +## What You'll Learn + +This cookbook teaches you to: +- Run A/B tests between branches to measure performance impact +- Monitor Core Web Vitals and build performance metrics +- Automatically block deploys that degrade performance +- Optimize build times and bundle sizes with AI assistance + ## Prerequisites -Before starting, ensure you have: +- GitHub repository with a web project +- [Netlify account](https://netlify.com) (free tier works) +- Node.js 22+ installed (required for Netlify) +- [Continue CLI](https://docs.continue.dev/guides/cli) (`npm i -g @continuedev/cli`) +- [Netlify MCP](https://hub.continue.dev/netlify/netlify-mcp) configured +- [Netlify Development Rules](https://hub.continue.dev/netlify/netlify-development) (recommended) -- GitHub repository with a web project (React, Vue, Next.js, etc.) -- Netlify account (free tier works) -- Node.js 22+ installed locally -- Continue CLI account with **active credits** (required for API usage) -- Continue Hub account to install Netlify MCP +## Quick Setup @@ -26,556 +35,327 @@ Before starting, ensure you have: npm i -g @continuedev/cli ``` - - - ```bash - npm i -g netlify-cli - ``` - - - - 1. Visit [Continue Organizations](https://hub.continue.dev/settings/organizations) - 2. Sign up or log in to your Continue account - 3. Navigate to your organization settings - 4. Click **"API Keys"** and then **"+ New API Key"** - 5. Copy the API key immediately (you won't see it again!) - 6. Login to the CLI: `cn login` + + + 1. Visit [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) + 2. Follow the configuration instructions for CLI + 3. Add your Netlify Personal Access Token to your MCP config - - Visit [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) and follow the installation instructions for your preferred editor, or add to your MCP config manually. + + Install the [Netlify Development Rules](https://hub.continue.dev/netlify/netlify-development) bundle for best practices: + + 1. Visit the bundle page on Continue Hub + 2. Click **"Install Rules"** + 3. Rules automatically apply to your agent + + + + Test the connection with cn CLI: + + ```bash + cn + # Then in TUI mode: + "Check my Netlify auth and list sites" + ``` - - Netlify MCP gives Continue CLI direct access to Netlify's API and CLI - commands, enabling powerful deployment automation through natural language! - + + The Netlify Development Rules bundle includes guardrails for: + - Proper `.gitignore` configuration + - Function structure and placement + - Edge function constraints + - Local development best practices + -## Step 1: Set Up Your Credentials +## Performance Optimization Steps -First, you'll need to gather your API credentials and configure both Netlify CLI and Continue CLI. +### Step 1: Baseline Performance Metrics -### Get Your Netlify Personal Access Token - -1. Go to [Netlify Personal Access Tokens](https://app.netlify.com/user/applications#personal-access-tokens) -2. Click **"New access token"** -3. Name it "Continue CLI Deployment" -4. Copy the token immediately (you won't see it again!) - -### Authenticate Netlify CLI +Establish your current performance baseline using cn CLI: ```bash -netlify login -``` +# Start cn in TUI mode +cn -This will open your browser for authentication. - -### Configure MCP with Netlify - -Add Netlify MCP to your MCP configuration file (usually `~/.config/mcp/config.json` or similar): - -```json -{ - "mcpServers": { - "netlify": { - "command": "npx", - "args": ["-y", "@netlify/mcp"], - "env": { - "NETLIFY_PERSONAL_ACCESS_TOKEN": "your-pat-here" - } - } - } -} -``` - - - **Security Note**: Never commit your Personal Access Token to version control. - Consider using environment variables or secure secret management. - - -### Test Your Setup - -Use Continue CLI to verify Netlify MCP is working: - -```bash -cn -p "Using the Netlify MCP server, please: -1. Check if I'm authenticated with Netlify -2. List my current Netlify sites (if any) -3. Show my Netlify account information -4. Confirm the MCP connection is working properly - -Please provide a summary of the connection status and any sites found." -``` - -## Step 2: Create and Deploy Your First Site - -Now you'll use Continue CLI with Netlify MCP to create a new site and deploy your project. - -### Create a New Netlify Site - -```bash -cn -p "Using Netlify MCP, I need to create and deploy a new site. Please: - -1. Create a new Netlify site with these specifications: - - Name: my-continue-cli-demo-{random-id} - - Use the current directory as the project root - - Detect the build settings automatically - -2. Link the site to my current Git repository if one exists - -3. Set up the following build configuration: - - Build command: Detect automatically or use 'npm run build' - - Publish directory: Detect automatically or use 'dist' or 'build' - - Node version: 22.x - -4. Deploy the site immediately after creation - -5. Provide me with: - - The site URL - - The site ID for future reference - - Build status - - Any deployment logs - -Please execute these steps and show me the results." +# Then ask: +"Show my site's Core Web Vitals and build times" ``` - **What Netlify MCP Does:** - - Creates a new site in your Netlify account - - Automatically detects framework settings (React, Vue, Next.js, etc.) - - Links to your Git repository for continuous deployment - - Triggers an initial deployment - - Provides live site URL + Netlify automatically tracks: + - **Build Performance**: Compile times, cache hits + - **Runtime Performance**: Core Web Vitals, Time to Interactive + - **Resource Usage**: Bandwidth, function execution times -## Step 3: Manage Environment Variables +### Step 2: A/B Test Branch Performance -Use Continue CLI to manage your site's environment variables securely: +Compare performance between branches: ```bash -cn -p "Using Netlify MCP, help me manage environment variables for my site. Please: +# In cn TUI mode: +"Set up 50/50 A/B test between main and feature branch" +``` -1. List all current environment variables for site: {your-site-id} + + **Enhanced Analytics**: Combine Netlify's A/B testing with PostHog session recordings + to understand not just which variant performs better, but why users behave differently. + See our [PostHog MCP guide](/guides/posthog-mcp-product-engineer-cookbook) to set up + session tracking and create a complete continuous AI analytics workflow. + -2. Add these new environment variables: - - API_KEY: 'demo-api-key-123' - - NODE_ENV: 'production' - - ENABLE_FEATURE_FLAGS: 'true' +### Step 3: Optimize Build Performance -3. Create these build-time only variables: - - BUILD_TIMESTAMP: Current ISO timestamp - - GIT_COMMIT_SHA: Latest commit SHA if available +Reduce build times and improve caching: -4. Set up these sensitive variables (mark as secret): - - DATABASE_URL: 'postgresql://user:pass@host:5432/db' - - JWT_SECRET: Generate a secure random string - -5. Verify all variables are set correctly - -6. Trigger a new deployment to apply the changes - -Please execute these operations and confirm the environment variables are properly configured." +```bash +# In cn TUI mode: +"Enable dependency caching and optimize my build" ``` - Environment variables set through Netlify MCP are encrypted and only - accessible during build time and runtime, keeping your secrets secure. + Common optimizations that Continue can implement: + - Dependency caching saves 40-60% on build times + - Parallel builds for monorepos + - Selective builds based on changed files + - Build plugin optimizations -## Step 4: Set Up Continuous Deployment Workflow +### Step 4: Bundle Size Analysis -Create an automated workflow that deploys on code changes and monitors build status. - -### Create Deployment Automation Script - -Create a file called `deploy-with-continue.sh`: +Identify and fix bundle size issues: ```bash -#!/bin/bash - -# Deploy with Continue CLI and Netlify MCP -cn -p "Using Netlify MCP, perform a production deployment: - -1. Check the current deployment status of my Netlify site - -2. If there are uncommitted changes: - - Show me what files have changed - - Ask if I want to commit them first - -3. Create a new deployment with: - - Clear build cache if needed - - Production context - - Auto-publish enabled - -4. Monitor the deployment: - - Show build logs in real-time - - Report any errors immediately - - Notify when deployment is complete - -5. After successful deployment: - - Show the preview URL - - Run basic smoke tests (check if site is accessible) - - Report Core Web Vitals if available - -6. If deployment fails: - - Show error logs - - Suggest potential fixes - - Option to rollback to previous deployment - -Please execute this deployment workflow and keep me updated on progress." +# In cn TUI mode: +"Show largest dependencies and implement code splitting" ``` -Make it executable: -```bash -chmod +x deploy-with-continue.sh -``` + + Continue can automatically: + - Add dynamic imports for large components + - Configure tree shaking + - Implement lazy loading + - Optimize image formats + -## Step 5: Advanced Netlify Operations +### Step 5: Performance Budget Enforcement -### Manage Multiple Environments +Set and enforce performance budgets: ```bash -cn -p "Using Netlify MCP, help me set up a staging environment: - -1. Create a branch deploy for 'staging' branch: - - Enable automatic deploys from staging branch - - Use different environment variables for staging - - Create unique URL: staging--{site-name}.netlify.app - -2. Set up deploy previews: - - Enable for all pull requests - - Add comment to PR with preview URL - - Run tests on preview deploys - -3. Configure split testing: - - Create A/B test between main and staging - - Split traffic 50/50 - - Track performance metrics - -Please set up these deployment environments and provide the configuration details." +# In cn TUI mode: +"Set performance budget: LCP < 2.5s, bundle < 200KB" ``` -### Enable Netlify Functions +### Step 6: Image Optimization + +Optimize images for better performance: ```bash -cn -p "Using Netlify MCP, help me set up serverless functions: - -1. Enable Netlify Functions for my site - -2. Create a sample function at netlify/functions/hello-world.js: - - Simple JSON response - - Handle GET and POST requests - - Include CORS headers - -3. Create an API endpoint function at netlify/functions/api.js: - - Connect to environment variables - - Handle multiple routes - - Include error handling - -4. Deploy the functions and provide: - - Function endpoints - - Invocation URLs - - Test commands - -Please set up these serverless functions and show me how to invoke them." +# In cn TUI mode: +"Convert images to WebP and add lazy loading" ``` -### Set Up Form Handling +## Continuous Performance Monitoring + +### Step 7: Real User Monitoring + +Track actual user experience: ```bash -cn -p "Using Netlify MCP, configure form handling for my site: - -1. Enable Netlify Forms - -2. Set up form notifications: - - Email notifications to: admin@example.com - - Webhook to: https://api.example.com/form-webhook - - Slack notifications if possible - -3. Configure spam filtering: - - Enable reCAPTCHA - - Set up honeypot field - - Configure Akismet if available - -4. Create form submission handling: - - Store submissions in Netlify - - Export endpoint for submissions - - Set up auto-response emails - -Please configure these form features and provide integration instructions." +# In cn TUI mode: +"Set up RUM tracking with alerts for P75 degradation" ``` -## Step 6: Monitoring and Analytics +### Step 8: Lighthouse CI Integration -### Set Up Deployment Monitoring +Automate performance testing: ```bash -cn -p "Using Netlify MCP, help me monitor my site's performance: - -1. Get deployment analytics: - - Build times over last 30 days - - Success/failure rate - - Average deploy time - -2. Check current site metrics: - - Bandwidth usage - - Request count - - Form submission count - -3. Set up monitoring alerts: - - Build failures - - High bandwidth usage - - Form spam detection - -4. Generate a deployment report: - - Last 10 deployments - - Git commits for each - - Build duration trends - -Please gather this monitoring data and create a comprehensive report." +# In cn TUI mode: +"Add Lighthouse CI with minimum score 90" ``` -## Step 7: GitHub Actions Integration +## Automated Performance Checks -Create a GitHub Actions workflow that uses Continue CLI with Netlify MCP for automated deployments. +### GitHub Actions Performance Guard -### Add GitHub Secrets - -1. Go to **Repository Settings → Secrets and variables → Actions** -2. Add these secrets: - - `CONTINUE_API_KEY`: Your Continue API key - - `NETLIFY_AUTH_TOKEN`: Your Netlify Personal Access Token - - `NETLIFY_SITE_ID`: Your Netlify site ID - -### Create GitHub Actions Workflow - -Create `.github/workflows/netlify-deploy.yml`: +Block PRs that degrade performance: ```yaml -name: Deploy to Netlify with Continue CLI +name: Performance Check on: - push: - branches: [main, staging] pull_request: - types: [opened, synchronize] - workflow_dispatch: - inputs: - environment: - description: 'Deployment environment' - required: true - default: 'preview' - type: choice - options: - - production - - staging - - preview jobs: - deploy: + performance: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: '22' - - - name: Install dependencies - run: | - npm ci - npm install -g @continuedev/cli netlify-cli - - - name: Authenticate Continue CLI - env: - CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} - run: | - cn auth login --api-key "$CONTINUE_API_KEY" - echo "✅ Continue CLI authenticated" - - - name: Deploy with Netlify MCP + + - name: Deploy and Test Performance + id: perf env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - DEPLOY_ENV: ${{ github.event.inputs.environment || 'preview' }} - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - COMMIT_SHA: ${{ github.sha }} - COMMIT_MESSAGE: ${{ github.event.head_commit.message }} run: | - cat > deploy_prompt.txt << 'EOF' - Using Netlify MCP, deploy my site with these specifications: - - 1. Site ID: $NETLIFY_SITE_ID - 2. Environment: $DEPLOY_ENV - 3. Branch: $BRANCH_NAME - 4. Commit: $COMMIT_SHA - - Deployment steps: - 1. Build the project with production optimizations - 2. Deploy to Netlify with appropriate context - 3. If PR, create preview deployment with comment - 4. If main branch, deploy to production - 5. If staging branch, deploy to staging environment - - After deployment: - - Provide deployment URL - - Show build logs summary - - Report Core Web Vitals if available - - Add deployment status to GitHub commit - - Please execute this deployment and provide detailed feedback. - EOF - - cn < deploy_prompt.txt - - - name: Comment on PR - if: github.event_name == 'pull_request' + npx @continuedev/cli@latest << 'EOF' + Deploy PR preview and run Lighthouse. + Compare scores with main branch. + Output JSON with score deltas. + EOF > performance.json + + - name: Comment Performance Results uses: actions/github-script@v7 with: script: | - const message = `🚀 **Netlify Preview Deployment Ready!** - - Preview URL: https://deploy-preview-${{ github.event.number }}--${{ secrets.NETLIFY_SITE_ID }}.netlify.app - - Deployment triggered by Continue CLI with Netlify MCP.`; - + const fs = require('fs'); + const perf = JSON.parse(fs.readFileSync('performance.json')); + + const emoji = perf.score_delta < -10 ? '🔴' : + perf.score_delta < 0 ? '🟡' : '🟢'; + + const comment = `## ${emoji} Performance Impact + + | Metric | Main | PR | Delta | + |--------|------|----|---------| + | Performance Score | ${perf.main_score} | ${perf.pr_score} | ${perf.score_delta > 0 ? '+' : ''}${perf.score_delta} | + | LCP | ${perf.main_lcp}s | ${perf.pr_lcp}s | ${perf.lcp_delta > 0 ? '+' : ''}${perf.lcp_delta}s | + | Bundle Size | ${perf.main_bundle}KB | ${perf.pr_bundle}KB | ${perf.bundle_delta > 0 ? '+' : ''}${perf.bundle_delta}KB | + + ${perf.score_delta < -10 ? '⚠️ **This PR significantly degrades performance. Please optimize before merging.**' : ''} + + [View Full Report](${perf.report_url})`; + github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: message + body: comment }); + + // Fail check if performance degrades significantly + if (perf.score_delta < -10) { + core.setFailed('Performance degraded by more than 10 points'); + } ``` -## Step 8: Testing Your Workflow - -### Local Testing - -Test your Netlify MCP integration locally: - -```bash -# Test site creation -cn -p "Using Netlify MCP, create a test site and immediately delete it to verify my setup works" - -# Test deployment -cn -p "Using Netlify MCP, deploy my current project to Netlify and show me the deployment logs" - -# Test environment variables -cn -p "Using Netlify MCP, list and update environment variables for my site" -``` - -### Production Testing Checklist - - - **Deployment Checklist:** - - Site builds successfully without errors - - Environment variables are properly set - - Custom domain is configured (if applicable) - - SSL certificate is active - - Forms are working (if used) - - Functions are accessible (if used) - - Analytics tracking is enabled - - Performance metrics meet targets - - -## Troubleshooting - -### Common Issues and Solutions - -```bash -cn -p "Help me troubleshoot my Netlify deployment. Please: - -1. Check Netlify MCP connection status -2. Verify my authentication is working -3. List recent deployment failures and their causes -4. Check for common configuration issues: - - Missing environment variables - - Incorrect build commands - - Wrong publish directory - - Node version mismatches -5. Suggest fixes for any issues found - -Please diagnose and help me resolve any problems." -``` - -### Debug Build Failures - -```bash -cn -p "Using Netlify MCP, help me debug a build failure: - -1. Get the latest failed build logs -2. Identify the error message and stack trace -3. Check for: - - Missing dependencies - - Build command errors - - Environment variable issues - - Memory limit exceeded -4. Suggest specific fixes -5. Attempt to redeploy with fixes - -Show me the full diagnostic process." -``` - -## What You've Built - -After completing this guide, you have a complete **Continuous Deployment system** that: - -✅ **Automates deployments** - Deploy sites through natural language commands -✅ **Manages environments** - Handle production, staging, and preview deployments -✅ **Configures infrastructure** - Set up forms, functions, and environment variables -✅ **Monitors performance** - Track build times, success rates, and site metrics -✅ **Integrates with Git** - Automatic deployments on push with GitHub Actions - - - Your system now operates at **[Level 2 Continuous AI](https://blog.continue.dev/what-is-continuous-ai-a-developers-guide/)** - - AI handles deployment tasks while maintaining human oversight through - PR reviews and deployment approvals. - - -## Security Best Practices - - **Protect Your Credentials:** - - Store Netlify tokens as GitHub Secrets - - Use Continue CLI's secure authentication - - Rotate Personal Access Tokens regularly - - Enable 2FA on your Netlify account - - Audit deployment logs regularly - - Use environment-specific variables + This workflow will: + - **Block merge** if performance score drops >10 points + - **Warn** on any performance regression + - **Celebrate** improvements with green indicators -## Advanced Use Cases +## Performance Testing Locally - - - "Set up blue-green deployments with instant rollback capabilities using - Netlify's split testing features" - - - "Deploy edge functions for personalization and A/B testing at the CDN level" - - - "Configure geo-distributed deployments for optimal global performance" - - - "Run Lighthouse tests on every deployment and block if scores drop" - - +### Step 9: Local Performance Testing + +Test performance before deploying: + +```bash +# In cn TUI mode: +"Run production build and measure bundle sizes" +``` + +### Step 10: Pre-commit Performance Checks + +Prevent performance regressions before they happen: + +```bash +# In cn TUI mode: +"Add pre-commit hooks for bundle size limits" +``` + +## Performance Troubleshooting + +### Debug Performance Issues + +Identify and fix performance bottlenecks: + +```bash +# In cn TUI mode: +"Why did my performance score drop?" +``` + +### Performance Issue Quick Fixes + +| Issue | Quick Fix Command (in cn TUI) | +|-------|--------------------------------| +| Slow LCP | `"Preload critical resources"` | +| High CLS | `"Add size attributes to images"` | +| Large bundles | `"Implement code splitting"` | +| Slow builds | `"Enable build caching"` | +| Poor caching | `"Configure cache headers"` | + +## What You've Accomplished + + + You've built an AI-powered performance optimization system that: + - Automatically monitors Core Web Vitals + - Runs A/B tests between branches + - Blocks deployments that degrade performance + - Provides actionable optimization suggestions + + +## Performance Best Practices + +The Netlify Performance Rules enforce: + +✅ **Build Optimization** +- Dependency caching enabled +- Parallel builds when possible +- Incremental compilation +- Smart cache invalidation + +✅ **Runtime Performance** +- Automatic image optimization +- Efficient resource hints (preload, prefetch) +- Optimal cache headers +- CDN configuration + +✅ **Monitoring Standards** +- Performance budgets enforced +- Core Web Vitals tracking +- Real user monitoring +- Automated alerts + +## Advanced Performance Strategies + +### Progressive Enhancement +```bash +# In cn TUI mode: +"Implement progressive enhancement with basic HTML first" +``` + +### Multi-variant Testing +```bash +# In cn TUI mode: +"Test 3 bundle strategies and auto-select winner" +``` + +### Predictive Prefetching +```bash +# In cn TUI mode: +"Analyze navigation patterns and prefetch next pages" +``` ## Next Steps -1. **Deploy your first site** - Use Continue CLI to deploy a real project -2. **Set up staging** - Create a complete deployment pipeline -3. **Add monitoring** - Configure alerts for build failures and performance issues -4. **Optimize builds** - Implement caching and incremental builds -5. **Scale your workflow** - Add more sites and team collaboration features +- Install [Netlify MCP](https://hub.continue.dev/netlify/netlify-mcp) from Continue Hub +- Set up [Performance Monitoring](https://docs.netlify.com/analytics/get-started/) +- Configure [A/B Testing](https://docs.netlify.com/split-testing/overview/) +- Join the [Continue Discord](https://discord.gg/continue) for support ## Resources -- [Netlify MCP Documentation](https://docs.netlify.com/welcome/build-with-ai/netlify-mcp-server/) -- [Continue CLI Documentation](https://docs.continue.dev/cli) -- [Model Context Protocol](https://modelcontextprotocol.org) -- [Netlify CLI Reference](https://docs.netlify.com/cli/get-started/) \ No newline at end of file +- [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) +- [Core Web Vitals Guide](https://web.dev/vitals/) +- [Netlify Analytics Documentation](https://docs.netlify.com/analytics/) +- [Continue Performance Guides](https://docs.continue.dev/guides) \ No newline at end of file From af1a05d824ddef4fced53b83444c55bd630b72b5 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:01:05 -0700 Subject: [PATCH 04/25] docs: update Netlify MCP setup to use CLI authentication - Remove Personal Access Token requirement from setup - Add Netlify CLI installation and login steps - Clarify that users authenticate via netlify login command - Simplify configuration flow for better user experience Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/netlify-mcp-continuous-deployment.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 22b50e629..900916196 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -37,9 +37,10 @@ This cookbook teaches you to: - 1. Visit [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) - 2. Follow the configuration instructions for CLI - 3. Add your Netlify Personal Access Token to your MCP config + 1. Install Netlify CLI: `npm i -g netlify-cli` + 2. Authenticate with Netlify: `netlify login` + 3. Visit [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) + 4. Follow the configuration instructions for your editor From 8b14a96f7c7022cd898d550022f084f21ed8d753 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:03:24 -0700 Subject: [PATCH 05/25] docs: add detailed Lighthouse CI setup prompt to Netlify guide - Expand Step 8 with comprehensive Lighthouse CI configuration prompt - Include specific performance budget requirements (LCP, bundle size) - Add setup instructions for Netlify plugin and GitHub checks - Provide clear implementation requirements and expected outcomes - Add tip about automatic testing on all deployments Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .../netlify-mcp-continuous-deployment.mdx | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 900916196..88cc4594d 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -172,13 +172,33 @@ Track actual user experience: ### Step 8: Lighthouse CI Integration -Automate performance testing: +Automate performance testing with strict budgets: ```bash # In cn TUI mode: -"Add Lighthouse CI with minimum score 90" +"Set up Lighthouse CI with performance budgets for my Netlify site: + +Requirements: +- LCP must be < 2.5 seconds +- JavaScript bundle must be < 200KB +- Total size < 500KB +- Performance score >= 90 + +Setup needed: +1. Install @lhci/cli and @netlify/plugin-lighthouse +2. Create lighthouserc.js with these budget assertions +3. Configure netlify.toml to run checks on all deploys +4. Add GitHub status checks to block PRs that exceed budgets +5. Create performance dashboard at /lighthouse-reports + +Please configure the complete Lighthouse CI setup with these budgets." ``` + + This comprehensive setup will automatically test every deploy preview and + production deployment, blocking any changes that violate your performance budgets. + + ## Automated Performance Checks ### GitHub Actions Performance Guard From 2b0be1c1cf232cea79c0faf5f5207ce1495c846d Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:05:28 -0700 Subject: [PATCH 06/25] docs: reorganize Lighthouse CI step under Continuous Performance Monitoring - Move Performance Budget Enforcement to Continuous Performance Monitoring section - Renumber steps for better flow (Image Optimization becomes Step 5) - Keep Lighthouse CI setup as Step 6 under monitoring where it belongs - Maintain logical progression from optimization to monitoring Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .../netlify-mcp-continuous-deployment.mdx | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 88cc4594d..632cc223c 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -141,16 +141,7 @@ Identify and fix bundle size issues: - Optimize image formats -### Step 5: Performance Budget Enforcement - -Set and enforce performance budgets: - -```bash -# In cn TUI mode: -"Set performance budget: LCP < 2.5s, bundle < 200KB" -``` - -### Step 6: Image Optimization +### Step 5: Image Optimization Optimize images for better performance: @@ -161,18 +152,9 @@ Optimize images for better performance: ## Continuous Performance Monitoring -### Step 7: Real User Monitoring +### Step 6: Performance Budget Enforcement with Lighthouse CI -Track actual user experience: - -```bash -# In cn TUI mode: -"Set up RUM tracking with alerts for P75 degradation" -``` - -### Step 8: Lighthouse CI Integration - -Automate performance testing with strict budgets: +Set and enforce performance budgets with automated testing: ```bash # In cn TUI mode: @@ -199,6 +181,17 @@ Please configure the complete Lighthouse CI setup with these budgets." production deployment, blocking any changes that violate your performance budgets. +### Step 7: Real User Monitoring + +Track actual user experience: + +```bash +# In cn TUI mode: +"Set up RUM tracking with alerts for P75 degradation" +``` + + + ## Automated Performance Checks ### GitHub Actions Performance Guard @@ -276,7 +269,7 @@ jobs: ## Performance Testing Locally -### Step 9: Local Performance Testing +### Step 8: Local Performance Testing Test performance before deploying: @@ -285,7 +278,7 @@ Test performance before deploying: "Run production build and measure bundle sizes" ``` -### Step 10: Pre-commit Performance Checks +### Step 9: Pre-commit Performance Checks Prevent performance regressions before they happen: From bda4cd503ba6cbe3044d987748a08d6cdc168e3f Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:08:45 -0700 Subject: [PATCH 07/25] docs: enhance image optimization step with Cloudinary setup - Add specific Cloudinary plugin installation via MCP - Include responsive image size generation - Specify WebP conversion with fallbacks - Add blur-up placeholder configuration - Set clear performance target (60-80% reduction) - Make prompt concise but comprehensive Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/netlify-mcp-continuous-deployment.mdx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 632cc223c..730cc36f5 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -147,7 +147,14 @@ Optimize images for better performance: ```bash # In cn TUI mode: -"Convert images to WebP and add lazy loading" +"Set up Cloudinary image optimization for my Netlify site: +- Install @cloudinary/netlify-plugin via MCP +- Auto-convert images to WebP with fallbacks +- Generate responsive sizes (320w, 640w, 1024w, 1920w) +- Add lazy loading for all images +- Configure blur-up placeholders +- Update netlify.toml with Cloudinary settings +Target: Reduce image payload by 60-80% and improve LCP" ``` ## Continuous Performance Monitoring From a42d6371727d3fb3668b69aedf7c58aa59339218 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:09:55 -0700 Subject: [PATCH 08/25] docs: enhance A/B testing step with specific implementation details - Add traffic split configuration (50/50) - Include Core Web Vitals and conversion tracking - Specify cookie-based visitor persistence - Add test duration and auto-conclusion criteria - Include performance and conversion metrics reporting - Make prompt actionable with clear requirements Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/netlify-mcp-continuous-deployment.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 730cc36f5..5d93a2360 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -97,7 +97,15 @@ Compare performance between branches: ```bash # In cn TUI mode: -"Set up 50/50 A/B test between main and feature branch" +"Set up A/B test between main and feature branch on Netlify: +- Split traffic 50/50 between branches +- Track Core Web Vitals for each variant +- Monitor conversion metrics and bounce rate +- Enable analytics to measure performance impact +- Configure cookie-based visitor persistence +- Set test duration for 1000 unique visitors +- Auto-conclude test when statistical significance reached +Report winner based on performance + conversion metrics" ``` From d25da39a6496d850b2f8ae61566bb02dfdb4b813 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:14:14 -0700 Subject: [PATCH 09/25] docs: enhance Netlify guide with feature awareness and documentation links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Improved Steps 3 & 4 with comprehensive Netlify-specific features - Added extensive documentation links to build awareness of Netlify capabilities - Included "Hidden Gems" section showcasing lesser-known Netlify features - Enhanced prompts to demonstrate Build Plugins, Edge Functions, and more - Added info box highlighting Netlify's full feature set beyond static hosting - Linked to official Netlify docs throughout for deeper exploration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../netlify-mcp-continuous-deployment.mdx | 151 +++++++++++++++--- 1 file changed, 128 insertions(+), 23 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 5d93a2360..73d3a3c49 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -10,13 +10,26 @@ sidebarTitle: "Using Netlify MCP for Performance Optimization" from Netlify Analytics + + **Did You Know?** Netlify is more than just static hosting! It offers: + - [Split Testing](https://docs.netlify.com/site-deploys/split-testing/) for A/B testing branches + - [Analytics](https://docs.netlify.com/analytics/get-started/) with Core Web Vitals tracking + - [Edge Functions](https://docs.netlify.com/edge-functions/overview/) for personalization at the edge + - [Build Plugins](https://docs.netlify.com/integrations/build-plugins/) ecosystem with 100+ integrations + - [Forms](https://docs.netlify.com/forms/setup/) with built-in spam protection + - [Identity](https://docs.netlify.com/visitor-access/identity/) for user authentication + - [Large Media](https://docs.netlify.com/large-media/overview/) for Git LFS support + + This guide shows you how to leverage these features through natural language with Continue CLI! + + ## What You'll Learn This cookbook teaches you to: -- Run A/B tests between branches to measure performance impact -- Monitor Core Web Vitals and build performance metrics -- Automatically block deploys that degrade performance -- Optimize build times and bundle sizes with AI assistance +- Run [A/B tests](https://docs.netlify.com/site-deploys/split-testing/) between branches to measure performance impact +- Monitor [Core Web Vitals](https://docs.netlify.com/analytics/get-started/#core-web-vitals) and build performance metrics +- Automatically block deploys that degrade performance using [Deploy Contexts](https://docs.netlify.com/site-deploys/overview/#deploy-contexts) +- Optimize build times with [Build Plugins](https://docs.netlify.com/integrations/build-plugins/) and bundle sizes with AI assistance ## Prerequisites @@ -115,38 +128,85 @@ Report winner based on performance + conversion metrics" session tracking and create a complete continuous AI analytics workflow. -### Step 3: Optimize Build Performance +### Step 3: Advanced Build Optimization with Netlify -Reduce build times and improve caching: +Leverage Netlify's powerful build features to dramatically reduce build times: ```bash # In cn TUI mode: -"Enable dependency caching and optimize my build" +"Optimize my Netlify build performance using these features: + +1. Enable Netlify Cache Plugin for dependency caching + - Configure @netlify/plugin-cache for node_modules + - Set up custom cache directories for .next/cache or .nuxt + - Enable Gatsby's incremental builds if applicable + +2. Set up Build Plugins from Netlify's ecosystem: + - Install @netlify/plugin-lighthouse for performance monitoring + - Add netlify-plugin-checklinks to prevent broken links + - Configure netlify-plugin-submit-sitemap for SEO + +3. Implement Conditional Builds: + - Skip builds when only docs change (ignore: /docs/**) + - Use build.ignore script for custom logic + - Set up monorepo-specific build triggers + +4. Configure concurrent builds for monorepos + - Set base directory per package + - Use pnpm workspaces or yarn workspaces + +Show me the netlify.toml configuration and explain each optimization" ``` - - Common optimizations that Continue can implement: - - Dependency caching saves 40-60% on build times - - Parallel builds for monorepos - - Selective builds based on changed files - - Build plugin optimizations - + + **Netlify Build Features You're Getting**: + - [Build Caching](https://docs.netlify.com/configure-builds/build-caching/) - Persist dependencies between builds + - [Build Plugins](https://docs.netlify.com/integrations/build-plugins/) - Extend build process with 100+ plugins + - [Conditional Builds](https://docs.netlify.com/configure-builds/ignore-builds/) - Skip unnecessary builds + - [Monorepo Support](https://docs.netlify.com/configure-builds/monorepos/) - Optimize multi-package repos -### Step 4: Bundle Size Analysis + These features can reduce build times by 50-70% for most projects! + -Identify and fix bundle size issues: +### Step 4: Bundle Analysis with Netlify's Built-in Tools + +Use Netlify's bundle analyzer and optimization features: ```bash # In cn TUI mode: -"Show largest dependencies and implement code splitting" +"Analyze and optimize my bundle using Netlify's tools: + +1. Enable Netlify Bundle Analyzer: + - Add @netlify/plugin-bundle-analyzer to plugins + - Configure size thresholds in netlify.toml + - Generate visual bundle reports + +2. Set up Asset Optimization: + - Enable automatic JS minification + - Configure CSS optimization + - Turn on HTML minification + - Set up image processing pipeline + +3. Implement Smart Code Splitting: + - Analyze current chunks with the bundle analyzer + - Identify components over 50KB for splitting + - Configure webpack/vite for optimal chunking + - Set up route-based code splitting + +4. Configure Netlify's CDN for optimal delivery: + - Set cache headers for static assets + - Enable Brotli compression + - Configure edge caching rules + +Generate a full report with before/after bundle sizes" ``` - - Continue can automatically: - - Add dynamic imports for large components - - Configure tree shaking - - Implement lazy loading - - Optimize image formats + + **Features Available Through Netlify MCP**: + - [Bundle Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/) - Visualize your JavaScript bundles + - [Asset Optimization](https://docs.netlify.com/configure-builds/post-processing/) - Automatic minification and compression + - [Edge Network](https://docs.netlify.com/platform/edge-network/) - Global CDN with smart caching + - [Deploy Previews](https://docs.netlify.com/site-deploys/deploy-previews/) - Test optimizations before production ### Step 5: Image Optimization @@ -333,6 +393,51 @@ Identify and fix performance bottlenecks: - Provides actionable optimization suggestions +## Discover Netlify's Hidden Performance Gems + +Features many developers don't know Netlify offers: + + + + **[Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/)** + - Run code at the edge, closer to users + - Transform responses on-the-fly + - A/B test at the edge level + - Personalize content without client-side JS + + + + **[Netlify Graph](https://docs.netlify.com/graph/overview/)** + - Unified GraphQL gateway for all your APIs + - Automatic TypeScript generation + - Built-in authentication handling + - Zero client-side API keys needed + + + + **[On-Demand Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** + - Generate pages only when requested + - Cache dynamically generated content + - Perfect for large sites (10k+ pages) + - Reduce build times dramatically + + + + **[Background Functions](https://docs.netlify.com/functions/background-functions/)** + - Run tasks up to 15 minutes + - Process webhooks asynchronously + - Handle heavy computations + - No timeout worries + + + +```bash +# Try these advanced features in cn TUI mode: +"Show me how to use Netlify Edge Functions for geo-based personalization" +"Set up On-Demand Builders for my blog with 5000 posts" +"Configure Background Functions for image processing" +``` + ## Performance Best Practices The Netlify Performance Rules enforce: From 80005c3cb9f1c7cc7b0249e2648fd0274e18b5e9 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:15:30 -0700 Subject: [PATCH 10/25] docs: enhance Step 7 with comprehensive RUM and Netlify Analytics features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Expanded Real User Monitoring with Netlify Analytics Pro capabilities - Added geographic performance monitoring using Edge Functions - Included custom performance dashboard creation - Highlighted Netlify Analytics advantages over Google Analytics - Added implementation details for alerts and Web Vitals tracking - Emphasized privacy-first, server-side analytics approach - Included Netlify Blobs for performance data storage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../netlify-mcp-continuous-deployment.mdx | 63 ++++++++++++++++++- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 73d3a3c49..40f25e6ca 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -256,15 +256,72 @@ Please configure the complete Lighthouse CI setup with these budgets." production deployment, blocking any changes that violate your performance budgets. -### Step 7: Real User Monitoring +### Step 7: Real User Monitoring with Netlify Analytics -Track actual user experience: +Leverage Netlify's built-in analytics and integrate advanced RUM solutions: ```bash # In cn TUI mode: -"Set up RUM tracking with alerts for P75 degradation" +"Set up comprehensive Real User Monitoring for my Netlify site: + +1. Enable Netlify Analytics Pro: + - Activate server-side analytics (no JS required) + - Track Core Web Vitals (LCP, FID, CLS, INP) + - Monitor top pages by performance score + - Set up custom performance alerts + - Configure weekly performance reports + +2. Integrate Web Vitals tracking: + - Install web-vitals library for detailed metrics + - Send metrics to Netlify Functions endpoint + - Store performance data in Netlify Blobs + - Create performance dashboard at /metrics + +3. Set up Performance Alerts: + - Alert when P75 LCP > 3 seconds + - Notify if CLS increases by 20% + - Monitor JavaScript error rates + - Track 404s and broken resources + - Send alerts to Slack via Netlify Functions + +4. Configure Geographic Performance Monitoring: + - Use Netlify Edge Functions to track region-specific metrics + - Identify slow regions with Edge geo data + - Compare performance across CDN nodes + - Optimize edge caching for slow regions + +5. Create Custom Performance Dashboard: + - Build dashboard page using Netlify Functions + - Display real-time Core Web Vitals + - Show performance trends over time + - Include browser and device breakdowns + +Show me the complete implementation with all code and configurations" ``` + + **Netlify Analytics Advantages**: + - [Server-side Analytics](https://docs.netlify.com/analytics/get-started/) - No client-side JavaScript needed + - [Core Web Vitals](https://docs.netlify.com/analytics/core-web-vitals/) - Automatic tracking of Google's metrics + - [Custom Metrics](https://docs.netlify.com/functions/logs/) - Track any metric via Functions + - [Edge Insights](https://docs.netlify.com/edge-functions/overview/#geolocation) - Geographic performance data + - [No Cookie Banner Required](https://docs.netlify.com/analytics/get-started/#privacy) - GDPR compliant by default + + Unlike Google Analytics, Netlify Analytics: + - Doesn't slow down your site (server-side) + - Captures 100% of traffic (no ad blockers) + - Respects user privacy (no cookies) + - Shows bot traffic separately + + + + **Pro Tip**: Combine Netlify Analytics with Edge Functions to create a powerful RUM solution that: + - Tracks performance by user segment + - A/B tests performance optimizations + - Personalizes content based on connection speed + - Automatically serves lighter assets to slow connections + + ## Automated Performance Checks From f51ca22331e58585dc2b47a3f5f5ae122370eaf5 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:17:33 -0700 Subject: [PATCH 11/25] docs: add Plan Mode guidance to Step 1 for safe exploration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added info block about testing in Plan Mode before execution - Included link to Plan Mode Guide - Added Shift+Tab shortcut reminder - Provided example prompt for testing without making changes - Mirrors the pattern used in Snyk guide for consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/guides/netlify-mcp-continuous-deployment.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 40f25e6ca..fc3d109b7 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -97,6 +97,13 @@ cn "Show my site's Core Web Vitals and build times" ``` + + **Test in Plan Mode First**: Before making performance optimizations that might affect your site, + test your prompts in plan mode (see the [Plan Mode Guide](/guides/plan-mode-guide); press **Shift+Tab** to switch modes). This shows you + what the agent will do without executing it. For example: + `"Set up A/B testing between main and feature branch with performance monitoring"` + + Netlify automatically tracks: - **Build Performance**: Compile times, cache hits From fa155fa13cbc9b72b597582525135fb07c031c8a Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:18:56 -0700 Subject: [PATCH 12/25] docs: change Plan Mode block from Info to Tip for better visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed from to component for colored box styling - Matches the visual style of other tip boxes in the guide - Provides better visual hierarchy and draws attention - Consistent with the comprehensive setup tip in Step 6 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/guides/netlify-mcp-continuous-deployment.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index fc3d109b7..0167af101 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -97,12 +97,12 @@ cn "Show my site's Core Web Vitals and build times" ``` - + **Test in Plan Mode First**: Before making performance optimizations that might affect your site, test your prompts in plan mode (see the [Plan Mode Guide](/guides/plan-mode-guide); press **Shift+Tab** to switch modes). This shows you what the agent will do without executing it. For example: `"Set up A/B testing between main and feature branch with performance monitoring"` - + Netlify automatically tracks: From 42d40aaf3a2fd9afee44bfd42865f879c77aa85a Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:21:21 -0700 Subject: [PATCH 13/25] docs: clarify Netlify Analytics Pro requirements and update language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed "Enable" to "Configure" to avoid implying instant activation - Added note that Netlify Analytics Pro requires paid account ($19/month) - Included guidance for free tier users to focus on custom solutions - Updated prompt language to be more accurate about setup vs enablement - Added warning box to clearly communicate pricing requirements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/guides/netlify-mcp-continuous-deployment.mdx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 0167af101..c9ad249d7 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -271,11 +271,11 @@ Leverage Netlify's built-in analytics and integrate advanced RUM solutions: # In cn TUI mode: "Set up comprehensive Real User Monitoring for my Netlify site: -1. Enable Netlify Analytics Pro: - - Activate server-side analytics (no JS required) +1. Configure Netlify Analytics Pro (requires Pro account): + - Set up server-side analytics (no JS required) - Track Core Web Vitals (LCP, FID, CLS, INP) - Monitor top pages by performance score - - Set up custom performance alerts + - Create custom performance alerts - Configure weekly performance reports 2. Integrate Web Vitals tracking: @@ -306,6 +306,12 @@ Leverage Netlify's built-in analytics and integrate advanced RUM solutions: Show me the complete implementation with all code and configurations" ``` + + **Note**: Netlify Analytics Pro requires a paid Netlify Pro account ($19/month per site). + The prompt above assumes you have this plan. For free tier users, focus on steps 2-5 which + use Netlify Functions and Edge Functions to build custom analytics. + + **Netlify Analytics Advantages**: - [Server-side Analytics](https://docs.netlify.com/analytics/get-started/) - No client-side JavaScript needed From e0b4f9e9c00eba1cbac3e891a3872fb54c67897b Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 05:27:02 -0700 Subject: [PATCH 14/25] docs: fix broken link to PostHog guide - Update link from non-existent posthog-mcp-product-engineer-cookbook - Point to existing posthog-github-continuous-ai guide - Maintain context about enhanced analytics workflow Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/netlify-mcp-continuous-deployment.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index c9ad249d7..aa1ee46d5 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -131,7 +131,7 @@ Report winner based on performance + conversion metrics" **Enhanced Analytics**: Combine Netlify's A/B testing with PostHog session recordings to understand not just which variant performs better, but why users behave differently. - See our [PostHog MCP guide](/guides/posthog-mcp-product-engineer-cookbook) to set up + See our [PostHog session analysis guide](/guides/posthog-github-continuous-ai) to set up session tracking and create a complete continuous AI analytics workflow. From 3c6cc0b43571d4d68e5f162c271dd58a63a54709 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 06:33:35 -0700 Subject: [PATCH 15/25] =?UTF-8?q?fix:=20switch=20=E2=9C=85=20to=20cards?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../netlify-mcp-continuous-deployment.mdx | 201 +++++++++--------- 1 file changed, 106 insertions(+), 95 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index aa1ee46d5..c94a44267 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -20,12 +20,14 @@ sidebarTitle: "Using Netlify MCP for Performance Optimization" - [Identity](https://docs.netlify.com/visitor-access/identity/) for user authentication - [Large Media](https://docs.netlify.com/large-media/overview/) for Git LFS support - This guide shows you how to leverage these features through natural language with Continue CLI! +This guide shows you how to leverage these features through natural language with Continue CLI! + ## What You'll Learn This cookbook teaches you to: + - Run [A/B tests](https://docs.netlify.com/site-deploys/split-testing/) between branches to measure performance impact - Monitor [Core Web Vitals](https://docs.netlify.com/analytics/get-started/#core-web-vitals) and build performance metrics - Automatically block deploys that degrade performance using [Deploy Contexts](https://docs.netlify.com/site-deploys/overview/#deploy-contexts) @@ -49,12 +51,12 @@ This cookbook teaches you to: ``` - - 1. Install Netlify CLI: `npm i -g netlify-cli` - 2. Authenticate with Netlify: `netlify login` - 3. Visit [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) - 4. Follow the configuration instructions for your editor - + + 1. Install Netlify CLI: `npm i -g netlify-cli` 2. Authenticate with Netlify: + `netlify login` 3. Visit [Netlify MCP on Continue + Hub](https://hub.continue.dev/netlify/netlify-mcp) 4. Follow the configuration + instructions for your editor + Install the [Netlify Development Rules](https://hub.continue.dev/netlify/netlify-development) bundle for best practices: @@ -62,6 +64,7 @@ This cookbook teaches you to: 1. Visit the bundle page on Continue Hub 2. Click **"Install Rules"** 3. Rules automatically apply to your agent + @@ -72,15 +75,14 @@ This cookbook teaches you to: # Then in TUI mode: "Check my Netlify auth and list sites" ``` + - The Netlify Development Rules bundle includes guardrails for: - - Proper `.gitignore` configuration - - Function structure and placement - - Edge function constraints - - Local development best practices + The Netlify Development Rules bundle includes guardrails for: - Proper + `.gitignore` configuration - Function structure and placement - Edge function + constraints - Local development best practices ## Performance Optimization Steps @@ -98,17 +100,17 @@ cn ``` - **Test in Plan Mode First**: Before making performance optimizations that might affect your site, - test your prompts in plan mode (see the [Plan Mode Guide](/guides/plan-mode-guide); press **Shift+Tab** to switch modes). This shows you - what the agent will do without executing it. For example: - `"Set up A/B testing between main and feature branch with performance monitoring"` + **Test in Plan Mode First**: Before making performance optimizations that + might affect your site, test your prompts in plan mode (see the [Plan Mode + Guide](/guides/plan-mode-guide); press **Shift+Tab** to switch modes). This + shows you what the agent will do without executing it. For example: `"Set up + A/B testing between main and feature branch with performance monitoring"` - Netlify automatically tracks: - - **Build Performance**: Compile times, cache hits - - **Runtime Performance**: Core Web Vitals, Time to Interactive - - **Resource Usage**: Bandwidth, function execution times + Netlify automatically tracks: - **Build Performance**: Compile times, cache + hits - **Runtime Performance**: Core Web Vitals, Time to Interactive - + **Resource Usage**: Bandwidth, function execution times ### Step 2: A/B Test Branch Performance @@ -129,10 +131,11 @@ Report winner based on performance + conversion metrics" ``` - **Enhanced Analytics**: Combine Netlify's A/B testing with PostHog session recordings - to understand not just which variant performs better, but why users behave differently. - See our [PostHog session analysis guide](/guides/posthog-github-continuous-ai) to set up - session tracking and create a complete continuous AI analytics workflow. + **Enhanced Analytics**: Combine Netlify's A/B testing with PostHog session + recordings to understand not just which variant performs better, but why users + behave differently. See our [PostHog session analysis + guide](/guides/posthog-github-continuous-ai) to set up session tracking and + create a complete continuous AI analytics workflow. ### Step 3: Advanced Build Optimization with Netlify @@ -172,7 +175,8 @@ Show me the netlify.toml configuration and explain each optimization" - [Conditional Builds](https://docs.netlify.com/configure-builds/ignore-builds/) - Skip unnecessary builds - [Monorepo Support](https://docs.netlify.com/configure-builds/monorepos/) - Optimize multi-package repos - These features can reduce build times by 50-70% for most projects! +These features can reduce build times by 50-70% for most projects! + ### Step 4: Bundle Analysis with Netlify's Built-in Tools @@ -209,11 +213,15 @@ Generate a full report with before/after bundle sizes" ``` - **Features Available Through Netlify MCP**: - - [Bundle Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/) - Visualize your JavaScript bundles - - [Asset Optimization](https://docs.netlify.com/configure-builds/post-processing/) - Automatic minification and compression - - [Edge Network](https://docs.netlify.com/platform/edge-network/) - Global CDN with smart caching - - [Deploy Previews](https://docs.netlify.com/site-deploys/deploy-previews/) - Test optimizations before production + **Features Available Through Netlify MCP**: - [Bundle + Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/) + - Visualize your JavaScript bundles - [Asset + Optimization](https://docs.netlify.com/configure-builds/post-processing/) - + Automatic minification and compression - [Edge + Network](https://docs.netlify.com/platform/edge-network/) - Global CDN with + smart caching - [Deploy + Previews](https://docs.netlify.com/site-deploys/deploy-previews/) - Test + optimizations before production ### Step 5: Image Optimization @@ -243,7 +251,7 @@ Set and enforce performance budgets with automated testing: "Set up Lighthouse CI with performance budgets for my Netlify site: Requirements: -- LCP must be < 2.5 seconds +- LCP must be < 2.5 seconds - JavaScript bundle must be < 200KB - Total size < 500KB - Performance score >= 90 @@ -259,8 +267,9 @@ Please configure the complete Lighthouse CI setup with these budgets." ``` - This comprehensive setup will automatically test every deploy preview and - production deployment, blocking any changes that violate your performance budgets. + This comprehensive setup will automatically test every deploy preview and + production deployment, blocking any changes that violate your performance + budgets. ### Step 7: Real User Monitoring with Netlify Analytics @@ -307,9 +316,10 @@ Show me the complete implementation with all code and configurations" ``` - **Note**: Netlify Analytics Pro requires a paid Netlify Pro account ($19/month per site). - The prompt above assumes you have this plan. For free tier users, focus on steps 2-5 which - use Netlify Functions and Edge Functions to build custom analytics. + **Note**: Netlify Analytics Pro requires a paid Netlify Pro account ($19/month + per site). The prompt above assumes you have this plan. For free tier users, + focus on steps 2-5 which use Netlify Functions and Edge Functions to build + custom analytics. @@ -320,23 +330,21 @@ Show me the complete implementation with all code and configurations" - [Edge Insights](https://docs.netlify.com/edge-functions/overview/#geolocation) - Geographic performance data - [No Cookie Banner Required](https://docs.netlify.com/analytics/get-started/#privacy) - GDPR compliant by default - Unlike Google Analytics, Netlify Analytics: - - Doesn't slow down your site (server-side) - - Captures 100% of traffic (no ad blockers) - - Respects user privacy (no cookies) - - Shows bot traffic separately +Unlike Google Analytics, Netlify Analytics: + +- Doesn't slow down your site (server-side) +- Captures 100% of traffic (no ad blockers) +- Respects user privacy (no cookies) +- Shows bot traffic separately - **Pro Tip**: Combine Netlify Analytics with Edge Functions to create a powerful RUM solution that: - - Tracks performance by user segment - - A/B tests performance optimizations - - Personalizes content based on connection speed - - Automatically serves lighter assets to slow connections + **Pro Tip**: Combine Netlify Analytics with Edge Functions to create a + powerful RUM solution that: - Tracks performance by user segment - A/B tests + performance optimizations - Personalizes content based on connection speed - + Automatically serves lighter assets to slow connections - - ## Automated Performance Checks ### GitHub Actions Performance Guard @@ -356,7 +364,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '22' + node-version: "22" - name: Deploy and Test Performance id: perf @@ -406,10 +414,9 @@ jobs: ``` - This workflow will: - - **Block merge** if performance score drops >10 points - - **Warn** on any performance regression - - **Celebrate** improvements with green indicators + This workflow will: - **Block merge** if performance score drops >10 points - + **Warn** on any performance regression - **Celebrate** improvements with green + indicators ## Performance Testing Locally @@ -445,22 +452,21 @@ Identify and fix performance bottlenecks: ### Performance Issue Quick Fixes -| Issue | Quick Fix Command (in cn TUI) | -|-------|--------------------------------| -| Slow LCP | `"Preload critical resources"` | -| High CLS | `"Add size attributes to images"` | -| Large bundles | `"Implement code splitting"` | -| Slow builds | `"Enable build caching"` | -| Poor caching | `"Configure cache headers"` | +| Issue | Quick Fix Command (in cn TUI) | +| ------------- | --------------------------------- | +| Slow LCP | `"Preload critical resources"` | +| High CLS | `"Add size attributes to images"` | +| Large bundles | `"Implement code splitting"` | +| Slow builds | `"Enable build caching"` | +| Poor caching | `"Configure cache headers"` | ## What You've Accomplished - You've built an AI-powered performance optimization system that: - - Automatically monitors Core Web Vitals - - Runs A/B tests between branches - - Blocks deployments that degrade performance - - Provides actionable optimization suggestions + You've built an AI-powered performance optimization system that: - + Automatically monitors Core Web Vitals - Runs A/B tests between branches - + Blocks deployments that degrade performance - Provides actionable optimization + suggestions ## Discover Netlify's Hidden Performance Gems @@ -476,21 +482,18 @@ Features many developers don't know Netlify offers: - Personalize content without client-side JS - - **[Netlify Graph](https://docs.netlify.com/graph/overview/)** - - Unified GraphQL gateway for all your APIs - - Automatic TypeScript generation - - Built-in authentication handling - - Zero client-side API keys needed - + + **[Netlify Graph](https://docs.netlify.com/graph/overview/)** - Unified + GraphQL gateway for all your APIs - Automatic TypeScript generation - Built-in + authentication handling - Zero client-side API keys needed + - - **[On-Demand Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** - - Generate pages only when requested - - Cache dynamically generated content - - Perfect for large sites (10k+ pages) - - Reduce build times dramatically - + + **[On-Demand + Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** - + Generate pages only when requested - Cache dynamically generated content - + Perfect for large sites (10k+ pages) - Reduce build times dramatically + **[Background Functions](https://docs.netlify.com/functions/background-functions/)** @@ -512,39 +515,47 @@ Features many developers don't know Netlify offers: The Netlify Performance Rules enforce: -✅ **Build Optimization** -- Dependency caching enabled -- Parallel builds when possible -- Incremental compilation -- Smart cache invalidation + + + - Dependency caching enabled + - Parallel builds when possible + - Incremental compilation + - Smart cache invalidation + -✅ **Runtime Performance** -- Automatic image optimization -- Efficient resource hints (preload, prefetch) -- Optimal cache headers -- CDN configuration + + - Automatic image optimization + - Efficient resource hints (preload, prefetch) + - Optimal cache headers + - CDN configuration + -✅ **Monitoring Standards** -- Performance budgets enforced -- Core Web Vitals tracking -- Real user monitoring -- Automated alerts + + - Performance budgets enforced + - Core Web Vitals tracking + - Real user monitoring + - Automated alerts + + ## Advanced Performance Strategies ### Progressive Enhancement + ```bash # In cn TUI mode: "Implement progressive enhancement with basic HTML first" ``` ### Multi-variant Testing + ```bash # In cn TUI mode: "Test 3 bundle strategies and auto-select winner" ``` ### Predictive Prefetching + ```bash # In cn TUI mode: "Analyze navigation patterns and prefetch next pages" @@ -562,4 +573,4 @@ The Netlify Performance Rules enforce: - [Netlify MCP on Continue Hub](https://hub.continue.dev/netlify/netlify-mcp) - [Core Web Vitals Guide](https://web.dev/vitals/) - [Netlify Analytics Documentation](https://docs.netlify.com/analytics/) -- [Continue Performance Guides](https://docs.continue.dev/guides) \ No newline at end of file +- [Continue Performance Guides](https://docs.continue.dev/guides) From 68d355b4a4512dc8918bec75ba0b4182003c5b4b Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 19 Sep 2025 06:44:27 -0700 Subject: [PATCH 16/25] docs: Add Netlify build optimization guide link to cookbook - Added community support guide link to Step 3 of the Netlify performance cookbook - Positioned as a prompt discovery tool to inspire additional optimization scenarios - Included example prompts for common build optimization tasks like skipping Dependabot PRs - Updated SSG comparison example to use Astro and Hugo instead of Hugo and Gatsby Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/netlify-mcp-continuous-deployment.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index c94a44267..de4d301e0 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -179,6 +179,19 @@ These features can reduce build times by 50-70% for most projects! + + **Discover more optimization prompts!** The Netlify community has documented dozens of build optimization strategies in their [Support Guide: How can I optimize my Netlify build time](https://answers.netlify.com/t/support-guide-how-can-i-optimize-my-netlify-build-time/3907). + + Use this guide as inspiration for cn CLI prompts not covered in this cookbook, such as: + - `"Configure my builds to skip Dependabot PRs automatically"` + - `"Set up custom ignore patterns for documentation-only changes"` + - `"Optimize my Contentful webhooks to prevent duplicate builds"` + - `"Show me how to use build hooks instead of automatic git triggers"` + - `"Help me choose between Astro and Hugo based on build performance"` + + The community guide contains real-world scenarios that you can turn into AI-assisted solutions - just describe what you want to achieve and let cn CLI handle the implementation! + + ### Step 4: Bundle Analysis with Netlify's Built-in Tools Use Netlify's bundle analyzer and optimization features: From e5905aaeeaac1adbf220a7357c0cba37011a0faf Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 22 Sep 2025 22:31:14 -0700 Subject: [PATCH 17/25] Update docs/guides/netlify-mcp-continuous-deployment.mdx Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com> --- docs/guides/netlify-mcp-continuous-deployment.mdx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index de4d301e0..a71080879 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -108,9 +108,13 @@ cn - Netlify automatically tracks: - **Build Performance**: Compile times, cache - hits - **Runtime Performance**: Core Web Vitals, Time to Interactive - - **Resource Usage**: Bandwidth, function execution times + + Netlify automatically tracks: + - **Build Performance**: Compile times, cache + hits + - **Runtime Performance**: Core Web Vitals, Time to Interactive + - **Resource Usage**: Bandwidth, function execution times + ### Step 2: A/B Test Branch Performance From 827da231cb9cdbe68a82fa0bd31d4284a4fee4b1 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 22 Sep 2025 22:31:59 -0700 Subject: [PATCH 18/25] Update docs/guides/netlify-mcp-continuous-deployment.mdx Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com> --- .../netlify-mcp-continuous-deployment.mdx | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index a71080879..3c9c2138a 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -230,15 +230,20 @@ Generate a full report with before/after bundle sizes" ``` - **Features Available Through Netlify MCP**: - [Bundle - Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/) - - Visualize your JavaScript bundles - [Asset - Optimization](https://docs.netlify.com/configure-builds/post-processing/) - - Automatic minification and compression - [Edge - Network](https://docs.netlify.com/platform/edge-network/) - Global CDN with - smart caching - [Deploy - Previews](https://docs.netlify.com/site-deploys/deploy-previews/) - Test - optimizations before production + + **Features Available Through Netlify MCP**: + - [Bundle + Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/): Visualize your JavaScript bundles + - [Asset + Optimization](https://docs.netlify.com/configure-builds/post-processing/): + Automatic minification and compression + - [Edge + Network](https://docs.netlify.com/platform/edge-network/): Global CDN with + smart caching + - [Deploy + Previews](https://docs.netlify.com/site-deploys/deploy-previews/): Test + optimizations before production + ### Step 5: Image Optimization From 2a9ee315463c406d3551bb4e803d896951b90eca Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 22 Sep 2025 22:32:08 -0700 Subject: [PATCH 19/25] Update docs/guides/netlify-mcp-continuous-deployment.mdx Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com> --- docs/guides/netlify-mcp-continuous-deployment.mdx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 3c9c2138a..6b8fbca26 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -361,10 +361,16 @@ Unlike Google Analytics, Netlify Analytics: - **Pro Tip**: Combine Netlify Analytics with Edge Functions to create a - powerful RUM solution that: - Tracks performance by user segment - A/B tests - performance optimizations - Personalizes content based on connection speed - - Automatically serves lighter assets to slow connections + + **Pro Tip** + Combine Netlify Analytics with Edge Functions to create a + powerful RUM solution that: + - Tracks performance by user segment + - A/B tests + performance optimizations + - Personalizes content based on connection speed + - Automatically serves lighter assets to slow connections + ## Automated Performance Checks From 60485499559c07b6fe0d4d1473e00ad64f52abef Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 22 Sep 2025 22:32:17 -0700 Subject: [PATCH 20/25] Update docs/guides/netlify-mcp-continuous-deployment.mdx Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com> --- docs/guides/netlify-mcp-continuous-deployment.mdx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 6b8fbca26..5e93ef093 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -491,10 +491,14 @@ Identify and fix performance bottlenecks: ## What You've Accomplished - You've built an AI-powered performance optimization system that: - - Automatically monitors Core Web Vitals - Runs A/B tests between branches - - Blocks deployments that degrade performance - Provides actionable optimization - suggestions + + You've built an AI-powered performance optimization system that: + - Automatically monitors Core Web Vitals + - Runs A/B tests between branches + - Blocks deployments that degrade performance + - Provides actionable optimization + suggestions + ## Discover Netlify's Hidden Performance Gems From b08cd23832a91f1bc4dc32c7321506dbac9825c5 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 22 Sep 2025 22:32:25 -0700 Subject: [PATCH 21/25] Update docs/guides/netlify-mcp-continuous-deployment.mdx Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com> --- docs/guides/netlify-mcp-continuous-deployment.mdx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 5e93ef093..0f80c5556 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -507,11 +507,13 @@ Features many developers don't know Netlify offers: - **[Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/)** - - Run code at the edge, closer to users - - Transform responses on-the-fly - - A/B test at the edge level - - Personalize content without client-side JS + + **[Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/)** + - Run code at the edge, closer to users + - Transform responses on-the-fly + - A/B test at the edge level + - Personalize content without client-side JS + From 4e3eacb323f065829b7348212c402289731683c7 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 22 Sep 2025 22:32:38 -0700 Subject: [PATCH 22/25] Update docs/guides/netlify-mcp-continuous-deployment.mdx Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com> --- docs/guides/netlify-mcp-continuous-deployment.mdx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index 0f80c5556..b16c8d5f3 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -517,9 +517,13 @@ Features many developers don't know Netlify offers: - **[Netlify Graph](https://docs.netlify.com/graph/overview/)** - Unified - GraphQL gateway for all your APIs - Automatic TypeScript generation - Built-in - authentication handling - Zero client-side API keys needed + + **[Netlify Graph](https://docs.netlify.com/graph/overview/)** + - Unified GraphQL gateway for all your APIs + - Automatic TypeScript generation + - Built-in authentication handling + - Zero client-side API keys needed + From d4f20c3d65c03c710f9b12249a477b0e7370804a Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 22 Sep 2025 22:43:23 -0700 Subject: [PATCH 23/25] Update Netlify MCP deployment guide and add mintlify formatting rules Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .continue/rules/mintlify-formatting.md | 100 ++++++++++++++++++ .../netlify-mcp-continuous-deployment.mdx | 72 ++++++++----- 2 files changed, 145 insertions(+), 27 deletions(-) create mode 100644 .continue/rules/mintlify-formatting.md diff --git a/.continue/rules/mintlify-formatting.md b/.continue/rules/mintlify-formatting.md new file mode 100644 index 000000000..4df9bdb91 --- /dev/null +++ b/.continue/rules/mintlify-formatting.md @@ -0,0 +1,100 @@ +# Mintlify Documentation Formatting Rules + +## Component Formatting + +When working with Mintlify documentation components (Card, Info, Tip, Note, Warning, etc.), follow these formatting guidelines: + +### Bullet Points and Lists + +1. **Always add a blank line** after the opening component tag and before the closing tag +2. **Indent content** by 2 spaces within components +3. **Use proper list formatting** with each item on its own line: + - Start lists on a new line after introductory text + - Use `-` for unordered lists + - Maintain consistent indentation + +### Examples + +#### ✅ Correct Formatting: + +```mdx + + + This is the content with proper formatting: + - First bullet point + - Second bullet point + - Third bullet point + + +``` + +```mdx + + + Important information here: + - Point one + - Point two + - Point three + + +``` + +#### ❌ Incorrect Formatting: + +```mdx + + This is wrong: - All bullets - On one line - Bad formatting + +``` + +### Component-Specific Rules + +1. **Card Components**: Always include blank lines and proper indentation +2. **Info/Tip/Note/Warning**: Format lists as bullet points, not inline +3. **CardGroup**: Each Card within should follow the same formatting rules +4. **Code Blocks**: Within components, maintain proper indentation + +### Links in Lists + +When including links in bullet points: +```mdx +- [Link Text](url): Description of the link +``` + +### Nested Components + +For nested components, maintain proper indentation levels: +```mdx + + + + Content here: + - Bullet one + - Bullet two + + + + + + More content: + - Another bullet + - Final bullet + + + +``` + +## Application + +These rules apply to all `.mdx` files in the `docs/` directory, particularly: +- Guide documents +- Cookbook documents +- Reference documentation +- Any Mintlify-powered documentation + +## Automation Note + +When using Continue or other AI assistants to generate or modify documentation: +- Always format Mintlify components according to these rules +- Review generated content for proper formatting +- Apply these rules consistently across all documentation \ No newline at end of file diff --git a/docs/guides/netlify-mcp-continuous-deployment.mdx b/docs/guides/netlify-mcp-continuous-deployment.mdx index de4d301e0..71c127084 100644 --- a/docs/guides/netlify-mcp-continuous-deployment.mdx +++ b/docs/guides/netlify-mcp-continuous-deployment.mdx @@ -108,9 +108,12 @@ cn - Netlify automatically tracks: - **Build Performance**: Compile times, cache - hits - **Runtime Performance**: Core Web Vitals, Time to Interactive - - **Resource Usage**: Bandwidth, function execution times + + Netlify automatically tracks: + - **Build Performance**: Compile times, cache hits + - **Runtime Performance**: Core Web Vitals, Time to Interactive + - **Resource Usage**: Bandwidth, function execution times + ### Step 2: A/B Test Branch Performance @@ -226,15 +229,13 @@ Generate a full report with before/after bundle sizes" ``` - **Features Available Through Netlify MCP**: - [Bundle - Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/) - - Visualize your JavaScript bundles - [Asset - Optimization](https://docs.netlify.com/configure-builds/post-processing/) - - Automatic minification and compression - [Edge - Network](https://docs.netlify.com/platform/edge-network/) - Global CDN with - smart caching - [Deploy - Previews](https://docs.netlify.com/site-deploys/deploy-previews/) - Test - optimizations before production + + **Features Available Through Netlify MCP**: + - [Bundle Analyzer](https://docs.netlify.com/configure-builds/build-plugins/bundle-analyzer/): Visualize your JavaScript bundles + - [Asset Optimization](https://docs.netlify.com/configure-builds/post-processing/): Automatic minification and compression + - [Edge Network](https://docs.netlify.com/platform/edge-network/): Global CDN with smart caching + - [Deploy Previews](https://docs.netlify.com/site-deploys/deploy-previews/): Test optimizations before production + ### Step 5: Image Optimization @@ -352,10 +353,13 @@ Unlike Google Analytics, Netlify Analytics: - **Pro Tip**: Combine Netlify Analytics with Edge Functions to create a - powerful RUM solution that: - Tracks performance by user segment - A/B tests - performance optimizations - Personalizes content based on connection speed - - Automatically serves lighter assets to slow connections + + **Pro Tip**: Combine Netlify Analytics with Edge Functions to create a powerful RUM solution that: + - Tracks performance by user segment + - A/B tests performance optimizations + - Personalizes content based on connection speed + - Automatically serves lighter assets to slow connections + ## Automated Performance Checks @@ -381,6 +385,8 @@ jobs: - name: Deploy and Test Performance id: perf + # Note: These secrets are needed for direct Netlify API access in CI + # The Continue Hub manages authentication separately for interactive use env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} @@ -476,10 +482,13 @@ Identify and fix performance bottlenecks: ## What You've Accomplished - You've built an AI-powered performance optimization system that: - - Automatically monitors Core Web Vitals - Runs A/B tests between branches - - Blocks deployments that degrade performance - Provides actionable optimization - suggestions + + You've built an AI-powered performance optimization system that: + - Automatically monitors Core Web Vitals + - Runs A/B tests between branches + - Blocks deployments that degrade performance + - Provides actionable optimization suggestions + ## Discover Netlify's Hidden Performance Gems @@ -488,24 +497,33 @@ Features many developers don't know Netlify offers: + **[Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/)** - Run code at the edge, closer to users - Transform responses on-the-fly - A/B test at the edge level - Personalize content without client-side JS + - **[Netlify Graph](https://docs.netlify.com/graph/overview/)** - Unified - GraphQL gateway for all your APIs - Automatic TypeScript generation - Built-in - authentication handling - Zero client-side API keys needed + + **[Netlify Graph](https://docs.netlify.com/graph/overview/)** + - Unified GraphQL gateway for all your APIs + - Automatic TypeScript generation + - Built-in authentication handling + - Zero client-side API keys needed + - **[On-Demand - Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** - - Generate pages only when requested - Cache dynamically generated content - - Perfect for large sites (10k+ pages) - Reduce build times dramatically + + **[On-Demand Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** + - Generate pages only when requested + - Cache dynamically generated content + - Perfect for large sites (10k+ pages) + - Reduce build times dramatically + From 9818a8b5877a44ce91db7edbd6edc9d74b80da3f Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 22 Sep 2025 23:03:09 -0700 Subject: [PATCH 24/25] Add MDX files in docs folder to prettierignore Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index 51cd37d83..8867072b6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,6 +4,7 @@ binary/out binary/tmp core/.continue-test docs/.docusaurus +docs/**/*.mdx extensions/.continue-debug extensions/vscode/continue_rc_schema.json extensions/vscode/.vscode-test From 66d1cacc2b5f5dcdeffb375ebfed2812c7c73d2b Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 22 Sep 2025 23:11:35 -0700 Subject: [PATCH 25/25] Add mintlify-formatting.md to prettierignore Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index 8867072b6..cd8b968db 100644 --- a/.prettierignore +++ b/.prettierignore @@ -18,6 +18,7 @@ extensions/vscode/models extensions/intellij/src/main/resources gui/dist **/.continueignore +.continue/rules/mintlify-formatting.md CHANGELOG.md **/continue_tutorial.py **/node_modules