# Build And Format

> Run build verification and code formatting across all RAPID project components (backend, frontend, CDK). Use after implementing code changes, before committing, after modifying Prisma schema, or before creating a pull request. Use when this capability is needed.

- Skill: `tomevault-io/build-and-format` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/build-and-format`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/build-and-format/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/build-and-format

---


# Build and Format Verification

## Build Sequence

Run builds in dependency order (backend must build before CDK):

```bash
# 1. Backend (must be first - CDK depends on it)
cd backend
npm run build
npm run format

# 2. Frontend
cd ../frontend
npm run build
npm run format

# 3. CDK (depends on backend build)
cd ../cdk
npx cdk synth
```

## Prisma-Specific Build

After modifying `backend/prisma/schema.prisma`:

```bash
cd backend
npm run prisma:generate
npm run build
npm run format
```

## Common Errors

| Error | Solution |
|-------|----------|
| `Module not found: @prisma/client` | `cd backend && npm run prisma:generate` |
| `Cannot find module '../backend/...'` (CDK) | Build backend first |
| `Docker daemon not running` (CDK synth) | Start Docker Desktop |

## Quick Commands

| Task | Command |
|------|---------|
| Backend build + format | `cd backend && npm run build && npm run format` |
| Frontend build + format | `cd frontend && npm run build && npm run format` |
| CDK synth | `cd cdk && npx cdk synth` |
| Prisma generate | `cd backend && npm run prisma:generate` |

## Success Criteria

- Backend: TypeScript compiles without errors
- Frontend: Vite builds without errors
- CDK: CloudFormation template generates
- All code formatted by Prettier

After successful build, consider running `/test-database-feature` if database changes were made.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/aws-samples) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

