Skip to content

docs(lark-wiki): correct the --as default-identity claim#919

Merged
fangshuyu-768 merged 1 commit into
mainfrom
fix/wiki-skill-default-identity
May 15, 2026
Merged

docs(lark-wiki): correct the --as default-identity claim#919
fangshuyu-768 merged 1 commit into
mainfrom
fix/wiki-skill-default-identity

Conversation

@liujinkun2025
Copy link
Copy Markdown
Collaborator

@liujinkun2025 liujinkun2025 commented May 15, 2026

Summary

Plan A fix for the reported wiki +space-list identity bug. Docs-only, branched off main (independent of #904).

The lark-wiki skill claimed list/copy shortcuts default to --as user, but identity is resolved by the global precedence — --as > strict-mode > app defaultAs > auto-detect (which falls back to bot). So lark-cli wiki +space-list without --as commonly resolves to bot and lists the app's spaces instead of the user's, contradicting the doc.

This is a pre-existing framework-wide behavior (internal/cmdutil/factory.go auto-detect fallback), not a regression — the fix here is to make the docs match reality and steer the agent to pass --as user for wiki's user-centric operations. (No code change; the framework precedence is intentionally global and out of scope.)

Changes

  • SKILL.md: new authoritative 身份解析(必读) section — spells out the real precedence, the bot fallback, and the rule to pass --as user for query/list/read/my_library operations.
  • references/lark-wiki-space-list.md, lark-wiki-node-list.md, lark-wiki-node-copy.md: corrected the --as rows to stop advertising a non-existent user default.

Test plan

  • node scripts/skill-format-check/index.js — passed (CI skill gate)
  • ./scripts/skill-format-check/test.sh — all passed
  • go build ./... OK, go test ./shortcuts/wiki/... green (sanity; no code touched)
  • grep confirms no remaining "default user" identity claims in skills/lark-wiki/

Summary by CodeRabbit

  • Documentation
    • Added an "Identity Resolution" guide clarifying how the --as flag selects identity (auto/user/bot)
    • Changed docs to show --as defaults to auto (not user) and explain resolution behavior
    • Recommend explicitly passing --as user for user-centric wiki operations; note my_library requires --as user

Review Change Stack

@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 May 15, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20d55cea-e01c-45b6-8677-bf2daf23e8ac

📥 Commits

Reviewing files that changed from the base of the PR and between e01ab4b and d5cdb55.

📒 Files selected for processing (4)
  • skills/lark-wiki/SKILL.md
  • skills/lark-wiki/references/lark-wiki-node-copy.md
  • skills/lark-wiki/references/lark-wiki-node-list.md
  • skills/lark-wiki/references/lark-wiki-space-list.md
✅ Files skipped from review due to trivial changes (4)
  • skills/lark-wiki/references/lark-wiki-node-list.md
  • skills/lark-wiki/references/lark-wiki-space-list.md
  • skills/lark-wiki/references/lark-wiki-node-copy.md
  • skills/lark-wiki/SKILL.md

📝 Walkthrough

Walkthrough

Documentation-only changes: added a "身份选择" guideline in skills/lark-wiki/SKILL.md and updated three lark-wiki command references to set --as default to auto, document user/bot identity options, and recommend explicitly using --as user for user-centric wiki operations.

Changes

Identity Resolution Documentation

Layer / File(s) Summary
Guide: identity selection guidance
skills/lark-wiki/SKILL.md
Adds a "身份选择" paragraph advising to prefer --as user for wiki resources and restrict --as bot to explicit app/bot-perspective requests, subject to membership-management limits.
Reference: --as flag docs
skills/lark-wiki/references/lark-wiki-node-copy.md, skills/lark-wiki/references/lark-wiki-node-list.md, skills/lark-wiki/references/lark-wiki-space-list.md
Updates --as flag rows: Default changed to auto, identity options documented as user/bot, and guidance added to explicitly pass --as user for user-centric wiki operations (noting my_library requirement).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • larksuite/cli#505: Related documentation updates aligning --as identity guidance and default behavior.
  • larksuite/cli#417: Related SKILL.md edits documenting --as identity resolution and bot-related constraints.
  • larksuite/cli#512: Related documentation around preferring --as user and disallowing unsupported department+bot flows.

Suggested labels

documentation

Suggested reviewers

  • fangshuyu-768

Poem

🐰 A carrot-sized doc update I bring,
No hidden user default in the spring,
Say --as user when personal space you need,
Only use bot view when the user decreed,
Hoppity-docs now clear — hop on and read! 📚✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: correcting documentation about the --as flag's default identity behavior in lark-wiki.
Description check ✅ Passed The description includes a clear summary, detailed changes, comprehensive test plan, and related issues section. All required template sections are present and well-filled.
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 fix/wiki-skill-default-identity

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.92%. Comparing base (14a3213) to head (d5cdb55).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #919   +/-   ##
=======================================
  Coverage   65.92%   65.92%           
=======================================
  Files         523      523           
  Lines       49692    49692           
=======================================
  Hits        32758    32758           
  Misses      14134    14134           
  Partials     2800     2800           

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

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/wiki-skill-default-identity -y -g

The skill doc claimed wiki list/copy shortcuts default to --as user, but
the CLI --as default is `auto` (no --as commonly resolves to bot, listing
the app's spaces instead of the user's). Running `wiki +space-list`
without --as therefore returns app-scoped data, contradicting the doc.

Following the established lark-mail convention (concise user-centric
guidance, not a precedence essay):
- add a short "优先使用 user 身份" section to SKILL.md
- fix the --as rows in lark-wiki-space-list / node-list / node-copy
  references to show the real `auto` default and steer to --as user

Change-Id: I539f8d622c1bbad57f8a64c2fc7b7ecc0dfe2116
@liujinkun2025 liujinkun2025 force-pushed the fix/wiki-skill-default-identity branch from e01ab4b to d5cdb55 Compare May 15, 2026 14:12
@fangshuyu-768 fangshuyu-768 merged commit 898e0ee into main May 15, 2026
22 checks passed
@fangshuyu-768 fangshuyu-768 deleted the fix/wiki-skill-default-identity branch May 15, 2026 14:21
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.

2 participants