User picks the winning candidate (informed by audit). Generate the folder structure tree and a Mermaid module diagram. Fill block 4 of the checklist with the concrete choices.
- Augmented comparison table from action 03 (with verdicts and rationale).
- Filled checklist blocks 1-3.
Three artifacts held in conversation context (not yet written to disk):
- The checklist with block 4 filled (architecture pattern, front, back, DB, auth, final hosting).
- A folder-structure code block showing the project root tree.
- A Mermaid diagram showing modules and their relations.
## Folder structure
```
acme-invoicing/
├── apps/
│ ├── web/ # Next.js app
│ └── workers/ # Background jobs (BullMQ)
├── packages/
│ ├── db/ # Drizzle schema + migrations
│ ├── api/ # tRPC routers shared between web and workers
│ └── ui/ # shared React components
├── infra/
│ └── supabase/ # Supabase project config + RLS policies
├── aidd_docs/
│ └── INSTALL.md
└── package.json
```
## Architecture diagram
```mermaid
graph TD
User --> Web[Next.js Web]
Web --> API[tRPC API]
API --> DB[(Supabase Postgres)]
API --> Airtable[Airtable SDK]
Web --> Auth[NextAuth]
Workers[BullMQ Workers] --> DB
Workers --> Slack[Slack API]
```03-audit-candidates
- Print the action 03 augmented table. Ask the user to pick a candidate by letter (A / B / C).
- If the picked candidate has verdict
⚠️, surface the audit concerns directly: list the specific risks found in action 03, ask whether the user has a mitigation plan, and loop until satisfied or candidate is switched. - If the picked candidate has verdict
❌, refuse the pick and loop back to letting the user choose differently. (Do not proceed with a known-broken stack.) - Fill block 4 of the checklist with the picked candidate's concrete choices. Show the user the full filled checklist and ask them to confirm "go".
- Generate the folder-structure tree following conventions from the picked stack: monorepo (
apps/,packages/) for modular monolith; flatsrc/for monolith;services/per service for microservices;functions/for serverless. Reflect every component listed in block 4. - Generate the Mermaid module diagram by invoking
aidd-context:04-mermaid. Pass it the list of modules and their relations derived from the folder tree. Verify the rendered diagram passes Mermaid syntax (no parser errors). - Print the tree + diagram together. Wait for user confirmation before action 05.
The checklist's block 4 has all 6 items filled with no remaining <...> placeholders; a folder-structure code block is rendered; a Mermaid code block tagged ```mermaid is present and parses without error; the user has confirmed in writing.