AGENT SKILL

pipeline-validator

Validate CI/CD pipelines after PR creation. Discovers pipelines, triggers runs, monitors status, diagnoses failures, applies auto-fixes, and retries. Use after any change-making skill creates a PR that needs pipeline validation.

License 许可
MIT
所属仓库
loriensleafs/brain
最近更新
2026-03-11
Stars
★ 0
Forks
0

01 前言 Front Matter

name
pipeline-validator
model
claude-sonnet-4-5
agents
[ "devops", "implementer", "qa" ]
license
MIT
metadata
{ "version": "1.0.0" }
description
Validate CI/CD pipelines after PR creation. Discovers pipelines, triggers runs, monitors status, diagnoses failures, applies auto-fixes, and retries. Use after any change-making skill creates a PR that needs pipeline validation.

02 资源文件 1

03 SKILL.md 正文

Pipeline Validator

Post-PR pipeline validation workflow. Discovers pipelines, triggers runs, monitors completion, diagnoses failures, applies fixes, and retries until all pipelines pass.

Triggers

Trigger Phrase Operation
validate pipelines Full 8-step workflow
discover pipelines Step 1: Find pipeline definitions
trigger pipeline runs Step 3: Queue pipeline runs
monitor pipeline status Step 4: Poll for completion
diagnose pipeline failure Step 5: Analyze failure logs

When to Use

Use this skill when:

  • A PR has been created and needs pipeline validation before merge
  • Pipeline runs have failed and need diagnosis
  • Auto-fix and retry cycles are needed for transient or known failures
  • Any change-making skill (e.g., windows-image-updater) needs post-PR validation

Process

Step 1: Discover Pipelines

  1. Scan the repository for pipeline definition files:
    • .azure-pipelines/*.yml
    • .pipelines/*.yml
    • build/**/*.yml
    • Root-level azure-pipelines.yml
  2. Classify each pipeline by type: PR Build, Buddy Build, Buddy Release, Other
  3. Record pipeline names and file paths

Step 2: Identify Target Pipelines

  1. Filter to pipelines triggered by PR events or manual dispatch
  2. Exclude pipelines that are disabled or have path filters excluding the changed files
  3. Produce a target list with pipeline name, type, and definition path

Step 3: Trigger Pipeline Runs

  1. For each target pipeline, trigger a run against the PR branch
  2. Use Azure DevOps REST API or az pipelines run CLI
  3. Record the run ID and URL for each triggered pipeline
  4. Update the PR description with pipeline run links

Step 4: Monitor Pipeline Status

  1. Poll each pipeline run at 60-second intervals
  2. Track status transitions: Queued, Running, Completed
  3. Set a timeout of 120 minutes per pipeline run
  4. Report intermediate status updates as PR comments (at 5-minute intervals)

Step 5: Diagnose Failures

For each failed pipeline run:

  1. Download the run logs
  2. Match log content against known error patterns (see error-patterns.md)
  3. Classify the failure:
    • Auto-fixable: Known pattern with a documented fix
    • Transient: Infrastructure flake, retry without changes
    • Investigation required: Unknown pattern, escalate to human

Step 6: Apply Auto-Fixes

For auto-fixable failures:

  1. Apply the documented fix from the error pattern catalog
  2. Commit the fix to the PR branch with a descriptive message
  3. Push the commit

Step 7: Retry

  1. Re-trigger failed pipelines after fixes are applied
  2. Track retry count per pipeline (maximum 3 retries)
  3. If a pipeline fails after 3 retries, mark it as requiring investigation

Step 8: Report Results

Update the PR description with a summary table:

## Pipeline Validation Results

| Pipeline | Type | Status | Retries | Run Link |
|----------|------|--------|---------|----------|
| PR Build | PR | Passed | 0 | [Run #123](url) |
| Buddy Build | CI | Passed | 1 | [Run #124](url) |
| Buddy Release | CD | Passed | 0 | [Run #125](url) |

Constraints

  • Maximum 3 retry attempts per pipeline
  • 120-minute timeout per pipeline run
  • Do not auto-fix failures that modify production configuration
  • Always update the PR description with run links before monitoring
  • Log all diagnosis results, even for passing pipelines

Composability

This skill is designed to be invoked by any skill that creates a PR needing pipeline validation. The calling skill creates the PR. This skill validates it.

Example integration:

  1. windows-image-updater creates a PR with image updates
  2. pipeline-validator is invoked with the PR number
  3. pipeline-validator discovers, triggers, monitors, and reports

Any future migration skill (e.g., .NET version upgrades) can follow the same pattern.

See Also

Document Content
error-patterns.md 12-category error diagnosis catalog
windows-image-updater skill Pre-PR change-making skill

04 同仓库更多 Skills

loriensleafs
loriensleafs/brain

validation-authority

Treat upstream validators as authoritative. Align local config to them. Use when validation fails unexpectedly, before modifying validator behavior, or when tempted to change upstream tool code.

★ 0
loriensleafs
loriensleafs/brain

using-brain-memory

Guidance for using Brain semantic memory effectively. Applies Zettelkasten atomic note principles with observations and relations. Use when deciding whether to query or create notes, structuring note content, or understanding the semantic knowledge graph.

★ 0
loriensleafs
loriensleafs/brain

threat-modeling

Structured security analysis using OWASP Four-Question Framework and STRIDE methodology. Generates threat matrices with risk ratings, mitigations, and prioritization. Use for attack surface analysis, security architecture review, or when asking what can go wrong.

★ 0
loriensleafs
loriensleafs/brain

taste-lints

Custom lints with agent-readable remediation instructions. Enforces taste invariants (file size, naming conventions, structured logging, complexity) and surfaces errors that agents can act on directly. Use when writing or reviewing code to catch style violations early.

Skill与智能体开发
★ 0
loriensleafs
loriensleafs/brain

style-enforcement

Validate code against style rules from .editorconfig, StyleCop.json, and Directory.Build.props. Detects line ending violations, naming convention issues, indentation problems, and charset mismatches across C#, Python, TypeScript, and JavaScript. Produces JSON reports for pre-commit hooks and CI pipelines.

★ 0
loriensleafs
loriensleafs/brain

steering-matcher

Match file paths against steering file glob patterns to determine applicable steering guidance. Use when orchestrator needs to inject context-aware guidance based on files being modified.

★ 0