Skip to content

docs(skills): add cite user guidance for cross-skill user name rendering#1394

Merged
fangshuyu-768 merged 1 commit into
mainfrom
docs/skill-cite-user-guidance
Jun 11, 2026
Merged

docs(skills): add cite user guidance for cross-skill user name rendering#1394
fangshuyu-768 merged 1 commit into
mainfrom
docs/skill-cite-user-guidance

Conversation

@fangshuyu-768

@fangshuyu-768 fangshuyu-768 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

When writing user names into Lark documents from cross-skill data sources (IM messages, calendar events, approvals, tasks, etc.), the AI agent should use <cite type="user" user-id="open_id"> tags instead of plain text names. This ensures names render as clickable @mentions in the document.

Changes

Modified skills/lark-doc/references/lark-doc-xml.md:

  1. Inline table row — Updated the <cite type="user"> description to explicitly state that any known open_id should use this tag, not plain text.

  2. New "用户名写入规则" section — Added under 补充规则 with:

    • General rule: when open_id is available from any source (IM, calendar, approvals, tasks), use <cite type="user">
    • Concrete example: when writing IM chat messages to a document, both sender and mentions users should use this tag

Related Issues

Discovered during a real workflow: IM messages were written to a doc with plain text names for senders, missing the clickable @mention rendering that <cite type="user"> provides.

Summary by CodeRabbit

  • Documentation
    • Added "username writing rules" and "Writing Messages to Lark Documents" guidance: documents should use structured user references (clickable @-mentions) when user IDs are available. Clarifies which IM fields require this (senders, mentions, reaction operators, card-referenced users) and adds group-chat, system-message, merged-forward examples. Describes a lookup procedure (via CLI/tool) to resolve user IDs when only plain-text names exist before writing citations.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

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 rules and examples requiring <cite type="user" user-id="open_id"> when writing usernames into lark-doc XML, documents which IM fields carry open_id (sender, mentions, reactions operator/operator_id, card references, system text, merged forwards), and prescribes using lark-cli contact +search-user to resolve open_id from plain names.

Changes

User mention formatting documentation

Layer / File(s) Summary
Core rule: write users with open_id
skills/lark-doc/references/lark-doc-xml.md
Adds "核心原则": when a user open_id is available (IM, calendar, approvals, tasks), write the user as <cite type="user" user-id="open_id">; if only a name exists, resolve via lark-cli contact +search-user before writing.
Scenarios, examples, and lookup details
skills/lark-doc/references/lark-doc-xml.md
Adds a coverage table listing fields that must use <cite type="user"> (sender, mentions, reactions' operator/operator_id, card-referenced users, system-text names, merged forwards), provides IM group-chat examples, and documents name->open_id lookup commands and confirmation steps.
SKILL: writing messages to docs
skills/lark-im/SKILL.md
Adds "Writing Messages to Lark Documents" mapping message fields to open_id usage (sender, mentions, reaction operators, card refs) and points to the username-writing rules and lookup workflow when only names are available.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#763: Related documentation updates about handling user identifiers and mention rendering.
  • larksuite/cli#1144: Guidance on using lark-cli contact (including search-user) to resolve open_id.

Suggested labels

documentation, domain/im

Suggested reviewers

  • SunPeiYang996
  • YangJunzhou-01

Poem

🐰 I hopped through docs and found a cue,
When open_id is known, cite them true.
Sender, mentions, reactions too,
Search for names when IDs are few.
I nibble bytes and bounce anew.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers the motivation and changes, but omits the required Test Plan section from the template and lacks comprehensive detail on the actual implementation scope. Add a Test Plan section with specific verification steps. Include more details on all files modified (both lark-doc-xml.md and SKILL.md changes) and the coverage of different message types.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main change: adding documentation guidance for using cite tags when rendering user names across skills.
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
  • Commit unit tests in branch docs/skill-cite-user-guidance

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/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Jun 11, 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

🤖 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-doc/references/lark-doc-xml.md`:
- Line 26: Standardize the modal verb for the <cite type="user"> tag
requirement: replace "应使用" with "必须使用" wherever the document refers to using the
<cite type="user"> (e.g., the occurrence at the table row and the paragraph
currently using "应使用" and the one at line 83 using "必须使用"), so all references
consistently state that using <cite type="user" user-id="..."></cite> is
mandatory.
🪄 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: b78f78ff-101e-4a0f-8ece-2658edfa1f50

📥 Commits

Reviewing files that changed from the base of the PR and between 6d8dc40 and 9ba7c70.

📒 Files selected for processing (1)
  • skills/lark-doc/references/lark-doc-xml.md

Comment thread skills/lark-doc/references/lark-doc-xml.md Outdated
@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.75%. Comparing base (6d8dc40) to head (2ff0fc4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1394   +/-   ##
=======================================
  Coverage   72.74%   72.75%           
=======================================
  Files         730      730           
  Lines       69031    69030    -1     
=======================================
+ Hits        50220    50224    +4     
+ Misses      15037    15034    -3     
+ Partials     3774     3772    -2     

☔ 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

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#docs/skill-cite-user-guidance -y -g

@fangshuyu-768
fangshuyu-768 force-pushed the docs/skill-cite-user-guidance branch from b2934ea to 4a46415 Compare June 11, 2026 03:31

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

🧹 Nitpick comments (1)
skills/lark-doc/references/lark-doc-xml.md (1)

85-85: ⚡ Quick win

Clarify the "通常" (usually) qualifier for sender handling.

Line 85 states that sender "通常用纯文本名字标注即可" (usually just needs plain text label), implying there are exceptions when sender should use <cite type="user"> tags instead. However, the criteria for these exceptions are not defined, which may lead to inconsistent implementations across different developers or scenarios.

Consider one of the following:

  1. Remove "通常" if sender should always use plain text in IM informational record contexts
  2. Clarify the exceptions: specify when sender should use cite tags (e.g., "发言人标注用纯文本即可;当需要提醒发言人查看记录时,才使用 <cite type="user">")
  3. Add more concrete examples beyond IM to illustrate the distinction in other scenarios mentioned in line 83 (tasks, calendar, approvals)
🤖 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-doc/references/lark-doc-xml.md` at line 85, Update the sentence
about sender labeling to remove ambiguity: either remove the qualifier "通常" and
state that sender should always be labeled as plain text, or explicitly define
the exceptions when sender must be wrapped in a <cite type="user"> tag (for
example: "use <cite type='user'> when you need the IM platform to notify or link
the user, such as when an action/acknowledgement is required; otherwise use
plain text for informational records"); additionally add one concrete example
(e.g., IM chat message vs. approval request) to illustrate the difference; edit
the sentence containing "发言人 通常用纯文本名字标注即可" and reference <cite type="user"> and
"sender" so implementers know which rule to follow.
🤖 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-doc/references/lark-doc-xml.md`:
- Line 85: Update the sentence about sender labeling to remove ambiguity: either
remove the qualifier "通常" and state that sender should always be labeled as
plain text, or explicitly define the exceptions when sender must be wrapped in a
<cite type="user"> tag (for example: "use <cite type='user'> when you need the
IM platform to notify or link the user, such as when an action/acknowledgement
is required; otherwise use plain text for informational records"); additionally
add one concrete example (e.g., IM chat message vs. approval request) to
illustrate the difference; edit the sentence containing "发言人 通常用纯文本名字标注即可" and
reference <cite type="user"> and "sender" so implementers know which rule to
follow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 078a67f4-4307-4caf-90a9-7b623c97bbc4

📥 Commits

Reviewing files that changed from the base of the PR and between 9ba7c70 and 360beea.

📒 Files selected for processing (1)
  • skills/lark-doc/references/lark-doc-xml.md

@fangshuyu-768
fangshuyu-768 force-pushed the docs/skill-cite-user-guidance branch from aebf04c to d7fe75c Compare June 11, 2026 03:36
@github-actions github-actions Bot added domain/im PR touches the im domain size/L Large or sensitive change across domains or core paths and removed size/M Single-domain feat or fix with limited business impact labels Jun 11, 2026
@fangshuyu-768
fangshuyu-768 force-pushed the docs/skill-cite-user-guidance branch from c21c281 to 4164fb1 Compare June 11, 2026 04:37
@github-actions github-actions Bot added size/M Single-domain feat or fix with limited business impact and removed domain/im PR touches the im domain size/L Large or sensitive change across domains or core paths labels Jun 11, 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

🤖 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-doc/references/lark-doc-xml.md`:
- Line 117: The text incorrectly references the command "lark-contact"; update
the documentation to use the actual CLI invocation "lark-cli contact" and ensure
the example command shown ("lark-cli contact +search-user") and any surrounding
explanatory text consistently use "lark-cli contact" instead of "lark-contact"
so readers use the correct tool name.
🪄 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: 7aa763ef-ebbb-4f64-b2a5-dfbf08b09cb2

📥 Commits

Reviewing files that changed from the base of the PR and between d7fe75c and c21c281.

📒 Files selected for processing (2)
  • skills/lark-doc/references/lark-doc-xml.md
  • skills/lark-im/SKILL.md

Comment thread skills/lark-doc/references/lark-doc-xml.md Outdated
@fangshuyu-768
fangshuyu-768 force-pushed the docs/skill-cite-user-guidance branch 3 times, most recently from d73ea8f to 9ff4847 Compare June 11, 2026 06:50
- Unify modal verbs to "必须" throughout the user name writing rules
- Expand typical scenarios to cover sender, mentions, reactions, cards,
  system messages, and merge_forward
- Add open_id resolution workflow via lark-contact +search-user for
  plain-text names (system messages, merge_forward content)
- Fix typos in lark-doc-style.md
@fangshuyu-768
fangshuyu-768 force-pushed the docs/skill-cite-user-guidance branch from 9ff4847 to 2ff0fc4 Compare June 11, 2026 06:53
@fangshuyu-768
fangshuyu-768 merged commit c2e617f into main Jun 11, 2026
29 of 32 checks passed
@fangshuyu-768
fangshuyu-768 deleted the docs/skill-cite-user-guidance branch June 11, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm 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.

2 participants