Skip to content

Multi-AI agent-instructions support via symlinks#43

Open
kirkabowman wants to merge 3 commits into
petrowsky:mainfrom
kirkabowman:feat/multi-ai-agent-instructions
Open

Multi-AI agent-instructions support via symlinks#43
kirkabowman wants to merge 3 commits into
petrowsky:mainfrom
kirkabowman:feat/multi-ai-agent-instructions

Conversation

@kirkabowman
Copy link
Copy Markdown

Summary

  • Adds AGENTS.md at the repo root (symlink to .claude/CLAUDE.md) so AI tools that use the AGENTS.md convention — Aider, Cline, Continue.dev, OpenAI Codex CLI, generic AGENTS.md-aware tools — find the project conventions at the path they expect.
  • Adds .github/copilot-instructions.md (symlink to .claude/CLAUDE.md) so GitHub Copilot picks up the same content.
  • Joins the existing .cursor/AGENTS.md symlink. Now four paths point to one canonical file: .claude/CLAUDE.md. Edit only the canonical; symlinks pick up changes automatically.
  • Adds agent/scripts/sync_agent_docs.sh — a verifier (md5-checks all four paths, prints how to restore symlinks if broken). Suitable for pre-commit or CI.
  • Documents the convention in the canonical doc itself ("Agent-instructions across multiple AI tools" section) and in ARCHITECTURE.md § "Update documentation together".

Why

Currently only Claude Code (.claude/CLAUDE.md) and Cursor (.cursor/AGENTS.md) get the project conventions. Other AI assistants — Aider, Cline, Continue.dev, OpenAI Codex CLI, GitHub Copilot — read different conventional paths. This PR makes agentic-fm tool-agnostic without content duplication.

Symlink-vs-copy choice

Symlinks (mode 120000 in git) avoid sync drift entirely. The existing .cursor/AGENTS.md is already a symlink, so this PR just extends the pattern. Caveats:

  • Windows clones without Developer Mode treat symlinks as plain text files containing the target path. Project is macOS-centric so this is acceptable; documented in the verifier script's restore instructions.
  • Editors / pre-commit hooks generally follow symlinks transparently.

Test plan

  • Fresh clone on macOS — verify all four paths show the same content (agent/scripts/sync_agent_docs.sh)
  • Open the repo in Cursor, Claude Code, and a Codex CLI session — confirm each tool reads its expected agent-instructions file
  • Edit .claude/CLAUDE.md, confirm AGENTS.md and .github/copilot-instructions.md reflect the change without re-running anything
  • Replace one symlink with a plain file (simulating a regression) — verify sync_agent_docs.sh detects the divergence and exits non-zero

🤖 Generated with Claude Code

Kirk Bowman and others added 3 commits April 24, 2026 16:54
- analyze.py: change glob() to rglob() so folder-nested CFs are found;
  filter out folder separator pseudo-files via stub XML existence check;
  add folder_path to CF data and index loader
- fmcontext.sh: fix sanitized body path lookup to be subfolder-relative
  (flat lookup silently missed nested CFs, misclassifying all as functional);
  add FolderPath as 7th column to custom_functions.index header and output;
  replace mapfile with while-read loop for bash 3.2 compatibility on macOS
- build_cf_names: use rglob instead of iterdir so custom functions
  nested inside folder-group subdirectories are discovered
- parse_scripts: extend bracket guard to include lines with ']' so
  zero-argument CF calls on expression-continuation lines are not skipped

Made-with: Cursor
Adds AGENTS.md (root) and .github/copilot-instructions.md as symlinks to
the canonical .claude/CLAUDE.md so non-Claude AI tools (Aider, Cline,
Continue.dev, OpenAI Codex CLI, GitHub Copilot, plus the existing Cursor
.cursor/AGENTS.md symlink) find the same project conventions at the
paths they expect, without duplicating content. Adds a verifier script
(agent/scripts/sync_agent_docs.sh) suitable for pre-commit/CI to confirm
all four paths resolve to byte-identical content. Documents the
convention in both the canonical doc and ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant