docs(lark-shared): restructure into prioritized rules + on-demand references#1450
docs(lark-shared): restructure into prioritized rules + on-demand references#1450liangshuo-1 wants to merge 1 commit into
Conversation
…erences Rewrite the always-loaded SKILL.md from a 168-line monolith into a slim core: a positioning line plus 7 mental-model "通用准则" ordered by agent attention priority (silent/proactive rules first; loud-triggered and low-frequency ones last), and a short routing list. Mechanics and edge cases move into on-demand references/ (loaded only when relevant). References (named with the lark-shared- prefix, matching the per-domain convention): - lark-shared-auth-split-flow.md split-flow steps (marked must-read) - lark-shared-high-risk-approval.md exit-10 envelope forms + predict/preview - lark-shared-identity-and-permissions.md identity model + scope recovery - lark-shared-config-init.md first-run config (blocking, no split-flow) - lark-shared-update-notice.md _notice handling (update/skills/deprecated) Fix doc-vs-implementation drift confirmed against the code: - exit-10 keys on exit code 10, not the type string; covers both the flat (type=confirmation_required) and typed (type=confirmation + subtype) envelopes, and reads the confirm flag from hint (--yes / --force). - distinguish permission_violations (raw API) vs missing_scopes (CLI error). - complete _notice keys (update / skills / deprecated_command). - identity failure is silent-or-loud per command, not always empty. Switch description to Chinese; bump version 1.0.0 -> 1.1.0. Change-Id: I2dff478ecdc05a13f2d750944f637ed2374961e7
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR refactors the Lark shared CLI skills documentation from a monolithic guide into a modular reference architecture. The main SKILL.md is condensed to a short checklist, with detailed workflows for authentication, identity, approval gating, and lifecycle notifications moved to five dedicated reference documents. ChangesShared Skills Documentation Restructuring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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 #1450 +/- ##
=======================================
Coverage 72.88% 72.88%
=======================================
Files 738 738
Lines 69553 69553
=======================================
Hits 50695 50695
Misses 15043 15043
Partials 3815 3815 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@09d5c5d99b3b6562faeda9c60f678d8dcf5a38b0🧩 Skill updatenpx skills add larksuite/cli#docs/lark-shared-restructure -y -g |
Summary
lark-sharedis force-loaded by nearly everylark-*skill, so its body is paid on almost every task. This rewrites the 168-line monolith into a slim always-loaded core plus on-demandreferences/.The core is a positioning line + 7 mental-model rules (通用准则) ordered by agent attention priority: rules that fail silently or have no trigger (read-usage-first, identity, auth split-flow) come first; rules with loud self-announcing triggers or low frequency (exit-10 gate, relative-path, no-secrets) come last. Each rule states the why / boundary (the mental model); the how (mechanics, steps, field paths) lives in references loaded only when relevant.
Changes
references/, named with thelark-shared-prefix to match the per-domain convention.lark-shared-auth-split-flow.md— split-flow steps (marked must-read before initiating user auth)lark-shared-high-risk-approval.md— exit-10 envelope forms, predict-before-running,--dry-runpreviewlark-shared-identity-and-permissions.md— identity model, grant layers, scope-recovery flowslark-shared-config-init.md— first-run config (blocking; no split-flow)lark-shared-update-notice.md—_noticehandling (update/skills/deprecated_command)typestring; covers both the flat (type=confirmation_required) and typed (type=confirmation+subtype) envelopes; reads the confirm flag fromhint(--yes/--force, varies by command).permission_violations(raw API block) vsmissing_scopes(CLI structured error)._noticekeys (update/skills/deprecated_command).1.0.0→1.1.0.Test plan
lark-cli skills read lark-sharedand eachreferences/lark-shared-*.mdresolve; no broken links (everyreferences/…mdtarget exists).internal/cmdutil/confirm.go(flat envelope),errs/(typed envelope),cmd/root.go(_noticekeys),internal/vfs/localfileio/path.go(relative-path error + hint),internal/schema/assembler.go(yesfield injection).lark-cli: the slim rules steer correct handling of exit-10 (stop + confirm, no silent--yes), bot/user identity selection, auth split-flow (QR + hand back control), and relative-path recovery.Related
Alternative restructure of the same file as #1433.
Summary by CodeRabbit