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 skills/filipebraida/adonisjs-starter-kit/authorizationnpx skills add filipebraida/adonisjs-starter-kit --skill authorizationgit clone --depth 1 https://github.com/filipebraida/adonisjs-starter-kitWrote 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/filipebraida/adonisjs-starter-kit/authorization)<a href="https://agentmods.dev/skills/filipebraida/adonisjs-starter-kit/authorization"><img src="https://agentmods.dev/badge/skills/filipebraida/adonisjs-starter-kit/authorization.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.00145 | $0.01918 |
| Opus 5 | $0.00072 | $0.00959 |
| Sonnet 5 | $0.00029 | $0.00384 |
| Haiku 4.5 | $0.00015 | $0.00192 |
Grade A, and why
authorization 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 5d 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 — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Authorization
Role-based access control implemented in plain code on top of AdonisJS Bouncer — no external RBAC library. Four moving parts:
PERMISSIONS— a const catalog of every capability the app understands.ROLES— a const catalog of role slugs, each with a weight used to pick a display role.WithRoles— a mixin composed intoUserthat grantsassignRole/hasRole/hasPermission/syncRoles.BasePolicysubclasses — enforcehasPermission(...)at the controller.
On the frontend a typed GlobalPermissions object flows through Inertia's shared props and is consumed via useCan(). Adding a permission is a two-line change (PERMISSIONS const + wherever it's gated); adding a role is a config + seed touch.
Rules
- Single source of truth for capabilities in a
PERMISSIONSconst object under theusersmodule. Naming:<mod>.<action>(users.create,tokens.view_list). Adding a permission = adding one entry + referencing it wherever it's gated. A new module's capabilities go in this same const — the<mod>.<action>naming already namespaces them; don't fork a secondPERMISSIONS. One central catalog; the policies that consume it stay in each module. - Role slugs live in a
ROLESconst with a matchingROLE_WEIGHTSmap. The weights drivemainRole()for display ordering. Adding a role = new entry + a seed that grants its permissions. - Roles store their own permissions on the
Rolemodel as a JSON column (role.permissions: Permission[]). Seed withRole.updateOrCreate({ name }, { permissions: [...] }). WithRolesmixin composes intoUsernext towithAuthFinder. It exposes:- Mutations:
assignRole(role),assignRoles(roles),syncRoles(roles),revokeRole(role),revokeRoles(roles). - Checks:
hasRole(name),hasPermission(permission). - Reads:
getRoleNames(),getPermissions(),preloadedRoles(sync read of.load('roles')).
- Mutations:
- Policies subclass
BasePolicyand live atapp/<mod>/policies/<entity>_policy.ts. One method per gated action. Signature:currentUserfirst, resource second when applicable. Returnboolean | AuthorizerResponse. - Gate at the controller before validating:
await bouncer.with(EntityPolicy).authorize('methodName', resource?). On deny it throws → 403 (JSON) or 302 back (HTML/Inertia). Every mutation route (POST/PUT/PATCH/DELETE) must be gated by a Bouncer policy — no exceptions. - Frontend shared prop: an Inertia middleware computes a small
can: GlobalPermissionsobject (manageUsers,manageTokens, …) and shares it on every request. Read withuseCan(). Extending the object = adding a boolean field toglobal_permissions.tscomputed fromuser.hasPermission(PERMISSIONS.x);useCantypes update automatically. - Escalation guards are defense-in-depth on top of validators:
requireManageRoles(executor)— throws if the executor lacksusers.manage_roles.requireManageRolesIfEscalating(executor, desiredRoles)— enforces the check even when a validator accepted a non-default role. Call at create / invite paths.AdminLockoutException— prevents a user from removing their ownadminrole. Raised insideSyncUserRoleswhen target and executor are the same and admin is being dropped.
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.
- 5d ago First seen · 136 lines · 145 tokens per session scan A c4b265729541
authorization is a skill published in the GitHub repository filipebraida/adonisjs-starter-kit (94 stars, last pushed 25d ago), licensed MIT. It adds 145 tokens to every session and 1,918 once invoked, about $0.0007 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 skills, from other repositories
coss-particles
Index of all COSS UI particle examples. Use when implementing UI features to find copy-paste-ready component patterns built on coss primitives. Each particle has a description and a JSON URL for easy installation.
coss
Helps implement coss UI components correctly. Use when building UIs with coss primitives and patterns (buttons, dialogs, selects, forms, menus, tabs, segmented controls, inputs, toasts, etc.), migrating from shadcn/Radix to coss/Base UI, composing trigger-based overlays, or troubleshooting coss component behavior.…
ui-beats
Use this skill when users want to add, customize, or troubleshoot UI Beats components in React/Next.js projects. It covers component selection, shadcn registry installation from uibeats.com, the UI Beats MCP server, motion and reduced-motion handling, and integration patterns for animated sections.
morphous-catalog
Create or refresh Morphous website design-system/theme bundles from animal, insect, plant, landscape, mineral, weather, or other nature motifs. Use when Codex is asked to generate Morphous motif images, light/dark design-system boards, reusable image prompts, generated web assets, shadcn/tweakcn theme exports, or the…
ktui
Comprehensive guide to KtUI (Keenthemes Tailwind UI) — components, theming, initialization, data-attribute API, event system, helpers, and common patterns. Use this skill when building UI with KtUI, adding/customizing components, working with KtUI theming/colors/dark-mode, or when the user mentions KtUI, ktui…
ktui-datatable
KtUI DataTable (KTDataTable) — local/remote data, sorting, filtering, pagination, checkbox selection, state persistence, fixed layouts, event system, and architecture. Use this skill when building, debugging, or customizing DataTable components.