Problem
Rule files in rules/ cross-reference sibling rules with same-directory links, e.g. in async-cheap-condition-before-await.md:
This is a specialization of [Defer Await Until Needed](./async-defer-await.md) ...build.ts inlines rule bodies into the skill-root AGENTS.md without rewriting these links, so they break from the output file's location. skills/react-best-practices/AGENTS.md currently contains three such broken links (./async-defer-await.md, ./async-cheap-condition-before-await.md, ./server-hoist-static-io.md) — consumers vendoring the skill see 404 links.
Fix
A post-generation pass in build.ts rewrites same-directory .md links to the rules directory, computed via relative(dirname(outputFile), rulesDir) so it holds for any skill config. Links that already contain a path segment (e.g. ./rules/x.md) and external links are untouched; anchors are preserved.
Verification
Ran tsx src/build.ts --all: the only content change across all three skills' regenerated AGENTS.md is the three previously-broken links now resolving (./rules/<file>.md). A link-resolution check over the regenerated files reports zero broken relative links.
Activity
5Pull request overview
This PR fixes broken intra-rule markdown links that occur when rule bodies from skills/*/rules/ are inlined into a skill’s root AGENTS.md, by rewriting same-directory ./<rule>.md links to be valid from the output file’s location.
Changes:
- Add a post-generation rewrite pass in
packages/react-best-practices-build/src/build.tsto adjust](./<file>.md[#anchor])links to point into the configuredrulesDir. - Regenerate
skills/react-best-practices/AGENTS.mdso the previously broken rule cross-references now use./rules/<file>.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| skills/react-best-practices/AGENTS.md | Updates three inlined rule cross-links to point to ./rules/*.md so they resolve from the skill root. |
| packages/react-best-practices-build/src/build.ts | Implements link rewriting during build output generation to keep inlined rule-relative links valid. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b43d67a
@sgaabdu4 is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.