Repository navigation
Add AGENTS.md files with a CI-checked related_files header - #471
Conversation
|
Thanks for putting this agent guidance together. Before we import it, we need to account for the repository layout: SVN trunk is mirrored into the GitHub idl/ directory, while GitHub-root dot directories are not produced by the SVN snapshot. |
This is the portable part of PR spedas#471, reworked so that it can be imported into SVN trunk (the GitHub idl/ folder) on its own and works in a clean trunk working copy. Every path is relative to idl/, e.g. projects/themis/common/thm_init.pro, and nothing refers to .github/, .agents/ or other files outside idl/. - idl/AGENTS.md is the trunk entry point: layout, finding routines, tplot variables, loaders, what to skip, and the AGENTS.md header convention. - 59 AGENTS.md files for idl/projects, idl/general, idl/spedas_gui, idl/external and the missions and instruments below them. - idl/agents/scripts/check_agents_md.py checks the headers. Its default root is two levels above the script (trunk); outside a Git work tree it walks the tree, skipping .git and .svn. Naming AGENTS.md files checks only those. - idl/agents/scripts/build_agents_map.py builds idl/agents/map/, only after a human agrees (idl/agents/skills/agents-map/SKILL.md). The map is rebuilt from the new headers: 60 AGENTS.md files, 1756 related paths, none missing. svn_version_info.txt and the _spd_doc.html pages come from the zip build, not SVN, so no header lists them. No code changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GitHub-only part of PR spedas#471, on top of the portable content in idl/: - AGENTS.md at the repository root now covers only GitHub: the mirror, the workflows, and reporting upstream. Everything else is in idl/AGENTS.md. - The agents_md workflow runs idl/agents/scripts/check_agents_md.py with idl/ as the root, the same check as in a trunk working copy, then checks the root AGENTS.md alone with the repository root as the root, since its paths start there. Checker lines become file annotations. - mirror_bleeding_edge.yml always keeps the root AGENTS.md. It keeps the AGENTS.md files under idl/ only while the snapshot has no idl/AGENTS.md, and idl/agents/ only while the snapshot has no idl/agents/. Once upstream ships either one, the sync mirrors it, deletions included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1b6320a to
76a7c3e
Compare
|
Thanks, that makes sense. I've reworked the branch into two commits that can be reviewed and imported separately:
To check it with One thing to confirm on your side: I treated The PR description is updated to match. |
|
Portable content from commit 224eab6 was imported into SVN trunk as rNNNNN. The remaining commit contains GitHub-only automation. |
This PR adds AGENTS.md guidance for IDL SPEDAS, organized so SVN can import it. It has two commits that can be reviewed and imported independently:
idl/, which maps to SVN trunk.idl/, which stays in this mirror.#470 was closed in favor of this one.
The AGENTS.md convention (same as pyspedas#1492)
AGENTS.md files are the cross-tool place for coding-agent instructions; Codex, Claude Code, Gemini CLI, Cursor, Copilot and others read them. Every AGENTS.md starts with a YAML header with exactly two fields:
Paths are relative to the top of the source tree:
idl/here,trunk/in SVN. No folder has to have an AGENTS.md, but any that exists must have this header.1. Portable content (
idl/only)idl/AGENTS.mdis the trunk entry point: layout, finding a routine, tplot variables, loaders, what to skip, and the header convention.projects/(one line for each of the 39 mission folders),general/,general/missions/,spedas_gui/andexternal/.general/:tplot,misc,science,tools,cotrans,CDF,spice,spedas_tools.general/missions/.idl/agents/scripts/check_agents_md.pychecks the headers. It fails on a missing or malformed header, and warns on listed paths that don't exist, files the text mentions but doesn't list, and parent/child links that only go one way. Its default root is trunk; outside a Git work tree it walks the tree and skips.gitand.svn.idl/agents/scripts/build_agents_map.pybuildsidl/agents/map/MAP.md(Mermaid) andidl/agents/map/graph.jsonfrom the headers. It runs only when a human agrees; seeidl/agents/skills/agents-map/SKILL.md. The map in this commit covers all 60 files and 1,756 related paths, none missing.Each AGENTS.md covers the folder's layout, how its main entry point works, and lasting traps an agent would hit: common blocks and system variables, routines called by name from strings, duplicate file names, legacy subfolders to skip, and servers and credentials.
2. GitHub-only automation (outside
idl/)AGENTS.md: covers the mirror, the two workflows and reporting upstream, and points toidl/AGENTS.mdfor everything else..github/workflows/agents_md.yml) runs the checker withidl/as the root, then checks the rootAGENTS.mdseparately, and turns the checker's output into annotations. It runs on every push and PR, and weekly an hour after the mirror sync, because the mirror's pushes don't trigger workflows.mirror_bleeding_edge.yml) always keeps the rootAGENTS.md. It keeps the AGENTS.md files underidl/and theidl/agents/folder only while the upstream snapshot lacks them. Once trunk ships them, the sync mirrors them like the rest of the code, deletions included. I tested the rsync lines against snapshots with neither, one or both.How it was checked
idl/from the first commit into a folder outside Git and ranpython agents/scripts/check_agents_md.py --strict: 60 files, 0 errors, 0 warnings.build_agents_map.py --checkreports the map up to date..proor data files changed. The files were written from the code, and specific claims were spot-checked against it. Bugs noticed while reading the code were kept out of the docs and are being reported separately.svn_version_info.txtand the*_spd_doc*.htmlpages come from the zip build and aren't in trunk, so no header lists them.🤖 Generated with Claude Code