Skip to content
Merged
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
58 changes: 37 additions & 21 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,58 @@
## Description
A simple Java client for ACINQ's [phoenixd REST API](https://phoenix.acinq.co/server/api). It wraps the HTTP endpoints and exposes typed requests and responses.

## Project
- Maintain the versions in the configuration section of the parent pom.xml file.

## Coding
- When writing code, follow the "Clean Code" principles:
- [Clean Code](https://dev.398ja.xyz/books/Clean_Architecture.pdf)
- Relevant chapters: 2, 3, 4, 7, 10, 17
- [Clean Architecture](https://dev.398ja.xyz/books/Clean_Code.pdf)
- Relevant chapters: All chapters in part III and IV, 7-14.
- [Design Patterns](https://github.com/iluwatar/java-design-patterns)
- Follow design patterns as described in the book, whenever possible.
- When commiting code, follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
- When adding new features, ensure they are compliant with the Cashu specification (NUTs) provided above.

## Documentation

- When generating documentation:
- Follow the Diátaxis framework and classify each document as a tutorial, how-to guide, reference, or explanation.
- Place new Markdown files under `docs/<section>` matching the chosen category.
- Start each document with a top-level `#` heading and a short introduction that states the purpose.
- Link the document from `docs/README.md` in the corresponding section.
- Use relative links to reference other documents and keep code snippets minimal and tested.
- Consult the following resources on Diátaxis for guidance:
- https://github.blog/developer-skills/documentation-done-right-a-developers-guide/
- https://diataxis.fr/
- https://diataxis.fr/start-here/
- https://diataxis.fr/how-to-use-diataxis/
- https://diataxis.fr/tutorials/
- https://diataxis.fr/how-to-guides/
- https://diataxis.fr/tutorials-how-to/
- https://diataxis.fr/quality/
- https://diataxis.fr/complex-hierarchies/
- https://diataxis.fr/compass/

## Testing

- Always run `mvn -q verify` from the repository root before committing your changes.
- Include the command's output in the PR description.
- If tests fail due to dependency or network issues, mention this in the PR.
- Update the `README.md` file if you add or modify features.
- Update the documentation files if you add or modify features.
- Update the `pom.xml` file for new modules or dependencies, ensuring compatibility with Java 21.
- Verify new Dockerfiles or `docker-compose.yml` files by running `docker-compose build`.
- Document new REST endpoints in the API documentation and ensure they are tested.
- Add unit tests for new functionality, covering edge cases.
- Add unit tests for new functionality, covering edge cases. Follow "Clean Code" principles on unit tests, as described in the "Clean Code" book (Chapter 9).
- Ensure modifications to existing code do not break functionality and pass all tests.
- Add integration tests for new features to verify end-to-end functionality.
- Ensure new dependencies or configurations do not introduce security vulnerabilities.
- Maintain the versions in the configuration section of the pom.xml files.
- Add a comment on top of every test method to describe the test in plain English.

## Pull Requests

- Always follow the repository's PR submission guidelines and use the PR template located at `.github/pull_request_template.md`.
- Summarize the changes made and describe how they were tested.
- Include any limitations or known issues in the description.
- Add a "Network Access" section summarizing blocked domains if network requests were denied.
- Ensure all new features, modules, or dependencies are properly documented in the `README.md` file.
- Always follow the repository's PR submission guidelines and use the PR template located at `.github/pull_request_template.md`.
- When implementing features, consult the API specifications:

## PR Quality Gate

- Always follow the PR submission guidelines and use the [PR template](.github/pull_request_template.md) when creating pull requests.
- PR summaries must reference modified files with file path citations (e.g. `F:path/to/file.java†L1-L2`).
- PR titles and commit messages must follow the `type: description` naming format.
- Allowed types: feat, fix, docs, refactor, test, chore, ci, build, perf, style.
- The description should be a concise verb + object phrase (e.g., `refactor: Refactor auth middleware to async`).
- Include a Testing section listing the commands run. Prefix each command with ✅, ⚠️, or ❌ and cite relevant terminal output.
- If network requests fail, add a Network Access section noting blocked domains.
- When TODOs or placeholders remain, include a Notes section.
- Review AI-generated changes with developer expertise, ensuring you understand why the code works and that it remains resilient, scalable, and secure.
- Use `rg` for search instead of `ls -R` or `grep -R`.
- Ensure all new features are compliant with the API specification provided above.
- Ensure all new features are compliant with the Cashu specification (NUTs) provided above.
9 changes: 7 additions & 2 deletions phoenixd-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.11.0</version>
<version>${commons.configuration2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<version>${commons.beanutils.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion phoenixd-mock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.4.1</version>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>gcr.io/distroless/java21</image>
Expand Down
6 changes: 3 additions & 3 deletions phoenixd-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<version>${commons.beanutils.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand All @@ -52,7 +52,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.12.0</version>
<version>${mockwebserver.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -62,7 +62,7 @@
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.4.1</version>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>gcr.io/distroless/java21</image>
Expand Down
2 changes: 1 addition & 1 deletion phoenixd-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version> <!-- Use the latest stable version -->
<version>${commons.beanutils.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@

<fasterxml.jackson.version>2.18.3</fasterxml.jackson.version>

<!-- Apache Commons Versions -->
<commons.configuration2.version>2.11.0</commons.configuration2.version>
<commons.beanutils.version>1.9.4</commons.beanutils.version>
<commons.lang3.version>3.14.0</commons.lang3.version>

<!-- Test Dependency Versions (module-specific) -->
<mockwebserver.version>4.12.0</mockwebserver.version>

<!-- Test Dependency Versions -->
<junit.version>5.9.1</junit.version>
<assertj.version>3.23.1</assertj.version>
Expand All @@ -35,6 +43,7 @@
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<jib-maven-plugin.version>3.4.1</jib-maven-plugin.version>
</properties>

<dependencyManagement>
Expand Down
Loading