Skip to content

Commit 83598db

Browse files
DCjanuscodex
andcommitted
docs(create-skill): clarify Typer enum typing guidance
Co-authored-by: OpenAI Codex <codex@openai.com>
1 parent 3396ecd commit 83598db

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

skills/create-skill/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ Python 脚本规范要点:
9999
- 移除依赖引用后,若确认不再使用,应同步移除该依赖。
100100
- **CLI 形态**
101101
- 命令行参数优先用 Typer。
102+
- 对离散可选值(如 `format``view``profile``column` 等),优先使用 `Enum``Literal` 做类型标注,而不是只靠 help 文案描述可选值;这样 Typer 可以自动在 `--help` 中展示候选值,提升可读性与可发现性。
103+
- 取舍建议:少量、一次性使用的枚举值可优先用 `Literal`;需要复用、集中管理或值较多时优先用 `Enum`
102104
- 输出提示/表格优先用 rich(提升可读性)。
103105
- 数据模型与参数校验优先用 pydantic(失败信息清晰可定位)。
104106
- Typer 应用实例变量名使用小写 `app`

0 commit comments

Comments
 (0)