跪拜 Guibai
← All articles
Artificial Intelligence

Give Your Coding Agent Direct Feishu Group Access: A Real Landing Page Workflow

By 约翰_麦卡岩 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The pattern cuts the copy-paste loop between chat requirements and code changes, and it pushes coding agents to carry relevance judgment as a first-class responsibility. That matters for any team running agents on noisy messaging channels, whether in Feishu or comparable enterprise chat tools.

Summary

This workflow replaces manual information shuttling with an agent that pulls the latest 20 messages, decides whether each one needs action, reads the linked spreadsheet or doc, modifies a copy of the code, and runs a browser-based check that inspects actual event calls. The author used it on real landing page projects, handling 50+ message reads, 20+ screenshots, and 6 video recordings with zero errors in information transport. The key choices are a CLI that returns JSON, full JSON written to disk for parsing, and letting the agent judge relevance instead of reacting to every message.

The approach also exposes common failure points: wiki links that resolve to spreadsheets, multi-sheet documents where only the first sheet gets read, rich-text images needing the post's message-id, and the trap of sequential string replacements when shifting event IDs. The mitigation is concrete: use placeholder substitution, always list sheets first, and verify by intercepting the real SDK to record actual event calls rather than trusting screenshots.

Takeaways
— Use `--as user` when logging in with lark-cli; bot identities cannot see the groups a person is in.
— Only four commands are high-frequency: `chat-messages-list`, `messages-resources-download`, `sheets +cells-get`, and `docs +fetch`.
— When a wiki link points to a spreadsheet, `docs +fetch` fails with error code 3380002; switch to `sheets +cells-get`.
— Always run `+workbook-info` to list all sheets and specify `--sheet-name`; reading only the first sheet caused a missed configuration in the real project.
— For rich text messages, download images using the post's `message_id`, not the image's own ID.
— Use placeholder replacement when shifting event IDs to avoid re-replacing values in adjacent mappings like 5→6, 6→7.
— Verify analytics changes by intercepting the SDK and recording actual event calls, not by inspecting screenshots.
— Produce deliverable HTML as a single file with inlined data URIs for images to avoid missing resources.
— Judge message relevance: classify as notification, question, or assignment; only execute assignments and read linked docs first.
— Security rules: keep CLI tokens out of logs, read only project-relevant groups, redact sensitive info, and confirm before sending any message or file.
— Optional scheduled inspection runs at 09:30 on workdays, but only when explicitly requested by the user.
— The workflow read 50+ group messages, analyzed 20+ screenshots and 6 recordings, and read 3 versions of tracking config, with zero information-transport errors.
Conclusions

The most valuable rule is the agent's ability to say 'this is not for me' rather than auto-replying to everything; that single judgment filter eliminates most noise and false actions.

Choosing a CLI over a plugin is a pragmatic move because it gives the agent composability: it can chain commands, parse JSON with Python, and debug by inspecting one output at a time.

The multi-sheet pitfall shows that context gathering is a major failure mode for coding agents; the agent is only as good as the assumption that it fetched the right sheet.

Verifying by intercepting the SDK and inspecting event calls is a stronger test than visual checking, especially for analytics code where the page can look correct but send wrong events.

Concepts & terms
lark-cli
A command-line interface for Feishu/Lark APIs that outputs JSON, allowing scripts and AI agents to read messages, download resources, access spreadsheets, and fetch documents with a single command.
Placeholder replacement
A string substitution technique that first replaces each target value with a unique temporary placeholder, then swaps placeholders to final values, preventing sequential replacements from accidentally re-matching newly written values.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗