Skip to content

docs: reorganize lark-doc skill navigation#1574

Closed
fangshuyu-768 wants to merge 1 commit into
mainfrom
codex/lark-doc-skill-structure
Closed

docs: reorganize lark-doc skill navigation#1574
fangshuyu-768 wants to merge 1 commit into
mainfrom
codex/lark-doc-skill-structure

Conversation

@fangshuyu-768

@fangshuyu-768 fangshuyu-768 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a single lark-doc operation guide focused on operation prerequisites, conditional references, and easy-to-misroute boundaries
  • update lark-doc SKILL.md to route agents through the guide before reading operation-specific references
  • add a lightweight creation-topic router with simple guides for reports, meeting notes, and project plans
  • preserve existing detailed create/fetch/update/xml/media/resource/whiteboard reference docs without adding new entries for commands planned for deprecation

Tests

  • node scripts/skill-format-check/index.js
  • go test ./internal/qualitygate/skillscan ./internal/skillscheck
  • go test ./cmd -run Skill
  • local markdown link check for skills/lark-doc

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels Jun 25, 2026
@coderabbitai

coderabbitai Bot commented Jun 25, 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

Walkthrough

The PR revises skills/lark-doc guidance to require an operation matrix, adds a command index for lark-cli docs scope grouping, and updates prerequisite reading order and shortcut notes.

Changes

Lark docs routing and references

Layer / File(s) Summary
Skill guidance and shortcuts
skills/lark-doc/SKILL.md
The skill now requires reading lark-doc-operation-matrix.md first, then ../lark-shared/SKILL.md, updates the common must-read list, and replaces shortcut table content with command-index pointers.
Operation matrix
skills/lark-doc/references/lark-doc-operation-matrix.md
The operation matrix maps user intent to lark-cli docs commands, required references, format choice, and validation rules across fetch, create, edit, media, cover-resource, and whiteboard flows.
Command index
skills/lark-doc/references/lark-doc-command-index.md
The command index groups lark-cli docs shortcuts by scope, defines boundaries for document content, body media, document resource/meta, and bridge flows, and lists the required reference for each group.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • larksuite/cli#1283: Also updates skills/lark-doc/SKILL.md routing guidance for lark-cli docs.
  • larksuite/cli#1463: Changes the same skill’s prerequisite guidance around rich-block handling and required references.
  • larksuite/cli#1508: Revises the path/prerequisite flow and block-ID guidance used by skills/lark-doc docs operations.

Suggested reviewers

  • SunPeiYang996
  • caojie0621

Poem

I hopped through matrices by moonbeam light,
Then nibbled command scopes into neat little sight.
With shortcuts and refs in my soft rabbit den,
I’ll hop to the right doc path again and again. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description has Summary and Tests, but it is missing the required Changes and Related Issues sections from the template. Add a Changes section with the main bullets and a Related Issues section, and rename Tests to Test Plan if you want to match the template exactly.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: reorganizing lark-doc skill navigation and related docs.
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.

✏️ 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 codex/lark-doc-skill-structure

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 Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.59%. Comparing base (1c92ed8) to head (f0d5e7b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1574      +/-   ##
==========================================
+ Coverage   74.53%   74.59%   +0.06%     
==========================================
  Files         792      793       +1     
  Lines       78690    79085     +395     
==========================================
+ Hits        58653    58997     +344     
- Misses      15670    15702      +32     
- Partials     4367     4386      +19     

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

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#codex/lark-doc-skill-structure -y -g

@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: 4

🤖 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/references/lark-doc-media.md`:
- Around line 54-60: The media-preview docs use the wrong fetch output tag
names; update the wording in lark-doc-media.md where `docs +media-preview` is
described so it refers to the actual `docs +fetch` symbols `<image token="...">`
and `<file token="...">` instead of `<img>` and `<source>`, keeping the token
extraction guidance consistent with the documented fetch output.
- Around line 37-39: The media routing guidance for URL inputs is inconsistent
with the insert flow and should not send agents to docs +update. Update the
references in lark-doc-media.md so the URL case points to the same handling as
the sibling insert guidance and operation matrix: either download the media and
use --file or route through the appropriate drive-related flow, while keeping
the --from-clipboard and local-path branches unchanged.

In `@skills/lark-doc/references/lark-doc-search.md`:
- Line 56: Scope the direct-fetch rule in the search routing guidance to
Docx/Wiki only, since spreadsheet/base flows are handled separately. Update the
wording in lark-doc-search.md so the “if user explicitly provides URL/token,
fetch directly” behavior is tied to Docx/Wiki URL/token cases, using the command
index and operation matrix as the reference for the routing distinction.

In `@skills/lark-doc/SKILL.md`:
- Around line 32-35: The prerequisite list in SKILL.md is ordered inconsistently
with the matrix-first guidance; update the “常用必读文件” entries so
lark-doc-operation-matrix.md appears before lark-doc-command-index.md, keeping
../lark-shared/SKILL.md first. Make sure the surrounding wording in the
prerequisites section stays aligned with the entrypoint guidance used elsewhere
in the document.
🪄 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

Run ID: 3aa566fa-716f-4b8a-9611-b30030b238df

📥 Commits

Reviewing files that changed from the base of the PR and between 1c92ed8 and 5e7618a.

📒 Files selected for processing (5)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-command-index.md
  • skills/lark-doc/references/lark-doc-media.md
  • skills/lark-doc/references/lark-doc-operation-matrix.md
  • skills/lark-doc/references/lark-doc-search.md

Comment on lines +37 to +39
- 用户说“截图、剪切板、刚复制的图” → `--from-clipboard`
- 用户给本地路径 → `--file <path>`
- 用户给 URL → 可用 `docs +update` 直接插入 `<img href="https://..."/>`,或先下载再 `--file`

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

Don't route URL inserts through docs +update.

This URL path conflicts with the sibling insert guidance and the operation matrix, which route media URLs to --file/download or drive-related flows instead. As written, agents will be sent down the wrong command path.

Proposed fix
- - 用户给 URL → 可用 `docs +update` 直接插入 `<img href="https://..."/>`,或先下载再 `--file`
+ - 用户给 URL → 先下载到本地再用 `--file`,或按对应的 drive/insert 流程处理
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 用户说“截图、剪切板、刚复制的图” → `--from-clipboard`
- 用户给本地路径 → `--file <path>`
- 用户给 URL → 可用 `docs +update` 直接插入 `<img href="https://..."/>`,或先下载再 `--file`
- 用户说“截图、剪切板、刚复制的图” → `--from-clipboard`
- 用户给本地路径 → `--file <path>`
- 用户给 URL → 先下载到本地再用 `--file`,或按对应的 drive/insert 流程处理
🤖 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/references/lark-doc-media.md` around lines 37 - 39, The media
routing guidance for URL inputs is inconsistent with the insert flow and should
not send agents to docs +update. Update the references in lark-doc-media.md so
the URL case points to the same handling as the sibling insert guidance and
operation matrix: either download the media and use --file or route through the
appropriate drive-related flow, while keeping the --from-clipboard and
local-path branches unchanged.

Comment on lines +54 to +60
用于预览正文图片或附件素材。token 从 `docs +fetch` 返回的 `<img>` / `<source>` 中提取。

```bash
lark-cli docs +media-preview --token "Z1Fjxxxxxxxx" --output ./asset
```

`--output` 不带扩展名时,CLI 会根据响应类型自动补全。

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

Fix the token tag names for fetch output.

docs +fetch is documented elsewhere as yielding <image token="..."> / <file token="...">, not <img> / <source>. If this stays unchanged, agents will look for the wrong tags and miss the media token.

Proposed fix
- 用于预览正文图片或附件素材。token 从 `docs +fetch` 返回的 `<img>` / `<source>` 中提取。
+ 用于预览正文图片或附件素材。token 从 `docs +fetch` 返回的 `<image>` / `<file>` 节点中提取。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
用于预览正文图片或附件素材。token 从 `docs +fetch` 返回的 `<img>` / `<source>` 中提取。
```bash
lark-cli docs +media-preview --token "Z1Fjxxxxxxxx" --output ./asset
```
`--output` 不带扩展名时,CLI 会根据响应类型自动补全。
用于预览正文图片或附件素材。token 从 `docs +fetch` 返回的 `<image>` / `<file>` 节点中提取。
🤖 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/references/lark-doc-media.md` around lines 54 - 60, The
media-preview docs use the wrong fetch output tag names; update the wording in
lark-doc-media.md where `docs +media-preview` is described so it refers to the
actual `docs +fetch` symbols `<image token="...">` and `<file token="...">`
instead of `<img>` and `<source>`, keeping the token extraction guidance
consistent with the documented fetch output.


- 不要把搜索摘要当正文事实来源;需要准确内容必须 fetch 目标文档。
- 搜索是 discovery 能力,不负责正文 block 操作。
- 如果用户明确给了 URL/token,不要先 search 再 fetch,直接 fetch。

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 | 🟡 Minor | ⚡ Quick win

Scope the direct-fetch rule to Docx/Wiki only.

“URL/token” is too broad here: spreadsheet/base cases already have separate routing, so this line should say Docx/Wiki URL/token explicitly to avoid sending non-doc search hits into the wrong flow. Based on the command index and operation matrix.

🛠️ Suggested wording
-- 如果用户明确给了 URL/token,不要先 search 再 fetch,直接 fetch。
+- 如果用户明确给了 Docx/Wiki URL/token,且目标是正文内容,不要先 search 再 fetch,直接 fetch。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 如果用户明确给了 URL/token,不要先 search 再 fetch,直接 fetch。
- 如果用户明确给了 Docx/Wiki URL/token,且目标是正文内容,不要先 search 再 fetch,直接 fetch。
🤖 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/references/lark-doc-search.md` at line 56, Scope the
direct-fetch rule in the search routing guidance to Docx/Wiki only, since
spreadsheet/base flows are handled separately. Update the wording in
lark-doc-search.md so the “if user explicitly provides URL/token, fetch
directly” behavior is tied to Docx/Wiki URL/token cases, using the command index
and operation matrix as the reference for the routing distinction.

Comment thread skills/lark-doc/SKILL.md Outdated
@fangshuyu-768 fangshuyu-768 force-pushed the codex/lark-doc-skill-structure branch from 5e7618a to 1003542 Compare June 25, 2026 08:03
@github-actions github-actions Bot added size/M Single-domain feat or fix with limited business impact and removed size/L Large or sensitive change across domains or core paths labels Jun 25, 2026
@fangshuyu-768 fangshuyu-768 force-pushed the codex/lark-doc-skill-structure branch 2 times, most recently from bd3aba0 to 9a0e86e Compare June 25, 2026 08:24

@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`:
- Around line 26-30: The prerequisite order in SKILL.md is inconsistent: the
matrix-first rule conflicts with the shared-SKILL-first rule. Update the section
to use one clear sequence and make it consistent across the text, referencing
lark-doc-operation-matrix.md and ../lark-shared/SKILL.md so readers know which
must be read first before any operation-specific reference.
- Line 37: The Markdown guidance in SKILL.md is too narrow and can cause agents
to miss the `.md` import path. Update the “创建或编辑文档内容” entry so it points to
lark-doc-md.md not only when the user explicitly asks for Markdown, but also
when the input is a Markdown file/import; keep the XML and workflow references
intact, and make the condition clear near the existing lark-doc-xml.md and
lark-doc-md.md symbols.
🪄 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

Run ID: 51c653cc-b38b-47d7-807e-5ad0434b2f95

📥 Commits

Reviewing files that changed from the base of the PR and between 1003542 and bd3aba0.

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

Comment thread skills/lark-doc/SKILL.md Outdated
Comment thread skills/lark-doc/SKILL.md Outdated

@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/references/lark-doc-operation-matrix.md`:
- Around line 11-16: The style doc links in the operation matrix are resolving
from references/ instead of the sibling style/ directory, so update the affected
markdown references in the lark-doc-operation-matrix table to use the correct
relative paths. Fix the entries that point to style/lark-doc-style.md,
style/lark-doc-create-workflow.md, and style/lark-doc-update-workflow.md so
navigation works correctly from references/.
🪄 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

Run ID: e3d3bc6b-0268-4ea7-bc3b-dc5839cb046c

📥 Commits

Reviewing files that changed from the base of the PR and between bd3aba0 and 9a0e86e.

📒 Files selected for processing (3)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-command-index.md
  • skills/lark-doc/references/lark-doc-operation-matrix.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-doc/references/lark-doc-command-index.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-doc/SKILL.md

Comment on lines +11 to +16
| 创建短文档 | `docs +create --api-version v2` | [`lark-doc-create.md`](lark-doc-create.md), [`lark-doc-xml.md`](lark-doc-xml.md) 或 [`lark-doc-md.md`](lark-doc-md.md) | [`style/lark-doc-style.md`](style/lark-doc-style.md) | 默认 XML;用户提供 `.md` 或明确要求 Markdown 时用 Markdown |
| 创建较长文档 | `docs +create --api-version v2` 建骨架,再 `docs +update --command block_insert_after` 分段 | [`lark-doc-create.md`](lark-doc-create.md), [`lark-doc-update.md`](lark-doc-update.md), [`style/lark-doc-create-workflow.md`](style/lark-doc-create-workflow.md), [`lark-doc-xml.md`](lark-doc-xml.md) | [`style/lark-doc-style.md`](style/lark-doc-style.md), [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) | 先建标题骨架,再按章节 block id 分段写入;避免把超长正文一次塞进 `--content` |
| 简单旧文本到新文本替换 | `docs +update --api-version v2 --command str_replace` | [`lark-doc-update.md`](lark-doc-update.md), [`lark-doc-xml.md`](lark-doc-xml.md) 或 [`lark-doc-md.md`](lark-doc-md.md) | | XML 模式只支持行内匹配;跨段/跨 block 使用 block 级操作或 Markdown 模式 |
| 精准 block 级插入、替换、删除、移动或复制 | `docs +fetch` 定位 block id,再 `docs +update --command block_*` | [`lark-doc-fetch.md`](lark-doc-fetch.md), [`lark-doc-update.md`](lark-doc-update.md), [`lark-doc-xml.md`](lark-doc-xml.md) | [`style/lark-doc-update-workflow.md`](style/lark-doc-update-workflow.md) | 优先局部 fetch;连续写操作必须遵守 block id 生命周期,受影响 ID 不要复用 |
| 改写、润色、补充或重排已有文档 | `docs +fetch` 局部读取,再 `docs +update` 精准修改 | [`lark-doc-fetch.md`](lark-doc-fetch.md), [`lark-doc-update.md`](lark-doc-update.md), [`style/lark-doc-update-workflow.md`](style/lark-doc-update-workflow.md), [`lark-doc-xml.md`](lark-doc-xml.md) | [`style/lark-doc-style.md`](style/lark-doc-style.md), [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) | 精准手术优于全文覆盖;保留原文中的 @人、@文档、图片、附件、画板、sheet、bitable、synced_reference 等 token 和属性 |
| 用户明确要求全文重建 | `docs +update --api-version v2 --command overwrite` | [`lark-doc-update.md`](lark-doc-update.md), [`lark-doc-xml.md`](lark-doc-xml.md) 或 [`lark-doc-md.md`](lark-doc-md.md) | [`style/lark-doc-update-workflow.md`](style/lark-doc-update-workflow.md) | `overwrite` 会清空文档后重写,可能丢失图片、评论等;只在用户明确要改整篇时使用 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the relative links to the style docs.

The style/... references here are relative to references/, so they currently resolve under references/style/ instead of the sibling style/ directory. That breaks these navigation links.

🛠️ Proposed fix
- [`style/lark-doc-style.md`](style/lark-doc-style.md)
+ [`style/lark-doc-style.md`](../style/lark-doc-style.md)

- [`style/lark-doc-create-workflow.md`](style/lark-doc-create-workflow.md)
+ [`style/lark-doc-create-workflow.md`](../style/lark-doc-create-workflow.md)

- [`style/lark-doc-update-workflow.md`](style/lark-doc-update-workflow.md)
+ [`style/lark-doc-update-workflow.md`](../style/lark-doc-update-workflow.md)

Also applies to: 22-23

🤖 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/references/lark-doc-operation-matrix.md` around lines 11 -
16, The style doc links in the operation matrix are resolving from references/
instead of the sibling style/ directory, so update the affected markdown
references in the lark-doc-operation-matrix table to use the correct relative
paths. Fix the entries that point to style/lark-doc-style.md,
style/lark-doc-create-workflow.md, and style/lark-doc-update-workflow.md so
navigation works correctly from references/.

@fangshuyu-768 fangshuyu-768 force-pushed the codex/lark-doc-skill-structure branch 5 times, most recently from ef67376 to dab0550 Compare June 25, 2026 10:34
@fangshuyu-768 fangshuyu-768 force-pushed the codex/lark-doc-skill-structure branch from dab0550 to f0d5e7b Compare June 25, 2026 10:42
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.

1 participant