Student guide: Build a Safe Text-to-Speech Skill
Labs reference: Student guide: Build a Safe Text-to-Speech Skill.
Use this guide with the canonical learner path. The objective is not to make a big audio system. It is to make one small command you can explain, test, and trust enough to review.
Before you start
You need a local project folder, a coding agent, a way to listen to an MP3, and the lab’s planning worksheet and secrets checklist. For the live finish, use your own provider account, a small spend limit or alert, and a short original, fictional, or public-domain script.
Do not put a key in chat, a prompt, source code, screenshots, notes, or a Git repository. If you cannot establish that boundary, complete the dry-run portion and stop there.
Step 1: Write the agreement before asking for code
Fill in the worksheet. State:
- one purpose, such as a 10–20 second community-event reminder;
- one approved voice name or slug;
- either direct text or one text file, never both;
- one explicit output path;
- what happens if the output already exists; and
- the failures you expect before a live request.
Completion check: you can explain the command in one sentence and name what it refuses.
Step 2: Establish the secret boundary
In the learner project, add a committed, value-free .env.example containing only the needed variable name. Create your real local .env separately. Verify that the real file is ignored before you add a value.
Completion check: git status does not show the real .env, and your key has not been pasted into the coding-agent conversation.
If that check fails, stop. Remove the exposed value and rotate or revoke it if it left your local secret boundary.
Step 3: Ask for the smallest command
Give the coding agent the reviewed worksheet and the tool-neutral prompt recipe. Ask it to propose the implementation and its test plan first. A useful command shape is:
voiceover --voice <approved-slug> (--text <text> | --text-file <path>) --out <path>.mp3 [--force] [--dry-run]
Your command should reject an unknown voice, a missing output path, missing or conflicting text input, missing credentials, and an existing file without --force.
Completion check: you can point to where the tool resolves an approved voice and where it reads the credential at runtime without printing it.
Step 4: Prove the failure paths first
Run the dry run, then intentionally make the command fail in the five ways listed above. Record only the outcome category—never a key, request header, or raw provider error that might contain sensitive context.
Recovery tip: a failure is useful evidence. Fix the command or the plan; do not bypass a refusal merely to reach the live request.
Completion check: every planned failure is either rejected clearly or has a written reason it needs another implementation pass.
Step 5: Make one small live audio file
Confirm the account’s spend guardrail. Use an original, fictional, public-domain, or otherwise authorized script of no more than two short sentences. Choose the voice deliberately and use an explicit output path.
Listen to the entire result. Record the approved voice slug, provider/model label, character or billable count if provided, output filename, duration, and your listening result. Do not record the key.
Completion check: the MP3 has positive duration, is intelligible, and has a short human review note explaining whether it is usable.
Step 6: Decide what remains human
Write a brief release decision: is the script accurate? Does the selected voice fit the audience? Do you have permission to use the text and voice? Are captions or a transcript needed? Is this merely a test, or ready for a particular use?
The answer may be “not ready.” Generating an MP3 is technical evidence, not editorial or accessibility approval.
Finish line
You are done when you have a reviewed plan; an ignored local secret; a command that passes its dry run and negative tests; one short, authorized MP3; a secret-free receipt; and a human listening/release note. Keep voice cloning as an idea note only—do not upload a voice sample or create a clone in this lab.
Source: labs/build-a-safe-text-to-speech-skill/companions/student-step-by-step.md