authorization

authorization is a skill for Claude Code from filipebraida/adonisjs-starter-kit. It costs 173 tokens per session (2,555 once invoked), scanned A, original, MIT.

A role-based access-control setup for an AdonisJS web app using Inertia. It defines permissions and roles in code, checks them in server policies, and makes the allowed actions available to the frontend.

In plain words
What is it for?
Use it to define capabilities such as creating users or viewing token lists, assign roles, check permissions and roles, protect routes, and let frontend components decide whether an action is available.
Why use it?
It keeps permission rules in one catalogue and applies them at the controller and interface levels. This helps prevent users from reaching actions they are not allowed to use.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to define capabilities such as creating users or viewing token lists, assign roles, check permissions and roles, protect routes, and let frontend components decide whether an action is available.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/filipebraida/adonisjs-starter-kit/authorization
Install

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.

Any agent
npx skills add filipebraida/adonisjs-starter-kit --skill authorization
Clone the repo
git clone --depth 1 https://github.com/filipebraida/adonisjs-starter-kit

Made for: Claude Code.

Wrote 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.

agentmods badge for authorization

README.md
[![agentmods](https://agentmods.dev/badge/skills/filipebraida/adonisjs-starter-kit/authorization/github.svg)](https://agentmods.dev/skills/filipebraida/adonisjs-starter-kit/authorization)
Your own site
<a href="https://agentmods.dev/skills/filipebraida/adonisjs-starter-kit/authorization"><img src="https://agentmods.dev/badge/skills/filipebraida/adonisjs-starter-kit/authorization/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.

agentmods 80×15 button for authorization

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 173 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00173 $0.02555
Opus 5.5 $0.00069 $0.01022
Sonnet 5.5 $0.00035 $0.00511
Haiku 4.5 $0.00017 $0.00255

Measured 5d ago against content hash 882349323093, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

packages/skills/authorization/SKILL.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authorization

Role-based access control with @adonis-agora/authz (DB-backed RBAC, wildcard matching) under AdonisJS Bouncer. Two kinds of role, and five moving parts:

  1. Capabilities — each module declares its own in app/<mod>/enums/capability.ts as a CAPABILITIES_<MOD> const of <domain>.<action> slugs.
  2. Role grants — config/capabilities.ts maps every structural role in ROLES to the capabilities it grants (users.* wildcards allowed). Read at check time from code: no seed, no screen can strip a capability the app depends on. Institutional roles are created on the roles page (/roles) and their capabilities, ticked from vocabulary in the same file, are stored in the authz tables; the library adds them to the code grants.
  3. Assignments — user.assignRole(role) writes a row in the authz tables (auth/database/migrations/*_create_authz_tables.ts). The user forms offer the structural roles and the institutional ones; actions call requireExistingRole first, because assignRole would create an unknown role.
  4. Authorizer (#core/authz/authorizer) — can(user, capability) with the request's permission cache. Policies and actions inject it.
  5. Bouncer policies — BasePolicy subclasses that combine a capability with ownership/state and gate the controller.

On the frontend the shared authz prop ({ roles, permissions }, built by buildAuthzShare in InertiaMiddleware) is read with useCan(capability) or <Can permission="..."> from @adonis-agora/authz-react, wildcard-aware.

Rules

  • Capabilities live with their module: app/<mod>/enums/capability.ts, naming <domain>.<action> (users.create, tokens.view_list). Typed as Capability (#core/authz/capability) at the check site, so a typo is a compile error at the constant.
  • Grants live in one place: config/capabilities.ts → roleGrants. Adding a capability without granting it means nobody has it (except via wildcards such as users.*).
  • Role slugs live in ROLES (app/auth/enums/role.ts) with ROLE_WEIGHTS for mainRole() display ordering. roleGrants is typed Record<Role, string[]>, so a new role must be granted.
  • Checks go through Authorizer.can in policies and actions — not user.can() from the mixin — so every check in a request shares one cached read.
  • Policies subclass BasePolicy, use @inject() with Authorizer, live at app/<mod>/policies/<entity>_policy.ts. One method per gated action; currentUser first, resource second.
  • Gate at the controller before validating: await bouncer.with(EntityPolicy).authorize('method', resource?). Every mutation route must be gated by a policy.
  • Reading roles in lists: User.roles is a read-only manyToMany to AuthzRole via authzRolesRelation() — preload('roles') / whereHas('roles', …) work. Writes always go through the store (assignRole, SyncUserRoles), never AuthzRole.
  • Escalation guards are defense in depth on top of validators:
    • requireManageRoles(executor) — throws ManageRolesUnauthorizedException without users.manage_roles.
    • requireManageRolesIfEscalating(executor, roles) — enforces it on create/invite when a non-default role is requested.
    • AdminLockoutException — SyncUserRoles refuses to remove the executor's own admin.
    • SyncUserRoles removes before granting, inside one transaction: a failure halfway leaves less privilege, never more.
  • Permission cache: the library caches role and permission reads per request on its own (AsyncLocalStorage is on in config/app.ts), so every check in a request costs one read; outside a request each check reads the store. Don't pass a cache of your own. Grants changed mid-request apply from the next request.

Read the full file on GitHub · 148 lines

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.

  1. 5d ago Changed 882349323093
  2. 20d ago Changed · +12 lines · +28 tokens per session a3e31887f6d9
  3. 3mo ago First seen · 136 lines · 145 tokens per session scan A c4b265729541

Subscribe to this mod's changes

authorization is a skill published in the GitHub repository filipebraida/adonisjs-starter-kit (99 stars, last pushed 6d ago), licensed MIT. It adds 173 tokens to every session and 2,555 once invoked, about $0.0007 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-30.

Related

authorization compared with skills from other repositories

authorization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
authorizationfilipebraida/adonisjs-starter-kitSkill996d agoMITA173Claude Code
calendarcnvmnog/calendarcnSkill1685d agoMITA76Claude Code, Codex
ui-beatsnikhils4/ui-beatsSkill2363mo agoMITA62Claude Code, Codex
declare-typesone-ie/oneSkill1353d agononeA49Claude Code, Codex
sdkone-ie/oneSkill1353d agononeA34Claude Code
react-doctorshipkit-io/bonesSkill213d agononeA31Claude Code, Codex
auth-setupfirtoz/cf-multiworker-starter-kitSkill121mo agononeA39Claude Code, Codex