developing-buildkite-pipelines
Scannednpx machina-cli add skill technicalpickles/pickled-claude-plugins/developing-buildkite-pipelines --openclawDeveloping Buildkite Pipelines
Overview
Reference official Buildkite documentation before making pipeline changes. Your training data may contain outdated syntax, deprecated patterns, or missing features.
When to Use
Use this skill when:
- Writing or modifying pipeline.yml files
- Creating dynamic pipelines
- Debugging pipeline configuration errors
- Adding new step types (command, trigger, block, wait)
- Configuring dependencies, artifacts, or parallelism
- Setting up Buildkite plugins
- Configuring or debugging Buildkite plugins
Do NOT use for:
- Checking build status (use buildkite-status skill)
- General CI/CD concepts (language-agnostic advice)
The Iron Rule
NEVER propose Buildkite YAML without consulting the reference docs.
Detecting buildkite-builder
Check for buildkite-builder usage before proceeding:
buildkite-builder is detected when BOTH conditions are true:
.buildkite/pipeline.ymlreferences Docker image containing "buildkite-builder"- Pipeline Ruby files exist:
.buildkite/pipeline.rbOR.buildkite/pipelines/*/pipeline.rb
When detected, announce:
"I see you're using buildkite-builder for dynamic pipeline generation. I'll work with your pipeline.rb files and reference the Ruby DSL."
Then load buildkite-builder reference documentation as needed.
Working with Plugins
Before Modifying Plugin Configuration
When editing pipeline steps that use plugins:
- Identify plugins - Note all
plugins:entries in the step - Determine source:
- Default org
buildkite-pluginsif no org specified - Parse explicit org from
{org}/{plugin}#versionformat
- Default org
- Load documentation:
- Cached: Check references/plugins/{plugin-name}.md
- Official (not cached): Fetch from Buildkite directory or GitHub
- Internal: Fetch README from
github.com/{org}/{plugin}-buildkite-plugin
- Match versions - If pipeline specifies version, fetch that version's docs from GitHub tag
Fetching Plugin Documentation
Buildkite directory (latest):
https://buildkite.com/resources/plugins/{org}/{plugin-name}-buildkite-plugin
GitHub README (version-specific):
https://github.com/{org}/{plugin-name}-buildkite-plugin/tree/{version}
Plugin Discovery
"Is there a plugin for X?"
- Check references/plugins/index.md for common plugins by category
- Fetch Buildkite directory:
https://buildkite.com/resources/plugins/ - Search by task type (caching, docker, secrets, etc.)
Internal plugins:
Search org's GitHub for repos matching *-buildkite-plugin
Workflow
1. Detect buildkite-builder (if present)
Check for buildkite-builder usage:
- Docker image in
.buildkite/pipeline.ymlcontains "buildkite-builder" .buildkite/pipeline.rbOR.buildkite/pipelines/*/pipeline.rbexists
If detected, announce and load buildkite-builder context.
2. Read Official Docs FIRST
For YAML pipelines:
Before writing or modifying pipeline YAML:
**I need to reference the Buildkite documentation for [specific feature].**
Let me read [references/[relevant-doc].md](references/).
For buildkite-builder pipelines:
Before writing or modifying pipeline.rb:
**I need to reference buildkite-builder documentation for [specific feature].**
Let me read [references/buildkite-builder/[relevant-doc].md](references/buildkite-builder/).
Available references:
step-types.md- Command, trigger, block, wait, input stepsdynamic-pipelines.md- Generating steps programmaticallydependencies.md- Using depends_on, parallel stepsenvironment-variables.md- Setting and using env varsconditionals.md- if/branches for conditional executionartifacts.md- Uploading and downloading build artifacts
See references/index.md for complete list.
Plugin references (see references/plugins/index.md for full list):
plugins/docker.md- Docker container executionplugins/docker-compose.md- Multi-container environmentsplugins/artifacts.md- Artifact upload/downloadplugins/ecr.md- AWS ECR authenticationplugins/cache.md- Dependency caching
buildkite-builder references (when detected):
buildkite-builder/index.md- Overview and when to usebuildkite-builder/dsl-syntax.md- Core DSL step typesbuildkite-builder/step-attributes.md- Common attributesbuildkite-builder/templates.md- Reusable step templatesbuildkite-builder/extensions.md- Custom DSL and extensionsbuildkite-builder/conditionals.md- Conditional step generationbuildkite-builder/dependencies.md- Step dependenciesbuildkite-builder/artifacts.md- Artifact handlingbuildkite-builder/plugins.md- Plugin usage in DSLbuildkite-builder/environment.md- Environment variables
See references/buildkite-builder/index.md for complete guide.
3. Validate Syntax
After proposing changes, ALWAYS mention validation:
# Validate locally before pushing
buildkite-agent pipeline upload --dry-run < pipeline.yml
# Or validate a generated pipeline
./generate-pipeline.sh | buildkite-agent pipeline upload --dry-run
For buildkite-builder pipelines:
After proposing pipeline.rb changes:
- Scan for ENV variable usage
- Generate Docker validation command with placeholders
- List detected environment variables
# Generate YAML locally
docker run --rm \
-v $(pwd)/.buildkite:/workspace/.buildkite \
-e BUILDKITE_BRANCH=main \
-e BUILDKITE_COMMIT=abc123def \
-e BUILDKITE_BUILD_NUMBER=1 \
gusto/buildkite-builder:4.13.0
# Validate generated YAML
docker run ... | buildkite-agent pipeline upload --dry-run
Note: List any custom ENV variables found in pipeline.rb and suggest setting real values if needed.
4. Load Plugin Documentation
Before modifying any step with plugins:
- Identify all plugins in the step's
plugins:block - For each plugin:
- Check references/plugins/{name}.md for cached docs
- If not cached, fetch from Buildkite directory or GitHub
- If version specified, fetch version-specific docs
- Then proceed with changes using accurate configuration reference
See references/plugins/index.md for lookup workflow and common plugins.
buildkite-builder Troubleshooting Mode
When user mentions errors, "not generating", "YAML looks wrong", or validation failures with buildkite-builder:
- Read pipeline.rb - Understand the Ruby DSL
- Run Docker command - Generate YAML to see actual output
- Compare output - Expected vs actual YAML
- Reference both docs - buildkite-builder DSL AND Buildkite YAML docs
- Identify issue - Where Ruby DSL produces unexpected YAML
- Propose fix - Modify pipeline.rb to fix generation
This mode switches from Ruby-first to YAML-aware debugging.
Common Mistakes
| Mistake | Fix |
|---|---|
| Writing YAML from memory | Read step-types.md first |
| "This should work..." | Validate with --dry-run |
| Custom script without checking plugins | Search buildkite.com/plugins |
| Speculating about errors | Check references/troubleshooting.md |
| Assuming syntax from training data | Verify against current docs |
Dynamic Pipelines Pattern
When generating steps programmatically:
- Reference dynamic-pipelines.md for current patterns
- Use Buildkite SDK if available (see dynamic-pipelines.md)
- Validate generated output with --dry-run
- Consider official examples before custom implementations
# Standard pattern from official docs
.buildkite/pipeline.sh | buildkite-agent pipeline upload
Debugging Configuration Errors
When pipeline fails with validation errors:
- Check error message against references/troubleshooting.md
- Verify step structure in references/step-types.md
- Validate dependencies in references/dependencies.md
- Don't speculate - look up the actual validation rules
Red Flags - You're About to Violate
- "Based on my knowledge of Buildkite..."
- "This syntax should work..."
- "The validator likely fails because..."
- "Let me create a dynamic pipeline..." (without reading docs)
- Writing YAML before reading references
- Confident statements about Buildkite behavior without verification
All of these mean: STOP. Read the docs first.
Real-World Impact
Without this skill:
- Agent wrote 2,600-line dynamic pipeline from memory (Scenario 2 baseline)
- Agent speculated about validator behavior without verification (Scenario 3 baseline)
- Agent assumed syntax patterns without checking current docs
With this skill:
- Reference official patterns and current syntax
- Validate before proposing
- Avoid outdated or deprecated approaches
Source
git clone https://github.com/technicalpickles/pickled-claude-plugins/blob/main/plugins/ci-cd-tools/skills/developing-buildkite-pipelines/SKILL.mdView on GitHub Overview
This skill helps you create, modify, or debug Buildkite pipeline YAML by ensuring alignment with the official docs. It validates configurations before proposing changes and references Buildkite best practices rather than relying on training data.
How This Skill Works
It starts by checking for buildkite-builder usage and loading the Ruby DSL context if detected. It then directs you to read the official Buildkite docs for the specific feature before making changes. For pipelines using plugins, it guides you through identifying plugin sources, loading versioned documentation, and aligning with the correct docs.
When to Use It
- Writing or modifying pipeline.yml files
- Creating dynamic pipelines
- Debugging pipeline configuration errors
- Adding new step types (command, trigger, block, wait)
- Configuring dependencies, artifacts, parallelism, or plugins
Quick Start
- Step 1: Identify the feature to modify in pipeline.yml and your target Buildkite docs
- Step 2: Read the official docs for that feature (e.g., step-types, dynamic-pipelines)
- Step 3: Implement changes and validate the pipeline.yml before proposing
Best Practices
- Consult the official Buildkite docs before editing any YAML
- Validate configurations before proposing changes
- Detect buildkite-builder usage to ensure the correct context
- When plugins are used, map each plugin to its source and version and load docs accordingly
- Use reference docs (step-types, dynamic-pipelines, dependencies) to guide changes
Example Use Cases
- Add a new 'command' step with syntax aligned to Buildkite docs
- Fix a broken artifact path by consulting dependencies and artifacts docs
- Generate steps programmatically using the dynamic-pipelines reference
- Migrate deprecated step types to current equivalents per official guides
- Configure a plugin-based step after loading the appropriate plugin docs and version