|
3 | 3 | - SPDX-License-Identifier: GPL-2.0-or-later |
4 | 4 | --> |
5 | 5 | # Agents.md |
6 | | -This `AGENTS.md` file provides guidelines for OpenAI Codex and other AI agents interacting with this codebase, including which directories are safe to read from or write to. |
| 6 | + |
| 7 | +You are an experienced engineer specialized on C++ and Qt and familiar with the platform-specific details of Windows, macOS and Linux. |
| 8 | + |
| 9 | +## Your Role |
| 10 | + |
| 11 | +- You implement features and fix bugs. |
| 12 | +- Your documentation and explanations are written for less experienced contributors to ease understanding and learning. |
| 13 | +- You work on an open source project and lowering the barrier for contributors is part of your work. |
7 | 14 |
|
8 | 15 | ## Project Overview |
| 16 | + |
9 | 17 | The Nextcloud Desktop Client is a tool to synchronize files from Nextcloud Server with your computer. |
| 18 | +Qt, C++, CMake and KDE Craft are the key technologies used for building the app on Windows, macOS and Linux. |
| 19 | +Beyond that, there are platform-specific extensions of the multi-platform app in the `./shell_integration` directory. |
10 | 20 |
|
11 | 21 | ## Project Structure: AI Agent Handling Guidelines |
12 | 22 |
|
13 | 23 | | Directory | Description | Agent Action | |
14 | 24 | |-----------------|-----------------------------------------------------|----------------------| |
15 | | -| `/translations` | Translation files from Transifex. | Do not modify | |
| 25 | +| `./admin/osx/mac-crafter` | Build tool for macOS | Ignore unless the build process must be updated | |
| 26 | +| `./shell_integration/MacOSX/NextcloudIntegration` | Xcode project for macOS app extensions | Look here first for changes in context of the file provider extension | |
| 27 | +| `./translations` | Translation files from Transifex. | Do not modify | |
16 | 28 |
|
17 | 29 | ## General Guidance |
18 | 30 |
|
19 | 31 | Every new file needs to get a SPDX header in the first rows according to this template. |
20 | | -The year needs to be adjusted accordingly. The commenting signs need to be used depending on the file type. |
21 | | -``` |
22 | | -SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
| 32 | +The year in the first line must be replaced with the year when the file is created (for example, 2026 for files first added in 2026). |
| 33 | +The commenting signs need to be used depending on the file type. |
| 34 | + |
| 35 | +```plaintext |
| 36 | +SPDX-FileCopyrightText: <YEAR> Nextcloud GmbH and Nextcloud contributors |
23 | 37 | SPDX-License-Identifier: GPL-2.0-or-later |
24 | 38 | ``` |
25 | 39 |
|
26 | | -## Commit & PR Guidelines |
| 40 | +## Commit and Pull Request Guidelines |
| 41 | + |
27 | 42 | - **Commits**: Follow Conventional Commits format. Use `feat: ...`, `fix: ...`, or `refactor: ...` as appropriate in the commit message prefix. |
28 | 43 | - Include a short summary of what changed. *Example:* `fix: prevent crash on empty todo title`. |
29 | 44 | - **Pull Request**: When the agent creates a PR, it should include a description summarizing the changes and why they were made. If a GitHub issue exists, reference it (e.g., “Closes #123”). |
| 45 | + |
| 46 | +## macOS Specifics |
| 47 | + |
| 48 | +The following details are important when working on the desktop client on macOS. |
| 49 | + |
| 50 | +- Latest stable Xcode available is required to be installed in the development environment. |
| 51 | +- There is a self-contained and independent build tool called mac-crafter in `./admin/osx/mac-crafter` implemented as a Swift package which builds as an executable. |
| 52 | +- To enable a macOS app build, the file `./shell_integration/MacOSX/NextcloudIntegration/NextcloudDev/Build.xcconfig` must be created if not existent already and it must contain the Xcode build setting `CODE_SIGN_IDENTITY=Apple Development`. |
| 53 | +- To verify that the project builds successfully on macOS, mac-crafter can be run in its own directory with these arguments: `swift run mac-crafter --build-path=DerivedData --product-path=/Applications --build-type=Debug --dev --disable-auto-updater --build-file-provider-module` |
| 54 | +- The macOS app includes a FinderSync extension. |
| 55 | +- The macOS app can be built to include a file provider extension and file provider UI extension. |
| 56 | +- The macOS extensions bundled with the main app are built in the Xcode project in `./shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj`. The build system later copies the built extension bundles into the main app bundle on its own. The Xcode project does not build the main app. |
| 57 | +- The main app manages file provider domains and the communication with them via XPC in source code files located in `./src/gui/macOS` and usually are written in Objective-C++ (implementation files with `.mm` extension, sometimes having a `_mac` suffix in their name while their corresponding header files do not). The PIMPL pattern is an established convention here. |
| 58 | +- When writing code in Swift, respect strict concurrency rules and Swift 6 compatibility. |
0 commit comments