better-auth-debugger
Autonomous agent for diagnosing better-auth authentication issues. Analyzes configuration, validates OAuth callbacks, tests endpoints, and provides specific…
Analyzes Cloudflare Workflow performance and suggests optimizations for cost, speed, and reliability. Use when workflow runs slowly, costs too much, or needs reliability improvements.
$ npx -y skills add secondsky/claude-skills --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Analyzes Cloudflare Workflow performance and suggests optimizations for cost, speed, and reliability. Use when workflow runs slowly, costs too much, or needs reliability improvements.
name: workflow-optimizer description: Analyzes Cloudflare Workflow performance and suggests optimizations for cost, speed, and reliability. Use when workflow runs slowly, costs too much, or needs reliability improvements. tools: - Read - Grep - Glob - Bash
Autonomous agent that analyzes workflow performance and provides actionable optimization recommendations for cost reduction, speed improvements, and enhanced reliability.
This agent should be used when:
**Keywords**: optimize, performance, slow, cost, expensive, improve, faster, reliability, retry, timeout, efficiency
# Find all workflow implementations find src -name "*.ts" -type f | xargs grep -l "extends WorkflowEntrypoint"
# Count workflows in configuration grep -v '^\s*//' wrangler.jsonc | jq '.workflows | length'
If multiple workflows found, analyze each or let user select.
---
# Count step.do() calls grep -c "step\.do" src/workflows/*.ts # Count sleep calls grep -c "step\.sleep\|step\.sleepUntil" src/workflows/*.ts # Count waitForEvent calls grep -c "step\.waitForEvent" src/workflows/*.ts
**Metrics**:
For each step.do() call, analyze:
# Find steps with multiple await statements (potential optimization) grep -A 20 "step\.do" src/workflows/*.ts | grep -c "await"
**Flag**:
# Find loops inside steps grep -B 5 -A 10 "step\.do" src/workflows/*.ts | grep "for\|while"
**Warning**: Loops inside step.do() may exceed 30s CPU limit.
# Check for retry configuration grep -n "retries:" src/workflows/*.ts
**Flag**:
---
Workflow cost factors:
**Formula**:
Cost per workflow = (1 + steps) × $0.00000015 + duration_gb_s × $0.00000002
Example (5 steps, 10ms each): - Requests: 6 × $0.00000015 = $0.0000009 - Duration: 0.05s × 0.128GB × $0.00000002 = ~$0 - Total: ~$0.0000009 per workflow At 1M workflows/month: ~$0.90
**High cost indicators**:
---
# Find try-catch blocks
grep -c "try.*{" src/workflows/*.ts
# Find NonRetryableError usage
grep -c "NonRetryableError" src/workflows/*.ts**Flags**:
# Check for timeout in waitForEvent grep "waitForEvent" src/workflows/*.ts | grep -c "timeout"
**Warning**: waitForEvent without timeout can hang indefinitely.
# Look for idempotency patterns grep -c "idempotency\|idempotent\|Idempotency-Key" src/workflows/*.ts
**Recommendation**: External API calls should use idempotency keys.
# Look for circuit breaker patterns grep -c "CircuitBreaker\|circuit" src/workflows/*.ts
**Recommendation**: Flaky external APIs should use circuit breaker.
---
Based on analysis, provide specific recommendations:
**Opt 1: Batch API Calls**
// Before: Multiple steps
const user = await step.do('get user', () => fetch('/users/1'));
const orders = await step.do('get orders', () => fetch('/orders?user=1'));
// After: Single step with parallel fetches
const data = await step.do('get user data', async () => {
const [user, orders] = await Promise.all([
fetch('/users/1'),
fetch('/orders?user=1')
]);
return { user: await user.json(), orders: await orders.json() };
});**Impact**: 50% fewer requests, 50% cost reduction
**Opt 2: Use step.sleep() Instead of Polling**
// Before: Polling loop (expensive)
for (let i = 0; i < 10; i++) {
const status = await step.do(`poll ${i}`, () => checkStatus());
if (status.done) break;
}
// After: Use sleep (free)
await step.sleep('wait for processing', '5 minutes');
const status = await step.do('check status', () => checkStatus());**Impact**: 90% fewer requests during wait periods
**Opt 3: Break Large Steps into Batches**
// Before: Single large step (may timeout)
await step.do('process all', async () => {
for (const item of items) await process(item);
});
// After: Batched steps (reliable)
const batchSize = 100;
for (let i = 0; i < items.length; i += batchSize) {
await step.do(`batch ${Math.floor(i/batchSize)}`, async () => {
return await Promise.all(
items.slice(i, i + batchSize).map(process)
);
});
}**Impact**: Prevents timeout, enables progress tracking
---
**Cost 1: Consolidate Related Steps**
// Before: Separate
145 production-ready skills for Claude Code CLI 🔌 Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).
Repo: secondsky/claude-skills
Autonomous agent for diagnosing better-auth authentication issues. Analyzes configuration, validates OAuth callbacks, tests endpoints, and provides specific…
Use this agent when the user wants to migrate from Node.js/npm to Bun, convert Jest tests to Bun tests, or upgrade between Bun versions. Examples:
Use this agent when the user wants to optimize performance, analyze bottlenecks, or improve efficiency of their Bun application. Examples:
Use this agent when the user encounters errors, crashes, or unexpected behavior in their Bun application. Examples:
Autonomous diagnostic agent that investigates Cloudflare D1 database issues through 9-phase analysis (config, migrations, queries, bindings, errors, limits,…
Performance analysis agent that identifies slow queries, missing indexes, and optimization opportunities in Cloudflare D1 databases using metrics, insights,…