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 skills add geoffjay/claude-plugins --skill clap-patternsgit clone --depth 1 https://github.com/geoffjay/claude-pluginsWrote 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/geoffjay/claude-plugins/clap-patterns)<a href="https://agentmods.dev/skills/geoffjay/claude-plugins/clap-patterns"><img src="https://agentmods.dev/badge/skills/geoffjay/claude-plugins/clap-patterns/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/geoffjay/claude-plugins/clap-patterns"><img src="https://agentmods.dev/badge/skills/geoffjay/claude-plugins/clap-patterns.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.00031 | $0.01268 |
| Opus 5.5 | $0.00012 | $0.00507 |
| Sonnet 5.5 | $0.00006 | $0.00254 |
| Haiku 4.5 | $0.00003 | $0.00127 |
Grade A, and why
clap-patterns 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 3mo 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 — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clap Patterns Skill
Common patterns and idioms for using Clap v4+ effectively in Rust CLI applications.
Derive API vs Builder API
When to Use Derive API
- CLI structure known at compile time
- Want type safety and compile-time validation
- Prefer declarative style
- Standard CLI patterns are sufficient
#[derive(Parser)]
#[command(version, about)]
struct Cli {
#[arg(short, long)]
input: PathBuf,
}
When to Use Builder API
- CLI needs to be built dynamically at runtime
- Building plugin systems
- Arguments depend on configuration
- Need maximum flexibility
fn build_cli() -> Command {
Command::new("app")
.arg(Arg::new("input").short('i'))
}
Common Patterns
Global Options with Subcommands
#[derive(Parser)]
struct Cli {
#[arg(short, long, global = true, action = ArgAction::Count)]
verbose: u8,
#[command(subcommand)]
command: Commands,
}
Argument Groups for Mutual Exclusivity
#[derive(Parser)]
#[command(group(
ArgGroup::new("format")
.required(true)
.args(&["json", "yaml", "toml"])
))]
struct Cli {
#[arg(long)]
json: bool,
#[arg(long)]
yaml: bool,
#[arg(long)]
toml: bool,
}
Custom Value Parsers
fn parse_port(s: &str) -> Result<u16, String> {
let port: u16 = s.parse()
.map_err(|_| format!("`{s}` isn't a valid port"))?;
if (1024..=65535).contains(&port) {
Ok(port)
} else {
Err(format!("port not in range 1024-65535"))
}
}
#[derive(Parser)]
struct Cli {
#[arg(long, value_parser = parse_port)]
port: u16,
}
Environment Variable Fallbacks
#[derive(Parser)]
struct Cli {
#[arg(long, env = "API_TOKEN")]
token: String,
#[arg(long, env = "API_ENDPOINT", default_value = "https://api.example.com")]
endpoint: String,
}
Flattening Shared Options
#[derive(Args)]
struct CommonOpts {
#[arg(short, long)]
verbose: bool,
#[arg(short, long)]
config: Option<PathBuf>,
}
#[derive(Parser)]
struct Cli {
#[command(flatten)]
common: CommonOpts,
#[command(subcommand)]
command: Commands,
}
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.
- 3mo ago First seen · 249 lines · 31 tokens per session scan A 288c65f5cced
clap-patterns is a skill published in the GitHub repository geoffjay/claude-plugins (8 stars, last pushed 1y ago), licensed MIT. It adds 31 tokens to every session and 1,268 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-08-31.
clap-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| clap-patternsgeoffjay/claude-plugins | Skill | 8 | 1y ago | MIT | A | 31 | Claude Code |
| rust-patternsaffaan-m/ECC | Skill | 314k | yesterday | MIT | A | 28 | Claude Code, Kiro |
| update-v8-versionopeninterpreter/openinterpreter | Skill | 69k | 2d ago | Apache-2.0 | A | 86 | Codex |
| omh-rustrlaope/oh-my-hermes | Skill | 6.2k | today | MIT | A | 19 | Claude Code |
| dd-code-generationDataDog/pup | Skill | 1.0k | today | Apache-2.0 | A | 16 | Claude Code |
| swiftidebosun-ai/swiftide | Skill | 807 | today | MIT | A | 43 | Claude Code, Codex |
| azure-keyvault-secrets-rustbenjaminasterA/antigravity-awesome-skills | Skill | 522 | today | MIT | A | 0 | Claude Code, Codex |