Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions skills/lark-im/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ When using bot identity (`--as bot`) to fetch messages (e.g. `+chat-messages-lis

Card messages (`interactive` type) are not yet supported for compact conversion in event subscriptions. The raw event data will be returned instead, with a hint printed to stderr.

**MANDATORY READ BEFORE SENDING/REPLYING TO INTERACTIVE CARD MESSAGES:**
- [`+messages-send`](references/lark-im-messages-send.md) - Detailed guide for sending messages, including interactive cards. **Must read before any card operations**
- [`+messages-reply`](references/lark-im-messages-reply.md) - Detailed guide for replying to messages, including interactive cards. **Must read before any card operations**

## Shortcuts(推荐优先使用)

Shortcut 是对常用操作的高级封装(`lark-cli im +<verb> [flags]`)。有 Shortcut 的操作优先使用。
Expand Down
145 changes: 145 additions & 0 deletions skills/lark-im/card-examples/ai-calendar-creation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"msg_type": "interactive",
"card": {
"schema": "2.0",
"config": {
"update_multi": true,
"style": {
"text_size": {
"normal_v2": {
"default": "normal",
"pc": "normal",
"mobile": "heading"
}
}
}
},
"body": {
"direction": "horizontal",
"horizontal_spacing": "8px",
"vertical_spacing": "12px",
"horizontal_align": "left",
"vertical_align": "top",
"padding": "20px 20px 20px 20px",
Comment on lines +18 to +23
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect body direction and top-level element tags across example cards.
python - <<'PY'
import json, pathlib
root = pathlib.Path("skills/lark-im/card-examples")
for p in sorted(root.glob("*.json")):
    data = json.loads(p.read_text(encoding="utf-8"))
    body = data.get("card", {}).get("body", {})
    direction = body.get("direction")
    tags = [e.get("tag") for e in body.get("elements", [])[:6]]
    print(f"{p.name}: direction={direction}, first_tags={tags}")
PY

Repository: larksuite/cli

Length of output: 3102


Change body.direction to vertical for proper stacked content layout.

This file is the only example using horizontal direction; all 27 other card examples use vertical. With direction set to horizontal, the title, date/time, person list, and action buttons render in a single row and break mobile readability. The content structure requires a vertical stack.

Fix
- "direction": "horizontal",
+ "direction": "vertical",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"direction": "horizontal",
"horizontal_spacing": "8px",
"vertical_spacing": "12px",
"horizontal_align": "left",
"vertical_align": "top",
"padding": "20px 20px 20px 20px",
"direction": "vertical",
"horizontal_spacing": "8px",
"vertical_spacing": "12px",
"horizontal_align": "left",
"vertical_align": "top",
"padding": "20px 20px 20px 20px",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-im/card-examples/ai-calendar-creation.json` around lines 18 - 23,
The card example's container uses "direction": "horizontal", causing title,
datetime, attendees, and actions to layout in a single row; update the
body.direction value from "horizontal" to "vertical" (in the JSON key
"body.direction" of the ai-calendar-creation example) so the elements stack
correctly for mobile/readability while leaving other spacing/padding keys
unchanged.

"elements": [
{
"tag": "markdown",
"content": "开发者运营项目启动会",
"text_align": "left",
"text_size": "heading"
},
{
"tag": "markdown",
"content": "2024年1月25日(周四) ",
"text_align": "left",
"text_size": "normal_v2",
"icon": {
"tag": "standard_icon",
"token": "calendar_outlined",
"color": "grey"
}
},
{
"tag": "markdown",
"content": "14:30 - 15:00 (GMT+8)",
"text_align": "left",
"text_size": "normal_v2",
"icon": {
"tag": "standard_icon",
"token": "time_outlined",
"color": "grey"
}
},
{
"tag": "person_list",
"persons": [
{
"id": "1"
},
{
"id": "2"
},
{
"id": "3"
}
],
"size": "small",
"lines": 1,
"show_avatar": true,
"show_name": true,
"icon": {
"tag": "standard_icon",
"token": "group_outlined",
"color": "grey"
},
"margin": "0px 0px 0px 0px"
},
{
"tag": "column_set",
"flex_mode": "stretch",
"horizontal_spacing": "12px",
"horizontal_align": "left",
"columns": [
{
"tag": "column",
"width": "auto",
"elements": [
{
"tag": "button",
"text": {
"tag": "plain_text",
"content": "确定日程"
},
"type": "primary_filled",
"width": "fill",
"size": "medium"
}
],
"direction": "horizontal",
"horizontal_spacing": "8px",
"vertical_spacing": "8px",
"horizontal_align": "left",
"vertical_align": "top"
},
{
"tag": "column",
"width": "auto",
"elements": [
{
"tag": "button",
"text": {
"tag": "plain_text",
"content": "编辑日程"
},
"type": "default",
"width": "fill",
"size": "medium"
}
],
"vertical_spacing": "8px",
"horizontal_align": "left",
"vertical_align": "top"
}
],
"margin": "4px 0px 0px 0px"
}
]
},
"header": {
"title": {
"tag": "plain_text",
"content": "为您创建了一个会议日程,请确认:"
},
"subtitle": {
"tag": "plain_text",
"content": ""
},
"template": "yellow",
"icon": {
"tag": "standard_icon",
"token": "calendar_colorful"
},
"padding": "12px 12px 12px 20px"
}
}
}
Loading
Loading