用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill agent-usage-optimizer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | agent-usage-optimizer |
| version | 1.0.0 |
| category | ai |
| description | Reads quota state and recommends optimal Codex/Codex/Gemini allocation per task |
| type | reference |
| capabilities | ["quota-aware routing","route-mapping","headroom display"] |
| requires | ["~/.cache/agent-quota.json"] |
| tags | ["quota-management","multi-provider","routing","Codex","codex","gemini","gemini-batching","agent-labels"] |
Deterministic agent routing using agent: labels on GitHub issues — no separate queue file needed:
# Route tasks to agents via labels
gh issue edit <issue-number> --add-label "agent:gemini"
gh issue edit <issue-number> --add-label "agent:Codex"
gh issue edit <issue-number> --add-label "agent:codex"
View agent queues:
gh issue list --label "agent:gemini,priority:high"
gh issue list --label "agent:Codex,priority:high"
gh issue list --label "agent:codex,priority:high"
Reassign tasks:
gh issue edit <issue-number> --remove-label "agent:gemini" --add-label "agent:Codex"
Group 5-6 related research/planning tasks into ONE Gemini session. Each task produces a file + commit.
Option A — OpenRouter (recommended for non-interactive/overnight):
hermes chat --provider openrouter --model google/gemini-2.5-pro --quiet -q "
You are the ACE Engineer advance scout. Working directory: /mnt/local-analysis/workspace-hub.
<task description>
"
This works reliably for one-shot/overnight execution. Costs OpenRouter credits but avoids 403 errors.
Option B — Interactive session (Copilot provider):
hermes chat --provider copilot --model gemini-2.5-pro -q "task"
Only works in interactive mode with --yolo flag for unattended runs.
h-router-gemini -q — alias does not work for one-shothermes chat --provider copilot --model gemini-2.5-pro --quiet -q — returns HTTP 403hermes chat --provider copilot --model gemini-2.5-pro -q (interactive) — returns HTTP 403| Provider | Model | Interactive | One-shot (-q) | Notes |
|---|---|---|---|---|
| openrouter | google/gemini-2.5-pro | Yes | Yes | Recommended for batches |
| copilot | gemini-2.5-pro | Yes (with --yolo) | No (403) | Only for interactive sessions |
For overnight batches, use openrouter provider or delegate to subagents (which run on current model):
# Per-task Gemini execution:
hermes chat --provider openrouter --model google/gemini-2.5-pro --quiet -q "<self-contained-prompt>"
# Or use subagent (runs on current model, NOT Gemini):
# delegate_task(goal="research task", toolsets=["terminal", "file"])
Key parameters:
--quiet — suppresses banners for programmatic use--provider openrouter --model google/gemini-2.5-pro — working Gemini pathFor heavy coding tasks, use:
# Complex implementation (Codex Opus)
hermes chat --provider anthropic -m Codex-opus-4-6 -q "<task>"
# Bounded tests + review (Codex via OpenAI)
hermes chat --provider openai-codex -q "<task>"
/session-start to set provider allocation for the sessionDo not assume session logs alone are enough to optimize quota burn. First verify all three layers:
Live quota snapshot
bash scripts/ai/assessment/query-quota.sh --refresh --json
config/ai-tools/agent-quota-latest.jsonsource: unavailablesource: estimatedweek_pct, pct_remaining, hours_to_resetHistorical quota ledger freshness
~/.agent-usage/weekly-log.jsonlSession coverage freshness
bash scripts/cron/hermes-session-export.sh
bash scripts/cron/codex-session-export.sh
bash scripts/cron/gemini-session-export.sh
bash scripts/cron/provider-session-ecosystem-audit.sh
analysis/provider-session-ecosystem-audit.json and docs/reports/provider-session-ecosystem-audit.md for actual usage patterns.Before trusting the optimizer, verify quota logging is actually scheduled. In practice, it is easy to have:
scripts/ai/assessment/query-quota.shconfig/ai-tools/agent-quota-latest.json~/.agent-usage/weekly-log.jsonlbut no scheduled task keeping them fresh.
Check config/scheduled-tasks/schedule-tasks.yaml for explicit quota-refresh / usage-log jobs. If missing, record that as a telemetry gap and do not overstate optimization confidence.
A reusable provider-utilization control plane now exists in workspace-hub. Prefer these generated artifacts over ad hoc interpretation when deciding where to route work:
config/ai-tools/provider-utilization-weekly.jsondocs/reports/provider-utilization-weekly.mdconfig/ai-tools/provider-routing-scorecard.jsondocs/reports/provider-routing-scorecard.mdconfig/ai-tools/provider-work-queue.jsondocs/reports/provider-work-queue.mdconfig/ai-tools/provider-autolabel-candidates.jsondocs/reports/provider-autolabel-candidates.mddocs/reports/provider-routing-system-handoff-YYYY-MM-DD.mdSupporting scripts:
scripts/ai/credit-utilization-tracker.pyscripts/ai/provider-routing-scorecard.pyscripts/ai/provider-work-queue.pyscripts/ai/provider-autolabel.pyscripts/cron/provider-utilization-refresh.shThe scheduled task is:
provider-utilization-refresh in config/scheduled-tasks/schedule-tasks.yamlUse this order:
bash scripts/cron/provider-utilization-refresh.sh
Auto-labeling should remain conservative. The current reusable pattern is:
agent:* labelstatus:plan-approved) firstCurrent command pattern:
# Dry run
uv run --no-project python scripts/ai/provider-autolabel.py
# Conservative live apply
uv run --no-project python scripts/ai/provider-autolabel.py --apply --limit 3
Confidence threshold lessons from live use:
>= 0.90 is reasonable for safe automatic labeling0.60 is still useful for reporting, but not for automatic label applicationIf the control plane is working but still imperfect, the next high-value upgrades are:
When the goal is not just analysis but active weekly credit utilization, use this artifact chain:
bash scripts/cron/provider-utilization-refresh.sh
This should regenerate:
config/ai-tools/provider-utilization-weekly.jsondocs/reports/provider-utilization-weekly.mdconfig/ai-tools/provider-routing-scorecard.jsondocs/reports/provider-routing-scorecard.mdconfig/ai-tools/provider-work-queue.jsondocs/reports/provider-work-queue.mdconfig/ai-tools/provider-autolabel-candidates.jsondocs/reports/provider-autolabel-candidates.mdprovider-routing-scorecard.json combines current-week utilization with provider session audit hygieneprovider-work-queue.json combines the scorecard with live gh issue list datastatus:plan-approved issues firstagent:* labels as authoritative when presentAuto-labeling GitHub issues is useful, but only if conservative.
Use this pattern:
uv run --no-project python scripts/ai/provider-autolabel.py
uv run --no-project python scripts/ai/provider-autolabel.py --apply --limit 3
Recommended guardrails:
agent:* labelstatus:plan-approved--limit 3) until confidence is proven over multiple cyclesHigh-confidence pattern observed in practice:
Do NOT auto-label broad or ambiguous items just because the provider is underused.
For current workspace-hub-style ecosystems, these rules proved reusable:
When the repo already has provider session exports and a provider audit, do not stop at a narrative recommendation. Build a 3-layer control loop:
Utilization layer
config/ai-tools/agent-quota-latest.json~/.agent-usage/weekly-log.jsonllogs/orchestrator/*/session_*.jsonlconfig/ai-tools/provider-utilization-weekly.jsondocs/reports/provider-utilization-weekly.mdweek_messages/weekly_limit, week_pct)activity_vs_recent_peak when quota telemetry is weakRouting-scorecard layer
analysis/provider-session-ecosystem-audit.jsonconfig/ai-tools/provider-routing-scorecard.jsondocs/reports/provider-routing-scorecard.mdgemini, codex, Codex)Live issue-queue layer
gh issue list --state open --limit 200 --json ...config/ai-tools/provider-work-queue.jsondocs/reports/provider-work-queue.mdagent:* labels firststatus:plan-approved or explicit agent ownership)Codex
Codex
Gemini
Do NOT mass-apply agent: labels just because the scorecard exists.
Preferred sequence:
agent: labels to the clearest casesReason:
A good recurring wrapper should:
bash scripts/ai/assessment/query-quota.sh --refresh --loglogs/quality/provider-utilization-refresh-YYYYMMDD.logA practical schedule is every 4 hours.
When aggregating provider activity from exported session_*.jsonl logs, older exports may not include reliable runtime session_id values. If you fall back to per-record keys like tool + ts, you will massively overcount sessions.
Safer fallback:
session_id exists, use itsession_YYYYMMDD file identity rather than the individual record identityThis keeps session counts directionally sane even when older exported logs are coarse.
When the repo already contains session exports plus provider audit artifacts, the most reusable pattern is:
bash scripts/ai/assessment/query-quota.sh --refresh --log
bash scripts/cron/hermes-session-export.sh
bash scripts/cron/codex-session-export.sh
bash scripts/cron/gemini-session-export.sh
bash scripts/cron/provider-session-ecosystem-audit.sh
uv run --no-project python scripts/ai/credit-utilization-tracker.py \
--weeks 8 \
--output-json config/ai-tools/provider-utilization-weekly.json \
--output-md docs/reports/provider-utilization-weekly.md
uv run --no-project python scripts/ai/provider-routing-scorecard.py
Canonical outputs:
config/ai-tools/provider-utilization-weekly.jsondocs/reports/provider-utilization-weekly.mdconfig/ai-tools/provider-routing-scorecard.jsondocs/reports/provider-routing-scorecard.mdUse the routing scorecard to decide where the next work packets go:
codex underused + quota visible + low migration debt -> route bounded implementation, tests, cleanup, crisp issue execution there firstgemini underused + weak/estimated telemetry -> route batched research/recon/risk-analysis packets there, but treat capacity as directional rather than exactCodex underused + high stale-read debt -> reserve for adversarial review, plan review, and long-context synthesis; reduce stale-path drift before trying to scale load thereRecommended practical ordering in workspace-hub is not purely "lowest utilization first". Combine:
That is why Gemini and Codex may both rank ahead of Codex even when Codex appears idle.
In workspace-hub this is now best run via:
scripts/cron/provider-utilization-refresh.shprovider-utilization-refreshlogs/quality/provider-utilization-refresh-*.logThe wrapper should always verify that all four artifacts exist after generation, not just the quota snapshot and utilization report.
Lessons learned while operationalizing this:
week_pct or week_messages/weekly_limit)pct_remaining from an unavailable source as trustworthy weekly utilizationtoday_messages/daily_limit from estimated is useful only as a weak hint; keep activity fallback activesession_id, do NOT derive session counts from per-record timestamps/tool names or you will massively overcount sessions; fall back to file identity insteadmissing_repo_reads, migration-debt hints, python3 density)Write outbound email and external messages in Vamsee Achanta's voice — a subtle offer to help, never bold or rash claims. Load before drafting ANY email, LinkedIn/Collide reply, proposal note, or outreach sent under his name.
Save/publish analysis or computation results from ANY ecosystem repo to Hugging Face as a queryable, viewer-renderable dataset. Use when the user wants to "save results to hugging face", "publish dataset to HF", "hugging face data saving", "save analysis results", "hf dataset", "make results queryable", or "render via datasets-server API". Reshapes nested results into flat parquet tables, writes a dataset card with a viewer `configs:` block and provenance, applies license/public-vs-private routing, enforces a domain data-quality gate (faithful-to-source != correct), publishes to `aceengineer/<repo>-<projection>`, and verifies via the datasets-server API.
Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.