Skip to content

docs: add lark drive knowledge organization workflow#1028

Open
YH-1600 wants to merge 1 commit into
mainfrom
feat/workflow-knowledgeOrganize
Open

docs: add lark drive knowledge organization workflow#1028
YH-1600 wants to merge 1 commit into
mainfrom
feat/workflow-knowledgeOrganize

Conversation

@YH-1600
Copy link
Copy Markdown
Collaborator

@YH-1600 YH-1600 commented May 22, 2026

Change-Id: I2343fcdf26ceefb898cc8d4faeae4b17384cfea8

Summary

Add a lark-drive knowledge organization workflow reference for Drive/Wiki/document-library organization scenarios.

Changes

  • Add a quick-decision rule in skills/lark-drive/SKILL.md to route cloud storage / knowledge-base organization requests to the workflow.
  • Add skills/lark-drive/references/lark-drive-workflow-knowledgeOrganize.md covering entry parsing, inventory, deduplication, planning, write confirmation, permission handling, and verification.

Test Plan

  • Documentation-only change; no Go behavior changed.
  • Verified referenced skill/shortcut commands and workflow links.
  • CI checks pass.

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Unified, end-to-end knowledge-organize workflow covering Discovery → Analysis → Planning → Execution.
    • Enforced prerequisite: users must review the organization guide before initiating organize/scan actions; default output is a plan only—any create/move/permission actions require explicit confirmation.
  • Documentation

    • Added detailed, read-only discovery/analysis rules, evidence-based classification, plan-generation and execution confirmation protocols, pagination/ reporting limits, and explicit failure/permission handling and manual-confirmation routing.

Review Change Stack

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 22, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

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 a unified knowledge-organize workflow and routes Drive/Wiki organization or inventory/planning requests to it; introduces discovery, analysis, planning, execution, and verification phase documents plus SKILL routing rules. Plans are produced by default; any create/move/permission writes require separate explicit confirmation.

Changes

Knowledge Organization Workflow

Layer / File(s) Summary
Skill decision routing
skills/lark-drive/SKILL.md, skills/lark-wiki/SKILL.md
Quick decision rules added to route organization/inventory/planning requests to the unified knowledge-organize workflow; default behavior outputs plans only and write actions require separate confirmation.
Workflow entry-point contract
skills/lark-drive/references/lark-drive-workflow-knowledge-organize.md
Main workflow document establishing prerequisite reads, progressive phase loading, runtime state, execution state machine (PARSE_SCOPE → DONE), per-state command allowlists, permission-request gate, and transition/failure handling rules.
Discovery phase: scope parsing and inventory
skills/lark-drive/references/lark-drive-workflow-knowledge-organize-discovery.md
Defines PARSE_SCOPE and INVENTORY behaviors: multiple input parsing forms, recursive listing with pagination/depth/item limits, ResourceItem schema, normalization/dedupe, inventory summary, and discovery failure handling.
Analysis phase: content reading and rule generation
skills/lark-drive/references/lark-drive-workflow-knowledge-organize-analysis.md
Read-only CONTENT_READ and ISSUE_ANALYSIS: low-confidence partial reads, evidence recording, batching/continuation rules, pagination-limited problem examples, RULE_GENERATION producing classification_rules and target_tree, and analysis failure handling routing ambiguous items to manual review.
Planning and execution confirmation
skills/lark-drive/references/lark-drive-workflow-knowledge-organize-planning.md
PLAN_GENERATION and EXEC_CONFIRM rules: PlanItem/DisplayItem contracts, plan pagination and overview-first behavior, plan revision protocol, manual-confirmation target handling, and explicit execution-confirmation flows that show write summaries and request execution scope.
Execution and verification
skills/lark-drive/references/lark-drive-workflow-knowledge-organize-execution.md
EXECUTE and VERIFY: allowed write commands, PathTokenMap resolution, shallow→deep creation, immediate token saving, parent-child ordering, progress reporting cadence, verification rescans and mismatch reporting, and execution failure handling.

Sequence Diagram

sequenceDiagram
  participant User
  participant PARSE_SCOPE
  participant INVENTORY
  participant CONTENT_READ
  participant ISSUE_ANALYSIS
  participant RULE_GENERATION
  participant PLAN_GENERATION
  participant EXEC_CONFIRM
  participant EXECUTE
  participant VERIFY

  User->>PARSE_SCOPE: submit scope/request
  PARSE_SCOPE->>User: confirm parsed scope (stop & wait)
  User->>INVENTORY: approve inventory
  INVENTORY->>CONTENT_READ: provide ResourceItems
  CONTENT_READ->>ISSUE_ANALYSIS: low_confidence_items + read evidence
  ISSUE_ANALYSIS->>RULE_GENERATION: identified organization problems
  RULE_GENERATION->>PLAN_GENERATION: classification_rules + target_tree
  PLAN_GENERATION->>EXEC_CONFIRM: plan summary (DisplayItems)
  EXEC_CONFIRM->>User: request execution confirmation (write scope)
  User->>EXEC_CONFIRM: confirm subset
  EXEC_CONFIRM->>EXECUTE: execute approved items (token resolution, moves)
  EXECUTE->>VERIFY: record results and trigger verify rescan
  VERIFY->>User: verification results & manual-confirmation routing
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • fangshuyu-768
  • wittam-01

"I hopped through folders, nibbling stray file crumbs,
I mapped the paths where scattered secrets hum.
From parse to plan, I pause before a shove,
I wait for your nod before moves I love.
Permissions polite — a tidy, gentle thrum. 🥕🐇"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a knowledge organization workflow documentation for Lark Drive.
Description check ✅ Passed The description covers key sections (Summary, Changes, Test Plan, Related Issues) and is mostly complete, though it deviates slightly from the template format.
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 feat/workflow-knowledgeOrganize

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 the size/L Large or sensitive change across domains or core paths label May 22, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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-drive/references/lark-drive-workflow-knowledgeOrganize.md`:
- Around line 81-105: The fenced workflow block (the triple-backtick code fence
that wraps the ASCII diagram under the workflow header) lacks a language tag,
causing MD040 lint failures; update the opening fence from ``` to ```text so the
block is explicitly annotated (e.g., change "```" to "```text") and leave the
closing fence as is to resolve the lint issue while preserving the diagram
content.
🪄 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: 32b25765-591a-4bca-88cb-b32d3434d45e

📥 Commits

Reviewing files that changed from the base of the PR and between fbe4cc6 and 08936db.

📒 Files selected for processing (2)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-knowledgeOrganize.md

Comment on lines +81 to +105
```
{用户输入的整理目标:URL / 名称 / token / 范围描述}
入口解析(识别资源类型并分流到 Drive / Wiki / 单资源链路)
递归盘点资源 ──► 标准化 ResourceItem 清单
现状统计 ──► 轻量内容读取(仅低置信度资源)
问题识别 ──► 整理规则生成
目标目录树 ──► 移动 / 创建计划
用户确认
├─► 不执行:输出整理方案
└─► 执行:创建目录 / 移动资源 / 重新扫描验证
```
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 | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced workflow block.

This block is missing a fence language and triggers MD040; please annotate it (e.g., text) for lint compliance.

Suggested diff
-```
+```text
 {用户输入的整理目标:URL / 名称 / token / 范围描述}
         │
         ▼
   入口解析(识别资源类型并分流到 Drive / Wiki / 单资源链路)
@@
-```
+```
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 81-81: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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-drive/references/lark-drive-workflow-knowledgeOrganize.md` around
lines 81 - 105, The fenced workflow block (the triple-backtick code fence that
wraps the ASCII diagram under the workflow header) lacks a language tag, causing
MD040 lint failures; update the opening fence from ``` to ```text so the block
is explicitly annotated (e.g., change "```" to "```text") and leave the closing
fence as is to resolve the lint issue while preserving the diagram content.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.63%. Comparing base (bbef3cb) to head (3ec3a59).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
+ Coverage   68.61%   68.63%   +0.01%     
==========================================
  Files         625      625              
  Lines       58348    58386      +38     
==========================================
+ Hits        40035    40071      +36     
+ Misses      15029    15027       -2     
- Partials     3284     3288       +4     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/workflow-knowledgeOrganize -y -g

@YH-1600 YH-1600 force-pushed the feat/workflow-knowledgeOrganize branch from 08936db to 5a1f271 Compare May 25, 2026 11:47
@github-actions github-actions Bot added the domain/ccm PR touches the ccm domain label May 25, 2026
@YH-1600 YH-1600 force-pushed the feat/workflow-knowledgeOrganize branch 6 times, most recently from f2a44d9 to 031f497 Compare May 26, 2026 11:42
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 (3)
skills/lark-drive/references/lark-drive-workflow-knowledge-organize-execution.md (3)

99-118: 💤 Low value

Table structure inconsistency between verification table and result table.

Lines 101-102 define a 9-column verification table including 标题, 预期 token, and 实际 token, but the result table template at line 116 only includes 6 columns, omitting these fields. If this is intentional for brevity, consider adding a note explaining the simplified format. Otherwise, align the column sets for consistency.

💡 Possible alignment

If the full detail is needed in results, update line 116:

-| plan_id | 动作 | 预期目标 | 实际目标 | 状态 | 失败原因 |
-|---------|------|----------|----------|------|----------|
+| plan_id | 动作 | 标题 | 预期目标 | 实际目标 | 预期 token | 实际 token | 状态 | 失败原因 |
+|---------|------|------|----------|----------|------------|------------|------|----------|

Alternatively, if brevity is preferred, add a note at line 104:

 ### Verification Result
 
+<!-- Note: Result table shows summary columns only; full verification table available in logs -->
 ```text
🤖 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-drive/references/lark-drive-workflow-knowledge-organize-execution.md`
around lines 99 - 118, The verification table header (the 9-column table
including 标题, 预期 token, 实际 token) does not match the "Verification Result"
summary table (which only has 6 columns); either expand the result table to
include the same columns (标题, 预期 token, 实际 token) so both tables are consistent,
or keep the simplified 6-column result table but add a brief note beneath the
verification header explaining that the result table is a condensed summary and
omits those three fields; update the markdown in the Verification table block
and the Verification Result block accordingly so headers and intent are aligned.

14-15: ⚡ Quick win

Consider adding specific file paths for cross-references.

Lines 14-15 reference "shortcut docs" and "Non-goals from the main workflow entry" but don't provide specific file paths. For better navigation and clarity, consider adding explicit references like you did on line 11.

📝 Suggested improvement
-4. Follow command syntax, scope requirements, and confirmation behavior from referenced shortcut docs.
-5. Follow `Non-goals` from the main workflow entry. Do not execute excluded operations from this file.
+4. Follow command syntax, scope requirements, and confirmation behavior from referenced shortcut documentation (see [`lark-drive/SKILL.md`](../SKILL.md) and individual command references).
+5. Follow `Non-goals` from [`lark-drive-workflow-knowledge-organize.md`](lark-drive-workflow-knowledge-organize.md). Do not execute excluded operations from this file.
🤖 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-drive/references/lark-drive-workflow-knowledge-organize-execution.md`
around lines 14 - 15, Update the two cross-references that currently say
"shortcut docs" and "Non-goals from the main workflow entry" to include explicit
file paths or anchor links (the same style used for the reference on line 11);
locate the phrases "shortcut docs" and "Non-goals from the main workflow entry"
in the document and replace them with concrete references pointing to the exact
markdown files or section anchors (e.g., ./path/to/shortcut-doc.md#section or
`#main-workflow-non-goals`) so readers can navigate directly to the referenced
content.

144-145: ⚡ Quick win

Add explicit markdown links for cross-referenced failure handling

In skills/lark-drive/references/lark-drive-workflow-knowledge-organize-execution.md (lines 144-145), lark-shared and Permission Request Gate are referenced as plain inline code, but the source docs are at ../../lark-shared/SKILL.md and lark-drive-workflow-knowledge-organize.md#permission-request-gate.

📝 Suggested improvement for clarity
-| Missing API scope | Follow `lark-shared` permission handling and stop | Do not retry the same command repeatedly |
-| Resource access denied | Stop and follow the main workflow `Permission Request Gate` | Do not request permission automatically or in batch |
+| Missing API scope | Follow permission handling from [`lark-shared/SKILL.md`](../../lark-shared/SKILL.md) and stop | Do not retry the same command repeatedly |
+| Resource access denied | Stop and follow the main workflow [`Permission Request Gate`](lark-drive-workflow-knowledge-organize.md#permission-request-gate) | Do not request permission automatically or in batch |
🤖 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-drive/references/lark-drive-workflow-knowledge-organize-execution.md`
around lines 144 - 145, Replace the inline code mentions `lark-shared` and
`Permission Request Gate` with explicit Markdown links: make `lark-shared` link
to its SKILL.md (e.g., [lark-shared](SKILL.md)) and make `Permission Request
Gate` link to the corresponding section anchor in the workflow doc (e.g.,
[Permission Request
Gate](lark-drive-workflow-knowledge-organize.md#permission-request-gate));
update the table cells on the two lines shown so the references become clickable
and maintain the existing wording and casing.
🤖 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-drive/references/lark-drive-workflow-knowledge-organize-execution.md`:
- Line 86: Replace the generic "lark-wiki" pointer on line 86 with explicit
guidance: reference the lark-wiki space-list doc (notes) and show the exact CLI
to resolve the shorthand (run the wiki spaces get command with --params
'{"space_id":"my_library"}' to obtain the real space_id and then pass that value
as --space-id), and also reference the lark-wiki move doc to state the
recommended flow of running the wiki spaces get command first before running
wiki +move so readers know to resolve my_library to an actual space_id before
moving pages.

---

Nitpick comments:
In
`@skills/lark-drive/references/lark-drive-workflow-knowledge-organize-execution.md`:
- Around line 99-118: The verification table header (the 9-column table
including 标题, 预期 token, 实际 token) does not match the "Verification Result"
summary table (which only has 6 columns); either expand the result table to
include the same columns (标题, 预期 token, 实际 token) so both tables are consistent,
or keep the simplified 6-column result table but add a brief note beneath the
verification header explaining that the result table is a condensed summary and
omits those three fields; update the markdown in the Verification table block
and the Verification Result block accordingly so headers and intent are aligned.
- Around line 14-15: Update the two cross-references that currently say
"shortcut docs" and "Non-goals from the main workflow entry" to include explicit
file paths or anchor links (the same style used for the reference on line 11);
locate the phrases "shortcut docs" and "Non-goals from the main workflow entry"
in the document and replace them with concrete references pointing to the exact
markdown files or section anchors (e.g., ./path/to/shortcut-doc.md#section or
`#main-workflow-non-goals`) so readers can navigate directly to the referenced
content.
- Around line 144-145: Replace the inline code mentions `lark-shared` and
`Permission Request Gate` with explicit Markdown links: make `lark-shared` link
to its SKILL.md (e.g., [lark-shared](SKILL.md)) and make `Permission Request
Gate` link to the corresponding section anchor in the workflow doc (e.g.,
[Permission Request
Gate](lark-drive-workflow-knowledge-organize.md#permission-request-gate));
update the table cells on the two lines shown so the references become clickable
and maintain the existing wording and casing.
🪄 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: 0bad6aa7-7b7f-4f7f-8e4e-a9bd64e52be5

📥 Commits

Reviewing files that changed from the base of the PR and between f2a44d9 and 031f497.

📒 Files selected for processing (7)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-knowledge-organize-analysis.md
  • skills/lark-drive/references/lark-drive-workflow-knowledge-organize-discovery.md
  • skills/lark-drive/references/lark-drive-workflow-knowledge-organize-execution.md
  • skills/lark-drive/references/lark-drive-workflow-knowledge-organize-planning.md
  • skills/lark-drive/references/lark-drive-workflow-knowledge-organize.md
  • skills/lark-wiki/SKILL.md
✅ Files skipped from review due to trivial changes (2)
  • skills/lark-wiki/SKILL.md
  • skills/lark-drive/references/lark-drive-workflow-knowledge-organize-planning.md

4. Execute `move` only when `target_parent_path` resolves to a token.
5. If same-name target ambiguity exists, inspect existing children when possible; otherwise mark `needs_review=true`.
6. Before writing to `my_library` root, resolve the real `space_id` according to `lark-wiki`.

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 | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Find lark-wiki documentation and space_id resolution guidance.
# Expected: Find wiki skill documentation with space_id or my_library resolution details.

# Search for wiki-related skill documentation
fd -t f -e md 'wiki' skills/ | head -10

# Search for space_id and my_library resolution guidance
rg -n --type=md -C3 'space_id.*my_library|my_library.*space_id' skills/

Repository: larksuite/cli

Length of output: 10089


Clarify the lark-wiki shorthand for resolving my_library’s space_id.

Line 86 should reference the exact guidance instead of the generic lark-wiki pointer:

  • skills/lark-wiki/references/lark-wiki-space-list.mdNotes (resolve my_library via lark-cli wiki spaces get --params '{"space_id":"my_library"}', then use the returned space_id as --space-id).
  • skills/lark-wiki/references/lark-wiki-move.md → the recommended flow to run wiki spaces get ... before wiki +move.
🤖 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-drive/references/lark-drive-workflow-knowledge-organize-execution.md`
at line 86, Replace the generic "lark-wiki" pointer on line 86 with explicit
guidance: reference the lark-wiki space-list doc (notes) and show the exact CLI
to resolve the shorthand (run the wiki spaces get command with --params
'{"space_id":"my_library"}' to obtain the real space_id and then pass that value
as --space-id), and also reference the lark-wiki move doc to state the
recommended flow of running the wiki spaces get command first before running
wiki +move so readers know to resolve my_library to an actual space_id before
moving pages.

@YH-1600 YH-1600 force-pushed the feat/workflow-knowledgeOrganize branch 7 times, most recently from f47c4c6 to c23be77 Compare May 28, 2026 03:49
Change-Id: I2343fcdf26ceefb898cc8d4faeae4b17384cfea8
@YH-1600 YH-1600 force-pushed the feat/workflow-knowledgeOrganize branch from c23be77 to 3ec3a59 Compare May 28, 2026 06:11
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/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants