environment-setup-guide
Guide developers through setting up development environments with proper tools, dependencies, and configurations
replit-known-pitfalls
Identify and avoid Replit anti-patterns and common integration mistakes. Use when reviewing Replit code for issues, onboarding new developers, or auditing existing Replit integrations for best practices violations. Trigger with phrases like "replit mistakes", "replit anti-patterns", "replit pitfa...
Full skill instructions
Common mistakes and anti-patterns when integrating with Replit.
// User waits for Replit API call
app.post('/checkout', async (req, res) => {
const payment = await replitClient.processPayment(req.body); // 2-5s latency
const notification = await replitClient.sendEmail(payment); // Another 1-2s
res.json({ success: true }); // User waited 3-7s
});
// Return immediately, process async
app.post('/checkout', async (req, res) => {
const jobId = await queue.enqueue('process-checkout', req.body);
res.json({ jobId, status: 'processing' }); // 50ms response
});
// Background job
async function processCheckout(data) {
const payment = await replitClient.processPayment(data);
await replitClient.sendEmail(payment);
}
// Blast requests, crash on 429
for (const item of items) {
await replitClient.process(item); // Will hit rate limit
}
import pLimit from 'p-limit';
const limit = pLimit(5); // Max 5 concurrent
const rateLimiter = new RateLimiter({ tokensPerSecond: 10 });
for (const item of items) {
await rateLimiter.acquire();
await limit(() => replitClient.process(item));
}
// In frontend code (visible to users!)
const client = new ReplitClient({
apiKey: 'sk_live_ACTUAL_KEY_HERE', // Anyone can see this
});
// In git history
git commit -m "add API key" // Exposed forever
// Backend only, environment variable
const client = new ReplitClient({
apiKey: process.env.REPLIT_API_KEY,
});
// Use .gitignore
.env
.env.local
.env.*.local
// Network error on response = duplicate charge!
try {
await replitClient.charge(order);
} catch (error) {
if (error.code === 'NETWORK_ERROR') {
await replitClient.charge(order); // Charged twice!
}
}
const idempotencyKey = `order-${order.id}-${Date.now()}`;
await replitClient.charge(order, {
idempotencyKey, // Safe to retry
});
// Trust any incoming request
app.post('/webhook', (req, res) => {
processWebhook(req.body); // Attacker can send fake events
res.sendStatus(200);
});
app.post('/webhook',
express.raw({ type: 'application/json' }),
(req, res) => {
const signature = req.headers['x-replit-signature'];
if (!verifyReplitSignature(req.body, signature)) {
return res.sendStatus(401);
}
processWebhook(JSON.parse(req.body));
res.sendStatus(200);
}
);
// Crashes on any error
const result = await replitClient.get(id);
console.log(result.data.nested.value); // TypeError if missing
try {
const result = await replitClient.get(id);
console.log(result?.data?.nested?.value ?? 'default');
} catch (error) {
if (error instanceof ReplitNotFoundError) {
return null;
}
if (error instanceof ReplitRateLimitError) {
await sleep(error.retryAfter);
return this.get(id); // Retry
}
throw error; // Rethrow unknown errors
}
const client = new ReplitClient({
timeout: 5000, // Too short for some operations
baseUrl: 'https://api.replit.com', // Can't change for staging
});
const client = new ReplitClient({
timeout: parseInt(process.env.REPLIT_TIMEOUT || '30000'),
baseUrl: process.env.REPLIT_BASE_URL || 'https://api.replit.com',
});
// When Replit is down, every request hangs
for (const user of users) {
await replitClient.sync(user); // All timeout sequentially
}
import CircuitBreaker from 'opossum';
const breaker = new CircuitBreaker(replitClient.sync, {
timeout: 10000,
errorThresholdPercentage: 50,
resetTimeout: 30000,
});
// Fails fast when circuit is open
for (const user of users) {
await breaker.fire(user).catch(handleFailure);
}
console.log('Request:', JSON.stringify(request)); // Logs API key, PII
console.log('User:', user); // Logs email, phone
const redacted = {
...request,
apiKey: '[REDACTED]',
user: { id: user.id }, // Only non-sensitive fields
};
console.log('Request:', JSON.stringify(redacted));
// Entire feature broken if Replit is down
const recommendations = await replitClient.getRecommendations(userId);
return renderPage({ recommendations }); // Page crashes
let recommendations;
try {
recommendations = await replitClient.getRecommendations(userId);
} catch (error) {
recommendations = await getFallbackRecommendations(userId);
reportDegradedService('replit', error);
}
return renderPage({ recommendations, degraded: !recommendations });
Scan codebase for each pitfall pattern.
Address security issues first, then performance.
Replace anti-patterns with recommended patterns.
Set up linting and CI checks to prevent recurrence.
| Issue | Cause | Solution |
|---|---|---|
| Too many findings | Legacy codebase | Prioritize security first |
| Pattern not detected | Complex code | Manual review |
| False positive | Similar code | Whitelist exceptions |
| Fix breaks tests | Behavior change | Update tests |
# Check for common pitfalls
grep -r "sk_live_" --include="*.ts" src/ # Key leakage
grep -r "console.log" --include="*.ts" src/ # Potential PII logging
| Pitfall | Detection | Prevention |
|---|---|---|
| Sync in request | High latency | Use queues |
| Rate limit ignore | 429 errors | Implement backoff |
| Key leakage | Git history scan | Env vars, .gitignore |
| No idempotency | Duplicate records | Idempotency keys |
| Unverified webhooks | Security audit | Signature verification |
| Missing error handling | Crashes | Try-catch, types |
| Hardcoded config | Code review | Environment variables |
| No circuit breaker | Cascading failures | opossum, resilience4j |
| Logging PII | Log audit | Redaction middleware |
| No degradation | Total outages | Fallback systems |
Guide developers through setting up development environments with proper tools, dependencies, and configurations
Implement Exa lint rules, policy enforcement, and automated guardrails. Use when setting up code quality rules for Exa integrations, implementing pre-commit hooks, or configuring CI policy checks for Exa best practices. Trigger with phrases like "exa policy", "exa lint", "exa guardrails", "exa be...
Configure CI/CD pipelines for Documenso integrations. Use when setting up automated testing, deployment pipelines, or continuous integration for Documenso projects. Trigger with phrases like "documenso CI", "documenso GitHub Actions", "documenso pipeline", "documenso automated testing".
Build check model availability and implement fallback chains. Use when building resilient systems or handling model outages. Trigger with phrases like 'openrouter availability', 'openrouter fallback', 'openrouter model down', 'openrouter health check'.
Configure Langfuse enterprise organization management and access control. Use when implementing team access controls, configuring organization settings, or setting up role-based permissions for Langfuse projects. Trigger with phrases like "langfuse RBAC", "langfuse teams", "langfuse organization"...
Execute compliance and security auditing for Cursor usage. Triggers on "cursor compliance", "cursor audit", "cursor security review", "cursor soc2", "cursor gdpr". Use when analyzing or auditing cursor compliance audit. Trigger with phrases like "cursor compliance audit", "cursor audit", "cursor".
Configure Apollo.io CI/CD integration. Use when setting up automated testing, continuous integration, or deployment pipelines for Apollo integrations. Trigger with phrases like "apollo ci", "apollo github actions", "apollo pipeline", "apollo ci/cd", "apollo automated tests".
Create robust Python automation with full logging and safety checks. Use when tasks need complex data processing, authenticated API work, conditional file operations, or error handling beyond simple shell commands.
Configure PostHog across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific PostHog configurations. Trigger with phrases like "posthog environments", "posthog staging", "po...
Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration. Use when: build agent, AI agent, autonomous agent, tool use, function calling.
Validate insecure deserialization checker operations. Auto-activating skill for Security Fundamentals. Triggers on: insecure deserialization checker, insecure deserialization checker Part of the Security Fundamentals skill category. Use when working with insecure deserialization checker functiona...
Manage path traversal finder operations. Auto-activating skill for Security Fundamentals. Triggers on: path traversal finder, path traversal finder Part of the Security Fundamentals skill category. Use when working with path traversal finder functionality. Trigger with phrases like "path traversa...
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience