Skip to main content

Neuron Project System Prompt

Use this as a preface before arbitrary task prompts for agents working in this repository.

You are working inside the Neuron repository, which is the Neuron compiler/runtime/tooling codebase.

Operate with these repo-specific rules:

1. Build and test workflow
- Do not use direct ad-hoc CMake commands for normal build/test work.
- Do not run `cmake -S ...`, `cmake --build ...`, or raw Ninja/Make commands directly unless you are explicitly repairing the build scripts themselves.
- Use the repository scripts under `scripts/` instead.
- Full Windows build+test command:
- `set "LLVM_DIR=C:\msys64\mingw64\lib\cmake\llvm"`
- `set "NEURON_TOOLCHAIN_BIN=C:\msys64\mingw64\bin"`
- `scripts\build.bat`
- Targeted tests command:
- `powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build_tests.ps1 -BuildDir C:\Users\yusuf\AppData\Local\Neuron\workspaces\Neuron\build-mingw -Filter <pattern> -LlvmDir C:\msys64\mingw64\lib\cmake\llvm`

2. Repository shape
- `src/` contains compiler, CLI, package manager, and NCON code.
- `runtime/` contains runtime and platform backends.
- `include/` contains headers.
- `tests/` contains the single-binary test suite.
- `scripts/` is the canonical automation surface.

3. Package system facts
- Dependency manifest is `neuron.toml`.
- Exact resolution lockfile is `neuron.lock`.
- Local packages install into `modules/<package>/`.
- Global package cache/store on Windows is `%LOCALAPPDATA%\Neuron\packages`.
- Canonical dependency syntax is inline TOML table:
- `foo = { github = "owner/repo", version = "^1.2.0" }`
- Canonical modulecpp config is top-level `[modulecpp]` and `[modulecpp.<Name>]`.
- Legacy `[ncon.native]` and `[ncon.modulecpp.<Name>]` still exist as compatibility aliases.

4. Compiler/runtime behavior
- Module imports use a recursive module resolver; source graphs matter, not just name existence.
- Dependency package source files can participate in compile/build/NCON flows.
- Dependency package modulecpp definitions can also affect compile/NCON behavior.

5. Editing rules
- Do not revert unrelated local changes.
- Keep changes narrowly scoped.
- Add or update tests for behavior changes.
- After meaningful code changes, rerun the appropriate script-based build/test flow.

6. Communication rule
- If build/test work is requested, explicitly mention that you are using the repo scripts rather than direct CMake commands.

Short Version

If a smaller preface is needed:

This is the Neuron repository. Use `scripts/build.bat` and `scripts/build_tests.ps1` for build/test work; do not use direct ad-hoc CMake commands. Assume `LLVM_DIR=C:\msys64\mingw64\lib\cmake\llvm` and `NEURON_TOOLCHAIN_BIN=C:\msys64\mingw64\bin` unless local context shows otherwise. Package manifests live in `neuron.toml`, exact resolutions in `neuron.lock`, local packages in `modules/`, and Windows global cache in `%LOCALAPPDATA%\Neuron\packages`. Add/update tests with behavior changes and preserve unrelated local edits.