Self Serve Lens & Persona Skill
You are working on code that depends on the Self Serve lens/persona system: dashboards, persona-aware components, the lens switcher, or any conditional behavior driven by LensService or ProjectContextService.
When to use
- The user mentions "lens", "persona", "PCC", "ED mode", "Admin Mode", "Maintainer view", or any persona variant.
- A change touches
dashboards/modules. - A component needs to gate UI behind persona checks (
isMaintainer,isVisitor,canEdit,hasPMOAccess, or an ED check viaPersonaService/executiveDirectorGuard). - A change touches
LensService,ProjectContextService, or persona helpers. - A change touches
apps/lfx-one/src/server/utils/persona-helperorauth-helper.
Workflow
- Re-read
docs/architecture/frontend/lens-system.md(the reference linked below) plusdocs/architecture/frontend/permission-persona-navigation-model-preread.mdfor the navigation/permission model. - For backend persona work, also read
docs/architecture/backend/impersonation.md. - Identify which persona(s) the change applies to and call them out explicitly in the plan. Self Serve personas are: Contributor, Maintainer, ED, Board Member. Admin Mode is a privileged variant for EDs and admins.
- Gate UI with the right signal —
!myRoleLoading() && !isVisitor()(not just!isVisitor()) so content does not flash while the role is loading. This is a documented learnings-reviewer pattern. - Do not duplicate persona detection — funnel through
LensService/ProjectContextService/ the relevant persona helper. - For permission changes (adding/removing/changing
canEdit(),isVisitor(),hasPMOAccess()), document the change in the PR description. - Coordinate with the persona backend service when shapes change —
lfx-v2-persona-serviceowns the persona aggregation contract; treat it as a peer repo.
Reference
docs/architecture/frontend/lens-system.md— the canonical lens/persona architecture doc. Treat this as the source of truth; do not maintain a separate copy under this skill.
Scope boundaries
- This skill does NOT cover Auth0/Authelia login flow (see
docs/architecture/backend/authentication.md). - It does NOT cover the upstream persona aggregation service (route persona-aggregation work to
lfx-v2-persona-servicevia/lfx-skills:lfx).