Skip to content

feat(drive): streamline drive skill routing#1644

Open
yballul-bytedance wants to merge 1 commit into
larksuite:mainfrom
yballul-bytedance:auto-research-sync/01KVMMAW9JNB87N9EEA2W9MGWT/mr-407-93c0a3a4
Open

feat(drive): streamline drive skill routing#1644
yballul-bytedance wants to merge 1 commit into
larksuite:mainfrom
yballul-bytedance:auto-research-sync/01KVMMAW9JNB87N9EEA2W9MGWT/mr-407-93c0a3a4

Conversation

@yballul-bytedance

@yballul-bytedance yballul-bytedance commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Streamline the Drive skill guidance into a shorter routing-first reference.

Changes

  • Replaced the long legacy Drive skill body with a compact route map.
  • Kept the key import, inspect, upload, download, sync, and permission guardrails.
  • Consolidated related workflow notes into a simpler hot-commands table.

Test Plan

  • git diff --check

Related Issues

Auto research task: 01KVMMAW9JNB87N9EEA2W9MGWT

Summary by CodeRabbit

  • Documentation
    • Streamlined the Drive skill guidance into a shorter, easier-to-scan format.
    • Added clearer command shortcuts, common workflows, and routing rules for choosing the right action.
    • Included stronger guardrails for permission, scope, and not-found cases, plus a reminder to check shared guidance first when needed.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

skills/lark-drive/SKILL.md is rewritten from a verbose reference document into a condensed card with four sections: Route (skill/command selection logic), Hot Commands (intent-to-shortcut table), Fixed Workflows (multi-step flow patterns), and Guardrails (wiki vs file token rules and stop-on-failure policy).

lark-drive SKILL.md rewrite

Layer / File(s) Summary
Route rules and Hot Commands table
skills/lark-drive/SKILL.md
Replaces prior headers and reference tables with a ## Route section for URL/token/extension-based skill selection and a ## Hot Commands table mapping user intents to lark-cli drive shortcuts with required flags and async/destructive constraints.
Fixed Workflows and Guardrails
skills/lark-drive/SKILL.md
Adds ## Fixed Workflows describing standardized multi-step flows (export, import, inspect→act, sync, comments-with-replies) and rewrites ## Guardrails to enforce wiki-token vs file-token separation and stop-and-surface on permission/scope/not-found failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • larksuite/cli#1284: Modifies the same skills/lark-drive/SKILL.md routing/decision sections with overlapping wiki vs file token handling and shortcut/workflow guidance.
  • larksuite/cli#1326: Tightens the same skills/lark-drive/SKILL.md guardrails around drive +inspect/+upload stop-on-failure behavior.
  • larksuite/cli#1275: Refines cross-skill routing and URL/token pitfall handling in skills/lark-wiki/SKILL.md, mirroring the drive-skill routing changes here.

Suggested labels

domain/base

Suggested reviewers

  • fangshuyu-768
  • wittam-01

Poem

🐇 Hop, hop! The skill card's lean and bright,
Hot Commands mapped from left to right.
Route by token, wiki or file,
Fixed workflows flow in tidy style.
Guardrails hold when errors appear—
This rabbit's docs are crisp and clear! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely matches the main change: streamlining Drive skill routing.
Description check ✅ Passed The description follows the required sections and covers 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

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.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Jun 29, 2026

@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-drive/SKILL.md`:
- Around line 30-56: The markdown table in SKILL.md is breaking because several
command examples in the rows for drive +export, drive +import, drive +pull,
drive +push, and drive +sync contain unescaped pipe characters that are being
parsed as extra columns. Update those table cells to escape the pipes or wrap
the option lists in HTML code tags, keeping the command names and option text
readable while preserving correct table column structure.
🪄 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: 5049633c-f1c2-4b06-b05f-92f271688ec0

📥 Commits

Reviewing files that changed from the base of the PR and between 30b28cf and 6e7583d.

📒 Files selected for processing (1)
  • skills/lark-drive/SKILL.md

Comment on lines +30 to +56
| User intent | Command / next step | Minimal flags and notes |
|---|---|---|
| Inspect URL/token/type | `drive +inspect` | `--url <url>`; wiki URLs are unpacked to canonical `type/token/title/url`. |
| Search Drive objects | `drive +search` | `--query`, optional `--edited-since`, `--created-by-me`, `--mine`, `--doc-types`, `--sort`; project only needed fields in your answer. |
| Upload local file | `drive +upload` | `--file ./relative --parent-token <folder>` or `--wiki-token <wiki_node>`; validate local path first. |
| Download Drive file | `drive +download` | `--file-token <token> --output ./relative/path --overwrite` when user says replace/overwrite; `--output` must stay relative to cwd. |
| Export online doc | `drive +export` | `--token <doc_token> --doc-type docx|sheet|bitable|slides --file-extension <ext>`; follow with `+export-download` when it returns a file token/task. |
| Download export result | `drive +export-download` | Use the exported `file_token` and a relative output path. |
| Import local file | `drive +import` | `--file ./relative --type docx|sheet|bitable|slides --folder-token <folder>`; follow with `+task_result` for async status. |
| Async result | `drive +task_result` | Use for import/export/move/delete task tokens until success/failure is clear. |
| Create folder | `drive +create-folder` | `--parent-token <folder> --name <name>`. |
| Delete file/folder | `drive +delete` | High-risk write: require explicit user confirmation and pass `--yes`; folder delete may need `+task_result`. |
| Preview formats | `drive +preview` | `--file-token <token> --list-only` to list downloadable PDF/HTML/text/image previews; add `--output ./relative` only when downloading. |
| Cover presets | `drive +cover` | `--file-token <token> --list-only`; add `--spec <preset> --output ./relative` only when downloading. |
| Folder list | `drive files list` | Raw API; read `references/lark-drive-files-list.md` if pagination/params are unclear. |
| Rename title | `drive files patch` | Use `new_title` for docx/sheet/bitable/file/wiki/folder; get schema before raw call. |
| Copy/move | `drive files copy` or `drive +move` | Prefer shortcut for move; raw copy requires schema. |
| Comments | `drive +add-comment`; raw `file.comments *` | Full comment/list/resolve via raw resources; replies via `file.comment.replys *`. |
| Permissions | `+apply-permission` or `permission.*` | Read permission guide for collaborator/public/app authorization details. |
| Versions | `+version-history/get/revert/delete` | Supports user and bot; destructive delete/revert needs explicit user intent. |
| Quota | `drive quota_details get --as user` | User-only; `quota_detail_id` is current user id. |
| Pull folder to local | `drive +pull` | `--folder-token <folder> --local-dir ./relative --if-exists skip|smart|overwrite`; create local root dir first if needed. |
| Push local to folder | `drive +push` | `--local-dir ./relative --folder-token <folder> --if-exists skip|smart|overwrite`; deletion needs `--delete-remote --yes`. |
| Status diff | `drive +status` | `--local-dir ./relative --folder-token <folder> [--quick]`; compares local and Drive without mutating. |
| Two-way sync | `drive +sync` | `--local-dir ./relative --folder-token <folder> --on-conflict remote-wins|local-wins|keep-both|ask`; does not delete extras by default. |
| Knowledge organize | Reference only | For broad "organize Drive/knowledge base" planning, read `references/lark-drive-workflow-knowledge-organize.md`; default to plan only. |

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 | 🔴 Critical | ⚡ Quick win

Fix broken markdown table formatting.

Multiple rows contain unescaped | characters inside code spans that are interpreted as column delimiters, breaking table rendering:

  • Line 36: docx|sheet|bitable|slides renders as 6 columns instead of 3
  • Line 38: docx|sheet|bitable|slides renders as 6 columns instead of 3
  • Line 51: skip|smart|overwrite renders as 5 columns instead of 3
  • Line 52: skip|smart|overwrite renders as 5 columns instead of 3
  • Line 54: remote-wins|local-wins|keep-both|ask renders as 6 columns instead of 3

Escape pipes inside table cells as \| or use <code> HTML tags.

🛠️ Proposed fix (escape pipes)
-| Export online doc | `drive +export` | `--token <doc_token> --doc-type docx|sheet|bitable|slides --file-extension <ext>`; follow with `+export-download` when it returns a file token/task. |
+| Export online doc | `drive +export` | `--token <doc_token> --doc-type docx\|sheet\|bitable\|slides --file-extension <ext>`; follow with `+export-download` when it returns a file token/task. |
-| Import local file | `drive +import` | `--file ./relative --type docx|sheet|bitable|slides --folder-token <folder>`; follow with `+task_result` for async status. |
+| Import local file | `drive +import` | `--file ./relative --type docx\|sheet\|bitable\|slides --folder-token <folder>`; follow with `+task_result` for async status. |
-| Pull folder to local | `drive +pull` | `--folder-token <folder> --local-dir ./relative --if-exists skip|smart|overwrite`; create local root dir first if needed. |
+| Pull folder to local | `drive +pull` | `--folder-token <folder> --local-dir ./relative --if-exists skip\|smart\|overwrite`; create local root dir first if needed. |
-| Push local to folder | `drive +push` | `--local-dir ./relative --folder-token <folder> --if-exists skip|smart|overwrite`; deletion needs `--delete-remote --yes`. |
+| Push local to folder | `drive +push` | `--local-dir ./relative --folder-token <folder> --if-exists skip\|smart\|overwrite`; deletion needs `--delete-remote --yes`. |
-| Two-way sync | `drive +sync` | `--local-dir ./relative --folder-token <folder> --on-conflict remote-wins|local-wins|keep-both|ask`; does not delete extras by default. |
+| Two-way sync | `drive +sync` | `--local-dir ./relative --folder-token <folder> --on-conflict remote-wins\|local-wins\|keep-both\|ask`; does not delete extras by default. |
📝 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
| User intent | Command / next step | Minimal flags and notes |
|---|---|---|
| Inspect URL/token/type | `drive +inspect` | `--url <url>`; wiki URLs are unpacked to canonical `type/token/title/url`. |
| Search Drive objects | `drive +search` | `--query`, optional `--edited-since`, `--created-by-me`, `--mine`, `--doc-types`, `--sort`; project only needed fields in your answer. |
| Upload local file | `drive +upload` | `--file ./relative --parent-token <folder>` or `--wiki-token <wiki_node>`; validate local path first. |
| Download Drive file | `drive +download` | `--file-token <token> --output ./relative/path --overwrite` when user says replace/overwrite; `--output` must stay relative to cwd. |
| Export online doc | `drive +export` | `--token <doc_token> --doc-type docx|sheet|bitable|slides --file-extension <ext>`; follow with `+export-download` when it returns a file token/task. |
| Download export result | `drive +export-download` | Use the exported `file_token` and a relative output path. |
| Import local file | `drive +import` | `--file ./relative --type docx|sheet|bitable|slides --folder-token <folder>`; follow with `+task_result` for async status. |
| Async result | `drive +task_result` | Use for import/export/move/delete task tokens until success/failure is clear. |
| Create folder | `drive +create-folder` | `--parent-token <folder> --name <name>`. |
| Delete file/folder | `drive +delete` | High-risk write: require explicit user confirmation and pass `--yes`; folder delete may need `+task_result`. |
| Preview formats | `drive +preview` | `--file-token <token> --list-only` to list downloadable PDF/HTML/text/image previews; add `--output ./relative` only when downloading. |
| Cover presets | `drive +cover` | `--file-token <token> --list-only`; add `--spec <preset> --output ./relative` only when downloading. |
| Folder list | `drive files list` | Raw API; read `references/lark-drive-files-list.md` if pagination/params are unclear. |
| Rename title | `drive files patch` | Use `new_title` for docx/sheet/bitable/file/wiki/folder; get schema before raw call. |
| Copy/move | `drive files copy` or `drive +move` | Prefer shortcut for move; raw copy requires schema. |
| Comments | `drive +add-comment`; raw `file.comments *` | Full comment/list/resolve via raw resources; replies via `file.comment.replys *`. |
| Permissions | `+apply-permission` or `permission.*` | Read permission guide for collaborator/public/app authorization details. |
| Versions | `+version-history/get/revert/delete` | Supports user and bot; destructive delete/revert needs explicit user intent. |
| Quota | `drive quota_details get --as user` | User-only; `quota_detail_id` is current user id. |
| Pull folder to local | `drive +pull` | `--folder-token <folder> --local-dir ./relative --if-exists skip|smart|overwrite`; create local root dir first if needed. |
| Push local to folder | `drive +push` | `--local-dir ./relative --folder-token <folder> --if-exists skip|smart|overwrite`; deletion needs `--delete-remote --yes`. |
| Status diff | `drive +status` | `--local-dir ./relative --folder-token <folder> [--quick]`; compares local and Drive without mutating. |
| Two-way sync | `drive +sync` | `--local-dir ./relative --folder-token <folder> --on-conflict remote-wins|local-wins|keep-both|ask`; does not delete extras by default. |
| Knowledge organize | Reference only | For broad "organize Drive/knowledge base" planning, read `references/lark-drive-workflow-knowledge-organize.md`; default to plan only. |
| User intent | Command / next step | Minimal flags and notes |
|---|---|---|
| Inspect URL/token/type | `drive +inspect` | `--url <url>`; wiki URLs are unpacked to canonical `type/token/title/url`. |
| Search Drive objects | `drive +search` | `--query`, optional `--edited-since`, `--created-by-me`, `--mine`, `--doc-types`, `--sort`; project only needed fields in your answer. |
| Upload local file | `drive +upload` | `--file ./relative --parent-token <folder>` or `--wiki-token <wiki_node>`; validate local path first. |
| Download Drive file | `drive +download` | `--file-token <token> --output ./relative/path --overwrite` when user says replace/overwrite; `--output` must stay relative to cwd. |
| Export online doc | `drive +export` | `--token <doc_token> --doc-type docx\|sheet\|bitable\|slides --file-extension <ext>`; follow with `+export-download` when it returns a file token/task. |
| Download export result | `drive +export-download` | Use the exported `file_token` and a relative output path. |
| Import local file | `drive +import` | `--file ./relative --type docx\|sheet\|bitable\|slides --folder-token <folder>`; follow with `+task_result` for async status. |
| Async result | `drive +task_result` | Use for import/export/move/delete task tokens until success/failure is clear. |
| Create folder | `drive +create-folder` | `--parent-token <folder> --name <name>`. |
| Delete file/folder | `drive +delete` | High-risk write: require explicit user confirmation and pass `--yes`; folder delete may need `+task_result`. |
| Preview formats | `drive +preview` | `--file-token <token> --list-only` to list downloadable PDF/HTML/text/image previews; add `--output ./relative` only when downloading. |
| Cover presets | `drive +cover` | `--file-token <token> --list-only`; add `--spec <preset> --output ./relative` only when downloading. |
| Folder list | `drive files list` | Raw API; read `references/lark-drive-files-list.md` if pagination/params are unclear. |
| Rename title | `drive files patch` | Use `new_title` for docx/sheet/bitable/file/wiki/folder; get schema before raw call. |
| Copy/move | `drive files copy` or `drive +move` | Prefer shortcut for move; raw copy requires schema. |
| Comments | `drive +add-comment`; raw `file.comments *` | Full comment/list/resolve via raw resources; replies via `file.comment.replys *`. |
| Permissions | `+apply-permission` or `permission.*` | Read permission guide for collaborator/public/app authorization details. |
| Versions | `+version-history/get/revert/delete` | Supports user and bot; destructive delete/revert needs explicit user intent. |
| Quota | `drive quota_details get --as user` | User-only; `quota_detail_id` is current user id. |
| Pull folder to local | `drive +pull` | `--folder-token <folder> --local-dir ./relative --if-exists skip\|smart\|overwrite`; create local root dir first if needed. |
| Push local to folder | `drive +push` | `--local-dir ./relative --folder-token <folder> --if-exists skip\|smart\|overwrite`; deletion needs `--delete-remote --yes`. |
| Status diff | `drive +status` | `--local-dir ./relative --folder-token <folder> [--quick]`; compares local and Drive without mutating. |
| Two-way sync | `drive +sync` | `--local-dir ./relative --folder-token <folder> --on-conflict remote-wins\|local-wins\|keep-both\|ask`; does not delete extras by default. |
| Knowledge organize | Reference only | For broad "organize Drive/knowledge base" planning, read `references/lark-drive-workflow-knowledge-organize.md`; default to plan only. |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 36-36: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 36-36: Table column count
Expected: 3; Actual: 6; Too many cells, extra data will be missing

(MD056, table-column-count)


[warning] 38-38: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 38-38: Table column count
Expected: 3; Actual: 6; Too many cells, extra data will be missing

(MD056, table-column-count)


[warning] 51-51: Table column count
Expected: 3; Actual: 5; Too many cells, extra data will be missing

(MD056, table-column-count)


[warning] 52-52: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 52-52: Table column count
Expected: 3; Actual: 5; Too many cells, extra data will be missing

(MD056, table-column-count)


[warning] 54-54: Table column count
Expected: 3; Actual: 6; Too many cells, extra data will be missing

(MD056, table-column-count)

🤖 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-drive/SKILL.md` around lines 30 - 56, The markdown table in
SKILL.md is breaking because several command examples in the rows for drive
+export, drive +import, drive +pull, drive +push, and drive +sync contain
unescaped pipe characters that are being parsed as extra columns. Update those
table cells to escape the pipes or wrap the option lists in HTML code tags,
keeping the command names and option text readable while preserving correct
table column structure.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add yballul-bytedance/cli#auto-research-sync/01KVMMAW9JNB87N9EEA2W9MGWT/mr-407-93c0a3a4 -y -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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