speak-with-profile
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpeak With Profile
基于配置文件的语音处理
Use this skill as the front door for speech tasks when the workflow needs reusable profiles, consistent disclosure, and reproducible reporting. Treat built-in as the primary synthesis engine, and keep this skill as the policy and profile adapter.
$speech当工作流需要可复用的配置文件、一致的披露规则以及可复现的报告时,请将本Skill作为语音任务的统一入口。将内置的作为主要的合成引擎,本Skill则作为策略与配置文件的适配层。
$speechPurpose
用途
- Normalize speech requests with deterministic profile precedence.
- Enforce disclosure and manifest policy consistently.
- Delegate generation to by default in Codex App/CLI conversations.
$speech - Keep a script fallback for deterministic local/automation execution.
- Support productivity workflows such as narrated notes, spoken drafts, audio summaries, and hands-free review without dropping accessibility-friendly profile options.
- 基于确定性的配置文件优先级规范语音请求。
- 统一执行披露规则与运行清单策略。
- 在Codex应用/CLI会话中,默认将生成任务委托给。
$speech - 保留脚本回退方案,用于确定性的本地/自动化执行场景。
- 支持旁白笔记、语音草稿、音频摘要及免提审阅等生产力工作流,同时保留无障碍友好的配置文件选项。
Required UX pattern
必需的UX流程
- Route speech requests through first.
$speak-with-profile - Resolve profile/default/override values.
- Require disclosure text in end-user output context.
- Delegate generation to built-in using resolved fields.
$speech - Record effective configuration in a run manifest.
- 首先将语音请求路由至。
$speak-with-profile - 解析配置文件/默认值/覆盖值。
- 在最终用户的输出上下文里必须包含披露文本。
- 使用解析后的字段将生成任务委托给内置的。
$speech - 在运行清单中记录实际生效的配置。
Execution modes
执行模式
- (default for conversational usage): use built-in
delegatefor synthesis.$speech - (fallback for scripted/automation runs): invoke a compatible speech CLI via
local-cli.scripts/speak_with_profile.py
Use unless there is a concrete reason to run the local script path.
delegate- (对话场景默认模式):使用内置的
delegate进行语音合成。$speech - (脚本/自动化运行的回退模式):通过
local-cli调用兼容的语音CLI工具。scripts/speak_with_profile.py
除非有明确的理由需要运行本地脚本,否则请使用模式。
delegateInputs needed
所需输入
- Input source: either the exact text to speak or a path to a text file.
- Profile choice: a ID if the caller wants a named profile, or no profile if baseline defaults are acceptable.
--profile - Profile data source: a path when profile-based resolution is required.
--profiles-file - Delivery guidance: any explicit voice, instructions, speed, or format overrides the caller wants to force.
- Output intent: target output path or filename expectations for the generated audio.
- Execution preference: whether built-in is acceptable or deterministic
$speechbehavior is required.local-cli - Playback intent: whether the generated file should also be played locally with or
open.afplay - Optional skill-local workflow customization from or
config/customization.yaml.config/customization.template.yaml
- 输入源:要朗读的精确文本,或文本文件的路径。
- 配置文件选择:如果调用者需要指定配置文件,需提供ID;若接受基线默认值,则无需指定。
--profile - 配置文件数据源:当需要基于配置文件解析时,需提供路径。
--profiles-file - 交付指引:调用者想要强制设置的任何明确语音、指令、语速或格式覆盖项。
- 输出意图:生成音频的目标输出路径或文件名要求。
- 执行偏好:是否允许使用内置的,还是需要确定性的
$speech行为。local-cli - 播放意图:是否需要使用或
open在本地播放生成的文件。afplay - 可选的Skill本地工作流自定义:来自或
config/customization.yaml的配置。config/customization.template.yaml
Hard constraints
硬性约束
- Do not bypass this skill for speech tasks in this repository workflow.
- Do not modify built-in behavior assumptions; adapt inputs/outputs around it.
$speech - Never modify a compatible downstream speech CLI from this skill; adapt inputs and outputs around it.
- Use built-in voices only.
- Require for live API calls.
OPENAI_API_KEY
- 本仓库工作流中的语音任务不得绕过本Skill。
- 不得修改内置的行为假设;需围绕其适配输入/输出。
$speech - 不得通过本Skill修改兼容的下游语音CLI;需围绕其适配输入/输出。
- 仅使用内置语音。
- 实时API调用需要。
OPENAI_API_KEY
Disclosure policy
披露策略
Always include a clear disclosure in user-visible output when speech is produced, for example:
- "This audio was generated by AI text-to-speech."
If a profile provides , use it. Otherwise, use the default disclosure above.
disclosure生成语音时,必须在用户可见的输出中包含明确的披露信息,例如:
- "此音频由AI文本转语音生成。"
如果配置文件中提供了字段,则使用该内容;否则使用上述默认披露文本。
disclosureProfile resolution order
配置文件解析顺序
- Explicit wrapper flags (,
--voice,--speed,--instructions, output path flags).--format - Selected profile ().
--profile - Default profile from profiles file ().
default_profile - Baseline defaults (,
voice=cedar, formatspeed=1.0, modelmp3).gpt-4o-mini-tts-2025-12-15
- 显式的包装器标志(、
--voice、--speed、--instructions、输出路径标志)。--format - 选中的配置文件()。
--profile - 配置文件中的默认配置()。
default_profile - 基线默认值(、
voice=cedar、格式speed=1.0、模型mp3)。gpt-4o-mini-tts-2025-12-15
Workflow configuration precedence
工作流配置优先级
- Explicit user input and wrapper flags.
- Skill-local workflow customization in , when present.
config/customization.yaml - Skill-local defaults in .
config/customization.template.yaml - Workflow defaults described in this skill and .
references/wrapper-contract.md
The local wrapper loads supported customization values from and at runtime. Use skill-local customization to guide wrapper defaults and agent decisions. remains documentation-only because the wrapper script implements only , while the skill-level workflow still treats as the default conversational path.
config/customization.yamlconfig/customization.template.yamlpreferredExecutionModelocal-clidelegate- 显式的用户输入和包装器标志。
- Skill本地工作流自定义(若存在)。
config/customization.yaml - Skill本地默认值()。
config/customization.template.yaml - 本Skill及中描述的工作流默认值。
references/wrapper-contract.md
本地包装器会在运行时从和加载支持的自定义值。使用Skill本地自定义来指导包装器默认值和代理决策。仅作为文档参考,因为包装器脚本仅实现了,而Skill层工作流仍将作为对话场景的默认路径。
config/customization.yamlconfig/customization.template.yamlpreferredExecutionModelocal-clidelegateWorkflow
工作流
- Resolve input text source (or
--text).--text-file - Resolve effective workflow settings using explicit input, skill-local customization, then workflow defaults.
- Resolve profile and defaults using .
references/wrapper-contract.md - Validate configuration against .
references/profile-schema.md - Choose execution mode:
- : call built-in
delegatewith resolved fields.$speech - : run
local-cli.scripts/speak_with_profile.py
- Emit/validate run manifest and include disclosure.
- 解析输入文本源(或
--text)。--text-file - 使用显式输入、Skill本地自定义、工作流默认值来解析实际生效的工作流设置。
- 使用解析配置文件和默认值。
references/wrapper-contract.md - 根据验证配置。
references/profile-schema.md - 选择执行模式:
- :使用解析后的字段调用内置的
delegate。$speech - :运行
local-cli。scripts/speak_with_profile.py
- 生成/验证运行清单并包含披露信息。
Output Contract
输出约定
- : return a user-visible result that confirms speech generation intent, includes the disclosure text, and surfaces the resolved speech settings that matter for the request.
delegate - : produce an audio file at the requested or resolved output path and write an adjacent
local-clifile.<audio>.manifest.json - manifest/result reporting must include:
local-cli- output audio path
- manifest path
- disclosure text
- execution mode ()
local-cli - playback result when or
openis usedafplay
- Playback failures must remain explicit rather than being treated as silent success.
- 模式:返回用户可见的结果,确认语音生成意图,包含披露文本,并展示与请求相关的已解析语音设置。
delegate - 模式:在请求的或解析后的输出路径生成音频文件,并在相邻位置写入
local-cli文件。<audio>.manifest.json - 模式的清单/结果报告必须包含:
local-cli- 输出音频路径
- 清单路径
- 披露文本
- 执行模式()
local-cli - 使用或
open时的播放结果afplay
- 播放失败必须明确返回,而非视为静默成功。
Failure modes
失败场景
- Missing : stop before generation and tell the caller that the local environment must provide the API key.
OPENAI_API_KEY - Missing text source or unreadable text file: fail fast rather than guessing input content.
- Missing profiles file when is requested: fail fast and require the caller to provide a valid JSON or YAML profiles file.
--profile - Invalid profiles file: stop on schema/parse errors and surface the validation failure clearly.
- Unknown profile ID: fail with the known profile list from the supplied profiles file.
- Input over 4096 characters: fail fast and require the caller to split or chunk the input before running.
- Missing compatible speech CLI on the local CLI path: stop and report that must point to a valid speech CLI implementation.
--tts-cli-path - Downstream speech CLI failure: propagate the subprocess failure rather than masking it.
- Playback failure with or
open: return the deterministic playback failure outcome, record it in the manifest, and respectafplay/--stop-on-error.--no-stop-on-error
- 缺少:在生成前终止,并告知调用者本地环境必须提供API密钥。
OPENAI_API_KEY - 缺少文本源或文本文件不可读:快速失败,而非猜测输入内容。
- 当请求时缺少配置文件:快速失败,要求调用者提供有效的JSON或YAML配置文件。
--profile - 无效的配置文件:在 schema/解析错误处终止,并清晰展示验证失败信息。
- 未知的配置文件ID:失败并返回提供的配置文件中的已知配置文件列表。
- 输入超过4096字符:快速失败,要求调用者在运行前拆分或分块输入。
- 本地CLI路径中缺少兼容的语音CLI:终止并报告必须指向有效的语音CLI实现。
--tts-cli-path - 下游语音CLI失败:传播子进程失败,而非掩盖。
- 使用或
open播放失败:返回确定性的播放失败结果,记录到清单中,并遵循afplay/--stop-on-error设置。--no-stop-on-error
References
参考资料
- Profile schema and validation rules:
references/profile-schema.md - Starter profile set and examples:
references/starter-profiles.md - Adapter contract and mode behavior:
references/wrapper-contract.md - Skill-local workflow customization:
references/customization.md
- 配置文件schema和验证规则:
references/profile-schema.md - 初始配置文件集和示例:
references/starter-profiles.md - 适配器约定和模式行为:
references/wrapper-contract.md - Skill本地工作流自定义:
references/customization.md
Validation helper
验证工具
Use to verify required manifest keys:
scripts/validate_manifest.pybash
uv run --group dev python speak-with-profile/scripts/validate_manifest.py path/to/output/file.manifest.json使用验证清单的必填字段:
scripts/validate_manifest.pybash
uv run --group dev python speak-with-profile/scripts/validate_manifest.py path/to/output/file.manifest.json