Skip to content

docs(mail): trim lark-mail skill context - #1410

Open
bubbmon233 wants to merge 1 commit into
larksuite:mainfrom
bubbmon233:docs/mail-skill-token-trim
Open

docs(mail): trim lark-mail skill context#1410
bubbmon233 wants to merge 1 commit into
larksuite:mainfrom
bubbmon233:docs/mail-skill-token-trim

Conversation

@bubbmon233

@bubbmon233 bubbmon233 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • trim the lark-mail skill entry document to reduce default context size
  • remove long low-frequency examples, resource inventory, and scope details from the always-loaded skill context
  • keep compact guidance for templates, mail rules, common workflows, and when to read references

Source

Ported from internal Codebase MR 34 (docs(mail): trim lark-mail skill context).

Tests

  • git diff --check -- skills/lark-mail/SKILL.md
  • node scripts/skill-format-check/index.js

Summary by CodeRabbit

  • Documentation
    • Clarified mail skill usage guidance and simplified pre-read requirements
    • Enhanced parameter discovery instructions emphasizing help output as authoritative source
    • Simplified HTML writing guidance based on complexity levels
    • Added template creation and sending workflow checklist
    • Included practical example for setting up mail rules with field mappings
    • Reorganized API discovery guidance using command-line help and schema tools

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updated mail skill documentation to consolidate and refine user guidance. Changed skill scope description to be explicit about mail-only usage, made pre-read requirements conditional, emphasized -h for parameter discovery, restructured raw API guidance, and added concrete workflows for templates and receiving rules.

Changes

Mail Skill Documentation Refinement

Layer / File(s) Summary
Skill scope and critical requirements
skills/lark-mail/SKILL.md
Skill description now explicitly restricts usage to mail-only tasks. Pre-read requirements simplified to conditionally include shared skill and HTML reference only for authentication-related or complex HTML cases, removing unconditional requirements.
Parameter discovery and API usage guidance
skills/lark-mail/SKILL.md
Parameter discovery guidance refocused on checking -h output before guessing flags, with -h clarified as authoritative. Low-frequency operations condensed to pointer list. Raw API discovery section reorganized to avoid retaining resource/scope tables and emphasize -h and method-level schema for --params vs --data distinction.
Feature-specific workflows and examples
skills/lark-mail/SKILL.md
HTML writing guidance made conditional on complexity/local images/uncertainty. Template creation checklist added covering template_id capture, +send --confirm-send invocation, and send_status polling with message_id. Receiving rules section added with concrete labels.list, rules.create, rules.list, rules.delete examples and condition/action field mappings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • larksuite/cli#749: Both PRs modify skills/lark-mail/SKILL.md write-operation confirmation and workflow constraints, with overlapping documentation guidance on sends, deletes, and rule operations.
  • larksuite/cli#545: Both PRs update raw API and permissions documentation in skills/lark-mail/SKILL.md; the retrieved PR removes specific permission entries while the main PR restructures the entire "API Resources/权限表" section into a new "Raw API Discovery" flow.

Suggested labels

domain/mail, size/M

Suggested reviewers

  • chanthuang
  • infeng

Poem

🐰 A skill refined, so clear and bright,
No more confusion left and right—
Just dash-h the way, the truth to find,
And templates send with peaceful mind!
Mail rules dance in quick-lookup grace.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers summary, source origin, and testing approach, but lacks a formal 'Changes' section and explicit Test Plan checklist as specified in the template. Add a 'Changes' section listing the main modifications and format the test commands as a checklist matching the template structure.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: trimming documentation to reduce context size for the lark-mail skill.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@github-actions github-actions Bot added domain/mail PR touches the mail domain size/M Single-domain feat or fix with limited business impact labels Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.83%. Comparing base (e53f9d9) to head (23e9241).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1410      +/-   ##
==========================================
- Coverage   72.83%   72.83%   -0.01%     
==========================================
  Files         731      732       +1     
  Lines       69111    69140      +29     
==========================================
+ Hits        50335    50356      +21     
- Misses      14999    15003       +4     
- Partials     3777     3781       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add bubbmon233/cli#docs/mail-skill-token-trim -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: 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-mail/SKILL.md`:
- Line 390: The current sentence about using “--yes” reads like an unconditional
bypass; reword the line about only using real `label_id` / `rule_id` and the
`--yes` flag to explicitly state that `--yes` represents explicit user consent
and is only permitted when the user issues the full create→verify→delete
workflow in the same CLI invocation; otherwise the delete step must remain
confirmation-gated (i.e., require an interactive confirmation or separate
explicit delete command), and keep the requirement that only real
`label_id`/`rule_id` may be used.
🪄 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: 29f832c7-144f-4467-9669-8d157d885800

📥 Commits

Reviewing files that changed from the base of the PR and between 5aeae2d and 23e9241.

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

Comment thread skills/lark-mail/SKILL.md

### 收信规则速查:主题包含文本 → 添加标签

只用真实 `label_id` / `rule_id`,不要猜。用户在同一请求中要求创建、验证、删除规则时,视为本流程已授权,可使用 `--yes` 通过 CLI 确认门。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for other --yes usage patterns and confirmation bypass logic

# Search for --yes flag usage in documentation
rg -n --type=md -C3 '\-\-yes'

# Search for confirmation bypass or authorization skip patterns
rg -n --type=md -C3 '(bypass|skip|绕过|跳过).*(confirm|授权)'

Repository: larksuite/cli

Length of output: 50371


Clarify that the --yes usage at line 390 is explicit user consent, not an unconditional confirmation bypass

  • Line 390 currently reads like a “bypass”; adjust wording to state deletion is only allowed when the user explicitly requests the full create/verify/delete workflow in the same CLI invocation, and otherwise the delete step must still be confirmation-gated.
🧰 Tools
🪛 SkillSpector (2.1.1)

[error] 34: [P1] Instruction Override: This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Remediation: Remove or rewrite any text that instructs the agent to ignore prompts, override safety rules, or trust unverified content. Ensure skill content cannot be injected to alter agent behavior.

(Prompt Injection (P1))

🤖 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 390, The current sentence about using
“--yes” reads like an unconditional bypass; reword the line about only using
real `label_id` / `rule_id` and the `--yes` flag to explicitly state that
`--yes` represents explicit user consent and is only permitted when the user
issues the full create→verify→delete workflow in the same CLI invocation;
otherwise the delete step must remain confirmation-gated (i.e., require an
interactive confirmation or separate explicit delete command), and keep the
requirement that only real `label_id`/`rule_id` may be used.

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/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant