add-page
/add-page
Dodaje stronę, formularz lub częściową aktualizację do aplikacji Spring Boot: szablon, walidację, obsługę błędów i testy.
- Autor
- steamfield ↗
- Repozytorium
- stacks ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 08.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.11.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Dodaje stronę, formularz lub częściową aktualizację do aplikacji Spring Boot: szablon, walidację, obsługę błędów i testy.
Oryginalny opis (EN)
Add a page, a form or a partial update to this Spring Boot web app with its template, validation, error rows and tests. Use when the user asks for a new page, screen, form, field, list, htmx interaction or route.
Jak działa
SKILL.md bez nagłówków drugiego poziomu · 11 linii, 296 słów
Podgląd SKILL.md
---
name: add-page
description: Add a page, a form or a partial update to this Spring Boot web app with its template, validation, error rows and tests. Use when the user asks for a new page, screen, form, field, list, htmx interaction or route.
---
# Add a page
The notes pages are the worked example: `app.notes` (`Note`, `NoteForm`, `NoteStore`, `InMemoryNoteStore`), `app.web.NotesController`, `templates/notes/index.html` and `show.html`, `NotesControllerTest` and the browser flow in `WebIT`. Follow the same path; `docs/web.md` has the rules.
1. **Domain.** A new resource gets its own package beside `app.notes` with a `package-info.java` carrying `@NullMarked`: a record for the resource, a form bean with getters, setters and Bean Validation constraints whose `message` is the text the page shows, and a store interface with an in-memory `@Component`. It imports nothing from `app.web`, Spring MVC, Spring Security, Thymeleaf or servlets (`ArchitectureTest` fails otherwise). A new field on notes goes in `Note`, `NoteForm`, `InMemoryNoteStore.create` and the templates.
2. **Controller.** One `@Controller` per resource in `app.web`, constructor injection, returning view names. A form post takes `@Valid @ModelAttribute("<name>") <Form> form, BindingResult result` and the optional `HX-Request` header: errors re-render (fragment for htmx, whole page otherwise, status 200); success answers htmx with the fragment and a plain post with `redirect:` plus a flash attribute. A missing record throws `AppException(ErrorCode.NOT_FOUND, ...)`; a status the table lacks is a new `ErrorCode` row and a row in `docs/web.md`.
3. **Template.** `templates/<resource>/<page>.html`, replacing its `<html>` with `~{layout :: page(~{::title}, ~{::main})}`. Forms use `th:action` and `method="post"` (the CSRF field comes with them), `th:object`, `th:field` and `th:errors`; a partial update adds `th:hx-post`, `hx-target` and `hx-swap` on the form and a `th:fragment` around the swapped part.
4. **Test.** In a `@WebMvcTest(<Controller>.class)` test importing the in-memory store and `SecurityConfig`, render every new template and read it with jsoup: the GET, a valid and an invalid post with and without `HX-Request` (posts use `.with(csrf())`), a refused post without the token, and any miss. Add the browser flow to an `*IT` with HtmlUnit when the page has a form.
5. Run `make fmt compile test test-integration`.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · steamfield/stacks | 96 | Apache-2.0 |
| TurbineKit/turbinekit | 100 | MIT |
| steamfield/stacks | 86 | Apache-2.0 |
| steamfield/stacks | 86 | Apache-2.0 |
| steamfield/stacks | 86 | Apache-2.0 |
Migawka bazy z 13.11.2026 · wersja paczki b517e2b6fa3a (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 96add-endpoint
Dodaje endpoint HTTP lub nowy zasób do API w Spring Boot, z magazynem danych, obsługą błędów i testami. - 100spring-boot-testing
Pisze testy jednostkowe, integracyjne i slice dla aplikacji Spring Boot 3. - 100new-screen
Generuje nowy ekran (lista, szczegóły, formularz, raport lub ustawienia) w aplikacji HTMX, PHP i Bootstrap 5.3, zgodny z systemem projektowym i zasadami mobilnymi. - 100spring-boot-migration
Prowadzi aktualizację aplikacji ze Spring Boot 3.5 do Boot 4 i diagnozuje problemy po migracji. - 100303-frameworks-spring-boot-validation
Projektuje i sprawdza walidację w Spring Boot: Bean Validation na DTO, grupy ograniczeń, własne ograniczenia i spójne błędy. - 90spring-boot
Pomaga zmieniać aplikacje Java oparte na Spring Boot: MVC, Spring Security, Spring Data i konfigurację zarządzaną przez Spring.