Skip to content

DOC: add AGENTS.md and CLAUDE.md for AI coding agents - #717

Open
mvdoc wants to merge 3 commits into
mainfrom
claude/pycortex-issue-706-fae0da
Open

DOC: add AGENTS.md and CLAUDE.md for AI coding agents#717
mvdoc wants to merge 3 commits into
mainfrom
claude/pycortex-issue-706-fae0da

Conversation

@mvdoc

@mvdoc mvdoc commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes #706.

Adds repository guidance for AI coding agents (Claude Code and any tool that reads the cross-tool AGENTS.md standard).

What's in it

  • Commands: editable install with the Cython extensions (--no-build-isolation), the headless extra + Playwright setup, running the full suite / a single file / a single test, the per-test timeout, which tools tests self-skip on (Inkscape, Playwright, FreeSurfer), and the docs build.
  • Architecture: the filestore/Database layout, the dataset braindata × Dataview class hierarchy, the mapper families and their caching, quickflat's layer-composition design, the WebGL pipeline (Package → CTM packs → Tornado templates → Three.js r69 app, JSProxy, shaderlib.js), the shared overlays.svg ROI system, and configuration (options.cfg, filestore/colormaps).
  • Gotchas: silent pervasive caching and recache/db.clear_cache, import cortex side effects, CTM vertex reordering, package_data enumeration for new webgl resources, CRLF line endings in some JS files.

Layout

Per @kroq-gar78's suggestion in #706, the content lives in AGENTS.md and CLAUDE.md imports it with Claude Code's @AGENTS.md syntax. I used an import rather than a symlink so Windows checkouts (recently fixed in #701) don't degrade the link into a plain text file.

🤖 Generated with Claude Code

Adds repository guidance for AI coding agents: build/test/docs commands,
the big-picture architecture (filestore, dataset containers, mappers,
quickflat, the WebGL viewer pipeline), and non-obvious gotchas (silent
caching, import side effects, CTM vertex reordering, Three.js r69).

Per the discussion in #706, the content lives in AGENTS.md (the
cross-tool standard) and CLAUDE.md imports it, so both filenames stay
in sync without a symlink (which would break on Windows checkouts).

Closes #706

Co-Authored-By: Claude Fable 5 <[email protected]>
@mvdoc mvdoc assigned mvdoc and unassigned mvdoc Aug 25, 2026
@mvdoc

mvdoc commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Overall it looks OK to me. Anything worth adding @kroq-gar78 @alexhuth @marklescroart ?

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
Comment on lines +14 to +16
pip install -U setuptools wheel numpy cython
pip install -e '.[headless]' --no-build-isolation # headless extra = playwright, for WebGL tests
pip install -e . --no-build-isolation --group dev # test + type-checking dependencies

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use uv instead? That'd simplify the setup substantially (just uv sync --all-extras --dev). We'd also have to modify the testing and docs commands later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does uv work with windows?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like uv but I'm tempted to leave the pip installation instructions. For an LLM it doesn't matter if it's 4 lines vs. one line, and maybe it's easier to debug? But I may be wrong...

@kroq-gar78 kroq-gar78 Aug 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even for an LLM, I still think uv would be better because it keeps the environment isolated in the repo. The agent doesn't need to worry about outside side effects. (Right now the file doesn't have any instructions to create a venv either, which would be the alternative but IMO is more complicated)

Comment thread AGENTS.md Outdated
mvdoc added 2 commits August 25, 2026 12:31
Clarify that changes to overlays.svg are due to pretty-printing and should not be committed.
@mvdoc
mvdoc requested a review from kroq-gar78 August 25, 2026 19:34
@kroq-gar78

Copy link
Copy Markdown
Contributor

It would also be great if we strongly suggest (require?) new Python code to have type annotations. I'm not sure where in the file that would go.

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.

Add CLAUDE.md

2 participants