← Về thư mục
📄 / / root / .hermes / skills / operate / lark-task-hub / SKILL.md

name: lark-task-hub description: Setup and manage a high-fidelity Task Hub on Lark Base following exacting IT BA standards for executive operations.


Lark Task Hub — IT BA Standard Management

1. Naming Convention (Strict — DO NOT deviate)

Task ID Format: [DEPT_CODE.SEQ] Subject + CRUD + Object

Correct: - [IT.01] IT Tạo và thiết lập Task Hub ✓ - [RD.01] R&D Nghiên cứu chính sách du lịch ✓ - [IT.03] IT Tích hợp NotebookLM CLI

Incorrect: - [P1.01][AIOS][TASK-HUB][IT-AI] CEO duyệt... ✗ - [DH.01] Điều hành... ✗ (DH is not an approved dept code)

Sub-record Task ID: [DEPT_CODE.SEQ.SUB]

Example: [IT.01.01], [IT.03.01]

Sub-record Task Name

Same CRUD format, shorter — the sub-record name IS the to-do item: - [IT.01.01] Deadline field chuyển từ text sang datetime ✓ - [IT.03.01] User copy cookie từ Chrome ✓ - [DH.01.01] Chuyển Deadline... ✗ (wrong prefix)

⚠️ CRITICAL — User rejected these old patterns

2. Approved Field Schema (Dual-Status Configuration)

Trường Status đã được tách làm 2 trường riêng biệt từ ngày 11/07/2026:

Field Name Type Notes
Task ID Text (primary) Replaces both ID and name. NO separate "Task" field.
Status Select Thực thi dự án: Draft, In progress, Blocked, Done
Handoff Status Select Giao vận giữa các phòng: Ready for handoff, Handed off, Accepted, Reported, Revised, Cancelled
Priority Select P0, P1, P2, P3
Phòng gửi Select (single) Exactly the 5 real departments (§5). No extra depts.
Phòng nhận Select (multi) Multi-select — allows assigning to multiple departments simultaneously. Same 5 options as Phòng gửi.
Loại việc Select Kịch bản, Audit, SEO, Nghiên cứu, Phát triển, Báo cáo, Họp, Khác
Deadline DateTime ⚠️ MUST be datetime not text. Format yyyy/MM/dd.
Note Text (long) Mission description of the task (one paragraph). NOT a log/update.
Output mong muốn Text Desired deliverable / definition of done.
Parent items Link (self) Self-referencing link to same table — enables sub-record hierarchy (§3).

Fields in active use:

Fields to NEVER include (explicitly rejected):

Pitfall: User may edit schema directly on Lark Base UI

If the user says "I edited manually" — trust their edit. Do NOT try to "fix" their schema back. Confirm what they changed, then update supporting code (handoff.py, auto_accept_worker.py) to match.

3. Sub-Record Pattern (CRITICAL — single-table hierarchy)

NEVER create a separate "To-do List" table. Use self-referencing links within the same table.

Correct implementation:

  1. Add a Parent items field of type link pointing to the same table (self-referencing, bidirectional: true automatically by Lark).
  2. Create sub-tasks as new records in the same table.
  3. Set their Parent items field to the parent task's record_id.
  4. Lark Base UI renders this as an expandable tree (click > chevron → "Add Sub-record").
  5. The parent record's Kanban card shows a branch icon with sub-record count (e.g., ├ 3).

What user expects:

"đây mới là cách đúng, add sub-record cho task lớn, chứ ko phải là tạo thêm 1 field task, hay tạo 1 separate todo list"


4. Tooling & CLI Pitfalls (lark-cli)

Field Updates use full PUT semantics

+field-update replaces the entire field definition. - Always read current field first: lark-cli base +field-get --base-token X --table-id Y --field-id Z --as user - Then send the complete target state via --json.

Converting text → datetime

lark-cli base +field-get --base-token X --table-id Y --field-id "fldSjKYncp" --as user
lark-cli base +field-update --base-token X --table-id Y \
  --field-id "fldSjKYncp" --as user \
  --json '{"name":"Deadline","type":"datetime"}' --yes

Changing Select/Dropdown Options

Send the full list in one shot — API replaces entirely:

{
  "name": "Phòng gửi",
  "type": "select",
  "multiple": false,
  "options": [
    {"name": "IT & AI"},
    {"name": "R&D"},
    {"name": "Strategy & Marketing"},
    {"name": "Writers"},
    {"name": "Grill & QA"}
  ]
}

Multi-Select Conversion

To change a single-select to multi-select:

{
  "name": "Phòng nhận",
  "type": "select",
  "multiple": true,
  "options": [...same 5 depts...]
}

Avoiding Duplicate Records

+record-upsert creates a new record if --record-id is omitted (even if Task ID in JSON matches an existing record). - Update existing: --record-id "rec_xxx" --json '{"Status":"Done"}' - Create new: Omit --record-id.


5. Department Abbreviations & Real Departments (Nova Structure)

Only 5 departments exist — restructuring to "Nova" (Value Chain) completed 2026-07-11.

Code Full Name Role Thread ID
IT IT & AI Hạ tầng, Automation, Agent 18
RD R&D Nghiên cứu Policy, Market, Academic 14
SM Strategy & Marketing Chiến lược, phản biện, kế hoạch ND 12
WR Writers Sản xuất nội dung chi tiết 1591
GQ Grill & QA Entry QA + Exit QA (Sandwich) 20

Alias Mapping (for handoff.py)

MAPPING in handoff.py (canonical reference — Nova structure)

MAPPING = {
    "it-ai": {"name": "IT & AI", "chat_id": "-1003707758328", "thread_id": 18, "prefix": "IT"},
    "it": {"name": "IT & AI", "chat_id": "-1003707758328", "thread_id": 18, "prefix": "IT"},
    "r-d": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "rd": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "policy-lab": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "pl": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "research-inno": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "ri": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "rs": {"name": "R&D", "chat_id": "-1003707758328", "thread_id": 14, "prefix": "RD"},
    "strategy-marketing": {"name": "Strategy & Marketing", "chat_id": "-1003707758328", "thread_id": 12, "prefix": "SM"},
    "sm": {"name": "Strategy & Marketing", "chat_id": "-1003707758328", "thread_id": 12, "prefix": "SM"},
    "marketing": {"name": "Strategy & Marketing", "chat_id": "-1003707758328", "thread_id": 12, "prefix": "SM"},
    "mk": {"name": "Strategy & Marketing", "chat_id": "-1003707758328", "thread_id": 12, "prefix": "SM"},
    "writers": {"name": "Writers", "chat_id": "-1003707758328", "thread_id": 1591, "prefix": "WR"},
    "wr": {"name": "Writers", "chat_id": "-1003707758328", "thread_id": 1591, "prefix": "WR"},
    "grill-qa": {"name": "Grill & QA", "chat_id": "-1003707758328", "thread_id": 20, "prefix": "GQ"},
    "gq": {"name": "Grill & QA", "chat_id": "-1003707758328", "thread_id": 20, "prefix": "GQ"},
    "grill-brainstorm": {"name": "Grill & QA", "chat_id": "-1003707758328", "thread_id": 20, "prefix": "GQ"},
    "gb": {"name": "Grill & QA", "chat_id": "-1003707758328", "thread_id": 20, "prefix": "GQ"},
}

6. Kanban Status View Filter (Parent tasks only)

Kanban Status View (vewajUACw3) has a filter applied to keep the board clean:

{"conditions":[["Parent items","is_empty"]]}

This ensures sub-records do not show as separate cards on the Kanban board. They only display inside their parent task cards.


7. Code Update Checklist (when schema changes)

Whenever Lark Base field schema changes (add/remove/rename fields), update these files:

  1. /opt/ai-os/core/plugin/ai-os/handoff.py — update create_lark_task() field map and dynamic status values.
  2. /opt/ai-os/core/lib/auto_accept_worker.py — update schema references and check Handoff Status vs Status.
  3. /opt/ai-os/products/ceo/config/lark_schema.json — update schema anchor immediately.