Project Scaffold & Vibe Coding Workflow
Create, architect, and continuously maintain production-ready projects using the Vibe Coding: Beginner-to-Production workflow. This skill eliminates chaos, prevents scope creep, enforces architectural integrity, and scaffolds the exact feature-based or modular architectures for Next.js, FastAPI, and React (Vite).
The Core Philosophy: The Professional Vibe Loop
Never skip directly from:
$$\text{IDEA} \longrightarrow \text{AI} \longrightarrow \text{DEPLOY}$$
Instead, follow the complete production lifecycle:
$$\text{IDEA} \rightarrow \text{RESEARCH} \rightarrow \text{PRD} \rightarrow \text{STACK} \rightarrow \text{ARCHITECTURE} \rightarrow \text{DESIGN} \rightarrow \text{RULES} \rightarrow \text{TASKS} \rightarrow \text{SCAFFOLD} \rightarrow \text{FEATURE SLICES} \rightarrow \text{TEST} \rightarrow \text{PREVIEW} \rightarrow \text{PROD}$$
Operating Modes
Choose the mode matching the user's intent:
| Mode |
Trigger |
Output |
| Mode 1: Full Project Inception |
User has an idea or wants to start a project from scratch |
5-question intake brief, complete docs/ suite, exact folder scaffolding, and initial TASKS.md |
| Mode 2: Exact Architecture Scaffolding |
User specifies stack (Next.js, FastAPI, React, or Fullstack) |
Creates the exact directory tree, placeholder files, barrel exports, configs, and types |
| Mode 3: Documentation & AI Rulebook Initializer |
Existing project or docs-only setup |
Generates PRD.md, ARCHITECTURE.md, DESIGN.md, RULES.md, TASKS.md, DECISIONS.md, MEMORY.md, TEST_PLAN.md, SECURITY.md, .env.example |
| Mode 4: Vertical-Slice Feature Builder |
Implementing a feature in an active project |
6-part structured AI prompt, single-slice execution, automated testing, git commit, and doc sync |
| Mode 5: Project Reopen & Resume Protocol |
User reopens an existing project or starts a new chat session |
Reads MEMORY.md, TASKS.md, and RULES.md, states active status, aligns on next step, and updates docs upon completion |
| Mode 6: 200% Production Architecture & Feasibility Engine |
User presents a technical problem or feature requirement in a new or existing project |
Critiques naive patterns, checks internet standards & cloud pricing, provides 3-option trade-off matrix, designs 200% production flow, and documents in docs/ARCHITECTURE.md & docs/DECISIONS.md |
Mode 1: Full Project Inception
Step 1: The 5-Question Intake Brief
Before writing code or creating folders, ask these five questions (or extract them from the user's prompt):
- What problem are you solving? (The core pain point)
- Who is the target user? (Demographics, roles, audience)
- What is the main outcome? (What success looks like for the user)
- What is the MVP? (List only the absolute core features, e.g., Auth, Dashboard, Core Entity CRUD)
- What is explicitly OUT OF SCOPE for v1? (e.g., No mobile app, no AI chat, no payments, no social feeds)
Rule: Never proceed to code if items 1, 4, and 5 are undefined.
Step 2: Select the Tech Stack Architecture
Match the requirements to the exact architectural pattern:
- Next.js (App Router, Feature-Based): Best for modern full-stack web apps, SEO-driven portals, SaaS platforms with SSR/SSG.
- FastAPI (Modular Clean Architecture): Best for high-performance Python backends, AI/ML APIs, microservices, and database-intensive backends.
- React + Vite (Feature-Based SPA): Best for client-heavy single-page applications, dashboards, or offline-capable apps paired with a separate API.
- Fullstack (Next.js/React + FastAPI): Next.js or React frontend connected to a FastAPI backend.
Step 3: Initialize Project Documentation
Create the docs/ folder and root configuration markdown files:
docs/PRD.md — Product Requirements Document (What & Why)
docs/ARCHITECTURE.md — System architecture, flow diagrams, and architectural rules (How)
docs/DESIGN.md — Typography, colors, spacing tokens, button/card specs, loading/empty/error states
docs/RULES.md — AI rulebook for code style, input validation, and commit hygiene
docs/TASKS.md — Phased atomic checklist (Setup $\rightarrow$ Auth $\rightarrow$ Feature Slices)
docs/DECISIONS.md — Architectural Decision Records (ADRs)
docs/MEMORY.md — Current active status, completed items, active task, blockers
docs/TEST_PLAN.md — Acceptance criteria and responsive matrix (375px, 768px, 1440px)
docs/SECURITY.md — Authentication, authorization guards, secret management, upload sanitization
.env.example — Required environment variable keys without secrets
README.md — Developer setup guide and run instructions
Mode 2: Exact Architecture Scaffolding
You can scaffold the exact folder structures directly or invoke the built-in generator script:
python scripts/scaffold.py --stack [nextjs|fastapi|react|fullstack] --name <project-name> --output-dir <path> [--with-docs]
1. Next.js App Router Architecture (frontend/)
Reference document: nextjs-architecture.md
Key structure highlights:
app/: Next.js App Router routing layer with route groups:
(public)/: layout.tsx, page.tsx (landing), about/page.tsx, contact/page.tsx
(auth)/: layout.tsx, login/page.tsx, register/page.tsx, forgot-password/page.tsx, reset-password/page.tsx
(dashboard)/: layout.tsx, dashboard/page.tsx, profile/page.tsx, settings/page.tsx, reports/page.tsx
(admin)/: layout.tsx, dashboard/page.tsx, users/page.tsx, roles/page.tsx, permissions/page.tsx
api/auth/route.ts: BFF/API endpoints
layout.tsx, loading.tsx, error.tsx, not-found.tsx, page.tsx
features/: Modular business domains (auth, dashboard, profile, settings, users, reports). Each feature contains:
components/, hooks/, api/ (service, query, mutation), store/, context/, validation/, utils/, types/, constants/, tests/, and barrel index.ts.
components/: Shared UI components (ui/ with Button, Input, Card, Modal, Table, Select, Badge, Spinner; common/ with Loader, EmptyState, ErrorMessage, ConfirmDialog; layout/ with Navbar, Sidebar, Footer, Header).
services/: API Axios client, endpoints, interceptors, WebSocket, Firebase.
hooks/, store/, lib/, context/, utils/, constants/, config/, types/, styles/, assets/, public/, tests/.
- Root files:
middleware.ts, Dockerfile, .dockerignore, .env.local, .env.production, next.config.js, tsconfig.json, package.json, README.md.
2. FastAPI Modular Domain Architecture (backend/)
Reference document: fastapi-architecture.md
Strict Layer Responsibilities:
| Layer |
File / Directory |
Responsibility |
| Router |
router.py |
Handles HTTP request/response, path/query validation, status codes, dependency injection |
| Service |
service.py |
Core business logic, domain rules, transaction coordination, validation |
| Repository |
repository.py |
Database operations, SQLAlchemy ORM queries, CRUD abstraction |
| Models |
models/ |
DB table schema definitions (SQLAlchemy Base) |
| Schemas |
schema.py |
Pydantic V2 request & response serialization models |
| Guards |
dependency.py |
Route-level security dependencies, token parsing, RBAC guards |
Key structure highlights:
app/main.py: Entrypoint
app/app_factory.py: Application factory pattern
app/core/: config.py (Pydantic Settings), security.py (hashing, JWT), logging.py, events.py, exceptions.py
app/db/: base.py (DeclarativeBase), session.py (engine & sessionmaker), models_import.py (Alembic model aggregator)
app/modules/: Feature modules (auth/, users/, items/), each strictly adhering to router $\rightarrow$ service $\rightarrow$ repository $\rightarrow$ models.
app/shared/: responses.py, pagination.py, constants.py
app/dependencies.py, app/middleware.py
alembic/: Database migrations
tests/: unit/ and integration/
- Root:
requirements.txt, Dockerfile
3. React + Vite Feature Architecture (my-react-app/)
Reference document: react-vite-architecture.md
Key structure highlights:
public/: favicon.ico, robots.txt, manifest.json
src/features/: Feature modules (auth, dashboard, profile, settings) containing components, hooks, api, types, store slices, utils, and context.
src/components/:
ui/: Button/, Input/, Modal/, Spinner/, Badge/ (each with .jsx, .module.css, .test.jsx, index.js)
shared/: Navbar/, Footer/, Sidebar/, ErrorBoundary/
layout/: AuthLayout.jsx, DashboardLayout.jsx, PublicLayout.jsx
src/hooks/, src/context/, src/services/ (axiosClient.js, endpoints.js, firebase.js, socket.js), src/store/, src/types/, src/utils/, src/constants/, src/config/, src/routes/ (AppRoutes.jsx, PrivateRoute.jsx, routesConfig.js), src/styles/, src/lib/, src/tests/.
- Root files:
App.jsx, main.jsx, index.css, .env, .env.example, .gitignore, .eslintrc.cjs, .prettierrc, package.json, README.md, tsconfig.json, vite.config.js.
Mode 4: Vertical-Slice Feature Builder
When developing features in the scaffolded project, enforce vertical-slice delivery:
[Understand] -> [Plan] -> [Implement Single Slice] -> [Test] -> [Review] -> [Commit] -> [Sync Docs]
The 6-Part Structured Prompt Template
Whenever instructing AI to code a feature:
- CONTEXT: What product we are building + reference
docs/PRD.md, ARCHITECTURE.md, and RULES.md.
- TASK: Exactly one atomic feature task (e.g.
TASK-001: Implement Login Form UI).
- FILES: Exact list of files to touch (e.g.
features/auth/components/LoginForm.tsx).
- CONSTRAINTS: Never touch unrelated files, reuse existing components, validate inputs.
- ACCEPTANCE CRITERIA: Clear checklist of what must work for the feature to be done.
- TESTING: Type check, lint check, unit tests, and responsive verification.
Mode 5: Project Reopen & Resume Protocol
Whenever you close a project and reopen it later in a new session:
Step 1: Re-alignment & Reading Context
The AI assistant must immediately inspect the project state before taking action:
- Read
docs/MEMORY.md to identify:
- Current status of the project.
- What tasks were completed in previous sessions.
- What is the active task and immediate next step.
- Any active blockers or known issues.
- Read
docs/TASKS.md to see the roadmap phase and remaining items.
- Read
docs/RULES.md and docs/ARCHITECTURE.md to re-align on layer discipline and coding constraints.
- Provide a quick summary to the user:
"Resumed project [Name]. Current status: [Status from MEMORY.md]. Next scheduled task: [TASK-ID: Title]. Ready to proceed?"
Step 2: Implementation & Testing
- Work strictly on the active task identified in
MEMORY.md.
- Follow the architectural boundaries (router $\rightarrow$ service $\rightarrow$ repository in FastAPI, or feature-slice in Next.js/React).
- Verify the change against
docs/TEST_PLAN.md (unit tests, lint, typecheck, responsive checks).
Step 3: Synchronize Documentation
Once the feature slice is verified and committed:
docs/TASKS.md: Mark the completed task [x].
docs/MEMORY.md:
- Move the completed task to "Completed Milestones".
- Set the new active task and immediate next steps.
- Note any new dependencies or issues discovered.
docs/DECISIONS.md: If any new technical choice was made, record an ADR.
docs/SECURITY.md: If any new auth route or sensitive data was introduced, document the security controls.
Mode 6: 200% Production Architecture & Feasibility Engine
Use this mode whenever you bring a specific technical problem or feature (e.g., "How do I implement real-time alerts for 100k users?", "Design the payment webhook flow", "What is the best architecture for this search problem?").
Reference document: production-architecture-evaluation.md
The 5-Step Principal Architect Pass (Normal vs. Best Production Fit + Azure Pricing)
flowchart TD
Prob["1. Ingest Problem & Scale Targets"] --> Methods["2. Method Comparison\n- Normal / Baseline Method\n- Best Production Fit (Your Case)\n- Hyper-Scale Method"]
Methods --> Pricing["3. Real Azure Pricing Check\n(Container Apps, Service Bus, Postgres, Redis, Blob Storage)"]
Pricing --> Decision["4. Best Fit Verdict & 200% Architecture Flow\n(Mermaid diagram, layer contracts, idempotency, retries)"]
Decision --> LockDocs["5. Lock into Project Docs\n- docs/ARCHITECTURE.md\n- docs/DECISIONS.md (ADR with Azure cost breakdown)\n- docs/TASKS.md"]
Step 1: Analyze the Given Problem
Extract the core problem, user volume, read vs. write ratio, latency tolerance, and security requirements.
Step 2: Architecture Method Breakdown
Contrast three clear methods:
- Normal / Baseline Method: The quick, naive implementation commonly found in tutorials (e.g. processing synchronously in route handlers, unindexed table scans, basic polling). Point out exactly why it fails in production, where the bottleneck will choke, and what race conditions it creates.
- Best Production Fit (200% Recommended for Your Case): The battle-tested, resilient architecture designed specifically for your stack and use case (clean layer separation, async workers, cache-aside, idempotency, and graceful degradation).
- Hyper-Scale Method: The extreme-scale distributed pattern (e.g. multi-region Kafka/Event Hubs, Cosmos DB globally distributed), and whether it represents costly over-engineering for your current stage.
Step 3: Microsoft Azure Pricing & Cost Feasibility Check
Go and check official Microsoft Azure pricing for the methods:
- Compute: Azure Container Apps (serverless consumption with free grant) vs. Azure App Service (Linux B1/P1v3) vs. Azure Functions.
- Database: Azure Database for PostgreSQL Flexible Server (Burstable B1ms vs General Purpose D2ds_v5) vs. Azure SQL.
- Queuing & Messaging: Azure Service Bus (Standard tier topics/queues with DLQ) vs. Azure Storage Queues.
- Storage & Uploads: Azure Blob Storage (Hot/Cool) with SAS tokens for direct browser uploads.
- Caching: Azure Cache for Redis (Basic C0 vs Standard C1).
- Provide a clear Estimated Monthly Azure Cost Breakdown at:
- Starting volume (~1,000 active users)
- Growth volume (~10,000 active users)
- Scale volume (~100,000 active users)
Step 4: Best Fit Verdict & 200% Architecture Flow
Select the Best Fit for your exact case and produce:
- Mermaid End-to-End Flow Diagram: Complete client-to-cloud visual pipeline.
- Layer Contracts: Router $\rightarrow$ Service $\rightarrow$ Azure Service Bus $\rightarrow$ Worker $\rightarrow$ Database.
- Resilience Specifications: Idempotency keys, retry policy with exponential backoff, dead-letter queue (DLQ) handling, and cache invalidation.
Step 5: Lock into Project Documentation
Before writing implementation code:
- Update
docs/ARCHITECTURE.md with the new architecture flow and Azure component diagram.
- Record an Architecture Decision Record (ADR) in
docs/DECISIONS.md detailing the problem, the methods evaluated (Normal vs. Best Fit), and the Azure cost rationale.
- Break down the implementation into atomic vertical slices in
docs/TASKS.md.
Pre-Deployment Verification Checklist
Before pushing to production or preview:
Reference Guides and Resources
1---2name: project-scaffold3description: Project Scaffold & Vibe Coding Workflow4---56# Project Scaffold & Vibe Coding Workflow78Create, architect, and continuously maintain production-ready projects using the **Vibe Coding: Beginner-to-Production** workflow. This skill eliminates chaos, prevents scope creep, enforces architectural integrity, and scaffolds the **exact** feature-based or modular architectures for **Next.js**, **FastAPI**, and **React (Vite)**.910---1112## The Core Philosophy: The Professional Vibe Loop1314Never skip directly from:15$$\text{IDEA} \longrightarrow \text{AI} \longrightarrow \text{DEPLOY}$$1617Instead, follow the complete production lifecycle:18$$\text{IDEA} \rightarrow \text{RESEARCH} \rightarrow \text{PRD} \rightarrow \text{STACK} \rightarrow \text{ARCHITECTURE} \rightarrow \text{DESIGN} \rightarrow \text{RULES} \rightarrow \text{TASKS} \rightarrow \text{SCAFFOLD} \rightarrow \text{FEATURE SLICES} \rightarrow \text{TEST} \rightarrow \text{PREVIEW} \rightarrow \text{PROD}$$1920---2122## Operating Modes2324Choose the mode matching the user's intent:2526| Mode | Trigger | Output |27|---|---|---|28| **Mode 1: Full Project Inception** | User has an idea or wants to start a project from scratch | 5-question intake brief, complete `docs/` suite, exact folder scaffolding, and initial `TASKS.md` |29| **Mode 2: Exact Architecture Scaffolding** | User specifies stack (Next.js, FastAPI, React, or Fullstack) | Creates the exact directory tree, placeholder files, barrel exports, configs, and types |30| **Mode 3: Documentation & AI Rulebook Initializer** | Existing project or docs-only setup | Generates `PRD.md`, `ARCHITECTURE.md`, `DESIGN.md`, `RULES.md`, `TASKS.md`, `DECISIONS.md`, `MEMORY.md`, `TEST_PLAN.md`, `SECURITY.md`, `.env.example` |31| **Mode 4: Vertical-Slice Feature Builder** | Implementing a feature in an active project | 6-part structured AI prompt, single-slice execution, automated testing, git commit, and doc sync |32| **Mode 5: Project Reopen & Resume Protocol** | User reopens an existing project or starts a new chat session | Reads `MEMORY.md`, `TASKS.md`, and `RULES.md`, states active status, aligns on next step, and updates docs upon completion |33| **Mode 6: 200% Production Architecture & Feasibility Engine** | User presents a technical problem or feature requirement in a new or existing project | Critiques naive patterns, checks internet standards & cloud pricing, provides 3-option trade-off matrix, designs 200% production flow, and documents in `docs/ARCHITECTURE.md` & `docs/DECISIONS.md` |3435---3637## Mode 1: Full Project Inception3839### Step 1: The 5-Question Intake Brief40Before writing code or creating folders, ask these five questions (or extract them from the user's prompt):41421. **What problem are you solving?** (The core pain point)432. **Who is the target user?** (Demographics, roles, audience)443. **What is the main outcome?** (What success looks like for the user)454. **What is the MVP?** (List only the absolute core features, e.g., Auth, Dashboard, Core Entity CRUD)465. **What is explicitly OUT OF SCOPE for v1?** (e.g., No mobile app, no AI chat, no payments, no social feeds)4748*Rule: Never proceed to code if items 1, 4, and 5 are undefined.*4950### Step 2: Select the Tech Stack Architecture51Match the requirements to the exact architectural pattern:52- **Next.js (App Router, Feature-Based)**: Best for modern full-stack web apps, SEO-driven portals, SaaS platforms with SSR/SSG.53- **FastAPI (Modular Clean Architecture)**: Best for high-performance Python backends, AI/ML APIs, microservices, and database-intensive backends.54- **React + Vite (Feature-Based SPA)**: Best for client-heavy single-page applications, dashboards, or offline-capable apps paired with a separate API.55- **Fullstack (Next.js/React + FastAPI)**: Next.js or React frontend connected to a FastAPI backend.5657### Step 3: Initialize Project Documentation58Create the `docs/` folder and root configuration markdown files:59- `docs/PRD.md` — Product Requirements Document (What & Why)60- `docs/ARCHITECTURE.md` — System architecture, flow diagrams, and architectural rules (How)61- `docs/DESIGN.md` — Typography, colors, spacing tokens, button/card specs, loading/empty/error states62- `docs/RULES.md` — AI rulebook for code style, input validation, and commit hygiene63- `docs/TASKS.md` — Phased atomic checklist (Setup $\rightarrow$ Auth $\rightarrow$ Feature Slices)64- `docs/DECISIONS.md` — Architectural Decision Records (ADRs)65- `docs/MEMORY.md` — Current active status, completed items, active task, blockers66- `docs/TEST_PLAN.md` — Acceptance criteria and responsive matrix (375px, 768px, 1440px)67- `docs/SECURITY.md` — Authentication, authorization guards, secret management, upload sanitization68- `.env.example` — Required environment variable keys without secrets69- `README.md` — Developer setup guide and run instructions7071---7273## Mode 2: Exact Architecture Scaffolding7475You can scaffold the exact folder structures directly or invoke the built-in generator script:76```powershell77python scripts/scaffold.py --stack [nextjs|fastapi|react|fullstack] --name <project-name> --output-dir <path> [--with-docs]78```7980### 1. Next.js App Router Architecture (`frontend/`)81Reference document: [nextjs-architecture.md](./references/nextjs-architecture.md)8283Key structure highlights:84- `app/`: Next.js App Router routing layer with route groups:85 - `(public)/`: `layout.tsx`, `page.tsx` (landing), `about/page.tsx`, `contact/page.tsx`86 - `(auth)/`: `layout.tsx`, `login/page.tsx`, `register/page.tsx`, `forgot-password/page.tsx`, `reset-password/page.tsx`87 - `(dashboard)/`: `layout.tsx`, `dashboard/page.tsx`, `profile/page.tsx`, `settings/page.tsx`, `reports/page.tsx`88 - `(admin)/`: `layout.tsx`, `dashboard/page.tsx`, `users/page.tsx`, `roles/page.tsx`, `permissions/page.tsx`89 - `api/auth/route.ts`: BFF/API endpoints90 - `layout.tsx`, `loading.tsx`, `error.tsx`, `not-found.tsx`, `page.tsx`91- `features/`: Modular business domains (`auth`, `dashboard`, `profile`, `settings`, `users`, `reports`). Each feature contains:92 - `components/`, `hooks/`, `api/` (service, query, mutation), `store/`, `context/`, `validation/`, `utils/`, `types/`, `constants/`, `tests/`, and barrel `index.ts`.93- `components/`: Shared UI components (`ui/` with Button, Input, Card, Modal, Table, Select, Badge, Spinner; `common/` with Loader, EmptyState, ErrorMessage, ConfirmDialog; `layout/` with Navbar, Sidebar, Footer, Header).94- `services/`: API Axios client, endpoints, interceptors, WebSocket, Firebase.95- `hooks/`, `store/`, `lib/`, `context/`, `utils/`, `constants/`, `config/`, `types/`, `styles/`, `assets/`, `public/`, `tests/`.96- Root files: `middleware.ts`, `Dockerfile`, `.dockerignore`, `.env.local`, `.env.production`, `next.config.js`, `tsconfig.json`, `package.json`, `README.md`.9798---99100### 2. FastAPI Modular Domain Architecture (`backend/`)101Reference document: [fastapi-architecture.md](./references/fastapi-architecture.md)102103Strict Layer Responsibilities:104| Layer | File / Directory | Responsibility |105|---|---|---|106| **Router** | `router.py` | Handles HTTP request/response, path/query validation, status codes, dependency injection |107| **Service** | `service.py` | Core business logic, domain rules, transaction coordination, validation |108| **Repository**| `repository.py`| Database operations, SQLAlchemy ORM queries, CRUD abstraction |109| **Models** | `models/` | DB table schema definitions (SQLAlchemy Base) |110| **Schemas** | `schema.py` | Pydantic V2 request & response serialization models |111| **Guards** | `dependency.py`| Route-level security dependencies, token parsing, RBAC guards |112113Key structure highlights:114- `app/main.py`: Entrypoint115- `app/app_factory.py`: Application factory pattern116- `app/core/`: `config.py` (Pydantic Settings), `security.py` (hashing, JWT), `logging.py`, `events.py`, `exceptions.py`117- `app/db/`: `base.py` (DeclarativeBase), `session.py` (engine & sessionmaker), `models_import.py` (Alembic model aggregator)118- `app/modules/`: Feature modules (`auth/`, `users/`, `items/`), each strictly adhering to router $\rightarrow$ service $\rightarrow$ repository $\rightarrow$ models.119- `app/shared/`: `responses.py`, `pagination.py`, `constants.py`120- `app/dependencies.py`, `app/middleware.py`121- `alembic/`: Database migrations122- `tests/`: `unit/` and `integration/`123- Root: `requirements.txt`, `Dockerfile`124125---126127### 3. React + Vite Feature Architecture (`my-react-app/`)128Reference document: [react-vite-architecture.md](./references/react-vite-architecture.md)129130Key structure highlights:131- `public/`: `favicon.ico`, `robots.txt`, `manifest.json`132- `src/features/`: Feature modules (`auth`, `dashboard`, `profile`, `settings`) containing components, hooks, api, types, store slices, utils, and context.133- `src/components/`:134 - `ui/`: `Button/`, `Input/`, `Modal/`, `Spinner/`, `Badge/` (each with `.jsx`, `.module.css`, `.test.jsx`, `index.js`)135 - `shared/`: `Navbar/`, `Footer/`, `Sidebar/`, `ErrorBoundary/`136 - `layout/`: `AuthLayout.jsx`, `DashboardLayout.jsx`, `PublicLayout.jsx`137- `src/hooks/`, `src/context/`, `src/services/` (`axiosClient.js`, `endpoints.js`, `firebase.js`, `socket.js`), `src/store/`, `src/types/`, `src/utils/`, `src/constants/`, `src/config/`, `src/routes/` (`AppRoutes.jsx`, `PrivateRoute.jsx`, `routesConfig.js`), `src/styles/`, `src/lib/`, `src/tests/`.138- Root files: `App.jsx`, `main.jsx`, `index.css`, `.env`, `.env.example`, `.gitignore`, `.eslintrc.cjs`, `.prettierrc`, `package.json`, `README.md`, `tsconfig.json`, `vite.config.js`.139140---141142## Mode 4: Vertical-Slice Feature Builder143144When developing features in the scaffolded project, enforce vertical-slice delivery:145146```147[Understand] -> [Plan] -> [Implement Single Slice] -> [Test] -> [Review] -> [Commit] -> [Sync Docs]148```149150### The 6-Part Structured Prompt Template151Whenever instructing AI to code a feature:1521. **CONTEXT**: What product we are building + reference `docs/PRD.md`, `ARCHITECTURE.md`, and `RULES.md`.1532. **TASK**: Exactly one atomic feature task (e.g. `TASK-001: Implement Login Form UI`).1543. **FILES**: Exact list of files to touch (e.g. `features/auth/components/LoginForm.tsx`).1554. **CONSTRAINTS**: Never touch unrelated files, reuse existing components, validate inputs.1565. **ACCEPTANCE CRITERIA**: Clear checklist of what must work for the feature to be done.1576. **TESTING**: Type check, lint check, unit tests, and responsive verification.158159---160161## Mode 5: Project Reopen & Resume Protocol162163Whenever you close a project and reopen it later in a new session:164165### Step 1: Re-alignment & Reading Context166The AI assistant must immediately inspect the project state **before** taking action:1671. Read `docs/MEMORY.md` to identify:168 - Current status of the project.169 - What tasks were completed in previous sessions.170 - What is the active task and immediate next step.171 - Any active blockers or known issues.1722. Read `docs/TASKS.md` to see the roadmap phase and remaining items.1733. Read `docs/RULES.md` and `docs/ARCHITECTURE.md` to re-align on layer discipline and coding constraints.1744. Provide a quick summary to the user:175 > *"Resumed project [Name]. Current status: [Status from MEMORY.md]. Next scheduled task: [TASK-ID: Title]. Ready to proceed?"*176177### Step 2: Implementation & Testing178- Work strictly on the active task identified in `MEMORY.md`.179- Follow the architectural boundaries (router $\rightarrow$ service $\rightarrow$ repository in FastAPI, or feature-slice in Next.js/React).180- Verify the change against `docs/TEST_PLAN.md` (unit tests, lint, typecheck, responsive checks).181182### Step 3: Synchronize Documentation183Once the feature slice is verified and committed:1841. **`docs/TASKS.md`**: Mark the completed task `[x]`.1852. **`docs/MEMORY.md`**:186 - Move the completed task to "Completed Milestones".187 - Set the new active task and immediate next steps.188 - Note any new dependencies or issues discovered.1893. **`docs/DECISIONS.md`**: If any new technical choice was made, record an ADR.1904. **`docs/SECURITY.md`**: If any new auth route or sensitive data was introduced, document the security controls.191192---193194## Mode 6: 200% Production Architecture & Feasibility Engine195196Use this mode whenever you bring a specific technical problem or feature (e.g., *"How do I implement real-time alerts for 100k users?"*, *"Design the payment webhook flow"*, *"What is the best architecture for this search problem?"*).197198Reference document: [production-architecture-evaluation.md](./references/production-architecture-evaluation.md)199200### The 5-Step Principal Architect Pass (Normal vs. Best Production Fit + Azure Pricing)201202```mermaid203flowchart TD204 Prob["1. Ingest Problem & Scale Targets"] --> Methods["2. Method Comparison\n- Normal / Baseline Method\n- Best Production Fit (Your Case)\n- Hyper-Scale Method"]205 Methods --> Pricing["3. Real Azure Pricing Check\n(Container Apps, Service Bus, Postgres, Redis, Blob Storage)"]206 Pricing --> Decision["4. Best Fit Verdict & 200% Architecture Flow\n(Mermaid diagram, layer contracts, idempotency, retries)"]207 Decision --> LockDocs["5. Lock into Project Docs\n- docs/ARCHITECTURE.md\n- docs/DECISIONS.md (ADR with Azure cost breakdown)\n- docs/TASKS.md"]208```209210#### Step 1: Analyze the Given Problem211Extract the core problem, user volume, read vs. write ratio, latency tolerance, and security requirements.212213#### Step 2: Architecture Method Breakdown214Contrast three clear methods:2151. **Normal / Baseline Method**: The quick, naive implementation commonly found in tutorials (e.g. processing synchronously in route handlers, unindexed table scans, basic polling). Point out exactly **why it fails in production**, where the bottleneck will choke, and what race conditions it creates.2162. **Best Production Fit (200% Recommended for Your Case)**: The battle-tested, resilient architecture designed specifically for your stack and use case (clean layer separation, async workers, cache-aside, idempotency, and graceful degradation).2173. **Hyper-Scale Method**: The extreme-scale distributed pattern (e.g. multi-region Kafka/Event Hubs, Cosmos DB globally distributed), and whether it represents costly over-engineering for your current stage.218219#### Step 3: Microsoft Azure Pricing & Cost Feasibility Check220Go and check official Microsoft Azure pricing for the methods:221- **Compute**: Azure Container Apps (serverless consumption with free grant) vs. Azure App Service (Linux B1/P1v3) vs. Azure Functions.222- **Database**: Azure Database for PostgreSQL Flexible Server (Burstable B1ms vs General Purpose D2ds_v5) vs. Azure SQL.223- **Queuing & Messaging**: Azure Service Bus (Standard tier topics/queues with DLQ) vs. Azure Storage Queues.224- **Storage & Uploads**: Azure Blob Storage (Hot/Cool) with **SAS tokens** for direct browser uploads.225- **Caching**: Azure Cache for Redis (Basic C0 vs Standard C1).226- Provide a clear **Estimated Monthly Azure Cost Breakdown** at:227 - Starting volume (~1,000 active users)228 - Growth volume (~10,000 active users)229 - Scale volume (~100,000 active users)230231#### Step 4: Best Fit Verdict & 200% Architecture Flow232Select the **Best Fit for your exact case** and produce:233- **Mermaid End-to-End Flow Diagram**: Complete client-to-cloud visual pipeline.234- **Layer Contracts**: Router $\rightarrow$ Service $\rightarrow$ Azure Service Bus $\rightarrow$ Worker $\rightarrow$ Database.235- **Resilience Specifications**: Idempotency keys, retry policy with exponential backoff, dead-letter queue (DLQ) handling, and cache invalidation.236237#### Step 5: Lock into Project Documentation238Before writing implementation code:2391. Update **`docs/ARCHITECTURE.md`** with the new architecture flow and Azure component diagram.2402. Record an Architecture Decision Record (ADR) in **`docs/DECISIONS.md`** detailing the problem, the methods evaluated (Normal vs. Best Fit), and the Azure cost rationale.2413. Break down the implementation into atomic vertical slices in **`docs/TASKS.md`**.242243---244245## Pre-Deployment Verification Checklist246247Before pushing to production or preview:248- [ ] **Code Hygiene**: Type checking passes (`npm run typecheck` or `mypy`), linting passes (`npm run lint` or `ruff`), automated tests pass.249- [ ] **UI States**: Mobile (375px), Tablet (768px), and Desktop (1440px) verified. Loading, empty, and error states present.250- [ ] **Security**: No secrets committed to Git, all endpoints protected server-side, all inputs validated.251- [ ] **Documentation**: `TASKS.md` and `MEMORY.md` updated with completed status and next steps.252253---254255## Reference Guides and Resources256- Detailed Next.js Blueprint: [nextjs-architecture.md](./references/nextjs-architecture.md)257- Detailed FastAPI Blueprint: [fastapi-architecture.md](./references/fastapi-architecture.md)258- Detailed React Blueprint: [react-vite-architecture.md](./references/react-vite-architecture.md)259- Complete Vibe Coding Methodology: [vibe-coding-workflow.md](./references/vibe-coding-workflow.md)260- Production Architecture Evaluation: [production-architecture-evaluation.md](./references/production-architecture-evaluation.md)261- Scaffolding Generator Script: [scaffold.py](./scripts/scaffold.py)262- Markdown Templates: [templates/](./templates/)263