Skip to content

feature: MCP Server + Skill #3497

Merged
xiaoyatong merged 24 commits into
jdf2e:feat_v4.xfrom
alvinhui:feat/ai-coding-cli
Jul 20, 2026
Merged

feature: MCP Server + Skill #3497
xiaoyatong merged 24 commits into
jdf2e:feat_v4.xfrom
alvinhui:feat/ai-coding-cli

Conversation

@alvinhui

@alvinhui alvinhui commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

背景

AI 编程助手(Claude Code / Cursor / Copilot 等)在写 NutUI React 代码时,常凭记忆猜测组件 API,导致 Prop 名、枚举值出现「幻觉」。本 MR
新增一套离线知识查询能力,让 Agent 从「猜 API」变成「查 API」,从根源消除幻觉。

主要改动

1. 新增 @nutui/nutui-react-cli

面向 AI Coding 的离线知识查询 CLI,把组件的 Props、文档、示例、Design Token 在构建期打包随包分发:

  • 完全离线、零 API Key:安装后本地毫秒级查询,无需网络。
  • 结构化输出:所有命令支持 --format json,供 Agent 直接解析。
  • 拼写纠错:组件名大小写不敏感,未命中时给出「你是否想找」建议。
命令 说明
list [--category] 按分类列出全部组件
info <Component> 查看组件 Props 表
doc <Component> [--lang zh|en] 查看组件完整文档
demo <Component> [name] 列出/查看示例源码
token [Component] 查看 Design Token

2. MCP 服务(IDE 集成)

nutui-react mcp 启动本地 stdio MCP 服务,把同一份离线知识注册成 IDE 原生工具,供 Claude Code / Cursor / VS Code / Codex 在对话中按需自动调用,暴露 5
个只读工具(nutui_list / nutui_info / nutui_doc / nutui_demo / nutui_token)与 2 个提示词(nutui-expert / nutui-page-generator)。

3. 内置 Skill(约束 Agent 何时用)

内置一份遵循 Anthropic Agent Skills 规范的 Skill 文件随包分发。CLI/MCP 提供「能力」,Skill 则约束 Agent「什么时候、按什么顺序」使用——例如「写组件前先 info
查 Props、再 demo 拿示例」「定制样式用 var(--nutui-*) token 而非硬编码颜色」。

4. 文档站点更新

  • 新增 ai-react 文档:for-agents / cli / mcp(均含中英文)。
  • 导航新增 For AgentsCLIMCP Server 三个入口。
  • AI 板块默认页由 llms 调整为 for-agents,作为面向 Agent 的统一入口。

使用方式

# 免安装直接查询
npx @nutui/nutui-react-cli info Button

# 安装 Skill 到当前项目
npm i -D @nutui/nutui-react-cli
npx skills add ./node_modules/@nutui/nutui-react-cli/skills/nutui-react

作为 MCP 服务接入 IDE(.mcp.json / .cursor/mcp.json 等):

{
  "mcpServers": {
    "nutui-react": {
      "command": "npx",
      "args": ["-y", "@nutui/nutui-react-cli", "mcp"]
    }
  }
}

测试计划

  • pnpm --dir packages/nutui-react-cli build 构建通过
    image
  • node dist/cli.js list / info Button / doc Button / demo Button / token Button 各命令输出正常(text 与 json 两种格式)
    image
    image
    image
    image
  • 组件名拼写纠错(如 Buttn → Button)生效
    image
  • nutui-react mcp 在 Claude Code / Cursor 中可正常拉起并调用 5 个工具
  • 文档站点 For Agents / CLI / MCP Server 页面与导航跳转正常(中英文)
    image
    image

Summary by CodeRabbit

  • 新功能
    • 新增 NutUI React 离线知识查询 CLI:支持组件列表、Props/文档/示例/Design Token 查询,并提供文本与结构化 JSON 输出;支持大小写不敏感检索与拼写纠错。
    • 新增 MCP 服务,并配套 Agent Skill,提供只读工具与提示词用于 IDE/AI 工具集成。
  • 文档
    • 补充并新增 CLI、MCP 与 For Agents(AI 编码代理)使用指南,中英文说明与配置示例。
  • 改进
    • 更新站点 AI 导航入口,新增 For Agents、CLI、MCP 页面。
  • 其他
    • 调整构建与日志忽略规则,优化仓库提交内容。

alvinhui and others added 15 commits July 8, 2026 19:06
- Introduced a new script `build-meta.mjs` to aggregate component metadata from various sources.
- Added a new command `generate:meta` in `package.json` to run the metadata generation.
- Created `meta/components.json` to store the generated component metadata, including categories and global tokens.
- Replaced direct comparison of import.meta.url with pathToFileURL for improved URL handling.
# Conflicts:
#	.gitignore
#	scripts/build-llms.mjs
#	scripts/site/vite-plugin-llms.mjs
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the action:review This PR needs more reviews (less than 2 approvals) label Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

新增 @nutui/nutui-react-cli,将组件元数据、文档、示例和 Design Token 打包为离线快照,并提供文本/JSON CLI 查询、拼写建议、MCP stdio 服务、Agent Skill、站点导航与配套文档。

Changes

NutUI React 离线 CLI 与 MCP

Layer / File(s) Summary
离线 CLI 包与数据快照基础
packages/nutui-react-cli/package.json, packages/nutui-react-cli/scripts/prepare-data.mjs, packages/nutui-react-cli/src/types.ts, packages/nutui-react-cli/tsconfig.json, packages/nutui-react-cli/tsup.config.ts, pnpm-workspace.yaml, packages/nutui-react-cli/README.md, packages/nutui-react-cli/skills/*
新增包元数据、构建与发布脚本、类型模型、工作区登记、离线数据生成流程、README 和 Agent Skill。
CLI 命令与本地数据查询
packages/nutui-react-cli/src/data.ts, packages/nutui-react-cli/src/format.ts, packages/nutui-react-cli/src/cli.ts, packages/nutui-react-cli/src/commands/*
实现组件解析、拼写建议、文档/示例读取、文本或 JSON 格式化,以及 listinfodocdemotoken 命令。
MCP 工具与 stdio 服务
packages/nutui-react-cli/src/error.ts, packages/nutui-react-cli/src/mcp/*, packages/nutui-react-cli/src/commands/mcp.ts
新增结构化错误、五个只读 MCP 工具、两个提示词及基于 stdio 的 MCP 服务启动流程。
AI 站点导航与集成文档
src/sites/config/baseConfig.ts, src/sites/sites-react/doc/components/nav/nav.tsx, src/sites/sites-react/doc/docs/ai-react/*
更新 AI 路由和导航,并新增 CLI、MCP、For Agents 的中英文说明页面。

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • jdf2e/nutui-react#3494:该 PR 实现了此 issue 提出的统一元数据、离线 CLI、MCP、Skill 与 Agent 文档方案。

Possibly related PRs

  • jdf2e/nutui-react#3495:其生成 meta/components.jsonllms.txt,与本 PR 的离线数据准备流程属于同一数据生成链路。
  • jdf2e/nutui-react#3496:两者共同修改 AI 站点路由、导航及相关集成页面。

Sequence Diagram(s)

sequenceDiagram
  participant Agent
  participant NutUIReactCLI
  participant OfflineData
  Agent->>NutUIReactCLI: request component information
  NutUIReactCLI->>OfflineData: read metadata, docs, demos, or tokens
  OfflineData-->>NutUIReactCLI: return structured data
  NutUIReactCLI-->>Agent: return JSON or MCP response
Loading

Poem

小兔敲键盘,离线资料闪闪亮,
查 Props,读文档,示例源码排成行。
Token 像胡萝卜,MCP 送到助手旁,
先查再写代码,蹦蹦跳跳更漂亮!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.10% 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
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.
Title check ✅ Passed 标题与本次变更的核心内容一致,准确概括了 MCP Server 与 Skill 相关新增。
Description check ✅ Passed 描述已覆盖背景、主要改动、使用方式和测试计划,结构基本完整,仅缺少相关 Issue 与自查清单。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.44%. Comparing base (a938cf8) to head (f39d609).
⚠️ Report is 15 commits behind head on feat_v4.x.

Additional details and impacted files
@@              Coverage Diff              @@
##           feat_v4.x    #3497      +/-   ##
=============================================
+ Coverage      88.33%   88.44%   +0.11%     
=============================================
  Files            295      296       +1     
  Lines          19747    19812      +65     
  Branches        3117     3135      +18     
=============================================
+ Hits           17443    17523      +80     
+ Misses          2298     2283      -15     
  Partials           6        6              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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.

Actionable comments posted: 2

🧹 Nitpick comments (4)
src/sites/sites-react/doc-taro/router.ts (1)

51-51: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

转义正则表达式中的点号并增加对正则执行结果的安全校验。

正则表达式中的 . 会匹配任意字符,为了保证提取文件名的语义绝对准确,应将其转义为 \.。同时,exec() 可能会在未匹配时返回 null,直接断言为 any[] 并强行读取下标 [1] 存在引发运行时 TypeError 的风险,建议改用可选链语法进行安全访问。

  • src/sites/sites-react/doc-taro/router.ts#L51-L51: 建议修改为 let name = (/docs\/ai-taro\/(.*?)\.md$/.exec(path))?.[1] || '';
  • src/sites/sites-react/doc-taro/router.ts#L60-L60: 建议修改为 let name = (/docs\/ai-taro\/(.*?)\.en-US\.md$/.exec(path))?.[1] || '';
  • src/sites/sites-react/doc/router.ts#L74-L74: 建议修改为 let name = (/docs\/ai-react\/(.*?)\.md$/.exec(path))?.[1] || '';
  • src/sites/sites-react/doc/router.ts#L83-L83: 建议修改为 let name = (/docs\/ai-react\/(.*?)\.en-US\.md$/.exec(path))?.[1] || '';
🤖 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 `@src/sites/sites-react/doc-taro/router.ts` at line 51, Update the filename
extraction expressions in src/sites/sites-react/doc-taro/router.ts lines 51-51
and 60-60, and src/sites/sites-react/doc/router.ts lines 74-74 and 83-83: escape
literal dots, require the expected .md or .en-US.md suffix with an end anchor,
and safely access the match via optional chaining with an empty-string fallback
when exec() returns null.
packages/nutui-react-cli/src/cli.ts (1)

11-124: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建议使用 .parseAsync() 替代 .parse() 更好地处理异步命令

由于 mcp 命令的回调 runMcp 是一个异步函数,目前使用 .parse() 会导致 Promise 处于浮动(floating)状态(也是此处禁用 eslint 规则的原因)。建议改用 .parseAsync() 来确保顶层异步错误(例如 MCP 服务连接失败)能被 yargs 捕获或链式 .catch() 正确处理,而不会引发 unhandledRejection

♻️ 建议的重构

如果你使用的是 ESM 且支持顶层 await:

-// eslint-disable-next-line `@typescript-eslint/no-floating-promises`
-yargs(hideBin(process.argv))
+await yargs(hideBin(process.argv))
   .scriptName('nutui-react')
   // ... 中间命令保持不变 ...
   .wrap(null)
-  .parse()
+  .parseAsync()

或者使用链式调用捕获:

-// eslint-disable-next-line `@typescript-eslint/no-floating-promises`
 yargs(hideBin(process.argv))
   .scriptName('nutui-react')
   // ... 中间命令保持不变 ...
   .wrap(null)
-  .parse()
+  .parseAsync()
+  .catch((err) => {
+    console.error(err);
+    process.exit(1);
+  })
🤖 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/nutui-react-cli/src/cli.ts` around lines 11 - 124, Update the yargs
invocation to use parseAsync instead of parse, and handle the returned Promise
with appropriate top-level rejection handling so asynchronous failures from
runMcp and other command callbacks do not become unhandled rejections. Remove
the now-unnecessary no-floating-promises suppression while preserving the
existing command configuration.
packages/nutui-react-cli/package.json (1)

43-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

将运行时依赖移至 devDependencies 以实现真正的零依赖安装。

在配套的 tsup.config.ts 文件中,已经通过 noExternal 配置将 yargs@modelcontextprotocol/sdk 打包进了最终的产物。但如果它们依然留在 dependencies 字段中,用户在通过 npm installnpx 获取 CLI 时,NPM 仍会解析并下载这些包。建议将它们移至 devDependencies,从而真正实现产物的自包含与“零依赖安装”,提升终端用户的下载与执行速度。

♻️ 建议的修改
-  "dependencies": {
-    "`@modelcontextprotocol/sdk`": "^1.29.0",
-    "yargs": "^17.7.2"
-  },
   "devDependencies": {
+    "`@modelcontextprotocol/sdk`": "^1.29.0",
+    "yargs": "^17.7.2",
     "`@types/node`": "^22.5.5",
🤖 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/nutui-react-cli/package.json` around lines 43 - 46, 将 package.json
中的 yargs 和 `@modelcontextprotocol/sdk` 从 dependencies 移至 devDependencies,保持
tsup.config.ts 的 noExternal 打包配置不变,确保 CLI 产物自包含且安装时不再解析这些运行时依赖。
packages/nutui-react-cli/src/format.ts (1)

17-18: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

确保行内列数与表头一致,防止表格错位。

当前的 line 函数是通过遍历 cells 来生成列。如果某一行的数据(cells 数组)长度小于表头(headers)长度,这一行就会缺少最后几列,导致排版错乱。建议遍历 widths 来生成每一列,确保每一行都能被正确补充到预期的列数。

♻️ 建议的重构
-  const line = (cells: string[]) =>
-    cells.map((c, i) => pad(c ?? '', widths[i])).join('  ')
+  const line = (cells: string[]) =>
+    widths.map((w, i) => pad(cells[i] ?? '', w)).join('  ')
🤖 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/nutui-react-cli/src/format.ts` around lines 17 - 18, Update the line
function to iterate over widths rather than cells, using each width index to
read the corresponding cell and pad missing values with an empty string.
Preserve the existing spacing and joining behavior so every row matches the
header column count.
🤖 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 `@packages/nutui-react-cli/src/data.ts`:
- Around line 88-93: Update readDemo to validate name before constructing the
file path, rejecting path traversal components and any characters outside the
allowed demo-name format; return null for invalid names. Preserve support for
the optional .tsx suffix while ensuring the resolved path remains within the
component’s demos directory.

In `@packages/nutui-react-cli/src/mcp/tools.ts`:
- Around line 199-203: Update the lang selection in the nutui_doc case to
preserve any explicitly provided params.lang value, including 'zh', and only
fall back to ctx.lang when params.lang is nullish or absent. Keep the existing
readDoc(comp, lang) flow unchanged.

---

Nitpick comments:
In `@packages/nutui-react-cli/package.json`:
- Around line 43-46: 将 package.json 中的 yargs 和 `@modelcontextprotocol/sdk` 从
dependencies 移至 devDependencies,保持 tsup.config.ts 的 noExternal 打包配置不变,确保 CLI
产物自包含且安装时不再解析这些运行时依赖。

In `@packages/nutui-react-cli/src/cli.ts`:
- Around line 11-124: Update the yargs invocation to use parseAsync instead of
parse, and handle the returned Promise with appropriate top-level rejection
handling so asynchronous failures from runMcp and other command callbacks do not
become unhandled rejections. Remove the now-unnecessary no-floating-promises
suppression while preserving the existing command configuration.

In `@packages/nutui-react-cli/src/format.ts`:
- Around line 17-18: Update the line function to iterate over widths rather than
cells, using each width index to read the corresponding cell and pad missing
values with an empty string. Preserve the existing spacing and joining behavior
so every row matches the header column count.

In `@src/sites/sites-react/doc-taro/router.ts`:
- Line 51: Update the filename extraction expressions in
src/sites/sites-react/doc-taro/router.ts lines 51-51 and 60-60, and
src/sites/sites-react/doc/router.ts lines 74-74 and 83-83: escape literal dots,
require the expected .md or .en-US.md suffix with an end anchor, and safely
access the match via optional chaining with an empty-string fallback when exec()
returns null.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e1f3da90-af2f-4b65-8e7f-e9612381d399

📥 Commits

Reviewing files that changed from the base of the PR and between d306aea and 8b62e21.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • .gitignore
  • package.json
  • packages/nutui-react-cli/.gitignore
  • packages/nutui-react-cli/README.md
  • packages/nutui-react-cli/package.json
  • packages/nutui-react-cli/scripts/prepare-data.mjs
  • packages/nutui-react-cli/src/cli.ts
  • packages/nutui-react-cli/src/commands/_shared.ts
  • packages/nutui-react-cli/src/commands/demo.ts
  • packages/nutui-react-cli/src/commands/doc.ts
  • packages/nutui-react-cli/src/commands/info.ts
  • packages/nutui-react-cli/src/commands/list.ts
  • packages/nutui-react-cli/src/commands/mcp.ts
  • packages/nutui-react-cli/src/commands/token.ts
  • packages/nutui-react-cli/src/data.ts
  • packages/nutui-react-cli/src/error.ts
  • packages/nutui-react-cli/src/format.ts
  • packages/nutui-react-cli/src/mcp/prompts.ts
  • packages/nutui-react-cli/src/mcp/tools.ts
  • packages/nutui-react-cli/src/types.ts
  • packages/nutui-react-cli/tsconfig.json
  • packages/nutui-react-cli/tsup.config.ts
  • pnpm-workspace.yaml
  • scripts/build-llms.mjs
  • scripts/build-semantic.mjs
  • scripts/site/vite-plugin-llms.mjs
  • src/sites/config/baseConfig.ts
  • src/sites/sites-react/doc-taro/App.tsx
  • src/sites/sites-react/doc-taro/router.ts
  • src/sites/sites-react/doc/App.tsx
  • src/sites/sites-react/doc/components/header/header.tsx
  • src/sites/sites-react/doc/components/nav/nav.tsx
  • src/sites/sites-react/doc/docs/ai-react/llms.en-US.md
  • src/sites/sites-react/doc/docs/ai-react/llms.md
  • src/sites/sites-react/doc/docs/ai-taro/llms.en-US.md
  • src/sites/sites-react/doc/docs/ai-taro/llms.md
  • src/sites/sites-react/doc/router.ts

Comment thread packages/nutui-react-cli/src/data.ts
Comment thread packages/nutui-react-cli/src/mcp/tools.ts

@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.

Actionable comments posted: 1

🤖 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 `@packages/nutui-react-cli/skills/nutui-react/SKILL.md`:
- Around line 21-30: 统一固定所有 npx 示例的精确版本,避免在未本地安装时拉取远程最新包;更新
packages/nutui-react-cli/skills/nutui-react/SKILL.md 第21-30行、第97-103行,以及
packages/nutui-react-cli/README.md 第102-103行中的命令,同时保持本地 nutui-react 调用方式可用。
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 64fcea5a-6687-4923-9653-f218fc2a4a06

📥 Commits

Reviewing files that changed from the base of the PR and between 8b62e21 and b4b1583.

📒 Files selected for processing (4)
  • packages/nutui-react-cli/README.md
  • packages/nutui-react-cli/package.json
  • packages/nutui-react-cli/skills/.npmignore
  • packages/nutui-react-cli/skills/nutui-react/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/nutui-react-cli/package.json

Comment thread packages/nutui-react-cli/skills/nutui-react/SKILL.md

@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 (2)
src/sites/config/baseConfig.ts (2)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建议同步更新导航项的 name 字段以保持语义一致

虽然 name 字段目前仅在头部渲染时用作 React key,但由于 AI 导航已经扩展包含了 for-agentsclimcp 等页面,继续使用 'llms' 作为 name 会有些过时。建议在 PC 和 Taro 两个配置中将其同步更新为 'ai''for-agents',以保持代码语义的整洁。

  • src/sites/config/baseConfig.ts#L46-51: 将 SiteReact.header 中 AI 导航项的 name'llms' 改为 'ai'
  • src/sites/config/baseConfig.ts#L100-105: 将 SiteReactTaro.header 中 AI 导航项的 name'llms' 改为 'ai'
🤖 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 `@src/sites/config/baseConfig.ts` at line 1, Update the AI navigation item name
from “llms” to “ai” in both SiteReact.header and SiteReactTaro.header within the
base configuration, keeping the navigation targets and other fields unchanged.

46-51: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建议同步更新导航项的 name 字段以保持语义一致

虽然 name 字段目前仅在头部渲染时用作 React key,但由于 AI 导航已经扩展包含了 for-agentsclimcp 等页面,继续使用 'llms' 作为 name 会有些过时。建议将其更新为 'ai''for-agents'

💡 建议的修改
-      name: 'llms',
+      name: 'ai',
       cName: 'AI',
       eName: 'AI',
       path: '/zh-CN/ai/for-agents',
       pathName: 'for-agents'
🤖 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 `@src/sites/config/baseConfig.ts` around lines 46 - 51, 更新 baseConfig 中 path 为
/zh-CN/ai/for-agents 的导航项,将过时的 name 值从“llms”改为与 AI
导航语义一致的“ai”或“for-agents”,并保持其他字段不变。
🤖 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 `@src/sites/config/baseConfig.ts`:
- Line 1: Update the AI navigation item name from “llms” to “ai” in both
SiteReact.header and SiteReactTaro.header within the base configuration, keeping
the navigation targets and other fields unchanged.
- Around line 46-51: 更新 baseConfig 中 path 为 /zh-CN/ai/for-agents 的导航项,将过时的 name
值从“llms”改为与 AI 导航语义一致的“ai”或“for-agents”,并保持其他字段不变。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c5d3562-fa4c-456c-9e29-e6ad4bbcb8b0

📥 Commits

Reviewing files that changed from the base of the PR and between b4b1583 and 14ed61c.

📒 Files selected for processing (8)
  • src/sites/config/baseConfig.ts
  • src/sites/sites-react/doc/components/nav/nav.tsx
  • src/sites/sites-react/doc/docs/ai-react/cli.en-US.md
  • src/sites/sites-react/doc/docs/ai-react/cli.md
  • src/sites/sites-react/doc/docs/ai-react/for-agents.en-US.md
  • src/sites/sites-react/doc/docs/ai-react/for-agents.md
  • src/sites/sites-react/doc/docs/ai-react/mcp.en-US.md
  • src/sites/sites-react/doc/docs/ai-react/mcp.md

@alvinhui alvinhui changed the title [WIP] feature: MCP Server + Skill feature: MCP Server + Skill Jul 16, 2026
@xiaoyatong
xiaoyatong merged commit 480efc9 into jdf2e:feat_v4.x Jul 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action:review This PR needs more reviews (less than 2 approvals) size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants