A reusable Codex Skill and PowerShell automation module for preparing, sending, and verifying one-to-one SMS messages through Microsoft Phone Link.
- Uses Windows UI Automation instead of mouse coordinates or foreground URI fallback.
- Waits for the target number to be visibly accepted before writing the message body.
- Keeps the user's foreground window unchanged during normal operation.
- Normalizes and validates mainland China mobile numbers.
- Prepares drafts without sending.
- Requires an explicit
-Confirmedswitch for sending. - Rechecks recipient and exact body immediately before send.
- Detects visible
sent,sending, andfailedstates. - Avoids sending an identical recipient-and-body pair twice when it is visible in Phone Link.
- Windows 10/11 with Microsoft Phone Link installed and open.
- iPhone or Android phone connected with messaging permission.
- PowerShell 7 (
pwsh) recommended; Windows PowerShell 5.1 also works.
git clone https://github.com/CTctikki/windows-phonelink-sms-skill.git "$env:USERPROFILE\.codex\skills\windows-phonelink-sms"Restart Codex after installation, then invoke $windows-phonelink-sms.
Inspect the connection:
pwsh -NoProfile -File scripts/phone-link-sms.ps1 -Action inspectPrepare a draft without sending:
pwsh -NoProfile -File scripts/phone-link-sms.ps1 `
-Action prepare `
-PhoneNumber "13800138000" `
-Message "示例短信,请勿实际发送。"After confirming the exact recipient and body with the user, send:
pwsh -NoProfile -File scripts/phone-link-sms.ps1 `
-Action send `
-PhoneNumber "13800138000" `
-Message "示例短信,请勿实际发送。" `
-ConfirmedVerify an existing message:
pwsh -NoProfile -File scripts/phone-link-sms.ps1 `
-Action verify `
-PhoneNumber "13800138000" `
-Message "示例短信,请勿实际发送。"Preview a private CSV with columns store_name,phone_number,message:
pwsh -NoProfile -File scripts/phone-link-sms-batch.ps1 `
-Action preview -CsvPath "C:\private\sms-batch.csv"After confirming that exact fixed batch with the user:
pwsh -NoProfile -File scripts/phone-link-sms-batch.ps1 `
-Action send -CsvPath "C:\private\sms-batch.csv" `
-Confirmed -DelaySeconds 5 -MaxMessages 20The batch stops on the first unresolved or failed result, clears any unsent body, and writes <batch>.results.csv after each processed row. Rerunning the same fixed batch is safe because visible identical messages are returned as already_sent.
All commands return JSON. A sent result indicates no visible Phone Link failure; it does not prove carrier delivery or recipient receipt.
- Do not commit real recipients, merchant lists, contact workbooks, message bodies, or send logs.
- Confirm exact recipients and text at action time before external sending.
- Use small batches, reasonable pacing, and only authorized business contacts.
- Stop on the first mismatch or failure.
pwsh -NoProfile -File tests/test_helpers.ps1
pwsh -NoProfile -File tests/test_batch.ps1
python "$env:USERPROFILE\.codex\skills\.system\skill-creator\scripts\quick_validate.py" .MIT