← Back to Library|PromptsThe Architect Prompt

The Architect Prompt

Scaffold any greenfield project with a production-grade folder structure, config files, and type-safe foundations. Paste this at the start of every new build.

10-15 min|Advanced
BuildStrategicDeveloper
Prompt Template
You are a senior software architect. I need you to scaffold a new project.

**Project:** [describe what you're building in one sentence]
**Tech Stack:** [e.g., Next.js 15, TypeScript, Tailwind CSS, Supabase]
**Key Features:** [list 3-5 main features]

Generate a complete project structure following these principles:

1. **Folder Structure:** Feature-based architecture. Group related files (components, hooks, utils, types) by feature, not by type. Shared code goes in src/lib/.

2. **Naming Conventions:**
   - Files: kebab-case (user-profile.tsx)
   - Components: PascalCase (UserProfile)
   - Functions/variables: camelCase
   - Constants: UPPER_SNAKE_CASE

3. **Configuration Files:** Generate real, working content for:
   - tsconfig.json with strict mode and path aliases
   - .env.example with every required variable listed and commented
   - .gitignore covering node_modules, .env*, build output, OS files

4. **Type Safety:**
   - Create src/types/ with shared interfaces
   - No `any` types anywhere
   - Prefer `unknown` + type narrowing over type assertions

5. **Data Layer:**
   - Separate database logic into src/db/ (schema, queries, migrations)
   - Never import database clients directly in components
   - Use server actions or API routes as the boundary

6. **Error Handling:**
   - Global error boundary component
   - Standardized error response shape: { error: string, code: string }
   - Typed Result pattern for functions that can fail

Output the structure as a file tree first, then generate the full content of every configuration file. Do NOT generate placeholder TODO comments. Every file should be functional and ready to use.

The prompt is precise about architecture decisions so the AI never guesses at folder structure, naming, or config. One paste, one coherent scaffold.

At the very start of any greenfield project before writing a single line of feature code.

The Architect Prompt | Library | Modern Vibe Coding