Skip to content

Surface integration-backed Kody guidance - #476

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/kody-integration-guidance-cfc6
May 14, 2026
Merged

kentcdodds merged 2 commits into
mainfrom
cursor/kody-integration-guidance-cfc6

Conversation

@kentcdodds

@kentcdodds kentcdodds commented May 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add concise integration-backed workflow guidance to MCP server instructions and search/execute tool descriptions.
  • Strengthen kody_official_guide guidance and user docs around integration bootstrap, smoke tests, and package apps.
  • Add focused assertions covering the surfaced guidance and refresh the official-guide search fixture.
  • Address CodeRabbit’s readability nit by splitting the long official-guide description string.

Testing

  • npx vitest run --config vitest.node.config.ts packages/worker/src/mcp/server-instructions.node.test.ts packages/worker/src/mcp/capabilities/coding/kody-official-guide.node.test.ts packages/worker/src/mcp/tools/search-handler.node.test.ts packages/worker/src/mcp/tools/execute.node.test.ts — 4 files / 16 tests passed.
  • npx vitest run --config vitest.workers.config.ts packages/worker/src/mcp/capabilities/capability-search.workers.test.ts — 1 file / 7 tests passed.
  • After the follow-up readability commit: npx vitest run --config vitest.node.config.ts packages/worker/src/mcp/capabilities/coding/kody-official-guide.node.test.ts — 1 file / 3 tests passed.
  • npm run validate — passed before and after the follow-up commit (format, lint, typecheck, unit, Playwright E2E, MCP E2E).

PR status

  • Marked ready for review with Kody.
  • PR checks are green: ✅ Validate, 🔎 Deploy Preview Resources, Cursor Bugbot, and CodeRabbit.
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation

    • Enhanced guides with step-by-step instructions for integration-backed workflows, including bootstrapping integrations before building packages, apps, or workflows.
  • Improvements

    • Updated tool guidance to direct users to search for integrations, verify secrets, and run authenticated smoke tests before proceeding with development.

Review Change Stack

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented May 14, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR adds integration-bootstrap guidance throughout the Kody system: documentation pages teach the pattern, MCP tool and capability descriptions surface it to users, server instructions reinforce it, test fixtures support new guide variants, and verification tests validate the guidance is present everywhere it should be.

Changes

Integration Bootstrap Guidance Pattern

Layer / File(s) Summary
User documentation for integration bootstrap pattern
docs/guides/integration-bootstrap.md, docs/use/first-steps.md, docs/use/packages.md, docs/use/search.md
Documentation pages are updated to teach the integration bootstrap workflow: first-steps introduces the habit, packages.md adds app-readiness instructions, search.md pairs discovery with bootstrap guidance, and the bootstrap guide itself references using it alongside search results.
MCP tool descriptions with bootstrap guidance
packages/worker/src/mcp/tools/search.ts, packages/worker/src/mcp/tools/execute.ts
Search and execute tool descriptions are extended with paragraphs instructing users to pair discovery with the official integration_bootstrap guide, inspect integration/secret entities, and run authenticated smoke tests before proceeding.
MCP capability and server instructions
packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts, packages/worker/src/mcp/server-instructions.ts
The kody_official_guide capability description emphasizes preferring this capability plus search over local repo exploration; server instructions gain a new integration-backed work convention bullet and broaden OAuth/secret scope to include package apps.
Test fixture expansion for official guides
packages/worker/src/mcp/capabilities/capability-search.workers.test.ts
The kody_official_guide search fixture is extended with additional guide variants (integration_backed_app, generated_ui_oauth, package_service_pattern) in description, keywords, and the inputTypeDefinition union.
Integration bootstrap guidance verification tests
packages/worker/src/mcp/tools/search-handler.node.test.ts, packages/worker/src/mcp/tools/execute.node.test.ts, packages/worker/src/mcp/capabilities/coding/kody-official-guide.node.test.ts, packages/worker/src/mcp/server-instructions.node.test.ts
Helpers and test cases are added to extract and verify tool descriptions and server instructions include the integration-bootstrap flow text, smoke-test guidance, and entity/guide references.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • kentcdodds/kody#102: Adjusts offline-search test expectations and fixture data for extended guide variants in capability-search.workers.test.ts.
  • kentcdodds/kody#447: Updates search/execute guidance text to steer callers toward pairing discovery with executable snippets.
  • kentcdodds/kody#252: Extends search tool to carry optional guidance/nextStep fields that would surface integration-bootstrap recommendations.

🐰 The integration bootstrap dance,
Search, guide, smoke test, prance—
Secrets verified, apps now armed,
No local spelunking! The system's charmed. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Surface integration-backed Kody guidance' directly and concisely summarizes the main change across the pull request: adding guidance about integration-backed workflows throughout documentation and tool descriptions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/kody-integration-guidance-cfc6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kentcdodds
kentcdodds marked this pull request as ready for review May 14, 2026 20:23
@github-actions

github-actions Bot commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-476.kentcdodds.workers.dev

Worker: kody-pr-476
D1: kody-pr-476-db
KV: kody-pr-476-oauth-kv

Mocks:

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts (1)

114-114: 💤 Low value

Consider breaking this long line for better readability.

Line 114 is approximately 700+ characters long, which makes the code difficult to read and edit. While the content is correct and comprehensive, breaking it into multiple shorter strings would improve maintainability.

♻️ Proposed refactor
-		'Load an official Kody guide from the kody GitHub repository (markdown). Prefer this capability plus `search` results over local repo spelunking when Kody auth or integration behavior is already documented. **For third-party integrations that will power a package, package app, or workflow, use `guide: "integration_bootstrap"` first.** It covers checking saved `integration` / `secret` entities and running the cheap authenticated smoke test before building. For non-OAuth APIs backed by saved secrets, then use `guide: "secret_backed_integration"` as the default recipe. After the smoke test passes and you are ready to build a package app, use `guide: "integration_backed_app"` for the default package-app pattern. For OAuth mechanics, then use `guide: "oauth"` (standard `/connect/oauth` path). Use `generated_ui_oauth` only for custom package-app OAuth. For API keys/PATs, use `connect_secret` for secret collection. For package-native long-lived service work built on `kody.services`, use `package_service_pattern`. If you are unsure, **call this capability** with the right `guide` instead of guessing.',
+		'Load an official Kody guide from the kody GitHub repository (markdown). ' +
+		'Prefer this capability plus `search` results over local repo spelunking when Kody auth or integration behavior is already documented. ' +
+		'**For third-party integrations that will power a package, package app, or workflow, use `guide: "integration_bootstrap"` first.** ' +
+		'It covers checking saved `integration` / `secret` entities and running the cheap authenticated smoke test before building. ' +
+		'For non-OAuth APIs backed by saved secrets, then use `guide: "secret_backed_integration"` as the default recipe. ' +
+		'After the smoke test passes and you are ready to build a package app, use `guide: "integration_backed_app"` for the default package-app pattern. ' +
+		'For OAuth mechanics, then use `guide: "oauth"` (standard `/connect/oauth` path). ' +
+		'Use `generated_ui_oauth` only for custom package-app OAuth. ' +
+		'For API keys/PATs, use `connect_secret` for secret collection. ' +
+		'For package-native long-lived service work built on `kody.services`, use `package_service_pattern`. ' +
+		'If you are unsure, **call this capability** with the right `guide` instead of guessing.',
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts` at line
114, The long single-line description in kody-official-guide.ts should be broken
into multiple shorter string segments for readability: locate the capability
description string that starts with "Load an official Kody guide from the kody
GitHub repository (markdown)..." and split it into concatenated pieces (either a
template literal spanning multiple lines or multiple quoted strings joined with
+) so each line stays under ~120 chars, preserving the exact wording, markdown
emphasis (e.g., **bold**) and punctuation, and ensure the surrounding
object/array (the capability entry) still has the trailing comma and formatting
unchanged (update the variable or property where this string appears
accordingly).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts`:
- Line 114: The long single-line description in kody-official-guide.ts should be
broken into multiple shorter string segments for readability: locate the
capability description string that starts with "Load an official Kody guide from
the kody GitHub repository (markdown)..." and split it into concatenated pieces
(either a template literal spanning multiple lines or multiple quoted strings
joined with +) so each line stays under ~120 chars, preserving the exact
wording, markdown emphasis (e.g., **bold**) and punctuation, and ensure the
surrounding object/array (the capability entry) still has the trailing comma and
formatting unchanged (update the variable or property where this string appears
accordingly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1545a861-d792-4145-9422-f65a3db8c8b3

📥 Commits

Reviewing files that changed from the base of the PR and between 8306448 and 9ea6420.

📒 Files selected for processing (13)
  • docs/guides/integration-bootstrap.md
  • docs/use/first-steps.md
  • docs/use/packages.md
  • docs/use/search.md
  • packages/worker/src/mcp/capabilities/capability-search.workers.test.ts
  • packages/worker/src/mcp/capabilities/coding/kody-official-guide.node.test.ts
  • packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts
  • packages/worker/src/mcp/server-instructions.node.test.ts
  • packages/worker/src/mcp/server-instructions.ts
  • packages/worker/src/mcp/tools/execute.node.test.ts
  • packages/worker/src/mcp/tools/execute.ts
  • packages/worker/src/mcp/tools/search-handler.node.test.ts
  • packages/worker/src/mcp/tools/search.ts

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds merged commit 056043e into main May 14, 2026
5 checks passed
@kentcdodds
kentcdodds deleted the cursor/kody-integration-guidance-cfc6 branch May 14, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants