一键导入
prompt-iteration
Use when iteratively improving agent prompts through automated LLM-as-Judge evaluation. Runs eval→fix→commit loop with circuit breakers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when iteratively improving agent prompts through automated LLM-as-Judge evaluation. Runs eval→fix→commit loop with circuit breakers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when asked to regenerate audio examples with shorthand like "L15 > P1 > E2" or "lesson 15 pattern 1 example 2" - runs regenerate_example.py with correct parameters
Start the TTS server in HTTP mode for audio generation
Stop the TTS server
| name | prompt-iteration |
| description | Use when iteratively improving agent prompts through automated LLM-as-Judge evaluation. Runs eval→fix→commit loop with circuit breakers. |
Iteratively improve teaching agent prompts using automated evaluation with local Qwen 2.5-7B as judge.
Before starting, verify:
vLLM is running:
curl http://localhost:8004/v1/models
Golden dataset exists:
ls tests/golden/
Create iteration branch:
git checkout -b eval/prompt-iteration-$(date +%Y%m%d-%H%M)
| Guardrail | Value |
|---|---|
| Max iterations | 5 |
| Success gate | 80% pass rate |
| Circuit breaker 1 | Score drops >20% on any dimension |
| Circuit breaker 2 | 3 consecutive iterations with no improvement |
| Rollback mechanism | Git commit after each iteration |
Run evaluation on all dimensions:
python -m tests.evaluation.cli --dimension all --output baseline.json
Record the baseline pass rate for each dimension in a TodoWrite checklist.
From baseline.json, find the dimension with lowest pass rate. Focus on one dimension at a time.
Run verbose evaluation on the failing dimension:
python -m tests.evaluation.cli --dimension <failing_dimension> --verbose
Review failed test cases to understand the failure pattern:
Modify the relevant prompt file based on analysis:
| Dimension | Primary Prompt File |
|---|---|
| language_choice | src/backend/app/prompts/agent/mode_practice.md |
| tool_usage | src/backend/app/prompts/agent/tools.md |
| output_cleanliness | src/backend/app/prompts/agent/tools.md |
| confusion_recovery | src/backend/app/prompts/agent/base.md |
| persona_consistency | src/backend/app/prompts/agent/mode_practice.md |
| curriculum_alignment | src/backend/app/prompts/agent/base.md |
Make targeted, minimal changes. Do not rewrite the entire prompt.
Run evaluation on the dimension you're fixing:
python -m tests.evaluation.cli --dimension <dimension> --output iteration-N.json
Compare iteration-N.json to baseline.json:
Did any dimension drop >20%?
git checkout src/backend/app/prompts/ and STOPDid the target dimension improve?
3 consecutive no-improvement?
If pass rate improved:
git add src/backend/app/prompts/
git commit -m "prompt: improve <dimension> pass rate N% -> M%
- [Description of what changed]
- [Why this should help]
Tested with: python -m tests.evaluation.cli --dimension <dimension>
"
Continue loop until one of these conditions:
After loop completes, produce this summary:
## Evaluation Summary
**Baseline**: 45% overall
**Final**: 82% overall
**Iterations**: 4
**Status**: SUCCESS / STOPPED (reason)
### Dimension Results
| Dimension | Baseline | Final | Change |
|-----------|----------|-------|--------|
| language_choice | 40% | 85% | +45% |
| tool_usage | 60% | 95% | +35% |
| output_cleanliness | 50% | 90% | +40% |
| confusion_recovery | 30% | 70% | +40% |
| persona_consistency | 40% | 80% | +40% |
| curriculum_alignment | 50% | 75% | +25% |
### Commits Made
- `abc123` prompt: improve language_choice 40% -> 65%
- `def456` prompt: improve tool_usage 60% -> 95%
- `ghi789` prompt: improve output_cleanliness 50% -> 90%
### Next Steps
- [If success] Ready to merge to main
- [If stopped] Manual review needed for dimension X
# Full evaluation
python -m tests.evaluation.cli --dimension all
# Single dimension
python -m tests.evaluation.cli --dimension language_choice --verbose
# Check judge availability
python -m tests.evaluation.cli --check
# List test cases
python -m tests.evaluation.cli --list
# A/B comparison (if testing prompt variants)
python -m tests.evaluation.cli --compare prompts/v1.md prompts/v2.md
src/backend/app/prompts/agent/
├── base.md # Core rules, language handling, confusion recovery
├── mode_help.md # Vocabulary helper mode behavior
├── mode_practice.md # Conversation practice mode behavior
└── tools.md # Tool definitions (speak, render_vocabulary, etc.)