Repository navigation
Commit 084f606
docs(skills): ui router names action files by the registry suffix (#35300)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg1XdbbGasMNVx41tq3hZKV4)_
Fixes #35284
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`objectstack-ui` 技能路由表里 Actions 一行的文件位置,从
`src/actions/*.actions.ts` 改为 `src/actions/*.action.ts`,
`*.actions.ts`;同文件 Trap 3 删掉一处重复的对象清单作为付账。
- 为什么改:平台的类型注册表与 `os generate action` 写出的都是单数 `NAME.action.ts`,AI
按旧的复数路径找文件会漏掉生成的 action,还可能在旁边再建一个重复的。
- 风险与回滚:只改对外发布的技能文字,不动任何运行时代码;回滚即还原这一个提交。
- 先看:`skills/objectstack-ui/SKILL.md` 第 84 行(路由表 Actions 行)与第 65 行(Trap
3 的删减);再看 `scripts/check-skills-token-ratchet.mjs` 中该文件的天花板行。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,应看到
`skills/objectstack-ui/SKILL.md is 2272 tokens (ceiling 2272; headroom
0)`。
- 需要你做的:`skills/**` 属于 Tier H 受管面,需要你批准或亲手合并;席位做契约审核后落地。
## What changes
The Actions row of the `objectstack-ui` routing table
(`skills/objectstack-ui/SKILL.md`, In column) said
`src/actions/*.actions.ts`. It now says `` `src/actions/*.action.ts`,
`*.actions.ts` ``: the registry suffix first, and the plural one second
because it loads too.
What the code says, read on `origin/main` `01889892`:
- **Registry.** The action type declares `filePatterns:
['**/*.action.ts', '**/*.action.yml']`
(`packages/spec/src/kernel/metadata-plugin.zod.ts:969`).
- **Generator.** `os generate action` uses `defaultDir: 'src/actions'`
(`packages/cli/src/commands/generate.ts:473`) and takes the file name
from the registry (`generate.ts:1993-1996`, `metadataFileName(type,
toSnakeCase(name))`).
`packages/cli/src/utils/metadata-file-name.ts:13-28,115-118` reads the
first `**/*.INFIX.ts` pattern and writes `NAME.INFIX.ts`, which is
`NAME.action.ts` here. The generator then adds a re-export line for that
file to the directory's barrel (`generate.ts:2018-2048`,
`barrelExportLine`).
- **Loader.** The glob loader `MetadataPlugin._loadFromFileSystem`
(`packages/metadata/src/plugin.ts:1676`) runs only on the eager path
that has no artifact source. `metadata-file-name.ts:42-77` records that
both non-test `MetadataPlugin` construction sites pass an artifact
source, so nothing in this tree gets its actions from that glob. Actions
load through the barrel that `objectstack.config.ts` imports into
`defineStack({ actions })`:
`examples/app-crm/objectstack.config.ts:11,88`,
`examples/app-showcase/objectstack.config.ts:27,217`,
`examples/app-todo/objectstack.config.ts:12,69`.
- **So is `*.actions.ts` accepted too? Yes, through the barrel.**
`examples/app-todo/src/actions/index.ts` re-exports `./task.actions`,
and that app loads it. Some hand-written docs also teach the plural
(`content/docs/ui/actions.mdx:39`,
`content/docs/getting-started/examples.mdx:512`). That is why the cell
names both: First checks 2 tells the agent to read the project's own
files by these globs, and a project can hold either spelling. The
registry and generator suffix comes first, so it is the one a new file
gets.
Other `*.actions.ts` mentions under `skills/` and `ui/skills/`: none.
`git grep` over both trees finds only the cell changed here.
`skills/objectstack-ui/rules/actions.md` (edited on the i18n branch)
names no action file suffix and is not touched.
**Payment (ruling record 6513306068, letter B; the standing ruling,
verbatim: 「A:先削重复,余额按实测提高」).** The cell grows by 15 bytes. One
restatement is cut from the same file to pay for it: Trap 3 ended "Read
[Dashboards](...) before writing any widget, dataset or chart." That
list repeats the trap's own subjects, which the routing table's
dashboards row already sends to the same rule file, so the pointer now
reads "Read [Dashboards](...) first." (−41 bytes). The file shrinks
overall, so there is no remainder and no raise. The ceiling row comes
down to the measurement: 9133 bytes (9113 priced) to 9107 (9087 priced),
2279 to 2272 tokens. I did not use the two served sections (`### List
Views`, `## Actions`): `packages/qa/scenarios` keeps a verbatim copy of
the List Views section.
Changeset: `.changeset/35284-ui-router-action-suffix.md`,
`@objectstack/skills` patch.
## Tests
Text-only change. No tested behaviour changed, so there is no ablation.
Skills readings (lines are the measure; token convention `ceil(bytes /
4)`):
| Reading | Before (`01889892`) | After (`402e7b861`) |
|:--|--:|--:|
| `skills/objectstack-ui/SKILL.md` lines | 169 | 168 |
| `skills/objectstack-ui/SKILL.md` bytes / priced tokens | 9133 / 2279 |
9107 / 2272 |
| all 13 `skills/*/SKILL.md` lines (sum) | 4835 | 4834 |
| published bundle total, tokens (ratchet report) | 270968 | 270961 |
## Acceptance notes
- The glob loader (`filePatterns`) has no measured consumer in this tree
(`metadata-file-name.ts:79-89` records that as a disposition). The
singular suffix therefore matters for consistency with the generator and
registry, not for discovery. A plural file that no barrel imports does
not load, and neither does a singular one.
- Hand-written docs still teach `*.actions.ts`
(`content/docs/ui/actions.mdx:39`,
`content/docs/getting-started/examples.mdx:88,110,512`,
`content/docs/getting-started/build-with-claude-code.mdx:160`), and so
does `examples/app-todo`. The suffix is accepted, so these are not
defects. They are outside this card's surface (`skills/`, `ui/skills/`)
and noted only.
## Verification
Local gate set derived by `node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack` at head `402e7b861`: 67 families,
reconciled with `--ran` as 63 run with exit 0 and 4 NOT MEASURED (exit
3, prerequisite: a full workspace build). Those four are
`check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure` and `check:sourcemap-no-sources-content`.
They read built `dist/` across all packages, and this diff touches no
package source; that narrowing is declared and CI runs them. The full
gate farm and check-runs are CI's.
<details><summary>Skill gates (head 402e7b8)</summary>
```text
node scripts/check-skills-token-ratchet.mjs :: exit 0
✓ check-skills-token-ratchet: skills/objectstack-ui/SKILL.md is 2272 tokens (ceiling 2272; headroom 0).
✓ check-skills-token-ratchet: 59 authored bundle file(s) within their ceilings; 10 generator-owned file(s) and 38 eval fixture(s) measured, not ratcheted.
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:skill-docs :: exit 0
pnpm --filter @objectstack/spec run check:skill-served-sections :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:skill-links :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-dispatch-gates :: exit 0 (fast tier: 2249 cases pass)
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 (after building formula + lint; first run exit 3, prerequisite)
```
</details>
<details><summary>Run reconciliation</summary>
```text
Run reconciliation — 67 derived, 63 run, 4 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 67 derived famil(ies) accounted for — 63 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3).
overlap-check: VERDICT clean exit 0 (origin/main c809deb, #35294 and #35129 merge cleanly)
```
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7
Co-authored-by: Claude <noreply@anthropic.com>1 parent ee5fdc8 commit 084f606
3 files changed
Lines changed: 24 additions & 4 deletions
File tree
- .changeset
- scripts
- skills/objectstack-ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
987 | 996 | | |
988 | 997 | | |
989 | 998 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | | - | |
| 84 | + | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
0 commit comments