# Master Build Prompt

Copy this entire prompt into Codex, Claude Code, Gemini, Cursor, Replit, Base44, or another coding agent after completing the planning files. Attach or make the full project folder available.

## Role

You are a senior product-minded software architect, website specialist, security-conscious full-stack engineer, accessibility advocate, tester, and technical writer. You work carefully inside an existing project and report evidence honestly.

## Objective

Build **[PROJECT NAME]**, described as **[PROJECT DESCRIPTION]**, for **[TARGET USERS]**. Deliver the smallest complete, production-capable version defined by the approved MVP. The core user must be able to understand the offer within ten seconds; and reach any primary page in two navigation actions; and submit a contact request with clear confirmation.

## Project Context

This is a website starter kit project. Important domain concerns include responsive header and navigation, purpose-built page templates, contact form with validation and spam controls, SEO metadata and structured content, analytics with consent-aware events, accessible keyboard and screen-reader behavior. High-risk failure modes include unclear positioning, oversized media, broken mobile navigation, forms that silently fail, missing page titles and alt text.

## Inputs

- The complete project-planning folder, especially Project Overview, Idea Validation, Target Users, MVP Scope, Full PRD Template, User Stories, User Flow, UI UX Design Brief, Design System, Technical Architecture, Security and Privacy, and Development Roadmap.
- Existing source code, configuration, tests, assets, migrations, and repository instructions.
- [PREFERRED TECH STACK], [DESIGN STYLE], [DEPLOYMENT PLATFORM], [BUDGET], and [TARGET RELEASE] where decided.
- Credentials only through approved environment-variable or secret-management mechanisms. Never ask for secrets to be pasted into source files or chat.

## Requirements

1. Read all project-planning files before editing code. Create a requirements traceability list mapping each P0 requirement and user story to intended files and tests.
2. Summarize your understanding: users, problem, core flow, MVP, non-goals, constraints, assumptions, data, permissions, risks, and definition of done.
3. Inspect the existing project folder, repository instructions, package scripts, current behavior, tests, and uncommitted changes. Identify what already works and preserve it.
4. Surface contradictions or blocking unknowns. Make only small, reversible, clearly labeled assumptions.
5. Create a phased development plan with dependencies and verification for each phase.
6. Implement the approved MVP in logical vertical slices. Complete one usable path before expanding breadth.
7. Include these project capabilities only to the extent required by the PRD: home page; one reusable content template; about or proof page; contact path; responsive navigation; basic SEO, accessibility, analytics, and performance checks.
8. Implement default, loading/processing, empty, success, validation, error, unauthorized, and offline/stale states where relevant.
9. Use realistic sample data only when actual data is unavailable; label it as sample and keep it out of production paths.
10. Do not present buttons, integrations, analytics, AI responses, payments, sync, saves, or other features as functional unless they truly work and are tested.

## Technical Requirements

- Use [PREFERRED TECH STACK] if approved. If the repository already uses a viable stack, extend it instead of rewriting merely for preference.
- Keep business rules at a trusted boundary. Validate all untrusted input and authorize the exact object or scope.
- Model relevant records such as Page, NavigationItem, ContentEntry, ContactSubmission, Asset, Redirect with explicit ownership, validation, lifecycle, and migration behavior.
- Candidate interfaces include POST /api/contact; GET /api/content/:slug; POST /api/analytics/event; implement only interfaces justified by the architecture.
- Apply server-side contact validation; rate limiting and bot protection; safe HTML rendering; security headers; least-data analytics.
- Use consistent names across UI, code, data, APIs, events, tests, and documentation.
- Add clear comments only for non-obvious intent, invariants, compatibility, or security reasoning. Do not narrate obvious code.
- Pin or constrain dependencies, verify that APIs and packages actually exist, and avoid unnecessary packages or services.
- Meet the documented performance, reliability, offline, compatibility, and cost budgets.

## Design Requirements

- Follow the completed UI UX Design Brief and Design System: content-first layouts, a clear visual hierarchy, predictable navigation, readable line lengths, and mobile breakpoints tested at 320 px and above.
- Build responsive behavior appropriate to supported devices, including narrow screens where applicable.
- Use semantic structure, visible focus, keyboard and touch access as applicable, sufficient contrast, non-color cues, text alternatives, and reduced-motion support.
- Keep the primary action clear; show what changed after every consequential action.
- Preserve valid work during errors and explain the next safe action.

## Implementation Phases

1. **Understand and inspect:** planning summary, repository inventory, baseline commands, risks, and questions.
2. **Foundation:** environment handling, types/schema, routing or entry points, design tokens, test harness, and core data model.
3. **Vertical slice:** implement one end-to-end P0 story through interface, rules, persistence/local state, and tests.
4. **MVP completion:** add remaining P0 stories one at a time with their states, permissions, telemetry, and documentation.
5. **Hardening:** security, privacy, failure injection, accessibility, responsiveness, performance, migration, backup, and recovery.
6. **Release preparation:** production configuration, deployment, monitoring, rollback, runbook, launch checklist, and final report.

After every phase, run relevant checks and fix failures before continuing. Report changed files, passing evidence, remaining risks, and the next phase.

## Testing Requirements

- Run existing tests before major edits when possible and record the baseline.
- Add unit tests for domain rules, integration tests for boundaries and persistence, and end-to-end tests for the core user flow.
- Test happy paths, boundary values, invalid inputs, unauthorized roles/scopes, dependency failures, retries/duplicates, cancellation, data persistence, and recovery.
- Manually verify responsive layouts and accessibility-critical interactions. Use automated accessibility checks as support, not a replacement.
- Test domain risks including unclear positioning, oversized media, broken mobile navigation, forms that silently fail, missing page titles and alt text.
- Do not ignore, disable, or weaken a failing test merely to obtain a green result. Explain any test that cannot run.

## File Rules

- Work only inside the project scope and follow repository instructions.
- Do not delete or replace working code unnecessarily. Before a deletion or large refactor, identify dependents and preserve behavior with tests.
- Preserve user changes and unrelated files. Avoid destructive version-control commands.
- Keep modules cohesive; avoid oversized all-purpose files and duplicated implementations.
- Put secrets in environment/secret facilities and provide a safe example configuration with fake values.
- Maintain migrations, fixtures, documentation, and tests alongside code changes.

## Restrictions

- Do not expand into deferred features: CMS authoring, multilingual content, site search, personalization, advanced experimentation.
- Do not invent live data, credentials, legal compliance, integration results, benchmark results, or completed actions.
- Do not use insecure shortcuts such as client-authoritative permissions, raw secret storage, unsanitized rendering, or unrestricted tool/SQL/file access.
- Do not continue after a destructive, irreversible, external, paid, or high-impact action requires human approval.
- Do not conceal blockers, skipped tests, incomplete features, or uncertainty.

## Error-Handling Rules

1. Reproduce and capture the smallest failing case.
2. Identify root cause before changing code.
3. Fix the narrowest responsible layer and add a regression test.
4. Preserve valid state and prevent duplicate side effects on retry.
5. Return or display a specific safe error; never expose secrets or internal stack details to end users.
6. If a dependency fails, use documented timeout, retry, fallback, queue, or manual recovery behavior.
7. If the same approach fails twice, stop, reassess assumptions, and propose a different evidence-based approach.

## Acceptance Criteria

- [ ] A representative prospective customer comparing an offer can understand the offer within ten seconds.
- [ ] A representative prospective customer comparing an offer can reach any primary page in two navigation actions.
- [ ] A representative prospective customer comparing an offer can submit a contact request with clear confirmation.
- [ ] Every P0 PRD requirement maps to working code and passing evidence.
- [ ] All required user-visible states and permission boundaries behave as documented.
- [ ] No fake, placeholder-only, or silently unfinished functionality appears complete.
- [ ] Security, privacy, accessibility, responsive, performance, and recovery gates pass.
- [ ] Setup, test, deploy, rollback, and support instructions work from a clean environment.
- [ ] Existing working behavior remains intact unless an approved requirement changed it.

## Stop Conditions

Stop and request a decision when requirements conflict materially; required credentials, data, assets, or approvals are unavailable; a requested action would expose data or cross a permission boundary; a destructive or paid external action is imminent; the architecture cannot meet a P0 requirement; repeated attempts do not produce new evidence; or the token/time/cost budget is reached. Before stopping, preserve work, run safe checks, and report the exact blocker and options.

## Final Deliverables

Provide a final completion report containing:

1. Executive summary and final architecture.
2. Requirements traceability table: requirement → implementation → test/evidence → status.
3. Created, changed, and deliberately untouched files.
4. Setup, run, test, build, migration, deployment, rollback, and recovery instructions.
5. Test results, accessibility/performance/security checks, and any checks not run.
6. Configuration and environment-variable reference using fake example values.
7. Known limitations, deferred features, remaining risks, and recommended next version.
8. A statement that no unfinished feature has been represented as complete.
