docs: improve task skill scoped resolution#1389
Conversation
6dcc174 to
b956b3e
Compare
📝 WalkthroughWalkthroughThis PR updates documentation for the lark-task skill to establish consistent task and assignee resolution patterns. Two core rules are added to SKILL.md, then applied across task completion and creation workflows with detailed step-by-step procedures that handle fallback behavior and disambiguation. ChangesTask and Assignee Resolution Guidance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 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)
⚔️ Resolve merge conflicts
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
skills/lark-task/references/lark-task-create.md (2)
53-53: 💤 Low valueOptional: Rephrase to avoid repetitive sentence starts.
Three consecutive sentences begin with "If" which slightly reduces readability. Consider rewording for variety.
✍️ Suggested rephrase
- - If there is no exact match in the tasklist candidates, fallback to `lark-cli contact +search-user --query "<name>" --exclude-external-users --as user`. - - If global search returns multiple exact same-name users, ask the user to confirm by email or department before creating the task; do not choose the first result. + - When no exact match exists in the tasklist candidates, fallback to `lark-cli contact +search-user --query "<name>" --exclude-external-users --as user`. + - Should global search return multiple users with identical names, ask the user to confirm by email or department before creating the task; do not choose the first result.🤖 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-task/references/lark-task-create.md` at line 53, Reword the three consecutive sentences that all start with "If" — including the sentence "If global search returns multiple exact same-name users, ask the user to confirm by email or department before creating the task; do not choose the first result." — to improve variety and readability: change at least one sentence to start differently (e.g., "When global search returns...", "Ask the user to...", or combine clauses to reduce repetition), keep the same meaning and guidance, and ensure the block remains clear and concise in lark-task-create.md.
48-53: Confirm assignee name matching field: uselocalized_name.
Inskills/lark-task/references/lark-task-create.md(line 51),contact +search-useroutputs the user’s name as JSON keylocalized_name(LocalizedName ... \json:"localized_name"``), so the exact-match step is correct.
Optional style: the repeated “If” at the start of bullets in the snippet could be toned down.🤖 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-task/references/lark-task-create.md` around lines 48 - 53, The assignee-resolution step must match on the JSON field localized_name (not another name field); update the tasklist-scoped resolution logic that uses contact +search-user batching to compare candidates' localized_name to the requested name, prefer a single exact localized_name match and use that user's open_id, otherwise fall back to the global contact +search-user --query "<name>" --exclude-external-users --as user flow, and when global search returns multiple exact localized_name matches prompt for confirmation (email/department) instead of picking the first result.skills/lark-task/references/lark-task-complete.md (1)
30-30: ⚡ Quick winConsider making the verification command explicit.
The verification step instructs to "read the same tasklist's incomplete tasks again with
completed:false" but doesn't provide the explicit command. For consistency with line 25, consider adding the full command syntax here to avoid ambiguity.📝 Suggested clarification
-4. Verify completion by reading the same tasklist's incomplete tasks again with `completed:false`; confirm the completed task's `guid` or exact `summary` is absent. Optionally read `completed:true` or `tasks.get` to show the task is now done. +4. Verify completion by reading the same tasklist's incomplete tasks again with `lark-cli task tasklists tasks --as user --params '{"tasklist_guid":"<tasklist_guid>","completed":false,"page_size":100,"user_id_type":"open_id"}'`; confirm the completed task's `guid` or exact `summary` is absent. Optionally read with `completed:true` or use `tasks.get` to show the task is now done.🤖 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-task/references/lark-task-complete.md` at line 30, Add an explicit verification command similar to line 25: instruct the user to run the tasks.list command against the same tasklist with the completed flag set to false (e.g., use tasks.list with the tasklist identifier and completed=false) and confirm the completed task's guid or exact summary is absent; mention optionally running tasks.list with completed=true or tasks.get to show the task is now done.
🤖 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.
Nitpick comments:
In `@skills/lark-task/references/lark-task-complete.md`:
- Line 30: Add an explicit verification command similar to line 25: instruct the
user to run the tasks.list command against the same tasklist with the completed
flag set to false (e.g., use tasks.list with the tasklist identifier and
completed=false) and confirm the completed task's guid or exact summary is
absent; mention optionally running tasks.list with completed=true or tasks.get
to show the task is now done.
In `@skills/lark-task/references/lark-task-create.md`:
- Line 53: Reword the three consecutive sentences that all start with "If" —
including the sentence "If global search returns multiple exact same-name users,
ask the user to confirm by email or department before creating the task; do not
choose the first result." — to improve variety and readability: change at least
one sentence to start differently (e.g., "When global search returns...", "Ask
the user to...", or combine clauses to reduce repetition), keep the same meaning
and guidance, and ensure the block remains clear and concise in
lark-task-create.md.
- Around line 48-53: The assignee-resolution step must match on the JSON field
localized_name (not another name field); update the tasklist-scoped resolution
logic that uses contact +search-user batching to compare candidates'
localized_name to the requested name, prefer a single exact localized_name match
and use that user's open_id, otherwise fall back to the global contact
+search-user --query "<name>" --exclude-external-users --as user flow, and when
global search returns multiple exact localized_name matches prompt for
confirmation (email/department) instead of picking the first result.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 48c14f74-1b10-452a-9fdf-488b5a5a9d75
📒 Files selected for processing (3)
skills/lark-task/SKILL.mdskills/lark-task/references/lark-task-complete.mdskills/lark-task/references/lark-task-create.md
Summary
Improve the Lark task skill guidance for prompts that already provide a concrete tasklist scope, so agents resolve assignees and tasks inside that tasklist before falling back to global search.
Changes
Test Plan
lark-cli skills read lark-taskflow works as expectedManual verification:
make buildlark-cli skills read lark-task | rg "清单范围内定位任务优先|清单范围内解析负责人优先" -nlark-cli skills read lark-task references/lark-task-complete.md | rg "tasklists tasks|global|tasks.get|completed:false" -nRelated Issues
Summary by CodeRabbit