Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# AGENTS.md

Contribution rules and conventions for flixopt, for humans and AI agents alike.

## AI-assisted contributions

You're welcome to help author code, pull requests and issues. But the
conversation around a change — PR and issue descriptions, comments and review
discussions — is how maintainers and contributors understand each other, so it
must stay human and honest. Three rules:

1. **AI-generated content must be marked**, preferably with a GitHub note alert
at the top of the generated section. Put verbose additional context (logs, generated analysis, long
reproductions) in a collapsed `<details>` block so it doesn't drown the
discussion.

Don't silently mix hand-written and generated prose.

2. **The human writes their own intent.** If a pull request or issue is more
than a self-documenting bug report, the author must write — or at least
rewrite in their own words — their personal intent and motivation by hand,
with everything else placed below it. Don't submit an AI-drafted description
as your own; the maintainers want the human's voice, concise and to the
point.

```markdown
Thats why this is important for me (handwritten)

> [!NOTE]
> The following content was generated by AI.
Comment on lines +26 to +30

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the typo in the example.

Change “Thats” to “That’s” so contributors do not copy incorrect prose.

Proposed fix
-   Thats why this is important for me (handwritten)
+   That's why this is important for me (handwritten)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```markdown
Thats why this is important for me (handwritten)
> [!NOTE]
> The following content was generated by AI.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` around lines 26 - 30, In the handwritten explanation near the
AI-generated-content note, update the typo “Thats” to “That’s” while leaving the
surrounding Markdown and wording unchanged.


What was implemented and how

<details>
<summary>Full benchmark output</summary>

...verbose content here...

</details>
```

3. **Conversations are not held through an agent.** Posting bare information via
an agent — e.g. a log, a benchmark result, a reproduction — is fine as long
as it's marked (see rule 1). But discussion itself — replies, answers to
questions, review back-and-forth — must be written by the human. Don't let an
agent argue, agree or decide on your behalf.

## Development workflow

- Install the project with development dependencies into your environment:
`pip install -e ".[full,dev]"`.
- Set up the pre-commit hooks once with `pre-commit install`; they run the
quality checks automatically on every commit.
- Run the test suite with `pytest`, and lint and format with `ruff`
(`ruff check --fix .` and `ruff format .`).
- For the authoritative, detailed setup and commands (docs, markers, coverage)
see [`CONTRIBUTING.md`](CONTRIBUTING.md).

## Project conventions

- Branch off `main` for every change and open pull requests via the GitHub CLI
(`gh`). Name branches `feature/…`, `fix/…` or `docs/…`.
- Write tests for new features and bug fixes under `tests/` as `test_*.py`,
reusing the shared fixtures from `tests/conftest.py` (e.g. `solver_fixture`,
`highs_solver`) where useful. Run the tests after making changes and make sure
they pass.
- Aim for full test coverage on new code, and add the `@pytest.mark.slow`
decorator to tests that take more than a few seconds.

## Architecture in one paragraph

flixopt is an energy-system optimization library built on linopy and xarray:
components (flows, storages, converters, effects) are assembled into a
`FlowSystem`, translated into a linopy model, and solved with an interchangeable
solver (HiGHS by default, Gurobi optionally). Time series, periods and scenarios
are dimension-labelled xarray structures that broadcast and align by dimension,
and the model is only handed to the solver at solve time. Keep new features
consistent with this component-based, xarray-backed design.
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CLAUDE.md

This project's guidance for AI agents — contribution rules, development workflow
and project conventions — lives in [`AGENTS.md`](AGENTS.md), imported below so
it loads automatically. Read it before making changes, opening pull requests or
issues, or writing comments.

@AGENTS.md