Skip to content

docs(base): restructure skill routing and analysis guidance - #2320

Open
zgz2048 wants to merge 26 commits into
larksuite:mainfrom
zgz2048:codex/base-filter-common-fewshots
Open

docs(base): restructure skill routing and analysis guidance#2320
zgz2048 wants to merge 26 commits into
larksuite:mainfrom
zgz2048:codex/base-filter-common-fewshots

Conversation

@zgz2048

@zgz2048 zgz2048 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • restructure the Base skill around the real resource tree: Base blocks, Table, Field, Record, View, Form, Dashboard, Workflow, advanced permissions, Docx, and Folder
  • make data-table analysis route through the analysis SOP, with base-block-list, typed NDJSON, predicate pushdown, rev reuse, jq/Python selection, and explicit NULL semantics
  • prefer batch record writes in skill guidance while keeping the public record-upsert shortcut available through its own help
  • align CellValue and filter examples with current OpenAPI shapes, including array-based Select values, Link/User/Group IDs, Location behavior, and common error recovery
  • compress low-frequency field documentation and remove tests that asserted prose contents instead of user-visible behavior

Why

The previous entry skill was a flat command catalog with important Base concepts and routing rules spread across references. Agents frequently over-read documentation, selected legacy single-record writes, confused Base blocks with dashboard blocks, repeated artifact checks, or treated low-frequency field details as the primary workflow.

This change makes the entry skill a compact resource map, keeps module-specific contracts in their references, and preserves the Base-specific facts that a database/data-analysis model cannot infer from generic SQL or DataFrame knowledge.

User and agent impact

  • first-time agents can resolve a Base URL or title, identify the target block type, and route to the correct module from one entry document
  • data analysis defaults to the existing typed NDJSON workflow and avoids unnecessary context expansion
  • record writes favor batch create/update, including the next step returned for record share URLs
  • field updates are documented as full PUT/read-modify-write operations
  • Base operations prefer user identity and switch to bot when permission issues occur or the user explicitly requests application identity
  • public shortcuts remain registered; this is a guidance and help cleanup, not an API removal

Validation

  • git diff --check
  • go test ./shortcuts/base/... ./internal/skillcontent/...
  • verified local Markdown references have no broken targets
  • PRE regression on the existing 5,000-row Base fixture covered default 2,000-row NDJSON export, predicate pushdown to 1,500 rows, manifest/stats/rev, record search/get, jq records, and multi-table Link joins
  • blind routing evaluations covered Dashboard content/config, Base+initial-table creation, batch record updates, Form read-modify-write, Workflow, advanced permissions, table-copy recovery, and identity selection

Experimental findings incorporated

  • exposing the internal 500-row page size caused agents to paginate manually, so the SOP documents the 2,000-row artifact contract instead
  • hard rules against loading large artifacts blocked required semantic/atomic inputs, so the SOP now narrows deterministic data first and loads original text when semantic reasoning requires it
  • repeated manifest and primary-key checks added cost without improving correctness, so the workflow trusts CLI completeness and Base-managed record_id guarantees
  • Polars/DuckDB-specific guides did not improve routing enough to justify their prompt cost; the retained examples focus on jq, Python stdlib, and pandas
  • non-actionable timeout budgeting and local Field configuration validation were removed; operational limits remain owned by the CLI/backend contracts

Summary by CodeRabbit

  • Documentation
    • Updated Lark Base guidance and examples for batch record creation and updates.
    • Replaced record-upsert recommendations and documentation with batch-update workflows.
    • Clarified array-valued select fields, full-replacement updates, default values, filtering, location fields, and read-only fields.
    • Added guidance for batching field creation, retrying partial failures, handling limits and conflicts, and validating asynchronous updates.
    • Improved filtering examples for text, people, groups, and empty values.
    • Reorganized guidance around Base Blocks, permissions, workflows, and resource discovery.
    • Clarified NDJSON record listing and search limits, including a maximum page size of 500.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR updates Base shortcut payloads and hints, upgrades the lark-base skill to version 1.2.6, revises field, record, filtering, and analysis references, removes obsolete guidance and contract tests, and adds NDJSON dry-run pagination coverage.

Changes

Base guidance alignment

Layer / File(s) Summary
Shortcut payload and hint updates
shortcuts/base/*
Hints and examples now use batch-update payloads, array-valued select cells, and array-based field creation. Record-share tests expect the batch-update hint.
Skill model and execution contract
skills/lark-base/SKILL.md
The skill now documents Base Blocks, entity resolution, module routing, asynchronous updates, delegated references, and shared execution rules.
Field schemas and updates
skills/lark-base/references/lark-base-field-*.md, skills/lark-base/references/lark-base-cell-value.md
Field references now document full-replacement updates, default preservation, rating limits, location behavior, creation retries, and conversion conditions.
Record operations and analysis references
skills/lark-base/references/lark-base-record-batch-*.md, skills/lark-base/references/lark-base-filter-condition.md, skills/lark-base/references/lark-base-data-analysis-sop.md
Record batching, filtering, export revision checks, error handling, serial writes, and conflict retries are updated. Obsolete upsert guidance is removed.
NDJSON dry-run pagination
shortcuts/base/record_ops.go, shortcuts/base/base_dryrun_ops_test.go
NDJSON record-list and record-search requests cap limits at 500 and use the v3 records endpoints in dry-run tests.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: ⚪ Minimal · up to 94eee

The change primarily restructures guidance while preserving the existing public shortcuts, and no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested labels: documentation

Suggested reviewers: zhouyue-bytedance

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main documentation restructuring and skill-routing changes.
Description check ✅ Passed The description provides a detailed summary, rationale, user impact, changes, and validation results; the missing template headings do not omit critical information.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added domain/base PR touches the base domain size/L Large or sensitive change across domains or core paths labels Aug 12, 2026
kongenpei
kongenpei previously approved these changes Aug 12, 2026
@zgz2048
zgz2048 marked this pull request as ready for review August 12, 2026 12:24

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

Actionable comments posted: 4

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

Inline comments:
In `@skills/lark-base/references/lark-base-data-analysis-sop.md`:
- Around line 63-65: Update the manifest reuse guidance in the batch extraction
workflow to always compare each manifest’s rev with the current table rev
whenever freshness affects correctness, rather than relying on elapsed time or
write frequency. Re-export the table when the revisions differ; if best-effort
reuse remains permitted, explicitly state that the reused result may be stale.

In `@skills/lark-base/references/lark-base-field-json.md`:
- Around line 431-436: 更新“+field-update”说明,明确完整 PUT
仅回写更新接口支持的可写属性;使用“+field-get”读取定义后,排除仅创建时支持的 dynamic_options_source
及其他只读属性,不要将这些字段传入更新请求。

In `@skills/lark-base/references/lark-base-field-update.md`:
- Around line 120-125: Update the blacklist exception guidance in the
field-update documentation to allow exceptions only for platform-explicitly
supported scenarios, while keeping blacklist restrictions effective for empty
columns and user-accepted data loss. Explicitly exclude link-type changes and
dynamic/static option-source switches from all exceptions.

In `@skills/lark-base/references/lark-base-record-batch-create.md`:
- Around line 54-58: Update the batch-create examples associated with the
visible status field `"状态":"Open"` so status CellValues use the established
array-valued shape, matching the shortcut help and regression-test contract.
Apply the correction to both occurrences around the examples near Lines 16 and
40, without changing unrelated fields or CLI behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 865d670c-51fb-467d-9ef1-535318520917

📥 Commits

Reviewing files that changed from the base of the PR and between 52ab2ea and 1b43a39.

📒 Files selected for processing (19)
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/base_resolve.go
  • shortcuts/base/base_resolve_test.go
  • shortcuts/base/base_shortcuts_test.go
  • shortcuts/base/base_skill_contract_test.go
  • shortcuts/base/data_query_guide_contract_test.go
  • shortcuts/base/field_create.go
  • shortcuts/base/record_batch_create.go
  • shortcuts/base/record_upsert.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-cell-value.md
  • skills/lark-base/references/lark-base-data-analysis-sop.md
  • skills/lark-base/references/lark-base-field-create.md
  • skills/lark-base/references/lark-base-field-json.md
  • skills/lark-base/references/lark-base-field-update.md
  • skills/lark-base/references/lark-base-filter-condition.md
  • skills/lark-base/references/lark-base-record-batch-create.md
  • skills/lark-base/references/lark-base-record-batch-update.md
  • skills/lark-base/references/lark-base-record-upsert.md
💤 Files with no reviewable changes (4)
  • skills/lark-base/references/lark-base-record-upsert.md
  • shortcuts/base/data_query_guide_contract_test.go
  • shortcuts/base/base_skill_contract_test.go
  • shortcuts/base/base_execute_test.go

Comment thread skills/lark-base/references/lark-base-data-analysis-sop.md Outdated
Comment thread skills/lark-base/references/lark-base-field-json.md
Comment on lines 120 to +125
只有在**整列数据丢失可接受**时,才允许对黑名单场景例外执行。

- `EmptyColumn`: 该列为空
- `FreshTableInit`: 新建空表初始化
- `PrimaryFieldBootstrap`: 主列不能删,只能更新完成初始化
- `ExplicitLossAccepted`: 用户明确接受整列数据丢失
1. 该列为空
2. 正在初始化新建的空表。
3. 主字段不能删除,需要通过更新完成初始化。
4. 用户明确接受整列数据丢失

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- target excerpt ---'
sed -n '90,140p' skills/lark-base/references/lark-base-field-update.md

printf '%s\n' '--- related guidance and references ---'
rg -n -C 3 '黑名单|link|动态|静态|选项来源|整列数据|数据丢失|字段类型|转换|CLI' \
  skills/lark-base/SKILL.md skills/lark-base/references \
  2>/dev/null | head -n 300

printf '%s\n' '--- files ---'
git ls-files 'skills/lark-base/**'

Repository: larksuite/cli

Length of output: 30299


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path

field_update = Path("skills/lark-base/references/lark-base-field-update.md").read_text()
field_json = Path("skills/lark-base/references/lark-base-field-json.md").read_text()

checks = {
    "field-update declares link as blacklist": "`link` 类型变更" in field_update,
    "field-update declares option-source changes as blacklist": "动态 / 静态选项来源切换" in field_update,
    "field-update grants broad blacklist exception": "允许对黑名单场景例外执行" in field_update,
    "field-json blocks link conversion": "link` 不允许转换为其他类型,其他类型也不能转换为 `link`" in field_json,
    "field-json disallows dynamic source on update": "dynamic_options_source` 仅创建支持;更新已有字段时不要传" in field_json,
}

for label, result in checks.items():
    print(f"{label}: {'PASS' if result else 'FAIL'}")

print("\n--- relevant field-update lines ---")
for number, line in enumerate(field_update.splitlines(), 1):
    if 105 <= number <= 130:
        print(f"{number}: {line}")

print("\n--- relevant field-json lines ---")
for number, line in enumerate(field_json.splitlines(), 1):
    if 230 <= number <= 242 or 359 <= number <= 364:
        print(f"{number}: {line}")
PY

printf '%s\n' '--- file diff summary ---'
git diff --stat -- skills/lark-base/references/lark-base-field-update.md

printf '%s\n' '--- target file diff ---'
git diff -- skills/lark-base/references/lark-base-field-update.md | sed -n '1,180p'

Repository: larksuite/cli

Length of output: 1640


保持黑名单限制有效。

空列或用户接受数据丢失不能覆盖不支持的转换。仅允许平台明确支持的场景例外,并明确排除 link 类型变更和动态/静态选项来源切换。

🤖 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-base/references/lark-base-field-update.md` around lines 120 -
125, Update the blacklist exception guidance in the field-update documentation
to allow exceptions only for platform-explicitly supported scenarios, while
keeping blacklist restrictions effective for empty columns and user-accepted
data loss. Explicitly exclude link-type changes and dynamic/static option-source
switches from all exceptions.

Comment on lines +54 to +58
- 单次最多 200 条;`1254104` 表示超过单批上限,拆成多个批次。
- `1254045` 表示字段不存在,重新 `+field-list` 后使用真实字段名或 `field_id`。
- `1254015` 表示 CellValue 类型不匹配,按真实 Field schema 和 CellValue 规范修正。
- 返回 `ignored_fields` / `READONLY` 时,从普通 Record 写入中移除 Formula、Lookup、系统字段和自动编号等只读字段。
- 同一 Table 连续批量写入使用串行执行;`1254291` 表示并发写冲突,短暂等待后重试当前批次。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Update the batch-create examples with the new CellValue shape.

The shortcut help uses array-valued status cells, but this reference still shows "状态":"Open" at Line 16 and Line 40. These status examples can cause agents to submit the wrong CellValue shape. Change them to array values, or rename the field to make it explicitly a text example.

As per coding guidelines, “Preserve established CLI behavior, tests, lint, CI, output contracts, and public APIs unless a breaking change is explicitly requested.” The supplied shortcut help and regression tests establish the array-valued select contract.

Proposed reference example fix
-  --json '{"create_records":[{"标题":"任务 A","状态":"Open"},{"标题":"任务 B","状态":"Done"}]}'
+  --json '{"create_records":[{"标题":"任务 A","状态":["Open"]},{"标题":"任务 B","状态":["Done"]}]}'

-{"create_records":[{"标题":"任务 A","状态":"Open"},{"标题":"任务 B","状态":"Done"}]}
+{"create_records":[{"标题":"任务 A","状态":["Open"]},{"标题":"任务 B","状态":["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-base/references/lark-base-record-batch-create.md` around lines 54
- 58, Update the batch-create examples associated with the visible status field
`"状态":"Open"` so status CellValues use the established array-valued shape,
matching the shortcut help and regression-test contract. Apply the correction to
both occurrences around the examples near Lines 16 and 40, without changing
unrelated fields or CLI behavior.

Source: Coding guidelines

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

♻️ Duplicate comments (1)
skills/lark-base/references/lark-base-field-json.md (1)

431-436: 🗄️ Data Integrity & Integration | 🟠 Major

Exclude creation-only and UI-only properties from the full PUT.

The +field-update guidance must limit full write-back to properties supported by the update API. This page states that dynamic_options_source is creation-only at Line 240 and that several properties are UI-only at Lines 241 and 339. Explicitly exclude those properties from the read-modify-write payload. Otherwise, the documented workflow can produce rejected update requests or inconsistent field definitions.

🤖 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-base/references/lark-base-field-json.md` around lines 431 - 436,
Update the +field-update guidance to exclude creation-only
dynamic_options_source and the UI-only properties identified in the field
documentation from the full PUT payload. In the read-modify-write workflow,
retain only properties supported by the update API while preserving the existing
supported field-definition attributes and --yes requirement.
🤖 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.

Duplicate comments:
In `@skills/lark-base/references/lark-base-field-json.md`:
- Around line 431-436: Update the +field-update guidance to exclude
creation-only dynamic_options_source and the UI-only properties identified in
the field documentation from the full PUT payload. In the read-modify-write
workflow, retain only properties supported by the update API while preserving
the existing supported field-definition attributes and --yes requirement.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 660612ae-868a-4971-8160-51e84fbf22a5

📥 Commits

Reviewing files that changed from the base of the PR and between 1b43a39 and 6dc567a.

📒 Files selected for processing (2)
  • skills/lark-base/references/lark-base-field-json.md
  • skills/lark-base/references/lark-base-field-update.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-base/references/lark-base-field-update.md

…ommon-fewshots

# Conflicts:
#	skills/lark-base/references/lark-base-filter-condition.md
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@181bb9d081469c209bd1429fb1e6d21c899d1c1d

🧩 Skill update

npx skills add zgz2048/cli#codex/base-filter-common-fewshots -y -g

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

Actionable comments posted: 1

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

Inline comments:
In `@shortcuts/base/base_dryrun_ops_test.go`:
- Around line 134-145: Add self-contained CLI-level dry-run E2E cases in
TestDryRunRecordOps for both NDJSON record-list and record-search paths, rather
than invoking dryRunRecordList or dryRunRecordSearch directly. Exercise shortcut
mounting, validation, and the CLI dry-run envelope while preserving assertions
for the expected endpoint and NDJSON query parameters.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7c250195-3c89-4a1d-9b1d-2b61a2b81f55

📥 Commits

Reviewing files that changed from the base of the PR and between 625af7d and 94eee52.

📒 Files selected for processing (2)
  • shortcuts/base/base_dryrun_ops_test.go
  • shortcuts/base/record_ops.go

Comment thread shortcuts/base/base_dryrun_ops_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants