Skip to content

docs: refresh mail skill API resources#1922

Open
infeng wants to merge 2 commits into
larksuite:mainfrom
infeng:feat/323c64b
Open

docs: refresh mail skill API resources#1922
infeng wants to merge 2 commits into
larksuite:mainfrom
infeng:feat/323c64b

Conversation

@infeng

@infeng infeng commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Updates the mail skill documentation with expanded mailbox workflows and refreshed API command guidance.

  • Adds detailed examples for recipient search, send-as, delivery status, recall, sharing mail to chat, calendar invites, drafts, HTML checks, mailbox rules, and sender allow/block resources.
  • Adds a draft/send reference page for working with draft lifecycle operations.

Summary by CodeRabbit

  • Documentation
    • Broadened “lark-mail” skill/intent coverage and updated onboarding requirements, including stricter guidance around help-first usage.
    • Expanded end-to-end mail workflows: recipient discovery with confirmation, safer sending constraints (including scheduling rules), per-recipient send status verification, cancellation of scheduled sends, and recall details.
    • Added detailed batch +draft-send documentation (dry runs, stop-on-error vs abort behavior, partial-failure envelopes, and retry guidance).
    • Strengthened HTML authoring/linting and template/merge semantics guidance, plus updated shortcuts and API resources/permissions reference.

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

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de25f061-65ab-4468-868b-82effb5cca2c

📥 Commits

Reviewing files that changed from the base of the PR and between 741b2b9 and cc20358.

📒 Files selected for processing (2)
  • skills/lark-mail/SKILL.md
  • skills/lark-mail/references/lark-mail-draft-send.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-mail/references/lark-mail-draft-send.md

📝 Walkthrough

Walkthrough

Expanded lark-mail guidance with recipient discovery, send safety, HTML linting, templates, API resources, permissions, and a new +draft-send reference covering batch execution and partial failures.

Changes

Mail documentation

Layer / File(s) Summary
Operational workflow and send safety
skills/lark-mail/SKILL.md
Adds first-use help checks, recipient search and confirmation, send-as instructions, delivery-status and recall flows, IM sharing, and calendar invite constraints.
Composition, linting, and templates
skills/lark-mail/SKILL.md
Expands writing rules, prohibits hand-crafted raw EML, documents enforced HTML linting, controls HTML output, and details template merging.
API resources and permissions
skills/lark-mail/SKILL.md
Adds schema-first API guidance, resource method listings, shortcut behavior, and permission scopes.
Batch draft sending reference
skills/lark-mail/references/lark-mail-draft-send.md
Documents +draft-send, confirmation and error handling, batch parameters, result envelopes, retry behavior, and related commands.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • larksuite/cli#1017: Documents the +draft-send batching, result aggregation, and error-handling behavior.
  • larksuite/cli#1893: Overlaps on raw EML prohibition and enforced HTML linting guidance.
  • larksuite/cli#449: Overlaps on scheduled-send status verification and cancellation guidance.

Suggested reviewers: chanthuang

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the mail skill documentation refresh, though it understates the broader workflow and draft-page updates.
Description check ✅ Passed The description covers the summary and main changes, but it omits the template's Test Plan and Related Issues sections.
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 commented Jul 16, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add infeng/cli#feat/323c64b -y -g

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/lark-mail/SKILL.md (1)

19-19: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Carve out +draft-send from the universal --confirm-send rule.

This wording implies every sending command defaults to draft mode and uses --confirm-send, but +draft-send sends existing drafts and has its own explicit-confirmation contract. Clarify the exception to prevent callers from applying the wrong workflow or sending without the required confirmation.

Proposed clarification
-- **草稿(Draft)**:未发送的邮件。所有发送类命令默认保存为草稿,加 `--confirm-send` 才实际发送。
+- **草稿(Draft)**:未发送的邮件。Compose 类发送命令默认保存为草稿,加 `--confirm-send` 才实际发送;`+draft-send` / `drafts.send` 是发送已有草稿的例外,同样必须先取得用户明确确认。
🤖 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-mail/SKILL.md` at line 19, Update the “草稿(Draft)” documentation
to explicitly exclude +draft-send from the universal --confirm-send draft
workflow. State that +draft-send sends existing drafts under its own
explicit-confirmation requirement, while preserving the existing default
behavior for other sending commands.
🤖 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-mail/references/lark-mail-draft-send.md`:
- Line 63: Update the partial-failure documentation around the retry guidance
and JSON output description to define the exact envelope containing ok, sent,
failed, counts, and account-level aborted/abort_error fields. Explicitly
distinguish successfully sent, failed, and unattempted draft IDs—especially
those skipped by --stop-on-error—and instruct callers to retry only failed
drafts after confirming sent drafts were delivered; when aborted is true,
resolve the account-level failure before retrying.

In `@skills/lark-mail/SKILL.md`:
- Around line 299-309: Update the calendar invitation example near the mail send
command so it matches the “save draft, then send after confirmation” wording:
remove the immediate-send behavior or show distinct draft and confirmed-send
commands, and replace the past 2026-05-10 event date with a clearly future
placeholder/date.
- Around line 152-167: Update the candidate-confirmation requirement in the
search-result handling instructions so it applies only when one or more matches
are found. Preserve the existing no-match behavior: inform the user no results
were found and suggest changing the keyword or providing an email address
directly.

---

Outside diff comments:
In `@skills/lark-mail/SKILL.md`:
- Line 19: Update the “草稿(Draft)” documentation to explicitly exclude
+draft-send from the universal --confirm-send draft workflow. State that
+draft-send sends existing drafts under its own explicit-confirmation
requirement, while preserving the existing default behavior for other sending
commands.
🪄 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: 8b9957dd-75a0-4b8a-86f1-842f0c5718f3

📥 Commits

Reviewing files that changed from the base of the PR and between 7081960 and 741b2b9.

📒 Files selected for processing (2)
  • skills/lark-mail/SKILL.md
  • skills/lark-mail/references/lark-mail-draft-send.md

Comment thread skills/lark-mail/references/lark-mail-draft-send.md Outdated
Comment thread skills/lark-mail/SKILL.md Outdated
Comment thread skills/lark-mail/SKILL.md Outdated
Comment thread skills/lark-mail/SKILL.md
| `user_mailboxes.search` | `mail:user_mailbox.message:readonly` |
| `user_mailbox.allow_sender.batch_create` | `mail:user_mailbox.message:modify` |
| `user_mailbox.allow_sender.batch_remove` | `mail:user_mailbox.message:modify` |
| `user_mailbox.allow_sender.list` | `mail:user_mailbox.message:modify` |

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 AI Review | [P2 正确性] list 方法权限表写成了 modify

larksuite-cli-registryregistry-conf/registry-config.yaml:529:535user_mailbox.allow_sender.list / blocked_sender.list 配的是 mail:user_mailbox.message:readonly,但这里的 skill 权限表写成了 modify。Agent 按文档申请权限时会把只读查询误导成写权限,导致最小授权和用户预期都不一致。

修复建议: 将这两行 list scope 改为 mail:user_mailbox.message:readonly,保留 batch_create / batch_remove 为 modify

如有疑问或认为判断不准确,欢迎直接回复讨论。

@infeng

infeng commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 AI Review | CR 汇总 | 有风险(1 个 P2)

本次新增 1 个文档正确性问题:用户级黑白名单两个 list 方法的权限表与 registry 不一致,建议修复后合入。

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

Labels

domain/mail PR touches the mail domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant