What problem does it solve?
Generating accurate, permanent links to specific lines of code for reviews in GitHub or GitLab is often error-prone due to changing branch names, relative diff positions, and manual URL construction. This skill automates the entire process, ensuring reliable links every time.
Core Features & Use Cases
- Accurate Line Numbering: Finds absolute line numbers in files, resolving the ambiguity of
git diff relative positions.
- Permanent Blob URLs: Generates stable URLs using commit SHAs (not volatile branch names) for GitHub and GitLab.
- Automated Review Formatting: Consistently formats code and architecture review comments from structured JSON input.
- Use Case: During a code review, you identify an issue at a specific line. Instead of manually navigating and copying a potentially broken URL, this skill automatically finds the correct line, generates a permanent link, validates it, and formats your feedback for direct posting to the MR/PR.
Quick Start
Locate tool
VCS_TOOL=$(for path in $(jq -r 'to_entries[] | .value.installLocation + "/plugin/skills/vcs-tool-manager/vcs-tool.sh"' ~/.claude/plugins/known_marketplaces.json); do [ -f "$path" ] && echo "$path" && break; done)
Detect platform
PLATFORM=$("$VCS_TOOL" detect-platform)
Find accurate line number
RESULT=$("$VCS_TOOL" find-line "src/Service.java" "methodName")
LINE=$(echo "$RESULT" | jq -r '.line')
Generate URL (assuming METADATA is already set from get-gitlab-mr/get-github-pr)
URL_INPUT=$(echo '{"platform": "'"$PLATFORM"'", "file_path": "src/Service.java", "line_number": '"$LINE"'}' | jq -c ". + {}") # Placeholder for METADATA
URL=$("$VCS_TOOL" format-url "$URL_INPUT")