Skip to content

Commit 295953e

Browse files
committed
Updates all, skills and Readme.md
1 parent 0db570f commit 295953e

25 files changed

Lines changed: 867 additions & 149 deletions

.claude/skills/angular/SKILL.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: angular
3+
description: Conventions for Angular applications
4+
---
5+
6+
## 1. In all setup files, the target should be esnext
7+
8+
### Example in `tsconfig.json`:
9+
10+
Replace:
11+
12+
```json
13+
{
14+
"compilerOptions": {
15+
"target": "es5",
16+
"lib": ["es5", "dom"],
17+
"types": ["cypress", "node"]
18+
},
19+
"include": ["**/*.ts"]
20+
}
21+
```
22+
23+
with
24+
25+
```json
26+
{
27+
"compilerOptions": {
28+
"target": "esnext",
29+
"lib": ["esnext", "dom"],
30+
"types": ["cypress", "node"]
31+
},
32+
"include": ["**/*.ts"]
33+
}
34+
```
35+
36+
## 2. Make sure that the code strictly follows all angular standards
37+
38+
Please find the list of alle angular standards on the following page: https://angular.dev/style-guide.
39+
It is of the utmost importance that all configuration, HTML, TypeScript, JavaScript, and everything that consists of an angular project, to follow these standards.
40+
Changes should be made accordingly.
41+
Modernize the build tooling too
42+
43+
## 3. Make sure that Angular projects are completely reactive with the usage of signals.
44+
45+
With the inception of signals, reactive programming for the front-end has been made easy. Make sure that, whenever possible, that the code uses signals instead of the typical subscriber model.
46+
Find information on how to do this with good practices over at: https://angular.dev/guide/signals
47+
Refactor subscribe() to resource()/rxResource()
48+
49+
## 4. Make sure to use new methods for deprecated classes
50+
51+
The `RouterTestingModule` and the `HttpClientTestingModule` have been deprecated. Can you make sure to replace the TypeScript declarations accordingly?
52+
53+
54+
From `RouterTestingModule`.
55+
56+
```text
57+
Use provideRouter or RouterModule/RouterModule.forRoot instead. This module was previously used to provide a helpful collection of test fakes, most notably those for Location and LocationStrategy. These are generally not required anymore, as MockPlatformLocation is provided in TestBed by default. However, you can use them directly with provideLocationMocks.
58+
```
59+
60+
From `HttpClientTestingModule`.
61+
62+
```text
63+
Add provideHttpClientTesting() to your providers instead.
64+
```
65+
66+
Use both definitions to make the changes wherever possible.
67+
68+
## 6. Update the build system, if necessary
69+
70+
Follow the documentation on https://angular.dev/tools/cli/build-system-migration to make a successful build migration
71+
72+
## 7. Checklist
73+
74+
[] All targets in `tsconfig.json` files should be set to `esnext`
75+
[] No target should remain with old target compiler option versions
File renamed without changes.

.claude/skills/docker/SKILL.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: docker
3+
description: Conventions for docker
4+
---
5+
6+
## 1. Update eclipse temurin image usages to the latest java version.
7+
8+
### Example 1:
9+
10+
If the latest java version is `25`and there is an image being used like:
11+
12+
```dockerfile
13+
FROM eclipse-temurin:21-alpine
14+
```
15+
16+
Then it should be updated to:
17+
18+
```dockerfile
19+
FROM eclipse-temurin:25-alpine
20+
```
21+
22+
### Example 2:
23+
24+
This example is only valid for CircleCI configuration files located in `.circleci/config.yml`.
25+
Replace this:
26+
27+
```yml
28+
docker:
29+
- image: eclipse-temurin:21-alpine
30+
```
31+
32+
with:
33+
34+
```yml
35+
docker:
36+
- image: eclipse-temurin:25-alpine
37+
```
38+
39+
## 2. Do not use `docker-compose`
40+
41+
The usage of `docker-compose` has been deprecated and in some cases it doesn't work anymore.
42+
Please replace `docker-compose` with `docker compose` everywhere, namely in `bash` scripts, `Makefile` and `Makefile.mk` files, `.md` files, all kinds of Markdown files, and other files you may find it.
43+
Leave all binary files untouched.
44+
45+
## 3. Checklist
46+
47+
[] No Dockerfile should use older Java version images
48+
[] No Testcontainers code should use older Java version images

.claude/skills/java/SKILL.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: java language patterns
3+
description: Conventions for using Java
4+
---
5+
6+
## 1. Use modern java conventions in the code and make necessary changes
7+
8+
Make sure to make the code as strict as possible to follow code conventions.
9+
Please use these sources:
10+
11+
1. https://www.oracle.com/java/technologies/javase/codeconventions-programmingpractices.html
12+
2. https://blog.jetbrains.com/idea/2024/02/java-best-practices/
13+
3. https://google.github.io/styleguide/javaguide.html

.claude/skills/jee/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Java Enterprise Edition Frameworks
3+
description: Conventions for using in all JEE frameworks. These are common standards for CDI
4+
---
5+
6+
## 1. Correct annotation usage for use-site targets
7+
8+
Constructor params annotated with `@Claim` should be injected with use-site target `param` as `@param:Claim`

.claude/skills/jvm/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: java language patterns
3+
description: Conventions for using in all JVM languages
4+
---
5+
6+
## 1. Remove all unused imports
7+
8+
If you find unused imports, please remove them. This is a good practice to keep the code clean and maintainable.

.claude/skills/kotlin/SKILL.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,117 @@ It makes no sense to use this operator when the value is guaranteed to be non-nu
1515
## 3. Avoid using `var` when possible
1616

1717
In Kotlin, it is recommended to use `val` instead of `var` whenever possible. This helps to make the code more readable and maintainable, as it makes it clear that the value of a variable is not expected to change.
18+
19+
## 4. Use Duration overload when possible
20+
21+
### Example 1
22+
23+
When using the `delay` function, it is recommended to use the overload that accepts a `Duration` parameter instead of a `Long` parameter. This makes the code more readable and easier to understand, as it clearly indicates the intended duration of the delay.
24+
25+
replace this:
26+
27+
```kotlin
28+
delay(100)
29+
```
30+
31+
with this:
32+
33+
```kotlin
34+
delay(100.milliseconds)
35+
```
36+
37+
Add import: `import kotlin.time.Duration.Companion.milliseconds`
38+
39+
## 5. Remove all code signatures
40+
41+
Code does not need to be signed. The code signature used to have some value, but in current times, the commit already has a signature.
42+
Old code may contain signatures that look like this:
43+
44+
```kotlin
45+
/**
46+
* Created by joao on 28-4-16.
47+
*/
48+
```
49+
50+
They should all be removed, as they are not needed and add no value to the code.
51+
52+
## 6. When using Kotlin code make sure to use the kotlin extensions for parsing
53+
54+
### Example 1
55+
56+
When finding this:
57+
58+
```kotlin
59+
.getForEntity("/tulips", String::class.java)
60+
```
61+
replace with:
62+
```kotlin
63+
.getForEntity<String>("/tulips")
64+
```
65+
66+
## 7. Update the usage of `CSVParser` which is now deprecated
67+
68+
This skill refers to the `CSVParser` from `org.apache.commons.csv.*`
69+
70+
### Example 1
71+
72+
Replace
73+
```kotlin
74+
val csvParser = CSVParser(reader, CSV_HEADER)
75+
```
76+
77+
with
78+
79+
```kotlin
80+
val csvParser = CSVParser.builder()
81+
.setReader(reader)
82+
.setFormat(CSV_HEADER).get()
83+
```
84+
85+
### Example 2
86+
87+
Replace this
88+
89+
```kotlin
90+
private val CSV_HEADER = DEFAULT
91+
.withHeader(
92+
"id",
93+
"description",
94+
"year",
95+
"value",
96+
"currency",
97+
"type",
98+
"diameterMM",
99+
"internalDiameterMM",
100+
"heightMM",
101+
"widthMM"
102+
)
103+
```
104+
105+
with:
106+
107+
```kotlin
108+
private val CSV_HEADER = CSVFormat.DEFAULT.builder()
109+
.setHeader(
110+
"id",
111+
"description",
112+
"year",
113+
"value",
114+
"currency",
115+
"type",
116+
"diameterMM",
117+
"internalDiameterMM",
118+
"heightMM",
119+
"widthMM"
120+
).get()
121+
```
122+
123+
## 8. Checklist
124+
125+
[ ] The code does not use the `!!` operator.
126+
[ ] The code does not use the safe call operator (`?.`) when the value is guaranteed to be non-null.
127+
[ ] The code uses `val` instead of `var` whenever possible.
128+
[ ] The code uses the `Duration` overload when using the `delay` function.
129+
[ ] The code does not contain any code signatures.
130+
[ ] The code uses the kotlin extensions for parsing when using Kotlin code.
131+
[ ] The code should not use the `CSVParser` constructuro directly

.claude/skills/maven/SKILL.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Maven standards
3+
description: Conventions to use in Maven files, mostly the `pom.xml` files
4+
---
5+
6+
## 1. Make sure dependencies that are supposed to be of scope `test`, remain test dependencies
7+
8+
In most cases, test dependencies should be of scope `test`. If you find any dependencies that are supposed to be of scope `test` but are not, you should add the `<scope>test</scope>` element to them. This ensures that the dependencies are only included in the test classpath and not in the production classpath.
9+
For these cases, the following are the dependencies that supposed to be of scope `test`:
10+
11+
```xml
12+
<dependency>
13+
<groupId>com.fasterxml.jackson.dataformat</groupId>
14+
<artifactId>jackson-dataformat-xml</artifactId>
15+
</dependency>
16+
<dependency>
17+
<groupId>io.mockk</groupId>
18+
<artifactId>mockk-jvm</artifactId>
19+
<scope>test</scope>
20+
</dependency>
21+
<dependency>
22+
<groupId>com.ninja-squad</groupId>
23+
<artifactId>springmockk</artifactId>
24+
<scope>test</scope>
25+
</dependency>
26+
<dependency>
27+
<groupId>io.kotest</groupId>
28+
<artifactId>kotest-assertions-core-jvm</artifactId>
29+
<scope>test</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-test</artifactId>
34+
<scope>test</scope>
35+
</dependency>
36+
```
37+
38+
In some cases, the test dependencies may be used for production code in test modules. Those cases are not always easy to determine.
39+
However, if you see that the module, where these dependencies are found to be used, is being used as a test dependency of other modules in the same project, then leave the dependency as is.
40+
41+
## 2. Excessive declarations of the maven compiler
42+
43+
As a common practice, the `maven-compiler-plugin` was declared in the parent module, but also in many submodules.
44+
The repetition is unnecessary, but may still prevail.
45+
Please remove all `maven-compiler-plugin` declarations from all modules and submodules.
46+
Keep only one at the top level.
47+
All the other `maven-compiler-plugin` declarations can be removed
48+
49+
## 3. Excessive declarations of maven surefire and maven failsafe
50+
51+
As a common practice, the `maven-surefire-plugin` and the `maven-failsafe-plugin` were declared in the parent module, but also in many submodules.
52+
Please remove all `maven-surefire-plugin` and the `maven-failsafe-plugin` declarations from all modules and submodules.
53+
Keep them only at the top level.
54+
All the other `maven-surefire-plugin` and the `maven-failsafe-plugin` declarations can be removed

.claude/skills/parallel/SKILL.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,59 @@ junit.jupiter.execution.parallel.mode.classes.default = concurrent
2020
Only add this file, and if the file doesn't exist. Do not override existing files.
2121

2222
Check if tests run successfully for every module where you add this file. If it fails, then remove the file.
23+
24+
In case they fail, the following should be tried
25+
26+
1. Add `@TestMethodOrder(OrderAnnotation::class)` to the test class
27+
2. Add `@Execution(SAME_THREAD)` to the test methods that are failing
28+
3. Add `@Order(1)` to the test methods that are failing. The number should be sequential for all failing tests
29+
30+
## Example 1
31+
32+
```kotlin
33+
34+
@SpringBootTest(webEnvironment = RANDOM_PORT)
35+
@TestMethodOrder(OrderAnnotation::class)
36+
class NarwhalsShopControllerTest @Autowired constructor(
37+
private val narwhalsWebShopDao: NarwhalsWebShopDao,
38+
private val testRestTemplate: TestRestTemplate,
39+
) {
40+
val xmlHeaders = HttpHeaders().apply {
41+
add("Content-Type", APPLICATION_XML_VALUE)
42+
}
43+
val jsonHeaders = HttpHeaders().apply {
44+
add("Content-Type", APPLICATION_JSON_VALUE)
45+
}
46+
47+
@Test
48+
fun `should load narwhals`() {
49+
}
50+
51+
@Test
52+
fun `should make full purchase when stocks are available`() {
53+
}
54+
55+
@Test
56+
@Execution(SAME_THREAD)
57+
fun `should make multiple purchase request but only one succeeds when stocks are available`(): Unit = runBlocking {
58+
}
59+
60+
@Test
61+
@Execution(SAME_THREAD)
62+
fun `should make partial purchase when stocks are not available`() {
63+
}
64+
65+
@Test
66+
fun `should make no purchase when stocks are not available and show predictions`() {
67+
}
68+
69+
@Test
70+
@Execution(SAME_THREAD)
71+
@Order(1)
72+
fun `should return not found failed when nothing is available`() {
73+
}
74+
75+
}
76+
```
77+
78+
If it still fails. Only here revert the changes made to the test class and remove the `junit-platform.properties` file.

0 commit comments

Comments
 (0)