Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 3.52 KB

File metadata and controls

60 lines (43 loc) · 3.52 KB

AGENTS.md

You are an experienced software engineer working on native apps for iOS and macOS which are written in Swift.

Repository Structure

  • Sources/ contains the Swift source code per target.
  • Tests/ contains the automated tests per target.

The NextcloudContainerManager library target groups its source files into folders by concern (one level deep):

  • Manager/ holds the NextcloudContainerManager enum and its feature extensions (+AppManagement, +UserManagement, +CommandExecution, +Provisioning, +HighPerformanceBackend), one feature group per file.
  • PublicTypes/ holds the remaining public types (NextcloudConfiguration, NextcloudContainer, NextcloudContainerManagerError).
  • DockerClient/ holds the Docker Engine client and its supporting utilities (DockerEngineClient, DockerClientError, findFreePort).
  • Requests/ and Responses/ hold the Docker Engine and Nextcloud request and response body models.
  • Documentation.docc/ holds the DocC catalog.

Code Style

  • This project is set up to use SwiftFormat.
  • The Package.swift manifest declares the Swift tool chain version to use which is relevant for code style and language features available.
  • Every type declarations must reside in its own source code file.
  • Every type declaration must have a documentation comment.
  • Every property declaration must have a documentation comment.
  • Documentation comments should also explain how the documented type or property relates to other symbols in the project.
  • Documentation comments should have one empty line at their top and their bottom each.
  • Documentation comments must not wrap at a fixed column count but when a sentence is finished. Line lengths do not matter in documentation comments. A full sentence should always be written into a single line.
  • Documentation comments must be separated by a blank line to any foregoing expression in the same block or scope.
  • Never wrap arguments in func declarations or calls.
  • Leave an empty line between blocks and other statements in the same scope.
  • Always run swift package plugin --allow-writing-to-package-directory swiftformat --verbose --cache ignore after applying changes.

Guidelines

  • This Swift package abstracts and simplifies the interaction with the Docker Engine API.
  • You do not write automated tests for this.
  • Every type is declared in its dedicated source code file.
  • You write a documentation block comment for every type and every property.
  • You always remove the source code file headers generated by Xcode.
  • You always run swiftformat after implementing changes.
  • Always check for the package to still successfully build by running swift build after implementing changes and try to fix compiler errors automatically.

Testing Instructions

  • After every implementation but before comitting, verify the Nextcloud container is still deployed successfully with the swift run Runner command. If there are errors, verify they originate from the package code and try to resolve them automatically.

Documentation Instructions

  • Always check existing documentation comments for validity and update, if necessary.
  • Whenever the files and folders within the repository change, update the "Repository Structure" section of this document accordingly.
  • Always check the ./README.md for validity and update, if necessary.
  • Semantic versioning is used. Report on the impact in this regard after applying changes.

Commit Instructions

  • Never commit automatically.

Pull Request Instructions

  • Never open a pull request automatically.