Expert assistant for working with Tony's World of Chips, a 3-tier e-commerce monorepo demonstrating full-stack TypeScript, Docker, Prisma ORM, AWS RDS IAM auth, Valkey sessions, Playwright E2E tests, and System Initiative policy compliance checking.
This skill has safety concerns that you should review before use. Some patterns were detected that may pose a risk.Safety score: 60/100.
KillerSkills scans all public content for safety. Use caution before installing or executing flagged content.
Expert guidance for working with the Tony's World of Chips e-commerce application codebase.
This skill provides comprehensive guidance for developing, testing, deploying, and maintaining Tony's World of Chips—a demonstration e-commerce application built as a TypeScript monorepo with Docker containerization. It covers API development, web frontend, database management, E2E testing, CI/CD orchestration, and System Initiative policy compliance checking.
Tony's World of Chips is a full-stack e-commerce storefront application that sells potato chips. It demonstrates modern web application architecture with:
When working with this codebase, follow these guidelines:
**Key principle**: Both packages extend the root TypeScript config. When working with Docker builds, ensure root `tsconfig.json` is copied to resolve extends paths.
**Running services locally:**
```bash
npm run dev # Port 3000
npm test # Jest tests
npm run test:watch # Watch mode
npx prisma studio # Database GUI
npm run dev # Port 3001
npm run lint # ESLint
npm run test:e2e # Run all Playwright tests
npm run test:e2e:ui # Interactive UI mode
```
**Using Docker Compose:**
```bash
npm run build:local # Build images with latest tag
npm run docker:up # Start services
npm run docker:logs # View logs
npm run docker:test:e2e
npm run docker:down
```
**All database commands run from `packages/api/`:**
```bash
npx prisma migrate dev --name descriptive_name
npx prisma generate
npx prisma db seed
npx prisma studio
npx prisma migrate deploy
```
**Schema location**: `packages/api/prisma/schema.prisma`
**Models**: Product, CartItem, Order
**Authentication modes**:
- Controlled by `DB_USE_IAM_AUTH` environment variable
- Tokens auto-refresh every 14 minutes via `src/config/secrets.ts`
**Image Tags**:
**Building specific images:**
```bash
npx tsx ci/main.ts build-local all
npx tsx ci/main.ts build-local api
npx tsx ci/main.ts build-local web
npx tsx ci/main.ts build-local e2e
```
**Using versioned tags:**
```bash
IMAGE_TAG=20250115120000-abc123 docker-compose up
```
**Important Docker considerations**:
**Entry point**: `src/index.ts`
**Routes** (all under `/api/*` prefix):
**Database client**: `src/config/database.ts`
**Testing**: Jest with supertest in `src/__tests__/`
**AWS Integration**:
**Entry point**: `src/index.ts`
**Routes**:
**Session Management**:
**Views**: EJS templates in `views/` directory
**Service Layer**: `src/services/` contains Axios-based API clients
**Environment Variables**:
**Test files**:
**Configuration**: `playwright.config.ts` at root level
**Environment Variables**:
**Running tests**:
```bash
npm run test:e2e
npm run docker:test:e2e
API_URL=https://api.example.com WEB_URL=https://www.example.com npm run docker:test:e2e
docker run --rm \
-e API_URL=https://api.example.com \
-e WEB_URL=https://www.example.com \
-v $(pwd)/test-results:/app/test-results \
-v $(pwd)/playwright-report:/app/playwright-report \
tonys-chips/e2e:latest
```
**Entry point**: `ci/main.ts` - TypeScript CLI for all CI/CD operations
**Available commands**:
**Usage pattern**:
```bash
npx tsx ci/main.ts <command> [args]
npm run ci:<command>
```
**Policy structure**: Markdown files in `policy/` directory with YAML frontmatter
**Policy file format**:
```markdown
Policy description and requirements...
Any exceptions to the policy...
```yaml
query-name: "schema:AWS*"
another-query: "schema:AWS::EC2::*"
```
```yaml
tags:
- tag1
- tag2
```
```
**Running policy checks**:
```bash
npx tsx ci/main.ts check-policy policy/my-policy.md
npx tsx ci/main.ts check-policy policy/my-policy.md --output ./reports/report.md
npm run ci:check-policy policy/my-policy.md
```
**Required environment variables**:
**Policy check pipeline**:
1. Extract Policy - Claude parses markdown to structured data
2. Collect Source Data - Query System Initiative API
3. Evaluate Policy - Claude evaluates components against requirements
4. Generate Report - Markdown report with deep links to SI components
**GitHub Actions**: `policy-check.yml` workflow runs all policies on manual trigger, posts results to issues, and uploads reports as artifacts.
When making changes to this codebase:
**API changes**:
**Web changes**:
**Docker changes**:
**E2E test changes**:
**CI/CD changes**:
**Add a new API endpoint**:
1. Define route handler in appropriate file under `packages/api/src/routes/`
2. Mount route in `src/index.ts`
3. Add service method in web package if needed
4. Write integration tests
5. Update E2E tests if user-facing
**Add a new database table**:
1. Update `packages/api/prisma/schema.prisma`
2. Run `npx prisma generate`
3. Create migration: `npx prisma migrate dev --name add_table_name`
4. Update seed data in `prisma/seed.ts` if needed
5. Update TypeScript types and API routes
**Add a new web page**:
1. Create EJS template in `packages/web/views/`
2. Add route handler in `packages/web/src/index.ts`
3. Create service methods for API calls
4. Add static assets if needed
5. Write E2E tests for the page
**Debug session issues**:
1. Check Valkey connectivity: `docker-compose logs valkey`
2. Verify `REDIS_URL` environment variable
3. Check session secret configuration
4. Test session persistence across requests
5. Review `express-session` middleware configuration
**Troubleshoot database connections**:
1. Check PostgreSQL health: `docker-compose logs postgres`
2. Verify `DATABASE_URL` format
3. For IAM auth issues, check token refresh logic in `src/config/secrets.ts`
4. Test connection with `npx prisma db pull`
5. Review Prisma connection pooling settings
```bash
cd packages/api
npx prisma generate
npx prisma migrate dev --name add_product_category
npx prisma db seed
npm test
```
```bash
npx tsx ci/main.ts build sandbox e2e 20250115120000-abc123
API_URL=https://staging-api.example.com \
WEB_URL=https://staging-web.example.com \
docker run --rm \
-e API_URL=https://staging-api.example.com \
-e WEB_URL=https://staging-web.example.com \
-v $(pwd)/test-results:/app/test-results \
-v $(pwd)/playwright-report:/app/playwright-report \
tonys-chips/e2e:20250115120000-abc123
npm run test:e2e:report
```
```bash
export SI_API_TOKEN="your-si-token"
export SI_WORKSPACE_ID="your-workspace-id"
export ANTHROPIC_API_KEY="your-anthropic-key"
npx tsx ci/main.ts check-policy policy/security-groups.md
npx tsx ci/main.ts check-policy policy/security-groups.md \
--output ./reports/security-groups-$(date +%Y%m%d).md
cat ./reports/security-groups-*.md
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/tonys-world-of-chips-development-assistant/raw