Borrowing it
Nothing to install: this file belongs to modrexio/modrex. 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/modrexio/modrex/main/.agents/skills/control-flow/SKILL.mdgit clone --depth 1 https://github.com/modrexio/modrexWrote 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/modrexio/modrex/control-flow)<a href="https://agentmods.dev/skills/modrexio/modrex/control-flow"><img src="https://agentmods.dev/badge/skills/modrexio/modrex/control-flow/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/modrexio/modrex/control-flow"><img src="https://agentmods.dev/badge/skills/modrexio/modrex/control-flow.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.00013 | $0.00523 |
| Opus 5.5 | $0.00005 | $0.00209 |
| Sonnet 5.5 | $0.00003 | $0.00105 |
| Haiku 4.5 | $0.00001 | $0.00052 |
Grade A, and why
control-flow 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 14d 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 — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
control-flow
Use this skill when a change touches branching logic, validation, installation flow, filesystem routing, renderer event handlers, or any function with nested conditionals.
This skill targets dangerous pattern #4 from .agents/rules/ai-danger-patterns.md: deep if/else nesting.
Rule
The happy path should not be buried.
Invalid, unsupported, or exceptional cases should exit early.
Required checks
Look for:
- nested
if/elseblocks elseafterreturn,throw,continue, orbreak- repeated checks for the same condition
- validation mixed with business logic
- side effects hidden inside deep branches
- boolean expressions that need a name
Refactoring order
Try these in order:
- invert the condition and return early
- remove
elseafter terminal statements - extract a named boolean
- extract a small helper only when it names a real domain concept
- split the workflow into smaller functions
- use
switchfor many exclusive domain cases
Examples
Bad:
if (game.isInstalled) {
if (game.supportsMods) {
if (!game.isRunning) {
installMod(mod)
}
}
}
Good:
if (!game.isInstalled) return
if (!game.supportsMods) return
if (game.isRunning) return
installMod(mod)
Bad:
if (!gamePath) {
return null
} else {
return scanGame(gamePath)
}
Good:
if (!gamePath) return null
return scanGame(gamePath)
Preserve behavior
Do not change behavior while flattening code.
Before editing, identify which branches return early, throw, mutate state, write files, call APIs, or show UI feedback. After editing, ensure those effects still happen under the same conditions.
Warning
Do not fix nesting by creating a fake abstraction.
Bad:
function validateGameState(game: Game) {
return game.isInstalled && game.supportsMods && !game.isRunning
}
Only good if validateGameState is a real reused domain rule. Otherwise use a named boolean inline.
Report
After editing, report:
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.
- 14d ago First seen · 107 lines · 13 tokens per session scan A bbd185d7c318
control-flow is a skill published in the GitHub repository modrexio/modrex (21 stars, last pushed today), licensed MIT. It adds 13 tokens to every session and 523 once invoked, about $0.0001 per session on Opus 5.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-11-15.
control-flow compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| control-flowmodrexio/modrex | Skill | 21 | today | MIT | A | 13 | Claude Code, Codex |
| Z.A.E.B.A.L.: profanity-triggered self-audit for agentshowdeploy/deploychan_mcp | Skill | 21 | 19d ago | MIT | A | 85 | Claude Code |
| endpoint-triageellmos-ai/skills | Skill | 10 | today | MIT | A | 111 | Claude Code, Codex |
| hex-annotateanomalyco/hex | Skill | 9.1k | today | MIT | A | 139 | Claude Code, Codex |
| graphics-api-hookinggmh5225/awesome-game-security | Skill | 3.8k | today | MIT | A | 43 | Claude Code |
| agentsight-bugfixalibaba/anolisa | Skill | 688 | 8d ago | Apache-2.0 | A | 67 | Claude Code, Codex |
| wispterm-diagnosticsxuzhougeng/wispterm | Skill | 471 | 4d ago | MIT | A | 88 | Codex |