Implement Vast.ai reference architecture with best-practice project layout. Use when designing new Vast.ai integrations, reviewing project structure, or establishing architecture standards for Vast.ai applications. Trigger with phrases like "vastai architecture", "vastai best practices", "vastai project structure", "how to organize vastai", "vastai layout".
View on GitHubjeremylongshore/claude-code-plugins-plus-skills
vastai-pack
plugins/saas-packs/vastai-pack/skills/vastai-reference-architecture/SKILL.md
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/vastai-pack/skills/vastai-reference-architecture/SKILL.md -a claude-code --skill vastai-reference-architectureInstallation paths:
.claude/skills/vastai-reference-architecture/# Vast.ai Reference Architecture
## Overview
Production-ready architecture patterns for Vast.ai integrations.
## Prerequisites
- Understanding of layered architecture
- Vast.ai SDK knowledge
- TypeScript project setup
- Testing framework configured
## Project Structure
```
my-vastai-project/
├── src/
│ ├── vastai/
│ │ ├── client.ts # Singleton client wrapper
│ │ ├── config.ts # Environment configuration
│ │ ├── types.ts # TypeScript types
│ │ ├── errors.ts # Custom error classes
│ │ └── handlers/
│ │ ├── webhooks.ts # Webhook handlers
│ │ └── events.ts # Event processing
│ ├── services/
│ │ └── vastai/
│ │ ├── index.ts # Service facade
│ │ ├── sync.ts # Data synchronization
│ │ └── cache.ts # Caching layer
│ ├── api/
│ │ └── vastai/
│ │ └── webhook.ts # Webhook endpoint
│ └── jobs/
│ └── vastai/
│ └── sync.ts # Background sync job
├── tests/
│ ├── unit/
│ │ └── vastai/
│ └── integration/
│ └── vastai/
├── config/
│ ├── vastai.development.json
│ ├── vastai.staging.json
│ └── vastai.production.json
└── docs/
└── vastai/
├── SETUP.md
└── RUNBOOK.md
```
## Layer Architecture
```
┌─────────────────────────────────────────┐
│ API Layer │
│ (Controllers, Routes, Webhooks) │
├─────────────────────────────────────────┤
│ Service Layer │
│ (Business Logic, Orchestration) │
├─────────────────────────────────────────┤
│ Vast.ai Layer │
│ (Client, Types, Error Handling) │
├─────────────────────────────────────────┤
│ Infrastructure Layer │
│ (Cache, Queue, Monitoring) │
└─────────────────────────────────────────┘
```
## Key Components
### Step 1: Client Wrapper
```typescript
// src/vastai/client.ts
export class Vast.