author-auth0-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAuthoring an Auth0 skill reference
编写Auth0 skill参考内容
Add or edit guidance in the single skill
(). This walks you through structure + router
wiring so the change passes CI on the first try.
auth0plugins/auth0/skills/auth0/Source of truth (read, don't duplicate):
and .
CONTRIBUTING.mddocs/architecture.md在单个 skill()中添加或编辑相关指南。本指南将带您完成结构搭建与路由配置,确保修改首次提交即可通过CI校验。
auth0plugins/auth0/skills/auth0/权威参考(仅阅读,请勿复制): 和 。
CONTRIBUTING.mddocs/architecture.mdCritical rules (get these wrong and CI fails)
关键规则(违反将导致CI失败)
- Depth-3 tree + reachability: every reference is a directory containing an
<name>/, and that directory name MUST be named in aindex.mdrouter table. Start index-only (the whole reference lives inSKILL.md, no leaves — one hop from the router).index.mdMUST NOT exceed 1000 lines — once it passes ~500 lines, consider splitting it into a leaf group (index.mdbecomes a hub — shared prerequisites + an intent→leaf dispatch table — over document-section leaves), but only if the content actually separates into distinct sections; don't split a reference that's long but cohesive. An index-onlyindex.md, and any leaf inside a leaf group, MUST NOT link to any otherindex.mdfile — they are sinks. The only second hop allowed is a leaf-group hub dispatching to leaves in its own directory; cross-group links are forbidden. Both are stated in full under.md→ "Make it routable" andCONTRIBUTING.md→ "Adding a reference"; the paths below tell you which table to edit.CONTRIBUTING.md - Strict mode: avoid vague quality adverbs that assert an outcome without showing it — state the concrete behavior instead (what happens, to what, when); give a positive alternative for every prohibition; hoist MUST/NEVER directives near the top of the file.
- 三级目录结构 + 可达性:每个参考内容都对应一个目录,目录下包含
<name>/文件,且该目录名称必须在index.md的路由表中声明。初始阶段请采用仅索引文件的形式(所有参考内容都放在SKILL.md中,无子文件——仅需通过路由跳转一次)。index.md的行数不得超过1000行——当行数达到约500行时,可考虑将其拆分为叶子组(index.md变为枢纽文件,包含共享前置条件以及意图→叶子文件的调度表,对应文档各章节的叶子文件),但仅当内容确实可划分为不同独立章节时才进行拆分;对于内容连贯的长文档,请勿拆分。仅索引形式的index.md以及叶子组中的任何叶子文件,不得链接到其他index.md文件——它们是终端节点。仅允许的二次跳转是叶子组的枢纽文件跳转到其自身目录下的叶子文件;跨组链接是被禁止的。上述规则在.md→ "确保可路由"和CONTRIBUTING.md→ "添加参考内容"中有完整说明;下文路径将告知您需要编辑哪张表。CONTRIBUTING.md - 严格模式:避免使用模糊的修饰性副词来断言结果却不展示具体过程——应改为陈述具体行为(发生了什么、作用于什么、何时发生);对于每一项禁止性要求,都要给出对应的正向替代方案;将MUST/NEVER类指令放在文件顶部附近。
Step 0 — Classify the contribution
步骤0 — 对贡献内容进行分类
| What you're adding | Prefix | Router edits |
|---|---|---|
| A single SDK/framework integration | | Step 2 all 3 tiers (+ variant row if web/API split) |
| A capability spanning frameworks | | Step 1 intent row + Step 4 load block |
| A provisioning tool | | Step 3 tooling table |
| Cross-cutting guidance | | Step 4 load block(s) referencing it |
| Editing an existing reference | (n/a) | Usually none — re-check the depth-3 tree rules |
Then follow the matching path below.
| 您要添加的内容类型 | 前缀 | 路由编辑操作 |
|---|---|---|
| 单个SDK/框架集成 | | 步骤2中的所有三层(若存在Web/API拆分,则需添加变体行) |
| 跨框架的功能 | | 步骤1添加意图行 + 步骤4添加加载块 |
| 配置工具 | | 步骤3添加工具表行 |
| 跨领域指南 | | 步骤4添加引用它的加载块 |
| 编辑现有参考内容 | (无) | 通常无需操作——重新检查三级目录结构规则即可 |
然后遵循下方对应的路径操作。
Path A — New framework reference
路径A — 新增框架参考内容
- Create (kebab-case directory). Start index-only: the whole reference lives in
plugins/auth0/skills/auth0/references/framework-<slug>/index.md, following the split used by peers (index.md,## Setup,## Integrationsections); self-contained (no## APIlinks). Only split into a leaf group once it's large — see "Splitting into a leaf group" below..md - Wire detection into all three tiers of Step 2 in
:
plugins/auth0/skills/auth0/SKILL.md- Tier 1 — the Auth0 SDK package row (e.g. →
@auth0/auth0-remix). Put it above less-specific rows.remix - Tier 2 — the non-Auth0 workspace dependency row (e.g. in
@remix-run/react→package.json).remix - Tier 3 — the prompt-keyword row (e.g. "Remix" → ).
remix
- Tier 1 — the Auth0 SDK package row (e.g.
- If the framework has a web-app vs API split, add a row to Variant disambiguation.
- No separate list to update: the reachability checker derives routable slugs
from the backticked value column of these tables, so naming in a table makes
<slug>reachable.framework-<slug>/index.md - The load block in Step 4 already reads
integrate— no Step 4 edit needed.references/framework-{framework}/index.md
- 创建(目录采用短横线分隔命名法)。初始采用仅索引文件形式:所有参考内容都放在
plugins/auth0/skills/auth0/references/framework-<slug>/index.md中,遵循同类文件的结构(分为index.md、## 安装配置、## 集成等章节);确保内容自包含(无## API文件链接)。仅当文档篇幅较大时才拆分为叶子组——详见下方“拆分为叶子组”部分。.md - 在的步骤2中,将检测逻辑接入所有三层:
plugins/auth0/skills/auth0/SKILL.md- 第一层——Auth0 SDK包行(例如→
@auth0/auth0-remix)。将其放在特异性较低的行上方。remix - 第二层——非Auth0工作区依赖行(例如中的
package.json→@remix-run/react)。remix - 第三层——提示关键词行(例如“Remix” → )。
remix
- 第一层——Auth0 SDK包行(例如
- 如果框架存在Web应用与API的拆分,需在变体消歧义部分添加一行。
- 无需更新单独的列表:可达性检查器会从这些表格的反引号值列中提取可路由的slug,因此在表格中命名即可让
<slug>具备可达性。framework-<slug>/index.md - 步骤4中的加载块已默认读取
integrate——无需编辑步骤4。references/framework-{framework}/index.md
Path B — New feature reference
路径B — 新增功能参考内容
-
Create(index-only, self-contained — see "Splitting into a leaf group" below for when to add leaves).
plugins/auth0/skills/auth0/references/feature-<slug>/index.md -
Add an intent row to the Step 1 table. Thevalue is a lookup key reused verbatim as a Step 4 heading. Describe the goal in plain language, not just the Auth0 term. Example row:
Intent| Let users sign in without a password ... *Auth0: passwordless.* | **feature:passwordless** | -
Add a matching load block in Step 4 whose heading is that intent. The heading is Markdown (); the
### feature:passwordlesslines sit inside a fenced block beneath it, matching the existing Step 4 blocks:Read:### feature:passwordless ``` Read: references/feature-passwordless/index.md Read: references/tooling-{tooling}/index.md If framework detected: Read references/framework-{framework}/index.md ```
-
创建(采用仅索引文件形式,内容自包含——何时添加叶子文件详见下方“拆分为叶子组”部分)。
plugins/auth0/skills/auth0/references/feature-<slug>/index.md -
在步骤1的表格中添加意图行。值是一个查找键,需与步骤4的标题完全一致。用通俗易懂的语言描述目标,而非仅使用Auth0术语。示例行:
Intent| 让用户无需密码即可登录……*Auth0:无密码认证。* | **feature:passwordless** | -
在步骤4中添加匹配的加载块,其标题为该意图值。标题采用Markdown格式();
### feature:passwordless行放在标题下方的代码块中,与现有步骤4的块格式一致:Read:### feature:passwordless ``` Read: references/feature-passwordless/index.md Read: references/tooling-{tooling}/index.md If framework detected: Read references/framework-{framework}/index.md ```
Path C — New tooling or pattern reference
路径C — 新增工具或模式参考内容
- Tooling: create
, then add a row to the Step 3 table. Backtick the value exactly as the existing rows do (
plugins/auth0/skills/auth0/references/tooling-<slug>/index.md) — reachability picks up tooling references only via their backticked group name, so an unbackticked value leaves the reference unreachable. Note| <project signal> | `tooling-<slug>/index.md` |hardcodesvalidate-skill.sh— a genuinely new tooling reference also needs that list extended.cli mcp terraform - Pattern: create
, then reference it from the relevant Step 4 load block(s) (patterns are pulled in conditionally, e.g.
plugins/auth0/skills/auth0/references/pattern-<slug>/index.mdunderpattern-multi-tenant/index.md).guidancehardcodesvalidate-skill.sh— extend that list for a new pattern reference.security token-handling multi-tenant rate-limiting common-errors
- 工具类:创建,然后在步骤3的表格中添加一行。反引号中的值需与现有行完全一致(
plugins/auth0/skills/auth0/references/tooling-<slug>/index.md)——仅通过反引号中的组名,可达性检查器才能识别工具类参考内容,因此未加反引号的值会导致参考内容不可达。注意| <项目标识> | `tooling-<slug>/index.md` |中硬编码了validate-skill.sh——若新增的是真正全新的工具类参考内容,还需扩展该列表。cli mcp terraform - 模式类:创建,然后在相关的步骤4加载块中引用它(模式类内容会被条件性调用,例如
plugins/auth0/skills/auth0/references/pattern-<slug>/index.md下的guidance)。pattern-multi-tenant/index.md中硬编码了validate-skill.sh——若新增模式类参考内容,需扩展该列表。security token-handling multi-tenant rate-limiting common-errors
Path D — Editing an existing reference
路径D — 编辑现有参考内容
Usually no router edit. Before finishing: confirm you introduced no link to
another file from an index-only or a leaf, and that any new
prohibition has a positive alternative and any weak language is reworded. If
you're editing a leaf group's hub, confirm any new dispatch still
points only at a leaf in its own directory.
.mdindex.mdRead:通常无需编辑路由。完成编辑前:确认您未在仅索引形式的或叶子文件中添加指向其他文件的链接;确认所有新增的禁止性要求都有对应的正向替代方案,且所有模糊表述都已修改。若您编辑的是叶子组的枢纽文件,确认所有新增的调度仅指向其自身目录下的叶子文件。
index.md.mdRead:Step 5 — Splitting into a leaf group (only for large references)
步骤5 — 拆分为叶子组(仅适用于大篇幅参考内容)
Skip this step for an index-only reference. Past ~500 lines (the 1000-line
cap is in "Critical rules" above), consider splitting into a leaf group so the
router pulls just the slice a task needs — but only if the content actually
separates into distinct sections; a long but cohesive reference stays
index-only:
references/framework-<slug>/
├── index.md # hub: shared prerequisites + intent→leaf dispatch table
├── integrate.md # document-section leaves (one per section, not per intent)
├── api-reference.md
├── patterns.md
├── setup.md
└── migration.md # only if the SDK has a major-version migration- Leaves are document sections, not intents (,
integrate,api-reference,patterns,setup, …).migration - becomes a lean hub: shared setup every leaf needs, then a dispatch table with one row per router intent, each an imperative
index.mdpointing at that intent's primary leaf. Intent strings must match Step 1 exactly (`Read: references/<slug>/<leaf>.md`, notfeature:mfa). A "Then, if the task requires it" list ofmfabullets makes secondary leaves reachable. Every leaf must appear in at least oneRead:line or it's an orphan.Read: - Lossless + self-contained: every line of the original lands in exactly one destination; leaves repeat shared context inline rather than linking to the hub or each other. If two sections cross-reference too heavily to separate, merge them into one leaf instead of adding a link.
index.md - You don't edit 's routing tables — the router always emits
SKILL.mdregardless of whether the target is index-only or a leaf group; a global Step 4 note tells the agent to follow the hub's dispatch table to a leaf if it has one.Read: references/{framework}/index.md
仅索引形式的参考内容可跳过此步骤。当文档行数超过约500行(关键规则中规定了1000行的上限)时,可考虑拆分为叶子组,以便路由仅提取任务所需的部分内容——但仅当内容确实可划分为不同独立章节时才进行拆分;对于内容连贯的长文档,仍保持仅索引形式:
references/framework-<slug>/
├── index.md # 枢纽文件:共享前置条件 + 意图→叶子文件调度表
├── integrate.md # 文档章节叶子文件(每个文件对应一个章节,而非一个意图)
├── api-reference.md
├── patterns.md
├── setup.md
└── migration.md # 仅当SDK存在大版本迁移时添加- 叶子文件对应文档章节,而非意图(例如、
integrate、api-reference、patterns、setup等)。migration - 变为精简的枢纽文件:包含所有叶子文件都需要的共享安装配置,然后是一个调度表,每行对应一个路由意图,每行都是一个命令式的
index.md,指向该意图对应的主要叶子文件。意图字符串必须与步骤1的内容完全一致(例如`Read: references/<slug>/<leaf>.md`,而非feature:mfa)。“Then, if the task requires it”列表中的mfa项目符号可让次要叶子文件具备可达性。每个叶子文件必须至少出现在一行Read:中,否则会成为孤立文件。Read: - 无损且自包含:原中的每一行内容都要准确放入一个目标文件中;叶子文件需重复共享上下文内容,而非链接到枢纽文件或其他叶子文件。若两个章节交叉引用过于频繁而无法拆分,应将它们合并为一个叶子文件,而非添加链接。
index.md - 您无需编辑的路由表——无论目标是仅索引形式还是叶子组,路由始终会输出
SKILL.md;步骤4中的全局说明会告知agent,如果枢纽文件存在调度表,则需遵循该表跳转到对应的叶子文件。Read: references/{framework}/index.md
Step 6 — Add a routing eval
步骤6 — 添加路由评估用例
Add a case to (repo root, not inside the skill) so
the new intent/framework is asserted. Replace the placeholder below
with your own slug — must name references that already exist
under (as , or for a leaf
group), or rejects the case:
evals/routing-cases.jsonremixexpect_refsreferences/<name>/index.md<name>/<leaf>.mdcheck_routing_evals.pyjson
{
"id": "integrate-remix",
"intent": "integrate",
"framework": "remix",
"tooling": "cli",
"expect_refs": ["framework-remix/index.md", "tooling-cli/index.md"]
}在(仓库根目录,非skill内部)中添加一个用例,以便对新增的意图/框架进行验证。将下方的占位符替换为您自己的slug——必须命名下已存在的参考内容(例如,或叶子组的),否则会拒绝该用例:
evals/routing-cases.jsonremixexpect_refsreferences/<name>/index.md<name>/<leaf>.mdcheck_routing_evals.pyjson
{
"id": "integrate-remix",
"intent": "integrate",
"framework": "remix",
"tooling": "cli",
"expect_refs": ["framework-remix/index.md", "tooling-cli/index.md"]
}Step 7 — Validate (the gate)
步骤7 — 验证(准入门槛)
Run all four, in order. The change is not done until every one passes:
bash
bash plugins/auth0/skills/auth0/scripts/validate-skill.sh
python3 scripts/check_router_reachability.py plugins/auth0/skills/auth0
python3 scripts/check_routing_evals.py plugins/auth0/skills/auth0
uvx skillsaw --strictWhat each catches:
- unreachable reference, orphaned leaf, or a link that breaks the depth-3 tree
(sideways/cross-group/second-hop-from-a-sink) →
check_router_reachability.py - a routing decision that doesn't match →
evals/routing-cases.jsoncheck_routing_evals.py - weak language or missing frontmatter fields (license, author, openclaw) →
skillsaw --strict - description length, required sections, expected file presence →
validate-skill.sh
Also update when the change adds visible coverage —
the linter enforces README documentation.
plugins/auth0/README.md按顺序运行以下四个命令。只有所有命令都通过,修改才算完成:
bash
bash plugins/auth0/skills/auth0/scripts/validate-skill.sh
python3 scripts/check_router_reachability.py plugins/auth0/skills/auth0
python3 scripts/check_routing_evals.py plugins/auth0/skills/auth0
uvx skillsaw --strict每个命令的检测范围:
- 不可达的参考内容、孤立的叶子文件,或违反三级目录结构的链接(横向/跨组/从终端节点发起二次跳转)→
check_router_reachability.py - 与不匹配的路由决策→
evals/routing-cases.jsoncheck_routing_evals.py - 模糊表述或缺失的前置元数据字段(许可证、作者、openclaw)→
skillsaw --strict - 描述长度、必填章节、预期文件是否存在→
validate-skill.sh
此外,当修改新增了可见的覆盖范围时,请更新——代码检查器会强制要求README文档同步更新。
plugins/auth0/README.md