Skip to content

Relative doc links break in the flat skills/rulesync/ mirror #2313

Description

@dyoshikawa

Background

While reviewing #2311, the security reviewer noticed that docs/reference/file-formats.md links to the FAQ as ../faq.md#.... That path is correct inside docs/reference/, but scripts/sync-skill-docs.ts copies all docs into the flat skills/rulesync/ directory, where faq.md is a sibling — so the copied ../faq.md links resolve to a nonexistent path in the distributed skill.

This is a pre-existing characteristic of the sync script (other unchanged paragraphs in the same file carry identical ../faq.md links), not something introduced by #2311.

Possible solution

Teach scripts/sync-skill-docs.ts to rewrite relative links during sync: strip directory segments so cross-doc links point at the sibling file in the flat mirror (e.g. ../faq.md#anchorfaq.md#anchor, ./configuration.md stays as-is). A check could also assert that all relative links in skills/rulesync/ resolve to files in that directory.

Noted by Claude Code review agents during #2311.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-scrapRough notes for AI implementation. Not for human eyes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions