Skip to content

docs: route wiki urls through wiki skill - #2112

Open
wittam-01 wants to merge 1 commit into
mainfrom
docs/wiki-url-type-routing
Open

docs: route wiki urls through wiki skill#2112
wittam-01 wants to merge 1 commit into
mainfrom
docs/wiki-url-type-routing

Conversation

@wittam-01

@wittam-01 wittam-01 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Update Lark skill routing guidance so /wiki/ URLs and Wiki tokens are handled by lark-wiki first. This avoids prematurely loading lark-doc docs fetch/update references before the real Wiki resource type is known.

Changes

  • Narrow lark-doc discovery description to explicit Docx resources only.
  • Route Wiki content operations through lark-wiki wiki +node-get before switching to the true business skill.
  • Document that wiki +node-get returns true obj_type / obj_token.

Test Plan

  • Unit tests pass (not run; docs-only skill guidance change)
  • Manual natural-language verification confirms Wiki URL routing enters lark-wiki first and routes by true resource type
  • Static check: git diff --check -- skills/lark-doc/SKILL.md skills/lark-wiki/SKILL.md

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Clarified that the Docx skill is Docx-only, applying only to confirmed Docx URL paths/tokens (or upstream-confirmed obj_type=docx); embedded spreadsheets/bitable/whiteboards now explicitly require token extraction and switching to the correct skill.
    • Updated wiki routing guidance to keep resource-routing until the real obj_type/obj_token is resolved.
    • Refined wiki quick decisions/shortcuts to select the --as identity first (default user unless explicitly overridden), then use +node-get to resolve the true resource type/token before routing.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a9f8ce9-ce12-46ea-bdaf-cffc7106b7ae

📥 Commits

Reviewing files that changed from the base of the PR and between 9677fed and 006452d.

📒 Files selected for processing (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-wiki/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-wiki/SKILL.md

📝 Walkthrough

Walkthrough

The skill documentation narrows lark-doc to Docx URL paths and tokens, and updates lark-wiki to resolve /wiki/ resources through wiki +node-get before routing by the returned object type and token.

Changes

Wiki and Docx routing

Layer / File(s) Summary
Wiki resource resolution guidance
skills/lark-wiki/SKILL.md
Defines /wiki/ URLs or tokens as the initial routing entry, selects the CLI identity, resolves obj_type and obj_token with wiki +node-get, and documents the shortcut behavior.
Docx routing scope
skills/lark-doc/SKILL.md
Limits the skill description to /docx/ URL paths and Docx tokens while retaining embedded-resource switching and path-plus-token routing rules.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • larksuite/cli#982: Updates wiki-token resolution and routing to the corresponding business skill.
  • larksuite/cli#1082: Updates skill front-matter routing guidance for URL-path and token-based resource handling.
  • larksuite/cli#1275: Tightens /wiki/ routing and resolution of the real obj_type/obj_token.

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main routing change and is concise.
Description check ✅ Passed The description follows the template and includes summary, changes, test plan, and related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/wiki-url-type-routing

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.

@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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f565a2 and c12b411.

📒 Files selected for processing (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-wiki/SKILL.md

Comment thread skills/lark-doc/SKILL.md Outdated
Comment thread skills/lark-wiki/SKILL.md Outdated
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@006452dcd6b3f2af336b6ae87c9d64e0a853b0d1

🧩 Skill update

npx skills add larksuite/cli#docs/wiki-url-type-routing -y -g

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.24%. Comparing base (59237f3) to head (006452d).
⚠️ Report is 11 commits behind head on main.

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.
📢 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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between c12b411 and c78a762.

📒 Files selected for processing (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-wiki/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-wiki/SKILL.md

Comment thread skills/lark-doc/SKILL.md Outdated
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` 并走思维笔记链路。

@coderabbitai coderabbitai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@wittam-01
wittam-01 force-pushed the docs/wiki-url-type-routing branch from c78a762 to 9677fed Compare July 30, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants