docs(mail): trim lark-mail skill context - #1527
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesLark Mail skill documentation overhaul and feature references
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
skills/lark-mail/SKILL.md (1)
130-130: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueMinor: Chinese grammar could be clarified (non-blocking).
The phrase "
-h输出是可用 flag 的权威来源" is grammatically acceptable but slightly awkward. Consider rewording to "-h输出是确定可用 flag 的权威来源" or "-h的输出是 flag 名称的权威来源" for clarity. This is very low-priority and does not affect understanding.🤖 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 130, The Chinese grammar in the SKILL.md documentation sentence could be clarified for better readability. In the sentence starting with "`-h` 输出是可用 flag 的权威来源", reword the phrase to either "`-h` 输出是确定可用 flag 的权威来源" or "`-h` 的输出是 flag 名称的权威来源" to make the meaning clearer and the grammar more natural. This improves clarity without changing the intended meaning.
🤖 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.
Nitpick comments:
In `@skills/lark-mail/SKILL.md`:
- Line 130: The Chinese grammar in the SKILL.md documentation sentence could be
clarified for better readability. In the sentence starting with "`-h` 输出是可用 flag
的权威来源", reword the phrase to either "`-h` 输出是确定可用 flag 的权威来源" or "`-h` 的输出是 flag
名称的权威来源" to make the meaning clearer and the grammar more natural. This improves
clarity without changing the intended meaning.
72b9227 to
81c24ab
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
skills/lark-mail/references/lark-mail-rules.md (2)
35-35: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueDocument the quick-code mappings more explicitly.
Line 35 ("Quick codes above: condition
type=2= subject,operator=2= contains, actiontype=2= add label") maps numeric codes to human-readable names, but only inline as a comment. Consider adding a reference table or link to the official API documentation so users can independently discover other code values for conditions and actions.The reference could include a note like:
For complete list of condition/action type codes, see API schema or run: lark-cli schema mail.user_mailbox.rules.create🤖 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/references/lark-mail-rules.md` at line 35, The quick codes mapping for condition types, operators, and action types on line 35 are currently documented only as an inline comment, making them difficult to discover. Replace this inline comment with a dedicated reference section or table in the document that explicitly lists the numeric code mappings for conditions, operators, and actions. Include a note directing users to the official API documentation or provide the CLI command (such as lark-cli schema mail.user_mailbox.rules.create) so users can independently discover additional code values beyond what is shown in the quick reference.
35-35: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueAdd link or reference to API schema for condition/action type codes.
Line 35 documents quick-reference codes inline ("condition
type=2= subject,operator=2= contains, actiontype=2= add label"), but only as a comment. To help users discover other available codes (e.g., for conditions: from/to/cc, for actions: move/delete/mark-read), add a reference to the schema discovery command:Suggested addition after line 35
Quick codes above: condition `type=2` = subject, `operator=2` = contains, action `type=2` = add label. + +For complete condition/action type mappings, see: +```bash +lark-cli schema mail.user_mailbox.rules.create +lark-cli schema mail.user_mailbox.rules.update +```🤖 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/references/lark-mail-rules.md` at line 35, The quick reference codes documented inline in the lark-mail-rules.md file at line 35 only show specific examples but don't help users discover other available codes for conditions and actions. After the line containing "Quick codes above: condition `type=2` = subject, `operator=2` = contains, action `type=2` = add label.", add a new section that references the schema discovery commands for mail.user_mailbox.rules.create and mail.user_mailbox.rules.update to help users find all available condition/action type codes and operator options through the CLI schema command.
🤖 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-rules.md`:
- Around line 22-25: In the lark-cli mail rule creation command example, correct
the semantic mismatch between numeric codes and their intended behavior. Change
the condition type from 2 to 6 to properly match "Subject" (not "Recipient")
with the provided subject_text parameter. Change the condition operator from 2
to 1 to match "contains" logic (not "does not contain"). Additionally, clarify
the action type: the current type=2 means "Delete it", but the example suggests
label functionality with the label_id parameter; either change to type=11 for
"Move to user folder" or update the parameter placeholder to reflect the actual
intended action based on the documented API behavior.
In `@skills/lark-mail/SKILL.md`:
- Around line 391-400: The SKILL.md documentation for the `+messages` shortcut
claims that the CLI handles more than 20 IDs in batches and merges output, but
this batching behavior is not documented in the corresponding reference guide
`lark-mail-messages.md`. Update the reference documentation to include the
auto-batching behavior with specific details: the exact batch size threshold,
the merge and deduplication strategy (including order preservation and handling
of unavailable IDs), and any limitations or ordering guarantees. This ensures
consistency between the overview documentation and the reference guide.
---
Nitpick comments:
In `@skills/lark-mail/references/lark-mail-rules.md`:
- Line 35: The quick codes mapping for condition types, operators, and action
types on line 35 are currently documented only as an inline comment, making them
difficult to discover. Replace this inline comment with a dedicated reference
section or table in the document that explicitly lists the numeric code mappings
for conditions, operators, and actions. Include a note directing users to the
official API documentation or provide the CLI command (such as lark-cli schema
mail.user_mailbox.rules.create) so users can independently discover additional
code values beyond what is shown in the quick reference.
- Line 35: The quick reference codes documented inline in the lark-mail-rules.md
file at line 35 only show specific examples but don't help users discover other
available codes for conditions and actions. After the line containing "Quick
codes above: condition `type=2` = subject, `operator=2` = contains, action
`type=2` = add label.", add a new section that references the schema discovery
commands for mail.user_mailbox.rules.create and mail.user_mailbox.rules.update
to help users find all available condition/action type codes and operator
options through the CLI schema command.
🪄 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: e830aaf1-d9a1-4dfe-afa7-b69667039db6
📒 Files selected for processing (3)
skills/lark-mail/SKILL.mdskills/lark-mail/references/lark-mail-recall.mdskills/lark-mail/references/lark-mail-rules.md
✅ Files skipped from review due to trivial changes (1)
- skills/lark-mail/references/lark-mail-recall.md
5e807f3 to
603ab27
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
skills/lark-mail/references/lark-mail-rules.md (1)
22-35:⚠️ Potential issue | 🔴 Critical | ⚡ Quick win** API payload codes are semantically incorrect for the documented intent.**
Per the past review, the numeric codes in the example contradict their intended behavior:
- Condition
type=2actually means "Recipient" (not "Subject"); should betype=6for subject matching.- Condition
operator=2actually means "Does not contain" (not "contains"); should beoperator=1for contains.- Action
type=2actually means "Delete it" (not "add label"); the API has no standard label action—usetype=11for "Move to user folder" or clarify the intended action.The current example payload matches: "Recipient does NOT contain <subject_text> → Delete" instead of "Subject contains text → add label."
The quick reference on line 35 compounds the confusion by stating incorrect mappings as fact.
🐛 Proposed fix to align payload with documented intent
# 2. 创建规则 lark-cli mail user_mailbox.rules create --as user --yes \ --params '{"user_mailbox_id":"me"}' \ - --data '{"name":"<rule_name>","is_enable":true,"ignore_the_rest_of_rules":false,"condition":{"match_type":1,"items":[{"type":2,"operator":2,"input":"<subject_text>"}]},"action":{"items":[{"type":2,"input":"<label_id>"}]}}' + --data '{"name":"<rule_name>","is_enable":true,"ignore_the_rest_of_rules":false,"condition":{"match_type":1,"items":[{"type":6,"operator":1,"input":"<subject_text>"}]},"action":{"items":[{"type":11,"input":"<folder_id>"}]}}'Also update line 35 to reflect the correct mappings:
-Quick codes above: condition `type=2` = subject, `operator=2` = contains, action `type=2` = add label. +Quick codes above: condition `type=6` = subject, `operator=1` = contains, action `type=11` = move to folder. Update `<folder_id>` placeholder accordingly.If "label" functionality is intended instead, clarify the action type and verify against current Lark Mail API documentation.
🤖 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/references/lark-mail-rules.md` around lines 22 - 35, The API payload codes in the lark-cli mail user_mailbox.rules create command contain incorrect numeric values that contradict the documented intent. In the condition object, change type from 2 to 6 to correctly reference subject matching, and change operator from 2 to 1 to correctly represent the "contains" operation. In the action object, change type from 2 to an appropriate value such as 11 for "Move to user folder" or clarify the intended action against current Lark Mail API documentation. Finally, update the quick reference codes at the end of the snippet to reflect the corrected mappings: condition type=6 = subject, operator=1 = contains, and the updated action type value.
🤖 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.
Duplicate comments:
In `@skills/lark-mail/references/lark-mail-rules.md`:
- Around line 22-35: The API payload codes in the lark-cli mail
user_mailbox.rules create command contain incorrect numeric values that
contradict the documented intent. In the condition object, change type from 2 to
6 to correctly reference subject matching, and change operator from 2 to 1 to
correctly represent the "contains" operation. In the action object, change type
from 2 to an appropriate value such as 11 for "Move to user folder" or clarify
the intended action against current Lark Mail API documentation. Finally, update
the quick reference codes at the end of the snippet to reflect the corrected
mappings: condition type=6 = subject, operator=1 = contains, and the updated
action type value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 83a8a9e7-b35f-4574-82d3-5c1ed84b0abe
📒 Files selected for processing (7)
skills/lark-mail/SKILL.mdskills/lark-mail/references/lark-mail-recall.mdskills/lark-mail/references/lark-mail-recipient-search.mdskills/lark-mail/references/lark-mail-rules.mdskills/lark-mail/references/lark-mail-send-as.mdskills/lark-mail/references/lark-mail-send-status.mdskills/lark-mail/references/lark-mail-template.md
✅ Files skipped from review due to trivial changes (3)
- skills/lark-mail/references/lark-mail-send-status.md
- skills/lark-mail/references/lark-mail-recall.md
- skills/lark-mail/references/lark-mail-send-as.md
92cbd62 to
97a758e
Compare
5f0923c to
f13abf1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1527 +/- ##
=======================================
Coverage 73.79% 73.79%
=======================================
Files 787 787
Lines 76142 76142
=======================================
Hits 56191 56191
Misses 15742 15742
Partials 4209 4209 ☔ 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@c6b9eb7bc18ef0dfcc5d1986df9309b541f3aa1f🧩 Skill updatenpx skills add larksuite/cli#jiayi/mail-skill-token-trim -y -g |
f13abf1 to
14b042b
Compare
14b042b to
c6b9eb7
Compare
Summary
Trim the lark-mail skill entry so the always-loaded context focuses on core workflows, safety rules, and command selection. Less common raw API and scope details are now handled through command help and schema discovery.
Changes
+messagesinstead of repeated+messagecalls.Test Plan
lark-cli maildocumentation flow remains consistent (git diff --check)Related Issues
Summary by CodeRabbit
Documentation
-h) for uncertain flags/parameters. Refreshed typical workflows for batch reads (+messages) and full conversations (+thread), tightened HTML/validation guidance (--html=false), and restructured native API usage into a discover-and-construct flow.