cnb-text-path-converter

Converts relative paths in CNB issue and pull request text into absolute URLs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? CNB issues, pull requests, comments, and reviews often contain relative file paths that AI agents cannot resolve directly. This Skill converts those relative paths into absolute URLs pointing to the actual repository resources, so agents can access referenced files without ambiguity. ## Core Features & Use Cases - Relative-to-Absolute Conversion: Transforms paths like ./src/utils/helper.ts or ../docs/api.md into full CNB raw file URLs based on the repository slug and branch. - Markdown and HTML Link Handling: Rewrites URLs inside Markdown links, images, and HTML src/href attributes while skipping code blocks and inline code spans. - Use Case: When an AI agent reads an issue description referencing ./src/config.ts, run the script to obtain the absolute URL https://cnb.cool/<repo>/-/git/raw/main/src/config.ts and fetch the file content directly. ## Quick Start Ask the agent to convert the relative paths in this issue description into absolute CNB URLs using the convertLink script.

Frequently Asked Questions about cnb-text-path-converter

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

FAQPage Schema
How do I convert relative paths in a CNB issue to absolute URLs?

Run node scripts/convertLink.js with the raw issue text as the argument. The script outputs the text with all relative paths replaced by absolute CNB raw file URLs based on the repository slug and branch.

What link formats does the path converter handle?

It rewrites Markdown links and images like [text](path) and ![alt](path), plus HTML src and href attributes. Paths starting with ./, ../, or / are converted, while URLs already containing /-/ are prefixed with the base URL.

Does the converter change paths inside code blocks?

No. The script detects fenced code blocks and inline code spans and excludes them from replacement, so example code containing relative paths remains unchanged.

What environment variables does the convertLink script need?

It requires CNB_WEB_ENDPOINT for the platform base URL, CNB_REPO_SLUG for the repository path, and optionally CNB_BRANCH for the branch or SHA, which defaults to HEAD when not set.

Why are some relative paths not converted?

Paths that resolve to nothing after filtering empty segments and dot segments are left unchanged, as are links already containing /-/ segments. External URLs and protocol-relative links are also passed through unmodified.