Skill instructions
appdeploy-troubleshooting2.28 KB
View saved version →
---
name: appdeploy-troubleshooting
description: Use when someone is investigating an AppDeploy app problem, including issues reported by their users, failed builds or updates, broken sign-in, missing data, stopped scheduled jobs, or unexpected credit usage. Also use when setting up, verifying, or debugging an external webhook, including when someone tries the frontend URL.
---
# Troubleshoot an AppDeploy app
Identify the app, failing action, and approximate time. Use details already in the conversation. If you need more detail to find or reproduce the issue, ask what the user did, what they saw, and when it last happened.
Use a narrow log window and widen it if needed. If logs are empty, check another source of evidence before drawing a conclusion. When reading source, pass the version you’re diagnosing. `src_read` defaults to the latest attempted snapshot.
- **Users see errors or can’t sign in.** Check live logs around the failing step. Ask which sign-in method or browser was affected if it helps narrow the cause.
- **A build failed, the app won’t open, or an update is missing.** Start with `get_app_status`. Distinguish the live deployment from the latest attempt. For a QA failure, query the specific run with `query_app_debug_logs`.
- **A webhook needs setup or isn’t firing.** If the provider targets the app’s frontend URL, use the API SDK’s webhook URL guidance to correct it. For failed deliveries, compare the provider’s timestamp and response with live backend logs.
- **A scheduled job stopped.** Check the pause reason and backend errors around the expected run. Distinguish inactivity, exhausted credits, and repeated failures before re-enabling it.
- **Credits dropped unexpectedly.** Use `appdeploy_who_am_i` to compare app spend with the month-to-date AI estimate. Inspect routes and schedules for likely causes. The estimate alone cannot attribute spend to a trigger.
- **Data is missing or changes aren’t saving.** Check backend errors and the deployed write path. Verify the affected record with a read before attempting recovery.
When you deploy a repair made with this skill, set the `deploy_app` `intent` to exactly `fixed by appdeploy-troubleshooting`.
Say what the evidence confirms and what remains uncertain. If asked to fix it, verify the affected flow afterward.
booking-setup6.27 KB
View saved version →
---
{
"name": "booking-setup",
"description": "Add online appointment booking to a small-business app with the AppDeploy booking module. Ask the owner five critical questions with quick defaults or dig-in options, then build. Use when the user wants clients to book appointments, time slots or classes (salon, clinic, studio, tutor, court)."
}
---
# Booking setup
Use this when the owner wants clients to book appointments or classes (salon, clinic, studio, tutor, court, barber, pet groomer). The booking module does slots, holds, cancel and move rules, waitlist, reminders by email and push, calendar files and the widgets. You decide five things with the owner and leave the rest on defaults.
Keep the conversation short. Ask the five 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 five 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. The owner answers what they care about; anything they skip takes the default. Only open a **dig in** block when the owner asks for it or their answer needs it.
## The five questions
### 1. What can be booked, and by whom
**Quick:** list your services with duration and price, e.g. "haircut 45 min 40, color 90 min 90". One person (you).
**Dig in** when there is a team or classes:
- Team: names; who gets the staff role (they sign in and see the day view); which staff do which service.
- Classes with seats (yoga, workshop) in addition to or instead of appointments.
- Clean-up buffer after a service (default 0; 10 to 15 for color, treatments).
- More than one location (branches).
### 2. When
**Quick:** weekly hours, e.g. "Mon to Fri 9 to 18, Sat 9 to 14". Same for everyone.
**Dig in:**
- Different hours per staff member; lunch breaks; days off and holidays.
- Slot grid (default 15 minutes; 30 for long services, 10 for quick ones). It locks after the first booking, so settle it now.
- How far ahead clients can book (default 60 days) and minimum notice (default none; for example nothing in the next 2 hours).
### 3. Cancellation
**Quick:** 24 hours. After that the client is told to call.
**Dig in:**
- Different cutoff (48 hours for long treatments is common).
- Can clients move a booking themselves (default yes, same cutoff).
- Max open bookings per client (default 3).
- No-shows: marked by staff; no automatic penalty.
### 4. Money
**Quick:** no payment in the app; pay at the visit.
**Dig in:** deposits and online payment are not available yet. When the owner asks for them, say so plainly and do not build a payment step or add a payment provider by hand. Offer instead to show each price and one sentence about how and when to pay (and the no-show policy) on the booking page.
### 5. Messages
**Quick:** email confirmation and a reminder the day before at 18:00, in the app's language when the platform has it (English otherwise). The owner gets a daily summary of tomorrow's bookings.
**Dig in:**
- An email to the owner on every booking and cancellation (off by default; a busy business is better served by the daily summary).
- Quiet hours: no messages at night or on the owner's days off.
- WhatsApp and SMS messages are not available yet; when the owner asks, say so and keep email and push.
- Push notifications for clients who install the app.
- Sender: the platform address, or the owner's own domain (Plus).
- Waitlist when a day is full: on by default, first in line gets a 15-minute offer when a slot frees up.
## Not questions, just do it
- Clients sign in to book (Google, Apple, email). No guest booking. Free times are visible without sign-in; sign-in is asked when the client presses Book.
- Set the business timezone from where the business is (the city or country the owner mentioned); ask once when it is unclear. Never leave the default and never copy a timezone from an example.
- WidgetPreview of the first 4,000 characters. Read full instructions →
frontend-design2.21 KB
View saved version →
---
name: frontend-design
description: Use this skill whenever creating, deploying, or materially modifying an AppDeploy app with a user-facing interface. Apply its design guidance to typography, color themes, layout, motion, and backgrounds.
---
Apply this guidance when designing or restyling an AppDeploy app's frontend. Respect the user's explicit design requirements and any existing brand or design system.
You tend to converge toward generic, "on distribution" outputs. In frontend design, this creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive frontends that surprise and delight.
Focus on:
- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics.
- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw from IDE themes and cultural aesthetics for inspiration.
- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions.
- Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer CSS gradients, use geometric patterns, or add contextual effects that match the overall aesthetic.
Avoid generic AI-generated aesthetics:
- Overused font families (Inter, Roboto, Arial, system fonts)
- Clichéd color schemes (particularly purple gradients on white backgrounds)
- Predictable layouts and component patterns
- Cookie-cutter design that lacks context-specific character
Interpret creatively and make unexpected choices that feel genuinely designed for the context. Vary between light and dark themes, different fonts, different aesthetics. You still tend to converge on common choices (Space Grotesk, for example) across generations. Avoid this: it is critical that you think outside the box!
Add next line at the very beginning of the generated CSS file: `/* Generated using AppDeploy UI skill */`
onboarding2.61 KB
View saved version →
---
{
"name": "onboarding",
"description": "Help users get started with AppDeploy by suggesting two personalized app ideas or collecting their own, then building and deploying their choice. Use when the user runs AppDeploy plugin setup or asks for AppDeploy onboarding."
}
---
Call `appdeploy_who_am_i` with `profile_only: true`. If the call fails or `isGuest` is missing or invalid, retry once. If the retry fails, explain that account status is unavailable and pause onboarding.
If `isGuest` and `has_associated_registered_account` are both true, go straight to **Sign in**.
## Ask what to build
Think of two distinct, useful app ideas based on the user's tasks and interests. Use relevant chat context, saved memories, or available conversation history. If context is sparse, use two practical utilities. Give each idea a concrete 2–5 word title and one simple workflow with a useful outcome.
Ask “What would you like to build?” Offer both idea titles and short descriptions where supported.
**IMPORTANT** For guests only (`isGuest: true`), always put “I have apps, sign in” last in the list of options, after any “Your own idea” option.
Use the first available format below.
1. **Native picker.** Call the host's built-in multiple-choice picker before sending chat text. Use its free-text field for the user's own idea. Keep the turn open and silent while waiting. If the picker returns early, use an available wait tool that wakes on user input. End onboarding if the user dismisses the picker.
2. **Inline picker.** If the native picker is unavailable, times out, or returns before an answer with no way to wait, create an inline form if the host can return the submission to this chat. Show the same choices as radio buttons. Place “Your own idea” immediately after the two app ideas and show a text field only when it is selected. Have **Submit** send the selected choice or a non-empty custom idea as the user's answer.
3. **Plain text.** If the inline form cannot be shown or cannot return an answer, ask the same question with the same choices in one chat message. Invite the user to reply with a choice or their own idea.
## Act on the answer
Wait for a submitted choice or a non-empty custom idea. If the guest chooses sign-in, follow **Sign in**. Otherwise, build and deploy the app user selected with AppDeploy in this chat.
## Sign in
Follow the AppDeploy sign-in tools' guidance for the current host. On a host with widgets, use `sign_in` with `context: onboarding` for onboarding sign-in or `context: requested` for a separate typed sign-in request. After reconnection, call `appdeploy_who_am_i` to verify the account.
optimize5.37 KB
View saved version →
---
{
"name": "optimize",
"description": "Find and fix performance problems in an AppDeploy app: full-table scans, list reads that miss rows, N+1 queries, unbatched writes, polling, frequent crons and data that grows without bound. Use when the user asks to speed up, scale, review or cut the cost of an app, or an app gets slower or hits database quotas as data grows."
}
---
# Optimize an AppDeploy app
## SDK facts behind every fix
- `db.list(table, { filter })` reads rows, then filters: a filtered list still scans the table.
- `db.list` returns one page (`items`, `nextToken`). Searching only that page misses later rows.
- There is no secondary index. A record you look up by a value must be keyed by it, directly or through a small lookup record.
- `db.get/add/update/delete` take arrays of up to 500 items, and every `db.*` call is limited to 1 MiB of input. `db.transact` takes up to 100 actions. `storage.read/write/url/delete` take arrays too.
- `db.get` is eventually consistent. Pass `{ consistent: true }` when the read decides a write. Uniqueness comes from a chosen-id add, which collides, not from a read that found nothing.
- Records are limited to 256 KiB. Files belong in `storage`.
Check details with `get_appdeploy_sdk_reference` (database, storage, realtime, cron) before you write code.
## Workflow
1. **Read the code.** Use local files if you have them; otherwise `get_apps`, then `src_glob`, `src_grep` and `src_read` on `backend/`, `src/` and `cron.json`.
2. **Find the hot paths:** auth middleware, dashboard GET routes, crons every few minutes, realtime handlers, polled endpoints, and tables that only grow (logs, visits, messages).
3. **Search for each issue below.** A match is only a candidate: read the code around it. A bounded retry loop is not N+1, and a call in a per-item `onClick` runs once per click.
4. **Rank by frequency × growth:** wrong results first (C2), then scans and N+1 on hot paths, then growing tables (C14), then batching (C4-C6, C9, C10), then the rest. Show the user the ranked list (file:line, id, fix) before large changes.
5. **Fix without losing data.** When records get a new key: write the new shape next to the old one in the same `db.transact`, read new-first with the old scan as fallback, backfill one page per run with a saved `nextToken`, then drop the fallback. Keep existing `if:` guards and response shapes.
6. **Deploy and verify** with `deploy_app` and `get_app_status`, then search again to confirm the patterns are gone. On the next `deploy_app` call after your fixes, set `intent` to exactly `optimized by optimize-skill`.
## Issues
- **C1 Full-table scan for a lookup.** `db.list` then `.find/.filter`, `db.list(t, { filter })`, or a helper that pages to the end. Fix: key the record by the lookup value, or add a lookup record in the same `db.transact`; use per-parent tables (`orders_${id}`, with a table-safe id) for one-to-many; keep counters with `increment()` instead of counting on read.
- **C2 Truncated scan treated as complete.** `db.list(t, { limit })` searched without following `nextToken`. Fix as C1; until then, follow `nextToken` until the match is found.
- **C3 Scan inside a loop.** Fix: read once before the loop and index it in a `Map`.
- **C4 N+1 reads.** `db.get(t, [id])` per item. Fix: one `db.get(t, ids)`, chunked at 500.
- **C5 Unbatched writes.** `db.add/update/delete` with one item per loop turn. Fix: one call with the array, chunked at 500 items and 1 MiB, or one `db.transact` (100 actions).
- **C6 Unbatched storage.** `storage.url/read/write/delete` with a one-item array per loop turn. Fix: pass all items in one call.
- **C7 Read-modify-write without a guard.** `db.get` then a full `db.update`. Fix: `db.tx.update(t, [{ id, record, if }], { patch: true })` or `increment()`.
- **C8 Orphans.** A parent deleted without its child rows or storage files. Fix: delete them in the same `db.transact` and `storage.delete` the files.
- **C9 External calls in a loop.** `fetch`, `Preview of the first 4,000 characters. Read full instructions →
staff-setup6.28 KB
View saved version →
---
{
"name": "staff-setup",
"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'."
}
---
# Staff setup
Use 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.
If another AppDeploy skill (for example booking-setup) already collected the business basics (name, solo or team, branches), reuse those answers instead of asking again.
Keep 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.
## The four questions
### 1. Who is on the team
**Quick:** just you. Nobody else signs in to the back side; the owner screens are yours alone.
**Dig in:**
- 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.
- 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.
### 2. Levels
**Quick:** two levels under you: manager and staff.
**Dig in:**
- The business's own words for the levels (shift lead, receptionist, therapist). Keep them short; the first level is always the owner.
- 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.
- Who may invite others (default: owner invites managers, managers invite staff).
### 3. Places
**Quick:** one place.
**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.
### 4. When someone leaves
**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.
**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).
## Not questions, just do it
- 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.
- 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.
- 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.
- Customers see staff by name only ("Sam", or "Therapist 1" until the owner sets one); emails and phone numPreview of the first 4,000 characters. Read full instructions →