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 rules/saadrahman01/claude-moodle-dev/cmd-moodle-capability-auditgit clone --depth 1 https://github.com/SaadRahman01/claude-moodle-devWrote 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/rules/saadrahman01/claude-moodle-dev/cmd-moodle-capability-audit)<a href="https://agentmods.dev/rules/saadrahman01/claude-moodle-dev/cmd-moodle-capability-audit"><img src="https://agentmods.dev/badge/rules/saadrahman01/claude-moodle-dev/cmd-moodle-capability-audit.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.00049 | $0.00886 |
| Opus 5 | $0.00024 | $0.00443 |
| Sonnet 5 | $0.00010 | $0.00177 |
| Haiku 4.5 | $0.00005 | $0.00089 |
Grade A, and why
cmd-moodle-capability-audit 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 6d 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 — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Audit capability declarations vs. usage for the plugin at the given path.
User's input: {user_input}
Procedure
- Resolve plugin path (default: cwd). Read
version.phpto get the frankenstyle$plugin->component. - Activate
moodle-security-auditandmoodle-plugin-developmentskills. - Parse
db/access.php— extract declared capabilities into a set. - Grep the plugin for runtime capability use:
require_capability\(['"]([^'"]+)['"]has_capability\(['"]([^'"]+)['"]require_all_capabilities\(\[(.*?)\]require_any_capability\(\[(.*?)\]- In
db/services.php:'capabilities' => '...' - In external function
execute_parametersfiles: same as above
- Cross-reference:
- Used but not declared -> ERROR (call will always deny).
- Declared but never used -> WARNING (dead capability, or used via JS/dynamic — flag for human check).
- Declared with risk bitmask but riskBitmask=0 for caps that grant write/admin -> WARNING.
- For each declared capability, verify:
captypeis one ofread/write.contextlevelis a validCONTEXT_*constant.archetypesincludes a sensible default (most caps should have'manager' => CAP_ALLOWat minimum).riskbitmaskuses correct combination:RISK_SPAM | RISK_XSS | RISK_PERSONAL | RISK_CONFIG | RISK_DATALOSS | RISK_MANAGETRUST.- A lang string exists in
lang/en/<component>.phpas$string['<component>:<capname-suffix>'] = '...'AND a<capname-suffix>_helpif non-trivial.
- Check for
cloneorextendsof risky caps (e.g., cloningmoodle/site:config) — flag. - If any cap uses
CONTEXT_SYSTEMand grants write/admin, ensureRISK_CONFIGorRISK_DATALOSSis set.
Output
# Capability audit: <component>
## Summary
- Declared: N | Used: N | Orphan declarations: N | Undeclared usages: N
- Risk-bitmask issues: N | Missing lang strings: N
## Errors
- foo.php:88 — `has_capability('<component>:doit', ...)` but `<component>:doit` not in db/access.php
## Warnings
- db/access.php:42 — `<component>:legacy` declared but no runtime usage (dead?)
- db/access.php:60 — `<component>:writeall` is write/CONTEXT_SYSTEM but no RISK_CONFIG flag
## Missing lang strings
- `<component>:doit` — add `$string['<component>:doit'] = '...';` to lang/en/<component>.php
- `<component>:doit_help` — add `_help` for non-trivial caps
## Suggested next steps
1. Add missing declarations to db/access.php, bump version.php
2. Remove dead caps or document why kept (e.g., used by sibling plugin)
3. Add risk bitmasks
4. Run `php admin/cli/upgrade.php` after version bump to apply changes
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.
- 6d ago First seen · 67 lines · 886 tokens per session scan A 468b9fc2c5b3
cmd-moodle-capability-audit is a cursor rule published in the GitHub repository SaadRahman01/claude-moodle-dev (35 stars, last pushed 2mo ago), licensed MIT. It adds 49 tokens to every session and 886 once invoked, about $0.0002 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 cursor rules, from other repositories
add-landing-template
Workflow for adding a new org landing-page template (editorial, vibrant, terminal, etc.) to the ClassroomIO monorepo. Activate when the user asks to add/create/build a new landing template or theme, or hands over a design reference for a new landing visual style.
agents
Agent engineering standards — Agents (TR-SEC-003).
profile
Command: /profile - Run the profile workflow for this project.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.