Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/cloudai-x/claude-workflow-v2/refactor-guidedgit clone --depth 1 https://github.com/CloudAI-X/claude-workflow-v2Wrote 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/commands/cloudai-x/claude-workflow-v2/refactor-guided)<a href="https://agentmods.dev/commands/cloudai-x/claude-workflow-v2/refactor-guided"><img src="https://agentmods.dev/badge/commands/cloudai-x/claude-workflow-v2/refactor-guided.svg" alt="Measured on agentmods" 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 | $0.00021 | $0.01044 |
| Opus 5 | $0.00010 | $0.00522 |
| Sonnet 5 | $0.00004 | $0.00209 |
| Haiku 4.5 | $0.00002 | $0.00104 |
Grade A, and why
refactor-guided scanned grade A with 0 findings 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 4d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Guided Refactoring
Perform safe, incremental refactoring with test verification at every step.
Context
- Recent changes: !
git diff --name-only HEAD~3 2>/dev/null | head -10 || echo "No recent changes" - Current branch: !
git branch --show-current - Working tree status: !
git status --short - Test framework: !
cat package.json 2>/dev/null | grep -E '"(jest|vitest|mocha)"' | head -1 || ls pytest.ini pyproject.toml 2>/dev/null | head -1 || ls Cargo.toml go.mod 2>/dev/null | head -1 || echo "Unknown" - Existing tests: !
find . -name "*test*" -o -name "*spec*" 2>/dev/null | grep -E '\.(ts|tsx|js|jsx|py|go|rs)$' | head -10 || echo "No test files found"
Safety Rules (NON-NEGOTIABLE)
- NEVER refactor AND add features simultaneously. Each change is purely structural.
- NEVER proceed without passing tests. If tests fail after a refactoring, revert immediately.
- ONE refactoring at a time. Each commit is a single, atomic refactoring step.
- Preserve external behavior. Inputs and outputs must remain identical.
- Ensure clean working tree before starting. Stash or commit uncommitted changes first.
Workflow
Phase 1: Analyze Scope
- Identify the target file(s) or directory from
$ARGUMENTS - Map all dependencies — files that import/use the target
- Map all dependents — files that the target imports/uses
- Assess blast radius: how many files could be affected?
- Report scope summary before proceeding:
## Refactoring Scope - Target: [file/directory] - Files affected: [count] - Dependencies: [list] - Dependents: [list] - Risk level: [low/medium/high]
Phase 2: Ensure Test Coverage
- Check if tests exist for the current behavior of the target
- Run existing tests to confirm they pass (this is your safety net)
- If test coverage is insufficient:
- Write tests that capture the current behavior BEFORE refactoring
- Run them to confirm they pass
- Commit these tests separately:
test: add coverage for [target] before refactoring
- Record baseline test results (pass count, time)
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.
- 4d ago First seen · 118 lines · 21 tokens per session scan A 4afd3b792eaf
refactor-guided is a command published in the GitHub repository CloudAI-X/claude-workflow-v2 (1,413 stars, last pushed 9d ago), licensed MIT. It adds 21 tokens to every session and 1,044 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
upgrade
Upgrade the skillshare CLI binary and/or the built-in skillshare skill.
release
Walk the llmwiki release process step by step.
add-agent
引导新增一个 Agent 适配器。用法 /add-agent.
migrate
Command "migrate" from chohra-med/expo_boilerplate, covering invocation, steps and rule.
lians-recall
Recall current (non-stale) facts from Lians memory, optionally as-of a past date.
t800-onboard
Для чата с новичками. Показывает, что настроено в Cursor (global + local), и что умеет отдел T-800.