Skip to content

feat: add slides +create shortcut with skill docs#389

Merged
fangshuyu-768 merged 1 commit intomainfrom
feat/lark_slides
Apr 11, 2026
Merged

feat: add slides +create shortcut with skill docs#389
fangshuyu-768 merged 1 commit intomainfrom
feat/lark_slides

Conversation

@ethan-zhx
Copy link
Copy Markdown
Collaborator

@ethan-zhx ethan-zhx commented Apr 10, 2026

Summary

Add Lark Slides support with a new slides +create shortcut and the initial lark-slides skill documentation/reference set. This lets agents create an empty presentation from the CLI and, in bot mode, automatically grant the current CLI user full access to the new presentation.

Changes

  • Add the slides +create shortcut, register it, and auto-grant current-user drive permission after bot-created presentations
  • Add tests covering user mode, bot auto-grant, skipped grant behavior, and XML escaping
  • Add English service description plus the skills/lark-slides docs, examples, schema references, and README updates

Test Plan

  • Unit tests pass (go test ./shortcuts/slides/...)
  • Manual local verification confirms the lark xxx command works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Added Slides service and CLI support to create and manage presentations in XML (returns presentation ID, title, revision, and optional permission-grant info when using app identity); Slides shortcuts integrated into the CLI.
  • Documentation

    • README updated (AI Agent Skills 21, business domains 13); comprehensive Slides docs added (skill spec, examples, XML schema quick-ref, command usage, templates, workflows).
  • Tests

    • Added CLI tests covering creation flows and XML escaping.

@github-actions github-actions bot added the size/XL Architecture-level or global-impact change label Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

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

Adds Slides as a new feature: README updates, a slides registry entry, slides shortcuts (including +create with XML payload handling and optional auto-grant), permission-label mapping for slides, comprehensive skill/docs (XML schema, templates, examples), and unit tests for creation and permission flows.

Changes

Cohort / File(s) Summary
README Updates
README.md, README.zh.md
Added Slides/幻灯片 to product coverage; incremented Agent Skills to 21 and business domains to 13; added Slides row in Features and lark-slides entry in Agent Skills.
Service Registry
internal/registry/service_descriptions.json
Added top-level slides entry with localized en/zh title and description for XML presentation management.
Shortcuts Core
shortcuts/register.go, shortcuts/common/permission_grant.go
Imported shortcuts/slides and appended its Shortcuts(); mapped resourceType == "slides" to permission label "presentation".
Slides Shortcuts
shortcuts/slides/shortcuts.go, shortcuts/slides/slides_create.go, shortcuts/slides/slides_create_test.go
New slides shortcuts domain and exported Shortcuts(); SlidesCreate implements +create with XML payload construction/escaping, DryRun/Execute flows, API response validation, optional AutoGrantCurrentUserDrivePermission call, and tests covering user/bot/grant scenarios plus xmlEscape unit tests.
Skill Documentation & Examples
skills/lark-slides/SKILL.md, skills/lark-slides/references/*, skills/lark-slides/references/slides_demo.xml
Added full skill docs: usage/workflows, XML schema quick-ref, examples, templates, command references, error guides, demo SML file, and numerous reference docs for create/get/delete and slide templates.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI (lark-cli)
    participant SlidesAPI as Slides API (/open-apis/slides_ai)
    participant GrantSvc as AutoGrant helper
    participant DriveAPI as Drive API (/open-apis/drive)
    CLI->>SlidesAPI: POST /xml_presentations (create payload)
    SlidesAPI-->>CLI: 201 { xml_presentation_id, revision_id, title }
    alt as bot && current user exists
        CLI->>GrantSvc: AutoGrantCurrentUserDrivePermission(resourceType="slides", id)
        GrantSvc->>DriveAPI: POST /permissions/{presentation}/members
        DriveAPI-->>GrantSvc: 200 { status }
        GrantSvc-->>CLI: permission_grant result
    else as user or no current user
        GrantSvc-->>CLI: permission_grant skipped/none
    end
    CLI-->>User: stdout JSON envelope (xml_presentation_id, title, optional permission_grant)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

size/L

Suggested reviewers

  • liangshuo-1
  • zhouyue-bytedance

Poem

🐰
I stitched slides from XML bright,
A hop of code to make them light.
Blank decks bloom into page by page,
CLI whispers steps onto the stage.
Hooray — a bunny-built slideshow flight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and specifically describes the main additions: the 'slides +create' shortcut and skill documentation.
Description check ✅ Passed The PR description follows the template structure with all required sections (Summary, Changes, Test Plan, Related Issues) completed with clear, substantive content.

✏️ 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 feat/lark_slides

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 10, 2026

CLA assistant check
All committers have signed the CLA.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 10, 2026

Greptile Summary

This PR adds a slides +create shortcut that creates a Lark Slides presentation (optionally adding slides in one step) and auto-grants drive permission to the current CLI user in bot mode, along with a full lark-slides skill documentation set. The implementation is well-structured and test coverage is thorough; two minor correctness issues were found.

  • Broken doc link (SKILL.md line 321): references/lark-slides-xml-presentations-create.md is referenced but not present in the repo — agents following this link will get a 404.
  • Stale revision_id: When --slides is provided, the revision_id returned reflects only the initial creation response; each slide-add call increments the server revision, leaving the returned value behind by N revisions.

Confidence Score: 4/5

Safe to merge after addressing the broken doc link; the stale revision_id and count inconsistency are minor.

One P1 (broken reference link that will cause agent lookups to 404) and two P2s (stale revision_id in response, partial-failure count divergence). Core shortcut logic, XML escaping, auth flow, and bot auto-grant are all correct and well-tested.

skills/lark-slides/SKILL.md (broken link) and shortcuts/slides/slides_create.go (stale revision_id, partial-failure count)

Important Files Changed

Filename Overview
shortcuts/slides/slides_create.go Core create-presentation implementation; minor issues: stale revision_id returned after slides are added, and error-message slide count uses loop index instead of len(slideIDs)
shortcuts/slides/slides_create_test.go Comprehensive test coverage for create, bot auto-grant, partial failure, dry-run, empty slides, and XML escaping; all edge cases exercised
shortcuts/common/permission_grant.go Adds "slides" → "presentation" mapping to permissionTargetLabel; clean, no issues
shortcuts/slides/shortcuts.go Simple aggregator returning SlidesCreate; correctly registered in shortcuts/register.go
skills/lark-slides/SKILL.md Thorough skill doc but references a non-existent file (lark-slides-xml-presentations-create.md) which will break agent lookups
shortcuts/register.go slides.Shortcuts() correctly added to allShortcuts; no issues

Sequence Diagram

sequenceDiagram
    participant CLI as lark-cli
    participant API as Lark API
    participant Drive as Drive API

    CLI->>API: POST /open-apis/slides_ai/v1/xml_presentations
    API-->>CLI: xml_presentation_id, revision_id

    opt --slides provided
        loop for each slide XML
            CLI->>API: POST /xml_presentations/{id}/slide (revision_id: -1)
            API-->>CLI: slide_id, new revision_id
        end
    end

    opt --as bot && userOpenId configured
        CLI->>Drive: POST /open-apis/drive/v1/permissions/{id}/members
        Drive-->>CLI: grant result
    end

    CLI-->>CLI: Output JSON (xml_presentation_id, title, revision_id, slide_ids?, permission_grant?)
    Note over CLI: revision_id is from initial creation only
Loading

Reviews (17): Last reviewed commit: "feat(slides): add slides +create shortcu..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/lark_slides -y -g

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: 9

🧹 Nitpick comments (1)
shortcuts/slides/slides_create_test.go (1)

100-106: 建议避免不安全的类型断言,提升失败可读性。

grant["message"].(string) 在字段缺失/类型变化时会 panic。建议先做 ok 检查并给出 t.Fatalf,这样回归时错误信息更明确。

Refactor suggestion
-	grant, _ := data["permission_grant"].(map[string]interface{})
+	grant, ok := data["permission_grant"].(map[string]interface{})
+	if !ok {
+		t.Fatalf("permission_grant missing or invalid: %#v", data["permission_grant"])
+	}
 	if grant["status"] != common.PermissionGrantGranted {
 		t.Fatalf("permission_grant.status = %v, want %q", grant["status"], common.PermissionGrantGranted)
 	}
-	if !strings.Contains(grant["message"].(string), "presentation") {
-		t.Fatalf("permission_grant.message = %q, want 'presentation' mention", grant["message"])
+	msg, ok := grant["message"].(string)
+	if !ok {
+		t.Fatalf("permission_grant.message missing or invalid: %#v", grant["message"])
+	}
+	if !strings.Contains(msg, "presentation") {
+		t.Fatalf("permission_grant.message = %q, want 'presentation' mention", msg)
 	}

Also applies to: 136-139

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/slides/slides_create_test.go` around lines 100 - 106, The test uses
unsafe type assertions on the parsed map (grant, and grant["message"].(string))
which can panic if fields are missing or types change; update the test to check
the type assertions with the comma-ok pattern before using values (e.g., assert
grant is a map[string]interface{} and that msg, ok := grant["message"].(string)
is true), and call t.Fatalf with explicit messages when the type/key is missing
or unexpected; update the corresponding checks that compare grant["status"] to
common.PermissionGrantGranted to also verify the status value exists and is the
expected type before comparing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shortcuts/slides/slides_create.go`:
- Around line 65-68: The result map currently uses the raw title variable so
when --title is empty callers get an empty string while the XML falls back to
"Untitled"; update the code that builds result (the map assigned to result with
keys "xml_presentation_id" and "title") to use the effective title actually
written to XML (compute an effectiveTitle = title or "Untitled" and store that
in result["title"] instead of the raw title), referencing the existing variables
presentationID and title and the result map construction.

In `@skills/lark-slides/references/examples.md`:
- Line 3: Replace the phrase "提供和 CLI schema 一致的调用示例" with the more natural
wording "提供与 CLI schema 一致的调用示例" in the sentence that reads "本文档提供和 CLI schema
一致的调用示例,XML 内容均遵循
[slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。" so the
sentence becomes "本文档提供与 CLI schema 一致的调用示例,XML 内容均遵循
[slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。".

In `@skills/lark-slides/references/lark-slides-create.md`:
- Around line 27-31: The IMPORTANT blockquote contains a blank line triggering
markdownlint MD028; edit the block started by "[!IMPORTANT]" so the blockquote
is contiguous by either removing the empty line between the two paragraphs or
prefixing that blank line with ">" (i.e., ensure the lines containing "`slides
+create` 只创建空白演示文稿..." and "如果演示文稿是**以应用身份(bot)创建**的,如 `lark-cli slides +create
--as bot`..." remain in the same blockquote without an unprefixed blank line).
- Line 28: The documentation has a typo: it instructs using
`xml_presentation.slide create` to add slides but the correct command is
`xml_presentation.slides create` (plural); update the text that follows `slides
+create` (and the other occurrence around the later paragraph) to reference
`xml_presentation.slides create` so it matches the actual command set and avoids
misleading users.

In `@skills/lark-slides/references/lark-slides-xml-presentations-create.md`:
- Around line 21-27: The request example incorrectly includes presentation_id
and revision_id as input fields; the actual create call (see the code that only
sends xml_presentation.content) only expects xml_presentation.content. Remove
presentation_id and revision_id from the create request example (or mark them
explicitly as response-only), and update the example payload so it only shows
the xml_presentation.content field (matching the create logic that sends
xml_presentation.content).
- Around line 39-42: The blockquote section contains an extra blank line between
consecutive '>' lines which triggers markdownlint MD028; remove the empty line
so the two quoted paragraphs about `xml_presentation.content` and the
"**当前命令行为说明**:`xml_presentations.create`..." are consecutive blockquote lines
(or combine them into a single blockquote paragraph), ensuring no blank line
exists between the `>`-prefixed lines.

In `@skills/lark-slides/references/slide-templates.md`:
- Line 3: Update the documented command path to the correct plural form: replace
references to xml_presentation.slide.create with xml_presentation.slides create
(including the occurrence noted as "Also applies to: 6-6") so the command
matches the rest of the references and will be executable; ensure both instances
in slide-templates.md use "xml_presentation.slides create".

In `@skills/lark-slides/references/xml-format-guide.md`:
- Around line 222-252: The docs list <icon> and <chart> as valid <data> page
elements but this contradicts the SlideType in the XSD (SlideType only allows
shape/line/polyline/img/table/smartArt); update the xml-format-guide.md to align
with the XSD by either removing or marking <icon> and <chart> as unsupported by
SlideType, or explicitly document that they are non-SlideType extensions and
must not be emitted for SlideType-based XML; when keeping the <chart> docs,
ensure the required sub-elements listed (chartPlotArea, chartData) and optional
ones (chartTitle, chartSubTitle, chartStyle, chartLegend, chartTooltip) match
the XSD element names and constraints so the examples and prose reflect the
actual schema.

In `@skills/lark-slides/SKILL.md`:
- Around line 45-46: 示例中混用了资源名 xml_presentation.slide 和
xml_presentation.slides,导致 CLI 示例可能执行失败;请在 SKILL.md 中把所有示例统一为真实的 resource
name(使用 xml_presentation.slides),例如将 "lark-cli slides xml_presentation.slide
create --as user" 及其它出现的 xml_presentation.slide 改为
xml_presentation.slides,并同步更新快速开始、API Resources 和参考文档中的所有相同示例以保持一致性。

---

Nitpick comments:
In `@shortcuts/slides/slides_create_test.go`:
- Around line 100-106: The test uses unsafe type assertions on the parsed map
(grant, and grant["message"].(string)) which can panic if fields are missing or
types change; update the test to check the type assertions with the comma-ok
pattern before using values (e.g., assert grant is a map[string]interface{} and
that msg, ok := grant["message"].(string) is true), and call t.Fatalf with
explicit messages when the type/key is missing or unexpected; update the
corresponding checks that compare grant["status"] to
common.PermissionGrantGranted to also verify the status value exists and is the
expected type before comparing.
🪄 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: d30001b0-5325-420e-b773-1661bb939919

📥 Commits

Reviewing files that changed from the base of the PR and between 76fac11 and 732a764.

📒 Files selected for processing (20)
  • README.md
  • README.zh.md
  • internal/registry/service_descriptions.json
  • shortcuts/common/permission_grant.go
  • shortcuts/register.go
  • shortcuts/slides/shortcuts.go
  • shortcuts/slides/slides_create.go
  • shortcuts/slides/slides_create_test.go
  • skills/lark-slides/SKILL.md
  • skills/lark-slides/references/examples.md
  • skills/lark-slides/references/lark-slides-create.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slides-create.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slides-delete.md
  • skills/lark-slides/references/lark-slides-xml-presentations-create.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-slides/references/slide-templates.md
  • skills/lark-slides/references/slides_demo.xml
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • skills/lark-slides/references/xml-format-guide.md
  • skills/lark-slides/references/xml-schema-quick-ref.md

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 10, 2026

Tip:

Greploop — Automatically fix all review issues by running /greploops in Claude Code. It iterates: fix, push, re-review, repeat until 5/5 confidence.

Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal.

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

♻️ Duplicate comments (1)
skills/lark-slides/SKILL.md (1)

45-46: ⚠️ Potential issue | 🟠 Major

统一 xml_presentation.slidexml_presentation.slides 的资源名,避免示例不可执行。

Line 45、Line 94、Line 255、Line 276 与参考文档命名(Line 331-332)存在单复数混用,会导致用户按文档执行时失败。请全文件统一为真实 CLI resource name。

Proposed patch
-lark-cli slides xml_presentation.slide create \
+lark-cli slides xml_presentation.slides create \
@@
-    · xml_presentation.slide.create 逐页添加 slide
+    · xml_presentation.slides.create 逐页添加 slide
@@
-### xml_presentation.slide
+### xml_presentation.slides
@@
-  - `create` — 在指定 xml 演示文稿下创建页面
-  - `delete` — 删除指定 xml 演示文稿下的页面
+  - `create` — 在指定 xml 演示文稿下创建页面
+  - `delete` — 删除指定 xml 演示文稿下的页面
@@
-| `xml_presentation.slide.create` | `slides:presentation:update` 或 `slides:presentation:write_only` |
-| `xml_presentation.slide.delete` | `slides:presentation:update` 或 `slides:presentation:write_only` |
+| `xml_presentation.slides.create` | `slides:presentation:update` 或 `slides:presentation:write_only` |
+| `xml_presentation.slides.delete` | `slides:presentation:update` 或 `slides:presentation:write_only` |

Also applies to: 94-95, 255-258, 276-277, 331-332

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-slides/SKILL.md` around lines 45 - 46, The examples use
inconsistent resource names "xml_presentation.slide" and
"xml_presentation.slides" which breaks the CLI examples; update every example
occurrence (including the command lines shown around the places referenced) to
the correct, single canonical resource name used by the CLI (choose either
xml_presentation.slide or xml_presentation.slides to match the actual CLI) so
all examples are consistent—search for all appearances of xml_presentation.slide
and xml_presentation.slides (notably the example command starting with "lark-cli
slides xml_presentation.slide create \\", and the other occurrences around the
referenced lines) and replace them with the chosen canonical resource name
throughout the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/lark-slides/SKILL.md`:
- Line 81: Three fenced code blocks in SKILL.md (the blocks containing "Step 1:
需求澄清 & 读取知识", "[PPT 标题] — [定位描述],面向 [目标受众]" and "Wiki Space (知识空间)") lack
language identifiers and trigger markdownlint MD040; update each opening
triple-backtick to include a language tag (e.g., change ``` to ```text) so the
blocks become fenced with a language specifier, leaving the block contents
unchanged.

---

Duplicate comments:
In `@skills/lark-slides/SKILL.md`:
- Around line 45-46: The examples use inconsistent resource names
"xml_presentation.slide" and "xml_presentation.slides" which breaks the CLI
examples; update every example occurrence (including the command lines shown
around the places referenced) to the correct, single canonical resource name
used by the CLI (choose either xml_presentation.slide or xml_presentation.slides
to match the actual CLI) so all examples are consistent—search for all
appearances of xml_presentation.slide and xml_presentation.slides (notably the
example command starting with "lark-cli slides xml_presentation.slide create
\\", and the other occurrences around the referenced lines) and replace them
with the chosen canonical resource name throughout the file.
🪄 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: 4189ee7b-ba8f-479f-a461-8b9b4857ab34

📥 Commits

Reviewing files that changed from the base of the PR and between 732a764 and 6e66e73.

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

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.

♻️ Duplicate comments (5)
skills/lark-slides/references/lark-slides-xml-presentations-create.md (2)

39-41: ⚠️ Potential issue | 🟡 Minor

Remove the blank line inside the blockquote (MD028).

Keep these two quoted lines consecutive to satisfy markdownlint.

🧹 Proposed formatting fix
 > 常见新建场景只需要传 `xml_presentation.content`,而且建议内容保持为空白 PPT 模板。XML 协议本身以 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml) 为准。
-
 > **当前命令行为说明**:`xml_presentations.create` 当前只适合创建空白 PPT,通常只支持指定标题和长宽。页面内容不要在这里一次性传入,后续 slide 请使用 [xml_presentation.slides create](lark-slides-xml-presentation-slides-create.md) 逐页添加。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-slides/references/lark-slides-xml-presentations-create.md` around
lines 39 - 41, The blockquote contains an extra blank line triggering
markdownlint MD028; edit the quoted section so the two lines starting with
"常见新建场景只需要传 `xml_presentation.content`..." and
"**当前命令行为说明**:`xml_presentations.create`..." are consecutive with no empty line
between them, keeping references to slides_xml_schema_definition.xml,
xml_presentation.content, xml_presentations.create and xml_presentation.slides
create unchanged.

21-27: ⚠️ Potential issue | 🟠 Major

Request example likely mixes in response-only fields.

presentation_id and revision_id in create input conflict with the surrounding guidance and can cause incorrect payload construction.

🛠️ Proposed doc correction
 {
   "xml_presentation": {
-    "content": "<presentation xmlns=\"http://www.larkoffice.com/sml/2.0\" width=\"960\" height=\"540\"><title>项目汇报</title></presentation>",
-    "presentation_id": "slides_example_presentation_id",
-    "revision_id": 1
+    "content": "<presentation xmlns=\"http://www.larkoffice.com/sml/2.0\" width=\"960\" height=\"540\"><title>项目汇报</title></presentation>"
   }
 }
 | 字段 | 类型 | 必需 | 说明 |
 |------|------|------|------|
 | `xml_presentation.content` | string | 否 | 演示文稿的 XML 内容 |
-| `xml_presentation.presentation_id` | string | 否 | 演示文稿 ID |
-| `xml_presentation.revision_id` | integer | 否 | 演示文稿版本号 |

Also applies to: 33-37

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-slides/references/lark-slides-xml-presentations-create.md` around
lines 21 - 27, The example create request incorrectly includes response-only
fields; remove "presentation_id" and "revision_id" from the create payload so
only the "xml_presentation.content" (and any allowed input-only fields) are
sent—update the JSON in the lark-slides XML create example to include just the
"xml_presentation.content" (e.g., "<presentation ...>...</presentation>") and
ensure the same fix is applied to the duplicate example at lines 33-37;
reference the keys "presentation_id", "revision_id", and
"xml_presentation.content" when locating the change.
skills/lark-slides/references/examples.md (1)

3-3: ⚠️ Potential issue | 🟡 Minor

Use “与” instead of “和” here for more natural wording.

Line 3 currently reads a bit stiff in Chinese technical docs.

📝 Proposed wording fix
-本文档提供和 CLI schema 一致的调用示例,XML 内容均遵循 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。
+本文档提供与 CLI schema 一致的调用示例,XML 内容均遵循 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-slides/references/examples.md` at line 3, Replace the conjunction
"和" with "与" in the sentence "本文档提供和 CLI schema 一致的调用示例,XML 内容均遵循
[slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。" so it
reads "本文档提供与 CLI schema 一致的调用示例,XML 内容均遵循
[slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。" to
achieve more natural Chinese phrasing.
shortcuts/slides/slides_create.go (1)

65-68: ⚠️ Potential issue | 🟡 Minor

Return the effective title in output, not the raw flag value.

When --title is empty, XML uses Untitled, but output currently returns an empty title.

💡 Proposed fix
-		result := map[string]interface{}{
+		effectiveTitle := title
+		if xmlEscape(title) == "" {
+			effectiveTitle = "Untitled"
+		}
+
+		result := map[string]interface{}{
 			"xml_presentation_id": presentationID,
-			"title":               title,
+			"title":               effectiveTitle,
 		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/slides/slides_create.go` around lines 65 - 68, The output currently
uses the raw flag variable title (which may be empty) when building result;
change it to return the effective title actually used in the XML (falling back
to the XML default "Untitled" or the title value read from the generated
presentation). After creating the presentation (where presentationID is set),
obtain the actual title (e.g. read the title from the created XML/presentation
object or compute effectiveTitle := title; if effectiveTitle == "" {
effectiveTitle = "Untitled" }) and put that effectiveTitle into the result map
in place of title so the "title" field reflects what is in the XML.
skills/lark-slides/SKILL.md (1)

45-46: ⚠️ Potential issue | 🟠 Major

Unify resource name to xml_presentation.slides everywhere.

This file still mixes xml_presentation.slide and xml_presentation.slides; copied commands can fail as-is.

🔧 Suggested normalization
-lark-cli slides xml_presentation.slide create \
+lark-cli slides xml_presentation.slides create \
@@
-    · xml_presentation.slide.create 逐页添加 slide
+    · xml_presentation.slides.create 逐页添加 slide
@@
-  - 有问题 → 用 xml_presentation.slide.delete 删除问题页,重新创建
+  - 有问题 → 用 xml_presentation.slides.delete 删除问题页,重新创建
@@
-lark-cli slides xml_presentation.slide create \
+lark-cli slides xml_presentation.slides create \
@@
-### xml_presentation.slide
+### xml_presentation.slides
@@
-2. **创建流程必须分两步**:`slides +create`(或 `xml_presentations.create`)只建空白 PPT,页面内容用 `xml_presentation.slide.create` 逐页添加
+2. **创建流程必须分两步**:`slides +create`(或 `xml_presentations.create`)只建空白 PPT,页面内容用 `xml_presentation.slides.create` 逐页添加
@@
-| `xml_presentation.slide.create` | `slides:presentation:update` 或 `slides:presentation:write_only` |
-| `xml_presentation.slide.delete` | `slides:presentation:update` 或 `slides:presentation:write_only` |
+| `xml_presentation.slides.create` | `slides:presentation:update` 或 `slides:presentation:write_only` |
+| `xml_presentation.slides.delete` | `slides:presentation:update` 或 `slides:presentation:write_only` |

Also applies to: 94-95, 102-103, 111-112, 255-258, 263-264, 276-277

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-slides/SKILL.md` around lines 45 - 46, Replace all occurrences of
the singular resource name "xml_presentation.slide" with the unified plural
"xml_presentation.slides" in this file; specifically update command lines like
"lark-cli slides xml_presentation.slide create --as user" and any other commands
or examples that use "xml_presentation.slide" (e.g., the other instances noted)
so every CLI invocation consistently uses "xml_presentation.slides".
🧹 Nitpick comments (1)
skills/lark-slides/references/lark-slides-xml-presentation-slides-create.md (1)

169-169: Polish phrasing for clearer Chinese readability.

Line 169 can read more naturally with “是否为完整的 <slide> 元素”.

📝 Suggested wording tweak
-| 400 | XML 格式错误 | 检查 `slide.content` 是否是完整 `<slide>` 元素 |
+| 400 | XML 格式错误 | 检查 `slide.content` 是否为完整的 `<slide>` 元素 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-slides/references/lark-slides-xml-presentation-slides-create.md`
at line 169, Update the table cell text in the row that currently reads "检查
`slide.content` 是否是完整 `<slide>` 元素" to the clearer phrasing "检查 `slide.content`
是否为完整的 `<slide>` 元素" so the Chinese reads naturally; locate the string in the
markdown where the 400 / XML 格式错误 row is defined (the table entry containing
`slide.content`) and replace the wording accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@shortcuts/slides/slides_create.go`:
- Around line 65-68: The output currently uses the raw flag variable title
(which may be empty) when building result; change it to return the effective
title actually used in the XML (falling back to the XML default "Untitled" or
the title value read from the generated presentation). After creating the
presentation (where presentationID is set), obtain the actual title (e.g. read
the title from the created XML/presentation object or compute effectiveTitle :=
title; if effectiveTitle == "" { effectiveTitle = "Untitled" }) and put that
effectiveTitle into the result map in place of title so the "title" field
reflects what is in the XML.

In `@skills/lark-slides/references/examples.md`:
- Line 3: Replace the conjunction "和" with "与" in the sentence "本文档提供和 CLI
schema 一致的调用示例,XML 内容均遵循
[slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。" so it
reads "本文档提供与 CLI schema 一致的调用示例,XML 内容均遵循
[slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。" to
achieve more natural Chinese phrasing.

In `@skills/lark-slides/references/lark-slides-xml-presentations-create.md`:
- Around line 39-41: The blockquote contains an extra blank line triggering
markdownlint MD028; edit the quoted section so the two lines starting with
"常见新建场景只需要传 `xml_presentation.content`..." and
"**当前命令行为说明**:`xml_presentations.create`..." are consecutive with no empty line
between them, keeping references to slides_xml_schema_definition.xml,
xml_presentation.content, xml_presentations.create and xml_presentation.slides
create unchanged.
- Around line 21-27: The example create request incorrectly includes
response-only fields; remove "presentation_id" and "revision_id" from the create
payload so only the "xml_presentation.content" (and any allowed input-only
fields) are sent—update the JSON in the lark-slides XML create example to
include just the "xml_presentation.content" (e.g., "<presentation
...>...</presentation>") and ensure the same fix is applied to the duplicate
example at lines 33-37; reference the keys "presentation_id", "revision_id", and
"xml_presentation.content" when locating the change.

In `@skills/lark-slides/SKILL.md`:
- Around line 45-46: Replace all occurrences of the singular resource name
"xml_presentation.slide" with the unified plural "xml_presentation.slides" in
this file; specifically update command lines like "lark-cli slides
xml_presentation.slide create --as user" and any other commands or examples that
use "xml_presentation.slide" (e.g., the other instances noted) so every CLI
invocation consistently uses "xml_presentation.slides".

---

Nitpick comments:
In `@skills/lark-slides/references/lark-slides-xml-presentation-slides-create.md`:
- Line 169: Update the table cell text in the row that currently reads "检查
`slide.content` 是否是完整 `<slide>` 元素" to the clearer phrasing "检查 `slide.content`
是否为完整的 `<slide>` 元素" so the Chinese reads naturally; locate the string in the
markdown where the 400 / XML 格式错误 row is defined (the table entry containing
`slide.content`) and replace the wording accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 65c7887d-fdff-40c4-b0e8-013c20a5959f

📥 Commits

Reviewing files that changed from the base of the PR and between c5ef8d6 and bc55b89.

📒 Files selected for processing (20)
  • README.md
  • README.zh.md
  • internal/registry/service_descriptions.json
  • shortcuts/common/permission_grant.go
  • shortcuts/register.go
  • shortcuts/slides/shortcuts.go
  • shortcuts/slides/slides_create.go
  • shortcuts/slides/slides_create_test.go
  • skills/lark-slides/SKILL.md
  • skills/lark-slides/references/examples.md
  • skills/lark-slides/references/lark-slides-create.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slides-create.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slides-delete.md
  • skills/lark-slides/references/lark-slides-xml-presentations-create.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-slides/references/slide-templates.md
  • skills/lark-slides/references/slides_demo.xml
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • skills/lark-slides/references/xml-format-guide.md
  • skills/lark-slides/references/xml-schema-quick-ref.md
✅ Files skipped from review due to trivial changes (9)
  • internal/registry/service_descriptions.json
  • skills/lark-slides/references/slides_demo.xml
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slides-delete.md
  • skills/lark-slides/references/slide-templates.md
  • shortcuts/slides/slides_create_test.go
  • skills/lark-slides/references/xml-schema-quick-ref.md
  • skills/lark-slides/references/xml-format-guide.md
  • shortcuts/register.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • shortcuts/slides/shortcuts.go
  • README.md
  • skills/lark-slides/references/lark-slides-create.md

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 the current code and only fix it if needed.

Inline comments:
In `@shortcuts/slides/slides_create_test.go`:
- Around line 102-107: The test uses unchecked type assertions on the
permission_grant map which can panic if the response shape changes; update the
checks around grant, grant["status"], and grant["message"] in
slides_create_test.go to use safe type assertions (ok idiom) and explicit
presence/type validation before comparing values (e.g., assert grant is
map[string]interface{}, assert status is string before comparing to
common.PermissionGrantGranted, and assert message is string before using
strings.Contains), and add clear t.Fatalf messages on missing/wrong types; apply
the same hardening to the other occurrence referenced at lines 139-142.
🪄 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: b9ef7c07-6829-492c-830b-074a6f1dfca2

📥 Commits

Reviewing files that changed from the base of the PR and between bc55b89 and 4cd025e.

📒 Files selected for processing (1)
  • shortcuts/slides/slides_create_test.go

@ViperCai ViperCai force-pushed the feat/lark_slides branch 5 times, most recently from d140023 to 964e5b3 Compare April 11, 2026 10:27
@fangshuyu-768 fangshuyu-768 merged commit a9c07ce into main Apr 11, 2026
16 checks passed
@fangshuyu-768 fangshuyu-768 deleted the feat/lark_slides branch April 11, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants