|
| 1 | +// The brief builder of the business landing: examples, the data source labels and the build instructions |
| 2 | +// for the visitor's coding agent. No network, the page fills a template with the visitor's answers. |
| 3 | + |
| 4 | +export type Source = 'spreadsheet' | 'app' | 'none' | 'unsure'; |
| 5 | + |
| 6 | +export type Brief = {manage: string; missed: string; team: string; source: Source; details: string}; |
| 7 | + |
| 8 | +export const EXAMPLES: Record<string, {label: string} & Brief> = { |
| 9 | + followups: { |
| 10 | + label: 'Customer follow-ups', |
| 11 | + manage: 'Customer requests for my maintenance business', |
| 12 | + missed: 'We send quotes and forget to follow up', |
| 13 | + team: 'Me and two managers; each manager handles their own requests', |
| 14 | + source: 'spreadsheet', |
| 15 | + details: 'A request needs a customer, owner, status, next action and due date.', |
| 16 | + }, |
| 17 | + orders: { |
| 18 | + label: 'Order tracking', |
| 19 | + manage: 'Customer orders, from quote to delivery', |
| 20 | + missed: 'Nobody sees which orders are late until the customer calls', |
| 21 | + team: 'Me, a sales manager and two people in the warehouse; the warehouse only updates delivery status', |
| 22 | + source: 'spreadsheet', |
| 23 | + details: 'An order has a customer, items, total, status, delivery date and the person responsible.', |
| 24 | + }, |
| 25 | + internal: { |
| 26 | + label: 'Internal requests', |
| 27 | + manage: 'Internal requests: equipment, access and purchases', |
| 28 | + missed: 'Requests sit in chat and nobody knows who approved what', |
| 29 | + team: 'Everyone can submit; two managers approve; finance sees approved purchases', |
| 30 | + source: 'none', |
| 31 | + details: 'A request has a requester, type, amount, approver, status and decision date.', |
| 32 | + }, |
| 33 | + own: {label: 'My own process', manage: '', missed: '', team: '', source: 'unsure', details: ''}, |
| 34 | +}; |
| 35 | + |
| 36 | +export const SOURCES: {value: Source; label: string; prompt: string}[] = [ |
| 37 | + {value: 'spreadsheet', label: 'Spreadsheet', prompt: 'A spreadsheet. Start this example with synthetic data.'}, |
| 38 | + {value: 'app', label: 'Existing app or database', prompt: 'An existing app or database. Start this example with synthetic data and describe how it would connect later.'}, |
| 39 | + {value: 'none', label: 'Starting fresh', prompt: 'Nothing yet. Start with synthetic data.'}, |
| 40 | + {value: 'unsure', label: 'Not sure', prompt: 'Not sure. Start this example with synthetic data.'}, |
| 41 | +]; |
| 42 | + |
| 43 | +export const DAILY_PROMPTS = [ |
| 44 | + 'What needs my attention today?', |
| 45 | + 'Which follow-ups are overdue, and whose?', |
| 46 | + 'Add a request from Harbor Café: office maintenance quote. Owner Maya, next action: send the quote by Friday.', |
| 47 | + 'Create a follow-up for Priya: call Brightside School tomorrow at 9.', |
| 48 | + 'Which invoices are unpaid for more than 30 days?', |
| 49 | +]; |
| 50 | + |
| 51 | +export function buildPrompt(b: Brief): string { |
| 52 | + const source = SOURCES.find((s) => s.value === b.source).prompt; |
| 53 | + return `Help me build a small business application with AdminForth. Work with me in |
| 54 | +plain language. I don't have a developer: tell me exactly what to do myself, |
| 55 | +step by step. |
| 56 | +
|
| 57 | +MY BUSINESS BRIEF |
| 58 | +BUSINESS_PROCESS: ${b.manage || 'Describe it with me before you start.'} |
| 59 | +CURRENT_PROBLEM: ${b.missed || 'Ask me what keeps getting missed.'} |
| 60 | +TEAM_ACCESS: ${b.team || 'Ask me who will use it and what each person may change.'} |
| 61 | +CURRENT_DATA: ${source} |
| 62 | +EXTRA_DETAILS: ${b.details || 'None yet. Suggest a sensible first set of fields and stages.'} |
| 63 | +
|
| 64 | +WHAT I WANT |
| 65 | +A web app on AdminForth that my agent and my team's agents work with through |
| 66 | +MCP, with sign-in, permissions and an audit log. I will mostly talk to it |
| 67 | +through my agent; screens are for checking. Keep the first version small and |
| 68 | +ready for more parts later (orders, jobs, stock, invoices). |
| 69 | +
|
| 70 | +START HERE |
| 71 | +Read https://adminforth.dev/docs/tutorial/gettingStarted/ and |
| 72 | +https://adminforth.dev/llms.txt first. Use AdminForth as the framework: reuse |
| 73 | +its screens, forms, filters and access rules, don't build a separate stack. |
| 74 | +Use pnpm and Node.js 24. For a new local example use SQLite, the documented |
| 75 | +create-app flow and Prisma migrations. Read the generated AGENTS.md, CLAUDE.md |
| 76 | +and skills before changing anything. If something can't run here, tell me what |
| 77 | +I must do instead of pretending it works. |
| 78 | +
|
| 79 | +Show me a short plain-language outline (records, roles, the first operation) |
| 80 | +and ask only about decisions that change the data or the access rules. |
| 81 | +
|
| 82 | +BUILD |
| 83 | +1. Records and relationships for my process, named so my team understands |
| 84 | + them, with a small set of fictional sample records. |
| 85 | +2. Access rules on the server: I manage everything; every other person works |
| 86 | + only with what their role allows, including direct record requests, lists |
| 87 | + and relationships. A hidden button is not an access rule. |
| 88 | +3. The MCP plugin (https://adminforth.dev/docs/tutorial/Plugins/mcp/) so I can |
| 89 | + connect my agent, and the Audit Log plugin |
| 90 | + (https://adminforth.dev/docs/tutorial/Plugins/audit-log/) with its |
| 91 | + executed-by column, so every change names the person and the agent. |
| 92 | +4. No production data, emails or payments in this first version. |
| 93 | +
|
| 94 | +SHOW ME |
| 95 | +Run the app and give me the local address and sign-in. Connect my agent with |
| 96 | +the command from the Agents settings page, then do one operation through the |
| 97 | +agent: find a record that needs attention, add its next action, and show me the |
| 98 | +audit log entry. Show one action my agent is allowed and one a teammate's agent |
| 99 | +would be refused. Say which checks you actually performed. |
| 100 | +
|
| 101 | +Write five prompts for my daily work with this app, in the words of my process. |
| 102 | +Explain where the code and data are, how to reopen the app tomorrow, how to |
| 103 | +update AdminForth and its plugins later, and what remains before my team uses |
| 104 | +it: hosting, real data, backups, access review. |
| 105 | +`; |
| 106 | +} |
0 commit comments