Skip to content

Commit 7069c07

Browse files
Copilotafranken
andcommitted
Add lint skill and update existing skills to reference it
Co-authored-by: afranken <763000+afranken@users.noreply.github.com>
1 parent 1e6d94d commit 7069c07

File tree

6 files changed

+64
-8
lines changed

6 files changed

+64
-8
lines changed

.claude/skills/implement/SKILL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ A complete feature implementation requires these skills — run them in sequence
1313

1414
1. **`refactor` skill** — if nearby existing code, tests, or configuration would benefit from cleanup *before* adding new code, do it first rather than working around it
1515
2. **`implement` skill** (this skill) — write the production code
16-
3. **`test` skill** — add/update unit and integration tests (`*Test.kt`, `*IT.kt`)
17-
4. **`document` skill** — update `CHANGELOG.md`, `README.md`, and `AGENTS.md` where applicable
16+
3. **`lint` skill** — fix formatting and verify style gates pass
17+
4. **`test` skill** — add/update unit and integration tests (`*Test.kt`, `*IT.kt`)
18+
5. **`document` skill** — update `CHANGELOG.md`, `README.md`, and `AGENTS.md` where applicable
1819

1920
> **Prefer refactoring over workarounds**: if you find yourself adding complexity to work around existing code, stop and invoke the `refactor` skill to clean it up first.
2021
@@ -32,12 +33,12 @@ Follow **DTO → Store → Service → Controller** (see AGENTS.md Architecture)
3233
- [ ] Read root + module `AGENTS.md` (required before any other step)
3334
- [ ] Identify the S3 API operation ([AWS docs](https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html))
3435
- [ ] Review existing similar implementations
35-
- [ ] Run `make format` then `make install`
36+
- [ ] Invoke the **`lint` skill** to fix formatting and verify style gates pass
3637
- [ ] Invoke the **`test` skill** to add/update unit and integration tests
3738
- [ ] Invoke the **`document` skill** to update `CHANGELOG.md`, `README.md`, and `AGENTS.md`
3839

3940
## Troubleshooting
4041

41-
- **Build fails**: Check Java 25, run `make format`
42+
- **Build fails**: Check Java 25, invoke the **`lint` skill**
4243
- **Tests fail**: Ensure XML matches AWS API exactly — run integration tests
4344
- **Docker fails**: Try `make skip-docker` to isolate

.claude/skills/lint/SKILL.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: lint
3+
description: Fix code style issues and ensure linting passes. Use when asked to fix lint errors, formatting issues, or when ktlint or Checkstyle violations are reported.
4+
---
5+
6+
# Lint Skill — S3Mock
7+
8+
Read `AGENTS.md` (root + relevant module) before making changes.
9+
10+
## Linters
11+
12+
S3Mock uses two linting tools that run as required CI gates:
13+
14+
| Tool | Target | Config | Auto-fix? |
15+
|------|--------|--------|-----------|
16+
| **ktlint** | Kotlin source files | `.editorconfig` | Yes — `make format` |
17+
| **Checkstyle** | Java source + XML files | `etc/checkstyle.xml` | No — fix manually |
18+
19+
Both run automatically as part of the full build (`make install`).
20+
21+
## Workflow
22+
23+
1. **Run `make format`** — auto-formats all Kotlin files with ktlint. Fixes the vast majority of Kotlin style issues.
24+
2. **Run `./mvnw checkstyle:check`** — reports Checkstyle violations for Java and XML files. Fix violations manually.
25+
3. **Re-run `make install`** — confirm all linting gates pass before submitting.
26+
27+
## ktlint (Kotlin)
28+
29+
`make format` auto-fixes most issues. Common violations:
30+
- Wrong indentation (4 spaces for Kotlin)
31+
- Unused or wildcard imports
32+
- Missing trailing newline
33+
- Line length (max 120 characters — see `.editorconfig`)
34+
35+
To check without modifying files: `./mvnw ktlint:check`
36+
37+
## Checkstyle (Java / XML)
38+
39+
Violations must be fixed manually. Common violations (config in `etc/checkstyle.xml`):
40+
- Wrong indentation (2 spaces for Java)
41+
- Line length (max 120 characters)
42+
- Import ordering
43+
- Missing or malformed Javadoc
44+
45+
See **[docs/JAVA.md](../../../docs/JAVA.md)** for Java style conventions.
46+
47+
## Checklist
48+
49+
- [ ] Read root + module `AGENTS.md` for the files being changed
50+
- [ ] Run `make format` to auto-fix Kotlin style
51+
- [ ] Run `./mvnw checkstyle:check` to check Java/XML style
52+
- [ ] Fix any remaining violations manually (see `docs/JAVA.md` for Java conventions, `docs/KOTLIN.md` for Kotlin)
53+
- [ ] Re-run `make install` to confirm all CI gates pass

.claude/skills/refactor/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Document what, why, and gotchas. Link to AWS API docs where relevant. See **[doc
3434
## Checklist
3535

3636
- [ ] Verify no behavior changes — run tests
37-
- [ ] Run `make format`
37+
- [ ] Invoke the **`lint` skill** to fix formatting and verify style gates pass
3838
- [ ] Ensure comments explain *why*, not *what*
3939
- [ ] Add KDoc for all public APIs
4040
- [ ] Use self-documenting names

.claude/skills/review/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ For each finding, reference the specific AGENTS.md rule or AWS API doc where app
5757

5858
- [ ] Read root + relevant module `AGENTS.md`
5959
- [ ] Check all categories above in priority order
60-
- [ ] Verify CI gates will pass (ktlint, checkstyle, tests, Docker build)
60+
- [ ] Verify CI gates will pass (ktlint, checkstyle, tests, Docker build) — suggest invoking the **`lint` skill** if style issues are found
6161
- [ ] Confirm `CHANGELOG.md` is updated if needed
6262
- [ ] Provide actionable feedback with specific file/line references

.claude/skills/test/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Read **[docs/TESTING.md](../../../docs/TESTING.md)**, **[docs/KOTLIN.md](../../.
2424
- [ ] Cover both success and failure cases
2525
- [ ] Keep tests independent (no shared state, UUID bucket names)
2626
- [ ] Use specific assertions
27-
- [ ] Run `make format`
27+
- [ ] Invoke the **`lint` skill** to fix formatting and verify style gates pass

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ make install # Full build
104104
make skip-docker # Skip Docker
105105
make test # Unit tests only
106106
make integration-tests # Run integration tests
107-
make format # Format Kotlin code
107+
make format # Format Kotlin code (ktlint)
108108
```
109109

110+
Use the **`lint` skill** to fix formatting and verify style gates (ktlint + Checkstyle) pass.
111+
110112
## CI/CD Pipeline
111113

112114
All PRs and pushes are validated by the `maven-ci-and-prb.yml` GitHub Actions workflow.

0 commit comments

Comments
 (0)