Skip to content

docs: improve task skill scoped resolution#1389

Open
zero-my wants to merge 1 commit into
larksuite:mainfrom
zero-my:codex/task-scope-resolution
Open

docs: improve task skill scoped resolution#1389
zero-my wants to merge 1 commit into
larksuite:mainfrom
zero-my:codex/task-scope-resolution

Conversation

@zero-my

@zero-my zero-my commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add a top-level task skill rule to prefer tasklist-scoped task lookup for "tasklist + task name" requests.
  • Update task completion workflow to list incomplete tasks from the target tasklist, exact-match by summary, complete the task, and verify it disappeared from the incomplete list.
  • Update task creation workflow to resolve assignee names from tasklist collaborators before global contact search.

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark-cli skills read lark-task flow works as expected

Manual verification:

  • make build
  • lark-cli skills read lark-task | rg "清单范围内定位任务优先|清单范围内解析负责人优先" -n
  • lark-cli skills read lark-task references/lark-task-complete.md | rg "tasklists tasks|global|tasks.get|completed:false" -n

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Updated tasklist operation guidance with improved scoping rules for task and assignee name matching
    • Expanded task completion workflow documentation with detailed step-by-step procedures, including pagination and verification steps
    • Enhanced task creation workflow documentation with comprehensive assignee resolution procedures, including confirmation prompts for ambiguous matches

@github-actions github-actions Bot added domain/task PR touches the task domain size/M Single-domain feat or fix with limited business impact labels Jun 10, 2026
@zero-my zero-my force-pushed the codex/task-scope-resolution branch from 6dcc174 to b956b3e Compare June 11, 2026 08:25
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Task and Assignee Resolution Guidance

Layer / File(s) Summary
Core resolution rules definition
skills/lark-task/SKILL.md
SKILL.md adds two foundational guidance rules: task name disambiguation within a specified tasklist (with fallback to global search) and assignee name resolution within a specified tasklist (with fallback to global user search and confirmation for ambiguous matches).
Task completion workflow with resolution
skills/lark-task/references/lark-task-complete.md
Workflow expands from minimal steps to detailed procedure for resolving the correct task GUID within a target tasklist using exact-name matching, pagination, and filtering, with constrained global fallback and post-completion verification.
Task creation workflow with assignee resolution
skills/lark-task/references/lark-task-create.md
Workflow adds assignee-resolution step when both tasklist-id and assignee name are provided, specifying candidate collection from tasklist context, scoped user search, exact-name preference, optional global fallback, and confirmation for ambiguous matches before execution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • tengchengwei

Poem

A CLI guide takes shape with tasklist care, 🐰
Resolve what's there before the leap you dare,
Exact matches first, then fallback's gentle way,
Confirm the ambiguous, and scope the day,
Clear workflows bloom where once was vague air. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: improve task skill scoped resolution' clearly and concisely summarizes the main change—improving documentation for scoped task and assignee resolution within specified tasklists.
Description check ✅ Passed The PR description includes all required template sections (Summary, Changes, Test Plan, Related Issues) with substantive detail. The Summary explains the motivation, Changes lists the main updates, and Test Plan documents both automated and manual verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch codex/task-scope-resolution

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 and usage tips.

@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.

🧹 Nitpick comments (3)
skills/lark-task/references/lark-task-create.md (2)

53-53: 💤 Low value

Optional: 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: use localized_name.
In skills/lark-task/references/lark-task-create.md (line 51), contact +search-user outputs the user’s name as JSON key localized_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 win

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f77ede and b956b3e.

📒 Files selected for processing (3)
  • skills/lark-task/SKILL.md
  • skills/lark-task/references/lark-task-complete.md
  • skills/lark-task/references/lark-task-create.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/task PR touches the task domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant