bamboohr-reference-architecture
Implement BambooHR reference architecture for production HR data pipelines. Use when designing new BambooHR integrations, building employee sync systems, or establishing architecture standards for BambooHR-powered applications. Trigger with phrases like "bamboohr architecture", "bamboohr design", "bamboohr project structure", "bamboohr system design", "bamboohr pipeline".
What this skill does
# BambooHR Reference Architecture
## Overview
Production-ready architecture for BambooHR integrations covering the three most common patterns: real-time employee sync, HR data pipeline, and employee lifecycle automation.
## Prerequisites
- Understanding of layered architecture and event-driven design
- BambooHR API knowledge from earlier skills in this pack
- TypeScript project setup with Node.js 18+
## Instructions
### Architecture Overview
```
┌──────────────────────────────────────────────────────────┐
│ Your Application │
├──────────────┬───────────────┬────────────────────────────┤
│ API Layer │ Sync Engine │ Webhook Handler │
│ /api/* │ (Cron/Queue) │ /webhooks/bamboohr │
├──────────────┴───────────────┴────────────────────────────┤
│ Service Layer │
│ EmployeeService │ TimeOffService │ ReportService │
├───────────────────┴──────────────────┴────────────────────┤
│ BambooHR Client Layer │
│ BambooHRClient │ Cache │ RetryHandler │ Metrics │
├───────────────────┴─────────┴────────────────┴────────────┤
│ Data Layer │
│ PostgreSQL (employees) │ Redis (cache) │ S3 (files) │
└───────────────────────────────────────────────────────────┘
│
▼
┌────────────────────────┐
│ BambooHR REST API │
│ api.bamboohr.com/api/ │
│ gateway.php/{co}/v1 │
└────────────────────────┘
```
### Project Structure
```
bamboohr-integration/
├── src/
│ ├── bamboohr/
│ │ ├── client.ts # HTTP client (from sdk-patterns)
│ │ ├── types.ts # BambooHR API response types
│ │ ├── retry.ts # Retry with Retry-After support
│ │ ├── cache.ts # LRU + Redis cache layer
│ │ └── metrics.ts # Request counting and latency
│ ├── services/
│ │ ├── employee-sync.ts # Incremental directory sync
│ │ ├── time-off.ts # PTO balance and request management
│ │ ├── reports.ts # Custom report generation
│ │ └── lifecycle.ts # Onboarding/offboarding automation
│ ├── handlers/
│ │ ├── webhook.ts # Webhook signature verification + routing
│ │ └── events.ts # Employee change event processors
│ ├── api/
│ │ ├── health.ts # Health check endpoint
│ │ ├── employees.ts # REST API for local employee data
│ │ └── reports.ts # Report generation endpoints
│ ├── jobs/
│ │ ├── full-sync.ts # Scheduled full directory sync
│ │ ├── incremental-sync.ts # Frequent delta sync
│ │ └── report-export.ts # Scheduled report export
│ └── db/
│ ├── schema.sql # PostgreSQL schema
│ └── queries.ts # Database queries
├── tests/
│ ├── unit/
│ │ ├── client.test.ts
│ │ ├── employee-sync.test.ts
│ │ └── webhook.test.ts
│ ├── integration/
│ │ └── bamboohr-live.test.ts
│ └── mocks/
│ └── bamboohr-handlers.ts # MSW handlers
├── config/
│ ├── default.json
│ ├── production.json
│ └── test.json
└── docker-compose.yml # PostgreSQL + Redis for local dev
```
### Step 1: Data Model
```sql
-- db/schema.sql
CREATE TABLE bamboohr_employees (
id INTEGER PRIMARY KEY, -- BambooHR employee ID
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
display_name TEXT,
work_email TEXT,
job_title TEXT,
department TEXT,
division TEXT,
location TEXT,
supervisor_id INTEGER REFERENCES bamboohr_employees(id),
status TEXT DEFAULT 'Active',
hire_date DATE,
termination_date DATE,
employee_number TEXT,
raw_data JSONB, -- Full BambooHR response
synced_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_employees_status ON bamboohr_employees(status);
CREATE INDEX idx_employees_department ON bamboohr_employees(department);
CREATE INDEX idx_employees_synced ON bamboohr_employees(synced_at);
CREATE TABLE bamboohr_sync_log (
id SERIAL PRIMARY KEY,
sync_type TEXT NOT NULL, -- 'full', 'incremental', 'webhook'
started_at TIMESTAMPTZ NOT NULL,
completed_at TIMESTAMPTZ,
employees_created INTEGER DEFAULT 0,
employees_updated INTEGER DEFAULT 0,
employees_deleted INTEGER DEFAULT 0,
errors JSONB DEFAULT '[]',
status TEXT DEFAULT 'running' -- 'running', 'completed', 'failed'
);
```
### Step 2: Employee Sync Service
```typescript
// src/services/employee-sync.ts
import { BambooHRClient } from '../bamboohr/client';
import { db } from '../db/queries';
const SYNC_FIELDS = [
'firstName', 'lastName', 'displayName', 'workEmail',
'jobTitle', 'department', 'division', 'location',
'supervisor', 'status', 'hireDate', 'terminationDate',
'employeeNumber',
];
export class EmployeeSyncService {
constructor(private client: BambooHRClient) {}
async fullSync(): Promise<SyncResult> {
const log = await db.createSyncLog('full');
try {
// One API call for all employee data
const report = await this.client.customReport(SYNC_FIELDS);
const result = { created: 0, updated: 0, deleted: 0, errors: [] as string[] };
for (const emp of report.employees) {
try {
const existing = await db.getEmployee(parseInt(emp.id));
if (existing) {
await db.updateEmployee(parseInt(emp.id), emp);
result.updated++;
} else {
await db.createEmployee(parseInt(emp.id), emp);
result.created++;
}
} catch (err) {
result.errors.push(`Employee ${emp.id}: ${(err as Error).message}`);
}
}
// Mark employees not in report as inactive
const activeIds = new Set(report.employees.map(e => parseInt(e.id)));
const localEmployees = await db.getActiveEmployeeIds();
for (const localId of localEmployees) {
if (!activeIds.has(localId)) {
await db.deactivateEmployee(localId);
result.deleted++;
}
}
await db.completeSyncLog(log.id, result);
return result;
} catch (err) {
await db.failSyncLog(log.id, (err as Error).message);
throw err;
}
}
async incrementalSync(): Promise<SyncResult> {
const lastSync = await db.getLastSyncTimestamp();
const changed = await this.client.request<any>(
'GET', `/employees/changed/?since=${lastSync}`,
);
const changedIds = Object.keys(changed.employees || {});
if (changedIds.length === 0) return { created: 0, updated: 0, deleted: 0, errors: [] };
// Fetch details for changed employees only
const result = { created: 0, updated: 0, deleted: 0, errors: [] as string[] };
for (const id of changedIds) {
const emp = await this.client.getEmployee(id, SYNC_FIELDS);
// Upsert logic...
}
return result;
}
async handleWebhookEvent(employeeId: string, action: string, fields: Record<string, string>) {
switch (action) {
case 'Created':
await db.createEmployee(parseInt(employeeId), fields);
break;
case 'Updated':
await db.updateEmployee(parseInt(employeeId), fields);
break;
case 'Deleted':
await db.deactivateEmployee(parseInt(employeeId));
break;
}
}
}
```
### Step 3: Employee Lifecycle Automation
```typescript
// src/services/lifecycle.ts
export class EmployeeLifecycleService {
constructor(
private bamboohr: BambooHRClient,
private slackClient: any,
private googleAdmin: any,
) {}
async onNewRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.