Do Lark Task
Implement a NAS frontend ticket from a Lark or Feishu task and prepare PR work in nas-fe. Use when the user provides a Lark task, todo link, task GUID, or task id such as t127620 and asks to implement, fix, continue, or prepare PR work; create the PR only when the user explicitly asks or confirms the drafted PR.
Source: .agents/skills/do-lark-task/SKILL.md
Metadata
- name: do-lark-task
- version: 1.0.0
- bins: ["lark-cli"]
Content
Do Lark Task
Prerequisite: Read installed
lark-sharedbefore using Lark CLI commands, especially for auth, missing scopes, and split login.
Turn a Lark task into a reviewed nas-fe pull request. Treat the Lark task as product intent, the repo as implementation truth, and the PR as the deliverable.
Required Skills
Use installed upstream and repo skills:
lark-sharedfor auth, identity, and missing scopes.lark-taskfor reading task details.code-review,pr-description, orready-prfor PR readiness.fe-tech-designwhen the PR exceeds 1000 changed lines.self-test-docwhen QA handoff or large-risk FE work needs a self-test doc.
Lark CLI Pattern
Follow the lark-cli skill-maker priority:
- Use shortcuts or registered APIs first.
- Use
lark-cli schema <service.resource.method>before any raw registered API with unclear params. - Use
lark-cli api <METHOD> <path>only when no shortcut or registered API covers the operation.
Permissions
| Operation | Required scope |
|---|---|
| Read Lark task details | task:task:read |
| Resolve people by email/name | contact:user:search |
| Read linked docs when needed | docs:document.content:read or scope reported by lark-doc |
| Download task/doc media when needed | docs:document.media:download |
| Create tech design or self-test docs | See fe-tech-design and self-test-doc |
Preflight
Before reading Lark:
command -v lark-cli
lark-cli auth status
Handle results:
- If
lark-cliis missing, stop Lark intake and ask the user to install/configure it. Continue only with repo-local work if enough context was provided. - If user identity is unavailable, task reads cannot proceed. Use
lark-sharedsplit auth fortask:task:read. - If bot identity is unavailable, ignore bot paths; this workflow should prefer
--as userfor task reads. - If user identity needs refresh, continue with the read command; if refresh fails, follow
lark-shared. - If a command reports
_notice.update, finish the current request. Mention the update notice in the final report, but do not run update commands automatically.
Resolve The Task
- If the user provides a Lark todo/task applink, extract the
guidquery parameter and use it astask_guid. - Do not use
suite_entity_numas the API GUID. Keep it as the human task id for branch, commit, and PR context. - Fetch task details:
lark-cli task tasks get --as user --params '{"task_guid":"<guid>","user_id_type":"open_id"}'
- Capture title, description, task id, task URL, status, assignee, members, attachments, related docs, Figma links, Sentry links, and any available comments/discussion.
- If images or attachments are inaccessible, continue from text and repo context unless the missing visual blocks implementation.
Analyze Before Editing
- Convert the task into acceptance criteria and open questions.
- Search the repo for product terms, route names, components, hooks, contexts, services, and tests.
- Classify the FE risk area:
- checkout/payment: displayed amount, provider amount, discounts/trials, saved methods, Apple Pay/Stripe/Ebanx/Razorpay
- auth: redirects, token refresh, 401/403, protected routes, sensitive storage/logging
- membership/settings: active tiers, disabled tiers, tier order, approval/questions, share links, member state
- public route/metadata: link previews, ISR/SSR/static behavior, invalid slugs or ids
- Magic Content/AI: asset state, polling, credits, provider errors, media rendering
- portal/dashboard: loading, permissions, empty states, tables/cards, mobile layout
- localization: use keys/placeholders only; never edit locale files
- shared UI/NPL: existing components, Tailwind/classNames, accessibility
- Identify routes/screens, API expectations, Figma/assets, localization keys/placeholders, QA cases, and risk notes that affect the implementation.
- Identify the smallest safe implementation plan.
- Do not stop at a proposal unless the user asked for planning only.
Branch And Worktree
Start from latest develop unless the user specifies another base.
Rules:
- Preserve existing local work.
- Never use
git reset --hard, destructive checkout, or branch deletion unless explicitly requested. - Prefer a separate worktree when the current checkout is dirty, on the wrong branch, or contains unrelated work.
- Follow
.agents/references/implementation/worktree-assignment.mdfor worktree and branch naming. - After creating a new worktree, copy local
.envand.env.*files from the source checkout into the new worktree before running app commands. - Use
feat/<feature-name>/<task-id>when the task comes from a PRD or proper large feature brief. - Use
adhoc/<feature-name>/<task-id>when no PRD was provided.
Typical fresh worktree flow for a PRD-backed feature:
git fetch origin develop
git worktree add ../<feature-name>-<task-id> -b feat/<feature-name>/<task-id> origin/develop
rsync -av --include='.env' --include='.env.*' --exclude='*' ./ ../<feature-name>-<task-id>/
For a direct task without a PRD, use the same worktree path pattern with -b adhoc/<feature-name>/<task-id>.
If already on the correct clean task branch, inspect whether it is based on latest origin/develop and update only with non-destructive commands.
Implement
- Match existing
nas-fepatterns and ownership boundaries. - Keep changes narrowly scoped to the task.
- Prefer existing helpers, types, contexts, services, and components.
- Follow all
.agents/rules/*. - Avoid unsafe
as,any, unnecessaryuseEffect, gratuitoususeCallback, inline styles, and unrelated formatting churn.
Verify
Run the smallest meaningful checks first:
- targeted
bunx eslint <changed paths>for changed TS/JS/TSX/JSX files - focused Jest tests when nearby tests exist
- browser verification for visual, route, checkout, auth, metadata, or user-flow behavior when practical
bun run buildfor SSR/page/shared-risk changes when targeted checks are insufficient
If a check fails because of unrelated existing issues, record the exact command, failure summary, and why it is unrelated.
PR
- Inspect
git statusandgit diff; ensure only intended files changed. - Commit only when the user explicitly asked to commit or confirms the proposed commit. If committing, use a concise message referencing the task id when available.
- Push only when the user explicitly asked to push or confirms the branch should be pushed.
- If the user already asked to create/open a PR in the current request, open a PR against
developunless the task or repo context requires another base. - If the user did not explicitly ask to create/open a PR, stop before PR creation. Return the proposed base branch, head branch, title, body summary, verification results, and ask for approval.
- Use
pr-descriptionorready-pronly after a PR exists or the user confirms PR creation, so the PR body includes:- Lark task link and task id
- problem summary
- implementation summary
- verification performed
- tech design and self-test links when created
- known limitations or follow-up
If additions plus deletions exceed 1000 lines, create a Lark tech design with fe-tech-design before marking the PR ready.
Close The Loop
Report:
- branch
- PR URL
- task link/id
- changed files summary
- verification results
- created tech design or self-test docs
- any missing auth, scope, env, or QA evidence
Do not mark the Lark task complete, assign it, or comment on it unless the user explicitly asks for that Lark write and the required write scope is available.