Skip to content

docs: update Lark Mail skill API resources#1646

Open
infeng wants to merge 4 commits into
larksuite:mainfrom
infeng:feat/1e0aada
Open

docs: update Lark Mail skill API resources#1646
infeng wants to merge 4 commits into
larksuite:mainfrom
infeng:feat/1e0aada

Conversation

@infeng

@infeng infeng commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Updates the Lark Mail skill documentation with expanded command coverage and current usage guidance for mailbox workflows.

  • Refreshes skill metadata and trigger terms for mail drafting, reading, rules, attachments, labels, contacts, and HTML compatibility checks.
  • Adds guidance for recipient lookup, send-as usage, delivery status checks, recall, message sharing, mail rules, and thread/message operations.
  • Clarifies first-use help checks and send/draft workflow behavior.

Summary by CodeRabbit

  • Documentation
    • Expanded the mail skill guide with broader intent coverage, stricter first-run -h guidance, and an updated receiver selection flow.
    • Added/clarified “Trusted/Blocked Senders” using dedicated allow/blocked sender list operations, with “user must explicitly confirm” applied to related batch add/remove actions.
    • Strengthened sending, scheduling, delivery-status checks, HTML linting/write constraints, and template creation/merge rules (including --template-id).
    • Refreshed shortcuts plus API resources and permission method references.
  • Tests
    • Added quality-gate tests verifying sender-list routing hints remain present in released markdown.

@coderabbitai

coderabbitai Bot commented Jun 29, 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: 5599d397-4691-4b70-8cc6-d5addab4ebad

📥 Commits

Reviewing files that changed from the base of the PR and between 296db74 and a0cecd4.

📒 Files selected for processing (4)
  • internal/qualitygate/rules/mail_skill_sender_lists_test.go
  • skill-template/domains/mail.md
  • skills/lark-mail/SKILL.md
  • skills/lark-mail/references/lark-mail-rules.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-mail/references/lark-mail-rules.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • internal/qualitygate/rules/mail_skill_sender_lists_test.go
  • skill-template/domains/mail.md

📝 Walkthrough

Walkthrough

skills/lark-mail/SKILL.md, skill-template/domains/mail.md, and related references were updated to cover trusted/blocked sender commands, revised mail workflow rules, recipient search and send guidance, HTML lint behavior, template merging, API resources, and permissions. Tests were added to verify the sender-list routing text remains present in the markdown sources.

Changes

lark-mail documentation and guidance update

Layer / File(s) Summary
Trusted/blocked senders and routing text
skills/lark-mail/SKILL.md, skill-template/domains/mail.md, skills/lark-mail/references/lark-mail-rules.md, internal/qualitygate/rules/mail_skill_sender_lists_test.go
Defines trusted/blocked sender management in the skill and template docs, routes those actions to dedicated allow/block APIs, and adds tests that assert the markdown contains the expected routing guidance.
Workflow, recipient search, and send checks
skills/lark-mail/SKILL.md
Updates typical workflow steps, recipient search rules, pre-send confirmation, post-send send_status checks, scheduled send handling, send_as lookup, and related mail flows.
HTML writing, lint, and read behavior
skills/lark-mail/SKILL.md
Expands HTML writing guidance, lint behavior, raw EML restrictions, and verification reads with --html=false.
Template merge rules and native API guidance
skills/lark-mail/SKILL.md
Reworks template creation and update rules, recipient and attachment merging, cid handling, and native API discovery steps.
Shortcuts, API resources, and permissions
skills/lark-mail/SKILL.md
Refreshes shortcut descriptions, +draft-send behavior, API resource listings, and the permissions table for the updated mail operations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#1527: Edits the same skills/lark-mail/SKILL.md areas around -h guidance and API Resources/权限表 content.
  • larksuite/cli#749: Updates the mail skill docs with related confirmation and mail-operation guidance in the same documentation set.

Suggested labels

documentation

Suggested reviewers

  • chanthuang

Poem

🐇 Hop, the mail rules bloom bright,
Blacklists and allowlists hop in sight,
-h first, then send with care,
HTML lint keeps drafts fair,
A bunny hums through inbox lore,
With cleaner mail than ever before.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required template sections and does not include a test plan or related issues. Reformat the PR description to match the template and add the missing Summary, Changes, Test Plan, and Related Issues sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the documentation/API-resource update.
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 domain/mail PR touches the mail domain size/L Large or sensitive change across domains or core paths labels 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

🧹 Nitpick comments (1)
skills/lark-mail/SKILL.md (1)

140-148: 📐 Maintainability & Code Quality | 🔵 Trivial

Clarify whether slash-separated type values are alternatives or compound values.

The table uses user / chatter and chat / group with slashes. Consider using "或" (or) to explicitly indicate these are alternative values for the same entity type, e.g., user(或 chatter).

🤖 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` around lines 140 - 148, The entity type table in
the search results section is ambiguous because slash-separated values like
user/chatter and chat/group can be read as compound types; update the
descriptions in SKILL.md to make it explicit that these are alternatives for the
same entity type, using wording such as “或” or parentheses, and keep the rest of
the table entries consistent with that convention.
🤖 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/SKILL.md`:
- Around line 98-104: Update the mail command guidance in SKILL.md for the
`+reply`, `+reply-all`, `+forward`, and `+send` entries so `--confirm-send` is
described as sending only after explicit user confirmation, not as an automatic
bypass. Rephrase those steps to make the confirmation requirement clear and
consistent with the safety rule in the document, while keeping the behavior of
`send_status`, `cancel_scheduled_send`, and the draft workflow unchanged.

---

Nitpick comments:
In `@skills/lark-mail/SKILL.md`:
- Around line 140-148: The entity type table in the search results section is
ambiguous because slash-separated values like user/chatter and chat/group can be
read as compound types; update the descriptions in SKILL.md to make it explicit
that these are alternatives for the same entity type, using wording such as “或”
or parentheses, and keep the rest of the table entries consistent with that
convention.
🪄 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: 4c1227e1-9fae-4dbc-975e-4ec091357bc6

📥 Commits

Reviewing files that changed from the base of the PR and between 602c788 and 48921b7.

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

Comment thread skills/lark-mail/SKILL.md
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add infeng/cli#feat/1e0aada -y -g

@infeng infeng requested a review from liangshuo-1 as a code owner June 29, 2026 18:54

@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

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)

100-102: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify that --confirm-send requires explicit user confirmation first.

Steps 4–6 still say "加 --confirm-send 则立即发送" which can be misread as skipping confirmation. The critical safety rule at Line 35 mandates pre-send recipient/content confirmation. Rephrase to "加 --confirm-send 并在用户确认后发送" to prevent ambiguity, consistent with the prior review feedback.

🤖 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` around lines 100 - 102, The reply/forward usage
text in SKILL.md is ambiguous about `--confirm-send`; update the `+reply`,
`+reply-all`, and `+forward` descriptions to explicitly say sending happens only
after explicit user confirmation, matching the safety rule in the document and
avoiding the impression that the flag bypasses confirmation.
🧹 Nitpick comments (1)
internal/qualitygate/rules/mail_skill_sender_lists_test.go (1)

27-31: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer t.Errorf over t.Fatalf to report all missing strings.

Using t.Fatalf stops at the first missing string. t.Errorf would surface every missing routing hint in one run, reducing fix-and-retest cycles.

 		if !strings.Contains(body, want) {
-			t.Fatalf("lark-mail skill is missing blocked sender routing hint %q", want)
+			t.Errorf("lark-mail skill is missing blocked sender routing hint %q", want)
 		}

(and similarly for the template test).

Also applies to: 46-50

🤖 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 `@internal/qualitygate/rules/mail_skill_sender_lists_test.go` around lines 27 -
31, The checks in the mail skill sender list tests stop at the first missing
routing hint because they use t.Fatalf inside the required-string loop. Update
the assertions in the relevant test helper and the template test to use t.Errorf
instead, so all missing strings are reported in one run. Keep the loop structure
in the test functions that validate body contents and required hints, but avoid
terminating early on the first failure.
🤖 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 `@internal/qualitygate/rules/mail_skill_sender_lists_test.go`:
- Line 14: The file path used in mail skill sender list tests is resolving from
internal/ instead of the repository root, so the markdown fixture paths are off
by one directory. Update the vfs.ReadFile calls in
mail_skill_sender_lists_test.go to use an additional "../" so they correctly
reach the root-level skills/ and skill-template/ directories, and make the same
fix for the other affected ReadFile usage in this test file.

---

Outside diff comments:
In `@skills/lark-mail/SKILL.md`:
- Around line 100-102: The reply/forward usage text in SKILL.md is ambiguous
about `--confirm-send`; update the `+reply`, `+reply-all`, and `+forward`
descriptions to explicitly say sending happens only after explicit user
confirmation, matching the safety rule in the document and avoiding the
impression that the flag bypasses confirmation.

---

Nitpick comments:
In `@internal/qualitygate/rules/mail_skill_sender_lists_test.go`:
- Around line 27-31: The checks in the mail skill sender list tests stop at the
first missing routing hint because they use t.Fatalf inside the required-string
loop. Update the assertions in the relevant test helper and the template test to
use t.Errorf instead, so all missing strings are reported in one run. Keep the
loop structure in the test functions that validate body contents and required
hints, but avoid terminating early on the first failure.
🪄 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: 33f04b0a-0b4b-47c0-aeb2-78933f213797

📥 Commits

Reviewing files that changed from the base of the PR and between 48921b7 and ee714fa.

📒 Files selected for processing (4)
  • internal/qualitygate/rules/mail_skill_sender_lists_test.go
  • skill-template/domains/mail.md
  • skills/lark-mail/SKILL.md
  • skills/lark-mail/references/lark-mail-rules.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-mail/references/lark-mail-rules.md

Comment thread internal/qualitygate/rules/mail_skill_sender_lists_test.go

@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.

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)

68-68: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Clarify the batch_remove API path reference.

The table entry lists allow_senders.batch_create / blocked_senders.batch_create / batch_remove — the last batch_remove lacks a resource prefix, making it ambiguous whether it applies to both allow_senders and blocked_senders. Consider writing allow_senders.batch_remove / blocked_senders.batch_remove for symmetry and clarity.

🤖 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 68, The API path list is ambiguous because
`batch_remove` is missing the resource prefix. Update the table entry in
`SKILL.md` so it explicitly mirrors the existing `allow_senders.batch_create` /
`blocked_senders.batch_create` pattern by naming both
`allow_senders.batch_remove` and `blocked_senders.batch_remove`, keeping the
reference clear and symmetric.
🤖 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-mail/SKILL.md`:
- Line 68: The API path list is ambiguous because `batch_remove` is missing the
resource prefix. Update the table entry in `SKILL.md` so it explicitly mirrors
the existing `allow_senders.batch_create` / `blocked_senders.batch_create`
pattern by naming both `allow_senders.batch_remove` and
`blocked_senders.batch_remove`, keeping the reference clear and symmetric.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9aec68b-407b-4a29-b030-e2c126b165a3

📥 Commits

Reviewing files that changed from the base of the PR and between ee714fa and 296db74.

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

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