Imported from Onlyaguest/ViviStableSkills (
prompt-tuner/SKILL.md). Install upstream withnpx skills add Onlyaguest/ViviStableSkills --skill prompt-tuner. Copyright stays with the author.
prompt-tuner
Treat prompts like code: prompt.txt is the source, cases.yaml is the golden dataset, tuner.py is the test runner, and CHANGELOG.md tracks prompt logic changes.
Use this skill when
- The user says "帮我优化这个 prompt"
- The user wants prompt regression testing
- The project already uses
cases.yaml,prompt.txt, or a golden dataset - A prompt behaves badly and needs repeatable debugging
- The team wants TDD for prompts instead of one-off prompt edits
Workflow
- Run local structure check first.
- If files are valid, run real regression tests with configured provider and API key.
- Add failing cases before editing prompt rules.
- Update version markers in
prompt.txtandCHANGELOG.mdafter changes.
Commands
Local check without API calls:
python3 tuner.py --check
Run full regression:
python3 tuner.py
Optional provider override:
python3 tuner.py --provider openai --model gpt-4o
Inputs and outputs
- Input:
prompt.txt,cases.yaml,.env - Output: pass/fail table in terminal, plus raw mismatches for failed cases
Validation
Minimum validation command:
python3 tuner.py --check
This checks:
- required files exist
prompt.txthas a version headercases.yamlloads correctly- each case has
inputandexpected
Constraints
- Do not change prompt behavior without adding or updating a regression case
- Prefer
--checkfor audits and review when API credentials are not configured - Keep prompt version in
prompt.txtaligned withCHANGELOG.md