cnb-pipeline

Write, validate, and diagnose CNB .cnb.yml pipeline configurations.

3|1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/wopal-cn/wopal-space-ontology --skill cnb-pipeline-wopal-cn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cnb-pipeline
Source: https://github.com/wopal-cn/wopal-space-ontology/tree/main/skills/cnb-pipeline
Command: npx skills add https://github.com/wopal-cn/wopal-space-ontology --skill cnb-pipeline-wopal-cn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires js-yaml, ajv, ajv-formats, and includes references (resource) components.

What problem does it solve? Writing and debugging CNB (cnb.cool) CI/CD pipeline configurations is error-prone: YAML syntax mistakes, misplaced events, invalid built-in variables, and cryptic build failures waste developer time. This Skill generates correct .cnb.yml configurations, validates them against the official schema, and diagnoses build failures or performance bottlenecks. ## Core Features & Use Cases - Pipeline Authoring: Generate complete .cnb.yml configurations covering branches, events, pipelines, stages, jobs, Docker environments, and built-in tasks, with mandatory schema validation before delivery. - Failure Diagnosis: Analyze CI build logs via the cnb CLI to classify failures as code errors, configuration issues, or external service problems, then propose concrete fixes. - Performance Optimization: Identify slow stages, missing caches, and serializable work, then recommend parallelization and caching strategies. - Use Case: A developer's PR build fails with an obscure error. The Skill pulls the failing build logs, pinpoints a misconfigured event placement in .cnb.yml, fixes it, and re-validates the file against the official schema. ## Quick Start Ask the assistant to create a .cnb.yml pipeline that runs npm test on every pull request and deploys on push to main.

Frequently Asked Questions about cnb-pipeline

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

FAQPage Schema
How do I write a .cnb.yml pipeline configuration?

Define the structure as branch, event, pipeline, stage, then job. Specify a Docker image or Dockerfile build, list stages with scripts or built-in task types, and optionally add failStages and endStages. Always validate the file with the schema validator before committing.

How do I diagnose a failed CNB CI build?

Run cnb pulls get-ci-logs to automatically locate the failed build and retrieve its logs. Classify the failure as a code error, configuration issue, or external service problem based on log keywords, then fix the root cause and push without polling for CI status.

What built-in environment variables does CNB provide?

CNB provides 82 built-in variables prefixed with CNB_, including CNB_BRANCH, CNB_COMMIT, CNB_BUILD_ID, CNB_TOKEN, and CNB_PIPELINE_KEY. Custom variables must not use the CNB_ prefix, as it is reserved for system read-only variables.

Why does my CNB pipeline fail schema validation?

Common causes include YAML indentation with tabs, misspelled field names, non-built-in CNB_ prefixed variables, built-in tasks used under unsupported events, and repository-level events like tag_push placed outside the $ fallback branch.

Can I reuse CNB pipeline configuration across files?

Yes. Use YAML anchors within the same file for template inheritance with merge support, and use !reference to import values from other files included via the include directive. Keys starting with a dot serve as reference sources and are not treated as branch names.

How do I speed up a slow CNB pipeline?

Analyze stage durations from build logs, then add Docker volume caches for dependencies, preinstall system packages via a custom Dockerfile instead of apt install, parallelize independent jobs, and use ifModify to skip unchanged modules in monorepos.