Skip to content

Remove page-to-markdown capability - #192

Merged
kentcdodds merged 3 commits into
mainfrom
cursor/remove-page-to-markdown-6b32
Apr 18, 2026
Merged

kentcdodds merged 3 commits into
mainfrom
cursor/remove-page-to-markdown-6b32

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Apr 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • remove the page_to_markdown coding capability and its Browser Rendering helper implementation
  • purge related tests, prompts, examples, setup notes, and skill-pattern docs so the feature is no longer referenced
  • simplify the Cloudflare mock/API documentation to only cover the remaining internal client and email use cases, then clarify and dedupe the remaining Cloudflare token docs after follow-up review

Testing

  • ✅ npm test -- --run packages/worker/src/mcp/capabilities/coding/coding-capabilities.node.test.ts packages/worker/src/mcp/skills/infer-codemode-capabilities.node.test.ts packages/worker/src/mcp/tools/execute.node.test.ts
  • ✅ npm test -- --run packages/worker/src/mcp/tools/execute.node.test.ts packages/worker/src/mcp/skills/infer-codemode-capabilities.node.test.ts
  • ✅ npm run typecheck
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Removed Features

    • Removed the page-to-markdown capability for converting web pages to Markdown.
  • Documentation

    • Updated docs and examples to remove Browser Rendering references, clarify Cloudflare-related environment variable guidance, and replace page-to-markdown examples with an alternative official guide capability.

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

coderabbitai Bot commented Apr 17, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR removes the page_to_markdown capability and its Browser Rendering integration across the worker, mock Cloudflare server, tests, and docs; replaces example references with kody_official_guide, and updates Cloudflare-related environment and setup documentation to reflect Email/API-only usage.

Changes

Cohort / File(s) Summary
Documentation: Cloudflare & Setup
docs/contributing/environment-variables.md, docs/contributing/setup-manifest.md, docs/contributing/setup.md, docs/contributing/mock-api-servers.md, packages/worker/.env.example
Removed Browser Rendering and page_to_markdown references; narrowed Cloudflare env var and setup guidance to Worker-side API and Email Service usage (local mocks/preview deploys).
Documentation: Skill Patterns & Examples
docs/contributing/skill-patterns/cloudflare-api-v4.md, docs/contributing/skill-patterns/cloudflare-developer-docs.md, docs/contributing/skill-patterns/index.md, docs/use/search.md, packages/worker/src/mcp/server-instructions.ts, packages/worker/src/mcp/tools/execute.ts, packages/worker/src/mcp/tools/search.ts, packages/worker/src/mcp/tools/search-format.ts
Removed Browser Rendering fallback guidance from skill-pattern docs and example skill snippets; updated example entity references from page_to_markdown:capability to kody_official_guide:capability.
Capability Removal: Implementation & Utilities
packages/worker/src/mcp/capabilities/coding/page-to-markdown.ts, packages/worker/src/mcp/capabilities/coding/fetch-page-markdown.ts
Deleted the page_to_markdown capability and the markdown conversion utility (validation, negotiated fetch, Browser Rendering fallback, and related types/exports).
Capability Registration & Tests
packages/worker/src/mcp/capabilities/coding/domain.ts, packages/worker/src/mcp/capabilities/coding/index.ts, packages/worker/src/mcp/capabilities/coding/coding-capabilities.node.test.ts
Removed pageToMarkdownCapability from the coding domain and index exports; deleted tests exercising page-to-markdown/browser-rendering behavior.
Mock Server Changes
packages/mock-servers/cloudflare/src/worker.ts
Removed Browser Rendering markdown endpoint (POST /client/v4/accounts/{accountId}/browser-rendering/markdown), related mock handlers, and the BrowserRenderingMarkdownBody type.
Cloudflare REST Client & Minor Tests
packages/worker/src/mcp/cloudflare/cloudflare-rest-client.ts, packages/worker/src/mcp/skills/infer-codemode-capabilities.node.test.ts, packages/worker/src/mcp/tools/execute.node.test.ts
Adjusted header comment in the Cloudflare REST client to reflect internal Worker-side usage; updated tests/mocks to reference kody_official_guide in place of page_to_markdown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I hop and nibble at removed fluff,

No more browser-rendered markdown stuff.
Guides take the lead, tidy and spry,
Kody guides now show the sky. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Remove page-to-markdown capability' directly and accurately summarizes the primary change: eliminating the page_to_markdown coding capability throughout the codebase.
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/remove-page-to-markdown-6b32

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 April 17, 2026 23:56
@github-actions

github-actions Bot commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Worker: kody-pr-192
D1: kody-pr-192-db
KV: kody-pr-192-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 (4)
packages/worker/src/mcp/tools/search.ts (1)

162-162: Nit: stray leading space before the bullet.

Line 162 begins with - \...`(a leading space), while the surrounding bullets on lines 159–161 and 163–166 use- ` with no leading space. Likely a leftover from the edit — worth normalizing for consistency.

Proposed fix
-  - \`{ "entity": "kody_official_guide:capability" }\`
+- \`{ "entity": "kody_official_guide:capability" }\`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/worker/src/mcp/tools/search.ts` at line 162, Normalize the
inconsistent bullet by removing the stray leading space so the line that
currently reads ` - `{ "entity": "kody_official_guide:capability" }`` becomes `-
`{ "entity": "kody_official_guide:capability" }``; edit the markdown in the
search.ts snippet (the bullet list around the existing entries) to ensure all
bullets use the same `- ` prefix formatting.
docs/contributing/environment-variables.md (1)

99-108: Minor: CLOUDFLARE_API_TOKEN description reads as single-purpose now.

Line 99-100 says the token is used by the internal API client "for the Cloudflare Email sender." Given the internal API client is also used for other Cloudflare API calls (per the cloudflare-rest-client.ts and the /client/v4/* note at Line 33 of .env.example), consider rewording to "…used by the internal API client (e.g., for the Cloudflare Email sender)" so readers don't infer email is the only use. Low priority.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing/environment-variables.md` around lines 99 - 108, The
CLOUDFLARE_API_TOKEN doc line is phrased as if it's only for the Email sender;
update the description to indicate it's used by the internal Cloudflare API
client more generally (e.g., "used by the internal API client (e.g., for the
Cloudflare Email sender)") so readers know it covers other Cloudflare REST
calls; adjust the text near CLOUDFLARE_API_TOKEN in environment-variables.md and
ensure consistency with the note in .env.example and the
cloudflare-rest-client.ts mention.
docs/contributing/skill-patterns/cloudflare-developer-docs.md (1)

71-78: Consider documenting HTML fallback behavior for readers.

The previous version used content-type to detect HTML and invoked a markdown fallback; now the skill returns whatever the docs site responds with. If a path returns HTML (e.g., a page without a markdown variant), the caller will get raw HTML in body. Worth a one-liner noting that the caller should check contentType and that HTML responses won't be auto-converted anymore. Not a blocker.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing/skill-patterns/cloudflare-developer-docs.md` around lines
71 - 78, Add a one-line note in the docs near the fetch response example
explaining that the function returns the raw body and callers must check the
returned contentType (the `contentType` field) before treating `body` as
Markdown because HTML responses (e.g., from a page without a markdown variant)
are not auto-converted anymore; reference the `markdownTokenEstimate` and `body`
slicing behavior so callers know to inspect `contentType` and handle HTML
fallback themselves.
docs/contributing/setup-manifest.md (1)

176-180: Duplicate CLOUDFLARE_API_TOKEN entry.

CLOUDFLARE_API_TOKEN is already documented earlier in the GitHub Actions list at Line 107-108. This second entry at Line 176-180 (under "How to get/set each value") is the "how to get it" counterpart for the earlier bullet, which is the established pattern in this doc — so the duplication is intentional. Just flagging to confirm the wording here ("required for remote AI; user API calls use account secrets + skills") stays in sync with the earlier bullet's framing, which talks about Workers deploy + D1 edit access. The two descriptions emphasize different uses of the same token and could confuse readers scanning only one.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing/setup-manifest.md` around lines 176 - 180, The duplicate
CLOUDFLARE_API_TOKEN entries should be reconciled so their wording is consistent
and clearly distinguishes the two uses: update the earlier GitHub Actions bullet
and the later "How to get/set each value" paragraph (search for the token name
CLOUDFLARE_API_TOKEN) to use matching phrasing that mentions both Workers deploy
+ D1 edit access and remote AI/user API calls via account secrets + skills, or
add a short clarifier sentence in one of the two locations that cross-references
the other to avoid confusion for readers who only see one section.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/contributing/environment-variables.md`:
- Around line 99-108: The CLOUDFLARE_API_TOKEN doc line is phrased as if it's
only for the Email sender; update the description to indicate it's used by the
internal Cloudflare API client more generally (e.g., "used by the internal API
client (e.g., for the Cloudflare Email sender)") so readers know it covers other
Cloudflare REST calls; adjust the text near CLOUDFLARE_API_TOKEN in
environment-variables.md and ensure consistency with the note in .env.example
and the cloudflare-rest-client.ts mention.

In `@docs/contributing/setup-manifest.md`:
- Around line 176-180: The duplicate CLOUDFLARE_API_TOKEN entries should be
reconciled so their wording is consistent and clearly distinguishes the two
uses: update the earlier GitHub Actions bullet and the later "How to get/set
each value" paragraph (search for the token name CLOUDFLARE_API_TOKEN) to use
matching phrasing that mentions both Workers deploy + D1 edit access and remote
AI/user API calls via account secrets + skills, or add a short clarifier
sentence in one of the two locations that cross-references the other to avoid
confusion for readers who only see one section.

In `@docs/contributing/skill-patterns/cloudflare-developer-docs.md`:
- Around line 71-78: Add a one-line note in the docs near the fetch response
example explaining that the function returns the raw body and callers must check
the returned contentType (the `contentType` field) before treating `body` as
Markdown because HTML responses (e.g., from a page without a markdown variant)
are not auto-converted anymore; reference the `markdownTokenEstimate` and `body`
slicing behavior so callers know to inspect `contentType` and handle HTML
fallback themselves.

In `@packages/worker/src/mcp/tools/search.ts`:
- Line 162: Normalize the inconsistent bullet by removing the stray leading
space so the line that currently reads ` - `{ "entity":
"kody_official_guide:capability" }`` becomes `- `{ "entity":
"kody_official_guide:capability" }``; edit the markdown in the search.ts snippet
(the bullet list around the existing entries) to ensure all bullets use the same
`- ` prefix formatting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f5cb401c-fff1-4481-993e-edefdf2163a2

📥 Commits

Reviewing files that changed from the base of the PR and between 9e7cf30 and 588029a.

📒 Files selected for processing (22)
  • docs/contributing/environment-variables.md
  • docs/contributing/mock-api-servers.md
  • docs/contributing/setup-manifest.md
  • docs/contributing/setup.md
  • docs/contributing/skill-patterns/cloudflare-api-v4.md
  • docs/contributing/skill-patterns/cloudflare-developer-docs.md
  • docs/contributing/skill-patterns/index.md
  • docs/use/search.md
  • packages/mock-servers/cloudflare/src/worker.ts
  • packages/worker/.env.example
  • packages/worker/src/mcp/capabilities/coding/coding-capabilities.node.test.ts
  • packages/worker/src/mcp/capabilities/coding/domain.ts
  • packages/worker/src/mcp/capabilities/coding/fetch-page-markdown.ts
  • packages/worker/src/mcp/capabilities/coding/index.ts
  • packages/worker/src/mcp/capabilities/coding/page-to-markdown.ts
  • packages/worker/src/mcp/cloudflare/cloudflare-rest-client.ts
  • packages/worker/src/mcp/server-instructions.ts
  • packages/worker/src/mcp/skills/infer-codemode-capabilities.node.test.ts
  • packages/worker/src/mcp/tools/execute.node.test.ts
  • packages/worker/src/mcp/tools/execute.ts
  • packages/worker/src/mcp/tools/search-format.ts
  • packages/worker/src/mcp/tools/search.ts
💤 Files with no reviewable changes (6)
  • docs/contributing/skill-patterns/cloudflare-api-v4.md
  • packages/worker/src/mcp/capabilities/coding/index.ts
  • packages/mock-servers/cloudflare/src/worker.ts
  • packages/worker/src/mcp/capabilities/coding/page-to-markdown.ts
  • packages/worker/src/mcp/capabilities/coding/coding-capabilities.node.test.ts
  • packages/worker/src/mcp/capabilities/coding/fetch-page-markdown.ts

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

@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)
docs/contributing/setup-manifest.md (1)

178-182: Consolidate duplicate CLOUDFLARE_API_TOKEN setup entries.

Line 178 through Line 182 repeats guidance already introduced at Line 137 onward. Consider merging these into a single subsection so future permission updates happen in one place.

Suggested doc cleanup
-- `CLOUDFLARE_API_TOKEN` (required for remote AI and for Cloudflare API
-  workflows that run with account secrets + skills)
-  - This is the same token described earlier for Workers deploy + D1 access.
-    When you reuse it for remote AI or Cloudflare API workflows, also include
-    the product permissions needed for those APIs.
+  - Include additional product permissions needed for remote AI and Cloudflare
+    API workflows when reusing this token.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing/setup-manifest.md` around lines 178 - 182, Duplicate
guidance about CLOUDFLARE_API_TOKEN exists in the doc; consolidate into a single
subsection named for CLOUDFLARE_API_TOKEN, remove the repeated block, and merge
any unique permission details so updates only need to be made in one place;
ensure the final subsection includes the note that this token is the same one
used for Workers deploy + D1 access and that additional product permissions must
be added when reusing it for remote AI or Cloudflare API workflows (keep the
original wording from the earlier occurrence and delete the later duplicate).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/contributing/setup-manifest.md`:
- Around line 178-182: Duplicate guidance about CLOUDFLARE_API_TOKEN exists in
the doc; consolidate into a single subsection named for CLOUDFLARE_API_TOKEN,
remove the repeated block, and merge any unique permission details so updates
only need to be made in one place; ensure the final subsection includes the note
that this token is the same one used for Workers deploy + D1 access and that
additional product permissions must be added when reusing it for remote AI or
Cloudflare API workflows (keep the original wording from the earlier occurrence
and delete the later duplicate).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2135735c-eb5e-4a3b-a2af-d914ff6dd8cf

📥 Commits

Reviewing files that changed from the base of the PR and between 588029a and 270ee20.

📒 Files selected for processing (4)
  • docs/contributing/environment-variables.md
  • docs/contributing/setup-manifest.md
  • docs/contributing/skill-patterns/cloudflare-developer-docs.md
  • packages/worker/src/mcp/tools/search.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/worker/src/mcp/tools/search.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/contributing/environment-variables.md
  • docs/contributing/skill-patterns/cloudflare-developer-docs.md

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds merged commit bfe1457 into main Apr 18, 2026
9 checks passed
@kentcdodds
kentcdodds deleted the cursor/remove-page-to-markdown-6b32 branch April 18, 2026 00:39
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