Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Univer CLI Skill
# Univer CLI Skills

![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)
![Skills](https://img.shields.io/badge/skills-1-0a7ea4.svg)
![Skills](https://img.shields.io/badge/skills-2-0a7ea4.svg)
![Support](https://img.shields.io/badge/support-Claude%20Code%20%7C%20Codex%20%7C%20Cursor-1f6feb.svg)
![OS](https://img.shields.io/badge/os-Linux%20%7C%20macOS-555.svg)

Languages: [English](./README.md) | [简体中文](./README.zh-CN.md)

The official Univer CLI Skill for Claude Code, Codex, and Cursor. Give your agent a `.univer`
file and describe the result you want; the Skill guides it through authoring, verification, and
visual review with Univer CLI.
The official Univer CLI Skills for Claude Code, Codex, and Cursor. Use them to operate `.univer`
content or integrate Univer CLI, Gateway, and Cowork into your own system.

Learn more about Univer at [univer.ai](https://univer.ai).

Expand All @@ -25,12 +24,21 @@ Learn more about Univer at [univer.ai](https://univer.ai).
a browser review link.
- **Exchange Excel files** — import and export `.xlsx` while keeping the working model in a
structured `.univer` file.
- **Build Univer-powered applications** — connect CLI processes, agent guidance, daemon/Gateway,
and Cowork UI to an existing host without prescribing the product shape.

## Choose a Skill

| Skill | Use it for |
| --- | --- |
| [`univer-cli`](./skills/univer-cli/SKILL.md) | Creating, inspecting, editing, verifying, importing, or exporting Univer content |
| [`integrate-univer-cli`](./skills/integrate-univer-cli/SKILL.md) | Selecting, acquiring, connecting, customizing, and delivering CLI/Gateway/Cowork components in a host system |

## Version-Matched Guidance

This repository installs the Univer CLI entry Skill. It guides agents to load core guidance and the
relevant Unit Skill from your installed CLI, keeping commands and Facade APIs aligned with that
version.
The `univer-cli` entry guides agents to load core guidance and the relevant Unit Skill from the
installed CLI, keeping commands and Facade APIs aligned with that version. The Builder integration
Skill uses the same installed CLI and package declarations as its operational authority.

The available Unit Skills cover Sheet, Doc, Slide, Base, and Board:

Expand Down Expand Up @@ -64,14 +72,17 @@ cd skills
# Claude Code
mkdir -p ~/.claude/skills
cp -R skills/univer-cli ~/.claude/skills/
cp -R skills/integrate-univer-cli ~/.claude/skills/

# Codex
mkdir -p ~/.codex/skills
cp -R skills/univer-cli ~/.codex/skills/
cp -R skills/integrate-univer-cli ~/.codex/skills/

# Cursor
mkdir -p ~/.cursor/skills
cp -R skills/univer-cli ~/.cursor/skills/
cp -R skills/integrate-univer-cli ~/.cursor/skills/
```

## Example Prompts
Expand All @@ -88,6 +99,10 @@ Use univer-cli to create a Board, insert a shape, and open the viewer for review
Use univer-cli to create a Base with a contacts table, add a record, and verify the stored model.
```

```text
Use integrate-univer-cli to add Univer content operations and an embedded Cowork Viewer to this application.
```

## Requirements

- Linux or macOS
Expand All @@ -96,7 +111,8 @@ Use univer-cli to create a Base with a contacts table, add a record, and verify

## Contributing

- The entry Skill lives at [`skills/univer-cli/SKILL.md`](./skills/univer-cli/SKILL.md).
- Content-operation discovery lives at [`skills/univer-cli/SKILL.md`](./skills/univer-cli/SKILL.md).
- Builder integration lives at [`skills/integrate-univer-cli/SKILL.md`](./skills/integrate-univer-cli/SKILL.md).
- Version-matched operational Skills and resources ship with the Univer CLI package.
- Run `npm run validate` before publishing Skill changes.

Expand Down
32 changes: 25 additions & 7 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Univer CLI Skill
# Univer CLI Skills

![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)
![Skills](https://img.shields.io/badge/skills-1-0a7ea4.svg)
![Skills](https://img.shields.io/badge/skills-2-0a7ea4.svg)
![Support](https://img.shields.io/badge/support-Claude%20Code%20%7C%20Codex%20%7C%20Cursor-1f6feb.svg)
![OS](https://img.shields.io/badge/os-Linux%20%7C%20macOS-555.svg)

语言: [English](./README.md) | [简体中文](./README.zh-CN.md)

面向 Claude Code、Codex 和 Cursor 的官方 Univer CLI Skill。把 `.univer` 文件交给 agent,并描述
期望的结果,Skill 会引导 agent 使用 Univer CLI 完成内容创作、结果验证和可视化检查
面向 Claude Code、Codex 和 Cursor 的官方 Univer CLI Skills。它们既可以引导 agent 操作
`.univer` 内容,也可以把 Univer CLI、Gateway 与 Cowork 集成到自己的系统

访问 [univer.ai](https://univer.ai) 了解 Univer。

Expand All @@ -20,11 +20,21 @@
- **使用开放画布** — 创建 Board 画布并添加可视化元素。
- **安全地与 agent 协作** — 使用 worktree 隔离修改、读回持久化模型,并交付浏览器 review 链接。
- **交换 Excel 文件** — 导入和导出 `.xlsx`,同时使用结构化 `.univer` 文件承载工作模型。
- **构建基于 Univer 的应用** — 在不预设产品形态的前提下,把 CLI 进程、Agent 指引、
daemon/Gateway 与 Cowork UI 接入已有宿主。

## 选择 Skill

| Skill | 适用场景 |
| --- | --- |
| [`univer-cli`](./skills/univer-cli/SKILL.md) | 创建、检查、编辑、验证、导入或导出 Univer 内容 |
| [`integrate-univer-cli`](./skills/integrate-univer-cli/SKILL.md) | 在宿主系统中选择、获取、连接、定制并交付 CLI/Gateway/Cowork 零部件 |

## 与 CLI 版本匹配的指引

这个仓库安装 Univer CLI 入口 Skill。它会引导 agent 从已安装的 CLI 加载 core 指引和对应的 Unit
Skill,使 command 和 Facade API 始终与当前版本一致。
`univer-cli` 入口会引导 agent 从已安装的 CLI 加载 core 指引和对应的 Unit Skill,使 command
和 Facade API 始终与当前版本一致。Builder 集成 Skill 同样以当前安装的 CLI 与 package
declarations 作为操作权威。

Unit Skills 覆盖 Sheet、Doc、Slide、Base 和 Board:

Expand Down Expand Up @@ -58,14 +68,17 @@ cd skills
# Claude Code
mkdir -p ~/.claude/skills
cp -R skills/univer-cli ~/.claude/skills/
cp -R skills/integrate-univer-cli ~/.claude/skills/

# Codex
mkdir -p ~/.codex/skills
cp -R skills/univer-cli ~/.codex/skills/
cp -R skills/integrate-univer-cli ~/.codex/skills/

# Cursor
mkdir -p ~/.cursor/skills
cp -R skills/univer-cli ~/.cursor/skills/
cp -R skills/integrate-univer-cli ~/.cursor/skills/
```

## 示例 Prompts
Expand All @@ -82,6 +95,10 @@ Use univer-cli to create a Board, insert a shape, and open the viewer for review
Use univer-cli to create a Base with a contacts table, add a record, and verify the stored model.
```

```text
Use integrate-univer-cli to add Univer content operations and an embedded Cowork Viewer to this application.
```

## 环境要求

- Linux 或 macOS
Expand All @@ -90,7 +107,8 @@ Use univer-cli to create a Base with a contacts table, add a record, and verify

## 参与贡献

- 入口 Skill 位于 [`skills/univer-cli/SKILL.md`](./skills/univer-cli/SKILL.md)。
- 内容操作 discovery 入口位于 [`skills/univer-cli/SKILL.md`](./skills/univer-cli/SKILL.md)。
- Builder 集成入口位于 [`skills/integrate-univer-cli/SKILL.md`](./skills/integrate-univer-cli/SKILL.md)。
- 与版本匹配的 operational Skills 和 resources 随 Univer CLI package 分发。
- 发布 Skill 变更前运行 `npm run validate`。

Expand Down
39 changes: 31 additions & 8 deletions scripts/validate-univer-skills.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const root = path.resolve(path.dirname(__filename), "..");
const skillsRoot = path.join(root, "skills");
const requiredSkills = ["univer-cli"];
const skillContracts = [
{ name: "univer-cli", hidden: true, entryOnly: true },
{ name: "integrate-univer-cli", hidden: false, entryOnly: false }
];
const requiredSkills = skillContracts.map(({ name }) => name);
const cliMirroredSkills = ["univer-cli"];
const removedWorkflowSkills = [
"using-univer-cli",
"writing-univer-plans",
Expand Down Expand Up @@ -88,7 +93,8 @@ async function collectMarkdownFiles(dirPath) {
}

async function validateSkillStructure() {
for (const skill of requiredSkills) {
for (const contract of skillContracts) {
const skill = contract.name;
const skillPath = path.join(skillsRoot, skill);
const skillFile = path.join(skillPath, "SKILL.md");
if (!existsSync(skillFile)) {
Expand All @@ -104,13 +110,23 @@ async function validateSkillStructure() {
if (!frontmatter.description || !frontmatter.description.startsWith("Use")) {
recordError(`skills/${skill}/SKILL.md: description must exist and start with "Use"`);
}
if (frontmatter.hidden !== "true") {
if (contract.hidden && frontmatter.hidden !== "true") {
recordError(`skills/${skill}/SKILL.md: discovery skill must be hidden`);
}
const entries = await fs.readdir(skillPath);
if (entries.length !== 1 || entries[0] !== "SKILL.md") {
if (!contract.hidden && frontmatter.hidden !== undefined) {
recordError(`skills/${skill}/SKILL.md: public builder skill must not be hidden`);
}
const entries = (await fs.readdir(skillPath)).sort();
if (contract.entryOnly && (entries.length !== 1 || entries[0] !== "SKILL.md")) {
recordError(`skills/${skill}: discovery skill directory must contain only SKILL.md`);
}
if (!contract.entryOnly) {
for (const entry of ["SKILL.md", "agents", "references"]) {
if (!entries.includes(entry)) {
recordError(`skills/${skill}: missing required ${entry}`);
}
}
}
}

reports.push(`structure: ${requiredSkills.length} official skills checked`);
Expand Down Expand Up @@ -275,13 +291,19 @@ async function realpathOrNull(filePath) {
}
}

async function validateExposureDirectory({ label, exposureRoot, failOnDrift, sourceRoot = skillsRoot }) {
async function validateExposureDirectory({
label,
exposureRoot,
failOnDrift,
sourceRoot = skillsRoot,
skills = requiredSkills
}) {
if (!existsSync(exposureRoot)) {
reports.push(`${label}: ${exposureRoot} not present`);
return;
}

for (const skill of requiredSkills) {
for (const skill of skills) {
const canonicalDir = path.join(sourceRoot, skill);
const exposedDir = path.join(exposureRoot, skill);
if (!existsSync(exposedDir)) continue;
Expand Down Expand Up @@ -338,7 +360,8 @@ async function validateDrift() {
label: "repo-local .codex/skills",
exposureRoot: path.join(repoRoot, ".codex", "skills"),
failOnDrift: true,
sourceRoot: path.join(repoRoot, "packages", "skills", "skills")
sourceRoot: path.join(repoRoot, "packages", "skills", "skills"),
skills: cliMirroredSkills
});
} else {
reports.push("repo-local .codex/skills: skipped; pass --repo-root to check repository exposure");
Expand Down
Loading