refactor(slides): create slide and edit ppt template#1726
Conversation
📝 WalkthroughWalkthroughThis PR restructures the lark-slides skill documentation: SKILL.md is rewritten around identity selection, URL/token handling, and design/color guidance; new create-workflow, template-workflow, and whiteboard reference docs are added; demo XML files illustrate charts/timelines; deprecated planning/asset/format docs are removed; schema quick-ref is expanded; validation checklist and cross-document links are updated. ChangesLark Slides skill documentation restructuring
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1726 +/- ##
=======================================
Coverage 74.40% 74.40%
=======================================
Files 854 854
Lines 88375 88375
=======================================
Hits 65752 65752
Misses 17552 17552
Partials 5071 5071 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@21af86c8d605f19995cf942441cf98304ecc4307🧩 Skill updatenpx skills add larksuite/cli#refactor/slides-creator -y -g |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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-replace-slide.md`:
- Line 240: The workflow nav link is stale because the markdown reference target
no longer matches the canonical doc name, and the visible label still uses the
old filename. Update the link in the lark-slides replace-slide reference so both
the href and the label point to the current workflow document name, keeping the
navigation entry consistent with the renamed workflow referenced by
lark-slides-edit-workflows and lark-slides-block-replace-workflows.
In `@skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md`:
- Line 110: The markdown link label and target in the slide reference are out of
sync after the workflow doc rename. Update the link text and href in
lark-slides-xml-presentation-slide-get.md so the visible label no longer says
lark-slides-edit-workflows.md and both the label and destination match the
renamed workflow doc referenced by lark-slides-block-replace-workflows.
In `@skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md`:
- Line 187: The workflow reference text in the slides XML replacement docs still
points to the old name and omits the markdown suffix; update the link target and
the displayed label in the affected reference so they both match the renamed
workflow document. Use the existing reference entry in
lark-slides-xml-presentation-slide-replace.md as the locator, and make the same
name change wherever the old lark-slides-edit-workflows.md label or href is used
so the visible text and destination stay consistent.
🪄 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: 61ca690a-7b0c-4d63-993d-29f74bdfe0dc
📒 Files selected for processing (16)
skills/lark-slides/SKILL.mdskills/lark-slides/references/asset-planning.mdskills/lark-slides/references/design-rules.mdskills/lark-slides/references/lark-slides-block-replace-workflows.mdskills/lark-slides/references/lark-slides-create-workflows.mdskills/lark-slides/references/lark-slides-pptx-template-workflows.mdskills/lark-slides/references/lark-slides-replace-slide.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-create.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-get.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-replace.mdskills/lark-slides/references/planning-layer.mdskills/lark-slides/references/slides_template_workflow.mdskills/lark-slides/references/validation-checklist.mdskills/lark-slides/references/visual-planning.mdskills/lark-slides/references/xml-format-guide.mdskills/lark-slides/references/xml-schema-quick-ref.md
💤 Files with no reviewable changes (4)
- skills/lark-slides/references/asset-planning.md
- skills/lark-slides/references/visual-planning.md
- skills/lark-slides/references/planning-layer.md
- skills/lark-slides/references/xml-format-guide.md
| - [xml_presentation.slide replace](lark-slides-xml-presentation-slide-replace.md) — 底层 replace API 参考 | ||
| - [+media-upload](lark-slides-media-upload.md) — 上传图片拿 `file_token` | ||
| - [lark-slides-edit-workflows.md](lark-slides-edit-workflows.md) — 读-改-写闭环 + 决策树 | ||
| - [lark-slides-edit-workflows.md](lark-slides-block-replace-workflows) — 读-改-写闭环 + 决策树 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the renamed workflow link.
The href drops the .md suffix, and the visible label still says lark-slides-edit-workflows.md. Please update both to the canonical workflow doc name so this nav entry doesn't go stale.
🤖 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-replace-slide.md` at line 240, The
workflow nav link is stale because the markdown reference target no longer
matches the canonical doc name, and the visible label still uses the old
filename. Update the link in the lark-slides replace-slide reference so both the
href and the label point to the current workflow document name, keeping the
navigation entry consistent with the renamed workflow referenced by
lark-slides-edit-workflows and lark-slides-block-replace-workflows.
| - [xml_presentation.slide replace](lark-slides-xml-presentation-slide-replace.md) — 底层 replace API 参考 | ||
| - [xml_presentations get](lark-slides-xml-presentations-get.md) — 读整个 PPT | ||
| - [lark-slides-edit-workflows.md](lark-slides-edit-workflows.md) — 读-改-写闭环 | ||
| - [lark-slides-edit-workflows.md](lark-slides-block-replace-workflows) — 读-改-写闭环 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Point this link at the renamed workflow doc.
The href no longer includes the .md file, and the visible label still references lark-slides-edit-workflows.md. Please make the label and target match the new doc name.
🤖 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-xml-presentation-slide-get.md` at
line 110, The markdown link label and target in the slide reference are out of
sync after the workflow doc rename. Update the link text and href in
lark-slides-xml-presentation-slide-get.md so the visible label no longer says
lark-slides-edit-workflows.md and both the label and destination match the
renamed workflow doc referenced by lark-slides-block-replace-workflows.
| - [xml_presentation.slide get](lark-slides-xml-presentation-slide-get.md) — 读原页拿 block short ID | ||
| - [slides +media-upload](lark-slides-media-upload.md) — 上传图片拿 file_token | ||
| - [lark-slides-edit-workflows.md](lark-slides-edit-workflows.md) — 读-改-写闭环 + 决策树 | ||
| - [lark-slides-edit-workflows.md](lark-slides-block-replace-workflows) — 读-改-写闭环 + 决策树 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the workflow link to the renamed file.
The href omits the .md suffix, and the visible label still says lark-slides-edit-workflows.md. Please update both to the current workflow doc name.
🤖 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-xml-presentation-slide-replace.md`
at line 187, The workflow reference text in the slides XML replacement docs
still points to the old name and omits the markdown suffix; update the link
target and the displayed label in the affected reference so they both match the
renamed workflow document. Use the existing reference entry in
lark-slides-xml-presentation-slide-replace.md as the locator, and make the same
name change wherever the old lark-slides-edit-workflows.md label or href is used
so the visible text and destination stay consistent.
8197308 to
6b97187
Compare
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-slides/references/lark-slides-create-workflows.md`:
- Around line 24-77: The relative references in this lark-slides workflow doc
are resolving from the wrong base because the file already sits under
skills/lark-slides/references/. Update the broken links in the CRITICAL section
and the later shortcut table so they point to the correct neighboring files from
this location, including the lark-shared SKILL reference and all references/...
entries. Keep the same targets, but adjust the paths consistently across the
document so navigation works after merge.
🪄 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: 4df390cd-01e1-41a3-935a-fd11edf35c0d
📒 Files selected for processing (16)
skills/lark-slides/SKILL.mdskills/lark-slides/references/asset-planning.mdskills/lark-slides/references/design-rules.mdskills/lark-slides/references/lark-slides-block-replace-workflows.mdskills/lark-slides/references/lark-slides-create-workflows.mdskills/lark-slides/references/lark-slides-pptx-template-workflows.mdskills/lark-slides/references/lark-slides-replace-slide.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-create.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-get.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-replace.mdskills/lark-slides/references/planning-layer.mdskills/lark-slides/references/slides_template_workflow.mdskills/lark-slides/references/validation-checklist.mdskills/lark-slides/references/visual-planning.mdskills/lark-slides/references/xml-format-guide.mdskills/lark-slides/references/xml-schema-quick-ref.md
💤 Files with no reviewable changes (4)
- skills/lark-slides/references/visual-planning.md
- skills/lark-slides/references/planning-layer.md
- skills/lark-slides/references/xml-format-guide.md
- skills/lark-slides/references/asset-planning.md
✅ Files skipped from review due to trivial changes (6)
- skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md
- skills/lark-slides/references/lark-slides-replace-slide.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md
- skills/lark-slides/references/slides_template_workflow.md
- skills/lark-slides/references/validation-checklist.md
🚧 Files skipped from review as they are similar to previous changes (2)
- skills/lark-slides/references/xml-schema-quick-ref.md
- skills/lark-slides/SKILL.md
6b97187 to
cc4e3c3
Compare
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-slides/references/lark-slides-create-workflows.md`:
- Around line 129-133: The warning/admonition block in
lark-slides-create-workflows.md contains an extra blank line that triggers
Markdownlint MD028. Remove the blank line inside the blockquote so the two
admonitions stay adjacent, and keep the formatting consistent around the
existing warning/important text in that section.
🪄 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: b81005d9-5769-41e6-b9f2-0b945b10093b
📒 Files selected for processing (16)
skills/lark-slides/SKILL.mdskills/lark-slides/references/asset-planning.mdskills/lark-slides/references/design-rules.mdskills/lark-slides/references/lark-slides-block-replace-workflows.mdskills/lark-slides/references/lark-slides-create-workflows.mdskills/lark-slides/references/lark-slides-pptx-template-workflows.mdskills/lark-slides/references/lark-slides-replace-slide.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-create.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-get.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-replace.mdskills/lark-slides/references/planning-layer.mdskills/lark-slides/references/slides_template_workflow.mdskills/lark-slides/references/validation-checklist.mdskills/lark-slides/references/visual-planning.mdskills/lark-slides/references/xml-format-guide.mdskills/lark-slides/references/xml-schema-quick-ref.md
💤 Files with no reviewable changes (4)
- skills/lark-slides/references/asset-planning.md
- skills/lark-slides/references/visual-planning.md
- skills/lark-slides/references/xml-format-guide.md
- skills/lark-slides/references/planning-layer.md
✅ Files skipped from review due to trivial changes (5)
- skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md
- skills/lark-slides/references/lark-slides-replace-slide.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md
- skills/lark-slides/references/xml-schema-quick-ref.md
🚧 Files skipped from review as they are similar to previous changes (3)
- skills/lark-slides/references/validation-checklist.md
- skills/lark-slides/SKILL.md
- skills/lark-slides/references/slides_template_workflow.md
| > [!WARNING] | ||
| > `--slides '[...]'` 的风险点主要在 shell 参数传递,而不是单纯页数。即使只有 1 页,只要 XML 足够复杂,也建议使用两步创建法。 | ||
|
|
||
| > [!IMPORTANT] | ||
| > `slides +create --slides` 底层会逐页创建,不是原子操作。中途失败时先记录 `xml_presentation_id`,回读确认当前状态,再继续修复或追加。 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove the blank line inside the warning blockquote. Markdownlint still reports MD028 here; keeping the admonitions adjacent avoids a doc-lint failure.
Proposed fix
> [!WARNING]
> `--slides '[...]'` 的风险点主要在 shell 参数传递,而不是单纯页数。即使只有 1 页,只要 XML 足够复杂,也建议使用两步创建法。
->
> [!IMPORTANT]
> `slides +create --slides` 底层会逐页创建,不是原子操作。中途失败时先记录 `xml_presentation_id`,回读确认当前状态,再继续修复或追加。📝 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.
| > [!WARNING] | |
| > `--slides '[...]'` 的风险点主要在 shell 参数传递,而不是单纯页数。即使只有 1 页,只要 XML 足够复杂,也建议使用两步创建法。 | |
| > [!IMPORTANT] | |
| > `slides +create --slides` 底层会逐页创建,不是原子操作。中途失败时先记录 `xml_presentation_id`,回读确认当前状态,再继续修复或追加。 | |
| > [!WARNING] | |
| > `--slides '[...]'` 的风险点主要在 shell 参数传递,而不是单纯页数。即使只有 1 页,只要 XML 足够复杂,也建议使用两步创建法。 | |
| > [!IMPORTANT] | |
| > `slides +create --slides` 底层会逐页创建,不是原子操作。中途失败时先记录 `xml_presentation_id`,回读确认当前状态,再继续修复或追加。 |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 131-131: Blank line inside blockquote
(MD028, no-blanks-blockquote)
🤖 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-create-workflows.md` around lines
129 - 133, The warning/admonition block in lark-slides-create-workflows.md
contains an extra blank line that triggers Markdownlint MD028. Remove the blank
line inside the blockquote so the two admonitions stay adjacent, and keep the
formatting consistent around the existing warning/important text in that
section.
Source: Linters/SAST tools
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
skills/lark-slides/SKILL.md (2)
52-55: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd the
node.obj_type == "slides"guard.The
/wiki/workflow is incomplete without the type check the PR intends: fetchingobj_tokenalone is not enough to distinguish slide presentations from other wiki-backed nodes.Suggested edit
-| `/wiki/` | `https://example.larkoffice.com/wiki/wikcnxxxxxxxxx` | `wiki_token` | ⚠️ **不能直接使用**,需要先查询获取真实的 `obj_token` | +| `/wiki/` | `https://example.larkoffice.com/wiki/wikcnxxxxxxxxx` | `wiki_token` | ⚠️ **不能直接使用**,需要先查询 wiki 节点,确认 `node.obj_type == "slides"` 后再使用真实的 `node.obj_token` |🤖 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/SKILL.md` around lines 52 - 55, The wiki URL handling in the SKILL.md guidance is missing the intended `node.obj_type == "slides"` guard, so the workflow can still treat non-slide wiki nodes as slide presentations. Update the `/wiki/` lookup instructions in the relevant shortcut/API section to require checking the returned node’s `obj_type` before using the resolved `obj_token`, and make sure the guidance around `replace-slide` and `media-upload` reflects that only slide-backed wiki nodes should be accepted.
20-20: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winShow the required slide selector here.
+screenshotrejects requests unless--slide-idor--slide-numberis present, so this row currently sends readers into a known error path. Please include the selector requirement in the quick reference.Suggested edit
-| 获取在线 slides 内容、读取 / 分析已有在线 PPT | XML 内容优先用 `slides +xml-get` 保存到文件;页面视觉内容用 `slides +screenshot`,详见 `lark-slides-screenshot.md` | +| 获取在线 slides 内容、读取 / 分析已有在线 PPT | XML 内容优先用 `slides +xml-get` 保存到文件;页面视觉内容用 `slides +screenshot --slide-id ...` / `--slide-number ...`,详见 `lark-slides-screenshot.md` |🤖 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/SKILL.md` at line 20, The quick reference row for slides screenshot usage is missing the required slide selector, which leads users into the known rejection path. Update the SKILL.md entry that mentions `slides +screenshot` so it explicitly states that `--slide-id` or `--slide-number` must be provided, keeping the selector requirement alongside the `+screenshot` guidance.
🤖 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.
Outside diff comments:
In `@skills/lark-slides/SKILL.md`:
- Around line 52-55: The wiki URL handling in the SKILL.md guidance is missing
the intended `node.obj_type == "slides"` guard, so the workflow can still treat
non-slide wiki nodes as slide presentations. Update the `/wiki/` lookup
instructions in the relevant shortcut/API section to require checking the
returned node’s `obj_type` before using the resolved `obj_token`, and make sure
the guidance around `replace-slide` and `media-upload` reflects that only
slide-backed wiki nodes should be accepted.
- Line 20: The quick reference row for slides screenshot usage is missing the
required slide selector, which leads users into the known rejection path. Update
the SKILL.md entry that mentions `slides +screenshot` so it explicitly states
that `--slide-id` or `--slide-number` must be provided, keeping the selector
requirement alongside the `+screenshot` guidance.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 409d538b-95fc-4b64-afbb-f1e811942052
📒 Files selected for processing (8)
skills/lark-slides/SKILL.mdskills/lark-slides/references/lark-slides-create-workflows.mdskills/lark-slides/references/lark-slides-whiteboard.mdskills/lark-slides/references/slides_chart_demo.xmlskills/lark-slides/references/slides_template_workflow.mdskills/lark-slides/references/slides_timeline_demo.xmlskills/lark-slides/references/validation-checklist.mdskills/lark-slides/references/xml-schema-quick-ref.md
✅ Files skipped from review due to trivial changes (2)
- skills/lark-slides/references/slides_chart_demo.xml
- skills/lark-slides/references/slides_timeline_demo.xml
🚧 Files skipped from review as they are similar to previous changes (3)
- skills/lark-slides/references/xml-schema-quick-ref.md
- skills/lark-slides/references/slides_template_workflow.md
- skills/lark-slides/references/lark-slides-create-workflows.md
Summary
Refactor the lark-slides skill docs around slide creation and PPT template editing workflows.
Changes
Test Plan
Not run locally per machine safety instructions.
Related Issues
Summary by CodeRabbit
New Features
Documentation