From 71f95dbc21451edaefa9929b4146403b2bfb3bc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 09:09:12 +0000 Subject: [PATCH 01/13] chore(deps): bump gradle/actions from 3 to 5 Bumps [gradle/actions](https://github.com/gradle/actions) from 3 to 5. - [Release notes](https://github.com/gradle/actions/releases) - [Commits](https://github.com/gradle/actions/compare/v3...v5) --- updated-dependencies: - dependency-name: gradle/actions dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/jetbrains-release.yaml | 8 ++++---- .github/workflows/submit-github-dependency-graph.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index 6ed9292b7..9c33c822c 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -116,7 +116,7 @@ jobs: # Validate wrapper - name: Gradle Wrapper Validation - uses: gradle/actions/wrapper-validation@v3 + uses: gradle/actions/wrapper-validation@v5 # # Set up Java environment for the next steps - name: Setup Java @@ -127,7 +127,7 @@ jobs: # # Setup Gradle - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v5 with: gradle-home-cache-cleanup: true @@ -444,7 +444,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v5 with: gradle-home-cache-cleanup: true @@ -522,7 +522,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v5 with: gradle-home-cache-cleanup: true diff --git a/.github/workflows/submit-github-dependency-graph.yml b/.github/workflows/submit-github-dependency-graph.yml index 08373c66a..b647c6557 100644 --- a/.github/workflows/submit-github-dependency-graph.yml +++ b/.github/workflows/submit-github-dependency-graph.yml @@ -19,7 +19,7 @@ jobs: distribution: "temurin" java-version: 17 - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@v4 + uses: gradle/actions/dependency-submission@v5 with: # The gradle project is not in the root of the repository. build-root-directory: extensions/intellij From 7036ece762753414e29f6ea2287cfe2c5b302f2d Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 2 Oct 2025 10:18:01 -0700 Subject: [PATCH 02/13] fix: tool outcome errors for preprocessing failures --- core/core.ts | 28 ++++++++--- core/protocol/core.ts | 7 ++- .../redux/thunks/preprocessToolCallArgs.ts | 47 ++++++++++++------- 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/core/core.ts b/core/core.ts index 270668b17..0d1b5ffba 100644 --- a/core/core.ts +++ b/core/core.ts @@ -83,6 +83,7 @@ import { NextEditProvider } from "./nextEdit/NextEditProvider"; import type { FromCoreProtocol, ToCoreProtocol } from "./protocol"; import { OnboardingModes } from "./protocol/core"; import type { IMessenger, Message } from "./protocol/messenger"; +import { ContinueError, ContinueErrorReason } from "./util/errors"; import { shareSession } from "./util/historyUtils"; import { Logger } from "./util/Logger.js"; @@ -1131,12 +1132,27 @@ export class Core { if (!tool) { throw new Error(`Tool ${toolName} not found`); } - const preprocessedArgs = await tool.preprocessArgs?.(args, { - ide: this.ide, - }); - return { - preprocessedArgs, - }; + + try { + const preprocessedArgs = await tool.preprocessArgs?.(args, { + ide: this.ide, + }); + return { + preprocessedArgs, + }; + } catch (e) { + let errorReason = + e instanceof ContinueError ? e.reason : ContinueErrorReason.Unknown; + let errorMessage = + e instanceof Error + ? e.message + : `Error preprocessing tool call args for ${toolName}\n${JSON.stringify(args)}`; + return { + preprocessedArgs: undefined, + errorReason, + errorMessage, + }; + } }); on("isItemTooBig", async ({ data: { item } }) => { diff --git a/core/protocol/core.ts b/core/protocol/core.ts index ea8bb388a..c559d9f64 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -54,6 +54,7 @@ import { } from "../control-plane/client"; import { ProcessedItem } from "../nextEdit/NextEditPrefetchQueue"; import { NextEditOutcome } from "../nextEdit/types"; +import { ContinueErrorReason } from "../util/errors"; export enum OnboardingModes { API_KEY = "API Key", @@ -317,7 +318,11 @@ export type ToCoreFromIdeOrWebviewProtocol = { ]; "tools/preprocessArgs": [ { toolName: string; args: Record }, - { preprocessedArgs?: Record }, + { + preprocessedArgs?: Record; + errorReason?: ContinueErrorReason; + errorMessage?: string; + }, ]; "clipboardCache/add": [{ content: string }, void]; "controlPlane/openUrl": [{ path: string; orgSlug?: string }, void]; diff --git a/gui/src/redux/thunks/preprocessToolCallArgs.ts b/gui/src/redux/thunks/preprocessToolCallArgs.ts index f6b973323..fd6a9e52d 100644 --- a/gui/src/redux/thunks/preprocessToolCallArgs.ts +++ b/gui/src/redux/thunks/preprocessToolCallArgs.ts @@ -1,4 +1,6 @@ import { ToolCallState } from "core"; +import { ContinueErrorReason } from "core/util/errors"; +import posthog from "posthog-js"; import { IIdeMessenger } from "../../context/IdeMessenger"; import { errorToolCall, @@ -15,25 +17,29 @@ export async function preprocessToolCalls( // Tool call pre-processing await Promise.all( generatedToolCalls.map(async (tcState) => { - try { - const result = await ideMessenger.request("tools/preprocessArgs", { + let errorReason: ContinueErrorReason | undefined = undefined; + let errorMessage: string | undefined = undefined; + let preprocessedArgs: Record | undefined = undefined; + const result = await ideMessenger.request("tools/preprocessArgs", { + toolName: tcState.toolCall.function.name, + args: tcState.parsedArgs, + }); + if (result.status === "success") { + preprocessedArgs = result.content.preprocessedArgs; + errorMessage = result.content.errorMessage; + errorReason = result.content.errorReason; + } else { + errorMessage = result.error; + errorReason = ContinueErrorReason.Unknown; + } + if (errorReason) { + posthog.capture("tool_call_outcome", { + // model: , TODO + succeeded: false, toolName: tcState.toolCall.function.name, - args: tcState.parsedArgs, + errorReason, + duration_ms: 0, // preprocessing is more or less instantaneous }); - if (result.status === "success") { - if (result.content.preprocessedArgs) { - dispatch( - setToolCallArgs({ - toolCallId: tcState.toolCallId, - newArgs: result.content.preprocessedArgs, - }), - ); - } - } else { - throw new Error(result.error); - } - } catch (e) { - let errorMessage = e instanceof Error ? e.message : `Unknown error`; dispatch( errorToolCall({ toolCallId: tcState.toolCallId, @@ -53,6 +59,13 @@ export async function preprocessToolCalls( ], }), ); + } else if (preprocessedArgs) { + dispatch( + setToolCallArgs({ + toolCallId: tcState.toolCallId, + newArgs: preprocessedArgs, + }), + ); } }), ); From 0aee4f756d0514f134822d53a7d9e78f58bdf98f Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 2 Oct 2025 12:22:11 -0700 Subject: [PATCH 03/13] feat: add opt `serverName` for registry MCP servers (#8037) Update index.ts --- packages/config-yaml/src/schemas/mcp/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/config-yaml/src/schemas/mcp/index.ts b/packages/config-yaml/src/schemas/mcp/index.ts index 64445ffc0..0f1778882 100644 --- a/packages/config-yaml/src/schemas/mcp/index.ts +++ b/packages/config-yaml/src/schemas/mcp/index.ts @@ -3,6 +3,7 @@ import { requestOptionsSchema } from "../../schemas/models.js"; const baseMcpServerSchema = z.object({ name: z.string(), + serverName: z.string().optional(), faviconUrl: z.string().optional(), sourceFile: z.string().optional(), // Added during loading connectionTimeout: z.number().gt(0).optional(), From 7598c16edf7e9ddd8723f52c49b1d88f7a57454b Mon Sep 17 00:00:00 2001 From: "continue[bot]" <230936708+continue[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:22:14 -0700 Subject: [PATCH 04/13] docs: Improve rules guidance in the deep dive and rules docs (#8022) * Improve rules guidance in docs - Add clear Hub vs Local rules integration explanation - Document rules loading order and synchronization behavior - Add troubleshooting section for common rules issues - Reference Linear issue CON-3084 for link accuracy problem - Clarify Hub/VSCode workflow with step-by-step instructions Addresses user confusion about rules created in different locations not syncing and provides clear guidance on workflows. Generated with Continue(https://continue.dev) Co-Authored-By: Continue * docs: Address Patrick's feedback on rules documentation - Add version control benefit for local rules - Highlight multi-agent reusability for Hub rules - Include concrete examples for both rule types Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --------- Co-authored-by: Continue Agent Co-authored-by: Continue Co-authored-by: Brian 'bdougie' Douglas --- docs/customization/rules.mdx | 24 ++++++ docs/customize/deep-dives/rules.mdx | 112 +++++++++++++++++++++++++++- 2 files changed, 133 insertions(+), 3 deletions(-) diff --git a/docs/customization/rules.mdx b/docs/customization/rules.mdx index 75dbfc811..e685e8303 100644 --- a/docs/customization/rules.mdx +++ b/docs/customization/rules.mdx @@ -15,4 +15,28 @@ By implementing rules, you transform the AI from a generic coding agent into a k Your agent detects rules and applies the specified rules while in [Agent](/features/agent/quick-start), [Chat](/features/chat/quick-start), and [Edit](/features/edit/quick-start) modes. +## Where to Manage Rules + + + +- Create files in `.continue/rules` folder +- Automatically appear with Hub assistants +- Edit directly in your file system +- Version controlled alongside your code +- Best for project-specific rules (e.g., "remember to generate migrations after modifying the db") + + + +- Manage on [Continue Hub](https://hub.continue.dev) +- Reference in config.yaml with `uses:` +- Share with team and community +- Easy to include in multiple agents +- Best for organization-wide rules (e.g., "always use X library for Y task") + + + + +**Quick Setup**: Start with local rules for immediate use, then promote commonly used rules to the Hub for sharing and reuse. + + Learn more in the [rules deep dive](/customize/deep-dives/rules), and view [`rules`](/reference#rules) in the YAML Reference for more details. \ No newline at end of file diff --git a/docs/customize/deep-dives/rules.mdx b/docs/customize/deep-dives/rules.mdx index 93631f3ab..449fc272d 100644 --- a/docs/customize/deep-dives/rules.mdx +++ b/docs/customize/deep-dives/rules.mdx @@ -20,6 +20,42 @@ You can view the current rules by clicking the pen icon above the main toolbar: To form the system message, rules are joined with new lines, in the order they appear in the toolbar. This includes the base chat system message ([see below](#how-to-customize-chat-system-message)). +## Understanding Hub vs Local Rules Integration + + +**Important:** Rules created in different locations behave differently and have different synchronization patterns. + + +Continue supports two types of rules with different behaviors: + + + +- **Location**: `.continue/rules` folder in your workspace +- **Visibility**: Automatically visible when using Hub assistants +- **Creation**: Add rules button in VSCode or manual file creation +- **File Management**: Creates actual `.md` files you can edit directly + + + +- **Location**: Stored on Continue Hub, referenced in config.yaml +- **Visibility**: Only appear when referenced in assistant configuration +- **Creation**: Created directly on Hub or copied from local rules +- **File Management**: No local files created, managed through Hub interface + + + +### How Rules Are Applied + +When using Continue, rules are loaded in this order: +1. **Hub assistant rules** (if using a Hub-based assistant) +2. **Referenced Hub rules** (via `uses:` in config.yaml) +3. **Local workspace rules** (from `.continue/rules` folder) +4. **Global rules** (from `~/.continue/rules` folder) + + +**TL;DR**: Local rules show up automatically when using Hub assistants. Hub rules show up automatically when referenced in your config. + + ## Quick Start: How to Create Your First Rule File Below is a quick example of setting up a new rule file: @@ -42,6 +78,8 @@ Now test your rules by asking a question about a file in chat. ## How to Create Rules Blocks +### Creating Local Rules + Rules can be added locally using the "Add Rules" button while viewing the Local Agent's rules. ![add local rules button](/images/add-local-rules.png) @@ -50,12 +88,44 @@ Rules can be added locally using the "Add Rules" button while viewing the Local **Automatically create local rule blocks**: When in Agent mode, you can prompt the agent to create a rule for you using the `create_rule_block` tool if enabled. For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation. - -Rules can also be added to an Agent on the Continue Hub. +### Creating Hub Rules -Explore available rules [here](https://hub.continue.dev), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub. +Rules can also be created and managed on the Continue Hub: + +1. **Browse existing rules**: [Explore available rules](https://hub.continue.dev) +2. **Create new rules**: [Create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub +3. **Copy from local rules**: Copy/paste content from your `.continue/rules` files to create Hub rules + +### Working Between Hub and Local Rules + + + +To use Hub rules in your local setup: + +1. Reference them in your `config.yaml`: + ```yaml + rules: + - uses: username/my-hub-rule + ``` +2. The rule will automatically appear in your rules toolbar +3. **Note**: No local file is created - the rule exists only on the Hub + + + +To move local rules to the Hub: + +1. Copy the content from your `.continue/rules/rule-name.md` file +2. Go to [Create new rule](https://hub.continue.dev/new?type=block&blockType=rules) +3. Paste the content and configure the rule +4. Optionally, remove the local file and reference the Hub rule in your config + + +**Current Limitation**: There's no automatic sync from local to Hub. You must manually copy/paste rule content. + + + ### How to Configure Rule Properties and Syntax @@ -150,6 +220,42 @@ globs: ["**/*.ts", "**/*.tsx"] - modularize components into smaller, reusable pieces ``` +## Troubleshooting Rules + +### Issue: Rules Created in Different Places Don't Sync + +**Problem**: You created rules in the Hub but don't see them in VSCode, or vice versa. + +**Solution**: +- **Hub rules** only appear when referenced in your config.yaml using the `uses:` syntax +- **Local rules** automatically appear when using Hub assistants +- There's currently no automatic bidirectional sync + +### Issue: "Edit" Links Point to Wrong Location + +**Problem**: When you click "Edit" on a rule in VSCode, it tries to open the Hub even though the rule is local, or shows an incorrect URL. + +**Root Cause**: This happens when you have a mix of local and Hub rules, and Continue can't properly determine where each rule originates. + +**Workaround**: +1. **For local rules**: Navigate directly to `.continue/rules/` folder and edit the `.md` file +2. **For Hub rules**: Go directly to your assistant page on [Continue Hub](https://hub.continue.dev) and edit from there +3. Keep track of which rules are local vs Hub-based to avoid confusion + + +**Known Issue**: This link accuracy problem is tracked in [Linear issue CON-3084](https://linear.app/continue/issue/CON-3084) and will be fixed in a future update. + + +### Issue: Rules Don't Appear in Assistant + +**Problem**: Your rules exist but don't show up in the rules toolbar. + +**Check These**: +1. **File location**: Ensure local rules are in `.continue/rules/` (not `.continue/rule/`) +2. **File format**: Rules should be `.md` files with proper YAML frontmatter +3. **Config reference**: Hub rules must be referenced in `config.yaml` +4. **Assistant type**: Ensure you're using the correct assistant (local vs Hub) + ### How to Customize Chat System Message Continue includes a simple default system message for [Agent](../../features/agent/quick-start) and [Chat](../../features/chat/quick-start) requests, to help the model provide reliable codeblock formats in its output. From c779b6121d4300f3ca81563d7927326834aa03ec Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 2 Oct 2025 22:48:26 -0700 Subject: [PATCH 05/13] docs: add Continue Docs MCP cookbook and update navigation - Add comprehensive Continue Docs MCP cookbook guide - Update docs.json navigation with new cookbook entries - Add dlt and Sanity MCP cookbook links to overview - Include GitHub Actions workflow for documentation checks - Add Sentry error analysis utility scripts This cookbook demonstrates how to use the Continue Docs MCP to: - Research existing documentation patterns - Create new cookbooks with AI assistance - Maintain consistency across documentation - Automate documentation quality checks Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .github/workflows/docs-update-check.yml | 181 +++++++ analyze-sentry-errors.js | 172 +++++++ docs/docs.json | 2 + docs/guides/continue-docs-mcp-cookbook.mdx | 542 +++++++++++++++++++++ docs/guides/overview.mdx | 2 + docs/test-sentry-mcp.js | 82 ++++ 6 files changed, 981 insertions(+) create mode 100644 .github/workflows/docs-update-check.yml create mode 100755 analyze-sentry-errors.js create mode 100644 docs/guides/continue-docs-mcp-cookbook.mdx create mode 100644 docs/test-sentry-mcp.js diff --git a/.github/workflows/docs-update-check.yml b/.github/workflows/docs-update-check.yml new file mode 100644 index 000000000..cb625cd3b --- /dev/null +++ b/.github/workflows/docs-update-check.yml @@ -0,0 +1,181 @@ +name: Documentation Update Check + +on: + pull_request: + types: [opened, synchronize, ready_for_review] + paths: + - 'core/**/*.ts' + - 'core/**/*.js' + - 'extensions/**/*.ts' + - 'extensions/**/*.js' + - 'packages/**/*.ts' + - 'packages/**/*.js' + - 'gui/**/*.tsx' + - 'gui/**/*.jsx' + +jobs: + check-docs-needed: + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Continue CLI + run: npm i -g @continuedev/cli + + - name: Analyze changes for documentation needs + id: analyze + env: + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Get the diff of changed files + git diff origin/main..HEAD --name-only > changed_files.txt + + # Create a detailed diff for analysis + git diff origin/main..HEAD > detailed_diff.txt + + # Use Continue to analyze if docs are needed + ANALYSIS=$(cn --auto --headless \ + "Analyze these code changes and determine if documentation updates are needed. + Consider: + 1. New features or APIs added + 2. Breaking changes to existing functionality + 3. New configuration options or settings + 4. Changes to CLI commands or flags + 5. New integrations or MCP servers + 6. Modified agent behavior or capabilities + + Changed files: $(cat changed_files.txt | tr '\n' ' ') + + If documentation updates are needed, list specific docs that should be updated. + Format as markdown bullet list. + If no docs updates needed, respond with 'NO_DOCS_NEEDED'. + Be concise and specific." 2>&1) || true + + # Save the analysis + echo "$ANALYSIS" > docs_analysis.md + + # Check if docs are needed + if grep -q "NO_DOCS_NEEDED" docs_analysis.md; then + echo "docs_needed=false" >> $GITHUB_OUTPUT + else + echo "docs_needed=true" >> $GITHUB_OUTPUT + fi + + - name: Format documentation suggestions + if: steps.analyze.outputs.docs_needed == 'true' + id: format + run: | + # Create a formatted comment + cat > comment.md << 'EOF' + ## šŸ“š Documentation Update Suggested + + Based on the changes in this PR, the following documentation may need updates: + + EOF + + # Add the analysis (excluding any system output) + cat docs_analysis.md | grep -E "^[\*\-\+]|^[[:space:]]*[\*\-\+]|^#{1,6}" >> comment.md || echo "See detailed analysis below." >> comment.md + + cat >> comment.md << 'EOF' + + --- + + ### Next Steps + + 1. Review the suggested documentation areas + 2. Update relevant docs in the `/docs` folder + 3. Consider updating: + - API references if interfaces changed + - Guides if workflows changed + - Configuration docs if settings changed + - MCP cookbook if new integrations added + + ### Resources + + - [Documentation Contributing Guide](/docs/CONTRIBUTING.mdx) + - [MCP Integration Guide](/docs/guides/mcp-continue-cookbook.mdx) + - [Continue Hub](https://hub.continue.dev) + + This analysis was generated automatically. Please review and update as needed. + EOF + + - name: Post PR comment + if: steps.analyze.outputs.docs_needed == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const fs = require('fs'); + const comment = fs.readFileSync('comment.md', 'utf8'); + + // Check if we already commented + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number + }); + + const botComment = comments.find(c => + c.user.type === 'Bot' && + c.body.includes('Documentation Update Suggested') + ); + + if (botComment) { + // Update existing comment + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: botComment.id, + body: comment + }); + } else { + // Create new comment + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + } + + - name: Add label if docs needed + if: steps.analyze.outputs.docs_needed == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['docs-needed'] + }); + + - name: Remove label if docs not needed + if: steps.analyze.outputs.docs_needed == 'false' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: 'docs-needed' + }); + } catch (error) { + // Label might not exist, that's okay + console.log('Label does not exist or already removed'); + } \ No newline at end of file diff --git a/analyze-sentry-errors.js b/analyze-sentry-errors.js new file mode 100755 index 000000000..534084d52 --- /dev/null +++ b/analyze-sentry-errors.js @@ -0,0 +1,172 @@ +#!/usr/bin/env node + +/** + * Sentry Error Analysis Script + * Analyzes errors from the past 24 hours using Sentry's API + */ + +const https = require('https'); +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +// Function to make API requests to Sentry +function sentryRequest(token, endpoint) { + return new Promise((resolve, reject) => { + const options = { + hostname: 'sentry.io', + path: `/api/0/${endpoint}`, + method: 'GET', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + } + }; + + const req = https.request(options, (res) => { + let data = ''; + res.on('data', (chunk) => data += chunk); + res.on('end', () => { + try { + resolve(JSON.parse(data)); + } catch (e) { + reject(e); + } + }); + }); + + req.on('error', reject); + req.end(); + }); +} + +// Format date for Sentry API +function getDateRange() { + const now = new Date(); + const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000); + return { + start: yesterday.toISOString(), + end: now.toISOString() + }; +} + +// Analyze errors +async function analyzeErrors(token) { + try { + console.log('\nšŸ” Fetching Sentry organizations...'); + const orgs = await sentryRequest(token, 'organizations/'); + + if (!orgs || orgs.length === 0) { + console.log('āŒ No organizations found. Please check your token permissions.'); + return; + } + + console.log(`\nšŸ“Š Found ${orgs.length} organization(s):\n`); + + for (const org of orgs) { + console.log(`\nšŸ¢ Organization: ${org.name} (${org.slug})`); + console.log('─'.repeat(50)); + + // Get projects + const projects = await sentryRequest(token, `organizations/${org.slug}/projects/`); + console.log(` šŸ“ Projects: ${projects.length}`); + + const { start, end } = getDateRange(); + + for (const project of projects) { + console.log(`\n šŸ“Œ Project: ${project.name}`); + + // Get issues for the past 24 hours + const issues = await sentryRequest( + token, + `projects/${org.slug}/${project.slug}/issues/?statsPeriod=24h&query=is:unresolved` + ); + + if (issues && issues.length > 0) { + console.log(` šŸ› Unresolved issues (24h): ${issues.length}`); + + // Analyze top issues + const topIssues = issues.slice(0, 5); + console.log('\n Top 5 Issues:'); + console.log(' ' + '─'.repeat(45)); + + topIssues.forEach((issue, index) => { + const errorCount = issue.count || 0; + const userCount = issue.userCount || 0; + const level = issue.level || 'unknown'; + const title = issue.title || issue.culprit || 'Unknown Error'; + + console.log(`\n ${index + 1}. ${title}`); + console.log(` Level: ${level.toUpperCase()}`); + console.log(` Events: ${errorCount} | Users affected: ${userCount}`); + console.log(` First seen: ${new Date(issue.firstSeen).toLocaleString()}`); + console.log(` Last seen: ${new Date(issue.lastSeen).toLocaleString()}`); + + if (issue.metadata && issue.metadata.type) { + console.log(` Type: ${issue.metadata.type}`); + } + }); + + // Summary statistics + const totalEvents = issues.reduce((sum, issue) => sum + (issue.count || 0), 0); + const totalUsers = issues.reduce((sum, issue) => sum + (issue.userCount || 0), 0); + const criticalIssues = issues.filter(i => i.level === 'error' || i.level === 'fatal').length; + + console.log('\n šŸ“Š 24-Hour Summary:'); + console.log(' ' + '─'.repeat(45)); + console.log(` Total issues: ${issues.length}`); + console.log(` Total events: ${totalEvents}`); + console.log(` Users affected: ${totalUsers}`); + console.log(` Critical issues: ${criticalIssues}`); + } else { + console.log(` āœ… No unresolved issues in the past 24 hours`); + } + } + } + + console.log('\n' + '='.repeat(50)); + console.log('āœ… Analysis complete!'); + + } catch (error) { + console.error('\nāŒ Error analyzing Sentry data:', error.message); + if (error.message.includes('401')) { + console.log('\nšŸ’” Tip: Make sure your token has the correct permissions:'); + console.log(' - project:read'); + console.log(' - org:read'); + console.log(' - event:read'); + } + } +} + +// Main execution +console.log('='.repeat(50)); +console.log('šŸ” SENTRY ERROR ANALYZER (Past 24 Hours)'); +console.log('='.repeat(50)); + +console.log('\nTo get your Sentry Auth Token:'); +console.log('1. Visit: https://sentry.io/settings/account/api/auth-tokens/'); +console.log('2. Create a new token with these scopes:'); +console.log(' - project:read'); +console.log(' - org:read'); +console.log(' - event:read'); +console.log('3. Copy the token and paste it below\n'); + +rl.question('Enter your Sentry Auth Token: ', async (token) => { + if (!token) { + console.log('āŒ No token provided. Exiting...'); + rl.close(); + return; + } + + await analyzeErrors(token.trim()); + rl.close(); +}); + +// Handle cleanup +rl.on('close', () => { + console.log('\nšŸ‘‹ Goodbye!'); + process.exit(0); +}); \ No newline at end of file diff --git a/docs/docs.json b/docs/docs.json index 94be18094..a3991caa3 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -260,8 +260,10 @@ "icon": "book-open-cover", "pages": [ "guides/posthog-github-continuous-ai", + "guides/continue-docs-mcp-cookbook", "guides/snyk-mcp-continue-cookbook", "guides/dlt-mcp-continue-cookbook", + "guides/sanity-mcp-continue-cookbook", "guides/netlify-mcp-continuous-deployment" ] } diff --git a/docs/guides/continue-docs-mcp-cookbook.mdx b/docs/guides/continue-docs-mcp-cookbook.mdx new file mode 100644 index 000000000..3dab28a94 --- /dev/null +++ b/docs/guides/continue-docs-mcp-cookbook.mdx @@ -0,0 +1,542 @@ +--- +title: "Contributing to Continue with Model Context Protocol (MCP)" +description: "Use the Continue Docs MCP to write cookbooks, guides, and documentation with AI-powered workflows." +sidebarTitle: "Continue Docs MCP Cookbook" +--- + + + Master using the Continue Docs MCP to contribute documentation, create cookbooks, and maintain consistency across Continue's docs - all through natural language prompts. + + +## Prerequisites + +Before starting, ensure you have: + +- Continue account with **Hub access** +- Read: [Contributing to Continue Documentation](/CONTRIBUTING) for setup instructions +- Forked the [continuedev/continue](https://github.com/continuedev/continue) repository +- Node.js 20+ and Continue CLI installed + + + This cookbook assumes you've read the setup in the [CONTRIBUTING guide](/CONTRIBUTING). If you haven't, start there first. + + +## Continue Docs MCP Setup + + + Use the pre-built [Docs Assistant - Mintlify agent](https://hub.continue.dev/continuedev/docs-mintlify) that includes the Continue Docs MCP and is ready to use immediately. + + + + + ```bash + # From your Continue docs directory + cn --config continuedev/docs-mintlify + ``` + + This agent includes: + - **Continue Docs MCP** for searching Continue documentation + - **Mintlify formatting rules** for proper component usage + - **Documentation-focused prompts** for common tasks + + + + If you want to customize, create your own agent and add: + 1. [Continue Docs MCP](https://hub.continue.dev/continuedev/continue-docs-mcp) + 2. [Mintlify Technical Writing Rule](https://hub.continue.dev/mintlify/technical-writing-rule) + + See the [CONTRIBUTING guide](/CONTRIBUTING#option-2-create-your-own-custom-agent) for details. + + + +--- + +## What is the Continue Docs MCP? + + + A Model Context Protocol server built with [Mintlify's MCP generation](https://www.mintlify.com/blog/generate-mcp-servers-for-your-docs) that enables semantic search across Continue documentation. [Learn more →](/reference/continue-mcp) + + +The MCP helps you: +- **Find examples** from existing documentation +- **Maintain consistency** with established patterns +- **Source accurate information** about Continue features +- **Write better documentation** faster + +--- + +## Documentation Workflows with Prompts + +### šŸ†• Creating a New Cookbook + +Cookbooks show how to use Continue CLI with specific tools or services. Here's how to create one using the Continue Docs MCP: + + + + ```bash + cn --config continuedev/docs-mintlify + ``` + + **Prompt:** + ``` + "Show me the structure of existing MCP cookbooks in the Continue docs. + I want to create a cookbook for GitHub MCP." + ``` + + The agent will find examples like the dlt, Snyk, and Sanity cookbooks. + + + + **Prompt:** + ``` + "Using the Continue Docs MCP, find information about how GitHub MCP works. + Then search the web for the official GitHub MCP documentation and combine + both sources to create a cookbook following the same structure as the + dlt cookbook." + ``` + + The agent will: + - Search Continue docs for MCP patterns + - Fetch GitHub MCP official documentation + - Combine both sources + - Generate a cookbook with consistent formatting + + + + **Prompt:** + ``` + "Add my new github-mcp-continue-cookbook.mdx to the docs.json navigation + under the Cookbooks section." + ``` + + + + ```bash + npm run dev + # Visit http://localhost:3000 + ``` + + **Refine with prompts:** + ``` + "Add more examples to the troubleshooting section" + "Include a CI/CD workflow example using GitHub Actions" + "Add authentication setup using environment variables" + ``` + + + + + **Pro Tip:** The agent uses the Continue Docs MCP to maintain consistency with existing cookbooks automatically. + + +--- + +### āœļø Updating Existing Documentation + + + + **Prompt:** + ``` + "Where is the MCP tools documentation located? Show me the file path." + ``` + + + + **Prompt:** + ``` + "Update the MCP tools documentation at docs/customization/mcp-tools.mdx + to include information about the new Slack MCP server. Use the Continue + Docs MCP to find examples of how other MCP servers are documented, then + add a similar section for Slack." + ``` + + + +--- + +### šŸ“ Adding New Guides + + + + **Prompt:** + ``` + "I want to create a guide for setting up Continue with Amazon Bedrock. + Search the Continue docs for similar model provider setup guides and + show me the common structure they follow." + ``` + + + + **Prompt:** + ``` + "Create a new guide at docs/guides/amazon-bedrock-setup.mdx following + the structure you found. Include: + - Prerequisites + - Step-by-step setup with code examples + - Configuration options + - Troubleshooting common issues + + Use the Continue Docs MCP to find accurate information about Continue's + model provider configuration." + ``` + + + + **Prompt:** + ``` + "Add this guide to docs.json under the Model Providers section" + ``` + + + +--- + +## Real-World Cookbook Examples + +### Example 1: PostgreSQL MCP Cookbook + +**Prompt:** +``` +"Create a cookbook for using Continue with PostgreSQL MCP. Follow the same +structure as the dlt cookbook, but customize it for database operations. + +Include these sections: +1. Quick start with pre-built agent +2. Manual setup with MCP configuration +3. Common database tasks (schema exploration, query writing, migrations) +4. Troubleshooting database connection issues + +Use the Continue Docs MCP to find MCP configuration patterns and search the +web for PostgreSQL MCP documentation." +``` + +### Example 2: Sentry Error Tracking Cookbook + +**Prompt:** +``` +"Create a cookbook showing how to use Continue to analyze Sentry errors. + +The cookbook should demonstrate: +1. Setting up Sentry MCP integration +2. Querying recent errors +3. Analyzing error patterns with AI +4. Generating fixes for common errors +5. CI/CD integration for automated error analysis + +Research the Snyk cookbook structure since it's also about error detection, +and adapt it for Sentry." +``` + +### Example 3: OpenAPI Documentation Cookbook + +**Prompt:** +``` +"I want to create a cookbook for using Continue to work with OpenAPI specs. + +Show how to: +1. Load OpenAPI specs into Continue's context +2. Generate API client code from specs +3. Create tests based on API endpoints +4. Update documentation when APIs change + +Use the Continue Docs MCP to find how context providers work, then combine +that with OpenAPI MCP information." +``` + +--- + +## Advanced Prompt Patterns + + + + ```bash + "Use the Continue Docs MCP to understand how agents + work in Continue, then search the web for Anthropic's + Computer Use MCP. Create a cookbook showing how to + combine Continue agents with Computer Use for + automated testing." + ``` + + + + ```bash + "Find all mentions of MCP servers across Continue + documentation. Then create a comprehensive reference + page that links to all MCP-related guides and + configurations." + ``` + + + + ```bash + "Review all cookbook files in docs/guides/ and check + if they follow the same structure. List any + inconsistencies and suggest updates to make them + uniform." + ``` + + + + ```bash + "Extract all code examples showing MCP server + configuration from the Continue docs. Format them + as a single reference page with explanations for + each pattern." + ``` + + + +--- + +## Testing Your Documentation + +### Local Preview + +```bash +cd docs +npm run dev +# Visit http://localhost:3000 +``` + +### Validation Prompts + +```bash +# Check formatting +"Review this documentation for Mintlify formatting issues and fix any problems" + +# Verify links +"Check all links in this file and ensure they point to existing documentation" + +# Test code examples +"Verify that all code examples in this cookbook are syntactically correct" +``` + +--- + +## Submitting Your Contribution + +**Prompt:** +```bash +"Create a pull request with my documentation changes and use the repo's +PR template to write the description" +``` + +The agent will: +- Create a feature branch +- Stage and commit your changes +- Push to your fork +- Generate a PR description following the template +- Open the PR for review + + + See the full [Contributing Guide](/CONTRIBUTING#submitting-your-contribution) for manual PR submission details. + + +--- + +## Automated Documentation Checks with GitHub Actions + +Add automated documentation checks to your PR workflow using the Continue Docs MCP agent: + +```yaml title=".github/workflows/docs-check.yml" +name: Documentation Check + +on: + pull_request: + types: [opened, synchronize] + paths: + - 'core/**' + - 'extensions/**' + - 'packages/**' + - 'gui/**' + +jobs: + check-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Continue CLI + run: npm i -g @continuedev/cli + + - name: Analyze Changes for Documentation Needs + id: analyze + env: + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} + run: | + echo "šŸ” Analyzing code changes for documentation needs..." + + # Get changed files + git diff origin/main..HEAD --name-only > changed_files.txt + + # Create detailed diff + git diff origin/main..HEAD > changes.diff + + # Use Continue agent to check if docs need updates + PROMPT="Review these code changes and determine if documentation updates are needed. + + Changed files: $(cat changed_files.txt | tr '\n' ' ') + + Consider: + - New features or APIs + - Breaking changes + - New configuration options + - Modified CLI commands + - New MCP integrations + + If docs updates are needed, specify which files in docs/ should be updated. + If no updates needed, respond with 'NO_DOCS_NEEDED'. + Be specific and concise." + + cn --config continuedev/docs-mintlify -p "$PROMPT" --auto > analysis.md || { + echo "āš ļø Analysis failed" + echo "needs_docs=false" >> $GITHUB_OUTPUT + exit 0 + } + + if grep -q "NO_DOCS_NEEDED" analysis.md; then + echo "needs_docs=false" >> $GITHUB_OUTPUT + else + echo "needs_docs=true" >> $GITHUB_OUTPUT + fi + + - name: Post Documentation Recommendation + if: steps.analyze.outputs.needs_docs == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + echo "šŸ“ Creating PR comment with documentation recommendations..." + + cat > pr-comment.md <<'EOF' +## šŸ“š Documentation Update Recommended + +Based on the code changes in this PR, documentation updates may be needed: + +EOF + + cat analysis.md >> pr-comment.md + + cat >> pr-comment.md <<'EOF' + +--- + +### Next Steps + +1. Review the suggested documentation areas above +2. Update relevant files in the `/docs` folder +3. Consider updating: + - API references for interface changes + - Guides for workflow changes + - Configuration docs for new settings + - MCP cookbooks for new integrations + +### Resources +- [Contributing to Docs](/CONTRIBUTING) +- [Continue Docs MCP Cookbook](/guides/continue-docs-mcp-cookbook) + +*This analysis was generated using the Continue Docs MCP agent.* +EOF + + gh pr comment ${{ github.event.pull_request.number }} --body-file pr-comment.md + + - name: Add Label + if: steps.analyze.outputs.needs_docs == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr edit ${{ github.event.pull_request.number }} --add-label "docs-needed" +``` + + + This workflow uses the Continue Docs MCP agent to analyze code changes and automatically comment on PRs when documentation updates are recommended. + + +--- + +## Documentation MCP for Other Projects + +Want to create documentation MCPs for your own projects? Mintlify makes it easy: + + + + ```bash + npm i -g mintlify + mintlify init + ``` + + + + Mintlify automatically generates an MCP server for your documentation, enabling semantic search. + + [Learn more about Mintlify MCP generation →](https://www.mintlify.com/blog/generate-mcp-servers-for-your-docs) + + + + Share your docs MCP on [Continue Hub](https://hub.continue.dev/new?type=mcp) so others can use it with Continue agents. + + + + + The [Continue Docs MCP](/reference/continue-mcp) itself was built this way! + + +--- + +## Key Prompts Cheat Sheet + +| Task | Prompt | +|:-----|:-------| +| **Find structure** | "Show me the structure of existing cookbooks in Continue docs" | +| **Create cookbook** | "Create a cookbook for [tool] MCP following the dlt cookbook structure" | +| **Update docs** | "Update [file] to include information about [feature], using Continue Docs MCP to find examples" | +| **Add navigation** | "Add [file] to docs.json under the [section] section" | +| **Check consistency** | "Review this file for consistency with other Continue documentation" | +| **Fix formatting** | "Review for Mintlify formatting issues and fix any problems" | +| **Extract examples** | "Find all examples of [topic] in Continue docs" | +| **Research feature** | "Use Continue Docs MCP to explain how [feature] works in Continue" | + +--- + +## Resources + +### Continue Documentation +- [Contributing Guide](/CONTRIBUTING) - Setup and submission process +- [Continue Docs MCP Reference](/reference/continue-mcp) - MCP server details +- [Understanding Agents](/guides/understanding-agents) - How agents work + +### Mintlify +- [MCP Generation Guide](https://www.mintlify.com/blog/generate-mcp-servers-for-your-docs) +- [Mintlify Documentation](https://mintlify.com/docs) + +### Community +- [Continue Discord](https://discord.gg/continue) - #documentation channel +- [GitHub Discussions](https://github.com/continuedev/continue/discussions) + +--- + +## Next Steps + + + + Set up your environment + + + + Install pre-built agent + + + + See cookbook examples + + + + Get help from community + + diff --git a/docs/guides/overview.mdx b/docs/guides/overview.mdx index 3ca80dae0..1a29b9a66 100644 --- a/docs/guides/overview.mdx +++ b/docs/guides/overview.mdx @@ -22,6 +22,8 @@ Step-by-step guides for integrating Model Context Protocol (MCP) servers with Co - [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 - [Snyk + Continue Hub Agent Cookbook (MCP)](/guides/snyk-mcp-continue-cookbook) - Integrate Snyk MCP via Continue Hub to scan code, deps, IaC, and containers +- [dlt Data Pipelines Cookbook](/guides/dlt-mcp-continue-cookbook) - Build AI-powered data pipelines with dlt MCP for pipeline inspection, schema management, and debugging +- [Sanity CMS Cookbook](/guides/sanity-mcp-continue-cookbook) - Manage content, schemas, and GROQ queries with Sanity MCP for AI-powered content management ## What Advanced Tutorials Are Available diff --git a/docs/test-sentry-mcp.js b/docs/test-sentry-mcp.js new file mode 100644 index 000000000..0d206c229 --- /dev/null +++ b/docs/test-sentry-mcp.js @@ -0,0 +1,82 @@ +#!/usr/bin/env node + +// Test script to verify Sentry MCP connection +console.log(` +======================================== +Sentry MCP Setup Guide +======================================== + +To set up Sentry MCP with Continue: + +1. CONFIGURE CONTINUE: + Open VS Code and add this to your Continue config: + + { + "mcpServers": { + "sentry": { + "command": "npx", + "args": ["@sentry/mcp-server@latest"], + "type": "stdio" + } + } + } + +2. TEST THE CONNECTION: + Run this command in your terminal: + + cn + + Then type: + "Show me recent Sentry errors" + +3. OAUTH AUTHENTICATION: + - On first use, Sentry MCP will prompt for OAuth + - Follow the browser authentication flow + - Grant access to your Sentry organization + +4. EXAMPLE QUERIES YOU CAN USE: + + a) View recent errors: + "Show me Sentry errors from the past 24 hours" + + b) Analyze critical issues: + "Find the most critical Sentry error affecting users in production" + + c) Performance analysis: + "Analyze Sentry performance data for slow transactions" + + d) Create GitHub issues: + "Analyze recent Sentry errors and create GitHub issues for critical bugs" + +======================================== +Alternative: Manual Setup with Auth Token +======================================== + +If OAuth doesn't work, you can use a Sentry auth token: + +1. Get your Sentry auth token from: + https://sentry.io/settings/account/api/auth-tokens/ + +2. Run the MCP server manually: + npx @sentry/mcp-server@latest --access-token=YOUR_TOKEN --host=sentry.io + +======================================== +`); + +// Check if Sentry MCP server is installed +const { exec } = require('child_process'); +exec('npx @sentry/mcp-server@latest --version', (error, stdout, stderr) => { + if (error) { + console.log('āŒ Sentry MCP server not found. Installing...'); + exec('npm install -g @sentry/mcp-server@latest', (err, out, serr) => { + if (err) { + console.log('Error installing:', err.message); + } else { + console.log('āœ… Sentry MCP server installed successfully!'); + } + }); + } else { + console.log('āœ… Sentry MCP server is installed!'); + console.log('Version:', stdout.trim()); + } +}); \ No newline at end of file From 7447936af0fd93f184cb1064001f0baf0c86a72f Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 2 Oct 2025 22:49:51 -0700 Subject: [PATCH 06/13] chore: remove unrelated utility and test files - Remove analyze-sentry-errors.js (Sentry analysis utility) - Remove docs/test-sentry-mcp.js (MCP test script) - Remove .github/workflows/docs-update-check.yml (docs automation workflow) These files were not part of the core documentation changes and should be handled separately from the cookbook documentation. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .github/workflows/docs-update-check.yml | 181 ------------------------ analyze-sentry-errors.js | 172 ---------------------- docs/test-sentry-mcp.js | 82 ----------- 3 files changed, 435 deletions(-) delete mode 100644 .github/workflows/docs-update-check.yml delete mode 100755 analyze-sentry-errors.js delete mode 100644 docs/test-sentry-mcp.js diff --git a/.github/workflows/docs-update-check.yml b/.github/workflows/docs-update-check.yml deleted file mode 100644 index cb625cd3b..000000000 --- a/.github/workflows/docs-update-check.yml +++ /dev/null @@ -1,181 +0,0 @@ -name: Documentation Update Check - -on: - pull_request: - types: [opened, synchronize, ready_for_review] - paths: - - 'core/**/*.ts' - - 'core/**/*.js' - - 'extensions/**/*.ts' - - 'extensions/**/*.js' - - 'packages/**/*.ts' - - 'packages/**/*.js' - - 'gui/**/*.tsx' - - 'gui/**/*.jsx' - -jobs: - check-docs-needed: - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install Continue CLI - run: npm i -g @continuedev/cli - - - name: Analyze changes for documentation needs - id: analyze - env: - CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Get the diff of changed files - git diff origin/main..HEAD --name-only > changed_files.txt - - # Create a detailed diff for analysis - git diff origin/main..HEAD > detailed_diff.txt - - # Use Continue to analyze if docs are needed - ANALYSIS=$(cn --auto --headless \ - "Analyze these code changes and determine if documentation updates are needed. - Consider: - 1. New features or APIs added - 2. Breaking changes to existing functionality - 3. New configuration options or settings - 4. Changes to CLI commands or flags - 5. New integrations or MCP servers - 6. Modified agent behavior or capabilities - - Changed files: $(cat changed_files.txt | tr '\n' ' ') - - If documentation updates are needed, list specific docs that should be updated. - Format as markdown bullet list. - If no docs updates needed, respond with 'NO_DOCS_NEEDED'. - Be concise and specific." 2>&1) || true - - # Save the analysis - echo "$ANALYSIS" > docs_analysis.md - - # Check if docs are needed - if grep -q "NO_DOCS_NEEDED" docs_analysis.md; then - echo "docs_needed=false" >> $GITHUB_OUTPUT - else - echo "docs_needed=true" >> $GITHUB_OUTPUT - fi - - - name: Format documentation suggestions - if: steps.analyze.outputs.docs_needed == 'true' - id: format - run: | - # Create a formatted comment - cat > comment.md << 'EOF' - ## šŸ“š Documentation Update Suggested - - Based on the changes in this PR, the following documentation may need updates: - - EOF - - # Add the analysis (excluding any system output) - cat docs_analysis.md | grep -E "^[\*\-\+]|^[[:space:]]*[\*\-\+]|^#{1,6}" >> comment.md || echo "See detailed analysis below." >> comment.md - - cat >> comment.md << 'EOF' - - --- - - ### Next Steps - - 1. Review the suggested documentation areas - 2. Update relevant docs in the `/docs` folder - 3. Consider updating: - - API references if interfaces changed - - Guides if workflows changed - - Configuration docs if settings changed - - MCP cookbook if new integrations added - - ### Resources - - - [Documentation Contributing Guide](/docs/CONTRIBUTING.mdx) - - [MCP Integration Guide](/docs/guides/mcp-continue-cookbook.mdx) - - [Continue Hub](https://hub.continue.dev) - - This analysis was generated automatically. Please review and update as needed. - EOF - - - name: Post PR comment - if: steps.analyze.outputs.docs_needed == 'true' - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const fs = require('fs'); - const comment = fs.readFileSync('comment.md', 'utf8'); - - // Check if we already commented - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number - }); - - const botComment = comments.find(c => - c.user.type === 'Bot' && - c.body.includes('Documentation Update Suggested') - ); - - if (botComment) { - // Update existing comment - await github.rest.issues.updateComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: botComment.id, - body: comment - }); - } else { - // Create new comment - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: comment - }); - } - - - name: Add label if docs needed - if: steps.analyze.outputs.docs_needed == 'true' - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - labels: ['docs-needed'] - }); - - - name: Remove label if docs not needed - if: steps.analyze.outputs.docs_needed == 'false' - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - try { - await github.rest.issues.removeLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - name: 'docs-needed' - }); - } catch (error) { - // Label might not exist, that's okay - console.log('Label does not exist or already removed'); - } \ No newline at end of file diff --git a/analyze-sentry-errors.js b/analyze-sentry-errors.js deleted file mode 100755 index 534084d52..000000000 --- a/analyze-sentry-errors.js +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env node - -/** - * Sentry Error Analysis Script - * Analyzes errors from the past 24 hours using Sentry's API - */ - -const https = require('https'); -const readline = require('readline'); - -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); - -// Function to make API requests to Sentry -function sentryRequest(token, endpoint) { - return new Promise((resolve, reject) => { - const options = { - hostname: 'sentry.io', - path: `/api/0/${endpoint}`, - method: 'GET', - headers: { - 'Authorization': `Bearer ${token}`, - 'Content-Type': 'application/json' - } - }; - - const req = https.request(options, (res) => { - let data = ''; - res.on('data', (chunk) => data += chunk); - res.on('end', () => { - try { - resolve(JSON.parse(data)); - } catch (e) { - reject(e); - } - }); - }); - - req.on('error', reject); - req.end(); - }); -} - -// Format date for Sentry API -function getDateRange() { - const now = new Date(); - const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000); - return { - start: yesterday.toISOString(), - end: now.toISOString() - }; -} - -// Analyze errors -async function analyzeErrors(token) { - try { - console.log('\nšŸ” Fetching Sentry organizations...'); - const orgs = await sentryRequest(token, 'organizations/'); - - if (!orgs || orgs.length === 0) { - console.log('āŒ No organizations found. Please check your token permissions.'); - return; - } - - console.log(`\nšŸ“Š Found ${orgs.length} organization(s):\n`); - - for (const org of orgs) { - console.log(`\nšŸ¢ Organization: ${org.name} (${org.slug})`); - console.log('─'.repeat(50)); - - // Get projects - const projects = await sentryRequest(token, `organizations/${org.slug}/projects/`); - console.log(` šŸ“ Projects: ${projects.length}`); - - const { start, end } = getDateRange(); - - for (const project of projects) { - console.log(`\n šŸ“Œ Project: ${project.name}`); - - // Get issues for the past 24 hours - const issues = await sentryRequest( - token, - `projects/${org.slug}/${project.slug}/issues/?statsPeriod=24h&query=is:unresolved` - ); - - if (issues && issues.length > 0) { - console.log(` šŸ› Unresolved issues (24h): ${issues.length}`); - - // Analyze top issues - const topIssues = issues.slice(0, 5); - console.log('\n Top 5 Issues:'); - console.log(' ' + '─'.repeat(45)); - - topIssues.forEach((issue, index) => { - const errorCount = issue.count || 0; - const userCount = issue.userCount || 0; - const level = issue.level || 'unknown'; - const title = issue.title || issue.culprit || 'Unknown Error'; - - console.log(`\n ${index + 1}. ${title}`); - console.log(` Level: ${level.toUpperCase()}`); - console.log(` Events: ${errorCount} | Users affected: ${userCount}`); - console.log(` First seen: ${new Date(issue.firstSeen).toLocaleString()}`); - console.log(` Last seen: ${new Date(issue.lastSeen).toLocaleString()}`); - - if (issue.metadata && issue.metadata.type) { - console.log(` Type: ${issue.metadata.type}`); - } - }); - - // Summary statistics - const totalEvents = issues.reduce((sum, issue) => sum + (issue.count || 0), 0); - const totalUsers = issues.reduce((sum, issue) => sum + (issue.userCount || 0), 0); - const criticalIssues = issues.filter(i => i.level === 'error' || i.level === 'fatal').length; - - console.log('\n šŸ“Š 24-Hour Summary:'); - console.log(' ' + '─'.repeat(45)); - console.log(` Total issues: ${issues.length}`); - console.log(` Total events: ${totalEvents}`); - console.log(` Users affected: ${totalUsers}`); - console.log(` Critical issues: ${criticalIssues}`); - } else { - console.log(` āœ… No unresolved issues in the past 24 hours`); - } - } - } - - console.log('\n' + '='.repeat(50)); - console.log('āœ… Analysis complete!'); - - } catch (error) { - console.error('\nāŒ Error analyzing Sentry data:', error.message); - if (error.message.includes('401')) { - console.log('\nšŸ’” Tip: Make sure your token has the correct permissions:'); - console.log(' - project:read'); - console.log(' - org:read'); - console.log(' - event:read'); - } - } -} - -// Main execution -console.log('='.repeat(50)); -console.log('šŸ” SENTRY ERROR ANALYZER (Past 24 Hours)'); -console.log('='.repeat(50)); - -console.log('\nTo get your Sentry Auth Token:'); -console.log('1. Visit: https://sentry.io/settings/account/api/auth-tokens/'); -console.log('2. Create a new token with these scopes:'); -console.log(' - project:read'); -console.log(' - org:read'); -console.log(' - event:read'); -console.log('3. Copy the token and paste it below\n'); - -rl.question('Enter your Sentry Auth Token: ', async (token) => { - if (!token) { - console.log('āŒ No token provided. Exiting...'); - rl.close(); - return; - } - - await analyzeErrors(token.trim()); - rl.close(); -}); - -// Handle cleanup -rl.on('close', () => { - console.log('\nšŸ‘‹ Goodbye!'); - process.exit(0); -}); \ No newline at end of file diff --git a/docs/test-sentry-mcp.js b/docs/test-sentry-mcp.js deleted file mode 100644 index 0d206c229..000000000 --- a/docs/test-sentry-mcp.js +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env node - -// Test script to verify Sentry MCP connection -console.log(` -======================================== -Sentry MCP Setup Guide -======================================== - -To set up Sentry MCP with Continue: - -1. CONFIGURE CONTINUE: - Open VS Code and add this to your Continue config: - - { - "mcpServers": { - "sentry": { - "command": "npx", - "args": ["@sentry/mcp-server@latest"], - "type": "stdio" - } - } - } - -2. TEST THE CONNECTION: - Run this command in your terminal: - - cn - - Then type: - "Show me recent Sentry errors" - -3. OAUTH AUTHENTICATION: - - On first use, Sentry MCP will prompt for OAuth - - Follow the browser authentication flow - - Grant access to your Sentry organization - -4. EXAMPLE QUERIES YOU CAN USE: - - a) View recent errors: - "Show me Sentry errors from the past 24 hours" - - b) Analyze critical issues: - "Find the most critical Sentry error affecting users in production" - - c) Performance analysis: - "Analyze Sentry performance data for slow transactions" - - d) Create GitHub issues: - "Analyze recent Sentry errors and create GitHub issues for critical bugs" - -======================================== -Alternative: Manual Setup with Auth Token -======================================== - -If OAuth doesn't work, you can use a Sentry auth token: - -1. Get your Sentry auth token from: - https://sentry.io/settings/account/api/auth-tokens/ - -2. Run the MCP server manually: - npx @sentry/mcp-server@latest --access-token=YOUR_TOKEN --host=sentry.io - -======================================== -`); - -// Check if Sentry MCP server is installed -const { exec } = require('child_process'); -exec('npx @sentry/mcp-server@latest --version', (error, stdout, stderr) => { - if (error) { - console.log('āŒ Sentry MCP server not found. Installing...'); - exec('npm install -g @sentry/mcp-server@latest', (err, out, serr) => { - if (err) { - console.log('Error installing:', err.message); - } else { - console.log('āœ… Sentry MCP server installed successfully!'); - } - }); - } else { - console.log('āœ… Sentry MCP server is installed!'); - console.log('Version:', stdout.trim()); - } -}); \ No newline at end of file From 22cdeb7fde1cf648da850830cec97951de926d5f Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 2 Oct 2025 22:50:46 -0700 Subject: [PATCH 07/13] docs: add Continue Docs MCP cookbook to overview guide Add link to continue-docs-mcp-cookbook in the MCP Integration Cookbooks section of the guides overview page. Places it at the top of the list as it's the most relevant for contributors working on documentation. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/overview.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guides/overview.mdx b/docs/guides/overview.mdx index 1a29b9a66..01b932715 100644 --- a/docs/guides/overview.mdx +++ b/docs/guides/overview.mdx @@ -19,6 +19,7 @@ description: "Comprehensive collection of practical guides for Continue includin Step-by-step guides for integrating Model Context Protocol (MCP) servers with Continue: +- [Continue Docs MCP Cookbook](/guides/continue-docs-mcp-cookbook) - Use the Continue Docs MCP to write cookbooks, guides, and documentation with AI-powered workflows - [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 - [Snyk + Continue Hub Agent Cookbook (MCP)](/guides/snyk-mcp-continue-cookbook) - Integrate Snyk MCP via Continue Hub to scan code, deps, IaC, and containers From 8c41c392ff5dd596e353efed635172b153d12b5e Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 2 Oct 2025 22:57:58 -0700 Subject: [PATCH 08/13] docs: remove Sanity MCP cookbook link (not yet live) Remove references to guides/sanity-mcp-continue-cookbook from: - docs/docs.json navigation - docs/guides/overview.mdx MCP cookbooks section The Sanity MCP cookbook is not yet available, so removing the broken link to prevent 404 errors. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/docs.json | 1 - docs/guides/overview.mdx | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/docs.json b/docs/docs.json index a3991caa3..ea42918df 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -263,7 +263,6 @@ "guides/continue-docs-mcp-cookbook", "guides/snyk-mcp-continue-cookbook", "guides/dlt-mcp-continue-cookbook", - "guides/sanity-mcp-continue-cookbook", "guides/netlify-mcp-continuous-deployment" ] } diff --git a/docs/guides/overview.mdx b/docs/guides/overview.mdx index 01b932715..d84ffe0a1 100644 --- a/docs/guides/overview.mdx +++ b/docs/guides/overview.mdx @@ -24,7 +24,6 @@ Step-by-step guides for integrating Model Context Protocol (MCP) servers with Co - [Netlify Performance Optimization Cookbook](/guides/netlify-mcp-continuous-deployment) - Optimize web performance with A/B testing and automated monitoring using Netlify MCP - [Snyk + Continue Hub Agent Cookbook (MCP)](/guides/snyk-mcp-continue-cookbook) - Integrate Snyk MCP via Continue Hub to scan code, deps, IaC, and containers - [dlt Data Pipelines Cookbook](/guides/dlt-mcp-continue-cookbook) - Build AI-powered data pipelines with dlt MCP for pipeline inspection, schema management, and debugging -- [Sanity CMS Cookbook](/guides/sanity-mcp-continue-cookbook) - Manage content, schemas, and GROQ queries with Sanity MCP for AI-powered content management ## What Advanced Tutorials Are Available From cef0113aedf4b29eaf736aabda71c4bb977d0616 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Fri, 3 Oct 2025 06:37:41 -0700 Subject: [PATCH 09/13] fix: use PR base ref instead of hardcoded origin/main in workflow Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/continue-docs-mcp-cookbook.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/continue-docs-mcp-cookbook.mdx b/docs/guides/continue-docs-mcp-cookbook.mdx index 3dab28a94..76c4637dd 100644 --- a/docs/guides/continue-docs-mcp-cookbook.mdx +++ b/docs/guides/continue-docs-mcp-cookbook.mdx @@ -374,10 +374,10 @@ jobs: echo "šŸ” Analyzing code changes for documentation needs..." # Get changed files - git diff origin/main..HEAD --name-only > changed_files.txt + git diff origin/${{ github.base_ref }}..HEAD --name-only > changed_files.txt # Create detailed diff - git diff origin/main..HEAD > changes.diff + git diff origin/${{ github.base_ref }}..HEAD > changes.diff # Use Continue agent to check if docs need updates PROMPT="Review these code changes and determine if documentation updates are needed. From b127301dc967b8650f86066697e7c73f1df78df9 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Fri, 3 Oct 2025 08:13:19 -0700 Subject: [PATCH 10/13] docs: Add Sanity MCP Continue cookbook with proper agent configs for CI/interactive modes (#8079) --- docs/guides/sanity-mcp-continue-cookbook.mdx | 610 +++++++++++++++++++ 1 file changed, 610 insertions(+) create mode 100644 docs/guides/sanity-mcp-continue-cookbook.mdx diff --git a/docs/guides/sanity-mcp-continue-cookbook.mdx b/docs/guides/sanity-mcp-continue-cookbook.mdx new file mode 100644 index 000000000..8af21df8d --- /dev/null +++ b/docs/guides/sanity-mcp-continue-cookbook.mdx @@ -0,0 +1,610 @@ +--- +title: "Content Management with Sanity MCP and Continue" +description: "Set up an AI-powered content management workflow that helps you manage schemas, run GROQ queries, handle documentation, and perform migrations using natural language commands." +sidebarTitle: "Sanity CMS with Continue" +--- + + + An AI-powered content management system workflow that uses Continue's AI agent with Sanity + MCP to manage schemas, execute GROQ queries, handle migrations, and maintain documentation - all through simple natural language prompts + + +## Prerequisites + +Before starting, ensure you have: + +- Continue account with **Hub access** +- Read: [Understanding Agents — How to get started with Hub agents](/guides/understanding-agents#how-to-get-started-with-hub-agents) +- Node.js 20+ installed locally +- A [Sanity account](https://www.sanity.io/) and project (free tier works) +- Basic understanding of content management systems + +For all options, first: + + + ```bash + npm i -g @continuedev/cli + ``` + + + + ```bash + npm install -g @sanity/cli + ``` + + + + To use agents in headless mode, you need a [Continue API key](https://hub.continue.dev/settings/api-keys) and proper environment variable configuration. + + +## Getting Started with Sanity + + + +New to Sanity? Follow the [Sanity Getting Started Guide](https://www.sanity.io/docs/getting-started) to set up your first project. + +**Quick setup:** +```bash +npm create sanity@latest +cd your-project-name +npm run dev +``` + +**Key resources:** +- [Sanity Studio](https://www.sanity.io/docs/sanity-studio) - Content editing interface +- [Schema Types](https://www.sanity.io/docs/schema-types) - Define content structure +- [GROQ](https://www.sanity.io/docs/groq) - Query language for fetching content +- [Content Lake](https://www.sanity.io/docs/datastore) - Real-time data store + + + +## Sanity MCP Workflow Options + + + Skip the manual setup and use our pre-built Sanity Assistant agent that includes + the Sanity MCP and optimized content management workflows for more consistent results. You can [remix this agent](/guides/understanding-agents#how-to-get-started-with-hub-agents) to customize it for your specific needs. + + + +After ensuring you meet the **Prerequisites** above, you have two paths to get started: + + + + + + Visit the [Sanity Agent Config](https://hub.continue.dev/continuedev/sanity-agent-config) on Continue Hub and click **"Install Agent"** or run: + + ```bash + cn --config continuedev/sanity-agent-config + ``` + + This agent includes: + - **[Sanity MCP](https://hub.continue.dev/sanity/sanity-mcp)** pre-configured and ready to use + - **Content management rules** for best practices + - **Schema optimization** guidelines + + + + Start with these beginner-friendly prompts to explore your content: + + ```bash + # Content exploration + "Show me all blog posts published in the last month" + + # Schema understanding + "Show me all the document types in my Sanity schema and explain their relationships" + + # Content management + "Create a new product page for our upcoming feature" + ``` + + That's it! The agent handles everything automatically. For more starter prompts and examples, see the [official Sanity MCP blog post](https://www.sanity.io/blog/model-context-protocol). + + + + + **Why Use the Agent?** The pre-built Sanity Assistant agent provides consistent content management workflows and handles MCP configuration automatically, making it easier to get started with AI-powered CMS operations. Results are more consistent and debugging is easier thanks to the [Sanity MCP](https://hub.continue.dev/sanity/sanity-mcp) integration and pre-tested prompts. + + + + + + + + Go to the [Continue Hub](https://hub.continue.dev) and [create a new agent](https://hub.continue.dev/new?type=agent). + + + + Visit the [Sanity MCP on Continue Hub](https://hub.continue.dev/sanity/sanity-mcp) and click **"Install"** to add it to the agent you created in the step above. + + This will add Sanity MCP to your agent's available tools. The Hub listing automatically configures the MCP connection. + + + **Alternative installation methods:** + 1. **Quick CLI install**: `cn --mcp sanity/sanity-mcp` + 2. **With config**: Use [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config) for environment variable setup + 3. **Manual configuration**: Add the MCP to your agent configuration + + Once installed, Sanity MCP tools become available to your Continue agent for all prompts. + + + + **Authentication Options:** + - **Interactive mode**: OAuth authentication via browser (expires after 7 days) + - **Headless/CI mode**: Uses environment variables (SANITY_API_TOKEN, SANITY_PROJECT_ID, etc.) + + See [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config) for environment variable setup. + + + + + + Start with these beginner-friendly prompts: + ```bash + cn + # Try these starter prompts: + # "Show me all blog posts published in the last month" + # "Show me all the document types in my Sanity schema and explain their relationships" + # "Create a new product page for our upcoming feature" + ``` + + For more examples, see the [Sanity MCP blog post](https://www.sanity.io/blog/model-context-protocol). + + + + + + + + To use the pre-built Sanity Assistant agent, you need either: + - **Continue CLI Pro Plan** with the models add-on, OR + - **Your own API keys** added to Continue Hub secrets + + The agent will automatically detect and use your configuration along with the pre-configured Sanity MCP for content operations. Note that OAuth authentication will be required on first use. + + + +--- + +## Sanity MCP Capabilities + + + **Sanity MCP** provides comprehensive tools for content management: + - Execute [GROQ queries](https://www.sanity.io/docs/groq) to fetch and analyze content + - Explore and modify [document schemas](https://www.sanity.io/docs/schema-types) + - Manage [content releases](https://www.sanity.io/docs/release-schedules) and versions + - Handle content [migrations](https://www.sanity.io/docs/migrating-data) between environments + - Automate documentation generation + - Perform bulk content operations + - Manage [localization](https://www.sanity.io/docs/localization) and translations + + The MCP integrates seamlessly with your existing Sanity workspace, providing AI-powered assistance for both development and content operations. + + +--- + +## Your First MCP Conversation + +With everything set up, you're ready for your first AI-powered content conversation! Try these beginner-friendly starter prompts: + + + + ``` + "Show me all blog posts published in the last month" + ``` + + + ``` + "Create a new product page for our upcoming feature" + ``` + + + ``` + "Update our pricing information across all service pages" + ``` + + + ``` + "Schedule the Easter marketing campaign content release for next Tuesday" + ``` + + + + +**New to MCP?** These prompts demonstrate the power of natural language content management. For more examples and detailed explanations, check out the [official Sanity MCP blog post](https://www.sanity.io/blog/model-context-protocol). + + +## Content Management Recipes + +Now you can use natural language prompts to manage your Sanity content and schemas. The Continue agent automatically calls the appropriate Sanity MCP tools. + + +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. + + + + **Where to run these workflows:** + - **IDE Extensions**: Use Continue in VS Code, JetBrains, or other supported IDEs + - **Terminal (TUI mode)**: Run `cn` to enter interactive mode, then type your prompts + - **CLI (headless mode)**: Use `cn -p "your prompt"` for headless commands + + **Test in Plan Mode First**: Before running operations that might make + changes, test your prompts in plan mode (see the [Plan Mode + Guide](/guides/plan-mode-guide); press **Shift+Tab** to switch modes in TUI/IDE). This + shows you what the agent will do without executing it. + + + + + **About the --auto flag**: The `--auto` flag enables tools to run continuously without manual confirmation. This is essential for headless mode where the agent needs to execute multiple tools automatically to complete tasks like schema exploration, GROQ execution, and content migration. + + + +### Schema Management + + + Review and understand your content schema structure. + +**TUI Mode Prompt:** +``` +Show me all document types in my Sanity schema with their fields, +validation rules, and relationships to other types. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Show me all document types in my Sanity schema with their fields, validation rules, and relationships to other types." --auto +``` + + + +### GROQ Queries + + + Run GROQ queries to fetch and analyze content. + +**TUI Mode Prompt:** +``` +Run a GROQ query to fetch all articles published in the last 30 days, +including their titles, authors, categories, and view counts. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Run a GROQ query to fetch all articles published in the last 30 days, including their titles, authors, categories, and view counts." --auto +``` + + + +### Content Operations + + + Perform bulk operations on your content. + +**TUI Mode Prompt:** +``` +Find all blog posts with the category "News" and update their +status to "archived" if they are older than 6 months. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Find all blog posts with the category 'News' and update their status to 'archived' if they are older than 6 months." --auto +``` + + + +### Localization + + + Set up and manage content translations. + +**TUI Mode Prompt:** +``` +Add localization support to my article document type for +Spanish and French languages with appropriate field configurations. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Add localization support to my article document type for Spanish and French languages with appropriate field configurations." --auto +``` + + + +### Content Migration + + + Migrate content between different schemas or environments. + +**TUI Mode Prompt:** +``` +Help me migrate my blog posts from the old schema structure +to the new one, mapping the deprecated fields to the new format. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Help me migrate my blog posts from the old schema structure to the new one, mapping the deprecated fields to the new format." --auto +``` + + + +### Documentation Generation + + + Automatically generate documentation for your content model. + +**TUI Mode Prompt:** +``` +Generate comprehensive documentation for my Sanity schema including +all document types, their purposes, field descriptions, and usage examples. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Generate comprehensive documentation for my Sanity schema including all document types, their purposes, field descriptions, and usage examples." --auto +``` + + + +### Content Releases + + + Work with Sanity's content release feature. + +**TUI Mode Prompt:** +``` +List all active releases in my dataset and show me the content +changes scheduled for each release. +``` + +**Headless Mode Prompt:** +```bash +cn -p "List all active releases in my dataset and show me the content changes scheduled for each release." --auto +``` + + + +### Performance Analysis + + + Optimize GROQ queries for better performance. + +**TUI Mode Prompt:** +``` +Analyze the performance of my most frequent GROQ queries and +suggest optimizations to improve response times. +``` + +**Headless Mode Prompt:** +```bash +cn -p "Analyze the performance of my most frequent GROQ queries and suggest optimizations to improve response times." --auto +``` + + + +## Continuous Content Management with GitHub Actions + +This example demonstrates a **Continuous AI workflow** where content validation and schema checks run automatically in your CI/CD pipeline in headless mode using the Sanity agent config. Consider [remixing this agent](/guides/understanding-agents#how-to-get-started-with-hub-agents) to add your organization's specific content governance rules. + +### Add GitHub Secrets + +Navigate to **Repository Settings → Secrets and variables → Actions** and add: + +- `CONTINUE_API_KEY`: Your Continue API key from [hub.continue.dev/settings/api-keys](https://hub.continue.dev/settings/api-keys) +- `SANITY_PROJECT_ID`: Your Sanity project ID +- `SANITY_DATASET`: Your Sanity dataset name (usually "production") +- `SANITY_API_TOKEN`: Your Sanity API token with appropriate permissions +- `MCP_USER_ROLE`: Your MCP user role (typically "admin" or "editor") + + + The workflow uses the [Sanity Agent Config](https://hub.continue.dev/continuedev/sanity-agent-config) with environment variable authentication via [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config). This enables headless mode operation without OAuth browser authentication. + + +### Create Workflow File + +This workflow automatically validates your Sanity schemas and content on pull requests using the Continue CLI in [headless mode](/cli/overview#headless-mode%3A-production-automation). It checks schema integrity, validates content relationships, and posts a summary report as a PR comment. + +Create `.github/workflows/sanity-content-validation.yml` in your repository: + +```yaml +name: Sanity Content Validation with MCP + +on: + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + validate-content: + runs-on: ubuntu-latest + env: + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} + SANITY_PROJECT_ID: ${{ secrets.SANITY_PROJECT_ID }} + SANITY_DATASET: ${{ secrets.SANITY_DATASET }} + SANITY_API_TOKEN: ${{ secrets.SANITY_API_TOKEN }} + MCP_USER_ROLE: ${{ secrets.MCP_USER_ROLE }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Install Sanity CLI + run: | + npm install -g @sanity/cli + echo "āœ… Sanity CLI installed" + + - name: Install Continue CLI + run: | + npm install -g @continuedev/cli + echo "āœ… Continue CLI installed" + + - name: Validate Schema Structure + run: | + echo "šŸ” Validating schema structure..." + cn --config continuedev/sanity-agent-config \ + -p "Analyze the Sanity schema for any structural issues, + missing required fields, or broken references between document types." \ + --auto + + - name: Check Content Integrity + run: | + echo "šŸ“Š Checking content integrity..." + cn --config continuedev/sanity-agent-config \ + -p "Run GROQ queries to identify any orphaned documents, + broken references, or missing required fields in the content." \ + --auto + + - name: Generate Schema Documentation + run: | + echo "šŸ“ Generating schema documentation..." + cn --config continuedev/sanity-agent-config \ + -p "Generate a markdown summary of all schema changes + in this PR and their potential impact on existing content." \ + --auto > schema-changes.md + + - name: Comment Report on PR + if: always() && github.event_name == 'pull_request' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + REPORT=$(cn --config continuedev/sanity-agent-config \ + -p "Generate a concise summary (200 words or less) of: + - Schema validation results + - Content integrity checks + - Any breaking changes detected + - Recommended actions before merging" \ + --auto) + + gh pr comment ${{ github.event.pull_request.number }} --body "$REPORT" +``` + + + Environment variables enable the MCP to authenticate without OAuth browser prompts. The [Sanity MCP Config](https://hub.continue.dev/sanity/sanity-mcp-config) documentation provides detailed setup instructions for all required variables. + + +## Content Management Best Practices + +Implement automated content quality checks using Continue's rule system. See the [Rules deep dive](/customize/deep-dives/rules) for authoring tips. + + + ```bash + "Before deploying schema changes, validate that all required fields + are present and that no breaking changes affect existing content." + ``` + + + + ```bash + "When creating new content types, ensure they follow the existing + naming conventions and field patterns established in the schema." + ``` + + + + ```bash + "Review GROQ queries for performance issues and suggest indexes + or query restructuring to improve response times." + ``` + + + + ```bash + "Ensure all user-facing content fields have proper localization + support configured for the required languages." + ``` + + +## Troubleshooting + +### Authentication Issues + +```bash +"Check if I'm properly authenticated with Sanity. +If not, help me set up OAuth or API token authentication." +``` + +### Schema Not Found + +```bash +"Verify that the Sanity project is properly configured +and that the schema files are accessible in the current directory." +``` + +### GROQ Query Errors + +```bash +"Debug this GROQ query and explain why it's failing, +then provide a corrected version that achieves the intended result." +``` + +### Migration Conflicts + + + **Verification Steps:** + - Sanity MCP is installed via [Continue Hub](https://hub.continue.dev/sanity/sanity-mcp) + - Project is authenticated with Sanity + - Schema files are present and valid + - Dataset permissions are correctly configured + + +## What You've Built + +After completing this guide, you have a complete **AI-powered content management system** that: + +- āœ… Uses natural language — Simple prompts instead of complex CMS commands +- āœ… Manages schemas automatically — AI handles schema evolution and migrations +- āœ… Runs continuously — Automated validation in CI/CD pipelines +- āœ… Ensures quality — Content checks prevent broken references and invalid data + + + Your content management workflow now operates at **[Level 2 Continuous + AI](https://blog.continue.dev/what-is-continuous-ai-a-developers-guide/)** - + AI handles routine content operations and schema management with human oversight + through review and approval of changes. + + +## Next Steps + +1. **Explore your schema** - Try the schema exploration prompt on your current project +2. **Run GROQ queries** - Use natural language to query your content +3. **Set up CI validation** - Add the GitHub Actions workflow to your repo +4. **Create documentation** - Generate comprehensive docs for your content model +5. **Optimize performance** - Analyze and improve query performance + +## Additional Resources + + + + Complete Sanity platform documentation + + + Explore more MCP integrations and agents + + + Learn GROQ query language + + + Official Sanity MCP introduction with examples + + + Official Sanity MCP documentation + + \ No newline at end of file From eaff6225c138cec4976e4fcdf18e7df4cf407880 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Fri, 3 Oct 2025 08:28:32 -0700 Subject: [PATCH 11/13] fix: update titles of cli releases (#8055) --- .github/workflows/beta-release.yml | 2 +- .github/workflows/stable-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index a52daa05b..192ebb612 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -110,6 +110,6 @@ jobs: # Create GitHub release gh release create "v${{ steps.get_version.outputs.beta_version }}" \ - --title "Beta Release v${{ steps.get_version.outputs.beta_version }}" \ + --title "CLI Beta Release v${{ steps.get_version.outputs.beta_version }}" \ --notes "Daily beta release for testing. This version will be promoted to stable after 7 days if no critical issues are found." \ --prerelease diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.yml index 6c02f1f17..c24abf8f8 100644 --- a/.github/workflows/stable-release.yml +++ b/.github/workflows/stable-release.yml @@ -208,7 +208,7 @@ jobs: # Create GitHub release gh release create "v${{ steps.final_version.outputs.stable_version }}" \ - --title "Stable Release v${{ steps.final_version.outputs.stable_version }}" \ + --title "CLI Stable Release v${{ steps.final_version.outputs.stable_version }}" \ --notes "${{ steps.final_version.outputs.release_notes }}" \ --latest From 60a08712c77ef7dbccc7becde141fb5168dfe6e5 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Fri, 3 Oct 2025 08:29:11 -0700 Subject: [PATCH 12/13] Add beta status tool option and improve status tool description (#8081) --- extensions/cli/src/shared-options.ts | 1 + extensions/cli/src/tools/status.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/cli/src/shared-options.ts b/extensions/cli/src/shared-options.ts index 31572949d..ad385ebf4 100644 --- a/extensions/cli/src/shared-options.ts +++ b/extensions/cli/src/shared-options.ts @@ -14,6 +14,7 @@ export function addCommonOptions(command: Command): Command { .option("--readonly", "Start in plan mode (read-only tools)") .option("--auto", "Start in auto mode (all tools allowed)") .option("--verbose", "Enable verbose logging") + .option("--beta-status-tool", "Enable beta status tool") .option( "--rule ", "Add a rule (can be a file path, hub slug, or string content). Can be specified multiple times.", diff --git a/extensions/cli/src/tools/status.ts b/extensions/cli/src/tools/status.ts index ff85dcd93..3cdaf6a62 100644 --- a/extensions/cli/src/tools/status.ts +++ b/extensions/cli/src/tools/status.ts @@ -24,12 +24,14 @@ export const statusTool: Tool = { displayName: "Status", description: `Set the current status of your task for the user to see -The available statuses are: +The default available statuses are: - PLANNING: You are creating a plan before beginning implementation - WORKING: The task is in progress - DONE: The task is complete - BLOCKED: You need further information from the user in order to proceed +However, if the user explicitly specifies in their prompt to use one or more different statuses, you can use those as well. + You should use this tool to notify the user whenever the state of your work changes. By default, the status is assumed to be "PLANNING" prior to you setting a different status.`, parameters: { type: "object", From bcc7a82a1e89827cbcb0d451215913e5b7e48697 Mon Sep 17 00:00:00 2001 From: "continue[bot]" <230936708+continue[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:30:45 -0700 Subject: [PATCH 13/13] docs: Add feature flag audit example to PostHog MCP cookbook (#8058) Add feature flag audit example to PostHog MCP cookbook - Added comprehensive feature flag audit and cleanup workflow - Included practical Continue CLI prompts for flag management - Added required API scopes and repository labels - Provided sample outputs and tool requirements - Enhanced existing advanced prompts section Fixes CON-4162 Generated with [Continue](https://continue.dev) Co-authored-by: Continue Agent Co-authored-by: Continue Co-authored-by: nate --- docs/guides/posthog-github-continuous-ai.mdx | 64 +++++++++++++++++--- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/docs/guides/posthog-github-continuous-ai.mdx b/docs/guides/posthog-github-continuous-ai.mdx index e74e798c5..b5aac1a1b 100644 --- a/docs/guides/posthog-github-continuous-ai.mdx +++ b/docs/guides/posthog-github-continuous-ai.mdx @@ -67,6 +67,7 @@ First, you'll need to gather your PostHog and GitHub API credentials and add the 3. Name it "Continue CLI Session Analysis" 4. Select these scopes: - `session_recording:read` - **Required** for accessing session data + - `feature_flag:read` - **Required** for feature flag auditing - `insight:read` - `query:read` - `session_recording_playlist:read` @@ -212,9 +213,9 @@ You only need to configure the PostHog MCP credential - it automatically handles **Repository Labels Required**: Make sure your GitHub repository has these labels: -- `bug`, `enhancement` +- `bug`, `enhancement`, `technical-debt` - `high-priority`, `medium-priority`, `low-priority` -- `user-experience`, `automated` +- `user-experience`, `automated`, `feature-flag`, `cleanup` Create missing labels in your repo at: **Settings → Labels → New label** @@ -266,7 +267,57 @@ After completing this guide, you have a complete **Continuous AI system** that: -## Advanced Prompts +## Example Use Cases + +Here are practical examples of what you can build with PostHog MCP and Continue CLI: + +### Session Recording Analysis (Current Implementation) + +The main workflow above focuses on analyzing session recordings to identify UX issues and create GitHub issues automatically. + +### Feature Flag Audit and Cleanup + + + Automatically audit your feature flags to identify unused, outdated, or problematic flags that need attention. + + +**What this workflow does:** +- Fetches all feature flags from your PostHog project +- Analyzes flag usage, rollout status, and configuration +- Identifies flags that may be candidates for removal or updates +- Creates GitHub issues for flag cleanup tasks + +**Example Continue CLI prompts:** + +```bash +# Get all feature flags and analyze them +cn "Use PostHog MCP to fetch all feature flags with mcp__posthog__feature-flag-get-all. Then analyze each flag to identify: 1) Flags that are 100% rolled out and could be removed, 2) Flags that haven't been updated in 90+ days, 3) Flags with complex targeting that might need simplification, 4) Experimental flags that should be cleaned up." + +# Create cleanup issues for identified flags +cn "For each problematic feature flag identified, create a GitHub issue using gh CLI: +- Title: 'šŸ Feature Flag Cleanup: [flag_name]' +- Include flag details: rollout percentage, last modified date, targeting rules +- Add labels: 'technical-debt', 'feature-flag', 'cleanup' +- Set priority based on risk level (high for 100% rollouts, medium for stale flags) +- Include specific recommendations for each flag" + +# Audit flag performance impact +cn "Cross-reference feature flags with PostHog performance metrics to identify flags that may be impacting user experience or site performance. Create performance-focused GitHub issues for flags showing negative impact." +``` + +**Required PostHog MCP Tools:** +- `feature-flag-get-all` - Retrieve all feature flags +- `feature-flag-get-definition` - Get detailed flag configuration +- `query-run` - Run analytics queries to check flag usage +- `insights-get-all` - Get insights related to flag performance + +**Sample Output:** +This workflow creates GitHub issues like: +- "šŸ Feature Flag Cleanup: dark-mode-toggle" (100% rollout, safe to remove) +- "šŸ Feature Flag Review: experimental-checkout" (unused for 120 days) +- "šŸ Feature Flag Simplify: complex-user-targeting" (overly complex rules) + +### Advanced Prompts Consider enhancing your workflow with these advanced Continue CLI prompts: @@ -280,13 +331,12 @@ Consider enhancing your workflow with these advanced Continue CLI prompts: "Cross-reference JavaScript console errors with user actions to identify the root cause of UX issues" - - "Analyze how [PostHog feature flags](https://posthog.com/docs/feature-flags) - impact user behavior in session recordings" + + "Use PostHog MCP to correlate feature flag rollouts with performance metrics and user behavior changes to identify flags causing issues" "Create Slack alerts when critical UX issues are detected in PostHog - sessions" + sessions or when feature flags need attention"