lark-worklog
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLark Worklog
Lark 工作日志
Maintain a structured Lark spreadsheet as the source of truth for the user's work. Record todos and progress, preserve task context in linked documents, and keep the log current across days and months.
维护一个结构化的Lark电子表格作为用户工作的真实数据源,记录待办事项与进度,将任务上下文保存在关联文档中,并跨天、跨月保持日志的时效性。
Required official Lark skills
所需官方Lark技能
Require all four official skills:
- — authentication, identity, scopes, credential persistence, and error handling.
lark-shared - — title-based cloud search and resource discovery.
lark-drive - — workbook validation, sheet structure, cells, rich text, styles, and batch operations.
lark-sheets - — task-document creation, fetch, and surgical updates.
lark-doc
Before any Lark read or write, confirm that and all four skills are available in the current agent runtime. Load first, then load , , or before using that domain.
lark-clilark-sharedlark-drivelark-sheetslark-docIf the binary or any required skill is unavailable, stop the work-log operation. Tell the user that depends on the official LarkSuite CLI skill set and direct them to the official installation guide. Recommend exactly:
lark-worklogbash
npx @larksuite/cli@latest installThen explicitly offer to follow the official guide and perform the installation and verification for the user. Ask whether they want you to do that now, and do not run the installer until they agree. After installation, ask the user to reload the agent so the official skills become discoverable. Once the dependencies exist, use their documented operations and follow for configuration and authorization.
lark-shared需要以下四项官方技能:
- — 身份验证、身份识别、权限范围、凭证持久化及错误处理。
lark-shared - — 基于标题的云端搜索与资源发现。
lark-drive - — 工作簿验证、表格结构、单元格、富文本、样式及批量操作。
lark-sheets - — 任务文档的创建、获取与精准更新。
lark-doc
在执行任何Lark读写操作前,确认当前Agent运行环境中已安装及上述四项技能。先加载,再在使用对应领域功能前加载、或。
lark-clilark-sharedlark-drivelark-sheetslark-doc若二进制文件或任何所需技能不可用,立即终止工作日志操作。告知用户依赖官方LarkSuite CLI技能集,并引导他们查看官方安装指南。推荐执行以下命令:
lark-worklogbash
npx @larksuite/cli@latest install随后明确提出可协助用户遵循官方指南完成安装与验证,询问用户是否需要立即执行此操作,且需在用户同意后再运行安装程序。安装完成后,要求用户重新加载Agent,使官方技能可被识别。依赖项就绪后,使用其文档化操作,并遵循进行配置与授权。
lark-sharedStart or resume a work-log conversation
启动或恢复工作日志会话
-
On the first work-log request in a conversation, check the required dependencies above. Reuse that dependency check while the runtime remains unchanged.
-
Reuse the selected workbook from the current conversation when one has already been found. Keep its title, URL or token, and the selecting user identity only in conversation context. Do not call Drive search again in that conversation unless the user explicitly asks to rediscover or switch targets. If the reused target becomes inaccessible or invalid, stop and report it instead of silently searching for another workbook.
-
Only when the conversation has no selected target, loadand search as the authenticated user for spreadsheet titles containing the literal, case-sensitive marker
lark-drive:[worklog]bashlark-cli drive +search --query '[worklog]' --only-title \ --doc-types sheet --created-by-me --page-size 20 --as user --format json -
Treatas original-creator semantics: only spreadsheets created by the current logged-in user qualify, even if ownership later changed. Keep only results whose returned title actually contains the literal, case-sensitive substring
--created-by-me; search matching is broader than this final check. Preserve API result order. If necessary, follow[worklog]until a second exact match is found or results are exhausted.page_token -
If no exact match exists, ask for authorization to createas the current user. If the user explicitly requests another spreadsheet, validate its creator, title marker, and structure before selecting it for the current conversation. A supplied link is never persisted locally.
工作日志 [worklog] -
If exactly one match exists, select it for the rest of the conversation.
-
If multiple matches exist, select the first exact match in API result order for the rest of the conversation, but tell the user which title and URL were selected and warn: stable behavior requires exactly one spreadsheet whose title contains. Never silently switch to a later result because the first is malformed or inaccessible.
[worklog] -
Load, resolve the selected result, and inspect its structure. If it differs from the reference format, assess whether the task and required cells can still be mapped unambiguously. Continue with a compatible interpretation when no destructive reshaping is needed. If the meaning is ambiguous or the requested operation requires conversion, describe the mismatch and ask whether to convert the workbook or create a compliant one. Never reshape it without explicit authorization.
lark-sheets -
Compute the current work-log date from the Agent process's local clock:bash
node <skill-directory>/scripts/worklog-rules.cjs date -
Read references/worklog-format.md. Run monthly and daily preflight when the conversation has not prepared this workbook for today's local date, when the date or month changed, or after a structural failure. Otherwise use the same-day fast path and read only the cells needed for the request.
-
When preflight detects that a month or date rollover is required, immediately tell the user that the structural rollover and verification can make this request a little slower than an ordinary update, reassure them that work is continuing, and then proceed without asking for redundant permission.
-
Re-read the current sheet after preflight. Treat live workbook metadata and cells as the source of truth; never reuse row or column coordinates after a structural change.
-
会话中首次收到工作日志请求时,检查上述所需依赖项。若运行环境未发生变化,可复用该依赖项检查结果。
-
若当前会话已找到选定的工作簿,复用该工作簿。仅在会话上下文中保留其标题、URL或令牌,以及选择该工作簿的用户身份。除非用户明确要求重新查找或切换目标,否则在该会话中不再调用Drive搜索。若复用的目标变得不可访问或无效,需终止操作并上报,而非静默搜索其他工作簿。
-
仅当会话中未选定目标时,加载,以已认证用户身份搜索标题包含字面、大小写敏感标记
lark-drive的电子表格:[worklog]bashlark-cli drive +search --query '[worklog]' --only-title \ --doc-types sheet --created-by-me --page-size 20 --as user --format json -
将视为原始创建者语义:仅当前登录用户创建的电子表格符合条件,即使后续所有权发生变更。仅保留返回标题实际包含字面、大小写敏感子串
--created-by-me的结果;搜索匹配范围比最终检查更宽泛。保留API结果的顺序。如有必要,循环获取[worklog],直到找到第二个精确匹配项或结果耗尽。page_token -
若未找到精确匹配项,请求以当前用户身份创建。若用户明确指定另一电子表格,需先验证其创建者、标题标记及结构,再将其选定为当前会话的目标。提供的链接不会在本地持久化存储。
工作日志 [worklog] -
若仅找到一个匹配项,将其选定为该会话后续操作的目标。
-
若找到多个匹配项,选定API结果顺序中的第一个精确匹配项作为会话后续操作的目标,但需告知用户选定的标题与URL,并警告:稳定运行要求仅存在一个标题包含的电子表格。切勿因第一个结果格式错误或不可访问而静默切换至后续结果。
[worklog] -
加载,解析选定的结果并检查其结构。若与参考格式不符,评估是否仍能明确映射任务与所需单元格。当无需破坏性重构时,采用兼容的解释方式继续操作。若含义模糊或请求的操作需要转换,需描述不匹配之处,并询问用户是转换工作簿还是创建符合规范的新工作簿。未经明确授权,切勿对其进行重构。
lark-sheets -
根据Agent进程的本地时钟计算当前工作日志日期:bash
node <skill-directory>/scripts/worklog-rules.cjs date -
阅读references/worklog-format.md。若会话未针对当前本地日期准备好该工作簿、日期或月份已变更,或发生结构故障,需执行月度与每日预检。否则使用当日快速路径,仅读取请求所需的单元格。
-
若预检发现需要切换月份或日期,立即告知用户结构切换与验证会使本次请求比普通更新稍慢,向用户确认工作仍在进行,无需额外请求权限即可继续操作。
-
预检完成后重新读取当前表格。将工作簿的实时元数据与单元格作为真实数据源;结构变更后切勿复用之前的行或列坐标。
Fast path within one conversation
同一会话内的快速路径
- Reuse the selected workbook identity without Drive search.
- After a successful preflight, remember the prepared local date and current-month sheet ID in conversation context. If both still match, skip workbook discovery and rollover checks.
- Reuse a task title/alias-to-row index until a row insertion, row deletion, task identity edit, target switch, or structural failure invalidates it. Before writing, read each targeted cell and confirm that its title or mention token still matches; refresh column A only on mismatch.
- For explicit row requests, read those rows directly. For multiple status updates, use one contiguous , one
+cells-get, and one verification read; read references/status-updates.md.+cells-set --writes - Treat complete target-cell content as a write precondition. After every , inspect
+cells-get,warning_message,truncated, andhas_morewhen present. If the result is incomplete, narrow the range or continue the read until every target cell is complete; never transform or write from a clipped value or partialcompletearray.rich_text - Consolidate independent sheet ranges into the fewest supported read calls. Do not run an explicit auth-status call before every business command; follow only when authentication actually needs diagnosis.
lark-shared
- 复用选定的工作簿标识,无需再次进行Drive搜索。
- 预检成功后,在会话上下文中记录已准备好的本地日期与当前月份表格ID。若两者仍匹配,跳过工作簿发现与切换检查。
- 复用任务标题/别名到行索引的映射,直到发生行插入、行删除、任务标识编辑、目标切换或结构故障导致映射失效。写入前,读取每个目标单元格并确认其标题或提及令牌仍匹配;仅在不匹配时刷新A列。
- 对于明确的行请求,直接读取对应行。对于多个状态更新,使用一次连续的、一次
+cells-get和一次验证读取;阅读references/status-updates.md。+cells-set --writes - 将目标单元格的完整内容视为写入前置条件。每次后,检查是否存在
+cells-get、warning_message、truncated和has_more字段。若结果不完整,缩小范围或继续读取,直到所有目标单元格内容完整;切勿基于截断值或部分complete数组进行转换或写入。rich_text - 将独立的表格范围合并为最少的支持读取调用。无需在每次业务命令前执行明确的授权状态检查;仅在实际需要诊断身份验证问题时遵循的要求。
lark-shared
Interpret user input
用户输入解析规则
- Put unassigned fragments in row 2 ().
杂项 - Resolve task references against the primary title and values read from column A.
别名: - Accept a unique title or alias match. For an uncertain match, present at most three likely tasks and wait for confirmation; then add the user's expression as an alias.
- Use one logical daily item per line:
- — open todo
[] - — completed item
[x] - — progress or context that should carry to the next day
[~]
- Treat task-level completion separately from daily items. Add
[x]only when the user explicitly completes the whole task.状态:已完成 - Use for a parked task. Retain suspended tasks during month rollover.
状态:挂起 - Keep links, PRDs, designs, decisions, and long-form context in the primary task document. Keep the daily sheet concise.
- 将未分配的零散内容放在第2行()。
杂项 - 根据从A列读取的主标题与值解析任务引用。
别名: - 接受唯一的标题或别名匹配。若匹配结果不确定,最多展示三个可能的任务并等待用户确认;随后将用户的表述添加为别名。
- 每行对应一个逻辑每日条目:
- — 未完成的待办事项
[] - — 已完成的条目
[x] - — 需要延续到次日的进度或上下文
[~]
- 将任务级完成状态与每日条目分开处理。仅当用户明确标记整个任务完成时,添加
[x]。状态:已完成 - 对暂停的任务使用。月份切换时保留暂停的任务。
状态:挂起 - 将链接、PRD、设计方案、决策内容及长篇上下文保存在主任务文档中,保持每日表格简洁。
Apply writes
写入操作规则
- Treat a clear maintenance request as authorization for its scoped Lark writes and automatic rollover. Ask again only for an ambiguous task, an inaccessible target, or a structural conversion that is not already explicit in the request.
- Follow the current instructions for every table operation, including style inheritance, stdin payloads, high-risk confirmation, and mandatory read-back verification.
lark-sheets - Read references/status-updates.md before changing aliases or statuses in rich-text task cells.
- Follow the current instructions for every task-document operation. Create the document before inserting a new task row, and update existing documents surgically rather than overwriting them.
lark-doc - Never assume a failed batch rolled back every successful child operation. Parse per-operation results, re-read affected ranges, and reconcile actual state before retrying.
- If document creation succeeds but a later sheet operation fails, retain and report that document URL. Resume with the same document; never create a duplicate or delete the first document automatically.
- 将明确的维护请求视为对其范围内Lark写入操作与自动切换的授权。仅在任务模糊、目标不可访问或结构转换未在请求中明确说明时,才需再次询问用户。
- 所有表格操作均遵循当前的说明,包括样式继承、标准输入 payload、高风险操作确认及强制回读验证。
lark-sheets - 在富文本任务单元格中修改别名或状态前,阅读references/status-updates.md。
- 所有任务文档操作均遵循当前的说明。插入新任务行前先创建文档,对现有文档进行精准更新而非覆盖。
lark-doc - 切勿假设批量操作失败时所有子操作已回滚。解析每个操作的结果,重新读取受影响的范围,在重试前协调实际状态。
- 若文档创建成功但后续表格操作失败,需保留并上报该文档URL。使用同一文档恢复操作;切勿自动创建重复文档或删除首个文档。
Respect boundaries
边界约束
- Represent task completion only with an explicit line. Preserve background styles during ordinary maintenance.
状态:已完成 - Never delete completed rows from an active month. Delete explicitly completed rows only from a newly copied month before creating its first current-month date column.
- Never copy an older month when the exact previous sheet is missing.
YYYYMM - Never create skipped daily columns; create only today's column from the latest prior populated date.
- Never modify A1. Leave it blank in a newly created workbook.
- Keep no persistent local configuration for this skill. Do not write a spreadsheet URL, timezone, document token, task content, or target-selection cache to disk. Conversation-local target reuse is required for speed and is discarded with the conversation. The official may persist its own authentication and application configuration according to
lark-cli; that state is external to this skill.lark-shared - Scope the preflight to work-log requests. This skill is not a scheduler and does not run before unrelated conversations.
- 仅使用明确的行表示任务完成。日常维护中保留背景样式。
状态:已完成 - 切勿从活跃月份的表格中删除已完成的行。仅在复制旧月份表格并创建其首个当月日期列前,删除明确标记为已完成的行。
- 若确切的上一个表格缺失,切勿复制旧月份表格。
YYYYMM - 切勿创建跳过的每日列;仅从最近的已填充日期开始创建当日列。
- 切勿修改A1单元格。新创建的工作簿中A1需保持空白。
- 不为该技能保存持久化本地配置。切勿将电子表格URL、时区、文档令牌、任务内容或目标选择缓存写入磁盘。会话内目标复用是为了提升速度,会随会话结束而丢弃。官方可根据
lark-cli的要求持久化自身的身份验证与应用配置;该状态独立于本技能。lark-shared - 预检仅针对工作日志请求。本技能并非调度器,不会在无关会话前运行。