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 jimmc414/claude-code-plugin-marketplace --skill pass-function-as-arggit clone --depth 1 https://github.com/jimmc414/claude-code-plugin-marketplaceWrote 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/jimmc414/claude-code-plugin-marketplace/pass-function-as-arg)<a href="https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/pass-function-as-arg"><img src="https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/pass-function-as-arg.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.1 | $0.00027 | $0.00629 |
| Opus 5 | $0.00014 | $0.00315 |
| Sonnet 5 | $0.00005 | $0.00126 |
| Haiku 4.5 | $0.00003 | $0.00063 |
Grade A, and why
pass-function-as-arg 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 7d 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 — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
pass-function-as-arg
When to Use
- Algorithm should work with different implementations
- Strategy pattern: same algorithm, different strategies
- Callbacks for event handling
- Sorting/filtering with custom criteria
- Higher-order functions (map, filter, reduce)
When NOT to Use
- Only one implementation needed
- Function parameter adds complexity without benefit
- Object-oriented approach is clearer
The Pattern
Accept a function as a parameter to customize behavior.
def generic_algorithm(data, key=lambda x: x, filter_fn=lambda x: True):
"""Process data with customizable key and filter."""
filtered = [x for x in data if filter_fn(x)]
return sorted(filtered, key=key)
# Use with different strategies
result1 = generic_algorithm(items, key=lambda x: x.priority)
result2 = generic_algorithm(items, key=lambda x: -x.size, filter_fn=lambda x: x.active)
Example (from pytudes)
# Hill climbing with configurable objective (ngrams.py)
def hillclimb(x, objective_fn, neighbors_fn, steps=10000):
"""Search for x that maximizes objective_fn, using neighbors_fn to explore."""
best = x
best_score = objective_fn(x)
for _ in range(steps):
for neighbor in neighbors_fn(best):
score = neighbor_score = objective_fn(neighbor)
if score > best_score:
best, best_score = neighbor, score
break
return best
# Use with specific objective and neighbor functions
decoded = hillclimb(initial_guess,
objective_fn=log_probability,
neighbors_fn=swap_adjacent_chars)
# Priority queue with custom key (AdventUtils.ipynb)
class PriorityQueue:
def __init__(self, items=(), key=lambda x: x):
self.key = key
self.items = []
for item in items:
self.add(item)
def add(self, item):
heapq.heappush(self.items, (self.key(item), item))
# A* search with custom heuristic
frontier = PriorityQueue(initial_nodes, key=lambda n: n.cost + h(n))
# Tree generation with configurable pop strategy (Maze.ipynb)
def random_tree(nodes, neighbors, pop=deque.pop):
"""Pop strategy determines tree shape."""
...
current = pop(frontier) # DFS, BFS, or random based on pop function
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.
- 7d ago First seen · 85 lines · 27 tokens per session scan A a01f5c6f8e30
pass-function-as-arg is a skill published in the GitHub repository jimmc414/claude-code-plugin-marketplace (4 stars, last pushed yesterday), licensed MIT. It adds 27 tokens to every session and 629 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-31.
Other skills, from other repositories
ai-ml-development
AI and machine learning development with PyTorch, TensorFlow, and LLM integration. Use when building ML models, training pipelines, fine-tuning LLMs, or implementing AI features.
codexer
Python research assistant with Context7 MCP. Use for Python library research, evaluating packages, enforcing strict Python coding standards, or fetching up-to-date library docs via Context7.
fastapi
Skill "fastapi" from ashish7802/awesome-api-skills, covering fastapi skill, ecosystem graph, quick start, production patterns and dependency injection.
python-packaging
Configure Python package metadata, setup.py, and pyproject.toml for distribution using UV or setuptools. Use when setting up Python packages, configuring build systems, or preparing projects for PyPI publication.
clean-code
Use when the user writes new Python, or asks for review, refactor, or cleanup of Python code, names, comments/docstrings, functions, or tests. Applies Robert Martin's complete Clean Code catalog -- naming, functions, comments, DRY, boundary conditions, and tests -- to the code being changed.
analyzing-windows-prefetch-with-python
Parse Windows Prefetch files using the windowsprefetch Python library to reconstruct application execution history, detect renamed or masquerading binaries, and identify suspicious program execution patterns.