Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ jobs:
- name: Lint
run: bun run lint

check-agents-md:
name: Check AGENTS.md Symlinks
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check CLAUDE.md symlinks exist
run: bash scripts/check-agents-md.sh

typecheck:
name: Type Check
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"lint:check": "biome lint .",
"check": "biome check --write .",
"check:ci": "biome check .",
"link-agents": "bash scripts/link-agents-md.sh",
"check:agents": "bash scripts/check-agents-md.sh",
"prepublishOnly": "bun run build"
},
"keywords": [
Expand Down
24 changes: 24 additions & 0 deletions scripts/check-agents-md.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Checks that every AGENTS.md (except root) has a CLAUDE.md symlink.
# Used in CI to catch missing symlinks.

set -euo pipefail

root="$(cd "$(dirname "$0")/.." && pwd)"
missing=0

find "$root" -name AGENTS.md -not -path "$root/AGENTS.md" | sort | while read -r agents; do
dir="$(dirname "$agents")"
link="$dir/CLAUDE.md"
rel="${link#$root/}"

if [ ! -L "$link" ]; then
echo "missing symlink: $rel -> AGENTS.md"
echo " run: bun run link-agents"
missing=1
fi
done

if [ "$missing" -eq 1 ]; then
exit 1
fi
20 changes: 20 additions & 0 deletions scripts/link-agents-md.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Creates CLAUDE.md symlinks for all AGENTS.md files (except root).
# Re-run whenever you add a new AGENTS.md.

set -euo pipefail

root="$(cd "$(dirname "$0")/.." && pwd)"

find "$root" -name AGENTS.md -not -path "$root/AGENTS.md" | while read -r agents; do
dir="$(dirname "$agents")"
link="$dir/CLAUDE.md"
if [ -L "$link" ]; then
echo "exists: ${link#$root/}"
elif [ -f "$link" ]; then
echo "skip (real file): ${link#$root/}"
else
ln -s AGENTS.md "$link"
echo "created: ${link#$root/}"
fi
done
1 change: 1 addition & 0 deletions src/cache/CLAUDE.md
1 change: 1 addition & 0 deletions src/cli/CLAUDE.md
1 change: 1 addition & 0 deletions src/middleware/CLAUDE.md
1 change: 1 addition & 0 deletions src/sandbox/CLAUDE.md
1 change: 1 addition & 0 deletions src/setup/CLAUDE.md
1 change: 1 addition & 0 deletions src/skills/CLAUDE.md
1 change: 1 addition & 0 deletions src/tools/CLAUDE.md
1 change: 1 addition & 0 deletions src/utils/CLAUDE.md