OpenParable
Skip to content
← Back to skills

Chromium Code Link Formatting

Documents
chromium-code-link-formatting

Chromium Code Link Formatting is an Agent Skill for documents published in the chromium/chromium repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Use this skill when you need to link to files or specific lines in the Chromium codebase within a document intended for external sharing (e.g., Google Docs, Buganizer). This skill ensures links use the stable `source.chromium.org` format with line numbers and commit hashes for accessibility, even if the user doesn't explicitly specify the format. Do not use for internal or purely local notes where file:/// links are preferred.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/chromium/chromium/blob/HEAD/agents/skills/chromium-code-link-formatting/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/chromium-code-link-formatting, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Chromium Source Link Formatter

Instructions

When formatting links to the Chromium codebase for documents that will be shared externally:

  1. Use the following URL format: https://source.chromium.org/chromium/chromium/src/+/main:{path_to_file};l={line_no};drc={commit_hash}

  2. Resolve Placeholders:

    • path_to_file: The path to the file relative to the repository root.
    • line_no:
      • Single line: l=20
      • Range: l=400-500 (inclusive)
      • Multiple ranges: l=20,400-500
      • Whole file: Leave empty (l=)
    • commit_hash:
      • If the user specifies a hash, use it.
      • Otherwise, execute git merge-base HEAD origin/main to find the latest common ancestor and use that hash.