This skill sets the authorization model for a multi-tenant SaaS and the threats every such app has. It starts by declaring the product’s shape before the first migration, then applies eleven rules: everything belongs to a workspace, two credentials never mix, deterministic code decides what cannot be undone, and permissions are checked, not roles.
It adds a threat table covering untrusted text, floods, cross-tenant access, leaked tokens and databases, webhooks, scheduled work, secrets, customer-supplied addresses and embedded agents, plus the tests a data route needs.
What You Get
- Eleven model rules: workspaces, two credentials, deterministic enforcement, three functions, permissions, entitlements, constraints and unguessable ids
- A threat table of thirteen classes, each with its rule and a reference section
- A capability-by-actor permissions matrix kept as the intent an audit compares against
- Required authorization tests, including a cross-tenant test on every data route
- Reference files for the model, the threat model and the documents and tests
Common Use Cases
- Adding a role or a permission to a multi-tenant product
- Writing a route that reads or changes a workspace’s data
- Adding API tokens, a webhook or a scheduled job safely
- Reviewing a product’s security against its permissions doc
What Makes It Unique
It separates who may act (roles and permissions) from how much (entitlements from billing) and says they never touch, since gating a capability on a feature removes it mid-session when a card lapses. It also requires that a denial test prove it reached the check it claims to test.
Under The Hood
The skill is instructions and reference markdown, with no scripts of its own. Following it, the agent writes route, database and test code in the product, edits its permissions, architecture and flows docs and its backlog, and runs the test suite. Some threat rules, such as calls to customer-supplied addresses and webhook verification, steer the code the agent writes toward network calls and secrets handling. The skill itself fetches nothing.