chore: clear lark-slides sync changes#1862
Conversation
📝 WalkthroughWalkthroughLark Slides documentation now defines stricter generation, template, visual planning, asset fallback, chart, whiteboard, icon, and XML schema rules. Template overlap lint tests now discover and validate all XML templates in the assets directory. ChangesLark Slides guidance and validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@ff05e8ad21f6f17b9c2ef4eaf8d1673266a804db🧩 Skill updatenpx skills add larksuite/cli#chore/sync-lark-slides-0706 -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1862 +/- ##
=======================================
Coverage 74.51% 74.51%
=======================================
Files 871 871
Lines 90876 90876
=======================================
Hits 67720 67720
Misses 17888 17888
Partials 5268 5268 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b7f6616 to
d1fae52
Compare
There was a problem hiding this comment.
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-slides/references/lark-slides-whiteboard.md`:
- Around line 53-57: The Mermaid type table in the whiteboard documentation is
out of sync with the authoritative schema. Remove the erDiagram and journey
entries from the applicable Mermaid types, including the entries near the
symbols shown in the diff, so the documentation matches
slides_xml_schema_definition.xml’s supported scenarios.
In `@skills/lark-slides/references/planning-layer.md`:
- Line 195: Update the adoption-trend chart entry’s fallback_if_missing guidance
to prohibit fabricated or unlabeled measurements. Specify that the fallback must
use a clearly labeled illustrative/mock chart or a qualitative XML-native
placeholder without invented data values.
In `@skills/lark-slides/scripts/xml_text_overlap_lint_test.py`:
- Around line 36-45: Guard
test_xml_text_overlap_lint_accepts_all_template_xml_files against a missing or
empty TEMPLATES_DIR glob by skipping the test when no XML templates are
available, or ensure the required template fixtures are restored. Preserve the
existing lint assertions when template_paths contains files.
In `@skills/lark-slides/SKILL.md`:
- Line 19: Revise the auto-fit guidance at skills/lark-slides/SKILL.md:19-19,
skills/lark-slides/SKILL.md:116-116, and
skills/lark-slides/references/visual-styles.md:40-40 so text is first shortened,
split, or moved during planning and readability is validated before using
auto-fit; describe auto-fit as a last-resort safeguard rather than a mandatory
default.
🪄 Autofix (Beta)
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
Run ID: 9c4a43cd-60fe-4517-8bcd-d5d6224d4c6a
📒 Files selected for processing (11)
skills/lark-slides/SKILL.mdskills/lark-slides/references/asset-planning.mdskills/lark-slides/references/iconpark.mdskills/lark-slides/references/lark-slides-whiteboard.mdskills/lark-slides/references/planning-layer.mdskills/lark-slides/references/slides_xml_schema_definition.xmlskills/lark-slides/references/visual-planning.mdskills/lark-slides/references/visual-styles.mdskills/lark-slides/references/xml-format-guide.mdskills/lark-slides/references/xml-schema-quick-ref.mdskills/lark-slides/scripts/xml_text_overlap_lint_test.py
| | 饼图 | `pie` | | ||
| | 甘特图 | `gantt` | | ||
| | 状态图 | `stateDiagram-v2` | | ||
| | 思维导图 | `mindmap` | | ||
| | ER 图 | `erDiagram` | |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Schema removed ER diagrams and user journeys from Mermaid applicable scenarios, but this doc still lists them.
slides_xml_schema_definition.xml line 3021 (the authoritative XML protocol source per SKILL.md) now reads: "适用场景: 流程图、时序图、思维导图、类图、甘特图、饼图等结构化图表" — explicitly dropping "ER 图、用户旅程". However, this file still lists erDiagram (line 57) and journey (line 269) as supported Mermaid types. Since the schema is the single source of truth, either update this doc to remove those entries or update the schema to retain them.
Also applies to: 264-269
🤖 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-slides/references/lark-slides-whiteboard.md` around lines 53 -
57, The Mermaid type table in the whiteboard documentation is out of sync with
the authoritative schema. Remove the erDiagram and journey entries from the
applicable Mermaid types, including the entries near the symbols shown in the
diff, so the documentation matches slides_xml_schema_definition.xml’s supported
scenarios.
| - `{"asset_type":"architecture_diagram","purpose":"Explain component relationships.","suggested_query":"service architecture diagram","fallback_if_missing":"Draw a component diagram with grouped boxes, connector arrows, and short labels."}` | ||
| - `{"asset_type":"logo","purpose":"Identify the customer context.","suggested_query":"customer logo","fallback_if_missing":"Use a text label in a small badge."}` | ||
| - `{"asset_type":"chart","purpose":"Show adoption trend.","suggested_query":"monthly adoption trend chart","fallback_if_missing":"Render a native `<chart>` using the provided series when available; otherwise render a native `<chart>` with mock placeholder values and label it as 模拟数据,仅占位,待替换真实数据."}` | ||
| - `{"asset_type":"chart","purpose":"Show adoption trend.","suggested_query":"monthly adoption trend chart","fallback_if_missing":"Draw a simple trend line chart with axis labels and data points."}` |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not fabricate unlabeled chart data in the fallback.
For an adoption-trend chart with missing data, drawing a trend line with data points can be mistaken for real measurements. Use a clearly labeled illustrative/mock chart, or render a qualitative XML-native placeholder without invented values.
Proposed wording
- "fallback_if_missing":"Draw a simple trend line chart with axis labels and data points."
+ "fallback_if_missing":"Render a clearly labeled illustrative trend diagram without implying real measurements."📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - `{"asset_type":"chart","purpose":"Show adoption trend.","suggested_query":"monthly adoption trend chart","fallback_if_missing":"Draw a simple trend line chart with axis labels and data points."}` | |
| `{"asset_type":"chart","purpose":"Show adoption trend.","suggested_query":"monthly adoption trend chart","fallback_if_missing":"Render a clearly labeled illustrative trend diagram without implying real measurements."}` |
🤖 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-slides/references/planning-layer.md` at line 195, Update the
adoption-trend chart entry’s fallback_if_missing guidance to prohibit fabricated
or unlabeled measurements. Specify that the fallback must use a clearly labeled
illustrative/mock chart or a qualitative XML-native placeholder without invented
data values.
| def test_xml_text_overlap_lint_accepts_all_template_xml_files(self) -> None: | ||
| template_paths = sorted(TEMPLATES_DIR.glob("*.xml")) | ||
| self.assertTrue(template_paths) | ||
| for template_path in template_paths: | ||
| with self.subTest(template=template_path.name): | ||
| result = xml_text_overlap_lint.lint_xml( | ||
| sample_xml, | ||
| sample_name, | ||
| template_path.read_text(encoding="utf-8"), | ||
| str(template_path), | ||
| ) | ||
| self.assertNoXmlTextOverlapLintIssues(result, sample_name) | ||
| self.assertNoXmlTextOverlapLintIssues(result, template_path) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether the templates directory exists and contains XML files
TEMPLATES_DIR="skills/lark-slides/assets/templates"
if [ -d "$TEMPLATES_DIR" ]; then
count=$(find "$TEMPLATES_DIR" -name '*.xml' | wc -l)
echo "Directory exists. XML file count: $count"
find "$TEMPLATES_DIR" -name '*.xml' -exec echo " {}" \;
else
echo "MISSING: $TEMPLATES_DIR does not exist"
fiRepository: larksuite/cli
Length of output: 211
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="skills/lark-slides/scripts/xml_text_overlap_lint_test.py"
echo "--- file outline ---"
ast-grep outline "$file" --view expanded || true
echo "--- relevant lines ---"
sed -n '1,120p' "$file"Repository: larksuite/cli
Length of output: 6509
Guard the template-XML smoke test This will fail until skills/lark-slides/assets/templates exists and contains at least one *.xml file; self.assertTrue(template_paths) trips on the empty glob. Add a skip/fixture guard or restore the templates before merging.
🤖 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-slides/scripts/xml_text_overlap_lint_test.py` around lines 36 -
45, Guard test_xml_text_overlap_lint_accepts_all_template_xml_files against a
missing or empty TEMPLATES_DIR glob by skipping the test when no XML templates
are available, or ensure the required template fixtures are restored. Preserve
the existing lint assertions when template_paths contains files.
|
|
||
| **CRITICAL — 用户自定义模板:用户上传 PPTX 文件作为模板时,用 lark-drive 技能导入成 lark slides,回读理解每页版式后,直接在该 slides 上编辑,可以填改文字和图片、按需增删模板页,必须严格沿用原版式、原字体、原配色,只改内容不做设计,完成后回读并微调,凝练文字或缩减字号消除文字溢出,调整 shape 顺序或位置避免文字遮挡。** | ||
|
|
||
| **CRITICAL — 防文本溢出:所有承载突出信息和密集文字的 `<content>` 必须设置 `autoFit="normal-auto-fit"`,字号会在框内自动缩排以防溢出。** |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Make auto-fit a last-resort safeguard, not the default text strategy.
The same mandatory shrink-to-fit rule appears in all three locations and conflicts with the planning contract that long text should be shortened, split, or moved before XML generation.
skills/lark-slides/SKILL.md#L19-L19: revise the global rule to require readability validation before auto-fit.skills/lark-slides/SKILL.md#L116-L116: apply the same last-resort wording to Doubao dense-card guidance.skills/lark-slides/references/visual-styles.md#L40-L40: keep the special-style rule consistent with the planning-layer policy.
📍 Affects 2 files
skills/lark-slides/SKILL.md#L19-L19(this comment)skills/lark-slides/SKILL.md#L116-L116skills/lark-slides/references/visual-styles.md#L40-L40
🤖 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-slides/SKILL.md` at line 19, Revise the auto-fit guidance at
skills/lark-slides/SKILL.md:19-19, skills/lark-slides/SKILL.md:116-116, and
skills/lark-slides/references/visual-styles.md:40-40 so text is first shortened,
split, or moved during planning and readability is validated before using
auto-fit; describe auto-fit as a last-resort safeguard rather than a mandatory
default.
d1fae52 to
ff05e8a
Compare
|
Closing this empty PR. |
Summary
No changes are included in this PR.
Changes
Test Plan
Related Issues