manage-skill-flavors
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseManage 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
从完整上下文开始
- Confirm the repository root contains ,
skills/, andskill-flavors/.scripts/compose-skill-flavor.mjs - Read the complete canonical file being changed.
- Read the matching relative file under every existing directory, when present. No override means that flavor intentionally inherits the canonical file.
skill-flavors/<flavor>/ - Read references/flavor-test-matrix.md completely when adding a flavor or changing discovery, composition, packaging, publishing, or CI.
- 确认仓库根目录包含、
skills/和skill-flavors/。scripts/compose-skill-flavor.mjs - 阅读待修改的完整规范文件。
- 阅读每个现有目录下对应的相对文件(若存在)。无覆盖文件意味着该变体有意继承规范文件的内容。
skill-flavors/<flavor>/ - 当添加变体或修改发现、组合、打包、发布或CI流程时,完整阅读references/flavor-test-matrix.md。
Classify the Change
对变更进行分类
| Change | Correct source edit |
|---|---|
| Behavior is valid in every host | Edit only the canonical file. |
| A host capability changes one instruction | Mark the smallest complete canonical passage and add one sparse replacement block. |
| An existing skill is safe unchanged for a flavor | Make no flavor edit; it is included automatically. |
| A new canonical skill is added | Review it against every flavor; add sparse overrides only where canonical guidance is unsafe. |
| A new flavor is added | Add its first real sparse override under |
Do not create an exception merely to reword shared guidance.
| 变更类型 | 正确的源文件编辑方式 |
|---|---|
| 行为在所有宿主环境中均有效 | 仅编辑规范文件。 |
| 宿主能力变更某一条指令 | 标记规范文件中最小的完整段落,并添加一个稀疏替换块。 |
| 现有技能对某一变体无需修改即可安全使用 | 不编辑变体文件;其会自动包含规范内容。 |
| 添加新的规范技能 | 针对每个变体进行审核;仅在规范指南对变体不安全时添加稀疏覆盖。 |
| 添加新变体 | 在 |
不要仅仅为了改写共享指南而创建例外。
Author the Smallest Exception
编写最小化的例外内容
Keep the canonical or reference complete. Put standalone boundaries around only the passage that differs:
SKILL.mdmarkdown
<!--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.mdmarkdown
<!--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.mdmarkdown
<!--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.mdmarkdown
<!--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 is a flavor. Never hardcode 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.
skill-flavors/studiowebPackage names derive mechanically from the root package:
| Variant | Package |
|---|---|
| |
| |
| |
Do not add an allowlist, , a flavor registry, or per-flavor package metadata. The directory name and sparse overrides are the source contract.
skill.build.jsonskill-flavors/studioweb包名称由根包自动生成:
| 变体 | 包名 |
|---|---|
| |
| |
| |
不要添加白名单、、变体注册表或每个变体的包元数据。目录名称和稀疏覆盖是源合约。
skill.build.jsonValidate 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 --checkskills:buildbuild/skills/skills:packbuild/packages/npm packbuild/npm/.tgzNormal and at the repository root remain backward
compatible default-package commands. Their lifecycle transactionally
activates a marker-free default tree, and restores the
exact canonical source tree before the command finishes. They produce or
publish only ; they do not replace , which
builds every discovered flavor. If npm fails or is interrupted between those
lifecycle steps and remains, first confirm the
original npm process has ended, then run before
retrying. Recovery restores canonical sources; if it finds unexpected overlay
edits, it preserves them under and exits nonzero
so they cannot be missed. Never use for root source
packaging because it intentionally bypasses this composition lifecycle.
npm packnpm publishprepackskills/postpack@uipath/skillsnpm run skills:packbuild/.root-pack-transactionnpm run skills:recoverbuild/.root-pack-recovery-*--ignore-scriptsInspect 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 field. They pin both
package.json.repositoryandpublishConfig.registrytopublishConfig["@uipath:registry"]; the scoped pin prevents an ambienthttps://npm.pkg.github.com/npmjs configuration from winning. The publisher still validates the effective scoped registry and supplies the reviewed@uipathordevtag. Do not set an access value during normal publishing because the existing Internal visibility must remain unchanged.preview - No built tree, staged package, or tarball contains comments,
skill-flavor:, repository tests, or composer source.skill-flavors/ - Binary and template assets remain byte-identical.
Clarify what "available" means before release work: a successful
makes a local tarball available; registry availability requires
an explicit publisher. When publication is in scope, read
completely and confirm the target registry and channel. Keep 's
established default jobs root-only. Give each published flavor an isolated,
reviewed caller that passes its flavor and channel to
. The reusable workflow validates the flavor,
derives its package name, and publishes one selected tarball to GitHub Packages
only. Studio Web callers pass ; 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
; 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 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
, and disable the global gate again before adding a caller for
another not-yet-bootstrapped flavor.
skills:packdocs/RELEASE.mdpublish.ymlpublish-skill-flavor.ymlflavor: studiowebENABLE_SKILL_FLAVOR_PUBLISH=trueUiPath/skillsdocs/RELEASE.md按顺序运行仓库命令:
bash
npm run skills:validate
npm run skills:build
npm run skills:pack
npm run skills:test
git diff --checkskills:buildbuild/skills/skills:packbuild/packages/npm packbuild/npm/.tgz仓库根目录下常规的和命令保持向后兼容,是默认包的命令。它们的生命周期会以事务方式激活无标记的默认目录树,会在命令完成前恢复精确的规范源目录树。它们仅生成或发布;不会替代(后者会构建所有发现的变体)。如果npm在这些生命周期步骤之间失败或中断,且仍然存在,请先确认原始npm进程已结束,然后在重试前运行。恢复操作会恢复规范源;如果发现意外的覆盖编辑,会将其保留在下并以非零状态退出,以免被忽略。切勿在根目录源打包时使用,因为这会有意绕过该组合生命周期。
npm packnpm publishprepackskills/postpack@uipath/skillsnpm run skills:packbuild/.root-pack-transactionnpm run skills:recoverbuild/.root-pack-recovery-*--ignore-scripts检查最终的包合约,而不仅仅是稀疏源文件:
- 默认包包含所有规范技能,并保留规范块内容,无标记边界。
- 每个自定义包包含所有规范技能及其变体替换内容。
- 每个暂存清单使用根版本和派生的包名。
- 自定义清单不包含仓库生命周期脚本或字段。它们将
package.json.repository和publishConfig.registry固定为publishConfig["@uipath:registry"];作用域固定可防止环境中的https://npm.pkg.github.com/npmjs配置生效。发布者仍需验证有效的作用域注册表,并提供经过审核的@uipath或dev标签。正常发布时不要设置访问权限值,因为现有的Internal可见性必须保持不变。preview - 构建后的目录树、暂存包或压缩包中不得包含注释、
skill-flavor:、仓库测试或composer源文件。skill-flavors/ - 二进制和模板资产保持字节级一致。
在发布工作开始前明确“可用”的定义:成功运行会生成本地可用的压缩包;注册表可用则需要显式的发布操作。当涉及发布时,完整阅读并确认目标注册表和渠道。保持中已确立的默认作业仅针对根目录。为每个发布的变体提供一个独立的、经过审核的调用方,将其变体和渠道传递给。可重用工作流会验证变体,派生其包名,并仅将选定的一个压缩包发布到GitHub Packages。Studio Web调用方传递;绝不要将Studio Web添加到默认的npmjs路径。未来的变体可自动构建,但在添加显式调用方之前不会自动发布。可重用发布器还需要仓库变量;在操作员确认每个显式发布的自定义包已被引导为Internal、未继承公共仓库的访问权限、且已授予 Actions写入权限之前,保持该变量缺失或设为false。注册表路由和GitHub包可见性是独立的控制项,此变量是启用开关而非实时可见性检查。遵循中的一次性流程,并在为另一个尚未引导的变体添加调用方之前再次禁用全局网关。
skills:packdocs/RELEASE.mdpublish.ymlpublish-skill-flavor.ymlflavor: studiowebENABLE_SKILL_FLAVOR_PUBLISH=trueUiPath/skillsdocs/RELEASE.mdCritical Rules
关键规则
- Keep canonical files complete. Default/local consumers must understand without a build manifest.
SKILL.md - Build files before packages. Packages consume complete trees, never canonical and sparse sources directly.
build/skills/<variant> - Make additions automatic. A valid new flavor directory must receive a tree and package without code, npm-script, or workflow edits.
- Preserve root command compatibility. Normal root and
npm packmust compose only the marker-free default package and restore canonical sources;npm publishremains the all-flavor command.npm run skills:pack - Never edit generated output. Change canonical files, sparse overrides, or the composer; do not modify or commit .
build/ - Fail before replacement. Validate every flavor and inspect every tarball before replacing the last successful generated artifacts.
- Recover without data loss. Keep root packaging transactional, reject overlapping transactions, and preserve unexpected overlay edits before restoring canonical sources.
- 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.
- 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.
- 保持规范文件完整。默认/本地用户无需构建清单即可理解。
SKILL.md - 先构建文件再打包。包使用完整的目录树,绝不直接使用规范和稀疏源文件。
build/skills/<variant> - 自动添加新变体。有效的新变体目录必须无需修改代码、npm脚本或工作流即可获得目录树和包。
- 保留根命令兼容性。根目录下常规的和
npm pack必须仅组合无标记的默认包并恢复规范源;npm publish仍是全变体命令。npm run skills:pack - 绝不编辑生成的输出。修改规范文件、稀疏覆盖或composer;不要修改或提交目录。
build/ - 替换前先验证失败。在替换上一次成功生成的产物之前,验证每个变体并检查每个压缩包。
- 无数据丢失恢复。保持根目录打包的事务性,拒绝重叠事务,并在恢复规范源之前保留意外的覆盖编辑。
- 隔离发布流程。将默认根目录发布与变体发布分开;锁定注册表并选择一个精确的变体压缩包,在确认每个被调用的变体包已设为Internal之前,保持操作员启用开关关闭。
- 自动共享演进。优先使用空的附加扩展点添加宿主专属内容;绝不要将共享表格或列表复制到大范围的替换块中,以免隐藏后续的规范变更。
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 ; enumerate every discovered flavor.
studioweb - Do not trust a source-tree scan as proof of package safety; inspect the actual tarballs.
- Do not remove or bypass the root /
prepacklifecycle; source markers must never reach the default npm package.postpack - Do not make the default publisher iterate over , and do not publish a flavor through an unreviewed registry wildcard.
build/npm/*.tgz - Do not configure npmjs credentials, OIDC trusted publishing, provenance, or public access for a custom flavor package.
- 不要为了修改几个段落而将整个技能复制到变体中。
- 不要引入JSON标签、片段清单或运行时组合。
- 不要为每个变体添加一个npm构建命令或通用验证CI分支;显式发布的变体仍需要正确发布器的经过审核的调用方。
- 不要在最小化宿主包中包含默认插件钩子或清单。
- 不要仅验证;枚举所有发现的变体。
studioweb - 不要信任源目录扫描作为包安全的证明;检查实际的压缩包。
- 不要移除或绕过根目录的/
prepack生命周期;源标记绝不能进入默认npm包。postpack - 不要让默认发布器遍历,也不要通过未审核的注册表通配符发布变体。
build/npm/*.tgz - 不要为自定义变体包配置npmjs凭据、OIDC可信发布、来源或公共访问权限。