The foundation shared by all lark-* skills: identity, authentication, output contract, and high-risk operations.
General Guidelines
-
Confirm usage before invoking: before executing, read the corresponding reference or run
--help, don't guess flags and call blindly. -
Identity determines whose behalf you operate on:
--as userrepresents the user themselves (can see and operate their calendar, cloud space/cloud drive/cloud storage, and other personal resources),--as botrepresents the application itself, an application-level operation that can only access the bot's own resources; when the bot queries user resources it returns empty success instead of an error. Figure out the identity before actingidentity. Identity model and permission management →lark-shared-identity-and-permissions.md。 -
Authorization/configuration URLs must be paired with a QR code: when a command outputs
verification_url、verification_uri_complete、console_urland other URL fields, you must uselark-cli auth qrcodeto generate and display it in the reply, URL first and QR code after; prefer generating PNG (--output), and only use ASCII (--ascii) when the user explicitly requests it. Forward the URL as-is—do not encode/decode, do not add punctuation, do not reassemble the query; please show the QR code and the link to the user together. -
--format json(default), determine success usingok == true(or process exit code 0), do not usecode == 0: the success envelope has no top-levelcode/msgfield,codeonly appears in the error envelope'serrorwithin. Judging by the old OpenAPI format{"code": 0, "msg": "ok"}will misjudge all successful calls as failures—especially dangerous when wrapping write-type commands. JSON output contract →lark-shared-output-contract.md。
Security Rules
- Do not output secrets(appSecret, accessToken, etc.) to the terminal in plaintext.
-
Must confirm user intent before write/delete operations。
-
When the target command supports
--dry-run, use--dry-runto preview the dangerous request. -
Exit code 10 is a high-risk confirmation gate (
risk: "high-risk-write"), not an error: stop → confirm with the user(showaction、riskand key parameters) → after obtaining theuser's explicit consent, append the confirmation flaghintindicated by to the end of your original argvand retry;neversilently add the confirmation flag to bypass →lark-shared-high-risk-approval.md。 -
File paths only accept relative paths:
--file、--output、--output-dir、@fileand other path parameters only accept relative paths under cwd; passing an absolute path will reportunsafe file path. For data input (@file, large JSON), prefer passing via stdin to avoid path and escaping issues.
Reference Strong-Trigger Index
When any trigger condition is hit,MUST read the corresponding reference before executing the next step. When multiple are hit, read them in the order in the table, and read the same reference only once.
| Strong trigger conditions (must read if any is hit) | Reference |
|---|---|
Check who you are (user/bot), get detailed current identity field information, identity diagnostics,--asselection logic, identity continuity, login state, authentication, scope, authorization and permission management,missing_scopes or console_url, the Agent is about to initiate or complete auth login |
lark-shared-identity-and-permissions.md |
| Need to rely on the JSON output contract to determine success/failure, read stdout/stderr, or write scripts and wrappers for commands | lark-shared-output-contract.md |
Prepare to execute high-risk-write (high-risk operation), determine the command risk level, encounter exit code exit 10,confirmation_required, and retry after confirmation |
lark-shared-high-risk-approval.md |
For first-time CLI use, run lark-cli config init to complete application configuration, or the CLI explicitly prompts config init --new |
lark-shared-config-init.md |
The user asks about notice, CLI version updates, or the output contains _notice(upgrade / skills outdated / deprecated command prompt) |
lark-shared-update-notice.md |