Borrowing it
Nothing to install: this file belongs to wangjialiang678/claude-omo-agentflow. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/wangjialiang678/claude-omo-agentflow/main/.claude/skills/switch-agentflow/SKILL.mdgit clone --depth 1 https://github.com/wangjialiang678/claude-omo-agentflowWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wangjialiang678/claude-omo-agentflow/switch-agentflow)<a href="https://agentmods.dev/skills/wangjialiang678/claude-omo-agentflow/switch-agentflow"><img src="https://agentmods.dev/badge/skills/wangjialiang678/claude-omo-agentflow/switch-agentflow/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wangjialiang678/claude-omo-agentflow/switch-agentflow"><img src="https://agentmods.dev/badge/skills/wangjialiang678/claude-omo-agentflow/switch-agentflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00115 | $0.02456 |
| Opus 5 | $0.00057 | $0.01228 |
| Sonnet 5 | $0.00023 | $0.00491 |
| Haiku 4.5 | $0.00012 | $0.00246 |
Grade B, and why
switch-agentflow scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
echo "project:$(test -f .claude/agentflow/state/mode.txt && cat .claude/agentflow/state/mode.txt || echo 'NOT_DEPLOYED')" && echo "global:$(test -f "$HOME/.claude/agentflow/state/mode.txt" && cat "$HOME/.claude/agentflow How it starts
The opening of the file, as written. The whole thing — 274 lines — stays where its author put it; the contents beside it link to each section on GitHub.
掌天瓶部署与模式管理
Step 0: 检测部署状态
用 Bash 检查两个位置(一条命令):
echo "project:$(test -f .claude/agentflow/state/mode.txt && cat .claude/agentflow/state/mode.txt || echo 'NOT_DEPLOYED')" && echo "global:$(test -f "$HOME/.claude/agentflow/state/mode.txt" && cat "$HOME/.claude/agentflow/state/mode.txt" || echo 'NOT_DEPLOYED')"
根据结果分流:
| 项目级 | 全局级 | → 行为 |
|---|---|---|
| 已部署 | 已部署 | 双范围模式 → 切换/状态时询问操作哪个范围 |
| 已部署 | 未部署 | 仅项目 → 直接操作项目 mode.txt |
| 未部署 | 已部署 | 仅全局 → 直接操作全局 mode.txt |
| 未部署 | 未部署 | 未部署 → 进入部署流程(Step 1) |
模式切换(已部署时)
单范围
- 启用:写入
on到对应mode.txt - 关闭:写入
off到对应mode.txt - 状态:读取并报告
双范围
用 AskUserQuestion 询问:
掌天瓶在项目和全局都已部署。要操作哪个?
A. 当前项目
B. 全局(影响所有项目)
C. 两个都切换
状态查询
无论哪种情况,status 命令应显示所有已部署范围的状态:
掌天瓶状态:
- 项目级:on(.claude/agentflow/state/mode.txt)
- 全局级:off(~/.claude/agentflow/state/mode.txt)
部署流程(未部署时)
Step 1: 询问部署范围
用 AskUserQuestion 询问:
掌天瓶尚未部署。请选择部署范围:
A. 当前项目(推荐)
- 仅对本项目生效
- hooks 使用相对路径,可移植
B. 全局
- 对所有项目生效
- hooks 使用绝对路径(machine-specific)
C. 两者都部署
- 各自独立的 mode.txt 控制
记录用户选择,后续步骤根据范围调整目标路径。
Step 2: 环境检查
用 Bash 执行:
# 1. jq 是否安装(必需)
command -v jq >/dev/null 2>&1 && echo "jq: OK" || echo "jq: MISSING — brew install jq"
# 2. 目标目录写权限
test -w "${TARGET_DIR}" && echo "write: OK" || echo "write: NO_PERMISSION"
其中 TARGET_DIR:
- 项目级 = 当前工作目录
- 全局级 =
$HOME
如果 jq 缺失,告知用户安装方法并等待确认后继续。 如果权限不足,报告并停止。
Step 3: 确认源码路径
自动检测:检查当前项目是否就是 agentflow 源码仓库:
# 检查标志文件
test -f AI-DEPLOY.md && test -f .claude/agentflow/agents.md && echo "IS_SOURCE_REPO" || echo "NOT_SOURCE_REPO"
-
如果是源码仓库:
- 项目级部署:无需复制,文件已在位,只需初始化状态文件和配置 settings.json
- 全局级部署:从当前项目复制到
$HOME/.claude/
-
如果不是源码仓库:
- 用 AskUserQuestion 询问源码路径
- 如果用户没有,引导克隆:
git clone https://github.com/wangjialiang678/claude-omo-agentflow.git
Step 4: 复制文件
读取源码仓库中的 AI-DEPLOY.md,按其 Step 3-5 的文件清单执行复制。
关键区别:
| 项目级 | 全局级 | |
|---|---|---|
| 目标根目录 | 当前工作目录 | $HOME |
| .claude/ 位置 | <project>/.claude/ |
$HOME/.claude/ |
| 复制方式 | cp $SOURCE/.claude/xxx .claude/xxx |
cp $SOURCE/.claude/xxx $HOME/.claude/xxx |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 274 lines · 115 tokens per session scan B 613a3a4cd127
switch-agentflow is a skill published in the GitHub repository wangjialiang678/claude-omo-agentflow (2 stars, last pushed 6mo ago), licensed MIT. It adds 115 tokens to every session and 2,456 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…