{"id":108341,"plugin_id":"plugin_asdk_app_6956e6ff740481919946ceae8e5d6304","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-20T18:10:53.488Z","digest":"7442d7da3a851ec8e6750972ff728d10fd3c0648f63bc4ee915958e44737ab63","against":null,"payload":{"description":"Give a small-business app a team: owner, managers and staff with the AppDeploy roles module. Ask the owner four questions with quick defaults or dig-in options, then build. Use when the user mentions employees, staff, managers, admins, branches or 'only I should see this'.","included_files":[],"name":"staff-setup","skill_md_contents":"---\n{\n  \"name\": \"staff-setup\",\n  \"description\": \"Give a small-business app a team: owner, managers and staff with the AppDeploy roles module. Ask the owner four questions with quick defaults or dig-in options, then build. Use when the user mentions employees, staff, managers, admins, branches or 'only I should see this'.\"\n}\n---\n\n# Staff setup\n\nUse this when more than one person will use the app's back side, or when some screens are for the owner only. The roles module stores who holds which role, makes the owner automatic, sends invite emails, and guards routes. You decide four things with the owner and leave the rest on defaults.\n\nIf another AppDeploy skill (for example booking-setup) already collected the business basics (name, solo or team, branches), reuse those answers instead of asking again.\n\nKeep the conversation short. Ask the four questions in one message, each with a one-line **quick** default. When the host has a native ask-user tool (request_user_input_async or request_user_input), put the four questions in one call with the quick default as the first option and \"let me dig in\" as the second; otherwise ask them as one chat message. Anything the owner skips takes the default. Open a **dig in** block only when asked or when the answer needs it.\n\n## The four questions\n\n### 1. Who is on the team\n**Quick:** just you. Nobody else signs in to the back side; the owner screens are yours alone.\n\n**Dig in:**\n- Names and email addresses of the people to invite now (they get an email with a join link), or invite later from the team page.\n- Whether staff members also appear to customers (for example as bookable stylists), which links a team member to a staff record. Ask for the display name customers see; never use an email as a name.\n\n### 2. Levels\n**Quick:** two levels under you: manager and staff.\n\n**Dig in:**\n- The business's own words for the levels (shift lead, receptionist, therapist). Keep them short; the first level is always the owner.\n- What each level may do, as three yes/no answers: see customer contact details; change the schedule, prices or stock; see money (revenue, payouts, refunds). Default: staff see and work, managers also change, only the owner sees money and settings.\n- Who may invite others (default: owner invites managers, managers invite staff).\n\n### 3. Places\n**Quick:** one place.\n\n**Dig in:** branches or locations. Each manager and staff member belongs to one or more branches and sees only theirs; the owner sees all. Every list in the app is filtered by branch on the server, not in the UI. Bookings need no extra code for this: the booking module limits a team member to the branches on their role.\n\n### 4. When someone leaves\n**Quick:** whoever may invite a level may also remove it on the team page, inside their own places (the owner may remove anyone); the person stays a signed-in user with no role, and everything they entered stays.\n\n**Dig in:** hand their open items (shifts, bookings, leads) to someone else first; when they were bookable, hide their staff record so clients no longer see them (past bookings keep the name); keep a change log of who did what (default on for anything money-related and for team changes).\n\n## Not questions, just do it\n\n- Everyone signs in (Google, Apple, email). The owner becomes owner by signing in with the same email as their AppDeploy account: no \"claim owner\" button, no first-user rule, no admin email list.\n- Guard every back-side route with requireAuth() then requireRole('<level>'); read the role from the verified token, never from the request body. Branch routes use requireRole with a scope.\n- Invites with roles.invite({ email, role, scopes, joinPath: '#/join' }): the platform emails the join link; show the returned joinUrl only when emailed is false. The join screen reads the code with invitesClient.getPendingCode() and calls roles.acceptInvite once signed in.\n- Customers see staff by name only (\"Sam\", or \"Therapist 1\" until the owner sets one); emails and phone numbers never appear on customer screens.\n- Link team members to their staff record the same way for everyone: the invite form picks the staff record (for bookable staff), the app stores which staff record each invite is for, and accepting the invite sets that record's userId. No special cases for particular emails, and people invited later from the team page are linked just like the first ones.\n- Team page from roles.list() (it returns names and emails); remove with roles.remove(); no profiles table. Show the remove button to everyone who may invite that level, not only the owner: the platform already limits removal to levels below the caller and to the caller's own branches.\n- With branches, taking someone out of one place is roles.assign with the branches they keep; use roles.remove only when no branch is left. A remove button under one branch must not drop the person from their other branches.\n- Customer-facing screens stay public or customer-only; staff screens live under a separate route (for example #/admin) and hide their links from users without a role.\n- Make the signed-in role obvious: anyone with a role sees a badge in the header with their role and name (for example \"Owner · Alex\" or \"Therapist · Downtown\"), the admin link has its own look (filled button, not one more menu item), and after sign-in staff land on the admin page while customers land on the home page. Customers keep the plain header.\n- A change log table (who, what, when) for team changes and anything that moves money or a schedule; the owner sees all of it, managers their branch.\n\n## After it is deployed, tell the owner\n\n1. Sign in to the app with your AppDeploy email: that makes you the owner.\n2. Open the team page and invite your first manager; they get an email, sign in with that same email, and have their role at once.\n3. Removing someone: team page, remove. Their work stays. Managers can remove the people they may invite.\n4. Optional: a custom email sender (Plus) so invites come from your own domain.\n\n## Example answer set (three cafes)\n\n> Three cafes: Downtown, Riverside, Airport. Each has a manager and baristas. Baristas see only their cafe's schedule; managers edit their cafe and invite baristas; I see everything and add or remove managers. Keep a log of who changed what.\n\nEverything else is the default: levels owner > manager > barista, branches = the three cafes, invites by email, removal keeps the data.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}