manage-skill-flavors

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Manage Skill Flavors

管理Skill Flavors

Maintain one complete canonical skill while building reviewed host-specific exceptions before packaging. Consumers receive finished files and never interpret markers.
维护一份完整的规范技能版本,同时在打包前构建经过审核的特定宿主例外内容。用户将收到最终成品文件,无需解析任何标记。

Start With the Complete Context

从完整上下文开始

  1. Confirm the repository root contains
    skills/
    ,
    skill-flavors/
    , and
    scripts/compose-skill-flavor.mjs
    .
  2. Read the complete canonical file being changed.
  3. Read the matching relative file under every existing
    skill-flavors/<flavor>/
    directory, when present. No override means that flavor intentionally inherits the canonical file.
  4. Read references/flavor-test-matrix.md completely when adding a flavor or changing discovery, composition, packaging, publishing, or CI.
  1. 确认仓库根目录包含
    skills/
    skill-flavors/
    scripts/compose-skill-flavor.mjs
  2. 阅读待修改的完整规范文件。
  3. 阅读每个现有
    skill-flavors/<flavor>/
    目录下对应的相对文件(若存在)。无覆盖文件意味着该变体有意继承规范文件的内容。
  4. 当添加变体或修改发现、组合、打包、发布或CI流程时,完整阅读references/flavor-test-matrix.md

Classify the Change

对变更进行分类

ChangeCorrect source edit
Behavior is valid in every hostEdit only the canonical file.
A host capability changes one instructionMark the smallest complete canonical passage and add one sparse replacement block.
An existing skill is safe unchanged for a flavorMake no flavor edit; it is included automatically.
A new canonical skill is addedReview it against every flavor; add sparse overrides only where canonical guidance is unsafe.
A new flavor is addedAdd its first real sparse override under
skill-flavors/<flavor>/
; generic build and CI must discover it without another registry edit.
Do not create an exception merely to reword shared guidance.
变更类型正确的源文件编辑方式
行为在所有宿主环境中均有效仅编辑规范文件。
宿主能力变更某一条指令标记规范文件中最小的完整段落,并添加一个稀疏替换块。
现有技能对某一变体无需修改即可安全使用不编辑变体文件;其会自动包含规范内容。
添加新的规范技能针对每个变体进行审核;仅在规范指南对变体不安全时添加稀疏覆盖。
添加新变体
skill-flavors/<flavor>/
下添加首个真实的稀疏覆盖;通用构建和CI必须无需修改注册表即可自动发现它。
不要仅仅为了改写共享指南而创建例外。

Author the Smallest Exception

编写最小化的例外内容

Keep the canonical
SKILL.md
or reference complete. Put standalone boundaries around only the passage that differs:
markdown
<!--skill-flavor:project-creation:start-->
Create the project with the default local workflow.
<!--skill-flavor:project-creation:end-->
Mirror the canonical path below the flavor root and write only complete replacement blocks plus whitespace:
text
skills/uipath-example/references/setup.md
skill-flavors/studioweb/uipath-example/references/setup.md
markdown
<!--skill-flavor:project-creation:start-->
Create the project with the host project-creation tool.
<!--skill-flavor:project-creation:end-->
Marker names must be lowercase kebab-case, unique within a file, unnested, and identical in canonical and override files. An override cannot add an unmarked introduction, heading, or note.
Use the compact marker form with no whitespace inside the HTML comment, and start every boundary at column 1 with no leading or trailing spaces or tabs. Keep the Markdown indentation on the content inside the block instead. For example, wrap a nested list item like this:
markdown
<!--skill-flavor:connector-registration:start-->
    - Nested host-specific instruction.
<!--skill-flavor:connector-registration:end-->
If a new flavor needs a smaller exception than an existing multi-paragraph block, split that block into adjacent sibling blocks. Update every existing override that used the old block, and compare its complete built file before and after the refactor—the existing flavor's consumer text must remain unchanged. Never nest a narrower block inside the old one.
保持规范的
SKILL.md
或参考文件完整。仅对存在差异的段落设置独立边界:
markdown
<!--skill-flavor:project-creation:start-->
Create the project with the default local workflow.
<!--skill-flavor:project-creation:end-->
在变体根目录下镜像规范路径,并仅编写完整的替换块及空白字符:
text
skills/uipath-example/references/setup.md
skill-flavors/studioweb/uipath-example/references/setup.md
markdown
<!--skill-flavor:project-creation:start-->
Create the project with the host project-creation tool.
<!--skill-flavor:project-creation:end-->
标记名称必须为小写短横线格式(kebab-case),在文件内唯一,不可嵌套,且在规范文件和覆盖文件中完全一致。覆盖文件不能添加无标记的引言、标题或注释。
使用紧凑的标记格式,HTML注释内部无空白字符,每个边界都从第1列开始,无前置或后置空格、制表符。相反,保持块内内容的Markdown缩进格式。例如,像这样包裹嵌套列表项:
markdown
<!--skill-flavor:connector-registration:start-->
    - Nested host-specific instruction.
<!--skill-flavor:connector-registration:end-->
如果新变体需要的例外范围比现有多段落块更小,请将该块拆分为相邻的兄弟块。更新所有使用旧块的现有覆盖文件,并重构前后对比完整构建文件——现有变体的用户文本必须保持不变。切勿在旧块内嵌套更窄的块。

Prefer Additive Extension Points

优先使用可扩展的附加点

Do not replace a complete shared table, list, or navigation section merely to add host guidance. A replacement freezes that whole passage for the flavor, so later canonical additions inside it no longer propagate. Keep the shared content unmarked and put an empty extension block next to it:
markdown
| Shared reference | Shared purpose |
|---|---|
| references/common.md | Used by every host |
<!--skill-flavor:reference-navigation-extra:start-->

<!--skill-flavor:reference-navigation-extra:end-->
Fill only that extension in the sparse override. The default emits nothing at the extension point; the flavor receives the complete shared section plus its addition. If one existing row genuinely differs, mark only that row instead of copying the whole table. Whenever a canonical marked passage changes, read every override for that block because those flavors do not inherit the edit.
不要仅仅为了添加宿主专属指南而替换完整的共享表格、列表或导航章节。替换操作会将整个段落针对变体冻结,因此后续规范中对该段落的新增内容将不再同步。保持共享内容无标记,并在其旁添加一个空扩展块:
markdown
| Shared reference | Shared purpose |
|---|---|
| references/common.md | Used by every host |
<!--skill-flavor:reference-navigation-extra:start-->

<!--skill-flavor:reference-navigation-extra:end-->
仅在稀疏覆盖文件中填充该扩展块。默认情况下扩展点不会输出任何内容;变体将获得完整的共享章节加上其附加内容。如果某一行确实存在差异,仅标记该行而非复制整个表格。每当规范中的标记段落发生变更时,需阅读该块对应的所有覆盖文件,因为这些变体不会继承该编辑内容。

Treat Missing Overrides as Intentional Inheritance

将缺失的覆盖视为有意继承

Every custom flavor package contains every canonical skill. Sparse files only replace passages that differ for that host.
  • Add no flavor file when canonical guidance is correct for the host.
  • Add the smallest replacement block when canonical guidance is wrong for the host.
  • Review every new or materially changed canonical skill against every existing flavor because inclusion is automatic. Update or add the smallest necessary sparse override wherever the canonical guidance is not correct for that flavor.
  • Do not create an empty flavor. If a host has no exceptions, it should consume the default package.
每个自定义变体包都包含所有规范技能。稀疏文件仅替换该宿主环境下存在差异的段落。
  • 当规范指南对宿主环境适用时,不添加变体文件。
  • 当规范指南对宿主环境不适用时,添加最小的替换块。
  • 针对每个现有变体审核所有新增或重大修改的规范技能,因为其会自动被包含。在规范指南对变体不适用的地方,更新或添加最小必要的稀疏覆盖。
  • 不要创建空变体。如果宿主环境无任何例外,应使用默认包。

Preserve Generic Discovery and Package Naming

保留通用发现机制和包命名规则

Every direct lowercase kebab-case directory under
skill-flavors/
is a flavor. Never hardcode
studioweb
in the composer, npm build scripts, generic validation loop, or reusable flavor publisher. Publication is intentionally different: each released flavor must opt in through an explicit reviewed caller so its registry policy cannot expand implicitly.
Package names derive mechanically from the root package:
VariantPackage
default
@uipath/skills
studioweb
@uipath/skills-studioweb
<flavor>
@uipath/skills-<flavor>
Do not add an allowlist,
skill.build.json
, a flavor registry, or per-flavor package metadata. The directory name and sparse overrides are the source contract.
skill-flavors/
下的每个直接小写短横线格式目录都是一个变体。切勿在composer、npm构建脚本、通用验证循环或可重用变体发布器中硬编码
studioweb
。发布机制则有所不同:每个发布的变体必须通过经过审核的显式调用方选择加入,因此其注册表策略不会自动扩展。
包名称由根包自动生成:
变体包名
default
@uipath/skills
studioweb
@uipath/skills-studioweb
<flavor>
@uipath/skills-<flavor>
不要添加白名单、
skill.build.json
、变体注册表或每个变体的包元数据。目录名称和稀疏覆盖是源合约。

Validate the Consumer Artifacts

验证用户产物

Run the repository commands in order:
bash
npm run skills:validate
npm run skills:build
npm run skills:pack
npm run skills:test
git diff --check
skills:build
must produce complete marker-free trees under
build/skills/
.
skills:pack
must rebuild those trees, stage packages under
build/packages/
, run real
npm pack
, and verify tarballs under
build/npm/
. Flavor publishing jobs must select one verified
.tgz
by manifest identity and publish only that exact path; they must never publish a wildcard containing the default or another flavor.
Normal
npm pack
and
npm publish
at the repository root remain backward compatible default-package commands. Their
prepack
lifecycle transactionally activates a marker-free default
skills/
tree, and
postpack
restores the exact canonical source tree before the command finishes. They produce or publish only
@uipath/skills
; they do not replace
npm run skills:pack
, which builds every discovered flavor. If npm fails or is interrupted between those lifecycle steps and
build/.root-pack-transaction
remains, first confirm the original npm process has ended, then run
npm run skills:recover
before retrying. Recovery restores canonical sources; if it finds unexpected overlay edits, it preserves them under
build/.root-pack-recovery-*
and exits nonzero so they cannot be missed. Never use
--ignore-scripts
for root source packaging because it intentionally bypasses this composition lifecycle.
Inspect the final package contract, not only sparse sources:
  • The default contains every canonical skill and retains canonical block bodies without marker boundaries.
  • Each custom package contains every canonical skill and its flavor replacements.
  • Every staged manifest uses the root version and the derived package name.
  • Custom manifests contain no repository lifecycle scripts or
    package.json.repository
    field. They pin both
    publishConfig.registry
    and
    publishConfig["@uipath:registry"]
    to
    https://npm.pkg.github.com/
    ; the scoped pin prevents an ambient
    @uipath
    npmjs configuration from winning. The publisher still validates the effective scoped registry and supplies the reviewed
    dev
    or
    preview
    tag. Do not set an access value during normal publishing because the existing Internal visibility must remain unchanged.
  • No built tree, staged package, or tarball contains
    skill-flavor:
    comments,
    skill-flavors/
    , repository tests, or composer source.
  • Binary and template assets remain byte-identical.
Clarify what "available" means before release work: a successful
skills:pack
makes a local tarball available; registry availability requires an explicit publisher. When publication is in scope, read
docs/RELEASE.md
completely and confirm the target registry and channel. Keep
publish.yml
's established default jobs root-only. Give each published flavor an isolated, reviewed caller that passes its flavor and channel to
publish-skill-flavor.yml
. The reusable workflow validates the flavor, derives its package name, and publishes one selected tarball to GitHub Packages only. Studio Web callers pass
flavor: studioweb
; never add Studio Web to the default npmjs path. A future flavor is automatically buildable, not automatically publishable, until an explicit caller is added. The reusable publisher also requires the repository variable
ENABLE_SKILL_FLAVOR_PUBLISH=true
; leave it absent or false until an operator has confirmed that every explicitly published custom package has been bootstrapped as Internal, does not inherit access from the public repository, and grants
UiPath/skills
Actions write access. Registry routing and GitHub package visibility are separate controls, and this variable is an enablement switch rather than a live visibility check. Follow the one-time procedure in
docs/RELEASE.md
, and disable the global gate again before adding a caller for another not-yet-bootstrapped flavor.
按顺序运行仓库命令:
bash
npm run skills:validate
npm run skills:build
npm run skills:pack
npm run skills:test
git diff --check
skills:build
必须在
build/skills/
下生成无标记的完整目录树。
skills:pack
必须重新构建这些目录树,在
build/packages/
下暂存包,运行真实的
npm pack
,并验证
build/npm/
下的压缩包。变体发布任务必须通过清单标识选择一个已验证的
.tgz
文件,并仅发布该精确路径;绝不能发布包含默认包或其他变体的通配符路径。
仓库根目录下常规的
npm pack
npm publish
命令保持向后兼容,是默认包的命令。它们的
prepack
生命周期会以事务方式激活无标记的默认
skills/
目录树,
postpack
会在命令完成前恢复精确的规范源目录树。它们仅生成或发布
@uipath/skills
;不会替代
npm run skills:pack
(后者会构建所有发现的变体)。如果npm在这些生命周期步骤之间失败或中断,且
build/.root-pack-transaction
仍然存在,请先确认原始npm进程已结束,然后在重试前运行
npm run skills:recover
。恢复操作会恢复规范源;如果发现意外的覆盖编辑,会将其保留在
build/.root-pack-recovery-*
下并以非零状态退出,以免被忽略。切勿在根目录源打包时使用
--ignore-scripts
,因为这会有意绕过该组合生命周期。
检查最终的包合约,而不仅仅是稀疏源文件:
  • 默认包包含所有规范技能,并保留规范块内容,无标记边界。
  • 每个自定义包包含所有规范技能及其变体替换内容。
  • 每个暂存清单使用根版本和派生的包名。
  • 自定义清单不包含仓库生命周期脚本或
    package.json.repository
    字段。它们将
    publishConfig.registry
    publishConfig["@uipath:registry"]
    固定为
    https://npm.pkg.github.com/
    ;作用域固定可防止环境中的
    @uipath
    npmjs配置生效。发布者仍需验证有效的作用域注册表,并提供经过审核的
    dev
    preview
    标签。正常发布时不要设置访问权限值,因为现有的Internal可见性必须保持不变。
  • 构建后的目录树、暂存包或压缩包中不得包含
    skill-flavor:
    注释、
    skill-flavors/
    、仓库测试或composer源文件。
  • 二进制和模板资产保持字节级一致。
在发布工作开始前明确“可用”的定义:成功运行
skills:pack
会生成本地可用的压缩包;注册表可用则需要显式的发布操作。当涉及发布时,完整阅读
docs/RELEASE.md
并确认目标注册表和渠道。保持
publish.yml
中已确立的默认作业仅针对根目录。为每个发布的变体提供一个独立的、经过审核的调用方,将其变体和渠道传递给
publish-skill-flavor.yml
。可重用工作流会验证变体,派生其包名,并仅将选定的一个压缩包发布到GitHub Packages。Studio Web调用方传递
flavor: studioweb
;绝不要将Studio Web添加到默认的npmjs路径。未来的变体可自动构建,但在添加显式调用方之前不会自动发布。可重用发布器还需要仓库变量
ENABLE_SKILL_FLAVOR_PUBLISH=true
;在操作员确认每个显式发布的自定义包已被引导为Internal、未继承公共仓库的访问权限、且已授予
UiPath/skills
Actions写入权限之前,保持该变量缺失或设为false。注册表路由和GitHub包可见性是独立的控制项,此变量是启用开关而非实时可见性检查。遵循
docs/RELEASE.md
中的一次性流程,并在为另一个尚未引导的变体添加调用方之前再次禁用全局网关。

Critical Rules

关键规则

  1. Keep canonical files complete. Default/local consumers must understand
    SKILL.md
    without a build manifest.
  2. Build files before packages. Packages consume complete
    build/skills/<variant>
    trees, never canonical and sparse sources directly.
  3. Make additions automatic. A valid new flavor directory must receive a tree and package without code, npm-script, or workflow edits.
  4. Preserve root command compatibility. Normal root
    npm pack
    and
    npm publish
    must compose only the marker-free default package and restore canonical sources;
    npm run skills:pack
    remains the all-flavor command.
  5. Never edit generated output. Change canonical files, sparse overrides, or the composer; do not modify or commit
    build/
    .
  6. Fail before replacement. Validate every flavor and inspect every tarball before replacing the last successful generated artifacts.
  7. Recover without data loss. Keep root packaging transactional, reject overlapping transactions, and preserve unexpected overlay edits before restoring canonical sources.
  8. Isolate publication. Keep default root publishing separate from flavor publishing; registry-lock and select one exact flavor tarball, and keep operator enablement off until every called flavor package is confirmed Internal.
  9. Keep shared evolution automatic. Prefer empty additive extension points for host-only additions; never copy a shared table or list into a broad replacement that can silently hide later canonical changes.
  1. 保持规范文件完整。默认/本地用户无需构建清单即可理解
    SKILL.md
  2. 先构建文件再打包。包使用完整的
    build/skills/<variant>
    目录树,绝不直接使用规范和稀疏源文件。
  3. 自动添加新变体。有效的新变体目录必须无需修改代码、npm脚本或工作流即可获得目录树和包。
  4. 保留根命令兼容性。根目录下常规的
    npm pack
    npm publish
    必须仅组合无标记的默认包并恢复规范源;
    npm run skills:pack
    仍是全变体命令。
  5. 绝不编辑生成的输出。修改规范文件、稀疏覆盖或composer;不要修改或提交
    build/
    目录。
  6. 替换前先验证失败。在替换上一次成功生成的产物之前,验证每个变体并检查每个压缩包。
  7. 无数据丢失恢复。保持根目录打包的事务性,拒绝重叠事务,并在恢复规范源之前保留意外的覆盖编辑。
  8. 隔离发布流程。将默认根目录发布与变体发布分开;锁定注册表并选择一个精确的变体压缩包,在确认每个被调用的变体包已设为Internal之前,保持操作员启用开关关闭。
  9. 自动共享演进。优先使用空的附加扩展点添加宿主专属内容;绝不要将共享表格或列表复制到大范围的替换块中,以免隐藏后续的规范变更。

What Not to Do

禁止操作

  • Do not copy an entire skill into a flavor to change a few paragraphs.
  • Do not introduce JSON tags, fragment manifests, or runtime composition.
  • Do not add one npm build command or generic validation-CI branch per flavor; an explicitly published flavor still needs a reviewed caller of the correct publisher.
  • Do not ship default plugin hooks or manifests in a minimal host package.
  • Do not validate only
    studioweb
    ; enumerate every discovered flavor.
  • Do not trust a source-tree scan as proof of package safety; inspect the actual tarballs.
  • Do not remove or bypass the root
    prepack
    /
    postpack
    lifecycle; source markers must never reach the default npm package.
  • Do not make the default publisher iterate over
    build/npm/*.tgz
    , and do not publish a flavor through an unreviewed registry wildcard.
  • Do not configure npmjs credentials, OIDC trusted publishing, provenance, or public access for a custom flavor package.
  • 不要为了修改几个段落而将整个技能复制到变体中。
  • 不要引入JSON标签、片段清单或运行时组合。
  • 不要为每个变体添加一个npm构建命令或通用验证CI分支;显式发布的变体仍需要正确发布器的经过审核的调用方。
  • 不要在最小化宿主包中包含默认插件钩子或清单。
  • 不要仅验证
    studioweb
    ;枚举所有发现的变体。
  • 不要信任源目录扫描作为包安全的证明;检查实际的压缩包。
  • 不要移除或绕过根目录的
    prepack
    /
    postpack
    生命周期;源标记绝不能进入默认npm包。
  • 不要让默认发布器遍历
    build/npm/*.tgz
    ,也不要通过未审核的注册表通配符发布变体。
  • 不要为自定义变体包配置npmjs凭据、OIDC可信发布、来源或公共访问权限。