clickup-sdk-patterns
Production-ready ClickUp API v2 client patterns with typed wrappers, error handling, caching, and multi-tenant support. Trigger: "clickup client wrapper", "clickup SDK patterns", "clickup best practices", "clickup typescript client", "clickup API wrapper", "production clickup code".
Best use case
clickup-sdk-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Production-ready ClickUp API v2 client patterns with typed wrappers, error handling, caching, and multi-tenant support. Trigger: "clickup client wrapper", "clickup SDK patterns", "clickup best practices", "clickup typescript client", "clickup API wrapper", "production clickup code".
Teams using clickup-sdk-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/clickup-sdk-patterns/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How clickup-sdk-patterns Compares
| Feature / Agent | clickup-sdk-patterns | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Production-ready ClickUp API v2 client patterns with typed wrappers, error handling, caching, and multi-tenant support. Trigger: "clickup client wrapper", "clickup SDK patterns", "clickup best practices", "clickup typescript client", "clickup API wrapper", "production clickup code".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# ClickUp SDK Patterns
## Overview
ClickUp has no official SDK. Build a typed REST client wrapper around `https://api.clickup.com/api/v2/`. These patterns provide singleton clients, typed responses, error boundaries, and multi-tenant support.
## Typed Client Wrapper
```typescript
// src/clickup/client.ts
const CLICKUP_BASE = 'https://api.clickup.com/api/v2';
interface ClickUpClientConfig {
token: string;
timeout?: number;
onRateLimit?: (waitMs: number) => void;
}
class ClickUpClient {
private token: string;
private timeout: number;
private rateLimitRemaining = 100;
private rateLimitReset = 0;
constructor(config: ClickUpClientConfig) {
this.token = config.token;
this.timeout = config.timeout ?? 30000;
}
async request<T>(path: string, options: RequestInit = {}): Promise<T> {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), this.timeout);
try {
const response = await fetch(`${CLICKUP_BASE}${path}`, {
...options,
signal: controller.signal,
headers: {
'Authorization': this.token,
'Content-Type': 'application/json',
...options.headers,
},
});
// Track rate limit state from response headers
this.rateLimitRemaining = parseInt(
response.headers.get('X-RateLimit-Remaining') ?? '100'
);
this.rateLimitReset = parseInt(
response.headers.get('X-RateLimit-Reset') ?? '0'
) * 1000;
if (!response.ok) {
const body = await response.json().catch(() => ({}));
throw new ClickUpApiError(response.status, body.err, body.ECODE);
}
return response.json();
} finally {
clearTimeout(timer);
}
}
// Convenience methods
async getUser(): Promise<ClickUpUser> {
const data = await this.request<{ user: ClickUpUser }>('/user');
return data.user;
}
async getTeams(): Promise<ClickUpTeam[]> {
const data = await this.request<{ teams: ClickUpTeam[] }>('/team');
return data.teams;
}
async getSpaces(teamId: string): Promise<ClickUpSpace[]> {
const data = await this.request<{ spaces: ClickUpSpace[] }>(
`/team/${teamId}/space?archived=false`
);
return data.spaces;
}
async createTask(listId: string, task: CreateTaskInput): Promise<ClickUpTask> {
return this.request<ClickUpTask>(`/list/${listId}/task`, {
method: 'POST',
body: JSON.stringify(task),
});
}
async getTask(taskId: string): Promise<ClickUpTask> {
return this.request<ClickUpTask>(`/task/${taskId}`);
}
async updateTask(taskId: string, updates: Partial<CreateTaskInput>): Promise<ClickUpTask> {
return this.request<ClickUpTask>(`/task/${taskId}`, {
method: 'PUT',
body: JSON.stringify(updates),
});
}
isRateLimited(): boolean {
return this.rateLimitRemaining < 5 && Date.now() < this.rateLimitReset;
}
}
```
## TypeScript Types
```typescript
// src/clickup/types.ts
interface ClickUpUser {
id: number;
username: string;
email: string;
color: string;
profilePicture: string | null;
}
interface ClickUpTeam {
id: string;
name: string;
color: string;
members: Array<{ user: ClickUpUser; role: number }>;
}
interface ClickUpSpace {
id: string;
name: string;
private: boolean;
statuses: Array<{ status: string; color: string; type: string }>;
features: Record<string, { enabled: boolean }>;
}
interface ClickUpTask {
id: string;
custom_id: string | null;
name: string;
description: string;
status: { status: string; color: string; type: string };
priority: { id: string; priority: string; color: string } | null;
date_created: string;
date_updated: string;
due_date: string | null;
assignees: ClickUpUser[];
tags: Array<{ name: string }>;
url: string;
list: { id: string; name: string };
folder: { id: string; name: string };
space: { id: string };
custom_fields: ClickUpCustomFieldValue[];
}
interface CreateTaskInput {
name: string;
description?: string;
markdown_description?: string;
assignees?: number[];
priority?: 1 | 2 | 3 | 4 | null;
status?: string;
due_date?: number;
due_date_time?: boolean;
parent?: string;
tags?: string[];
custom_fields?: Array<{ id: string; value: any }>;
}
interface ClickUpCustomFieldValue {
id: string;
name: string;
type: string;
value: any;
}
class ClickUpApiError extends Error {
constructor(
public readonly status: number,
public readonly err: string,
public readonly ecode?: string,
) {
super(`ClickUp API ${status}: ${err}${ecode ? ` (${ecode})` : ''}`);
}
get isRateLimited(): boolean { return this.status === 429; }
get isAuthError(): boolean { return this.status === 401; }
get isNotFound(): boolean { return this.status === 404; }
get isRetryable(): boolean { return this.status === 429 || this.status >= 500; }
}
```
## Singleton Pattern
```typescript
// src/clickup/index.ts
let defaultClient: ClickUpClient | null = null;
export function getClickUpClient(): ClickUpClient {
if (!defaultClient) {
const token = process.env.CLICKUP_API_TOKEN;
if (!token) throw new Error('CLICKUP_API_TOKEN not set');
defaultClient = new ClickUpClient({ token });
}
return defaultClient;
}
```
## Multi-Tenant Factory
```typescript
const tenantClients = new Map<string, ClickUpClient>();
function getClientForTenant(tenantId: string, token: string): ClickUpClient {
if (!tenantClients.has(tenantId)) {
tenantClients.set(tenantId, new ClickUpClient({ token }));
}
return tenantClients.get(tenantId)!;
}
```
## Zod Response Validation
```typescript
import { z } from 'zod';
const TaskSchema = z.object({
id: z.string(),
name: z.string(),
status: z.object({ status: z.string(), color: z.string() }),
priority: z.object({ priority: z.string() }).nullable(),
url: z.string().url(),
});
async function getValidatedTask(taskId: string) {
const raw = await getClickUpClient().getTask(taskId);
return TaskSchema.parse(raw);
}
```
## Error Handling
| Pattern | Use Case | Benefit |
|---------|----------|---------|
| Typed error class | All API calls | Type-safe error discrimination |
| Singleton | Single-tenant apps | Shared rate limit tracking |
| Factory | Multi-tenant SaaS | Per-tenant isolation |
| Zod validation | Response parsing | Catches API contract changes |
## Resources
- [ClickUp API Reference](https://developer.clickup.com/)
- [Zod Documentation](https://zod.dev/)
## Next Steps
Apply patterns in `clickup-core-workflow-a` for task management.Related Skills
workhuman-sdk-patterns
Workhuman sdk patterns for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman sdk patterns".
wispr-sdk-patterns
Wispr Flow sdk patterns for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr sdk patterns".
windsurf-sdk-patterns
Apply production-ready Windsurf workspace configuration and Cascade interaction patterns. Use when configuring .windsurfrules, workspace rules, MCP servers, or establishing team coding standards for Windsurf AI. Trigger with phrases like "windsurf patterns", "windsurf best practices", "windsurf config patterns", "windsurfrules", "windsurf workspace".
windsurf-reliability-patterns
Implement reliable Cascade workflows with checkpoints, rollback, and incremental editing. Use when building fault-tolerant AI coding workflows, preventing Cascade from breaking builds, or establishing safe practices for multi-file AI edits. Trigger with phrases like "windsurf reliability", "cascade safety", "windsurf rollback", "cascade checkpoint", "safe cascade workflow".
webflow-sdk-patterns
Apply production-ready Webflow SDK patterns — singleton client, typed error handling, pagination helpers, and raw response access for the webflow-api package. Use when implementing Webflow integrations, refactoring SDK usage, or establishing team coding standards. Trigger with phrases like "webflow SDK patterns", "webflow best practices", "webflow code patterns", "idiomatic webflow", "webflow typescript".
vercel-sdk-patterns
Production-ready Vercel REST API patterns with typed fetch wrappers and error handling. Use when integrating with the Vercel API programmatically, building deployment tools, or establishing team coding standards for Vercel API calls. Trigger with phrases like "vercel SDK patterns", "vercel API wrapper", "vercel REST API client", "vercel best practices", "idiomatic vercel API".
vercel-reliability-patterns
Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation. Use when building fault-tolerant serverless functions, implementing retry strategies, or adding resilience to production Vercel services. Trigger with phrases like "vercel reliability", "vercel circuit breaker", "vercel resilience", "vercel fallback", "vercel graceful degradation".
veeva-sdk-patterns
Veeva Vault sdk patterns for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva sdk patterns".
vastai-sdk-patterns
Apply production-ready Vast.ai SDK patterns for Python and REST API. Use when implementing Vast.ai integrations, refactoring SDK usage, or establishing coding standards for GPU cloud operations. Trigger with phrases like "vastai SDK patterns", "vastai best practices", "vastai code patterns", "idiomatic vastai".
twinmind-sdk-patterns
Apply production-ready TwinMind SDK patterns for TypeScript and Python. Use when implementing TwinMind integrations, refactoring API usage, or establishing team coding standards for meeting AI integration. Trigger with phrases like "twinmind SDK patterns", "twinmind best practices", "twinmind code patterns", "idiomatic twinmind".
together-sdk-patterns
Together AI sdk patterns for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together sdk patterns".
techsmith-sdk-patterns
TechSmith sdk patterns for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith sdk patterns".