← Back to list

multi-tenant
by davidgaribay-dev
⭐ 0🍴 0📅 Jan 23, 2026
SKILL.md
name: multi-tenant description: Multi-tenant architecture patterns. Preload for agents working with org/team/user scoping. user-invocable: false
Multi-Tenant Architecture
Hierarchy
Organization (tenant boundary)
├── OrganizationMember (user ↔ org, role: OWNER|ADMIN|MEMBER)
├── Team
│ └── TeamMember (org_member ↔ team, role: ADMIN|MEMBER|VIEWER)
└── Resources scoped by: organization_id + team_id + user_id
Critical FK Pattern
# TeamMember links to OrganizationMember, NOT User
class TeamMember(SQLModel, table=True):
org_member_id: UUID = Field(foreign_key="organization_member.id")
Query Scoping (REQUIRED)
# ALWAYS filter by organization
statement = select(Resource).where(
Resource.organization_id == org_context.organization.id,
Resource.deleted_at == None, # noqa: E711
)
# Add team scope for team resources
statement = statement.where(Resource.team_id == team_context.team.id)
Settings Hierarchy
Organization (defaults)
↓ overrides
Team (if allow_team_customization)
↓ overrides
User (if allow_user_customization)
RBAC Roles
| Org Role | Permissions |
|---|---|
| OWNER | All + delete org + transfer ownership |
| ADMIN | Manage members, teams, settings |
| MEMBER | Minimal access |
| Team Role | Permissions |
|---|---|
| ADMIN | All team management |
| MEMBER | Standard access |
| VIEWER | Read-only |
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon