agentleFS
hmctshmcts/claude/.claude/skills/pipeline-debug/SKILL.md

pipeline-debug

Skill1 starsChanged 7 months agoMITView on GitHub

Debug and understand Azure DevOps pipeline configurations. Use when a pipeline fails, when setting up CI/CD for a new repo, or when tracing variable resolution across templates.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the repo's azure-pipelines.yml (or azure-pipelines.yaml).

    line 21
  2. Very specific:

    Read the template file from cpp-azure-devops-templates/

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pipeline Debug

Helps debug, understand, and configure Azure DevOps pipelines across CP repositories by tracing template references, variable resolution, and pipeline structure.

When to Use

  • User asks "why did my pipeline fail", "debug this pipeline", "trace this variable"
  • User wants to set up CI/CD for a new repo
  • User needs to understand how shared templates work
  • User wants to find which template defines a specific step or variable

Process

Step 1: Identify the Pipeline

Read the repo's azure-pipelines.yml (or azure-pipelines.yaml). This is the entry point.

Step 2: Trace Template References

CP pipelines use shared templates from cpp-azure-devops-templates. Template references look like:

resources:
  repositories:
    - repository: cppAzureDevOpsTemplates
      type: github
      name: hmcts/cpp-azure-devops-templates
      ref: refs/heads/main

stages:
  - template: pipelines/context-verify.yaml@cppAzureDevOpsTemplates

For each template reference:

  1. Read the template file from cpp-azure-devops-templates/
  2. Map the parameters passed from the calling pipeline to the template's parameter definitions
  3. Recursively follow any nested template references (stages → steps → tasks)

Step 3: Trace Variable Resolution

Variables are resolved in this order (later overrides earlier):

  1. Pipeline-level variables — defined in azure-pipelines.yml
  2. Variable groups — referenced by name, stored in Azure DevOps
  3. Template parameters — passed explicitly to templates
  4. Runtime expressions — ${{ variables.xxx }}, $[ variables.xxx ]
  5. Macro syntax — $(variableName) resolved at runtime

Step 4: Identify Common Pipeline Types

Repo TypePR TemplateMerge TemplateKey Steps
Context servicescontext-verify.yamlcontext-validation.yamlMaven build, SonarQube, JaCoCo
UI appsui-verify.yamlui-validation.yamlnpm install, lint, test, build
Terraform modulesterratest.yaml—terraform init, validate, plan, test
Docker imagesimage-publish.yaml—Docker build, ACR push
Helm chartsCustom in cpp-helm-chart—Helm lint, package, ACR push
UI E2E tests (cpp-ui-e2e-serenity)azure-pipelines.yml (PR)azure-pipelines-dev01_regression.yml, *_BPO_regression.yml, *_migration.yml, *_migration_EDT.yml, *_migration-nows.yml, *_migration-ts.yml, azure-pipeline-cdci-dlrm.ymlMaven verify, Serenity profiles, WebDriver browser provisioning, Serenity HTML reports
API integration tests (cpp-apitests)azure-pipelines.yaml (PR)apitests-pipeline.yamlMaven verify (Failsafe runs *IT.java), REST Assured + JUnit 5

For test-authoring guidance in either of the two test repos above, see cpp-test-authoring.

Step 5: Common Failure Patterns

SymptomLikely CauseWhere to Look
settings.xml not foundSecure file download failedCheck DownloadSecureFile task and file name
SonarQube analysis failedWrong project key or missing tokenCheck sonarQubeProjectKey parameter
mvn: command not foundWrong agent pool or missing toolCheck pool and task: Maven@4 config
npm ERR! 403.npmrc not configured for private registryCheck secure file .npmrc download
docker push failedACR login failed or wrong registryCheck containerRegistry service connection
terraform plan failedBackend config mismatch or missing varsCheck backend-config parameters
Helm lint failedChart.yaml version mismatch or missing depsCheck helm dependency update step
Serenity report empty / no scenarios ranWrong tag filter or glue package missingCheck TestRunner.java @CucumberOptions + the profile's -Dcucumber.filter.tags
cpp-apitests build green but no tests executedClass named *Test.java instead of *IT.javaFailsafe only picks up *IT.java; rename
WebDriver session creation failedBrowser/driver mismatch in agent poolCheck WebDriverManager config + agent pool image

Step 6: Generate Debugging Report

## Pipeline Analysis: [repo-name]

### Pipeline Type
[context-verify / ui-verify / custom]

### Template Chain
1. azure-pipelines.yml
   └─ pipelines/context-verify.yaml@cppAzureDevOpsTemplates
      ├─ stages/build.yaml
      │   └─ steps/maven-build.yaml
      └─ stages/quality.yaml
          └─ steps/sonarqube-scan.yaml

### Variables Resolved
| Variable | Value | Source |
|----------|-------|--------|
| sonarQubeProjectKey | uk.gov.moj.cpp... | pipeline parameter |
| mavenGoals | clean verify | template default |

### Issues Found
- [description of any problems]

### Recommended Fix
- [specific fix with file and line references]

Key Files in cpp-azure-devops-templates

cpp-azure-devops-templates/
├── pipelines/
│   ├── context-verify.yaml         # Context service PR validation
│   ├── context-validation.yaml     # Context service merge build
│   ├── ui-verify.yaml              # UI app PR validation
│   ├── ui-validation.yaml          # UI app merge build
│   ├── terratest.yaml              # Terraform module testing
│   └── image-publish.yaml          # Docker image publishing
├── stages/                         # Reusable stage definitions
├── steps/                          # Reusable step definitions
└── variables/                      # Shared variable files

Deployment Pipelines

For deployment-related issues, also check:

  • cpp-aks-deploy/aks-deploy.yaml — main AKS deployment pipeline
  • cpp-aks-deploy/helmsman.toml — Helmsman deployment configuration
  • cpp-aks-deploy/helmsman_vars/*.env — environment-specific variables
  • Approval gates: non-live auto-resumes on timeout; live requires CP DevOps SC approval

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.