Skip to content

docs(lark-doc): simplify genre routers#1771

Open
SunPeiYang996 wants to merge 1 commit into
mainfrom
sun/lark-doc-authoring-loop
Open

docs(lark-doc): simplify genre routers#1771
SunPeiYang996 wants to merge 1 commit into
mainfrom
sun/lark-doc-authoring-loop

Conversation

@SunPeiYang996

@SunPeiYang996 SunPeiYang996 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Change-Id: I56a41a21a4d37a0d14e1b4e2aff8b7e1a9334064

Summary

Simplify the lark-doc authoring guidance by routing document-writing tasks through a compact design philosophy and genre router layer. This keeps the active reading surface smaller while preserving detailed guidance for workplace and report document families.

Changes

  • Add lark-doc design philosophy guidance and first-level genre routers under skills/lark-doc/references/genres/.
  • Keep focused second-level routing for workplace and report genres, with concrete guides for the supported document types.
  • Update create/update/whiteboard/XML authoring guidance to point agents at the new philosophy/router flow and remove the older style workflow references.

Test Plan

  • git diff --check
  • node scripts/skill-format-check/index.js
  • Checked Markdown router references and stale deleted-genre references locally
  • Unit tests pass — not run; this is a docs/skill guidance-only change
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected — not applicable; no CLI runtime behavior changed

Related Issues

  • None

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

coderabbitai Bot commented Jul 6, 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

This PR overhauls lark-doc skill documentation: rewrites prerequisite-read rules and workflows in SKILL.md, lark-doc-create.md, and lark-doc-update.md; adds a new lark-doc-design-philosophy.md; refines whiteboard/SVG main-agent vs SubAgent delegation across whiteboard/XML/style references; and adds a genres directory with a router index plus 27 new genre template files.

Changes

Lark-doc workflow and reference updates

Layer / File(s) Summary
Skill entry and routing rules
skills/lark-doc/SKILL.md
Reworks prerequisite-read requirements per operation, adds fetch-verification rules for edits, and updates whiteboard delegation guidance.
Design philosophy reference
skills/lark-doc/references/lark-doc-design-philosophy.md
New document defining document-job framing, genre routing, structure and rich-block selection principles, writing style, anti-pattern calibration, and a final self-check.
Create workflow updates
skills/lark-doc/references/lark-doc-create.md
Replaces prior prerequisite set with design-philosophy/XML reads, introduces a serial Document Authoring Loop, and revises the reference list.
Update workflow and block lifecycle
skills/lark-doc/references/lark-doc-update.md
Splits simple vs structural-rewrite prerequisites, adds an Observe-Diagnose-Patch Loop, tightens block ID refetch rules, and revises whiteboard-update handling.
Whiteboard and SVG routing
skills/lark-doc/references/lark-doc-whiteboard.md, .../lark-doc-xml.md, .../style/lark-doc-style.md
Refines main-agent vs SubAgent responsibilities for simple vs complex Mermaid/SVG diagrams.
Genre router index and top-level templates
skills/lark-doc/references/genres/README.md, .../genres/_router-*.md
Adds a genres README with routing rules and ten top-level genre router templates (creative, media, opinion, knowledge, consumer, marketing, personal-brand, platform, report, workplace).
Report-category genre guides
skills/lark-doc/references/genres/research-report.md, data-report.md, white-paper.md, business-analysis.md
Adds four second-level report genre reference pages with structure, style, and checklist guidance.
Workplace-category genre guides
skills/lark-doc/references/genres/memo-brief.md, weekly-report.md, proposal.md, formal-doc.md, official-redhead.md, meeting-minutes.md, retrospective.md, prd.md, technical-doc.md, sop-tutorial.md
Adds ten second-level workplace genre reference pages with structure, style, component, and checklist guidance.
Removed content
.../style/lark-doc-style.md (partial), .../style/lark-doc-update-workflow.md, .../style/lark-doc-create-workflow.md
Removes old style/workflow content superseded by the new design-philosophy and genre-based guidance.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • larksuite/cli#1579: Both PRs revise the "MUST READ" prerequisite docs for create/edit flows in SKILL.md, lark-doc-create.md, and lark-doc-update.md.
  • larksuite/cli#1701: Both PRs update SKILL.md and create/update prerequisite text plus quick-decision whiteboard routing for simple vs complex diagrams.
  • larksuite/cli#1508: Both PRs update lark-doc block-ID validity and refetch guidance in SKILL.md and lark-doc-update.md.

Suggested reviewers: fangshuyu-768, caojie0621

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: simplifying Lark doc authoring guidance via genre routers.
Description check ✅ Passed The description follows the required template with Summary, Changes, Test Plan, and Related Issues sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sun/lark-doc-authoring-loop

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.

@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: 2

🤖 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-create.md`:
- Around line 15-18: In the document guidance, the phrase about the local XML
draft is too absolute and conflicts with the later Markdown exception; update
the wording in the section that describes the draft workflow so it says the
local XML draft is the default source of truth rather than the only source, and
keep the rest of the Plan/Draft guidance in the same place consistent with that
fallback behavior.

In `@skills/lark-doc/references/lark-doc-xml.md`:
- Line 44: Update the `<whiteboard>` guidance in `lark-doc-xml.md` to separate
new-board creation from existing-board updates. The current wording around the
`whiteboard` item incorrectly routes both scenarios through `<whiteboard
type="blank">`; revise it so blank-board creation is only for new complex SVG
work, while existing whiteboard edits explicitly reference fetching the current
token and then using `lark-whiteboard` directly. Keep the distinction aligned
with the `lark-doc-whiteboard.md` flow and preserve the current
`whiteboard`/`type="svg"`/`type="blank"` terminology.
🪄 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: 270be4e3-a740-4c7d-a277-24451ed9abb5

📥 Commits

Reviewing files that changed from the base of the PR and between 91d785f and a8829c2.

📒 Files selected for processing (7)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-create.md
  • skills/lark-doc/references/lark-doc-update.md
  • skills/lark-doc/references/lark-doc-whiteboard.md
  • skills/lark-doc/references/lark-doc-xml.md
  • skills/lark-doc/references/style/lark-doc-style.md
  • skills/lark-doc/references/style/lark-doc-update-workflow.md
💤 Files with no reviewable changes (1)
  • skills/lark-doc/references/style/lark-doc-update-workflow.md

Comment thread skills/lark-doc/references/lark-doc-create.md Outdated

- `<img>` — `<img href="https://..."/>` 上传网络图片
- `<whiteboard>` — 简单图由 SubAgent 直接插入 `<whiteboard type="svg">完整自包含 SVG</whiteboard>`;复杂图使用 `<whiteboard type="blank"></whiteboard>` 先创建空白画板,再按 [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) 启动 SubAgent 调用 `lark-whiteboard` 写入;
- `<whiteboard>` — 简单 Mermaid / SVG 图可由主 Agent 直接写入;复杂 SVG 可启动 SubAgent 产出完整 `<whiteboard type="svg">完整自包含 SVG</whiteboard>`;特别复杂或已有画板更新,使用 `<whiteboard type="blank"></whiteboard>` 先创建空白画板,再按 [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) 启动 SubAgent 调用 `lark-whiteboard` 写入;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Separate new-board creation from existing-board updates.

This bullet routes both cases through <whiteboard type="blank">, which conflicts with the existing-board flow elsewhere in this stack. Keep blank-board creation only for new complex SVGs; existing whiteboard edits should fetch the current token and go straight through lark-whiteboard.

Proposed fix
-- `<whiteboard>` — 简单 Mermaid / SVG 图可由主 Agent 直接写入;复杂 SVG 可启动 SubAgent 产出完整 `<whiteboard type="svg">完整自包含 SVG</whiteboard>`;特别复杂或已有画板更新,使用 `<whiteboard type="blank"></whiteboard>` 先创建空白画板,再按 [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) 启动 SubAgent 调用 `lark-whiteboard` 写入;
+- `<whiteboard>` — 简单 Mermaid / SVG 图可由主 Agent 直接写入;复杂 SVG 可启动 SubAgent 产出完整 `<whiteboard type="svg">完整自包含 SVG</whiteboard>`;**新建**特别复杂画板时先创建 `<whiteboard type="blank"></whiteboard>`,**已有画板更新**则直接 fetch 当前 token 并按 [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) 走 `lark-whiteboard` 写入流程;
📝 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
- `<whiteboard>` — 简单 Mermaid / SVG 图可由主 Agent 直接写入;复杂 SVG 可启动 SubAgent 产出完整 `<whiteboard type="svg">完整自包含 SVG</whiteboard>`特别复杂或已有画板更新,使用 `<whiteboard type="blank"></whiteboard>` 先创建空白画板,再按 [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) 启动 SubAgent 调用 `lark-whiteboard` 写入
`<whiteboard>` — 简单 Mermaid / SVG 图可由主 Agent 直接写入;复杂 SVG 可启动 SubAgent 产出完整 `<whiteboard type="svg">完整自包含 SVG</whiteboard>`**新建**特别复杂画板时先创建 `<whiteboard type="blank"></whiteboard>`**已有画板更新**则直接 fetch 当前 token 并按 [`lark-doc-whiteboard.md`](lark-doc-whiteboard.md) `lark-whiteboard` 写入流程
🤖 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 44, Update the
`<whiteboard>` guidance in `lark-doc-xml.md` to separate new-board creation from
existing-board updates. The current wording around the `whiteboard` item
incorrectly routes both scenarios through `<whiteboard type="blank">`; revise it
so blank-board creation is only for new complex SVG work, while existing
whiteboard edits explicitly reference fetching the current token and then using
`lark-whiteboard` directly. Keep the distinction aligned with the
`lark-doc-whiteboard.md` flow and preserve the current
`whiteboard`/`type="svg"`/`type="blank"` terminology.

@github-actions github-actions Bot added size/L Large or sensitive change across domains or core paths size/XL Architecture-level or global-impact change and removed size/M Single-domain feat or fix with limited business impact size/L Large or sensitive change across domains or core paths labels Jul 6, 2026
@SunPeiYang996 SunPeiYang996 force-pushed the sun/lark-doc-authoring-loop branch 2 times, most recently from 8dad84d to 37b53df Compare July 7, 2026 07:26
@SunPeiYang996 SunPeiYang996 changed the title docs: update lark doc authoring loops docs(lark-doc): simplify genre routers Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Quality Summary

CI did not complete successfully. Use the failed check links below to decide whether this PR needs a code change or a rerun.

Failed checks

  • deterministic-gate — failure — details
  • results — failure — details

deterministic-gate

  • public_content_change_id_trailercommit:9be6dd95d154:3 — public contribution contains a Change-Id trailer — Action: remove the value from the public contribution and replace it with a non-sensitive placeholder
  • public_content_change_id_trailerpull_request_metadata:3 — public contribution contains a Change-Id trailer — Action: remove the value from the public contribution and replace it with a non-sensitive placeholder

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1771      +/-   ##
==========================================
- Coverage   74.46%   74.40%   -0.07%     
==========================================
  Files         855      857       +2     
  Lines       88568    88952     +384     
==========================================
+ Hits        65954    66181     +227     
- Misses      17543    17668     +125     
- Partials     5071     5103      +32     

☔ 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 Jul 7, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@9be6dd95d154e16235eab117aa1c23925c617704

🧩 Skill update

npx skills add larksuite/cli#sun/lark-doc-authoring-loop -y -g

Comment thread shortcuts/doc/whiteboard_inline.go Fixed
Comment thread shortcuts/doc/whiteboard_inline.go Fixed
@SunPeiYang996 SunPeiYang996 force-pushed the sun/lark-doc-authoring-loop branch 4 times, most recently from 21c992e to be92f52 Compare July 7, 2026 11:38
Change-Id: I7e9a42bb761775136a61cc331b230e9740843348
@SunPeiYang996 SunPeiYang996 force-pushed the sun/lark-doc-authoring-loop branch from be92f52 to 9be6dd9 Compare July 7, 2026 11:51
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/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant