api-integration-patterns

Integrate external APIs and CLI tools with secure subprocess calls and retry logic.

32|5|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/akaszubski/autonomous-dev --skill api-integration-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-integration-patterns
Source: https://github.com/akaszubski/autonomous-dev/tree/main/plugins/autonomous-dev/skills/api-integration-patterns
Command: npx skills add https://github.com/akaszubski/autonomous-dev --skill api-integration-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standard patterns for safely integrating external APIs and CLI tools, including safe subprocess calls, GitHub CLI usage, retry logic, authentication, rate limiting, and timeouts.

Core Features & Use Cases

  • Subprocess safety (CWE-78) and safe argument arrays
  • GitHub CLI integration patterns
  • Retry logic with exponential backoff
  • Authentication and rate limiting handling

Quick Start

Example usage: safely invoke gh CLI commands, or call APIs with authentication patterns.

Frequently Asked Questions about api-integration-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely call external commands and APIs without shell injection vulnerabilities?

Safe API and CLI integrations use argument arrays instead of shell strings to prevent command injection. This Skill provides patterns for secure subprocess calls, GitHub CLI invocation, and authenticated API requests that enforce argument-array syntax and validate inputs before execution.

What's the best way to handle authentication and rate limiting when integrating with GitHub CLI?

Manage GitHub CLI authentication through environment variables and implement rate limiting with retry logic and exponential backoff. This Skill covers credential validation patterns, timeout handling, and retry strategies that work with gh CLI commands and external APIs.

How do I implement retry logic with exponential backoff for API calls?

Retry logic with exponential backoff automatically resends failed requests with increasing delays, preventing overwhelming downstream services. This Skill provides proven patterns for timeout handling and retry configuration applicable to both CLI tools and HTTP APIs.

Can I use these patterns with my existing subprocess and API integration code?

Yes. This Skill applies to any scenario requiring subprocess safety, GitHub CLI integration, authentication management, or rate limiting. The patterns work with existing codebases by replacing unsafe shell calls with argument arrays and adding credential validation via environment variables.

What security risks should I watch for when integrating external CLIs into my application?

Shell injection (CWE-78), credential exposure, and uncontrolled timeouts are primary risks. This Skill enforces safe argument arrays, whitelist validation for permitted commands, environment-variable credential management, and timely timeout implementation to mitigate these vulnerabilities.