docs: add drive knowledge asset workflow guidance#1103
Conversation
Change-Id: I2431a436e79d5a0e62501fb51aad4bde83f393b8
📝 WalkthroughWalkthroughThis PR establishes a complete knowledge asset organization workflow system for the lark-drive skill. It refines skill routing to guide users toward a new set of reference documents that define safety policies, artifact contracts, and three sequential workflows: inventory (catalog knowledge resources), organize (generate cleanup/organization plans), and permission-audit (identify permission risks). ChangesKnowledge Asset Organization Workflow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1103 +/- ##
==========================================
- Coverage 67.92% 67.92% -0.01%
==========================================
Files 601 603 +2
Lines 55766 55779 +13
==========================================
+ Hits 37880 37888 +8
- Misses 14751 14755 +4
- Partials 3135 3136 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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-knowledge-inventory.md`:
- Around line 50-54: Update Step 3's initial wiki +node-list command to allow
subtree-scoped inventory by adding an optional --parent-node-token parameter;
modify the example invocation that currently always queries the space root so it
conditionally accepts [--parent-node-token
"<scoped_root_node_token_if_subtree>"] when documenting the wiki +node-list call
in Step 3, and ensure the text explains using --parent-node-token to start from
the subtree root instead of the space root to preserve scope fidelity.
In `@skills/lark-drive/references/lark-drive-knowledge-organize.md`:
- Around line 49-58: The templates currently only emit dry-run commands (e.g.,
using the --dry-run flag) while the action contract requires both a dry-run and
an execute command and requires requires_confirmation=true; update the template
generation that produces organize-plan.json (and any affected templates between
lines 63-95) to emit a paired execute command for each action — either by
providing an explicit execute command field alongside the dry-run example or by
adding a normalization rule that derives the execute command by removing the
--dry-run flag from the dry-run command; ensure every action includes source,
target, reason, evidence, requires_confirmation=true, a dry-run command, and an
execute command so generation is deterministic.
In `@skills/lark-drive/references/lark-drive-knowledge-permission-audit.md`:
- Line 19: The capability table row uses dotted endpoint notation
`drive.permission.public.get` while neighboring rows use CLI command style
`drive permission.public get`; update this row to the CLI command style "drive
permission.public get" (or whatever unified "命令" notation is used elsewhere) so
the table is consistent—locate the table entry containing "Drive 文件夹公开权限" and
replace the dotted form with the CLI-style command.
- Line 58: Unify the unsupported-check key by replacing all occurrences of
drive_folder_public_permission with the canonical
drive_folder_public_permission_unsupported in this document and any related
examples/tests; ensure the logic that handles type=folder entries writes that
key into unsupported_checks or warnings (e.g.,
drive_folder_public_permission_unsupported) and update any cross-references
(including the other instance noted at 102-102) so producers/consumers of
permission-audit.json use the single canonical key.
In `@skills/lark-drive/SKILL.md`:
- Around line 39-40: Reorder the reference list in SKILL.md so that the safety
document is loaded before the artifacts document: change the sequence that
currently lists `references/lark-drive-knowledge-artifacts.md` followed by
`references/lark-drive-knowledge-safety.md` to `overview ->
references/lark-drive-knowledge-safety.md ->
references/lark-drive-knowledge-artifacts.md`; update the two lines that mention
these filenames to reflect the new order and ensure the text reads "overview ->
safety -> artifacts".
🪄 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: 8207499a-b96a-42ae-81c9-bd32f57245e6
📒 Files selected for processing (8)
skills/lark-drive/SKILL.mdskills/lark-drive/references/lark-drive-knowledge-artifacts.mdskills/lark-drive/references/lark-drive-knowledge-inventory.mdskills/lark-drive/references/lark-drive-knowledge-organize.mdskills/lark-drive/references/lark-drive-knowledge-overview.mdskills/lark-drive/references/lark-drive-knowledge-permission-audit.mdskills/lark-drive/references/lark-drive-knowledge-safety.mdskills/lark-wiki/SKILL.md
| ```bash | ||
| lark-cli wiki +node-list \ | ||
| --space-id "<space_id_or_my_library>" \ | ||
| --page-all --page-limit 0 --format json --as user | ||
| ``` |
There was a problem hiding this comment.
Subtree scope entry is missing from Step 3 root command.
Line 7 says subtree inventory is supported, but Step 3 always starts from space root. For subtree scope, the first wiki +node-list call should start with the scoped node_token as --parent-node-token; otherwise the workflow over-scans and breaks scope fidelity.
Proposed doc fix
读取根层:
```bash
lark-cli wiki +node-list \
--space-id "<space_id_or_my_library>" \
+ [--parent-node-token "<scoped_root_node_token_if_subtree>"] \
--page-all --page-limit 0 --format json --as user</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
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-knowledge-inventory.md around lines
50 - 54, Update Step 3's initial wiki +node-list command to allow subtree-scoped
inventory by adding an optional --parent-node-token parameter; modify the
example invocation that currently always queries the space root so it
conditionally accepts [--parent-node-token
"<scoped_root_node_token_if_subtree>"] when documenting the wiki +node-list call
in Step 3, and ensure the text explains using --parent-node-token to start from
the subtree root instead of the space root to preserve scope fidelity.
</details>
<!-- fingerprinting:phantom:triton:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
| 每个 action 必须包含: | ||
|
|
||
| - source | ||
| - target | ||
| - reason | ||
| - evidence | ||
| - `requires_confirmation=true` | ||
| - dry-run command | ||
| - execute command | ||
|
|
There was a problem hiding this comment.
Action contract requires execute command, but templates only show --dry-run.
The doc requires both commands per action, but current templates only provide dry-run examples. Add paired execute templates (or a normalization rule like “remove --dry-run for execute”) to keep organize-plan.json generation deterministic.
Proposed doc fix pattern
每个 action 必须包含:
...
- dry-run command
- execute command
+
+推荐模板约定:
+- `dry-run command`:命令含 `--dry-run`
+- `execute command`:与 dry-run 命令参数一致,仅去掉 `--dry-run`Also applies to: 63-95
🤖 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-knowledge-organize.md` around lines
49 - 58, The templates currently only emit dry-run commands (e.g., using the
--dry-run flag) while the action contract requires both a dry-run and an execute
command and requires requires_confirmation=true; update the template generation
that produces organize-plan.json (and any affected templates between lines
63-95) to emit a paired execute command for each action — either by providing an
explicit execute command field alongside the dry-run example or by adding a
normalization rule that derives the execute command by removing the --dry-run
flag from the dry-run command; ensure every action includes source, target,
reason, evidence, requires_confirmation=true, a dry-run command, and an execute
command so generation is deterministic.
| |-|-|-| | ||
| | Wiki 空间成员 | 支持 | `wiki +member-list` | | ||
| | 文档公开权限 | 支持 | `drive permission.public get`,仅限 schema 支持的文档类型 | | ||
| | Drive 文件夹公开权限 | 暂不支持 | `drive.permission.public.get` 不支持 `type=folder` | |
There was a problem hiding this comment.
Use one command notation style in the capability table.
This row uses dotted endpoint style (drive.permission.public.get) while neighboring rows use CLI command style (drive permission.public get). In a “命令” column, this inconsistency can mislead execution.
🤖 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-knowledge-permission-audit.md` at
line 19, The capability table row uses dotted endpoint notation
`drive.permission.public.get` while neighboring rows use CLI command style
`drive permission.public get`; update this row to the CLI command style "drive
permission.public get" (or whatever unified "命令" notation is used elsewhere) so
the table is consistent—locate the table entry containing "Drive 文件夹公开权限" and
replace the dotted form with the CLI-style command.
| doc, docx, sheet, bitable, file, wiki, mindnote, minutes, slides | ||
| ``` | ||
|
|
||
| `type=folder` 的 Drive 文件夹不要调用 `drive.permission.public get`。将该 item 写入 `unsupported_checks` 或 `warnings`,例如 `drive_folder_public_permission_unsupported`,并继续审计其他条目。 |
There was a problem hiding this comment.
Unify the drive_folder_public_permission unsupported-check key.
The doc currently uses two different required keys for the same uncovered check (drive_folder_public_permission_unsupported vs drive_folder_public_permission). Please standardize to one canonical value, otherwise producers/consumers of permission-audit.json can drift.
Also applies to: 102-102
🤖 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-knowledge-permission-audit.md` at
line 58, Unify the unsupported-check key by replacing all occurrences of
drive_folder_public_permission with the canonical
drive_folder_public_permission_unsupported in this document and any related
examples/tests; ensure the logic that handles type=folder entries writes that
key into unsupported_checks or warnings (e.g.,
drive_folder_public_permission_unsupported) and update any cross-references
(including the other instance noted at 102-102) so producers/consumers of
permission-audit.json use the single canonical key.
| 2. 需要标准中间产物时阅读 [`lark-drive-knowledge-artifacts.md`](references/lark-drive-knowledge-artifacts.md)。 | ||
| 3. 涉及任何写操作或权限治理时阅读 [`lark-drive-knowledge-safety.md`](references/lark-drive-knowledge-safety.md)。 |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
调整 reference 加载顺序为 safety 在 artifacts 之前。
这里先读 artifacts 再读 safety,和当前分层依赖(先安全策略,再产物协议)不一致,容易让执行阶段先按结构落地、后补安全约束。建议改成 overview -> safety -> artifacts。
Suggested diff
-2. 需要标准中间产物时阅读 [`lark-drive-knowledge-artifacts.md`](references/lark-drive-knowledge-artifacts.md)。
-3. 涉及任何写操作或权限治理时阅读 [`lark-drive-knowledge-safety.md`](references/lark-drive-knowledge-safety.md)。
+2. 涉及任何写操作或权限治理时阅读 [`lark-drive-knowledge-safety.md`](references/lark-drive-knowledge-safety.md)。
+3. 需要标准中间产物时阅读 [`lark-drive-knowledge-artifacts.md`](references/lark-drive-knowledge-artifacts.md)。📝 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.
| 2. 需要标准中间产物时阅读 [`lark-drive-knowledge-artifacts.md`](references/lark-drive-knowledge-artifacts.md)。 | |
| 3. 涉及任何写操作或权限治理时阅读 [`lark-drive-knowledge-safety.md`](references/lark-drive-knowledge-safety.md)。 | |
| 2. 涉及任何写操作或权限治理时阅读 [`lark-drive-knowledge-safety.md`](references/lark-drive-knowledge-safety.md)。 | |
| 3. 需要标准中间产物时阅读 [`lark-drive-knowledge-artifacts.md`](references/lark-drive-knowledge-artifacts.md)。 |
🤖 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/SKILL.md` around lines 39 - 40, Reorder the reference list
in SKILL.md so that the safety document is loaded before the artifacts document:
change the sequence that currently lists
`references/lark-drive-knowledge-artifacts.md` followed by
`references/lark-drive-knowledge-safety.md` to `overview ->
references/lark-drive-knowledge-safety.md ->
references/lark-drive-knowledge-artifacts.md`; update the two lines that mention
these filenames to reflect the new order and ensure the text reads "overview ->
safety -> artifacts".
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@2424f6dfc246a79aaaf77f93cc7e018303386cc8🧩 Skill updatenpx skills add larksuite/cli#docs/drive-knowledge-workflows -y -g |
Summary
This PR adds structured
lark-driveguidance for knowledge asset inventory,organization, permission auditing, and safety workflows. It also clarifies that
broader Wiki/document-library governance flows should enter through
lark-drive,while
lark-wikiremains focused on Wiki space, member, and node operations.Changes
lark-driveknowledge asset workflow references for overview, artifacts,inventory, organization, permission audit, and safety rules
lark-drive/SKILL.mdto the new referenceslark-wikirouting so Wiki/document-library governance workflowsdelegate to
lark-driveTest Plan
git diff --cached --checkpassed before commitRelated Issues
Summary by CodeRabbit
New Features
Documentation