Restructure docs for agent-ready site workflow#59
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (2)
📜 Recent review details🔇 Additional comments (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughReframes Leadtype as an agent-ready docs pipeline: adds middleware/serving guidance, rewrites quickstart, updates build/deploy and framework integration docs, introduces comprehensive source configuration, restructures navigation/config, and adjusts links/tests accordingly. ChangesAgent-Ready Docs Site Restructuring
Sequence Diagram(s)sequenceDiagram
participant Author as Author/App
participant CLI as Leadtype CLI
participant Config as docs.config.ts
participant Artifacts as Generated Artifacts
participant Middleware as App Middleware
participant Agent as Agent/LLM
Author->>CLI: npx leadtype generate
CLI->>Config: Load nav/product config
CLI->>Artifacts: Generate llms.txt, llms-full.txt, markdown mirrors, search.json, agent-readability.json
Author->>Middleware: Wire serve-agent-responses middleware
Agent->>Middleware: Request markdown via Accept header
Middleware->>Artifacts: Read markdown mirrors, regenerate sitemap/robots
Middleware->>Agent: Return markdown with content negotiation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d3826e850
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "mdx", | ||
| "remark", | ||
| "search", | ||
| "evals", | ||
| ], |
There was a problem hiding this comment.
Include frontmatter transformers in Reference nav
With this change the Reference section switched from { include: "*" } to an explicit pages list, and docs/reference/frontmatter-transformers.mdx is not listed. The generator only emits pages reachable through this curated nav in the committed artifacts, so /docs/reference/frontmatter-transformers is now absent from apps/example/src/generated/docs-pages.json even though the source page still exists; users lose that reference page from the site and agent bundles unless it is added here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/authoring/frontmatter.mdx (1)
97-105:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate the explanatory sentence to match the new nested-group example.
The snippet now uses
source-primitive/agent-artifacts, but Line 105 still saysgroup: remote-source, which makes the example internally inconsistent.Suggested fix
-A page sets `group: remote-source` and lands in that nested slot. Only **leaf** groups (no children) directly contain pages; non-leaf groups are headings only. +A page sets `group: source-primitive` (or `group: agent-artifacts`) and lands in that nested slot. Only **leaf** groups (no children) directly contain pages; non-leaf groups are headings only.🤖 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 `@docs/authoring/frontmatter.mdx` around lines 97 - 105, The explanatory sentence below the frontmatter example is inconsistent with the shown nested-group keys; update the sentence that mentions `group: remote-source` so it references the actual example keys (`source-primitive` / `agent-artifacts`) and clarifies that only leaf groups contain pages; modify the text that currently reads "A page sets `group: remote-source` and lands in that nested slot" to instead reference a page setting `group: source-primitive` (or `agent-artifacts`) to match the `children` array and emphasize that non-leaf groups are headings only.
🤖 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.
Inline comments:
In `@docs/build/deploy-generated-artifacts.mdx`:
- Around line 103-124: The example middleware uses h3/Nitro utilities but
doesn't import them; add an import for eventHandler, getRequestURL, and
getHeaders from "h3" at the top of the module so the exported handler
(eventHandler(...)) and the calls to getRequestURL and getHeaders resolve
correctly; specifically, add an import statement for eventHandler, getHeaders,
getRequestURL so normalizeAgentReadabilityManifest, createAgentMarkdownResponse,
and readMarkdownFile can be used without reference errors.
In `@docs/build/framework-matrix.mdx`:
- Around line 75-89: The text in use-the-source-primitive.mdx incorrectly calls
the leadtype/nuxt adapter a "future adapter"; update the copy to reflect that
the adapter already exists in production by removing the "future adapter"
language and instead state that createLoadPageData from "leadtype/nuxt" is
available (as used in apps/nuxt-example/server/api/docs.get.ts), and adjust any
example text referencing createLoadPageData to present it as an existing adapter
rather than a future one.
In `@docs/quickstart.mdx`:
- Around line 42-43: The example for bestStartingPoints in docs/quickstart.mdx
is missing required fields for the new config contract; update the example
object(s) in bestStartingPoints to use the full structured shape (include
urlPath, title, and description) so the quickstart shows valid config for the
new contract (refer to bestStartingPoints and the surrounding quickstart example
to locate and replace the current [{ urlPath: "/docs" }] entry).
---
Outside diff comments:
In `@docs/authoring/frontmatter.mdx`:
- Around line 97-105: The explanatory sentence below the frontmatter example is
inconsistent with the shown nested-group keys; update the sentence that mentions
`group: remote-source` so it references the actual example keys
(`source-primitive` / `agent-artifacts`) and clarifies that only leaf groups
contain pages; modify the text that currently reads "A page sets `group:
remote-source` and lands in that nested slot" to instead reference a page
setting `group: source-primitive` (or `agent-artifacts`) to match the `children`
array and emphasize that non-leaf groups are headings only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 74d3bd17-a317-4d74-8e7a-c37673fe46cd
⛔ Files ignored due to path filters (5)
apps/example/src/generated/agent-readability.jsonis excluded by!**/generated/**apps/example/src/generated/docs-nav.jsonis excluded by!**/generated/**apps/example/src/generated/docs-pages.jsonis excluded by!**/generated/**apps/example/src/generated/docs-search-content.jsonis excluded by!**/generated/**apps/example/src/generated/docs-search-index.jsonis excluded by!**/generated/**
📒 Files selected for processing (23)
README.mddocs/authoring/components.mdxdocs/authoring/frontmatter.mdxdocs/build/build-a-docs-site.mdxdocs/build/deploy-generated-artifacts.mdxdocs/build/framework-matrix.mdxdocs/build/generate-static-artifacts.mdxdocs/build/optimize-docs-for-agents.mdxdocs/build/serve-agent-responses.mdxdocs/build/use-the-source-primitive.mdxdocs/build/validate-in-ci.mdxdocs/docs.config.tsdocs/how-it-works.mdxdocs/index.mdxdocs/methodology.mdxdocs/quickstart.mdxdocs/reference/cli.mdxdocs/reference/evals.mdxdocs/reference/mdx.mdxdocs/reference/source.mdxdocs/sources/collections.mdxdocs/sources/configure-sources.mdxpackages/leadtype/src/cli.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Preferunknownoveranywhen the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions
Files:
packages/leadtype/src/cli.test.tsdocs/docs.config.ts
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, nevervar
Alwaysawaitpromises in async functions - don't forget to use the return value
Useasync/awaitsyntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't useeval()or assign directly todocument.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code
Files:
packages/leadtype/src/cli.test.tsdocs/docs.config.ts
**/*.{test,spec}.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions insideit()ortest()blocks
Avoid done callbacks in async tests - use async/await instead
Don't use.onlyor.skipin committed code
Keep test suites reasonably flat - avoid excessivedescribenesting
Files:
packages/leadtype/src/cli.test.ts
🪛 LanguageTool
docs/build/serve-agent-responses.mdx
[style] ~155-~155: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ..., must-revalidate. readMarkdownFile` may be sync or async. In Node/Bun, read fro...
(MISSING_IT_THERE)
[style] ~155-~155: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ..., fetch from KV/R2 or an asset binding. In Vercel Edge, fetch from the deployment'...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~175-~175: You have already used ‘right’ in nearby sentences. Consider using an alternative word to let your writing stand out and sound more polished.
Context: ...ew, staging, and prod all advertise the right URLs without per-environment config. T...
(REP_RIGHT)
🔇 Additional comments (20)
docs/build/validate-in-ci.mdx (1)
54-86: LGTM!docs/docs.config.ts (1)
15-86: LGTM!Also applies to: 96-144
docs/reference/cli.mdx (1)
12-12: LGTM!Also applies to: 47-47, 161-161
docs/reference/evals.mdx (1)
8-8: LGTM!Also applies to: 19-23
docs/reference/mdx.mdx (1)
8-8: LGTM!README.md (1)
30-30: LGTM!Also applies to: 36-42, 66-66
packages/leadtype/src/cli.test.ts (1)
204-204: LGTM!docs/how-it-works.mdx (1)
45-46: LGTM!Also applies to: 118-137, 161-162
docs/methodology.mdx (1)
26-27: LGTM!Also applies to: 37-38
docs/index.mdx (1)
3-3: LGTM!Also applies to: 8-10, 31-45, 51-68
docs/authoring/components.mdx (1)
12-13: LGTM!docs/quickstart.mdx (1)
3-3: LGTM!Also applies to: 8-10, 12-13, 18-37, 50-195
docs/build/serve-agent-responses.mdx (1)
1-187: LGTM!docs/build/optimize-docs-for-agents.mdx (1)
3-3: LGTM!Also applies to: 10-10, 33-33, 64-67, 107-109
docs/build/build-a-docs-site.mdx (1)
1-64: LGTM!docs/build/use-the-source-primitive.mdx (1)
1-235: LGTM!docs/reference/source.mdx (1)
1-226: LGTM!docs/sources/collections.mdx (1)
1-187: LGTM!docs/build/generate-static-artifacts.mdx (1)
1-205: LGTM!docs/sources/configure-sources.mdx (1)
195-195: The bundle documentation link is valid.The referenced path
/docs/package-docs/bundleexists asdocs/package-docs/bundle.mdxand is properly configured in the documentation system.
| ## Nuxt/Nitro | ||
|
|
||
| Nuxt Content is a Nuxt CMS. Leadtype is the portable artifact pipeline: use it when the same source needs framework-agnostic markdown, search JSON, `llms.txt`, and package docs. | ||
|
|
||
| Keep Leadtype source loading and adapter helpers in Nitro server files, not Vue client bundles: | ||
|
|
||
| ```ts title="server/api/docs.get.ts" | ||
| import { createLoadPageData } from "leadtype/nuxt"; | ||
|
|
||
| const source = await getSource(); | ||
| const loadPageData = createLoadPageData({ source }); | ||
| ``` | ||
|
|
||
| Use `leadtype/search/vue` for the client search composable. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if leadtype/nuxt adapter exports exist
rg -n "leadtype/nuxt" --type=ts -g '!docs/**' -C3Repository: inthhq/leadtype
Length of output: 1834
Update use-the-source-primitive.mdx: the leadtype/nuxt adapter already exists.
The framework-matrix.mdx example correctly imports createLoadPageData from leadtype/nuxt, which is an existing adapter used in production code (e.g., apps/nuxt-example/server/api/docs.get.ts). However, use-the-source-primitive.mdx still refers to it as a "future adapter" on line 204. Remove the "future adapter" language to reflect current state.
🤖 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 `@docs/build/framework-matrix.mdx` around lines 75 - 89, The text in
use-the-source-primitive.mdx incorrectly calls the leadtype/nuxt adapter a
"future adapter"; update the copy to reflect that the adapter already exists in
production by removing the "future adapter" language and instead state that
createLoadPageData from "leadtype/nuxt" is available (as used in
apps/nuxt-example/server/api/docs.get.ts), and adjust any example text
referencing createLoadPageData to present it as an existing adapter rather than
a future one.
There was a problem hiding this comment.
Important
Two regressions worth fixing before merge: the new explicit Reference nav drops the just-added frontmatter-transformers page, and one quickstart card link points to a slug that doesn't exist in the regenerated nav. Both are anchored inline.
TL;DR — Reorganizes the docs around an "agent-ready site" workflow, adds docs/sources/configure-sources.mdx, splits runtime serving out of optimize-docs-for-agents.mdx into a new serve-agent-responses.mdx, and refreshes copy across the build/source/quickstart pages around site mode, bundle mode, and Agent Readability.
Key changes
- New nav shape in
docs/docs.config.ts— Start / Build an Agent-Ready Site / Docs Sources / Package Docs for Agents / Author Content / Reference, and expandedbestStartingPointswith per-entry title and description. - Split runtime serving into
docs/build/serve-agent-responses.mdx— middleware, JSON-LD, sitemap/robots regenerators move out ofoptimize-docs-for-agents.mdxand cross-link both ways. - Add
docs/sources/configure-sources.mdx— task-led source guide covering single folder,--docs-dirmounts, and remote git collections. - Refresh framework coverage — Vite-only and "any other host" sections removed; explicit recipes for Next, TanStack Start, Nuxt, Astro, SvelteKit, Fumadocs replace them across
build-a-docs-site,use-the-source-primitive,framework-matrix,deploy-generated-artifacts. - Regenerate
apps/example/src/generated/*and aligncli.test.ts— picks up the renamed page titleBuild an agent-ready docs site.
Summary | 28 files | 4 commits | base: main ← KayleeWilliams/restructure-docs-2
Reference nav drops frontmatter-transformers
Before: Reference used
pages: [{ include: "*" }], so any newdocs/reference/*.mdx(including the just-mergedfrontmatter-transformers.mdxfrom #58) was picked up automatically.
After: Reference is now an explicit list that omitsfrontmatter-transformers.
Confirmed by the regenerated artifacts in this PR: apps/example/src/generated/docs-pages.json and docs-nav.json both have zero occurrences of frontmatter-transformers, so the page won't render in the sidebar or appear in the agent-readability manifest.
docs/docs.config.ts · apps/example/src/generated/docs-nav.json
Quickstart SvelteKit card anchor doesn't match generated slug
Before:
href="/docs/build/use-the-source-primitive#sveltekit-mdsvex"(single dash) — matched the slug Leadtype's slugger produces.
After:href="/docs/build/use-the-source-primitive#sveltekit--mdsvex"(double dash) — anchor doesn't exist.
The regenerated docs-nav.json and agent-readability.json from this PR both record the slug as #sveltekit-mdsvex for the ### SvelteKit + mdsvex heading, so the new link will land on the page top instead of the section.
bestStartingPoints title leaks editorial shorthand
Before: No per-entry title or description in
bestStartingPoints.
After: Each entry gets a curated title/description that feeds the Agent Readability manifest.
Most entries match the underlying page title cleanly. The Build a docs site (router) entry stands out — the page title is Build an agent-ready docs site, and (router) is unexplained jargon agents and humans will see in the manifest.
Claude Opus | 𝕏
| base: "reference", | ||
| pages: [{ include: "*" }], | ||
| pages: [ | ||
| "architecture", | ||
| "cli", | ||
| "source", | ||
| "llm", | ||
| "convert", | ||
| "lint", | ||
| "mdx", | ||
| "remark", | ||
| "search", | ||
| "evals", | ||
| ], |
There was a problem hiding this comment.
frontmatter-transformers is missing from this explicit list. The previous shape pages: [{ include: "*" }] auto-included every docs/reference/*.mdx, so the new frontmatter-transformers.mdx page added in #58 no longer appears in the Reference sidebar or the agent-readability manifest (verified: zero matches in the regenerated docs-pages.json / docs-nav.json). Add it to the list, or revert to a glob include for Reference.
| title="SvelteKit" | ||
| description="mdsvex preprocessor + createMdxSourcePlugins()." | ||
| href="/docs/build/use-the-source-primitive#sveltekit-mdsvex" | ||
| href="/docs/build/use-the-source-primitive#sveltekit--mdsvex" |
There was a problem hiding this comment.
Anchor mismatch: the regenerated docs-nav.json shows the actual slug is #sveltekit-mdsvex (single dash), not #sveltekit--mdsvex. Leadtype's slugger collapses + and surrounding whitespace into a single -. The previous single-dash form was correct.
| href="/docs/build/use-the-source-primitive#sveltekit--mdsvex" | |
| href="/docs/build/use-the-source-primitive#sveltekit-mdsvex" |
| }, | ||
| { | ||
| urlPath: "/docs/build/build-a-docs-site", | ||
| title: "Build a docs site (router)", |
There was a problem hiding this comment.
The (router) suffix is inconsistent with the page's real title (Build an agent-ready docs site) and is unexplained jargon as it appears in the agent-readability manifest. Consider aligning with the page title, e.g. Build an agent-ready docs site, or dropping the parenthetical.
There was a problem hiding this comment.
No new issues. Reviewed the following changes:
- Restored
frontmatter-transformersin the explicit Reference nav so the just-merged page reappears in the sidebar and Agent Readability manifest. - Fixed the quickstart SvelteKit card anchor from
#sveltekit--mdsvexto#sveltekit-mdsvexto match the slug in the regenerated artifacts. - Renamed the
bestStartingPointsentry from "Build a docs site (router)" to "Build an agent-ready docs site". - Added the missing
h3import to the TanStack Start middleware example and expanded the quickstartbestStartingPointssnippet withtitleanddescriptionfields. - Reframed TanStack Start, Nuxt, SvelteKit, and Astro guidance from "future adapter" language to concrete adapter helpers (
createLoadPageData,createEntries,createDocsServerHandler, Nitro handlers), and switchedarchitecture.mdxfrom "Planned adapter shapes" to "Adapter shapes" — verified each named export exists. - Regenerated
apps/example/src/generated/*to track the nav, slug, and adapter copy changes.
Claude Opus | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@docs/build/deploy-generated-artifacts.mdx`:
- Around line 103-124: The example middleware calls createAgentMarkdownResponse
and passes readMarkdownFile but never defines or imports readMarkdownFile; add a
function (e.g., readMarkdownFile) that reads markdown from your docs folder and
import node fs/path as needed, then pass that function into
createAgentMarkdownResponse; reference the manifest constant and the
eventHandler wrapper so the fix adds a docsRoot (or equivalent) path resolver
and an async readMarkdownFile(relativePath: string) that returns the file
contents (utf8) for the given relativePath before exporting the eventHandler.
In `@docs/quickstart.mdx`:
- Around line 189-190: Update the two links that currently point to "Optimize
docs for agents" so they instead point to the new dedicated runtime page "Serve
agent responses" (replace the link text/target "[Optimize docs for
agents](/docs/build/optimize-docs-for-agents)" with the "Serve agent responses"
page link, e.g. "[Serve agent responses](/docs/build/serve-agent-responses)");
search for the literal link text "Optimize docs for agents" in
docs/quickstart.mdx (appears in the sentence about runtime handling for markdown
responses, sitemap/robots regeneration, and JSON-LD and again later) and update
both occurrences to reference the new page and wording.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0c5ed51c-ba30-4564-96b2-e796ad1403b8
⛔ Files ignored due to path filters (5)
apps/example/src/generated/agent-readability.jsonis excluded by!**/generated/**apps/example/src/generated/docs-nav.jsonis excluded by!**/generated/**apps/example/src/generated/docs-pages.jsonis excluded by!**/generated/**apps/example/src/generated/docs-search-content.jsonis excluded by!**/generated/**apps/example/src/generated/docs-search-index.jsonis excluded by!**/generated/**
📒 Files selected for processing (6)
docs/build/deploy-generated-artifacts.mdxdocs/build/use-the-source-primitive.mdxdocs/docs.config.tsdocs/quickstart.mdxdocs/reference/architecture.mdxdocs/sources/configure-sources.mdx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Preferunknownoveranywhen the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions
Files:
docs/docs.config.ts
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, nevervar
Alwaysawaitpromises in async functions - don't forget to use the return value
Useasync/awaitsyntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't useeval()or assign directly todocument.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code
Files:
docs/docs.config.ts
🔇 Additional comments (5)
docs/build/deploy-generated-artifacts.mdx (1)
9-9: LGTM!Also applies to: 97-101, 127-127, 221-223, 225-226, 256-263
docs/build/use-the-source-primitive.mdx (1)
3-3: LGTM!Also applies to: 8-8, 191-191, 193-205, 206-219, 232-235
docs/reference/architecture.mdx (1)
43-59: LGTM!docs/sources/configure-sources.mdx (1)
1-215: LGTM!docs/docs.config.ts (1)
15-87: LGTM!Also applies to: 96-129, 133-145
There was a problem hiding this comment.
No new issues. Reviewed the following changes:
- Added a concrete
readMarkdownFileimplementation to the TanStack Start middleware example, with imports fornode:fs/promises,node:path, and theMarkdownMirrorTargettype — verified the type is re-exported fromleadtype/llm/readability. - Renamed the two "Optimize docs for agents" links in
quickstart.mdx(the inline next-step sentence and the "Common next steps" table row) to "Serve agent responses", pointing at the new dedicated runtime page. - Regenerated
apps/example/src/generated/*to track the renamed links.
Claude Opus | 𝕏

Summary
Restructures the Leadtype docs around the agent-ready site workflow:
Validation
bun run checkbun test