Back to list
aws-samples

build-and-format

by aws-samples

53🍴 18📅 Jan 22, 2026

SKILL.md


name: build-and-format description: Verify builds pass and format code after implementation

Build and Format Verification

This skill runs build verification and code formatting across all project components.

When to Use

  • After implementing any code changes
  • Before committing code
  • After modifying Prisma schema
  • Before creating a pull request

Sequential Build Verification

1. Backend Build

cd backend
npm run build
npm run format

Expected Output:

  • TypeScript compilation succeeds
  • No type errors
  • Prettier formats all files

Common Errors:

ErrorCauseSolution
Module not found: @prisma/clientPrisma client not generatedRun npm run prisma:generate
TS2304: Cannot find nameType definition missingCheck imports and type exports
TS2345: Argument of type X is not assignableType mismatchReview function signatures

2. Frontend Build

cd frontend
npm run build
npm run format

Expected Output:

  • Vite builds successfully
  • All React components compile
  • Tailwind CSS processes correctly
  • Prettier formats all files

Common Errors:

ErrorCauseSolution
Module "X" has no exported memberImport from wrong pathCheck export statements
Property X does not exist on type YType mismatchReview component props
Cannot find module '@/...'Path alias issueCheck tsconfig paths

3. CDK Synthesis

cd cdk
npx cdk synth

Expected Output:

  • CloudFormation template generates successfully
  • No CDK construct errors
  • Stack validation passes

Common Errors:

ErrorCauseSolution
Cannot find module '../backend/...'Backend not builtRun cd backend && npm run build first
Docker daemon not runningDocker not startedStart Docker Desktop (macOS) or Docker service
Asset build failedLambda bundling errorCheck esbuild configuration

Full Build Sequence

Run all builds in correct order:

# From project root

# 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:

cd backend

# 1. Generate Prisma client
npm run prisma:generate

# 2. Build backend
npm run build

# 3. Format
npm run format

Troubleshooting

Docker Issues

macOS: Ensure Docker Desktop is running

# Check Docker status
docker ps

# If not running, start Docker Desktop from Applications

Linux: Ensure Docker service is active

sudo systemctl status docker
sudo systemctl start docker  # If not running

Prisma Generation Errors

# Delete generated client and regenerate
cd backend
rm -rf node_modules/.prisma
npm run prisma:generate

Node Modules Issues

# Clean install for specific component
cd backend  # or frontend, or cdk
rm -rf node_modules package-lock.json
npm ci

Build Cache Issues

# Clear TypeScript build cache
cd backend  # or frontend
rm -rf dist
npm run build

Quick Commands Reference

TaskCommand
Backend buildcd backend && npm run build
Backend formatcd backend && npm run format
Frontend buildcd frontend && npm run build
Frontend formatcd frontend && npm run format
CDK synthcd cdk && npx cdk synth
Prisma generatecd backend && npm run prisma:generate
Full sequenceBackend build → Frontend build → CDK synth

Success Criteria

All builds pass:

  • Backend: TypeScript compiles without errors
  • Frontend: Vite builds without errors
  • CDK: CloudFormation template generates

All formatting passes:

  • Backend: Prettier formats .ts files
  • Frontend: Prettier formats .ts, .tsx files

No console errors:

  • Check terminal output for warnings
  • Review error messages if any

After Successful Build

  1. ✅ All builds passed
  2. ✅ All code formatted
  3. Ready to commit or proceed with testing
  4. Consider running /test-database-feature if database changes were made

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon