Skip to content

feat: add application domain with slash command management shortcuts#1806

Merged
liangshuo-1 merged 21 commits into
mainfrom
feat/application-slash-command
Jul 13, 2026
Merged

feat: add application domain with slash command management shortcuts#1806
liangshuo-1 merged 21 commits into
mainfrom
feat/application-slash-command

Conversation

@leave330

@leave330 leave330 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Feishu Open Platform now exposes slash command management APIs (application v7, not yet in the meta catalog). This PR adds a new application domain with four handwritten shortcuts so agents and developers can manage the bound app's slash commands directly from the CLI instead of hand-crafting raw v7 requests. The read-only list command is admitted despite being a thin wrapper because it is the by-name resolution base for update/delete and create --force, and it anchors the new domain's output contract.

Changes

  • Add shortcuts/application/ with +slash-command-list, +slash-command-create, +slash-command-update, +slash-command-delete (raw v7 paths via runtime.CallAPIRawTyped-style call, path segments encoded)
  • +slash-command-create: --force turns a name collision into a resolve-by-name PATCH (like gh label create --force); repeatable --description-i18n <lang>=<text>; icon key passed top-level per live-tested API shape
  • +slash-command-update: field-level PATCH semantics; target by --command-id or --command (resolved via live list); i18n map replace semantics documented with a CAUTION
  • +slash-command-delete: high-risk-write behind the framework confirmation gate (exit 10 without --yes); dry-run states the two-step by-name path
  • Shared Scopes plus ConditionalScopes (read scope for by-name/--force paths) declared for both bot and user identities
  • Register the domain in shortcuts/register.go; bilingual domain descriptions in internal/registry/service_descriptions.json
  • Interactive auth login: list application among shortcut-only domains in cmd/auth/login_messages.go; admit application:app_slash_command:read to the recommended tier via internal/registry/scope_overrides.json (v7 scopes are absent from the platform priorities catalog, so the common tier previously resolved to zero scopes; write scope intentionally stays out of the recommended tier)
  • No standalone domain skill this iteration (deliberately deferred per review: the domain has a single capability so far and a resident skill is not worth the agent-context cost); agents learn the commands via --help — the usage gotchas live in flag descriptions and command tips
  • E2E dry-run suite tests/cli_e2e/application/slash_command_dryrun_test.go
  • 27 unit tests across the new package plus registry/auth test updates

Test Plan

  • make unit-test passed
  • validate passed
  • local-eval passed (E2E 5/5; skill-eval ran 6/6 against the since-deferred skill docs — commands themselves unchanged)
  • acceptance-reviewer passed (5/5 cases)
  • manual verification: full CRUD walked by hand against a live app with probe commands — lark-cli application +slash-command-list --json, +slash-command-create --command test-cli-demo --description ... [--force], +slash-command-update --command test-cli-demo --description ..., +slash-command-delete --command test-cli-demo --yes, plus validation-error, name-collision, missing-scope and confirmation-gate (exit 10) paths

Related Issues

N/A

Summary by CodeRabbit

  • New Features

    • Added application slash-command management shortcuts to list, create, update, and delete commands (including descriptions, localized descriptions, icons, lookup by name/ID, dry runs, and forced updates).
  • Improvements

    • Updated application “shortcut-only” domain handling and expanded recommended permissions to include the needed slash-command read scope.
    • Added localized application service description metadata.
  • Tests

    • Added unit and end-to-end coverage for listing, creating, updating, deleting, conflict/force behavior, and dry-run request generation.

@leave330
leave330 requested a review from liangshuo-1 as a code owner July 8, 2026 09:20
@github-actions github-actions Bot added the size/L Large or sensitive change across domains or core paths label Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ae94bba-bc02-4fcc-b6a4-4d8ec92cccb6

📥 Commits

Reviewing files that changed from the base of the PR and between 41ea383 and cbf7111.

📒 Files selected for processing (19)
  • cmd/auth/login_messages.go
  • internal/registry/registry_test.go
  • internal/registry/scope_overrides.json
  • internal/registry/service_descriptions.json
  • shortcuts/application/shortcuts.go
  • shortcuts/application/slash_command_common.go
  • shortcuts/application/slash_command_common_test.go
  • shortcuts/application/slash_command_create.go
  • shortcuts/application/slash_command_create_test.go
  • shortcuts/application/slash_command_delete.go
  • shortcuts/application/slash_command_delete_test.go
  • shortcuts/application/slash_command_list.go
  • shortcuts/application/slash_command_list_test.go
  • shortcuts/application/slash_command_resolve.go
  • shortcuts/application/slash_command_resolve_test.go
  • shortcuts/application/slash_command_update.go
  • shortcuts/application/slash_command_update_test.go
  • shortcuts/register.go
  • tests/cli_e2e/application/slash_command_dryrun_test.go
🚧 Files skipped from review as they are similar to previous changes (17)
  • internal/registry/scope_overrides.json
  • shortcuts/application/shortcuts.go
  • shortcuts/application/slash_command_resolve.go
  • internal/registry/service_descriptions.json
  • shortcuts/application/slash_command_delete.go
  • shortcuts/application/slash_command_resolve_test.go
  • shortcuts/register.go
  • shortcuts/application/slash_command_create.go
  • tests/cli_e2e/application/slash_command_dryrun_test.go
  • cmd/auth/login_messages.go
  • shortcuts/application/slash_command_common.go
  • shortcuts/application/slash_command_common_test.go
  • shortcuts/application/slash_command_update.go
  • shortcuts/application/slash_command_create_test.go
  • shortcuts/application/slash_command_list_test.go
  • shortcuts/application/slash_command_delete_test.go
  • shortcuts/application/slash_command_update_test.go

📝 Walkthrough

Walkthrough

Adds an application shortcut domain with slash-command list, create, update, and delete commands. It includes shared validation and resolution helpers, API request handling, scope and service metadata, global registration, unit tests, and CLI end-to-end dry-run and confirmation coverage.

Changes

Application slash-command feature

Layer / File(s) Summary
Registry, scope, and service metadata
cmd/auth/login_messages.go, internal/registry/*
Registers the application domain, allows its read scope, adds localized service metadata, and updates override expectations.
Shared slash-command helpers
shortcuts/application/slash_command_common*
Adds i18n parsing, command validation, path encoding, request-body construction, collision detection, and helper tests.
Command ID resolution
shortcuts/application/slash_command_resolve*
Resolves exact command names through the list API and returns typed not-found errors.
Slash-command listing
shortcuts/application/slash_command_list*
Adds list execution, empty-item normalization, formatted output, and tests.
Slash-command creation
shortcuts/application/slash_command_create*
Adds create validation, dry-run and POST handling, optional force-based PATCH conversion, and tests.
Slash-command updates
shortcuts/application/slash_command_update*
Adds update validation, PATCH execution, by-name resolution, dry-run descriptions, and tests.
Slash-command deletion
shortcuts/application/slash_command_delete*
Adds confirmation-aware deletion by ID or name, encoded paths, dry-run behavior, output, and tests.
Registration and CLI coverage
shortcuts/register.go, tests/cli_e2e/application/*
Registers the application shortcuts and verifies CLI request shapes and delete confirmation behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • larksuite/cli#528: Updates shared CLI E2E infrastructure used by the new application slash-command tests.

Suggested labels: domain/ccm

Suggested reviewers: liangshuo-1

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Shortcut
  participant ApplicationAPI
  participant Resolver
  CLI->>Shortcut: Run slash-command operation
  Shortcut->>ApplicationAPI: GET, POST, PATCH, or DELETE
  ApplicationAPI-->>Shortcut: Response or command collision
  Shortcut->>Resolver: Resolve command name when needed
  Resolver->>ApplicationAPI: GET slash-command list
  ApplicationAPI-->>Resolver: Command items
  Resolver-->>Shortcut: command_id
  Shortcut-->>CLI: Formatted result or typed error
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding an application domain for slash command management shortcuts.
Description check ✅ Passed The description matches the required template and covers summary, changes, test plan, and related issues with sufficient detail.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/application-slash-command

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.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.57993% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.59%. Comparing base (1ab8530) to head (cbf7111).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/application/slash_command_create.go 71.18% 9 Missing and 8 partials ⚠️
shortcuts/application/slash_command_update.go 76.19% 8 Missing and 7 partials ⚠️
shortcuts/application/slash_command_list.go 50.00% 10 Missing and 2 partials ⚠️
shortcuts/application/slash_command_delete.go 76.92% 5 Missing and 4 partials ⚠️
shortcuts/application/shortcuts.go 0.00% 6 Missing ⚠️
shortcuts/application/slash_command_resolve.go 82.60% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1806    +/-   ##
========================================
  Coverage   74.58%   74.59%            
========================================
  Files         863      870     +7     
  Lines       90123    90340   +217     
========================================
+ Hits        67220    67386   +166     
- Misses      17696    17730    +34     
- Partials     5207     5224    +17     

☔ View full report in Codecov by Harness.
📢 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

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/application-slash-command -y -g

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (4)
shortcuts/application/slash_command_common.go (1)

92-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use p.Code == 40000000 here. CallAPITyped preserves the upstream code on errs.Problem, so code-based matching is more stable than strings.Contains(p.Message, "command already exists").

🤖 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 `@shortcuts/application/slash_command_common.go` around lines 92 - 98, Update
isCommandExists in slash_command_common.go to use the upstream problem code
instead of matching the message text. Keep the errs.ProblemOf(err) check, but
replace the strings.Contains(p.Message, "command already exists") logic with a
direct comparison against p.Code == 40000000 so CallAPITyped-based errors are
identified more reliably.
shortcuts/application/slash_command_create_test.go (1)

146-158: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert typed metadata in the non-conflict error test.

TestSlashCommandCreate_ForceDoesNotConvertNonConflict only checks err.Error() for the "icon_key" substring. Per coding guidelines, error-path tests must assert typed metadata via errs.ProblemOf (category/subtype/param), not message substrings alone. Consider also verifying the error category/subtype to confirm the original API error surfaces unchanged.

💡 Suggested addition
 	if !strings.Contains(err.Error(), "icon_key") {
 		t.Fatalf("expected original icon_key failure to surface unchanged, got %v", err)
 	}
+	p, ok := errs.ProblemOf(err)
+	if !ok || p.Code != 40000031 {
+		t.Fatalf("expected original API error (code 40000031) to surface unchanged, got %v (problem=%v, ok=%v)", err, p, ok)
+	}
🤖 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 `@shortcuts/application/slash_command_create_test.go` around lines 146 - 158,
`TestSlashCommandCreate_ForceDoesNotConvertNonConflict` only asserts on the
error message substring, so update it to verify typed metadata instead of
relying on `err.Error()` alone. In the test, keep the original failure
expectation but also use `errs.ProblemOf` against the returned error from
`mountAndRun` to assert the expected category/subtype/param from the original
icon_key API error, ensuring `SlashCommandCreate` still surfaces the
non-conflict error unchanged.

Source: Coding guidelines

shortcuts/application/slash_command_update_test.go (1)

46-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert typed metadata in the not-found error test.

TestSlashCommandUpdate_ByNameNotFound only checks err.Error() for the "not found" substring. Per coding guidelines, error-path tests must assert typed metadata via errs.ProblemOf (category/subtype/param), not message substrings alone. Consider also verifying the error category/subtype to confirm it's a typed not-found error from resolveCommandID.

💡 Suggested addition
 	if err == nil || !strings.Contains(err.Error(), "not found") {
 		t.Fatalf("expected not found, got %v", err)
 	}
+	p, ok := errs.ProblemOf(err)
+	if !ok || p.Category != errs.CategoryNotFound {
+		t.Fatalf("expected typed not-found error, got %v (problem=%v, ok=%v)", err, p, ok)
+	}
🤖 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 `@shortcuts/application/slash_command_update_test.go` around lines 46 - 55,
TestSlashCommandUpdate_ByNameNotFound currently only checks the error string, so
update it to assert the typed problem metadata as well. Use errs.ProblemOf on
the returned error from mountAndRun to verify the not-found category/subtype and
the relevant param for the lookup failure, and keep the existing substring check
only as a secondary guard if needed. This should reference the resolveCommandID
path and ensure the test validates the typed not-found error rather than just
matching "not found" in the message.

Source: Coding guidelines

shortcuts/application/slash_command_update.go (1)

82-89: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add a Desc for the direct --command-id PATCH path in DryRun.

When --command-id is provided, the DryRunAPI has no description set before the PATCH call. The by-name path sets a Desc for the GET step, but the direct-id path produces a descriptionless dry-run entry. Add a brief description for consistency.

💡 Suggested fix
 	d := common.NewDryRunAPI()
 	target := runtime.Str("command-id")
 	if target == "" {
 		d.Desc(fmt.Sprintf("resolve command_id by name %q via GET list first", runtime.Str("command"))).
 			GET(slashCommandBasePath)
 		target = "<resolved_command_id>"
+	} else {
+		d.Desc("Update a slash command by command_id")
 	}
 	return d.PATCH(slashCommandBasePath + "/" + target).Body(body)
🤖 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 `@shortcuts/application/slash_command_update.go` around lines 82 - 89, The
DryRun flow in slash command update is missing a description when `--command-id`
is used directly, so the PATCH entry is anonymous compared with the by-name
branch. Update the logic around `common.NewDryRunAPI()` and the `target :=
runtime.Str("command-id")` branch to set a brief `Desc` on `d` before calling
`PATCH`, keeping the direct-id path consistent with the existing description set
for the GET resolution path.
🤖 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 `@shortcuts/application/slash_command_common_test.go`:
- Around line 49-54: In TestParseDescriptionI18n_DuplicateLang, stop validating
the error only by substring and assert its typed metadata instead. Use
errs.ProblemOf on the error returned from parseDescriptionI18n to verify the
expected category, subtype, and param values for the duplicate-language case,
and keep any cause-preservation check if available. This test should
specifically target the parseDescriptionI18n error contract rather than the
error message text.

In `@shortcuts/application/slash_command_create.go`:
- Around line 84-92: The rewrapped API error in the slash command creation flow
is dropping the original cause, so update the error construction in the
CallAPITyped handling path to preserve the chain. In the branch that builds the
new API error for “slash command already exists”, add the original err via
WithCause(err) on the errs.NewAPIError result before returning it, while keeping
the existing Subtype, Code, LogID, and hint behavior intact.

In `@shortcuts/application/slash_command_delete_test.go`:
- Around line 93-109: The validation error-path test in
TestSlashCommandDelete_Validate only checks errs.CategoryValidation and should
also assert the typed subtype from errs.ProblemOf. Update the test to verify
p.Subtype is errs.SubtypeInvalidArgument for the validation failures triggered
by SlashCommandDelete, alongside the existing category check.
- Line 67: The `TestSlashCommandDelete_ByNameWithYes` test is ignoring the
`json.Unmarshal` error, unlike `TestSlashCommandDelete_ByIDWithYes`, which can
hide invalid output and lead to a later panic. Update the unmarshalling in
`TestSlashCommandDelete_ByNameWithYes` to check and fail on the error the same
way as the by-ID test, using the `stdout.Bytes()` to `got` decode step so the
test stops with a clear failure if the output is not valid JSON.

In `@shortcuts/application/slash_command_resolve_test.go`:
- Around line 31-39: `TestResolveNotFoundErrorShape` is only validating the
error string from `commandNotFoundError`, but it should assert the typed problem
metadata instead. Update the test to inspect the returned error with
`errs.ProblemOf` and verify the expected category/subtype (and param if
applicable) for `commandNotFoundError`, while also keeping any
cause-preservation check needed for this error path. Avoid relying on
`strings.Contains` message substrings as the primary assertion.

In `@skills/lark-application/references/lark-application-slash-command-update.md`:
- Line 17: Update the `--description` option description in the
`lark-application` slash-command update reference to use clearer Chinese
wording. The current phrasing `新的默认描述` is awkward for user-facing docs; change
it to something like `默认描述的新值`, keeping the meaning aligned with
`description.default_value` and preserving the rest of the table entry
structure.

In `@skills/lark-application/SKILL.md`:
- Around line 13-17: The scope summary in SKILL.md is incomplete because it
implies application:app_slash_command:read is only needed for listing, but the
by-name update/delete flows and create --force also require it. Update the
permissions note near the top-level guidance and reference the relevant command
behavior from the app slash command docs so it explicitly calls out that read
scope is needed for list plus name-based update/delete and force-create paths,
while write scope covers create/update/delete actions.

---

Nitpick comments:
In `@shortcuts/application/slash_command_common.go`:
- Around line 92-98: Update isCommandExists in slash_command_common.go to use
the upstream problem code instead of matching the message text. Keep the
errs.ProblemOf(err) check, but replace the strings.Contains(p.Message, "command
already exists") logic with a direct comparison against p.Code == 40000000 so
CallAPITyped-based errors are identified more reliably.

In `@shortcuts/application/slash_command_create_test.go`:
- Around line 146-158: `TestSlashCommandCreate_ForceDoesNotConvertNonConflict`
only asserts on the error message substring, so update it to verify typed
metadata instead of relying on `err.Error()` alone. In the test, keep the
original failure expectation but also use `errs.ProblemOf` against the returned
error from `mountAndRun` to assert the expected category/subtype/param from the
original icon_key API error, ensuring `SlashCommandCreate` still surfaces the
non-conflict error unchanged.

In `@shortcuts/application/slash_command_update_test.go`:
- Around line 46-55: TestSlashCommandUpdate_ByNameNotFound currently only checks
the error string, so update it to assert the typed problem metadata as well. Use
errs.ProblemOf on the returned error from mountAndRun to verify the not-found
category/subtype and the relevant param for the lookup failure, and keep the
existing substring check only as a secondary guard if needed. This should
reference the resolveCommandID path and ensure the test validates the typed
not-found error rather than just matching "not found" in the message.

In `@shortcuts/application/slash_command_update.go`:
- Around line 82-89: The DryRun flow in slash command update is missing a
description when `--command-id` is used directly, so the PATCH entry is
anonymous compared with the by-name branch. Update the logic around
`common.NewDryRunAPI()` and the `target := runtime.Str("command-id")` branch to
set a brief `Desc` on `d` before calling `PATCH`, keeping the direct-id path
consistent with the existing description set for the GET resolution path.
🪄 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: 2a75613c-4e75-4220-b34c-adbb874a2764

📥 Commits

Reviewing files that changed from the base of the PR and between 9413e7c and 42dc50f.

📒 Files selected for processing (25)
  • cmd/auth/login_messages.go
  • internal/registry/registry_test.go
  • internal/registry/scope_overrides.json
  • internal/registry/service_descriptions.json
  • shortcuts/application/shortcuts.go
  • shortcuts/application/slash_command_common.go
  • shortcuts/application/slash_command_common_test.go
  • shortcuts/application/slash_command_create.go
  • shortcuts/application/slash_command_create_test.go
  • shortcuts/application/slash_command_delete.go
  • shortcuts/application/slash_command_delete_test.go
  • shortcuts/application/slash_command_list.go
  • shortcuts/application/slash_command_list_test.go
  • shortcuts/application/slash_command_resolve.go
  • shortcuts/application/slash_command_resolve_test.go
  • shortcuts/application/slash_command_update.go
  • shortcuts/application/slash_command_update_test.go
  • shortcuts/register.go
  • skill-template/domains/application.md
  • skills/lark-application/SKILL.md
  • skills/lark-application/references/lark-application-slash-command-create.md
  • skills/lark-application/references/lark-application-slash-command-delete.md
  • skills/lark-application/references/lark-application-slash-command-list.md
  • skills/lark-application/references/lark-application-slash-command-update.md
  • tests/cli_e2e/application/slash_command_dryrun_test.go

Comment thread shortcuts/application/slash_command_common_test.go
Comment thread shortcuts/application/slash_command_create.go Outdated
Comment thread shortcuts/application/slash_command_delete_test.go Outdated
Comment thread shortcuts/application/slash_command_delete_test.go
Comment thread shortcuts/application/slash_command_resolve_test.go
|---|---|---|---|
| `--command-id` | string | 与 `--command` 二选一 | 目标指令的 `command_id`(来自 `+slash-command-list` 或 create 的输出) |
| `--command` | string | 与 `--command-id` 二选一 | 按名字定位(不带前导 `/`),CLI 会先调用 list 解析出 `command_id`,需要 read scope |
| `--description` | string | 否 | 新的默认描述(`description.default_value`) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Polish the --description label.

新的默认描述 reads a bit awkwardly in Chinese user-facing docs; 默认描述的新值 (or similar) is clearer. Based on the static analysis hint on this line.

Suggested wording
-| `--description` | string | 否 | 新的默认描述(`description.default_value`) |
+| `--description` | string | 否 | 默认描述的新值(`description.default_value`) |
📝 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.

Suggested change
| `--description` | string || 新的默认描述`description.default_value`|
| `--description` | string || 默认描述的新值`description.default_value`|
🧰 Tools
🪛 LanguageTool

[uncategorized] ~17-~17: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:新"地"默认
Context: ...ope | | --description | string | 否 | 新的默认描述(description.default_value) | | `-...

(wb4)

🤖 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-application/references/lark-application-slash-command-update.md`
at line 17, Update the `--description` option description in the
`lark-application` slash-command update reference to use clearer Chinese
wording. The current phrasing `新的默认描述` is awkward for user-facing docs; change
it to something like `默认描述的新值`, keeping the meaning aligned with
`description.default_value` and preserving the rest of the table entry
structure.

Source: Linters/SAST tools

Comment thread skills/lark-application/SKILL.md Outdated
Comment on lines +13 to +17
## 身份权限和风险处理

开始前先读 [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md)(认证、权限处理、`--dry-run`、exit 10 高风险确认协议)。
`--as bot` 或 `--as user`均支持。
两个权限:`application:app_slash_command:read`(列出)/ `application:app_slash_command:write`(创建/更新/删除)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify the conditional read-scope requirement.

The scope summary reads as if application:app_slash_command:read is only for listing, but the by-name update/delete paths and create --force also need it. Please call that out here so the top-level guidance matches the per-command docs and avoids preventable auth failures. Based on the command docs in this PR.

Suggested wording
-两个权限:`application:app_slash_command:read`(列出)/ `application:app_slash_command:write`(创建/更新/删除)
+两个主要权限:`application:app_slash_command:read`(列出;以及按名字定位 / `--force` 撞名重跑时需要)/ `application:app_slash_command:write`(创建/更新/删除)
📝 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.

Suggested change
## 身份权限和风险处理
开始前先读 [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md)(认证、权限处理、`--dry-run`、exit 10 高风险确认协议)。
`--as bot``--as user`均支持。
两个权限`application:app_slash_command:read`(列出)/ `application:app_slash_command:write`(创建/更新/删除)
## 身份权限和风险处理
开始前先读 [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md)(认证、权限处理、`--dry-run`、exit 10 高风险确认协议)。
`--as bot``--as user`均支持。
两个主要权限`application:app_slash_command:read`(列出;以及按名字定位 / `--force` 撞名重跑时需要)/ `application:app_slash_command:write`(创建/更新/删除)
🤖 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-application/SKILL.md` around lines 13 - 17, The scope summary in
SKILL.md is incomplete because it implies application:app_slash_command:read is
only needed for listing, but the by-name update/delete flows and create --force
also require it. Update the permissions note near the top-level guidance and
reference the relevant command behavior from the app slash command docs so it
explicitly calls out that read scope is needed for list plus name-based
update/delete and force-create paths, while write scope covers
create/update/delete actions.

@leave330

leave330 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed in 78acceb — added .WithCause(err) to the rewrapped conflict error so errors.Is / errors.Unwrap reach the original API error, and extended TestSlashCommandCreate_ConflictNoForce with errors.As + errors.Unwrap assertions to lock the cause chain in.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Quality Summary

CI did not complete successfully. Use the failed check links below to decide whether this PR needs a code change or a rerun.

Failed checks

leave330 and others added 21 commits July 13, 2026 19:33
…ict code

- commandNotFoundError now returns errs.NewAPIError(SubtypeNotFound, ...)
  instead of a validation error: a resolution miss against the live list
  means the resource doesn't exist, not that the caller's argument shape
  was invalid.
- The no-force name-collision rewrap in +slash-command-create now carries
  over the original Code/LogID from the upstream conflict response instead
  of dropping them.
- +slash-command-delete now prints an extra stderr note that recreating the
  same command name yields a NEW command_id.
- Add a test guarding that --force only converts a name-collision response
  into an update; any other POST failure (e.g. invalid icon_key) must
  surface unchanged with no PATCH attempted.
Pin the dry-run request shapes for +slash-command-list/create/update/delete
(GET/POST/PATCH/DELETE paths, top-level icon key sibling to description,
description.i18n) and confirm the high-risk-write delete path exits 10 with
a confirmation_required envelope on stderr when --yes is omitted.
@liangshuo-1
liangshuo-1 force-pushed the feat/application-slash-command branch from 41ea383 to cbf7111 Compare July 13, 2026 11:39
@liangshuo-1
liangshuo-1 merged commit fc8d212 into main Jul 13, 2026
32 of 36 checks passed
@liangshuo-1
liangshuo-1 deleted the feat/application-slash-command branch July 13, 2026 12:43
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 13, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 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