Skip to content

docs(lark-doc): refine rich block, path, and block ID guidance#1508

Open
fangshuyu-768 wants to merge 6 commits into
mainfrom
docs/soften-lark-doc-rich-block-guidance
Open

docs(lark-doc): refine rich block, path, and block ID guidance#1508
fangshuyu-768 wants to merge 6 commits into
mainfrom
docs/soften-lark-doc-rich-block-guidance

Conversation

@fangshuyu-768

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

Copy link
Copy Markdown
Collaborator

Background

PR #1463 softened the lark-doc style guidance by making rich blocks optional instead of mandatory. Follow-up evaluation still showed three gaps:

  • Agents can still overuse <callout> and <table> because the component guide presents them as the default recommendation for conclusions, summaries, and structured content.
  • Agents can take a heavy Docs path for simple tasks, such as searching for a document, reading a summary, or replacing clearly specified text.
  • Agents can incorrectly reuse stale block IDs across multi-step docs +update operations because the lifecycle of block IDs after write commands is not explicit enough.

This PR keeps rich blocks, full-fidelity editing, and block-level operations available, but makes the routing guidance more selective and concise.

Changes

1. Soften rich block and whiteboard guidance

  • Rename the component guide table column from "推荐方案" to "可选表达方式".
  • Narrow <callout> usage to short visual reminders such as risks, limitations, pending confirmations, or key alerts.
  • Narrow <table> usage to content that benefits from row/column lookup or comparison.
  • Make create/update workflows prefer simpler readability edits first: splitting paragraphs, using lists, adding subheadings, and reordering content.
  • Replace the long whiteboard trigger table with concise "use / do not use" guidance, so whiteboards are considered only when they clearly reduce understanding cost.

2. Clarify Docs task path selection

  • Add a compact quick-decision rule for routing document search, read-only fetches, simple text replacement, full-fidelity edits, block-level operations, and import/export tasks.
  • Route title/file/location-based document search and import/export work to lark-drive.
  • Keep --detail full as the intended path for full-fidelity content edits.
  • Avoid fetching block IDs for read-only tasks or clear old text -> new text replacements.
  • Keep update workflow guidance concise by pointing agents to direct str_replace, local with-ids, or scoped full reads based on actual edit intent.

3. Clarify and deduplicate block ID lifecycle guidance

  • Require reading lark-doc-update.md when editing existing documents, alongside the update workflow.
  • Add a quick-decision reminder for multi-step document edits to re-check whether previously fetched block IDs are still valid.
  • Replace the long lifecycle table with grouped rules:
    • destructive operations invalidate affected old IDs
    • insert/copy operations create new IDs
    • move operations preserve IDs but change position semantics
    • simple str_replace usually preserves IDs, while large replacements may require refetching
  • Remove later one-off reminders that duplicated the lifecycle section.

4. Trim repeated entry-point guidance

  • Shorten repeated "use style.md for rich blocks" notes in create/update references.
  • Replace the long create-doc splitting reminder with a pointer to the create workflow.

Expected Behavior

  • Agents should still use <callout>, <table>, <grid>, <whiteboard>, and other rich blocks when they fit the content.
  • Agents should be less likely to wrap normal summaries in callouts, convert short notes into tables, or over-plan whiteboards.
  • Agents should avoid fetch with-ids/full -> block operation for simple read-only, search, import/export, and direct text replacement tasks.
  • Agents should still use --detail full for full-fidelity edits that need existing content, style, references, media, or resource metadata.
  • Agents should be less likely to reuse stale block IDs after structural document updates.

Testing

  • git diff --check
  • node scripts/skill-format-check/index.js
  • go test ./shortcuts/doc

@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 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 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

Five Lark doc reference and skill files are updated across two functional themes. Element usage guidance in style and workflow files is made conditional rather than prescriptive: tables, grids, callouts, and whiteboards should be used only when they solve specific problems (row/column data, comparison, visual emphasis, or diagram comprehension), with paragraph restructuring preferred otherwise. The skill and update-reference files add comprehensive block ID lifecycle documentation explaining which write operations invalidate IDs and when to re-fetch, plus tighter prerequisites for document creation vs. editing workflows.

Changes

Lark Doc Reference and Skill Documentation Updates

Layer / File(s) Summary
Element usage guidance consolidation across style and workflow files
skills/lark-doc/references/style/lark-doc-style.md, skills/lark-doc/references/lark-doc-whiteboard.md, skills/lark-doc/references/style/lark-doc-create-workflow.md, skills/lark-doc/references/style/lark-doc-update-workflow.md, skills/lark-doc/references/lark-doc-create.md, skills/lark-doc/references/lark-doc-update.md
Updates lark-doc-style.md element-choice table to rename header from "推荐方案" to "可选表达方式" and refines scenario rows: visual-reminder short sentences map to <callout>, low-risk comparisons to <grid> 2-column layout, row/column precision data to <table>, and the old "3+ attribute structured data" row is removed. Renames whiteboard section from "优先规则" to "适用规则" and changes guidance from "always prioritize" to "use when diagrams clearly reduce comprehension cost". Both workflow files drop "add tables/columns/callouts" from readability-improvement examples in favor of paragraph rewriting, heading adjustment, and subheading addition. Narrows style reference conditions in create and update documents to cases requiring rich blocks or explicit user requests for beautification.
Block ID lifecycle rules, prerequisites, and operation decision matrix
skills/lark-doc/SKILL.md, skills/lark-doc/references/lark-doc-update.md
Adds new "Block ID 生命周期" section to lark-doc-update.md documenting which write operations (overwrite, block_replace, block_delete, block_insert_after, append, block_copy_insert_after, block_move_after, str_replace) invalidate block IDs and when to re-fetch with --detail with-ids. Updates SKILL.md prerequisites to explicitly require lark-doc-xml.md plus create/update workflow references based on document creation context. Adds "快速决策" decision matrix specifying docs +fetch variant selection (simple for read/summary; with-ids for block deep links and block-level operations; full for high-fidelity rewrites) and block ID lifecycle constraints (no reuse after destructive operations; re-fetch after inserts/copies for fresh IDs).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • larksuite/cli#1120: Updates skills/lark-doc/SKILL.md to clarify block ID retrieval rules; this PR extends that with lifecycle-based re-fetch guidance after write operations.
  • larksuite/cli#1463: Updates the same three style/workflow files with guidance on conditional use of rich components (<table>, <grid>, <callout>); this PR refines and completes that guidance.
  • larksuite/cli#1466: Modifies skills/lark-doc/references/lark-doc-update.md with block ID invalidation and re-fetch guidance; this PR systematizes that guidance into a comprehensive Block ID lifecycle section.

Suggested reviewers

  • caojie0621

Poem

🐇 A table's a tool, not a trap for all text,
When columns align, then use them—what's next?
Block IDs shift too, after writes come and go,
Fetch them anew when positions all flow.
Clear rules for all tools keep the docs singing bright! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: refining guidance for rich blocks, task path selection, and block ID lifecycle in lark-doc documentation.
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.
Description check ✅ Passed The PR description comprehensively covers all required template sections with clear structure, motivation, detailed change list, test plan, and related issues reference.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/soften-lark-doc-rich-block-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 commented Jun 17, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@3d611ef635fb2bc3456395cb7a3a46004e650d57

🧩 Skill update

npx skills add larksuite/cli#docs/soften-lark-doc-rich-block-guidance -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.

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

58-58: ⚡ Quick win

Minor wording improvement needed for consistency with adjacent table entries.

Line 58 uses "复制出的 block 是新 ID" which is grammatically valid but inconsistent with the verb patterns in nearby rows. Lines 56 and 57 use the more natural and active phrasing "会生成新 block ID" (will generate new ID). For clarity and consistency, recommend rephrasing line 58 to match:

  • Old: "复制出的 block 是新 ID"
  • New: "复制出的新 block 会生成新 ID" or "复制出的 block 会生成新 ID"
📝 Proposed rewording for consistency
- | `block_copy_insert_after` | 源 block 和锚点 block ID 保留;复制出的 block 是新 ID | 如果要继续操作复制出的内容,先重新 fetch 获取新 ID |
+ | `block_copy_insert_after` | 源 block 和锚点 block ID 保留;复制出的新 block 会生成新 ID | 如果要继续操作复制出的内容,先重新 fetch 获取新 ID |
🤖 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-update.md` at line 58, In the table entry
for block_copy_insert_after on line 58, update the phrase "复制出的 block 是新 ID" to
use the more consistent and active verb pattern "会生成新 ID" that is used in the
adjacent rows (lines 56-57). Change the text to either "复制出的新 block 会生成新 ID" or
"复制出的 block 会生成新 ID" to maintain grammatical consistency and clarity with the
surrounding table entries.
🤖 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-update.md`:
- Line 58: In the table entry for block_copy_insert_after on line 58, update the
phrase "复制出的 block 是新 ID" to use the more consistent and active verb pattern
"会生成新 ID" that is used in the adjacent rows (lines 56-57). Change the text to
either "复制出的新 block 会生成新 ID" or "复制出的 block 会生成新 ID" to maintain grammatical
consistency and clarity with the surrounding table entries.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4b0c1bc-ba3e-432e-92ca-980e86283ef3

📥 Commits

Reviewing files that changed from the base of the PR and between a4d647a and 30c2854.

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

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.72%. Comparing base (4a4c334) to head (3d611ef).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1508      +/-   ##
==========================================
+ Coverage   73.52%   73.72%   +0.19%     
==========================================
  Files         783      781       -2     
  Lines       74630    74217     -413     
==========================================
- Hits        54874    54717     -157     
+ Misses      15662    15437     -225     
+ Partials     4094     4063      -31     

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

@fangshuyu-768 fangshuyu-768 changed the title docs(lark-doc): soften rich block guidance docs(lark-doc): refine rich block and block ID guidance Jun 17, 2026
@fangshuyu-768 fangshuyu-768 changed the title docs(lark-doc): refine rich block and block ID guidance docs(lark-doc): refine rich block, path, and block ID guidance Jun 18, 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

🧹 Nitpick comments (1)
skills/lark-doc/references/style/lark-doc-update-workflow.md (1)

40-41: ⚡ Quick win

Strengthen explicit alignment with style.md rich-block usage constraints.

Lines 40–41 correctly prioritize simpler formatting and state that rich blocks are optional, but the guidance could be more explicit about when each rich block is appropriate. The referenced lark-doc-style.md table (Context snippet 1) defines specific scenarios:

  • <callout> only for short visual reminders (risks, limitations, alerts)
  • <grid> for simple 2-column comparisons
  • <table> for row/column lookups or multi-dimension comparisons

Currently, line 41 mentions rich blocks are optional but doesn't cross-reference these usage constraints. Consider rephrasing to explicitly exclude callout/table/grid from readability improvements unless those specific scenarios apply.

For example, align more closely with the lark-doc-create-workflow.md pattern (Context snippet 2):

"优先拆段、改列表、增加小标题或调整顺序;只有确实存在行列数据、并列对比或强提醒信息时,才考虑 <table> / <grid> / <callout>"

Suggested alignment
   - 优先通过重写段落、调整标题、拆分列表或补充小标题提升可读性
-  - 富 block 是可选表达手段,不因固定比例而添加;画板类需求只走第 5 步
+  - 富 block 是可选表达手段:只有确实存在行列数据、并列对比或强提醒信息时,才分别考虑 `<table>` / `<grid>` / `<callout>`;不因固定比例而添加。画板类需求只走第 5 步。
🤖 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/style/lark-doc-update-workflow.md` around lines 40
- 41, The guidance on lines 40-41 states that rich blocks are optional but lacks
explicit constraints on when each rich block type should be used. Revise line 41
to be more specific by replacing the vague statement about rich blocks being
optional with explicit conditions that align with lark-doc-style.md constraints:
specifically mention that callout, grid, and table should only be considered
when their specific scenarios apply (callout for alerts/risks, grid for 2-column
comparisons, table for row/column data lookups). Reword to follow the
lark-doc-create-workflow.md pattern that explicitly states these rich blocks
should only be used when those specific conditions genuinely exist, not merely
as decoration, making the when-and-why of each rich block type clear to writers.
🤖 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/style/lark-doc-update-workflow.md`:
- Around line 22-28: In the lark-doc-update-workflow.md file on line 25, the
instruction uses incomplete shorthand notation "section --start-block-id <标题id>"
which is ambiguous. Replace this shorthand with the full and explicit command
syntax "docs +fetch --api-version v2 --scope section --start-block-id <标题id>" to
maintain consistency with the authoritative syntax documented in
lark-doc-fetch.md and avoid confusion. Ensure that all command examples in this
section follow the complete syntax pattern with the --scope parameter always
explicitly stated rather than implied.

---

Nitpick comments:
In `@skills/lark-doc/references/style/lark-doc-update-workflow.md`:
- Around line 40-41: The guidance on lines 40-41 states that rich blocks are
optional but lacks explicit constraints on when each rich block type should be
used. Revise line 41 to be more specific by replacing the vague statement about
rich blocks being optional with explicit conditions that align with
lark-doc-style.md constraints: specifically mention that callout, grid, and
table should only be considered when their specific scenarios apply (callout for
alerts/risks, grid for 2-column comparisons, table for row/column data lookups).
Reword to follow the lark-doc-create-workflow.md pattern that explicitly states
these rich blocks should only be used when those specific conditions genuinely
exist, not merely as decoration, making the when-and-why of each rich block type
clear to writers.
🪄 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: d813306a-e61e-4dd0-93f9-f3790366af79

📥 Commits

Reviewing files that changed from the base of the PR and between 30c2854 and f5ec500.

📒 Files selected for processing (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/style/lark-doc-update-workflow.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-doc/SKILL.md

Comment thread skills/lark-doc/references/style/lark-doc-update-workflow.md Outdated

@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-update.md`:
- Line 52: In the documentation line describing block operations, replace the
phrase "新内容是新 ID" with an action verb to clarify the relationship. Change "是"
(is) to "产生" (generate) or "获得" (acquire) to make the causality explicit. Use
either "新内容产生新的 ID" or "新内容获得新的 ID" to improve clarity and grammar in the
sentence about how new content relates to new IDs in the block_insert_after,
append, and block_copy_insert_after operations.
🪄 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: 20c4c0ed-2537-4bf9-b7c7-45201e8ba32e

📥 Commits

Reviewing files that changed from the base of the PR and between f5ec500 and d5a7bcc.

📒 Files selected for processing (3)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-update.md
  • skills/lark-doc/references/style/lark-doc-update-workflow.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-doc/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-doc/references/style/lark-doc-update-workflow.md

Comment thread skills/lark-doc/references/lark-doc-update.md
@larksuite larksuite deleted a comment from github-actions Bot Jun 18, 2026
@github-actions

Copy link
Copy Markdown

PR Quality Summary

The semantic review system could not produce a fully trusted result. This is not reported as a code defect.

System status

  • semantic review degraded: semantic review request too large (endpoint=https[:]//ark.cn-beijing.volces.com/api/plan/v3/chat/completions model=deepseek-v4-pro response_format=none attempt=1/3 bytes=329867 limit=65536) — Action: inspect deterministic quality-gate diagnostics

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.

1 participant