Changesets · Branches · Tags · Compare
| Changeset | 66b78cf96160f7d454f85db0bce53dad80193ac84f21d10e5caecb867c68a8f8 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-25 16:36 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-25 16:36 -07:00 |
| Parents | 37fdf55a6cac, c977fe2591e2 |
11 files changed
modified docs/docs.json +1 −1
| @@ -239,7 +239,6 @@ | ||
| 239 | 239 | "guides/codebase-documentation-awareness", |
| 240 | 240 | "guides/cli", |
| 241 | 241 | "guides/continuous-ai", |
| 242 | - "guides/snyk-mcp-continue-cookbook", | |
| 243 | 242 | "guides/continuous-ai-readiness-assessment", |
| 244 | 243 | "guides/plan-mode-guide", |
| 245 | 244 | "guides/ollama-guide", |
| @@ -254,6 +253,7 @@ | ||
| 254 | 253 | "icon": "book-open-cover", |
| 255 | 254 | "pages": [ |
| 256 | 255 | "guides/posthog-github-continuous-ai", |
| 256 | + "guides/snyk-mcp-continue-cookbook", | |
| 257 | 257 | "guides/netlify-mcp-continuous-deployment" |
| 258 | 258 | ] |
| 259 | 259 | } |
modified docs/guides/netlify-mcp-continuous-deployment.mdx +123 −22
| @@ -44,18 +44,82 @@ | ||
| 44 | 44 | |
| 45 | 45 | ## Quick Setup |
| 46 | 46 | |
| 47 | +<Info> | |
| 48 | + The Netlify Development Rules bundle includes guardrails for: | |
| 49 | + - Proper `.gitignore` configuration | |
| 50 | + - Function structure and placement | |
| 51 | + - Edge function constraints | |
| 52 | + - Local development best practices | |
| 53 | + | |
| 54 | +</Info> | |
| 55 | +For all options, first: | |
| 47 | 56 | <Steps> |
| 48 | - <Step title="Install Continue CLI"> | |
| 57 | +<Step title="Install Continue CLI"> | |
| 49 | 58 | ```bash |
| 50 | 59 | npm i -g @continuedev/cli |
| 51 | 60 | ``` |
| 52 | 61 | </Step> |
| 53 | 62 | |
| 63 | +<Step title="Install Netlify CLI"> | |
| 64 | + | |
| 65 | + 1. Install Netlify CLI: `npm i -g netlify-cli` | |
| 66 | + 2. Authenticate with Netlify: | |
| 67 | + `netlify login` | |
| 68 | + </Step> | |
| 69 | +</Steps> | |
| 70 | + | |
| 71 | +## Netlify Continuous AI Workflow Options | |
| 72 | + | |
| 73 | +<Card title="🚀 Fastest Path to Success" icon="zap"> | |
| 74 | + Skip the manual setup and use our pre-built Netlify Continuous AI agent that includes | |
| 75 | + optimized prompts, rules, and the Netlify MCP for more consistent results. | |
| 76 | +</Card> | |
| 77 | + | |
| 78 | +After completing **Quick Setup** above, you have two paths to get started: | |
| 79 | + | |
| 80 | +<Tabs> | |
| 81 | + <Tab title="⚡ Quick Start (Recommended)"> | |
| 82 | + | |
| 83 | + <Steps> | |
| 84 | + <Step title="Add the Pre-Built Agent"> | |
| 85 | + Visit the [Netlify Continuous AI Agent](https://hub.continue.dev/continuedev/netlify-continuous-ai) on Continue Hub and click **"Install Agent"** | |
| 86 | + | |
| 87 | + This agent includes: | |
| 88 | + - **Optimized prompts** for Netlify deployment and performance analysis | |
| 89 | + - **Built-in rules** for consistent formatting and error handling | |
| 90 | + - **Netlify MCP** for more reliable API interactions | |
| 91 | + </Step> | |
| 92 | + | |
| 93 | + <Step title="Verify Your Setup"> | |
| 94 | + The agent uses the Netlify MCP automatically and includes best practice rules for deployment and performance optimization. | |
| 95 | + </Step> | |
| 96 | + | |
| 97 | + <Step title="Run Performance Analysis"> | |
| 98 | + Navigate to your project directory and run: | |
| 99 | + ```bash | |
| 100 | + cn "Analyze my Netlify site's performance and optimize it for better Core Web Vitals." | |
| 101 | + ``` | |
| 102 | + | |
| 103 | + That's it! The agent handles everything automatically. | |
| 104 | + </Step> | |
| 105 | + </Steps> | |
| 106 | + | |
| 107 | + <Info> | |
| 108 | + **Why Use the Agent?** Results are more consistent and debugging is easier thanks to the Netlify MCP integration and pre-tested prompts. You can remix the agent later to customize it to your needs. | |
| 109 | + </Info> | |
| 110 | + | |
| 111 | + </Tab> | |
| 112 | + | |
| 113 | + <Tab title="🛠️ Manual Setup"> | |
| 114 | +<Steps> | |
| 115 | + | |
| 54 | 116 | <Step title="Configure Netlify MCP"> |
| 55 | - 1. Install Netlify CLI: `npm i -g netlify-cli` 2. Authenticate with Netlify: | |
| 56 | - `netlify login` 3. Visit [Netlify MCP on Continue | |
| 57 | - Hub](https://hub.continue.dev/netlify/netlify-mcp) 4. Follow the configuration | |
| 58 | - instructions for your editor | |
| 117 | + 1. Authenticate with Netlify: | |
| 118 | + `netlify login` | |
| 119 | + 2. Visit [Netlify MCP on Continue | |
| 120 | + Hub](https://hub.continue.dev/netlify/netlify-mcp) | |
| 121 | + 3. Follow the configuration instructions for your editor | |
| 122 | + | |
| 59 | 123 | </Step> |
| 60 | 124 | |
| 61 | 125 | <Step title="Add Development Rules"> |
| @@ -77,13 +141,26 @@ | ||
| 77 | 141 | ``` |
| 78 | 142 | |
| 79 | 143 | </Step> |
| 80 | -</Steps> | |
| 81 | 144 | |
| 82 | -<Info> | |
| 83 | - The Netlify Development Rules bundle includes guardrails for: - Proper | |
| 84 | - `.gitignore` configuration - Function structure and placement - Edge function | |
| 85 | - constraints - Local development best practices | |
| 86 | -</Info> | |
| 145 | + | |
| 146 | +</Steps> | |
| 147 | + <Info> | |
| 148 | + You're all set! Now you can use cn CLI to interact with Netlify using natural language prompts. Check out the examples below to get started. | |
| 149 | + </Info> | |
| 150 | + </Tab> | |
| 151 | +</Tabs> | |
| 152 | + | |
| 153 | +<Accordion title="Agent Requirements"> | |
| 154 | + To use the pre-built agent, you need either: | |
| 155 | + - **Continue CLI Pro Plan** with | |
| 156 | + the models add-on, OR | |
| 157 | + - **Your own API keys** added to Continue Hub secrets | |
| 158 | + The agent will automatically detect and use your | |
| 159 | + configuration along with the Netlify MCP for deployment operations. | |
| 160 | + | |
| 161 | +</Accordion> | |
| 162 | + | |
| 163 | +--- | |
| 87 | 164 | |
| 88 | 165 | ## Performance Optimization Steps |
| 89 | 166 | |
| @@ -375,6 +452,14 @@ | ||
| 375 | 452 | |
| 376 | 453 | ## Automated Performance Checks |
| 377 | 454 | |
| 455 | +### Add GitHub Secrets | |
| 456 | + | |
| 457 | +Navigate to **Repository Settings → Secrets and variables → Actions** and add: | |
| 458 | + | |
| 459 | +- `CONTINUE_API_KEY`: Your Continue API key from [hub.continue.dev/settings/api-keys](https://hub.continue.dev/settings/api-keys) | |
| 460 | +- `NETLIFY_AUTH_TOKEN`: Your Netlify personal access token | |
| 461 | +- `NETLIFY_SITE_ID`: Your Netlify site ID | |
| 462 | + | |
| 378 | 463 | ### GitHub Actions Performance Guard |
| 379 | 464 | |
| 380 | 465 | Block PRs that degrade performance: |
| @@ -394,17 +479,28 @@ | ||
| 394 | 479 | with: |
| 395 | 480 | node-version: "22" |
| 396 | 481 | |
| 482 | + - name: Install Continue CLI | |
| 483 | + run: | | |
| 484 | + npm install -g @continuedev/cli | |
| 485 | + echo "✅ Continue CLI installed" | |
| 486 | + | |
| 487 | + - name: Authenticate Continue CLI | |
| 488 | + env: | |
| 489 | + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} | |
| 490 | + run: | | |
| 491 | + cn auth login --api-key "$CONTINUE_API_KEY" | |
| 492 | + echo "✅ Continue CLI authenticated" | |
| 493 | + | |
| 397 | 494 | - name: Deploy and Test Performance |
| 398 | 495 | id: perf |
| 399 | 496 | env: |
| 400 | 497 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
| 401 | 498 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
| 402 | 499 | run: | |
| 403 | - npx @continuedev/cli@latest << 'EOF' | |
| 404 | - Deploy PR preview and run Lighthouse. | |
| 405 | - Compare scores with main branch. | |
| 406 | - Output JSON with score deltas. | |
| 407 | - EOF > performance.json | |
| 500 | + echo "🚀 Deploying PR preview and analyzing performance..." | |
| 501 | + cn -p "Deploy PR preview and run Lighthouse. | |
| 502 | + Compare scores with main branch. | |
| 503 | + Output JSON with score deltas." > performance.json | |
| 408 | 504 | |
| 409 | 505 | - name: Comment Performance Results |
| 410 | 506 | uses: actions/github-script@v7 |
| @@ -442,9 +538,11 @@ | ||
| 442 | 538 | ``` |
| 443 | 539 | |
| 444 | 540 | <Warning> |
| 445 | - This workflow will: - **Block merge** if performance score drops >10 points - | |
| 446 | - **Warn** on any performance regression - **Celebrate** improvements with green | |
| 447 | - indicators | |
| 541 | + This workflow will: | |
| 542 | + - **Block merge** if performance score drops >10 points | |
| 543 | + - **Warn** on any performance regression | |
| 544 | + - **Celebrate** improvements with green indicators | |
| 545 | + | |
| 448 | 546 | </Warning> |
| 449 | 547 | |
| 450 | 548 | ## Performance Testing Locally |
| @@ -528,9 +626,12 @@ | ||
| 528 | 626 | |
| 529 | 627 | <Card title="On-Demand Builders" icon="hammer"> |
| 530 | 628 | **[On-Demand |
| 531 | - Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** - | |
| 532 | - Generate pages only when requested - Cache dynamically generated content - | |
| 533 | - Perfect for large sites (10k+ pages) - Reduce build times dramatically | |
| 629 | + Builders](https://docs.netlify.com/configure-builds/on-demand-builders/)** | |
| 630 | + - Generate pages only when requested | |
| 631 | + - Cache dynamically generated content | |
| 632 | + - Perfect for large sites (10k+ pages) | |
| 633 | + - Reduce build times dramatically | |
| 634 | + | |
| 534 | 635 | </Card> |
| 535 | 636 | |
| 536 | 637 | <Card title="Netlify Functions" icon="function"> |
modified docs/guides/posthog-github-continuous-ai.mdx +109 −113
| @@ -1,23 +1,32 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | title: "Building a Continuous AI Workflow with PostHog and GitHub" |
| 3 | -description: "Build an automated system that continuously monitors PostHog session recordings, analyzes UX issues using Continue CLI, and creates GitHub issues automatically." | |
| 4 | -sidebarTitle: "PostHog Session Analysis with Continue CLI" | |
| 3 | +description: "Build an automated system that continuously monitors PostHog analytics, analyzes user behavior with AI, and creates GitHub issues automatically using PostHog MCP." | |
| 4 | +sidebarTitle: "PostHog Analytics with Continue CLI" | |
| 5 | 5 | --- |
| 6 | 6 | |
| 7 | 7 | <Card title="What You'll Build" icon="robot"> |
| 8 | - A fully automated workflow that uses Continue CLI to fetch PostHog session | |
| 9 | - data, analyze user experience issues with AI, and automatically create GitHub | |
| 10 | - issues with specific technical recommendations | |
| 8 | + A fully automated workflow that uses Continue CLI with the PostHog MCP to fetch analytics data, analyze user experience issues with AI, and automatically create GitHub | |
| 9 | + issues with the GitHub CLI. | |
| 11 | 10 | </Card> |
| 12 | 11 | |
| 12 | +## What You'll Learn | |
| 13 | + | |
| 14 | +This cookbook teaches you to: | |
| 15 | + | |
| 16 | +- Use [PostHog MCP](https://posthog.com/docs/model-context-protocol) to query [analytics](https://posthog.com/docs/web-analytics), [errors](https://posthog.com/docs/error-tracking), and [feature flags](https://posthog.com/docs/feature-flags) | |
| 17 | +- Analyze user behavior patterns with AI | |
| 18 | +- Automatically create GitHub issues using GitHub CLI | |
| 19 | +- Set up continuous monitoring with GitHub Actions | |
| 20 | + | |
| 13 | 21 | ## Prerequisites |
| 14 | 22 | |
| 15 | 23 | Before starting, ensure you have: |
| 16 | 24 | |
| 17 | 25 | - GitHub repository where you want to create issues |
| 18 | -- PostHog account with **[session recordings enabled and collecting data](https://posthog.com/docs/session-replay/installation)** | |
| 26 | +- [PostHog account](https://posthog.com) with [session recordings enabled](https://posthog.com/docs/session-replay/installation) and data collecting | |
| 19 | 27 | - Node.js 18+ installed locally |
| 20 | -- Continue CLI account with **active credits** (required for API usage) | |
| 28 | +- [Continue CLI](https://docs.continue.dev/guides/cli) with **active credits** (required for API usage) | |
| 29 | +- [GitHub CLI](https://cli.github.com/) installed (`gh` command) | |
| 21 | 30 | |
| 22 | 31 | <Steps> |
| 23 | 32 | <Step title="Install Continue CLI"> |
| @@ -66,39 +75,38 @@ | ||
| 66 | 75 | 7. Note your PostHog host URL (e.g., `https://us.posthog.com` or your custom domain) |
| 67 | 76 | 8. You'll also need your POSTHOG_AUTH_HEADER value, which is simply `Bearer YOUR_API_KEY` |
| 68 | 77 | |
| 69 | - <Tip> | |
| 70 | - **Find Your Project Details**: Your Project ID is in your PostHog URL: | |
| 71 | - `https://app.posthog.com/project/YOUR_PROJECT_ID` | |
| 72 | - </Tip> | |
| 78 | + <Info> | |
| 79 | + **Continue Secrets**: The `POSTHOG_AUTH_HEADER` secret should be stored in | |
| 80 | + Continue's secure secrets storage. This keeps your API key safe and the MCP | |
| 81 | + automatically connects to your default PostHog project. | |
| 82 | +</Info> | |
| 73 | 83 | |
| 74 | 84 | </Tab> |
| 75 | - <Tab title="GitHub Personal Access Token"> | |
| 76 | - You'll need a **Personal Access Token** to create issues in your GitHub repository: | |
| 77 | - | |
| 78 | - 1. Go to [GitHub Personal Access Tokens](https://github.com/settings/personal-access-tokens/new) | |
| 79 | - 2. Click **"Generate new token (classic)"** | |
| 80 | - 3. Name it "Continue CLI PostHog Analysis" | |
| 81 | - 4. Select these scopes: | |
| 82 | - - `repo` (or just `public_repo` if your repository is public) | |
| 83 | - - `issues:write` - **Required** for creating issues | |
| 84 | - 5. Copy the token immediately | |
| 85 | + <Tab title="Set Up GitHub CLI Authentication"> | |
| 86 | + GitHub CLI handles authentication automatically - no manual PAT needed: | |
| 85 | 87 | |
| 86 | - </Tab> | |
| 87 | -</Tabs> | |
| 88 | + 1. Install GitHub CLI if not already installed | |
| 89 | + 2. Run `gh auth login` and follow the prompts | |
| 90 | + 3. Choose authentication method (browser or token) | |
| 91 | + 4. Grant necessary permissions when prompted (`issues:write` is **required** for creating issues) | |
| 88 | 92 | |
| 89 | -### Add Secrets to Continue CLI | |
| 93 | + </Tab> | |
| 94 | +<Tab title= "Configure API Access in Continue CLI"> | |
| 95 | + | |
| 96 | +<Tip> | |
| 97 | +See https://docs.continue.dev/hub/secrets/secret-types#secret-types for adding secrets | |
| 98 | +</Tip> | |
| 90 | 99 | |
| 91 | -To add environment variables to your Continue Hub account: | |
| 100 | +You only need to configure the PostHog MCP credential - it automatically handles project selection. To add environment variables to your Continue Hub account: | |
| 92 | 101 | |
| 93 | 102 | 1. Go to the [Continue Hub](https://hub.continue.dev) |
| 94 | 103 | 2. Sign in to your account |
| 95 | 104 | 3. Navigate to your user settings |
| 96 | 105 | 4. Look for the "Secrets" section |
| 97 | -5. Add your variables there (like POSTHOG_API_KEY, POSTHOG_PROJECT_ID, | |
| 98 | - POSTHOG_HOST,GITHUB_PAT, etc.) | |
| 106 | +5. Add your Personal API Key from PostHog (phx_...) as POSTHOG_AUTH_HEADER secret with format: Bearer YOUR_API_KEY | |
| 99 | 107 | |
| 100 | -These environment variables will then be securely stored and available for use in | |
| 101 | -your Continue workflows. | |
| 108 | +</Tab> | |
| 109 | +</Tabs> | |
| 102 | 110 | |
| 103 | 111 | ## PostHog GitHub Continuous AI Workflow Options |
| 104 | 112 | |
| @@ -107,7 +115,17 @@ | ||
| 107 | 115 | optimized prompts, rules, and the PostHog MCP for more consistent results. |
| 108 | 116 | </Card> |
| 109 | 117 | |
| 110 | -After completing **Step 1** below, you have two paths to get started: | |
| 118 | +<Info> | |
| 119 | + **How PostHog MCP Works**: | |
| 120 | + - Your API key is tied to your PostHog account and | |
| 121 | + organization | |
| 122 | + - It automatically uses your default project (no project ID | |
| 123 | + needed) | |
| 124 | + - If you have multiple projects, use `mcp__posthog__switch-project` to | |
| 125 | + change | |
| 126 | + - The MCP connects via `https://mcp.posthog.com/sse` using your account context. | |
| 127 | + | |
| 128 | +</Info> | |
| 111 | 129 | |
| 112 | 130 | <Tabs> |
| 113 | 131 | <Tab title="⚡ Quick Start (Recommended)"> |
| @@ -115,20 +133,16 @@ | ||
| 115 | 133 | |
| 116 | 134 | <Steps> |
| 117 | 135 | <Step title="Add the Pre-Built Agent"> |
| 118 | - Visit the [PostHog GitHub Continuous AI Agent](https://hub.continue.dev/continuedev/awesome-models-posthog-gh) on Continue Hub and click **"Install Agent"** | |
| 136 | + Visit the [PostHog GitHub Continuous AI Agent](https://hub.continue.dev/continuedev/awesome-models-posthog-gh) on Continue Hub and click **"Install Agent"** or run: | |
| 137 | + | |
| 138 | + ```bash | |
| 139 | + cn --config continuedev/awesome-models-posthog-gh | |
| 140 | + ``` | |
| 119 | 141 | |
| 120 | 142 | This agent includes: |
| 121 | - - **Optimized prompts** for PostHog analysis and GitHub issue creation | |
| 122 | - - **Built-in rules** for consistent formatting and error handling | |
| 123 | - - **PostHog MCP** for more reliable API interactions | |
| 124 | - </Step> | |
| 125 | - | |
| 126 | - <Step title="Verify Your Secrets"> | |
| 127 | - The agent uses these Hub resources automatically: | |
| 128 | - - **Environment Variables**: [bekahhw/env-vars](https://hub.continue.dev/bekahhw/env-vars) | |
| 129 | - - **Analysis Rules**: [bekah-hawrot-weigel/posthog-github-continuous-ai-rules](https://hub.continue.dev/bekah-hawrot-weigel/posthog-github-continuous-ai-rules) | |
| 130 | - - **Analysis Prompt**: [continuedev/posthog-analysis](https://hub.continue.dev/continuedev/posthog-analysis) | |
| 131 | - - **Issue Creation Prompt**: [continuedev/github-issues](https://hub.continue.dev/continuedev/github-issues) | |
| 143 | + - **Optimized prompts** for [PostHog analysis](https://hub.continue.dev/continuedev/posthog-analysis) and [GitHub issue creation](https://hub.continue.dev/continuedev/posthog-github-issues) | |
| 144 | + - **[Built-in rules](https://hub.continue.dev/bekah-hawrot-weigel/posthog-github-continuous-ai-rules)** for consistent formatting and error handling | |
| 145 | + - **[PostHog MCP](https://hub.continue.dev/posthog/posthog-mcp)** for more reliable API interactions | |
| 132 | 146 | </Step> |
| 133 | 147 | |
| 134 | 148 | <Step title="Run the Analysis"> |
| @@ -148,72 +162,41 @@ | ||
| 148 | 162 | </Tab> |
| 149 | 163 | |
| 150 | 164 | <Tab title="🛠️ Manual Setup"> |
| 151 | - **Perfect for:** Learning the process and customizing prompts. | |
| 152 | - | |
| 153 | - Now you'll use Continue CLI to fetch PostHog session data and analyze it for UX issues. Continue CLI handles all the API calls and analysis automatically. | |
| 154 | - | |
| 155 | -### Run the PostHog Analysis | |
| 156 | - | |
| 157 | -Use this prompt with Continue CLI to fetch and analyze your PostHog sessions: | |
| 158 | - | |
| 159 | -```bash | |
| 160 | -cn -p "I need you to help me analyze PostHog session recordings to identify UX issues. Please: | |
| 161 | - | |
| 162 | -1. First, fetch session recordings from PostHog using these details: | |
| 163 | - - Use the POSTHOG_API_KEY, POSTHOG_PROJECT_ID, and POSTHOG_HOST from my secrets | |
| 164 | - - API endpoint: {POSTHOG_HOST}/api/projects/{POSTHOG_PROJECT_ID}/session_recordings/?limit=20 | |
| 165 | - - Include Authorization header: 'Bearer {POSTHOG_API_KEY}' | |
| 166 | - | |
| 167 | -2. Filter the sessions to find problematic ones with either: | |
| 168 | - - console_error_count > 0 (JavaScript errors) | |
| 169 | - - recording_duration > 300 (sessions longer than 5 minutes) | |
| 170 | - | |
| 171 | -3. Analyze the filtered sessions and create exactly 3 GitHub issues for the most critical UX problems. | |
| 172 | - | |
| 173 | -4. Format each issue like this: | |
| 174 | -### 1. **Issue Title Here** | |
| 175 | -**Problem**: One sentence describing the user problem | |
| 176 | -**Technical Causes**: Brief technical explanation | |
| 177 | -**Affected Pages**: List the URLs | |
| 178 | -**Recommended Fix**: | |
| 179 | -- Specific action item 1 | |
| 180 | -- Specific action item 2 | |
| 181 | -**Priority**: **HIGH** or **MEDIUM** or **LOW** | |
| 182 | -**Impact**: Quantify the impact (e.g., 'Affects 80% of sessions') | |
| 183 | - | |
| 184 | -Please make the API call, analyze the data, and provide the 3 formatted issues. Base all recommendations on actual patterns in the session data." | |
| 185 | -``` | |
| 186 | - | |
| 187 | -### Create GitHub Issues from PostHog Analysis | |
| 188 | - | |
| 189 | -Now use Continue CLI to create GitHub issues from your analysis results: | |
| 190 | - | |
| 191 | -```bash | |
| 192 | -cn -p "I have analyzed PostHog session data and identified UX issues. Now I need you to create GitHub issues using the GitHub API. | |
| 193 | - | |
| 194 | -Use these details from my secrets: | |
| 195 | -- GITHUB_PAT: My GitHub Personal Access Token | |
| 196 | -- Repository: Extract from git remote or ask me to specify | |
| 197 | - | |
| 198 | -For each issue in my analysis: | |
| 199 | -1. Parse the issue title, body content, and priority level | |
| 200 | -2. Create a GitHub issue via API POST to: https://api.github.com/repos/{owner}/{repo}/issues | |
| 201 | -3. Use these headers: | |
| 202 | - - Authorization: token {GITHUB_PAT} | |
| 203 | - - Accept: application/vnd.github.v3+json | |
| 204 | - - Content-Type: application/json | |
| 205 | -4. Set labels based on priority: | |
| 206 | - - HIGH: [\"bug\", \"high-priority\", \"user-experience\", \"automated\"] | |
| 207 | - - MEDIUM: [\"enhancement\", \"medium-priority\", \"user-experience\", \"automated\"] | |
| 208 | - - LOW: [\"low-priority\", \"user-experience\", \"automated\"] | |
| 209 | -5. Format the issue title as: \"🔍 UX Issue: {original title}\" | |
| 210 | - | |
| 211 | -Please create the GitHub issues and confirm they were successfully created with issue numbers and URLs. | |
| 212 | -" | |
| 213 | -``` | |
| 165 | + <Steps> | |
| 166 | + <Step title="Add PostHog MCP to Continue CLI"> | |
| 167 | + First, install the [PostHog MCP](https://hub.continue.dev/posthog/posthog-mcp) or run: | |
| 168 | + ```bash | |
| 169 | + npx -y mcp-remote@latest https://mcp.posthog.com/sse --header Authorization:${{ secrets.continuedev/awesome-models-posthog-gh/posthog/posthog-mcp/POSTHOG_AUTH_HEADER }} | |
| 170 | + ``` | |
| 171 | + </Step> | |
| 172 | + <Step title="Add PostHog + GitHub Analysis Rules"> | |
| 173 | + In the Continue Hub, add the [PostHog GitHub Continuous AI Rules](https://hub.continue.dev/bekah-hawrot-weigel/posthog-github-continuous-ai-rules) to your account for better formatting and error handling. | |
| 174 | + </Step> | |
| 175 | + <Step title="Create Your Custom Prompts"> | |
| 176 | + Use this prompt with Continue CLI to analyze PostHog data and create GitHub issues: | |
| 177 | + | |
| 178 | + ```bash | |
| 179 | + | |
| 180 | + # In cn TUI mode: | |
| 181 | + "Create GitHub issues from the PostHog analysis using gh CLI: | |
| 182 | + - For each issue, run: gh issue create --title '🔍 UX Issue: [title]' --body '[details]' | |
| 183 | + - Add labels: --label 'bug,user-experience,automated' | |
| 184 | + - Set priority labels (high/medium/low) | |
| 185 | + - Include session data and technical details in the body | |
| 186 | + Execute the commands and confirm each issue was created with URL." | |
| 187 | + ``` | |
| 188 | + </Step> | |
| 189 | +</Steps> | |
| 214 | 190 | |
| 215 | 191 | </Tab> |
| 216 | 192 | </Tabs> |
| 193 | +<Info> | |
| 194 | + | |
| 195 | + **Why GitHub CLI over GitHub MCP**: While GitHub MCP is available, it can be | |
| 196 | + token-expensive to run. The `gh` CLI is more efficient, requires no API tokens | |
| 197 | + (authenticated via `gh auth login`), and provides a cleaner command-line | |
| 198 | + experience. GitHub MCP remains an option if you prefer full MCP integration. | |
| 199 | +</Info> | |
| 217 | 200 | |
| 218 | 201 | <Accordion title="Agent Requirements"> |
| 219 | 202 | To use the pre-built agent, you need either: |
| @@ -492,16 +475,17 @@ | ||
| 492 | 475 | |
| 493 | 476 | <CardGroup cols={2}> |
| 494 | 477 | <Card title="Performance Analysis" icon="chart-line"> |
| 495 | - "Analyze PostHog performance metrics alongside session recordings to | |
| 496 | - identify slow page loads affecting user experience" | |
| 478 | + "Analyze [PostHog performance | |
| 479 | + metrics](https://posthog.com/docs/web-analytics) alongside session | |
| 480 | + recordings to identify slow page loads affecting user experience" | |
| 497 | 481 | </Card> |
| 498 | 482 | <Card title="Error Correlation" icon="bug"> |
| 499 | 483 | "Cross-reference JavaScript console errors with user actions to identify the |
| 500 | 484 | root cause of UX issues" |
| 501 | 485 | </Card> |
| 502 | 486 | <Card title="Feature Flag Analysis" icon="flag"> |
| 503 | - "Analyze how PostHog feature flags impact user behavior in session | |
| 504 | - recordings" | |
| 487 | + "Analyze how [PostHog feature flags](https://posthog.com/docs/feature-flags) | |
| 488 | + impact user behavior in session recordings" | |
| 505 | 489 | </Card> |
| 506 | 490 | <Card title="Custom Slack Alerts" icon="slack"> |
| 507 | 491 | "Create Slack alerts when critical UX issues are detected in PostHog |
| @@ -511,7 +495,19 @@ | ||
| 511 | 495 | |
| 512 | 496 | ## Next Steps |
| 513 | 497 | |
| 514 | -1. **Monitor your first issues** - Review the GitHub issues created and implement fixes | |
| 515 | -2. **Measure impact** - Track how resolved issues improve PostHog metrics | |
| 516 | -3. **Refine prompts** - Adjust the Continue CLI prompts based on issue quality | |
| 517 | -4. **Scale the system** - Add more data sources or create specialized analysis workflows | |
| 498 | +- Consider [GitHub MCP](https://hub.continue.dev/github/github-mcp) as an alternative (note: can be token-expensive) | |
| 499 | +- Configure [Slack MCP](https://hub.continue.dev/slack/slack-mcp) for alerts | |
| 500 | +- Set up [PostHog performance monitoring](https://posthog.com/docs/web-analytics) | |
| 501 | +- Join the [Continue Discord](https://discord.gg/continue) for support | |
| 502 | + | |
| 503 | +## Resources | |
| 504 | + | |
| 505 | +- [PostHog API Documentation](https://posthog.com/docs/api) | |
| 506 | +- [PostHog MCP Documentation](https://posthog.com/docs/model-context-protocol) | |
| 507 | +- [PostHog Session Replay](https://posthog.com/docs/session-replay) | |
| 508 | +- [PostHog Feature Flags](https://posthog.com/docs/feature-flags) | |
| 509 | +- [PostHog Error Tracking](https://posthog.com/docs/error-tracking) | |
| 510 | +- [GitHub CLI Documentation](https://cli.github.com/) | |
| 511 | +- [GitHub MCP on Continue Hub](https://hub.continue.dev/github/github-mcp) (alternative option) | |
| 512 | +- [Continue CLI Guide](https://docs.continue.dev/guides/cli) | |
| 513 | +- [Continuous AI Best Practices](https://blog.continue.dev/what-is-continuous-ai-a-developers-guide/) |
modified docs/guides/snyk-mcp-continue-cookbook.mdx +106 −32
| @@ -20,9 +20,74 @@ | ||
| 20 | 20 | - [Snyk account](https://snyk.io/) (free tier works) |
| 21 | 21 | - A local project to scan for vulnerabilities |
| 22 | 22 | |
| 23 | +For all options, first: | |
| 23 | 24 | <Steps> |
| 25 | +<Step title="Install Continue CLI"> | |
| 26 | + ```bash | |
| 27 | + npm i -g @continuedev/cli | |
| 28 | + ``` | |
| 29 | + </Step> | |
| 30 | + | |
| 31 | +<Step title="Add Your Project to Snyk"> | |
| 32 | + | |
| 33 | + 1. Sign up for a Snyk account at [snyk.io](https://snyk.io/) | |
| 34 | + 2. Create a new project in Snyk by importing your code repository (Git | |
| 35 | + provider or manual upload) | |
| 36 | + </Step> | |
| 37 | +</Steps> | |
| 38 | + <Warning> | |
| 39 | + To use agents in headless mode, you need a [Continue API key](https://hub.continue.dev/settings/api-keys). | |
| 40 | + </Warning> | |
| 41 | + | |
| 42 | +## Snyk Continuous AI Workflow Options | |
| 43 | + | |
| 44 | +<Card title="🚀 Fastest Path to Success" icon="zap"> | |
| 45 | + Skip the manual setup and use our pre-built Snyk Continuous AI agent that includes | |
| 46 | + the Snyk MCP and optimized security scanning workflows for more consistent results. | |
| 47 | +</Card> | |
| 48 | + | |
| 49 | + | |
| 50 | +After ensuring you meet the **Prerequisites** above, you have two paths to get started: | |
| 51 | + | |
| 52 | +<Tabs> | |
| 53 | + <Tab title="⚡ Quick Start (Recommended)"> | |
| 54 | + <Steps> | |
| 55 | + <Step title="Load the Pre-Built Agent"> | |
| 56 | + Navigate to your project directory and run: | |
| 57 | + ```bash | |
| 58 | + cn --config continuedev/snyk-continuous-ai | |
| 59 | + ``` | |
| 60 | + | |
| 61 | + This agent includes: | |
| 62 | + - **Snyk MCP** pre-configured and ready to use | |
| 63 | + - **Security-focused rules** for best practices | |
| 64 | + </Step> | |
| 65 | + | |
| 66 | + <Step title="Run Your First Security Scan"> | |
| 67 | + Start with a comprehensive security scan: | |
| 68 | + ```bash | |
| 69 | + # TUI mode | |
| 70 | + cn -p "Run a complete security scan on this project including code vulnerabilities, dependencies, and any IaC files. Summarize findings by severity." | |
| 71 | + ``` | |
| 72 | + | |
| 73 | + That's it! The agent handles everything automatically. | |
| 74 | + </Step> | |
| 75 | + </Steps> | |
| 76 | + | |
| 77 | + <Info> | |
| 78 | + **Why Use the Agent?** The pre-built agent provides consistent security scanning workflows and handles MCP configuration automatically, making it easier to get started with AI-powered security scanning. | |
| 79 | + </Info> | |
| 80 | + | |
| 81 | + </Tab> | |
| 82 | + | |
| 83 | + <Tab title="🛠️ Manual Setup"> | |
| 84 | +<Steps> | |
| 85 | + <Step title="Create a New Agent via the Continue Hub"> | |
| 86 | + Go to the [Continue Hub](https://hub.continue.dev) and [create a new agent](https://hub.continue.dev/new?type=agent). | |
| 87 | + </Step> | |
| 88 | + | |
| 24 | 89 | <Step title="Connect Snyk MCP via Continue Hub"> |
| 25 | - Visit the [Snyk MCP on Continue Hub](https://hub.continue.dev/snyk/snyk-mcp) and click **Install** to add it to your Continue account. | |
| 90 | + Visit the [Snyk MCP on Continue Hub](https://hub.continue.dev/snyk/snyk-mcp) and click **Install** to add it to the agent you created in the step above. | |
| 26 | 91 | |
| 27 | 92 | This will add Snyk MCP to your agent's available tools. The Hub listing automatically configures the MCP command: |
| 28 | 93 | ```bash |
| @@ -31,7 +96,7 @@ | ||
| 31 | 96 | |
| 32 | 97 | <Tip> |
| 33 | 98 | **Alternative installation methods:** |
| 34 | - 1. **Quick CLI install**: `cn -p --mcp snyk/snyk-mcp` | |
| 99 | + 1. **Quick CLI install**: `cn --mcp snyk/snyk-mcp` | |
| 35 | 100 | 2. **Manual configuration**: Add the MCP to your `~/.continue/config.json` under the `mcpServers` section |
| 36 | 101 | |
| 37 | 102 | Once installed, Snyk MCP tools become available to your Continue agent for all prompts. |
| @@ -59,35 +124,42 @@ | ||
| 59 | 124 | |
| 60 | 125 | </Step> |
| 61 | 126 | |
| 62 | - <Step title="Authenticate with Snyk"> | |
| 63 | - Use this prompt with your Continue agent to set up authentication: | |
| 64 | - | |
| 65 | - ``` | |
| 66 | - Check Snyk auth status. If not authenticated, authenticate me and confirm my org context. | |
| 67 | - ``` | |
| 68 | - | |
| 69 | - Or use the Continue CLI: | |
| 127 | + <Step title="Run Your First Security Scan"> | |
| 128 | + Start with a comprehensive security scan: | |
| 70 | 129 | ```bash |
| 71 | - cn -p "Check Snyk auth status. If not authenticated, authenticate me and confirm my org context." | |
| 130 | + # TUI mode | |
| 131 | + cn "Run a complete security scan on this project including code vulnerabilities, dependencies, and any IaC files. Summarize findings by severity." | |
| 72 | 132 | ``` |
| 73 | - | |
| 74 | - <Tip> | |
| 75 | - A browser window will open for Snyk login. After authenticating, approve | |
| 76 | - the request to trust your project folder when prompted. | |
| 77 | - </Tip> | |
| 78 | - | |
| 79 | 133 | </Step> |
| 80 | 134 | </Steps> |
| 81 | 135 | |
| 136 | + </Tab> | |
| 137 | +</Tabs> | |
| 138 | + | |
| 139 | +<Accordion title="Agent Requirements"> | |
| 140 | + To use the pre-built agent, you need either: | |
| 141 | + - **Continue CLI Pro Plan** with the models add-on, OR | |
| 142 | + - **Your own API keys** added to Continue Hub secrets (same as manual setup) | |
| 143 | + | |
| 144 | + The agent will automatically detect and use your configuration along with the pre-configured Snyk MCP for security scanning operations. | |
| 145 | + | |
| 146 | +</Accordion> | |
| 147 | + | |
| 148 | +--- | |
| 149 | + | |
| 82 | 150 | ## Security Scanning Recipes |
| 83 | 151 | |
| 84 | 152 | Now you can use natural language prompts to run comprehensive security scans. The Continue agent automatically calls the appropriate Snyk MCP tools. |
| 85 | 153 | |
| 154 | +<Info> | |
| 155 | +You can add prompts to your agent's configuration for easy access in future sessions. Go to your agent in the [Continue Hub](https://hub.continue.dev), click **Edit**, and add prompts under the **Prompts** section. | |
| 156 | +</Info> | |
| 157 | + | |
| 86 | 158 | <Info> |
| 87 | 159 | **Where to run these workflows:** |
| 88 | 160 | - **IDE Extensions**: Use Continue in VS Code, JetBrains, or other supported IDEs |
| 89 | 161 | - **Terminal (TUI mode)**: Run `cn` to enter interactive mode, then type your prompts |
| 90 | - - **CLI (headless mode)**: Use `cn -p "your prompt"` for one-off commands | |
| 162 | + - **CLI (headless mode)**: Use `cn -p "your prompt"` for headless commands | |
| 91 | 163 | |
| 92 | 164 | **Test in Plan Mode First**: Before running security scans that might make |
| 93 | 165 | changes, test your prompts in plan mode (see the [Plan Mode |
| @@ -101,14 +173,14 @@ | ||
| 101 | 173 | <Card title="Static Application Security Testing" icon="code"> |
| 102 | 174 | Scan your source code for security vulnerabilities and code quality issues. |
| 103 | 175 | |
| 104 | -**Example prompt:** | |
| 176 | +**TUI Mode Prompt:** | |
| 105 | 177 | ``` |
| 106 | 178 | Run a Snyk Code scan on this repo with severity threshold medium. |
| 107 | 179 | Summarize issues with file:line. Propose minimal diffs for the top 3 |
| 108 | 180 | and rerun to verify. |
| 109 | 181 | ``` |
| 110 | 182 | |
| 111 | -**Using Continue CLI:** | |
| 183 | +**Headless Mode Prompt:** | |
| 112 | 184 | ```bash |
| 113 | 185 | cn -p "Run a Snyk Code scan on this repo with severity threshold medium. Summarize issues with file:line. Propose minimal diffs for the top 3 and rerun to verify." |
| 114 | 186 | ``` |
| @@ -120,14 +192,14 @@ | ||
| 120 | 192 | <Card title="Software Composition Analysis" icon="cube"> |
| 121 | 193 | Check open source dependencies for known vulnerabilities. |
| 122 | 194 | |
| 123 | -**Example prompt:** | |
| 195 | +**TUI Mode Prompt:** | |
| 124 | 196 | ``` |
| 125 | 197 | Run Snyk Open Source on this repo (include dev deps). |
| 126 | 198 | Summarize vulnerable paths and propose a minimal-risk upgrade plan. |
| 127 | 199 | Re-test after the plan (dry run). |
| 128 | 200 | ``` |
| 129 | 201 | |
| 130 | -**Using Continue CLI:** | |
| 202 | +**Headless Mode Prompt:** | |
| 131 | 203 | ```bash |
| 132 | 204 | cn -p "Run Snyk Open Source on this repo (include dev deps). Summarize vulnerable paths and propose a minimal-risk upgrade plan. Re-test after the plan (dry run)." |
| 133 | 205 | ``` |
| @@ -139,13 +211,13 @@ | ||
| 139 | 211 | <Card title="IaC Security" icon="cloud"> |
| 140 | 212 | Scan Terraform, CloudFormation, and Kubernetes configs for misconfigurations. |
| 141 | 213 | |
| 142 | -**Example prompt:** | |
| 214 | +**TUI Mode Prompt:** | |
| 143 | 215 | ``` |
| 144 | 216 | Scan ./infra with Snyk IaC. Report high/critical misconfigs |
| 145 | 217 | with exact files/lines. Provide code changes and re-scan to confirm. |
| 146 | 218 | ``` |
| 147 | 219 | |
| 148 | -**Using Continue CLI:** | |
| 220 | +**Headless Mode Prompt:** | |
| 149 | 221 | ```bash |
| 150 | 222 | cn -p "Scan ./infra with Snyk IaC. Report high/critical misconfigs with exact files/lines. Provide code changes and re-scan to confirm." |
| 151 | 223 | ``` |
| @@ -157,14 +229,14 @@ | ||
| 157 | 229 | <Card title="Container Security" icon="docker"> |
| 158 | 230 | Analyze Docker images for vulnerabilities in base images and packages. |
| 159 | 231 | |
| 160 | -**Example prompt:** | |
| 232 | +**TUI Mode Prompt:** | |
| 161 | 233 | ``` |
| 162 | 234 | Scan image my-api:latest. Exclude base image vulns. |
| 163 | 235 | Print dependency tree. Recommend a safer base image or upgrades. |
| 164 | 236 | Re-test after the change (dry run). |
| 165 | 237 | ``` |
| 166 | 238 | |
| 167 | -**Using Continue CLI:** | |
| 239 | +**Headless Mode Prompt:** | |
| 168 | 240 | ```bash |
| 169 | 241 | cn -p "Scan image my-api:latest. Exclude base image vulns. Print dependency tree. Recommend a safer base image or upgrades. Re-test after the change (dry run)." |
| 170 | 242 | ``` |
| @@ -176,13 +248,13 @@ | ||
| 176 | 248 | <Card title="Changed Files Only" icon="code-branch"> |
| 177 | 249 | Focus scanning on modified files to catch issues before merging. |
| 178 | 250 | |
| 179 | -**Example prompt:** | |
| 251 | +**TUI Mode Prompt:** | |
| 180 | 252 | ``` |
| 181 | 253 | Scan only files changed since origin/main with Snyk Code. |
| 182 | 254 | Block if new high issues would be introduced. Show deltas. |
| 183 | 255 | ``` |
| 184 | 256 | |
| 185 | -**Using Continue CLI:** | |
| 257 | +**Headless Mode Prompt:** | |
| 186 | 258 | ```bash |
| 187 | 259 | cn -p "Scan only files changed since origin/main with Snyk Code. Block if new high issues would be introduced. Show deltas." |
| 188 | 260 | ``` |
| @@ -194,12 +266,12 @@ | ||
| 194 | 266 | <Card title="Snyk Learn Integration" icon="graduation-cap"> |
| 195 | 267 | Access security education resources based on identified vulnerabilities ([CWE](https://cwe.mitre.org/)). |
| 196 | 268 | |
| 197 | -**Example prompt:** | |
| 269 | +**TUI Mode Prompt:** | |
| 198 | 270 | ``` |
| 199 | 271 | Open Snyk Learn lessons related to the top CWE(s) from this scan. |
| 200 | 272 | ``` |
| 201 | 273 | |
| 202 | -**Using Continue CLI:** | |
| 274 | +**Headless Mode Prompt:** | |
| 203 | 275 | ```bash |
| 204 | 276 | cn -p "Open Snyk Learn lessons related to the top CWE(s) from this scan." |
| 205 | 277 | ``` |
| @@ -208,7 +280,7 @@ | ||
| 208 | 280 | |
| 209 | 281 | ## Continuous Security with GitHub Actions |
| 210 | 282 | |
| 211 | -This example demonstrates a **Continuous AI workflow** where security scanning runs automatically in your CI/CD pipeline using Continue CLI in headless mode (`cn -p`) with Snyk MCP. | |
| 283 | +This example demonstrates a **Continuous AI workflow** where security scanning runs automatically in your CI/CD pipeline Headless Mode Prompt in headless mode (`cn -p`) with Snyk MCP. | |
| 212 | 284 | |
| 213 | 285 | ### Add GitHub Secrets |
| 214 | 286 | |
| @@ -249,8 +321,10 @@ | ||
| 249 | 321 | echo "✅ Continue CLI installed" |
| 250 | 322 | |
| 251 | 323 | - name: Authenticate Continue CLI |
| 324 | + env: | |
| 325 | + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} | |
| 252 | 326 | run: | |
| 253 | - cn auth login --api-key "${{ secrets.CONTINUE_API_KEY }}" | |
| 327 | + cn auth login --api-key "$CONTINUE_API_KEY" | |
| 254 | 328 | echo "✅ Continue CLI authenticated" |
| 255 | 329 | |
| 256 | 330 | - name: Run Security Scans |
modified docs/hub/agents/create-an-agent.mdx +3 −2
| @@ -8,7 +8,8 @@ | ||
| 8 | 8 | |
| 9 | 9 | To create an agent from scratch, select “New agent” in the top bar. |
| 10 | 10 | |
| 11 | - | |
| 11 | + | |
| 12 | + | |
| 12 | 13 | |
| 13 | 14 | Choose a name, slug, description, and icon for your agent. |
| 14 | 15 | |
| @@ -24,7 +25,7 @@ | ||
| 24 | 25 | |
| 25 | 26 | By clicking the “remix” button, you’ll be taken to the “Create a remix” page. |
| 26 | 27 | |
| 27 | - | |
| 28 | + | |
| 28 | 29 | |
| 29 | 30 | Once here, you’ll be able to |
| 30 | 31 |
added docs/images/hub/agent-remix-button.png +0 −0
Binary content is not shown. View the file.
deleted docs/images/hub/assistant-new-button.png +0 −0
Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.
deleted docs/images/hub/assistants/images/assistant-new-button-16070e2cff9ce25ec9ebfeecb0e2f2b5.png +0 −0
Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.
deleted docs/images/hub/assistants/images/assistant-new-button.png +0 −0
Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.
deleted docs/images/hub/assistants/images/assistant-remix-button.png +0 −0
Binary content is not shown. View the file.
added docs/images/hub/new-agent-button.png +0 −0
Binary content is not shown. View the file.