Skip to content

Commit d5bfa08

Browse files
docs(.ai): ci and symlinking in readme
1 parent 1172b42 commit d5bfa08

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.ai/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ All rules and skills now live in **`.ai/`** — a tool-agnostic, plain-markdown
1212
- No sync step, no duplication, no drift between tools
1313
- New contributors or tools start from `AGENTS.md` at the repo root, which bootstraps everything
1414

15+
## CI integration
16+
17+
- `yarn lint:ai` runs `.ai/scripts/validate.js`, which checks story tags, AGENTS.md paths, and config schema. Catches broken internal links, symlinks, and misconfigured rules before merge
18+
- Pre-commit hook runs the contributor docs nav script to keep breadcrumbs and TOCs in sync automatically
19+
1520
## Rules
1621

1722
Rules defined in the `config.json` follow this structure:
@@ -309,6 +314,58 @@ Editing any `.ai/rules/*.md` file immediately updates what both Cursor and Claud
309314
2. Register it in the skills catalog below and in [`AGENTS.md`](../AGENTS.md).
310315
3. Both `.cursor/skills/` and `.claude/skills/` pick it up automatically via directory symlinks.
311316

317+
### Symlink setup
318+
319+
The symlinks in `.cursor/` and `.claude/` are committed to the repo, so **no setup is required after cloning**. Rules and skills should work automatically for all contributors.
320+
321+
#### Recreating broken symlinks
322+
323+
If a symlink is accidentally deleted or broken (e.g. after a file was deleted and recreated rather than edited in place), recreate it with the commands below.
324+
325+
##### Claude Code
326+
327+
```sh
328+
mkdir -p .claude
329+
ln -s ../.ai/rules .claude/rules
330+
ln -s ../.ai/skills .claude/skills
331+
```
332+
333+
Claude Code reads `.md` files, so directory-level symlinks work directly. Verify:
334+
335+
```sh
336+
ls -la .claude/
337+
# rules -> ../.ai/rules
338+
# skills -> ../.ai/skills
339+
```
340+
341+
##### Cursor
342+
343+
> **Cursor requires per-file symlinks for rules.** Cursor expects `.mdc` files and does not follow a directory symlink that contains `.md` files. Each rule needs its own symlink with the `.mdc` extension pointing back to the `.md` source.
344+
345+
```sh
346+
mkdir -p .cursor/rules
347+
for f in .ai/rules/*.md; do
348+
name=$(basename "$f" .md)
349+
ln -s "../../.ai/rules/${name}.md" ".cursor/rules/${name}.mdc"
350+
done
351+
352+
ln -s ../.ai/skills .cursor/skills
353+
```
354+
355+
Verify:
356+
357+
```sh
358+
ls -la .cursor/rules/
359+
# branch-naming.mdc -> ../../.ai/rules/branch-naming.md
360+
# styles.mdc -> ../../.ai/rules/styles.md
361+
# ... (one entry per rule)
362+
363+
ls -la .cursor/
364+
# skills -> ../.ai/skills
365+
```
366+
367+
If Cursor does not pick up the rules after symlinking, reload the window: `Cmd+Shift+P` → "Developer: Reload Window".
368+
312369
### Using rules and skills in other environments
313370

314371
If you use a tool that does not read `.cursor/` or `.claude/`, point it at `.ai/` directly:

0 commit comments

Comments
 (0)