add-permission
Skill1 starsChanged 53 days agoMITView on GitHub
Add a new feature permission to FEATURE_CATALOG in packages/permissions and optionally bind it to a role on next seed
4 other projects use a version of this.
Adopted by
Most recently taken up by
- suxrobGM/logistics-apptheir own version, first seen Oct 8, 2026
- fpindej/netrocktheir own version, first seen Oct 8, 2026
- fullstackhero/dotnet-starter-kittheir own version, first seen Oct 8, 2026
- alexmmatos/arthur-mcptheir own version, first seen Jul 16, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- fullstackhero/dotnet-starter-kit★ 6.9ksame name
- fpindej/netrock★ 234same name
- suxrobGM/logistics-app★ 207same name
- alexmmatos/arthur-mcp★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- downstream-syncSkill
- merge-prSkill
- neon-postgresSkill
- new-featureSkill
- personalizeSkill
- pre-pushSkill
- process-feedbackSkill
- release-notesSkill
- testSkill
- trivialSkill
- upstream-syncSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 1 is distinctive, and 7 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
When the user invokes /add-permission, walk through adding a new feature permission to the kit's permission system.
- Distinctive: line 15
Ask the user (if not already provided):
- Very specific: line 27
Add the new key to the FEATURES constant:
- Very specific: line 36
Add the matching FEATURE_CATALOG entry:
- Very specific: line 47
Keep the catalog entries in the same order as the FEATURES constant — it makes review diffs easier to read.
- Very specific: line 51
If the new permission should be granted to a role on a fresh seed, edit packages/db/src/seed.ts and add the feature key to that role's …
- Very specific: line 86
Update docs/product/functionality-map.md if the permission gates a new capability.
- Very specific: line 87
Run /release-notes to record the new permission in the current release notes file.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Feature Permission
When the user invokes /add-permission, walk through adding a new feature permission to the kit's permission system. The permission key may be provided as $ARGUMENTS (e.g., audit.read).
FEATURE_CATALOG in packages/permissions/src/index.ts is the source of truth. The seed script (packages/db/src/seed.ts) reads this catalog and inserts each feature into the features table. Role bindings happen in the seed too. The catalog in code — not the database — is the source of truth for what features exist; the admin roles UI renders directly from it.
Step 1: Gather Information
Ask the user (if not already provided):
- Permission key — dot-notation (e.g.,
audit.read,users.invite,tickets.triage). - Constant name — UPPER_SNAKE_CASE for the
FEATURESobject (e.g.,AUDIT_READ). - Human-readable name — for the admin UI (e.g., "Read audit log").
- Description — one sentence; shown next to the name in the admin roles editor.
- Category — usually
admin; add a new category if the feature belongs to a non-admin surface. - Default roles — which roles get this permission on a fresh seed? Usually
admin. Sometimes alsomember. Rarely none (assigned manually). - Admin-protected? — if losing this permission would lock admins out of the admin app, add it to
ADMIN_PROTECTED_FEATURES(the anti-lockout list the roles UI refuses to remove from the admin role).
Step 2: Update packages/permissions/src/index.ts
Add the new key to the FEATURES constant:
export const FEATURES = {
// ... existing entries ...
AUDIT_READ: "audit.read",
} as const;Add the matching FEATURE_CATALOG entry:
{
key: FEATURES.AUDIT_READ,
name: "Read audit log",
description: "View the append-only audit log of security-sensitive actions.",
category: "admin",
},Keep the catalog entries in the same order as the FEATURES constant — it makes review diffs easier to read.
Step 3: Wire the Default Role Binding (Optional)
If the new permission should be granted to a role on a fresh seed, edit packages/db/src/seed.ts and add the feature key to that role's binding list. The seed is idempotent — re-running it is safe.
For an existing database, the seed will only add the binding; it will not revoke it from any role that already has the permission via custom assignment. That's the right behavior.
Step 4: Apply the Change Locally
pnpm db:seedThis inserts the new row into features and (if you updated the seed) binds it to the configured roles.
Step 5: Use the New Permission
API route handler / server action:
import { auth } from "@/auth";
import { FEATURES, hasFeature } from "@repo/permissions";
const session = await auth();
if (!hasFeature(session?.user?.features, FEATURES.AUDIT_READ)) {
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
}UI conditional render:
const canRead = hasFeature(session?.user?.features, FEATURES.AUDIT_READ);
{canRead && <AuditLogPanel />}Remember the invariant: a permission answers "is this user allowed to do X?" A feature flag answers "is X turned on here?" A flag never gates a permission (AGENTS.md → Key Invariants).
Step 6: Document and Release-Note
- Update
docs/product/functionality-map.mdif the permission gates a new capability. - Run
/release-notesto record the new permission in the current release notes file.
Summary
Present what changed:
- New
FEATURES.<KEY>constant inpackages/permissions - New
FEATURE_CATALOGentry (name, description, category) ADMIN_PROTECTED_FEATURESupdated: yes / no- Seed binding updated (which roles get it on fresh install): yes / no
- Local seed run: PASS / FAIL
- Files modified
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

