detecting-agent-environment

Detect CI/CD status, network accessibility, and Docker availability.

1|Updated Feb 7, 2016
One-click install
npx skills add https://github.com/ynotradio/site --skill detecting-agent-environment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detecting-agent-environment
Source: https://github.com/ynotradio/site/tree/main/.claude/skills/detecting-agent-environment
Command: npx skills add https://github.com/ynotradio/site --skill detecting-agent-environment

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides essential utilities to dynamically adapt agent scripts and workflows based on the execution environment, ensuring robust and reliable operation whether in CI/CD pipelines or local development setups.

Core Features & Use Cases

  • Environment Detection: Differentiates between CI/CD and local development, identifies the CI provider, and checks network and Docker availability.
  • Environment-Aware Timeouts: Assigns appropriate timeouts for operations like container starts, installations, and service readiness checks, optimizing for the specific environment.
  • Use Case: When running automated tests, this Skill can detect if it's in a Buildkite pipeline or a local machine, applying stricter timeouts and using pre-built Docker images in CI for faster, more consistent test runs.

Quick Start

Source the script and print a summary of the current environment.

Frequently Asked Questions about detecting-agent-environment

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

FAQPage Schema
How do I detect if my script is running in a CI/CD pipeline or locally?

Environment detection scripts identify the current execution context by checking specific CI provider variables and network accessibility. This allows your agent scripts to dynamically adapt their behavior based on whether they run in a pipeline or on a local machine.

How do I set different timeouts for Docker and yarn in CI versus local development?

Setting environment-aware timeouts involves detecting the current CI/CD context and applying stricter or more relaxed limits for Docker container starts, yarn installations, and service health checks. This ensures operations complete reliably without unnecessary delays in different execution environments.

Can I check Docker and network availability before running automated tests?

Yes, you can check Docker and network availability by sourcing an environment detection script that probes these conditions before execution. Guarding your test scripts based on these detected conditions prevents failures when dependencies are missing or network resources are inaccessible.

Why do my Buildkite pipeline tests pass but fail locally?

Discrepancies between Buildkite pipelines and local development often stem from different timeouts, network accessibility, or Docker availability. Using environment detection helps debug these issues by reporting the specific conditions and CI context of each execution environment.

What is the best way to adapt agent scripts for different execution environments?

The best way to adapt agent scripts is to use environment detection utilities that identify the CI provider, network status, and Docker availability. By applying environment-specific timeouts and guards, scripts automatically adjust their execution logic for robust operation across any setup.