linear-debug-bundle
Comprehensive debugging toolkit for Linear integrations. Use when setting up logging, tracing API calls, or building debug utilities for Linear. Trigger: "debug linear integration", "linear logging", "trace linear API", "linear debugging tools".
What this skill does
# Linear Debug Bundle
## Overview
Production-ready debugging tools for Linear API integrations: instrumented client with request/response logging, request tracer with performance metrics, health check endpoint, environment validator, and interactive debug console.
## Prerequisites
- `@linear/sdk` installed and configured
- Node.js 18+
- Optional: pino or winston for structured logging
## Instructions
### Tool 1: Debug Client Wrapper
Intercept all API calls with timing, logging, and error capture by wrapping the SDK's underlying fetch.
```typescript
import { LinearClient } from "@linear/sdk";
interface DebugOptions {
logRequests?: boolean;
logResponses?: boolean;
onRequest?: (query: string, variables: any) => void;
onResponse?: (query: string, duration: number, data: any) => void;
onError?: (query: string, duration: number, error: any) => void;
}
function createDebugClient(apiKey: string, opts: DebugOptions = {}): LinearClient {
const { logRequests = true, logResponses = true } = opts;
return new LinearClient({
apiKey,
headers: { "X-Debug": "true" },
});
}
// Manual instrumentation wrapper
async function debugQuery<T>(
label: string,
fn: () => Promise<T>,
opts?: DebugOptions
): Promise<T> {
const start = Date.now();
console.log(`[Linear:DEBUG] >>> ${label}`);
try {
const result = await fn();
const ms = Date.now() - start;
console.log(`[Linear:DEBUG] <<< ${label} (${ms}ms) OK`);
opts?.onResponse?.(label, ms, result);
return result;
} catch (error) {
const ms = Date.now() - start;
console.error(`[Linear:DEBUG] !!! ${label} (${ms}ms) FAILED:`, error);
opts?.onError?.(label, ms, error);
throw error;
}
}
// Usage
const client = new LinearClient({ apiKey: process.env.LINEAR_API_KEY! });
const teams = await debugQuery("teams()", () => client.teams());
const issues = await debugQuery("issues(first:50)", () => client.issues({ first: 50 }));
```
### Tool 2: Request Tracer
Track all API calls with timing, success/failure, and aggregate stats.
```typescript
interface TraceEntry {
id: string;
operation: string;
startTime: number;
endTime?: number;
duration?: number;
success: boolean;
error?: string;
}
class LinearTracer {
private traces: TraceEntry[] = [];
private maxTraces = 200;
startTrace(operation: string): string {
const id = `trace-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
this.traces.push({ id, operation, startTime: Date.now(), success: false });
if (this.traces.length > this.maxTraces) this.traces = this.traces.slice(-100);
return id;
}
endTrace(id: string, success: boolean, error?: string): void {
const trace = this.traces.find(t => t.id === id);
if (trace) {
trace.endTime = Date.now();
trace.duration = trace.endTime - trace.startTime;
trace.success = success;
trace.error = error;
}
}
getSlowTraces(thresholdMs = 2000): TraceEntry[] {
return this.traces.filter(t => (t.duration ?? 0) > thresholdMs);
}
getFailedTraces(): TraceEntry[] {
return this.traces.filter(t => !t.success && t.endTime);
}
getSummary() {
const completed = this.traces.filter(t => t.endTime);
const durations = completed.map(t => t.duration ?? 0);
return {
total: this.traces.length,
completed: completed.length,
failed: this.getFailedTraces().length,
avgMs: durations.length ? Math.round(durations.reduce((a, b) => a + b, 0) / durations.length) : 0,
maxMs: durations.length ? Math.max(...durations) : 0,
p95Ms: durations.length ? durations.sort((a, b) => a - b)[Math.floor(durations.length * 0.95)] : 0,
};
}
}
// Usage
const tracer = new LinearTracer();
async function tracedCall<T>(operation: string, fn: () => Promise<T>): Promise<T> {
const id = tracer.startTrace(operation);
try {
const result = await fn();
tracer.endTrace(id, true);
return result;
} catch (error: any) {
tracer.endTrace(id, false, error.message);
throw error;
}
}
// After running operations:
console.log("Trace summary:", tracer.getSummary());
console.log("Slow traces:", tracer.getSlowTraces(1000));
```
### Tool 3: Health Check Utility
```typescript
interface HealthResult {
status: "healthy" | "degraded" | "unhealthy";
latencyMs: number;
user?: string;
teamCount?: number;
error?: string;
}
async function checkLinearHealth(client: LinearClient): Promise<HealthResult> {
const start = Date.now();
try {
const [viewer, teams] = await Promise.all([client.viewer, client.teams()]);
const latencyMs = Date.now() - start;
return {
status: latencyMs > 3000 ? "degraded" : "healthy",
latencyMs,
user: viewer.name,
teamCount: teams.nodes.length,
};
} catch (error: any) {
return {
status: "unhealthy",
latencyMs: Date.now() - start,
error: error.message,
};
}
}
// Express endpoint
app.get("/health/linear", async (req, res) => {
const health = await checkLinearHealth(client);
res.status(health.status === "unhealthy" ? 503 : 200).json(health);
});
```
### Tool 4: Environment Validator
```typescript
function validateLinearEnv(): { valid: boolean; issues: string[] } {
const issues: string[] = [];
const apiKey = process.env.LINEAR_API_KEY;
if (!apiKey) {
issues.push("LINEAR_API_KEY is not set");
} else if (!apiKey.startsWith("lin_api_")) {
issues.push("LINEAR_API_KEY must start with 'lin_api_'");
} else if (apiKey.length < 30) {
issues.push("LINEAR_API_KEY appears truncated");
}
if (!process.env.LINEAR_WEBHOOK_SECRET) {
issues.push("WARNING: LINEAR_WEBHOOK_SECRET not set (webhooks won't verify)");
}
if (process.env.NODE_ENV === "production" && apiKey?.includes("dev")) {
issues.push("WARNING: API key appears to be a development key in production");
}
const valid = issues.filter(i => !i.startsWith("WARNING")).length === 0;
return { valid, issues };
}
// Auto-run on import
const envCheck = validateLinearEnv();
if (!envCheck.valid) {
console.error("[Linear] Environment validation failed:");
envCheck.issues.forEach(i => console.error(` - ${i}`));
}
```
### Tool 5: Interactive Debug Console
```typescript
import readline from "readline";
import { LinearClient } from "@linear/sdk";
async function debugConsole(client: LinearClient): Promise<void> {
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
const prompt = () => rl.question("linear> ", handleCommand);
async function handleCommand(cmd: string) {
const trimmed = cmd.trim();
try {
switch (trimmed) {
case "me": {
const v = await client.viewer;
console.log(`${v.name} (${v.email})`);
break;
}
case "teams": {
const t = await client.teams();
t.nodes.forEach(team => console.log(` ${team.key}: ${team.name}`));
break;
}
case "issues": {
const i = await client.issues({ first: 10, orderBy: "updatedAt" });
i.nodes.forEach(issue => console.log(` ${issue.identifier}: ${issue.title}`));
break;
}
case "health": {
const h = await checkLinearHealth(client);
console.log(JSON.stringify(h, null, 2));
break;
}
case "exit": rl.close(); return;
default: console.log("Commands: me, teams, issues, health, exit");
}
} catch (e: any) {
console.error(`Error: ${e.message}`);
}
prompt();
}
console.log("Linear Debug Console — type 'help' for commands");
prompt();
}
```
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Circular JSON in logs | Logging full SDK objects | Use selective fields, not `JSON.stringify(issue)` |
| Memory leak | Unbounded trace storage | Set `maxTraces` limit, trim oldest |
| Missing env vars | Env not loaded | Call `validateLinearEnv()` on startup |
| Health chRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.