Skip to content

Commit ff779c5

Browse files
authored
📝 Update templated files
1 parent 8693668 commit ff779c5

File tree

5 files changed

+270
-30
lines changed

5 files changed

+270
-30
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ List any dependencies that are required for this change.
66

77
Fixes #(issue) <!--- Replace `(issue)` with the issue number fixed by this pull request. If this PR does not fix an issue, please remove this line. -->
88

9-
## Checklist:
9+
## Checklist
1010

1111
<!---
1212
This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly.
@@ -20,3 +20,9 @@ This checklist serves as a reminder of a couple of things that ensure your pull
2020
- [ ] The changes follow the project's style guidelines and introduce no new warnings.
2121
- [ ] The changes are fully tested and pass the CI checks.
2222
- [ ] I have reviewed my own code changes.
23+
24+
**If PR contains AI-assisted content:**
25+
26+
- [ ] I have disclosed the use of AI tools in the PR description as per our [AI Usage Guidelines](https://github.com/munich-quantum-toolkit/qcec/blob/main/docs/ai_usage.md).
27+
- [ ] AI-assisted commits include an `Assisted-by: [Model Name] via [Tool Name]` footer.
28+
- [ ] I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

.github/renovate.json5

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
$schema: "https://docs.renovatebot.com/renovate-schema.json",
33
suppressNotifications: ["prEditedNotification"],
4-
minimumReleaseAge: '7 days',
4+
minimumReleaseAge: "7 days",
55
extends: [
66
"config:recommended",
77
":gitSignOff",
@@ -14,78 +14,86 @@
1414
":prConcurrentLimitNone",
1515
":prHourlyLimitNone",
1616
],
17-
enabledManagers: ["cargo", "github-actions", "npm", "pep621", "pre-commit"],
17+
enabledManagers: [
18+
"cargo",
19+
"github-actions",
20+
"npm",
21+
"pep621",
22+
"pip_requirements",
23+
"pre-commit",
24+
],
1825
lockFileMaintenance: {
1926
enabled: true,
20-
automerge: true
27+
automerge: true,
2128
},
2229
labels: ["dependencies"],
2330
schedule: ["every weekend"],
2431
packageRules: [
2532
{
2633
matchManagers: ["cargo"],
2734
addLabels: ["rust"],
28-
commitMessagePrefix: "⬆\uFE0F\uD83E\uDD80"
35+
commitMessagePrefix: "⬆\uFE0F\uD83E\uDD80",
2936
},
3037
{
3138
matchManagers: ["github-actions"],
3239
addLabels: ["github-actions"],
33-
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB"
40+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB",
3441
},
3542
{
3643
matchManagers: ["npm"],
3744
addLabels: ["javascript"],
38-
commitMessagePrefix: "⬆\uFE0F\uD83D\uDCDC"
45+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDCDC",
3946
},
4047
{
41-
matchManagers: ["pep621"],
48+
matchManagers: ["pep621", "pip_requirements"],
4249
addLabels: ["python"],
43-
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D"
50+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D",
4451
},
4552
{
4653
matchManagers: ["pre-commit"],
4754
addLabels: ["pre-commit"],
4855
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE9D",
49-
versioning: "pep440"
56+
versioning: "pep440",
5057
},
5158
{
5259
matchUpdateTypes: ["lockFileMaintenance"],
5360
commitMessagePrefix: "⬆\uFE0F\uD83D\uDD12\uFE0F",
5461
},
5562
{
56-
description: "Group and automerge all patch updates",
63+
description: "Group and auto-merge all patch updates",
5764
groupName: "patch updates",
5865
matchUpdateTypes: ["patch"],
5966
matchCurrentVersion: "!/^0\.0/",
6067
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE79",
61-
automerge: true
68+
automerge: true,
6269
},
6370
{
64-
description: "Group and automerge all minor updates of stable dependencies (except our own packages)",
71+
description: "Group and auto-merge minor updates of stable dependencies",
6572
groupName: "minor stable updates",
6673
matchUpdateTypes: ["minor"],
6774
matchCurrentVersion: "!/^0\./",
6875
matchPackageNames: [
6976
"!munich-quantum-toolkit/*",
7077
"!munich-quantum-software/*",
78+
"!nanobind",
7179
],
7280
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE79",
73-
automerge: true
81+
automerge: true,
7482
},
7583
{
76-
description: 'Disable minimum release age checks for our own GitHub Actions',
77-
matchManagers: ['github-actions'],
84+
description: "Disable minimum release age checks for our own GitHub Actions",
85+
matchManagers: ["github-actions"],
7886
matchPackageNames: [
79-
'munich-quantum-toolkit/*',
80-
'munich-quantum-software/*',
87+
"munich-quantum-toolkit/*",
88+
"munich-quantum-software/*",
8189
],
8290
minimumReleaseAge: null,
8391
},
8492
{
85-
description: 'Disable minimum release age checks for our own Python packages',
86-
matchDatasources: ['pypi'],
87-
matchPackageNames: ['mqt*'],
93+
description: "Disable minimum release age checks for our own Python packages",
94+
matchDatasources: ["pypi"],
95+
matchPackageNames: ["mqt*"],
8896
minimumReleaseAge: null,
89-
}
90-
]
97+
},
98+
],
9199
}

AGENTS.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!--- This file has been generated from an external template. Please do not modify it directly. -->
2+
<!--- Changes should be contributed to https://github.com/munich-quantum-toolkit/templates. -->
3+
4+
# MQT QCEC
5+
6+
## C++
7+
8+
- Configure: `cmake -S . -B build_cpp -DCMAKE_BUILD_TYPE=Release`
9+
- Build: `cmake --build build_cpp --config Release`
10+
- Test: `ctest --test-dir build_cpp -C Release`
11+
- Single test binary: `./build_cpp/test/path/to/binary`
12+
- For debug builds, replace `Release` with `Debug`.
13+
14+
## Python
15+
16+
- Set up build and test dependencies: `uv sync --inexact --only-group build --only-group test`
17+
- Install package without build isolation (fast rebuilds): `uv sync --inexact --no-dev --no-build-isolation-package mqt-qcec`
18+
- Run tests: `uv run --no-sync pytest`
19+
- Nox test shortcuts: `uvx nox -s tests`, `uvx nox -s minimums`
20+
- Python 3.14 variants: `uvx nox -s tests-3.14`, `uvx nox -s minimums-3.14`
21+
22+
## Documentation
23+
24+
- Sources: `docs/`
25+
- Build docs locally: `uvx nox --non-interactive -s docs`
26+
- Link check: `uvx nox -s docs -- -b linkcheck`
27+
28+
## Tech Stack
29+
30+
### General
31+
32+
- `prek` for pre-commit hooks
33+
34+
### C++
35+
36+
- Targets Linux (glibc 2.28+), macOS (11.0+), and Windows on x86_64 and arm64 architectures
37+
- C++20
38+
- CMake 3.24+
39+
- `FetchContent` for dependency management (configured in `cmake/ExternalDependencies.cmake`)
40+
- `clang-format` and `clang-tidy` for formatting/linting (see `.clang-format` and `.clang-tidy`)
41+
- GoogleTest for unit tests (located in `test/`)
42+
43+
### Python
44+
45+
- Python 3.10+
46+
- Stable ABI wheels for 3.12+; free-threading support for 3.14+
47+
- `scikit-build-core` as build backend
48+
- `nanobind` for bindings
49+
- `uv` for installation, packaging, and tooling
50+
- `ruff` for formatting/linting (configured in `pyproject.toml`)
51+
- `ty` for type checking
52+
- `pytest` for unit tests (located in `test/python/`)
53+
- `nox` for task orchestration (tests, linting, docs)
54+
55+
### Documentation
56+
57+
- `sphinx`
58+
- MyST (Markdown)
59+
- Furo theme
60+
- `breathe` for C++ API docs
61+
62+
## Development Guidelines
63+
64+
### General
65+
66+
- MUST run `uvx nox -s lint` after every batch of changes.
67+
This runs the full `prek` hook set from `.pre-commit-config.yaml` (including `ruff`, `typos`, `ty`, formatting, and metadata checks).
68+
All hooks must pass before submitting.
69+
- MUST add or update tests for every code change, even if not explicitly requested.
70+
- MUST follow existing code style by checking neighboring files for patterns.
71+
- MUST update `CHANGELOG.md` and `UPGRADING.md` when changes are user-facing, breaking, or otherwise noteworthy.
72+
- MUST include a commit footer attribution in the form `Assisted-by: [Model Name] via [Tool Name]` (example: `Assisted-by: Claude Sonnet 4.6 via GitHub Copilot`) if AI tools are used to prepare a commit.
73+
- NEVER modify files that start with "This file has been generated from an external template. Please do not modify it directly."
74+
These files are managed by [the MQT templates action](https://github.com/munich-quantum-toolkit/templates) and changes will be overwritten.
75+
- PREFER running targeted tests over the full test suite during development.
76+
77+
### C++
78+
79+
- MUST use Doxygen-style comments.
80+
- MUST use `#pragma once` for header guards.
81+
- MUST regenerate stubs via `uvx nox -s stubs` when files in `bindings/` are added or modified.
82+
- NEVER edit `.pyi` files in `python/mqt/qcec/` manually; they are auto-generated by nanobind stubgen.
83+
- PREFER C++20 STL features over custom implementations.
84+
85+
### Python
86+
87+
- MUST use Google-style docstrings
88+
- PREFER running a single Python version over the full test suite during development.
89+
- PREFER fixing reported warnings over suppressing them (e.g., with `# noqa` comments for ruff); only add ignore rules when necessary and document why.
90+
- PREFER fixing typing issues reported by `ty` before adding suppression comments (`# ty: ignore[code]`); suppressions are sometimes necessary for incompletely typed libraries (e.g., Qiskit).
91+
92+
## Self-Review Checklist
93+
94+
- Did `uvx nox -s lint` pass without errors?
95+
- Are all changes covered by at least one automated test?
96+
- Were Python stubs regenerated via `uvx nox -s stubs` if bindings were modified?
97+
- Are `CHANGELOG.md` and `UPGRADING.md` updated when changes are user-facing, breaking, or otherwise noteworthy?

docs/ai_usage.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!--- This file has been generated from an external template. Please do not modify it directly. -->
2+
<!--- Changes should be contributed to https://github.com/munich-quantum-toolkit/templates. -->
3+
4+
# AI Usage Guidelines
5+
6+
We acknowledge that AI tools (Large Language Models, code completion engines like GitHub Copilot, etc.) have become helpful assistants for many developers.
7+
We allow the use of these tools to assist with contributions, provided that their use is transparent, responsible, and that a **human remains in the loop** at all times.
8+
9+
This guide outlines our policy on AI-assisted contributions to ensure code quality, maintainability, and legal compliance.
10+
11+
## Core Principles
12+
13+
### 1. You are Responsible
14+
15+
**You are responsible for every line of code you submit.**
16+
17+
Regardless of whether code was written by you or generated by an AI tool, you are the author and are fully accountable for the contribution. You must:
18+
19+
- Fully understand the code you are submitting.
20+
- Be able to explain the reasoning behind the code and how it interacts with the rest of the codebase.
21+
- Verify that the code is correct, efficient, and follows our coding standards.
22+
23+
**Do not blindly copy-paste AI-generated code.** If you cannot explain it, do not submit it.
24+
25+
### 2. Human in the Loop
26+
27+
> **Autonomous contributions from AI agents are not allowed.**
28+
29+
When using AI tools, you must be the driver.
30+
The AI is the assistant.
31+
32+
- **Review:** You must read and review all AI-generated code or text before submitting it.
33+
- **Edit:** AI-generated code often requires significant editing to meet project standards and correctness.
34+
- **Verify:** Ensure the code actually solves the problem and doesn't introduce subtle bugs or security vulnerabilities.
35+
36+
### 3. Communication
37+
38+
**Do not use AI tools to generate issue descriptions, pull request comments, or code reviews.**
39+
40+
We value your personal input and communication.
41+
LLMs are notoriously unreliable and can produce "smart-sounding" but incorrect or irrelevant claims ("hallucinations").
42+
Phrase your communications in your own words.
43+
It is more important that we can follow your reasoning than that the text sounds "perfect".
44+
45+
### 4. Transparency and Disclosure
46+
47+
Transparency helps the community understand the role of these tools and develop best practices.
48+
49+
**We encourage you to disclose any AI assistance.**
50+
This helps us understand how these tools are being used and identify potential issues.
51+
You can disclose this information in the following ways:
52+
53+
- **Commit Messages**: Add a trailer to your commit message in the form `Assisted-by: [Model Name] via [Tool Name]` (example: `Assisted-by: Claude Sonnet 4.6 via GitHub Copilot`)
54+
- **PR Description**: Mention the tool (name and version) and how it was used in the PR description.
55+
56+
### 5. Licensing and Copyright
57+
58+
You are responsible for ensuring that your contribution does not violate any third-party licenses or copyrights.
59+
60+
- **Originality**: Your submission must be your own original work of authorship.
61+
- **Training Data**: Be aware that some AI tools may generate code that is substantially similar to their training data. You must ensure that you have the right to contribute the generated code under [our license](https://github.com/munich-quantum-toolkit/qcec/blob/main/LICENSE.md).
62+
63+
## Extractive Contributions
64+
65+
Processing pull requests and comments for MQT QCEC requires significant maintainer time and energy.
66+
Sending unreviewed AI output to open-source projects shifts the burden of verifying correctness from the contributor to the maintainer.
67+
We classify such contributions as "extractive" because they consume more community resources than they provide in value.
68+
69+
Our **golden rule** is that a contribution should be valuable enough to justify the review effort.
70+
Nadia Eghbal captures this concept in her book _[Working in Public](https://press.stripe.com/working-in-public)_:
71+
72+
> "When attention is being appropriated, producers need to weigh the costs and benefits of the transaction. To assess whether the appropriation of attention is net-positive, it's useful to distinguish between _extractive_ and _non-extractive_ contributions. Extractive contributions are those where the marginal cost of reviewing and merging that contribution is greater than the marginal benefit to the project's producers. In the case of a code contribution, it might be a pull request that's too complex or unwieldy to review, given the potential upside." — Nadia Eghbal
73+
74+
Before AI tools became widespread, open-source project maintainers would often review all changes sent to the project simply because submitting a pull request was a sign of interest from a potential long-term contributor.
75+
However, AI tools now allow the rapid generation of large volumes of code, which can easily overwhelm maintainers if submitted without careful review.
76+
Our policy exists to ensure that maintainer time is spent on high-quality interactions rather than debugging AI-generated code.
77+
78+
### Sustainable Open Source
79+
80+
The Munich Quantum Toolkit (MQT) is committed to remaining free, open-source, and permissively licensed.
81+
We want to build a welcoming community where aspiring quantum software engineers can learn and grow.
82+
Reviewing contributions is a key part of this mentorship.
83+
84+
However, to keep the project sustainable, we must prioritize non-extractive contributions.
85+
By thoroughly reviewing and understanding your AI-assisted code before submission, you ensure that your contribution is a net positive for the project.
86+
This helps us maintain a healthy ecosystem where both the software and its contributors can thrive.
87+
88+
## Prohibited Uses
89+
90+
- **"Good First Issues"**: Do not use AI tools to solve issues labeled as "good first issue". These are intended as learning opportunities for new contributors. Automating them defeats the purpose.
91+
- **Spam**: Do not use AI to generate low-quality or repetitive comments/reviews ("AI Slop").
92+
- **Unreviewed Code**: Submitting code that you, as a human, have not reviewed and tested yourself.
93+
94+
## Summary
95+
96+
We want to foster a welcoming community where developers can learn and grow. AI tools can be great for productivity, but they should not replace critical thinking or the learning process.
97+
If a maintainer judges that a contribution relies too heavily on unverified AI generation or lacks sufficient human understanding ("extractive contribution"), we may request that you revise it or close the PR.
98+
99+
---
100+
101+
Parts of this guide were inspired by or adapted from the contribution guidelines of
102+
103+
- [Astral],
104+
- [Qiskit],
105+
- [LLVM], including the sources therein, such as [Fedora Council Policy Proposal: Policy on AI-Assisted Contributions (fetched 2026-03-12)][fedora], which is licensed under the [Creative Commons Attribution 4.0 International License][cca].
106+
107+
with the help of Gemini 3 Pro (Preview). The links above serve as attribution.
108+
109+
[Astral]: https://github.com/astral-sh/uv/blob/c89a78ec085077f6344b0439ddf07fdad7336310/CONTRIBUTING.md
110+
[Qiskit]: https://github.com/Qiskit/qiskit/blob/cd8701690723d3d9602fac63fe0bd7ea618799be/CONTRIBUTING.md#use-of-ai-tools
111+
[LLVM]: https://github.com/llvm/llvm-project/blob/9b6391f9c439c9926e8587b7b940e9a1e98a7819/llvm/docs/AIToolPolicy.md
112+
[fedora]: https://communityblog.fedoraproject.org/council-policy-proposal-policy-on-ai-assisted-contributions/
113+
[cca]: https://creativecommons.org/licenses/by/4.0/

0 commit comments

Comments
 (0)