Vincent

Singleshot Prompt Testing

AI 智慧體v0.1.0
作者:Vincent更新於 2026-05-11singleshot-prompt-testing@clawhub_vincentzhangz/singleshot-prompt-testing
提示詞最佳化工具呼叫#Prompt

據 AlphaMoat 統計,截至 2026-09,Singleshot Prompt Testing 累計下載 2,660 次、獲 3 個星標,在全部 5,078 個 AI 技能中排名第 3,974 位,在「AI 智慧體」分類(969 個)中排名第 798 位。

累計安裝
145
累計下載
2660
星標
3
全站排名
#3,974
全站前 79% · 「AI 智慧體」前 83%
平台累計安裝累計下載星標評論
ClawHub ↗7422743-
SkillHub ↗14526603—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

透過單次呼叫或設定檔生成基線與變體報告,支援跨服務供應商比較及圖像輸入。效率分析使用 -d 輸出細節、-r 儲存報告,再據報告調整提示詞或輸出上限。成本為估算,源文報告數字只是範例,不代表本次實測或節省保證。

資料釋出於 2026-10-26

可以用來做什麼

  • 比較提示詞與模型呼叫開銷

什麼時候用

  • 上線前需要檢查提示詞輸出和資源使用時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

為這兩個提示詞生成詳細報告並比較 token 與估算成本

使用條件

依據技能文件中的宣告整理,未經實際安裝或執行驗證。

鑑權說明
按所選服務設定 OPENAI_API_KEY、ANTHROPIC_API_KEY 或 OPENROUTER_API_KEY;Ollama 是本機分支。
配置要求
  • 需要安裝 singleshot,可透過 Homebrew 或 Cargo。

月度資料趨勢

累計下載2660
1521213327442026-03 · 累計下載 16052026-05 · 累計下載 18522026-06 · 累計下載 19872026-07 · 累計下載 21982026-08 · 累計下載 23182026-09 · 累計下載 266026-0326-09
星標3
2342026-03 · 星標 32026-05 · 星標 32026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092660—3
2026-082318+5.5%3
2026-072198+10.6%3
2026-061987+7.3%3
2026-051852—3
2026-031605—3

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

3.8 KB · ClawHub v0.1.0
# Singleshot Prompt Testing & Optimization Skill

## Description

Prompt cost testing with single shot

## Installation

```bash
brew tap vincentzhangz/singleshot
展開全部(共 181 行)
brew install singleshot
```

Or: `cargo install singleshot`

## When to Use

- Testing new prompts before openclaw implementation
- Benchmarking prompt variations for token efficiency
- Comparing model performance and costs
- Validating prompt outputs before production

## Core Commands

**Always use `-d` (detail) and `-r` (report) flags for efficiency analysis:**

```bash
# Basic test with full metrics
singleshot chat -p "Your prompt" -P openai -d -r report.md

# Test with config file
singleshot chat -l config.md -d -r report.md

# Compare providers
singleshot chat -p "Test" -P openai -m gpt-4o-mini -d -r openai.md
singleshot chat -p "Test" -P anthropic -m claude-sonnet-4-20250514 -d -r anthropic.md

# Batch test variations
for config in *.md; do
  singleshot chat -l "$config" -d -r "report-${config%.md}.md"
done
```

## Report Analysis Workflow

### 1. Generate Baseline
```bash
singleshot chat -p "Your prompt" -P openai -d -r baseline.md
cat baseline.md
```

### 2. Optimize & Compare
```bash
# Create optimized version, test, and compare
cat > optimized.md << 'EOF'
---provider---
openai
---model---
gpt-4o-mini
---max_tokens---
200
---system---
Expert. Be concise.
---prompt---
Your optimized prompt
EOF

singleshot chat -l optimized.md -d -r optimized-report.md

# Compare metrics
echo "Baseline:" && grep -E "(Tokens|Cost)" baseline.md
echo "Optimized:" && grep -E "(Tokens|Cost)" optimized-report.md
```

## Report Metrics

Reports contain:
```markdown
## Token Usage
- Input Tokens: 245
- Output Tokens: 180
- Total Tokens: 425

## Cost (estimated)
- Input Cost: $0.00003675
- Output Cost: $0.000108
- Total Cost: $0.00014475

## Timing
- Time to First Token: 0.45s
- Total Time: 1.23s
```

## Optimization Strategies

1. **Test with cheaper models first:**
   ```bash
   singleshot chat -p "Test" -P openai -m gpt-4o-mini -d -r report.md
   ```

2. **Reduce tokens:**
   - Shorten system prompts
   - Use `--max-tokens` to limit output
   - Add "be concise" to system prompt

3. **Test locally (free):**
   ```bash
   singleshot chat -p "Test" -P ollama -m llama3.2 -d -r report.md
   ```

## Example: Full Optimization

```bash
# Step 1: Baseline (verbose)
singleshot chat \
  -p "How do I write a Rust function to add two numbers?" \
  -s "You are an expert Rust programmer with 10 years experience" \
  -P openai -d -r v1.md

# Step 2: Read metrics
cat v1.md
# Expected: ~130 input tokens, ~400 output tokens

# Step 3: Optimized version
singleshot chat \
  -p "Rust function: add(a: i32, b: i32) -> i32" \
  -s "Rust expert. Code only." \
  -P openai --max-tokens 100 -d -r v2.md

# Step 4: Compare
echo "=== COMPARISON ==="
grep "Total Cost" v1.md v2.md
grep "Total Tokens" v1.md v2.md
```

## Quick Reference

```bash
# Test with full details
singleshot chat -p "prompt" -P openai -d -r report.md

# Extract metrics
grep -E "(Input|Output|Total)" report.md

# Compare reports
diff report1.md report2.md

# Vision test
singleshot chat -p "Describe" -i image.jpg -P openai -d -r report.md

# List models
singleshot models -P openai

# Test connection
singleshot ping -P openai
```

## Environment Variables

```bash
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENROUTER_API_KEY="sk-or-..."
```

## Best Practices

1. **Always use `-d`** for detailed token metrics
2. **Always use `-r`** to save reports
3. **Always `cat` reports** to analyze metrics
4. **Test variations** and compare costs
5. **Set `--max-tokens`** to control costs
6. **Use gpt-4o-mini** for testing (cheaper)

## Troubleshooting

- **No metrics**: Ensure `-d` flag is used
- **No report file**: Ensure `-r` flag is used
- **High costs**: Switch to gpt-4o-mini or Ollama
- **Connection issues**: Run `singleshot ping -P <provider>`

「AI 智慧體」分類下的熱門技能

self-improving agentAI 智慧體

記錄自身發現以實現自我改進的技能

↓ 129萬★ 4521pskoett
Find SkillsAI 智慧體

幫助使用者發現和安裝智慧體技能,當用戶詢問如「如何做X」、「找X的技能」、「有能做...的嗎」等問題時

↓ 110.3萬★ 1778桂皮
Agent BrowserAI 智慧體

給 AI agent 用的瀏覽器自動化命令列技能。

↓ 90.9萬★ 991Nicolas Kleiber
Self-Improving + Proactive AgentAI 智慧體

自我反思+自我批評+自我學習+自組織記憶。智慧體評估自身工作、發現錯誤並持續改進。

↓ 44.4萬★ 1606Iván
Skill VetterAI 智慧體

在安裝第三方技能之前,按清單審查來源、許可權與危險模式的技能。

↓ 33萬★ 1323spclaudehome
ontologyAI 智慧體

類型化知識圖譜,用於結構化智慧體記憶與可組合技能。適用於以下場景:建立/查詢實體(人物、專案、任務、事件、文件)、關聯相關物件、強制執行約束、將多步操作規劃為圖譜變換,或當技能需要共享狀態時。觸發關鍵詞包括"記住""我知道關於什麼""將X連結到Y""顯示依賴關係"、實體增刪改查操作,以及跨技能資料訪問。

↓ 29.4萬★ 788oswalpalash
Proactive AgentAI 智慧體

將 AI 代理從任務執行者轉變為能夠預見需求、持續最佳化的主動夥伴。現已支援 WAL Protocol、Working Buffer、Autonomous Crons 及經過實戰驗證的模式。屬於 Hal Stack 🦞。

↓ 28.8萬★ 913halthelobster
Skill CreatorAI 智慧體

建立有效技能指南。當用戶希望建立新技能(或更新現有技能)以利用專業知識、工作流程或工具整合擴充套件 Claude 的能力時,應使用此技能。

↓ 23.8萬★ 473chindden

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。