Cursor to Codex CLI: Migrating Rules to Agents.md (www.adithyan.io)

🤖 AI Summary
A developer released a migration script (generate_agents_from_cursor.py) that automates converting Cursor Rules (markdown with YAML frontmatter and auto-attachment/glob behavior) into the simpler AGENTS.md format used by Codex CLI. The tool addresses a practical pain point: teams that invested in detailed, folder-based agent documentation in Cursor—rules that auto-attach to files and encode behavior—need a reliable way to preserve that knowledge when moving to a lower-cost backend that expects AGENTS.md. The author frames this as laying “railway tracks”: worthwhile when you’re building a sustained codebase rather than quick throwaway scripts. Technically, the script handles three common scenarios: consolidating a single global rule into a root AGENTS.md and merging per-folder rules into AGENTS.md inside those folders; when multiple root-level rules exist, converting each to docs/rules/*.md and creating a concise root AGENTS.md index to avoid bloating agent context; and stripping YAML frontmatter while preserving rule content. Usage is simple: drop the script at the repo root and run python generate_agents_from_cursor.py, then review generated files (the original .cursor/rules are left intact). The migration keeps agent guidance portable and maintainable but requires attention to differences—AGENTS.md lacks Cursor’s auto-attach features—so review and tweak generated docs for project-specific attachment behavior.
Loading comments...
loading comments...