file-links

Formats file references as markdown links with GitHub-style line number anchors.

Updated May 2, 2026
One-click install
npx skills add https://github.com/hdeshev/pi-config --skill file-links-hdeshev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: file-links
Source: https://github.com/hdeshev/pi-config/tree/main/agent/skills/emacs-file-links
Command: npx skills add https://github.com/hdeshev/pi-config --skill file-links-hdeshev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When an AI assistant references files in its output, plain text paths are not clickable in editors like Emacs or on platforms like GitHub, forcing users to manually locate files and line numbers. ## Core Features & Use Cases - Clickable File References: Converts file mentions into markdown links using paths relative to the project root. - Line Number Anchors: Appends GitHub-style #L fragments for single lines and #L42-L50 style fragments for line ranges. - Consistent Link Text: Keeps the link text readable with filename:line notation while the URL carries the anchor. - Use Case: When reviewing code, the assistant outputs [parser.el:42-50](src/parser.el#L42-L50) so you can jump directly to the referenced block. ## Quick Start Ask the assistant to reference the files it modified, and it will format each one as a clickable markdown link with the relevant line numbers.

Frequently Asked Questions about file-links

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

FAQPage Schema
How do I make file references clickable in AI assistant output?▼

Format them as markdown links with the path relative to the project root, such as [filename.el](path/to/filename.el). Add a #L fragment to the URL when a specific line number is relevant.

How to link to a specific line range in a file on GitHub?▼

Use the #L start-end fragment syntax, for example filename.el#L42-L50 for lines 42 through 50. The link text should mirror the range as filename.el:42-50 so it stays readable.

Does the #L line anchor syntax work outside GitHub?▼

The #L fragment syntax is GitHub-style but is also recognized by editors and tools that resolve such links, including Emacs configurations set up for it. Plain markdown viewers will still render a working file link without line jumping.

When should line numbers be included in file links?▼

Include line numbers when they add context, such as error locations, function definitions, or modified lines. Omit them when referring to the file as a whole, since stale line numbers can mislead after edits.

What are common mistakes when formatting file markdown links?▼

A common mistake is putting the #L anchor in the link text but not the URL, or mismatching the range between them. The range must appear in both the link text (with a colon and dash) and the URL (with #L and -L).