fix(base): unify --json help format with tips and agent hints#372
fix(base): unify --json help format with tips and agent hints#372
Conversation
There was a problem hiding this comment.
kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
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 (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
skills/lark-base/references/lark-base-view-set-group.md (1)
56-60:⚠️ Potential issue | 🟠 MajorJSON Schema now contradicts the new required object shape
The doc now teaches
--jsonas an object withgroup_config, but the schema still declares a top-level array. Please update the schema to match the new contract.🛠️ Proposed doc fix
-{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100,"description":"Field id or name"},"desc":{"type":"boolean","default":false,"description":"define how to sort group headers"}},"required":["field"],"additionalProperties":false},"minItems":0,"maxItems":3,"$schema":"http://json-schema.org/draft-07/schema#"} +{"type":"object","properties":{"group_config":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100,"description":"Field id or name"},"desc":{"type":"boolean","default":false,"description":"define how to sort group headers"}},"required":["field"],"additionalProperties":false},"minItems":0,"maxItems":3}},"required":["group_config"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@skills/lark-base/references/lark-base-view-set-group.md` around lines 56 - 60, The JSON Schema in this doc still defines a top-level array, but the code/docs now expect a top-level object containing a group_config property (used by the --json flag); update the schema to make the root an object with a required "group_config" property whose value is the existing array schema (items are the objects with "field" and optional "desc"), preserve additionalProperties as appropriate and keep the $schema declaration—ensure "group_config" is required and its schema carries the original minItems/maxItems and item structure.
🧹 Nitpick comments (1)
shortcuts/base/view_set_group.go (1)
23-23: Align--jsonhelp text with object-only guidance.At Line 23, the description still says
group JSON object/array, which contradicts the object-style guidance ({"group_config":[...]}) this PR is aiming to enforce in user-facing docs. Keep backward-compatible parsing in code, but make the help text object-only for consistency.Proposed wording update
- {Name: "json", Desc: `group JSON object/array, e.g. {"group_config":[{"field":"fldStatus","desc":false}]}; read skills/lark-base/references/lark-base-view-set-group.md`, Required: true}, + {Name: "json", Desc: `group JSON object, e.g. {"group_config":[{"field":"fldStatus","desc":false}]}; read skills/lark-base/references/lark-base-view-set-group.md`, Required: true},🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shortcuts/base/view_set_group.go` at line 23, Update the help text for the CLI flag with Name: "json" so it describes an object-only payload (not "object/array"); change the Desc string to say "group JSON object, e.g. {\"group_config\":[{\"field\":\"fldStatus\",\"desc\":false}]}; read skills/lark-base/references/lark-base-view-set-group.md" while leaving parsing logic unchanged elsewhere so backward-compatible array parsing still works.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@skills/lark-base/references/lark-base-view-set-group.md`:
- Around line 56-60: The JSON Schema in this doc still defines a top-level
array, but the code/docs now expect a top-level object containing a group_config
property (used by the --json flag); update the schema to make the root an object
with a required "group_config" property whose value is the existing array schema
(items are the objects with "field" and optional "desc"), preserve
additionalProperties as appropriate and keep the $schema declaration—ensure
"group_config" is required and its schema carries the original minItems/maxItems
and item structure.
---
Nitpick comments:
In `@shortcuts/base/view_set_group.go`:
- Line 23: Update the help text for the CLI flag with Name: "json" so it
describes an object-only payload (not "object/array"); change the Desc string to
say "group JSON object, e.g.
{\"group_config\":[{\"field\":\"fldStatus\",\"desc\":false}]}; read
skills/lark-base/references/lark-base-view-set-group.md" while leaving parsing
logic unchanged elsewhere so backward-compatible array parsing still works.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 66c54959-2734-4912-9943-b9f86532e7da
📒 Files selected for processing (10)
shortcuts/base/field_create.goshortcuts/base/field_update.goshortcuts/base/record_upsert.goshortcuts/base/view_create.goshortcuts/base/view_set_card.goshortcuts/base/view_set_filter.goshortcuts/base/view_set_group.goshortcuts/base/view_set_sort.goshortcuts/base/view_set_timebar.goskills/lark-base/references/lark-base-view-set-group.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@1d40188b9ca928d8973f60bff7af67aa13185e09🧩 Skill updatenpx skills add larksuite/cli#fix-table-help -y -g |
There was a problem hiding this comment.
kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Summary
Standardize Base shortcut
--jsonhelp output so it is easier for humans and agents to consume:Flag.Descshort and explicitShortcut.TipsAlso keep
+view-set-groupguide aligned with object-style payload (group_config) only.Changes
Desc: concise JSON type description onlyTips[0]:Example: --json '...'Tips[1]:Agent hint: use the lark-base skill's ... guide for usage and limits.+field-create,+field-update,+record-upsert+view-create,+view-set-card,+view-set-filter+view-set-group,+view-set-sort,+view-set-timebarskills/lark-base/references/lark-base-view-set-group.mdto use object payload examples and removed direct-array wording.Test Plan
go test ./shortcuts/base -run 'Test(Base|runShortcut|workflow)'Related Issues
Summary by CodeRabbit