Przejdź do treści
Biblioteka skilli
Programowanie · Planowanie

clean-architecture-react

/clean-architecture-react

Pomaga układać i rozbudowywać front-end w React i TypeScript: do którego folderu należy ekran, komponent, hook, przypadek użycia lub wywołanie API, kto może importować od kogo i jak komponent dociera do API.

Repozytorium
skraft-plugin ↗
Licencja
GPL-3.0
Ostatnia zmiana repozytorium
11.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 11.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

GPL-3.0, otwarta.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: eslint/clean-architecture.js

Co robi i kiedy

Pomaga układać i rozbudowywać front-end w React i TypeScript: do którego folderu należy ekran, komponent, hook, przypadek użycia lub wywołanie API, kto może importować od kogo i jak komponent dociera do API.

Oryginalny opis (EN)

Use when laying out or extending a React / TypeScript front end — which folder a screen, component, hook, use case or API call belongs in, which folder may import which, and how a component reaches the API. Not for build, dependency, environment-variable or tooling configuration.

Jak działa

  1. One folder per feature, split into layers
  2. Components
  3. Guard
Sekcje z nagłówków SKILL.md, w oryginale · 42 linii, 386 słów
Podgląd SKILL.md
---
name: clean-architecture-react
description: Use when laying out or extending a React / TypeScript front end — which folder a screen, component, hook, use case or API call belongs in, which folder may import which, and how a component reaches the API. Not for build, dependency, environment-variable or tooling configuration.
---

# Clean Architecture — React

Business rules live in the backend: the front end has no domain layer. It sends the request, shows the answer, and shows the refusal.

## One folder per feature, split into layers

| Folder | Holds | May import |
|---|---|---|
| `src/<feature>/application/` | use cases (one class per action), `*ViewModel` types, the `*Gateway` interfaces they call | its own `application/` |
| `src/<feature>/infrastructure/` | the gateways: `fetch`, storage | its own `application/`, `src/shared/` |
| `src/<feature>/ui/` | components and hooks | its own `application/` and `ui/`, `src/shared/` |
| `src/shared/` | UI primitives and helpers several features use | `src/shared/` |
| `src/app/` | providers, routes, the only code that builds the gateways and hands the use cases to each feature | everything |

- A feature never imports another feature; what two features need moves to `src/shared/`.
- `application/` uses no React, no `fetch`, no browser API.
- A component reaches its use cases through a hook of its feature that reads a context; `src/app/` provides the value.
- The API owns the data, so the interface is a `*Gateway`. Call it a `*Repository` only when the browser owns the data (an offline store).
- A use case never re-checks a rule the API enforces. The gateway turns the API's refusal (409, 422) into a typed result or error that the component shows.

## Components

- One component per file, in a folder of its own name: `ui/ExpenseForm/ExpenseForm.tsx`, beside its CSS module and its sub-components. Pages, hooks and `App` too: `ui/useExpenses/useExpenses.ts`, `app/App/App.tsx`. No `index.ts` barrel.
- Declare `type <Name>Props` above the component and export it by name at the declaration: `export const ExpenseForm = ({ … }: ExpenseFormProps) => …`. No default export, no `FC`, no component declared inside another.

## Guard

Copy [eslint/clean-architecture.js](eslint/clean-architecture.js) into the project, spread it at the end of `eslint.config.js`, and add the dev dependencies it needs to `package.json`:

```js
import cleanArchitecture from './eslint/clean-architecture.js'

export default [...yourConfig, ...cleanArchitecture({ root: 'src' })]
```

```sh
npm i -D eslint-plugin-boundaries eslint-import-resolver-typescript eslint-plugin-react eslint-plugin-jsx-a11y
```

The lint then fails on a feature importing another, a layer pointing outward, a file outside the layout, two components in one file, a component outside its folder, a default export, and the accessibility rules of `jsx-a11y`. Tests follow `clean-architecture-testing` and its React examples.
Pliki w paczce (2)
  • SKILL.md 3 KB
  • eslint/clean-architecture.js 7 KB

Wersje

W bazie nie ma innych skilli o nazwie clean-architecture-react.

Migawka bazy z 13.11.2026 · wersja paczki ae97d12b3d5a (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

  • 100clean-architecture-dotnet
    Pomaga układać i rozbudowywać rozwiązanie .NET i ASP.NET Core: do którego projektu należy klasa, który projekt może odwoływać się do którego i jak endpoint dociera do przypadku użycia.
  • 100clean-architecture-java
    Pomaga układać i rozbudowywać usługę Java i Spring Boot z Mavenem: do którego modułu należy klasa, który moduł może zależeć od którego i jak endpoint dociera do przypadku użycia.
  • 82react-component-cleaner
    Porządkuje komponent React, wyłącznie na wyraźne polecenie użytkownika.
  • 95frontend-component
    Tworzy komponent React lub Vue z TypeScriptem, testami i stylami.
  • 90file-organization
    Określa zasady organizacji plików i folderów w Esposter: do którego folderu i pakietu należy plik, co może importować i jak przebiega zmiana nazwy, przy tworzeniu, przenoszeniu i zmianie nazw.
  • 100flutter-clean-arch
    Pomaga tworzyć i audytować warstwy funkcji lub pakietu Flutter: gdzie należy use case, repozytorium, datasource, encja lub model, czy domena może importować Flutter i czy zależności są odwrócone.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.