Skip to content

docs(lark-slides): tighten SKILL.md routing and trim always-loaded content#1169

Open
ViperCai wants to merge 5 commits into
mainfrom
optimize/lark-slides-skill
Open

docs(lark-slides): tighten SKILL.md routing and trim always-loaded content#1169
ViperCai wants to merge 5 commits into
mainfrom
optimize/lark-slides-skill

Conversation

@ViperCai
Copy link
Copy Markdown
Collaborator

@ViperCai ViperCai commented May 29, 2026

Background

Source: the CCM skill-quality audit doc (wiki), which raised 10 issues for lark-slides. This PR lands only the high-value, low-risk ones, and pushes back on / down-grades the lower-value or overly aggressive suggestions.

Changes

Audit item Action
description missing NOT / contains impl detail Drop "接口通过 XML 协议通信"; append a 不负责:... (out-of-scope) segment so "make a deck" / "draw an architecture diagram" no longer mis-route to lark-doc / lark-whiteboard
No reverse-boundary section Add a ## 不在本 skill 范围 (out-of-scope) routing table (doc / whiteboard / drive / sheets / base)
"Design Ideas" block too long Move the design spec (color strategy, page forms, alignment, common errors) into visual-planning.md (already a CRITICAL forced read on create / large-edit); SKILL.md keeps only the core gate + a pointer. No content lost
Permission table inside SKILL.md Relocate the per-method scope table to references/lark-slides-permissions.md, leaving a one-line pointer (relocated, not deleted)
Duplicated wiki-token handling Merge the three overlapping explanations; drop the over-emphatic "(关键!)" marker

Not adopted / pushed back

  • "schema note duplicates lark-shared": this is a slides native-API usage guardrail, not a real duplication — removing it would drop a useful "don't guess fields" hint. Left as-is.
  • Bulk-rename 13 reference files: purely cosmetic, requires updating every reference path with breakage risk for marginal benefit. Deferred to a later cleanup.

Verification

  • All cross-skill relative links (doc / whiteboard / drive / sheets / base / shared) were confirmed to exist; no dangling references.
  • Self-review caught and fixed one content loss from the consolidation: the icon-row / grid page forms and the body-text alignment rule were not covered by visual-planning.md's Layout Types. They were added back and explicitly marked as not layout_type enum values.
  • Incidentally resolved two latent numeric inconsistencies between the old SKILL.md and visual-planning.md (body font size, page margins); visual-planning.md's more precise figures are now the single source of truth.
  • The always-loaded SKILL.md shrank from 12842 → 11581 chars, with the largest design-guidance block moved to on-demand reading.

Summary by CodeRabbit

  • Documentation
    • Clarified routing guidelines for slide-related requests, specifying URL/token patterns and explicit out-of-scope responsibilities
    • Strengthened preflight requirements to reference centralized authentication, permissions, and global parameters
    • Added guidance to prefer native APIs when no shortcut applies and to validate request schemas before calling them
    • Replaced prior quick-permissions table with an out-of-scope routing table to direct tasks to appropriate services

Review Change Stack

…ntent

Based on the CCM skill-quality audit, apply the high-value, low-risk findings:

- description: drop the implementation detail ("接口通过 XML 协议通信") and add a
  NOT segment so "做演示文稿" / "画架构图" don't mis-route to lark-doc / lark-whiteboard
- add a "不在本 skill 范围" routing table (doc / whiteboard / drive / sheets / base)
- move the design spec (color strategy, page forms, alignment, common errors) into
  visual-planning.md (already a CRITICAL forced read on create/large-edit); SKILL.md
  keeps only the core gate + a pointer. No content lost
- relocate the per-method scope table to references/lark-slides-permissions.md, leaving
  a one-line pointer
- de-duplicate and de-emphasize the wiki-token handling section

Pushed back on the audit's lower-value items (schema-note "duplication", bulk
reference renames) and relocated rather than deleted the permission table.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Caution

Review failed

Failed to post review comments

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

Updated skills/lark-slides/SKILL.md to refine the skill description, point precondition/authentication governance to ../lark-shared/SKILL.md, add native API guidance for cases without Shortcut coverage, and replace the permissions table with an out-of-scope routing table.

Changes

Lark Slides Documentation Refinement

Layer / File(s) Summary
Skill metadata and precondition rules
skills/lark-slides/SKILL.md
Reworded the front-matter description to remove "XML 协议" wording while preserving routing rules; updated the "开始前 MUST" note to reference ../lark-shared/SKILL.md for auth, permissions, and global params.
Native API guidance (no Shortcut)
skills/lark-slides/SKILL.md
Added "没有 Shortcut 覆盖时使用原生 API" with example CLI commands, listed native methods (xml_presentations.get, xml_presentation.slide.create/delete/get/replace), and mandated running schema first to validate --data/--params.
Out-of-scope routing table
skills/lark-slides/SKILL.md
Replaced the prior permissions cheat-sheet with a routing table that directs out-of-scope tasks (docx/wiki editing, whiteboard drawing, drive operations, embedded tables/multi-dimensional data) to lark-doc, lark-whiteboard, lark-drive, and lark-sheets/lark-base.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#1082: Earlier docs change for lark-slides routing by URL path/token that this PR extends.
  • larksuite/cli#389: Initial lark-slides skill documentation and shortcut setup that this PR refines.

Suggested labels

domain/ccm

Suggested reviewers

  • fangshuyu-768
  • kongenpei

Poem

🐰 I hopped through docs with careful cheer,
Swapped a phrase and pointed auth clear,
When Shortcut fades, use native calls,
Out-of-scope finds its proper halls,
Slides now guide the devs near and dear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: tightening SKILL.md routing and trimming always-loaded content from lark-slides documentation.
Description check ✅ Passed The description includes Background, Changes, Verification sections with detailed explanations, but lacks explicit Test Plan and Related Issues sections from the template.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize/lark-slides-skill

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 and usage tips.

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

@coderabbitai coderabbitai Bot left a comment

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-slides/references/lark-slides-permissions.md`:
- Line 3: Update the remediation instructions for missing scopes: replace the
user identity command suggestion `auth login --domain slides` with the correct
CLI usage that supplies the missing scopes, e.g. `lark-cli auth login --scope
"<missing scopes>"` (or `auth login --scope "<missing scopes>"` if using local
CLI shorthand) so it matches the missing-scope handling referenced in SKILL.md;
ensure the text around the `user 身份` guidance and the `bot 身份` guidance remains
consistent with this corrected flag usage.
- Line 9: Update the table row for the `slides +replace-slide` shortcut to
include the missing scope `slides:presentation:write_only` alongside
`slides:presentation:update` and `wiki:node:read` so the documented scopes match
the actual shortcut declaration and prevent preflight auth failures; locate the
entry referencing "`slides +replace-slide`" in lark-slides-permissions.md and
append `slides:presentation:write_only` to the listed scopes.
🪄 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: 0c4bbb3e-3aa7-4b0f-8eaf-622633bba3bd

📥 Commits

Reviewing files that changed from the base of the PR and between 0a2c320 and eeaf291.

📒 Files selected for processing (3)
  • skills/lark-slides/SKILL.md
  • skills/lark-slides/references/lark-slides-permissions.md
  • skills/lark-slides/references/visual-planning.md

@@ -0,0 +1,14 @@
# slides 权限速查

各方法所需 scope。遇到权限不足时按 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 的流程处理(user 身份用 `auth login --domain slides`,bot 身份去开发者后台开通对应 scope)。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Missing-scope remediation command should use --scope, not --domain.

Line 3 currently tells user identity to run auth login --domain slides, but missing-scope handling in CLI points users to lark-cli auth login --scope "<missing scopes>". The current wording can lead to unresolved permission errors.

Suggested doc fix
-各方法所需 scope。遇到权限不足时按 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 的流程处理(user 身份用 `auth login --domain slides`,bot 身份去开发者后台开通对应 scope)。
+各方法所需 scope。遇到权限不足时按 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 的流程处理(user 身份按缺失项执行 `lark-cli auth login --scope "<scopes>"`,bot 身份去开发者后台开通对应 scope)。
📝 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
各方法所需 scope。遇到权限不足时按 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 的流程处理(user 身份用 `auth login --domain slides`,bot 身份去开发者后台开通对应 scope)。
各方法所需 scope。遇到权限不足时按 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 的流程处理(user 身份按缺失项执行 `lark-cli auth login --scope "<scopes>"`,bot 身份去开发者后台开通对应 scope)。
🤖 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-slides/references/lark-slides-permissions.md` at line 3, Update
the remediation instructions for missing scopes: replace the user identity
command suggestion `auth login --domain slides` with the correct CLI usage that
supplies the missing scopes, e.g. `lark-cli auth login --scope "<missing
scopes>"` (or `auth login --scope "<missing scopes>"` if using local CLI
shorthand) so it matches the missing-scope handling referenced in SKILL.md;
ensure the text around the `user 身份` guidance and the `bot 身份` guidance remains
consistent with this corrected flag usage.

|------|-----------|
| `slides +create` | `slides:presentation:create`, `slides:presentation:write_only`(含 `@` 占位符时还需 `docs:document.media:upload`) |
| `slides +media-upload` | `docs:document.media:upload`(wiki URL 解析还需 `wiki:node:read`) |
| `slides +replace-slide` | `slides:presentation:update`(wiki URL 解析还需 `wiki:node:read`) |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

+replace-slide scopes are incomplete in the table.

Line 9 omits slides:presentation:write_only, but the shortcut currently declares both slides:presentation:update and slides:presentation:write_only (plus wiki:node:read). This can cause preflight auth failures for users following this doc.

Suggested doc fix
-| `slides +replace-slide` | `slides:presentation:update`(wiki URL 解析还需 `wiki:node:read`) |
+| `slides +replace-slide` | `slides:presentation:update`, `slides:presentation:write_only`(wiki URL 解析还需 `wiki:node:read`) |
📝 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
| `slides +replace-slide` | `slides:presentation:update`(wiki URL 解析还需 `wiki:node:read`|
| `slides +replace-slide` | `slides:presentation:update`, `slides:presentation:write_only`(wiki URL 解析还需 `wiki:node:read`|
🤖 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-slides/references/lark-slides-permissions.md` at line 9, Update
the table row for the `slides +replace-slide` shortcut to include the missing
scope `slides:presentation:write_only` alongside `slides:presentation:update`
and `wiki:node:read` so the documented scopes match the actual shortcut
declaration and prevent preflight auth failures; locate the entry referencing
"`slides +replace-slide`" in lark-slides-permissions.md and append
`slides:presentation:write_only` to the listed scopes.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.90%. Comparing base (0a2c320) to head (a633ada).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1169      +/-   ##
==========================================
+ Coverage   68.79%   68.90%   +0.10%     
==========================================
  Files         628      628              
  Lines       58680    58735      +55     
==========================================
+ Hits        40371    40473     +102     
+ Misses      15015    14958      -57     
- Partials     3294     3304      +10     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#optimize/lark-slides-skill -y -g

ViperCai added 2 commits May 29, 2026 15:46
…ive-API guardrail local

- trim 身份选择 / wiki / lark-shared CRITICAL to delegate auth, permissions and
  global params to lark-shared (which actually owns them)
- drop the standalone permission table (CLI errors already return the missing
  scopes + console_url), removing references/lark-slides-permissions.md
- keep the schema-first native-API guardrail inline, matching the wording used by
  all 12 sibling skills — lark-shared does not document a native-API call flow, so
  delegating it there would dangle and lose the "run schema first, don't guess
  fields" rule
The skill audit did not flag 身份选择; trimming it was an optional cleanup that
dropped the concrete `auth login --domain slides` command and the slides-specific
"verify the bot actually has access to the target deck" caveat (which lark-shared
does not cover). Keep the section self-contained.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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-slides/SKILL.md`:
- Around line 213-214: The doc uses dot notation
`xml_presentation.slide.create/delete/get/replace` which conflicts with later
CLI-style examples; update the mention to the space-separated CLI-style form
`xml_presentation.slide create/delete/get/replace` (and similarly change
`xml_presentations.get` to `xml_presentations get` where appropriate) so it
matches the `lark-cli slides <resource> <method>` format used elsewhere in the
file and avoids implying a single command path.
🪄 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: 203010bd-bd81-465b-b70a-10ec3d2133a0

📥 Commits

Reviewing files that changed from the base of the PR and between eeaf291 and 2eaa367.

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

Comment thread skills/lark-slides/SKILL.md
ViperCai added 2 commits May 29, 2026 15:59
Drop the Design Ideas -> visual-planning.md move (audit #6/#10, Warning-level token
optimization). It was optional and not required; keeping the design spec inline
minimizes the diff. visual-planning.md is restored to its original state.
Restore the dedicated section and its concrete `wiki spaces get_node` command.
The audit's "duplicates other skills" claim doesn't hold here — the get_node call
is the actionable key step for resolving a wiki token to a presentation id, and
condensing it dropped the command. Keep it inline.
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