AgentSkillsCN

build-triggering

通过分支/提交控制与安全确认,触发新的 Buildkite 构建。

SKILL.md
--- frontmatter
name: build-triggering
description: "Triggers new Buildkite builds with branch/commit control and safety confirmations."

Build Triggering

Trigger new Buildkite builds with appropriate safety checks.

When to use

  • "Trigger a build"
  • "Run CI"
  • "Start a build for X"
  • "Rebuild this"
  • "Deploy to staging"
  • "Kick off the pipeline"
  • /buildkite:trigger

Available MCP Tools

ToolPurpose
get_pipelineVerify pipeline exists and get details
list_pipelinesList all pipelines in the organization
create_buildTrigger a new build
list_buildsCheck recent builds (optional)

Input Parsing

Parse from $ARGUMENTS or user's message:

Input FormatExample
Pipeline namemy-pipeline
Pipeline + branchmy-pipeline on main
Description"the deploy pipeline"
Rebuild request"rebuild build 123"

Approach

  1. Identify the pipeline

    • Parse from input
    • Use buildkite_get_pipeline to verify
    • If unclear, ask the user
  2. Determine parameters

    • Branch: From input, current git branch, or ask
    • Commit: Usually HEAD/latest
    • Message: Optional custom message
    • Environment: Any custom env vars
  3. Confirm before triggering

    • Show exactly what will be triggered
    • Require explicit confirmation
    • Be extra careful with deploy/production pipelines
  4. Create the build with buildkite_create_build

  5. Report result

    • Provide build URL
    • Show initial status

Safety Requirements

Always Confirm

text
I'll trigger a build for **my-org/my-pipeline**:
- Branch: `main`
- Commit: `abc123` (latest)

Proceed? (yes/no)

Extra Caution for Sensitive Pipelines

If pipeline name contains: deploy, prod, production, release

text
⚠️ This appears to be a deployment pipeline.

I'll trigger **my-org/deploy-production**:
- Branch: `main`
- Commit: `abc123`

This may deploy to production. Please confirm by typing "deploy" to proceed.

Environment Variables

If setting env vars, show them clearly:

text
Build will include these environment variables:
- DEPLOY_ENV=staging
- SKIP_TESTS=true

Proceed?

Build Parameters

ParameterSourceDefault
branchUser input, git contextAsk user
commitUsually "HEAD"Latest on branch
messageOptionalAuto-generated
envUser-specifiedNone

Response Format

After triggering:

text
✅ Build triggered successfully!

**Build #457**: https://buildkite.com/my-org/my-pipeline/builds/457
- Branch: main
- Commit: abc123
- Status: scheduled

The build is now queued and will start when an agent is available.

Example Interaction

text
User: Run CI on my branch

1. Identify pipeline (from context or ask)
2. Get current git branch
3. Confirm: "Trigger my-pipeline on feature-branch?"
4. On confirmation, create build
5. Return build URL and status