dicklesworthstone/pi_agent_rust/retellai-policy-guardrails

Claude Code and agent skill by dicklesworthstone/pi_agent_rust

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Implement Retell AI lint rules, policy enforcement, and automated guardrails. Use when setting up code quality rules for Retell AI integrations, implementing pre-commit hooks, or configuring CI policy checks for Retell AI best practices. Trigger with phrases like "retellai policy", "retellai lint", "retellai guardrails", "retellai best practices check", "retellai eslint".

Install

npx vskill@latest install dicklesworthstone/pi_agent_rust/retellai-policy-guardrails

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as dicklesworthstone/pi_agent_rust/retellai-policy-guardrails.

Retell AI Policy & Guardrails

Overview

Automated policy enforcement and guardrails for Retell AI integrations.

Prerequisites

  • ESLint configured in project
  • Pre-commit hooks infrastructure
  • CI/CD pipeline with policy checks
  • TypeScript for type enforcement

ESLint Rules

Custom Retell AI Plugin
javascript
// eslint-plugin-retellai/rules/no-hardcoded-keys.js
module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Disallow hardcoded Retell AI API keys',
},
fixable: 'code',
},
create(context) {
return {
Literal(node) {
if (typeof node.value === 'string') {
if (node.value.match(/^sk_(live|test)_[a-zA-Z0-9]{24,}/)) {
context.report({
node,
message: 'Hardcoded Retell AI API key detected',
});
}
}
},
};
},
};
ESLint Configuration
javascript
// .eslintrc.js
module.exports = {
plugins: ['retellai'],
rules: {
'retellai/no-hardcoded-keys': 'error',
'retellai/require-error-handling': 'warn',
'retellai/use-typed-client': 'warn',
},
};

Pre-Commit Hooks

yaml
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: retellai-secrets-check
name: Check for Retell AI secrets
entry: bash -c 'git diff --cached --name-only | xargs grep -l "sk_live_" && exit 1 || exit 0'
language: system
pass_filenames: false
- id: retellai-config-validate
name: Validate Retell AI configuration
entry: node scripts/validate-retellai-config.js
language: node
files: '\.retellai\.json$'

TypeScript Strict Patterns

typescript
// Enforce typed configuration
interface Retell AIStrictConfig {
apiKey: string; // Required
environment: 'development' | 'staging' | 'production'; // Enum
timeout: number; // Required number, not optional
retries: number;
}
// Disallow any in Retell AI code
// @ts-expect-error - Using any is forbidden
const client = new Client({ apiKey: any });
// Prefer this
const client = new RetellAIClient(config satisfies Retell AIStrictConfig);

Architecture Decision Records

ADR Template
markdown
# ADR-001: Retell AI Client Initialization
## Status
Accepted
## Context
We need to decide how to initialize the Retell AI client across our application.
## Decision
We will use the singleton pattern with lazy initialization.
## Consequences
-Pro: Single client instance, connection reuse
-Pro: Easy to mock in tests
-Con: Global state requires careful lifecycle management
## Enforcement
-ESLint rule: retellai/use-singleton-client
-CI check: grep for "new RetellAIClient(" outside allowed files

Policy-as-Code (OPA)

rego
# retellai-policy.rego
package retellai
# Deny production API keys in non-production environments
deny[msg] {
input.environment != "production"
startswith(input.apiKey, "sk_live_")
msg := "Production API keys not allowed in non-production environment"
}
# Require minimum timeout
deny[msg] {
input.timeout < 10000
msg := sprintf("Timeout too low: %d < 10000ms minimum", [input.timeout])
}
# Require retry configuration
deny[msg] {
not input.retries
msg := "Retry configuration is required"
}

CI Policy Checks

yaml
# .github/workflows/retellai-policy.yml
name: Retell AI Policy Check
on: [push, pull_request]
jobs:
policy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for hardcoded secrets
run: |
if grep -rE "sk_(live|test)_[a-zA-Z0-9]{24,}" --include="*.ts" --include="*.js" .; then
echo "ERROR: Hardcoded Retell AI keys found"
exit 1
fi
- name: Validate configuration schema
run: |
npx ajv validate -s retellai-config.schema.json -d config/retellai/*.json
- name: Run ESLint Retell AI rules
run: npx eslint --plugin retellai --rule 'retellai/no-hardcoded-keys: error' src/

Runtime Guardrails

typescript
// Prevent dangerous operations in production
const BLOCKED_IN_PROD = ['deleteAll', 'resetData', 'migrateDown'];
function guardRetell AIOperation(operation: string): void {
const isProd = process.env.NODE_ENV === 'production';
if (isProd && BLOCKED_IN_PROD.includes(operation)) {
throw new Error(`Operation '${operation}' blocked in production`);
}
}
// Rate limit protection
function guardRateLimits(requestsInWindow: number): void {
const limit = parseInt(process.env.RETELLAI_RATE_LIMIT || '100');
if (requestsInWindow > limit * 0.9) {
console.warn('Approaching Retell AI rate limit');
}
if (requestsInWindow >= limit) {
throw new Error('Retell AI rate limit exceeded - request blocked');
}
}

Instructions

Step 1: Create ESLint Rules

Implement custom lint rules for Retell AI patterns.

Step 2: Configure Pre-Commit Hooks

Set up hooks to catch issues before commit.

Step 3: Add CI Policy Checks

Implement policy-as-code in CI pipeline.

Step 4: Enable Runtime Guardrails

Add production safeguards for dangerous operations.

Output

  • ESLint plugin with Retell AI rules
  • Pre-commit hooks blocking secrets
  • CI policy checks passing
  • Runtime guardrails active

Error Handling

IssueCauseSolution
ESLint rule not firingWrong configCheck plugin registration
Pre-commit skipped--no-verifyEnforce in CI
Policy false positiveRegex too broadNarrow pattern match
Guardrail triggeredActual issueFix or whitelist

Examples

Quick ESLint Check
bash
npx eslint --plugin retellai --rule 'retellai/no-hardcoded-keys: error' src/

Resources

Next Steps

For architecture blueprints, see retellai-architecture-variants.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1,831
Repository forks
217
7-day trend score
43

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dicklesworthstone/pi_agent_rust/retellai-policy-guardrails/badge)](https://verified-skill.com/skills/dicklesworthstone/pi_agent_rust/retellai-policy-guardrails)

Something wrong with this skill or its page? Tell us.