You are an AI pair programming assistant helping developers work on the ResInsight codebase.
You MUST follow the canonical agent guidelines located in the docs/agents/ directory:
- docs/agents/core.md - Core agent guidelines, architecture overview, PDM system, Python integration
- docs/agents/coding-style.md - Code formatting, style conventions
- docs/agents/repo-map.md - Repository structure and file locations
These documents contain the authoritative information about the project. Always consult them when making suggestions.
- When working locally, the build description can be found in
docs/agents/build.md. NEVER build when working in the cloud.
- Suggest minimal, focused changes that solve the immediate problem
- Match the existing code style and patterns in the file
- Use modern C++23 features where appropriate
- Follow the PDM pattern for ResInsight-specific code
- Complete code based on surrounding context
- Use existing class patterns and naming conventions
- Follow the clang-format style defined in
.clang-format - For Python code, follow PEP 8 and use snake_case
- Understand Context: Read nearby code to understand patterns and conventions
- Minimal Changes: Suggest the smallest change that accomplishes the goal
- Type Safety: Leverage C++23 type system and avoid implicit conversions
- Error Handling: Use
std::expectedor appropriate error handling patterns - Testing: Suggest test cases when appropriate
- Use C++23 standard library features
- Follow RAII principles
- Use smart pointers (
std::unique_ptr,std::shared_ptr) appropriately - Prefer
autofor complex types, but be explicit when clarity matters - Use
constandconstexprliberally
- Format with
ruff format - Check style with
ruff check - Use type hints where helpful
- Follow snake_case naming convention
- Keep code compatible with Python 3.8+
If you encounter any of these situations, stop and ask the developer:
- Unclear requirements or specifications
- Changes that would affect multiple subsystems
- Breaking changes to public APIs
- Security-sensitive code modifications
- Performance-critical code sections
- Run
ninja -C buildto build after C++ changes - Run
ctestto run tests - For Python: Run
ruff formatandruff check --fixbefore committing - Test Python API changes with pytest:
python -m pytest tests/test_*.py
When suggesting commit messages:
#12773 Python: Add API for creating valve templates
- Added RimcWellPath_addValveTemplate method
- Made RimValveTemplate scriptable
- Updated Python tests
Start with issue number, followed by a brief description, then bullet points for details.