Maintain and patch existing Lark/Feishu documents while preserving comments, highlights, citations, and newer remote edits. Use for iterative document updates, local-mirror sync, or durable project ownership; LoopX integration is optional.
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
This skill manages a Lark document as a durable project material, not as a one-off text-editing target. It is repository-neutral and works without LoopX. Project-specific document conventions come from the owning project.
A managed Lark document has four distinct surfaces:
.local/ directory.Do not collapse these surfaces. In particular, a local mirror is not automatically a Git artifact, and a registry entry stores lineage and authority, not the private body or raw source URL.
goal_id only when the project already uses LoopX for this material.loopx register-authority-source; do not rely on chat memory or a repository-
specific document catalog alone.<project-root>/.local/managed-lark-docs/<source-id>/ by default.git check-ignore -v before
writing. Stop if it is not ignored. Outside Git, use an owner-approved private
directory rather than a published or shared folder.docs/ path merely to
obtain a diff or registry entry.lark-doc before fetching or updating a document.lark-drive for comments, title metadata, permissions, and comment
anchor checks.lark-shared for identity, authentication, and missing scopes.loopx-doc-registry and LoopX integration.skill-creator and run its validator.If an official lark-* skill is absent, try the installed CLI
lark-cli skills read <skill-or-reference-path> for its bundled instructions.
If neither source is available, report the missing prerequisite and hold the
affected operation. Do not install tools, change authorization, or invent API
parameters merely to make this skill available.
Find the owning repository from the user's named project, target document
context, or current working directory. Reuse its current document policy and
choose a stable, public-safe source_id; keep private names and raw URLs only
in the local manifest. Do not pick a project from historical usage.
For a project already connected to LoopX, follow LoopX integration. Otherwise keep the private mirror and manifest without requiring a Goal or registry. Do not bootstrap or connect a project as a side effect of document editing.
Use this default layout:
<project-root>/.local/managed-lark-docs/<source-id>/
├── manifest.json
├── mirror.lark.md
└── drafts/ # only when a separate review draft is usefulThe mirror filename may use XML or another loss-aware format when Markdown
cannot represent the document faithfully. The manifest should contain only
local/private state and use a small contract such as the following. Omit
goal_id for projects without LoopX:
{
"schema_version": "managed_lark_doc_local_manifest_v0",
"source_id": "stable-source-id",
"goal_id": "owning-goal-id",
"boundary": "local_private",
"source_url": "raw private URL allowed only in .local",
"remote_revision": 12,
"remote_revision_observed_at": "ISO-8601 timestamp",
"mirror_path": ".local/managed-lark-docs/stable-source-id/mirror.lark.md",
"mirror_sha256": "sha256",
"mirror_status": "remote_readback_verified",
"git_policy": "ignored_local_only",
"conflict_rule": "Remote/current-code authority rule"
}After every remote update, refresh the revision, timestamp, digest, status, and any local supporting-artifact references. Do not copy raw private values from this manifest into LoopX's public-safe status or Git artifacts.
Before drafting or writing:
preserve, merge, ask_user, or
explicit_replace. Default to preserve or ask_user.When the remote revision is newer, it becomes the base for that sync. Do not overwrite it from an older local mirror.
Write for the reader, not as a work log:
.local and expose only generalized conclusions on
shareable surfaces.Use the target document's voice by default. Apply a personal style corpus such as CS-Notes only when the user requests it or the document family declares it. Sample enough representative writing to infer structure and rhythm; do not mechanically copy private phrasing.
Update mirror.lark.md first when the user wants a reviewable local diff. A
separate draft is optional and should be created only when:
For private documents, the review surface remains in .local; reviewability
does not require Git.
If the user asked only to draft, refine locally, or show a preview, stop before the Lark write. If the current request explicitly says to update/sync the Lark document, that is sufficient intent for the scoped write after freshness and boundary checks.
Summarize the planned sections, protected anchors, and unresolved ambiguity before a broad rewrite. Ask only when the ambiguity affects authorship, authority, privacy, or destructive replacement.
Read the official lark-doc update and format references for the installed CLI.
Fetch the affected XML with full detail before a preservation-sensitive edit.
Build a small patch plan from the current remote state and revision.
Use the observed base revision when the installed API supports it. If a write
reports a revision conflict, fetch and merge the new remote state before retrying.
Prefer, in order:
Never use a Markdown overwrite merely because it is convenient. A request to "sync", "polish", or "reorganize" does not authorize clearing the document. Native doc cites should remain cites; comments and marked text are not disposable formatting.
str_replace searches the whole document: verify every match and choose block
operations when the text is ambiguous or spans multiple blocks. Read back after
each patch round before planning another structural edit; replacement can
invalidate block IDs. A successful response is not proof that anchors survived.
Inspect partial_success, warnings, and actual remote state before retrying;
never replay a partially applied batch blindly.
Read references/comment-preserving-sync.md before changing content with
comments, highlights, manual emphasis, tables with review anchors, or native
Lark cites.
After writing:
Do not claim synced when only one section was updated while other mirror
sections remain local-only. Report a precise partial-sync status instead.
| Situation | Default location | Git? |
|---|---|---|
| Private/internal Lark body | project .local/managed-lark-docs/ | No |
| Raw URL/token/revision manifest | same ignored local directory | No |
| Redacted source identity and authority | project LoopX registry | Registry only |
| Generalized reusable conclusion | project docs, after boundary review | Explicit decision |
| Existing tracked document family | repository-declared path | Only if its profile and audience permit |
Before any tracked write, scan for internal actors, private links, raw tokens, credentials, local absolute paths, screenshots, and source bodies. If a private mirror was mistakenly committed, move the live mirror to the owning project's ignored local state, remove the current Git projection through a normal review change, and report that prior Git history still retains it. Never rewrite history without explicit owner approval and coordination.
建议改写, 给你 review, 这里应该, and
process narration from the final body.不是 X,而是 Y when a
positive statement is clearer.Report:
source_id;Do not expose raw private URLs, tokens, source bodies, credentials, or local private evidence in public summaries.
huangruiteng/CS-Notes
feda44a
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.