Repository navigation
Commit 3806a5a
docs(skills): a param's helpText takes a sentence or an inline locale map in the ui actions rule (#31617)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbQ7P4Kce6oMVkWfoAmTFBvQ)_
Fixes #31487
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:技能文档 `skills/objectstack-ui/rules/actions.md` 新增一条说明:动作参数的提示文字
`helpText` 和 `description`
一样,可以写一句话,也可以写按语言的对照表;页面按钮的内联动作用对照表写多语言提示,两种写法都能带记录占位。
- 为什么改:PR #31485 之后 schema 已接受对照表,但技能还只教“写一句话”,AI 照着写页面按钮时提示只会有一种语言。
- 风险与回滚:只改技能文档,不动运行时和 schema;为守住 token 上限删了同文件里六处重复说明。回滚即 revert 本 PR。
- 先看:`skills/objectstack-ui/rules/actions.md` 第 26 行新增的那条,以及为付 token
删掉的几处(disabled 一句、successMessage 一句、两处代码注释、两处括注)。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs` 中 actions.md 一行显示
2258 / 2259,且 `pnpm --filter @objectstack/spec check:skill-examples` 退出
0。
- 需要你做的:审阅并批准这个 Tier H PR(skills/** 受管面)。
## What changes
- `skills/objectstack-ui/rules/actions.md`: a new bullet under the
copy-holes line says a param's `helpText`, like `description`, is a
sentence or an inline locale map (example `{ en: 'Why ... is paused',
'zh-CN': '暂停原因' }` with a record-name hole in the `en` value), that
holes work in either form, and that the map is how a page button's
inline `action` (no bundle reaches it) writes its hint per locale. The
copy-holes line keeps `helpText` in its list of copy that reads
`record`; its sentence example moved into the new bullet's map.
- The file has no worked inline-action example, so no example block
changed.
- Token payment, all inside the same file, deletion only (no re-wrap):
the `disabled` bullet's "Use this (not `visible`) ..." sentence (the
hidden vs greyed-out contrast is already drawn by the two bullets); "Set
`successMessage` for non-obvious outcomes;" (the default-toast clause
stays); the `// name of the flow` and `// registered handler` code
comments; the "(params, then a server body)" and "(SSO-like handlers)"
parentheticals, which restate their example or heading.
- `.changeset/31487-ui-skill-helptext-locale-map.md`:
`'@objectstack/skills': patch`.
Matched against `packages/spec/src/ui/action.zod.ts`
(`actionParamHelpText`, `localeMap: true`) and
`content/docs/protocol/objectui/actions.mdx` L519 as #31485 left them.
## Tests
- `pnpm --filter @objectstack/spec check:skill-examples`: exit 0, 308
marked examples across 118 files type-check.
- Schema probe against the built spec: `ActionParamSchema.safeParse`
accepts `helpText` as the taught map (with a hole in `en`) and as a
sentence.
## Acceptance notes
- `skills/**` readings: `actions.md` 180 → 181 lines, 9034 → 9031 bytes,
2259 → 2258 tokens (ceiling 2259, headroom 1). All `SKILL.md` in the
catalog: 4592 → 4592 lines (none touched).
- No ceiling moved.
## Verification
- Derived gate sweep (`dispatch-gates --commands`, 44 families): 43 exit
0; `check:dual-build-cjs-loads` exit 3 (PREREQUISITE NOT MET, needs a
full `pnpm build`), NOT MEASURED locally, CI runs it. `--ran`
reconciliation: 44 accounted for.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jSvaXAXqBaw3WmE3gy)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 09df571 commit 3806a5a
2 files changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
0 commit comments