docs: route wiki urls through wiki skill - #2112
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe skill documentation narrows ChangesWiki and Docx routing
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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 `@skills/lark-doc/SKILL.md`:
- Line 4: The lark-doc routing description claims Mindnote support, but wiki
nodes with obj_type=mindnote are not routed here. Update the routing exception
around the description and its corresponding /wiki/ rule to explicitly handle
mindnote_obj_token and preserve Mindnote requests in lark-doc, or remove the
Mindnote claim if routing cannot support it.
In `@skills/lark-wiki/SKILL.md`:
- Line 27: Update the Wiki URL/token resolution rule in the relevant skill
policy to use the selected identity: default to user when none is specified, but
preserve an explicit bot request instead of always passing “--as user” to
lark-cli wiki +node-get. Keep the existing real obj_type/obj_token resolution
and subsequent skill-routing behavior unchanged.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8b625b20-ba01-4a5e-a145-05dedbf1a253
📒 Files selected for processing (2)
skills/lark-doc/SKILL.mdskills/lark-wiki/SKILL.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@006452dcd6b3f2af336b6ae87c9d64e0a853b0d1🧩 Skill updatenpx skills add larksuite/cli#docs/wiki-url-type-routing -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2112 +/- ##
==========================================
+ Coverage 75.16% 75.24% +0.07%
==========================================
Files 912 916 +4
Lines 96475 97255 +780
==========================================
+ Hits 72517 73175 +658
- Misses 18381 18463 +82
- Partials 5577 5617 +40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 `@skills/lark-doc/SKILL.md`:
- Line 26: Update the resource-routing gate and its description in the Lark
document skill to include resolved obj_type=doc alongside docx and mindnote,
preserving the existing mindnote handling and returning document nodes to this
skill for document operations; keep the routing contract consistent with
lark-wiki-token-routing.md.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 48127537-2da0-4145-b5b5-dd0d3209a25c
📒 Files selected for processing (2)
skills/lark-doc/SKILL.mdskills/lark-wiki/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
- skills/lark-wiki/SKILL.md
| 1. [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md) — 认证、权限处理、全局参数(所有操作通用) | ||
| 2. **读取文档(`docs +fetch`)** → 必读 [`lark-doc-fetch.md`](references/lark-doc-fetch.md)(`--scope` / `--detail` 选择、局部读取策略、`<fragment>` / `<excerpt>` 输出结构) | ||
| 3. **创建或编辑文档内容** → 必读 [`lark-doc-xml.md`](references/lark-doc-xml.md)(XML 语法规则,仅当用户明确要求 Markdown 时改读 [`lark-doc-md.md`](references/lark-doc-md.md))和必读 [`lark-doc-style.md`](references/style/lark-doc-style.md)(写作原则:默认段落、按体裁、组件克制);从零创建时加读 [`lark-doc-create-workflow.md`](references/style/lark-doc-create-workflow.md);编辑已有文档时加读 [`lark-doc-update.md`](references/lark-doc-update.md) 和 [`lark-doc-update-workflow.md`](references/style/lark-doc-update-workflow.md) | ||
| 2. 用户给出 `/wiki/` URL/token 并要求总结、读取、编辑等内容操作时,当前任务仍处于资源路由阶段:停止读取本 skill 的后续 reference,切到 [`lark-wiki`](../lark-wiki/SKILL.md) 使用 `wiki +node-get` 获取 `obj_type` / `obj_token`;仅当结果为 `docx` 或 `mindnote` 时才回到本 skill,`mindnote` 使用 `obj_token` 作为 `--mindnote-id` 并走思维笔记链路。 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Preserve routing for resolved obj_type=doc nodes.
skills/lark-shared/references/lark-wiki-token-routing.md currently routes both docx and doc objects to lark-doc, but this gate resumes only for docx or mindnote. Wiki nodes resolving to obj_type=doc will therefore remain in lark-wiki and fail to reach document operations. Align the gate and the description, or explicitly retire doc support across the routing contract.
🤖 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 `@skills/lark-doc/SKILL.md` at line 26, Update the resource-routing gate and
its description in the Lark document skill to include resolved obj_type=doc
alongside docx and mindnote, preserving the existing mindnote handling and
returning document nodes to this skill for document operations; keep the routing
contract consistent with lark-wiki-token-routing.md.
There was a problem hiding this comment.
[P2] Keep legacy doc nodes on the document path
+node-get explicitly supports and can return the legacy obj_type=doc, and the shared routing contract maps both doc and docx to lark-doc. This new gate only returns for docx or mindnote, so a Wiki URL backed by a legacy doc stops in lark-wiki instead of reaching document content operations. Please include doc in both the discovery description and the resolved-type gate, or update the shared contract if legacy doc support is intentionally being removed.
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '== Locate and map relevant skill files =='
fd -t f '^(SKILL\.md|lark-wiki-token-routing\.md)$' skills | sort
echo
echo '== Shared Wiki token-routing contract =='
contract=$(fd -t f '^lark-wiki-token-routing\.md$' skills/lark-shared | head -n 1)
if [ -n "$contract" ]; then
nl -ba "$contract" | sed -n '1,240p'
fi
echo
echo '== lark-wiki resolved-type routing references =='
wiki_skill=$(fd -t f '^SKILL\.md$' skills/lark-wiki | head -n 1)
if [ -n "$wiki_skill" ]; then
rg -n -C 4 'obj_type|obj_token|node-get|`doc`|`docx`|mindnote' "$wiki_skill"
fi
echo
echo '== lark-doc discovery and routing gate =='
nl -ba skills/lark-doc/SKILL.md | sed -n '1,40p'Length of output: 1979
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '== Shared Wiki token-routing contract =='
contract=$(fd -t f '^lark-wiki-token-routing\.md$' skills/lark-shared | head -n 1)
if [ -n "$contract" ]; then
awk '{printf "%6d\t%s\n", NR, $0}' "$contract" | sed -n '1,240p'
fi
echo
echo '== lark-wiki resolved-type routing references =='
wiki_skill=$(fd -t f '^SKILL\.md$' skills/lark-wiki | head -n 1)
if [ -n "$wiki_skill" ]; then
rg -n -C 4 'obj_type|obj_token|node-get|`doc`|`docx`|mindnote' "$wiki_skill"
fi
echo
echo '== lark-doc discovery and routing gate =='
awk '{printf "%6d\t%s\n", NR, $0}' skills/lark-doc/SKILL.md | sed -n '1,40p'Length of output: 9329
@fangshuyu-768 Confirmed — this is a valid P2.
The shared contract explicitly lists doc as a supported resolved Wiki type and routes docx / doc content operations to lark-doc (skills/lark-shared/references/lark-wiki-token-routing.md, Lines 27 and 36). However, skills/lark-doc/SKILL.md currently recognizes only upstream obj_type=docx in its description (Line 4) and only resumes from the Wiki gate for docx or mindnote (Line 26).
The minimal fix is to include legacy doc in both locations, retaining the existing mindnote handling:
... 上游已确认 obj_type=docx 或 doc ...
... 仅当结果为 docx、doc 或 mindnote 时才回到本 skill ...
✏️ Learnings added
Learnt from: fangshuyu-768
Repo: larksuite/cli PR: 2112
File: skills/lark-doc/SKILL.md:26-26
Timestamp: 2026-07-30T10:28:19.226Z
Learning: For Wiki resource routing, `skills/lark-shared/references/lark-wiki-token-routing.md` treats both resolved `obj_type=docx` and legacy `obj_type=doc` as document-content resources handled by `lark-doc`; routing gates and discovery descriptions must preserve both types unless the shared contract is intentionally changed.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
You are interacting with an AI system.
c78a762 to
9677fed
Compare
9677fed to
006452d
Compare
Summary
Update Lark skill routing guidance so
/wiki/URLs and Wiki tokens are handled bylark-wikifirst. This avoids prematurely loadinglark-docdocs fetch/update references before the real Wiki resource type is known.Changes
lark-docdiscovery description to explicit Docx resources only.lark-wiki wiki +node-getbefore switching to the true business skill.wiki +node-getreturns trueobj_type/obj_token.Test Plan
lark-wikifirst and routes by true resource typegit diff --check -- skills/lark-doc/SKILL.md skills/lark-wiki/SKILL.mdRelated Issues
Summary by CodeRabbit
obj_type=docx); embedded spreadsheets/bitable/whiteboards now explicitly require token extraction and switching to the correct skill.obj_type/obj_tokenis resolved.--asidentity first (defaultuserunless explicitly overridden), then use+node-getto resolve the true resource type/token before routing.