frontend-architecture
Fungsinya
Skill ini menjelaskan cara mengatur kode untuk aplikasi React atau React Native. Skill ini membantu menjaga semuanya rapi dalam modul, memisahkan data server dari data layar, serta menetapkan aturan yang jelas tentang bagaimana bagian kode dapat berkomunikasi.
Kapan dipakai
- βSaat memulai proyek React/React Native baru.
- βSaat kode proyek mulai berantakan dan sulit dipahami.
- βAgar setiap developer mengikuti aturan pengorganisasian yang sama.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/frontend-architecture/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBagaimana cara menyusun kode React Native saya agar mudah dipahami dan dirawat?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini membagi aplikasi menjadi 'modul' (bagian fungsional), di mana setiap modul memiliki halaman, komponen, dan datanya sendiri. Aturan menentukan bagaimana modul-modul ini dapat berinteraksi, yaitu hanya melalui titik masuk publik.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Frontend Architecture (portable, module-based)
When to Use
Use this skill when you need a portable, framework-agnostic architecture style for any React or React Native frontend. Organizes apps into feature modules with page/screen directories, a strict server-state vs UI-state split, barrel-only cross-module imports, co-located styles, and clear component-promotion rules....
Portable skill β readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others. This skill describes a structure and a set of rules, not a component library, a state library, or a visual style. It is deliberately global: the same module/page/state model maps onto Next.js (App Router), React + Vite (SPA), Remix, and Expo / React Native, and it works with any state-management and styling stack.
The goal: a codebase where any contributor can instantly answer three questions β "where does this code live?", "what is allowed to import what?", and "is this server state or UI state?" β without asking anyone. The structure makes the answers obvious.
0. The five core ideas
- Feature modules own their world. Each feature is a self-contained
modules/{feature}/folder with its own pages, components, hooks, state, types, and a single public barrel. - Pages/screens are directories, not files. A route is a folder that co-locates its component, its styles, and the components/hooks used only by it.
- State is split by origin. Server data lives in a query/cache layer. UI/client state lives in a store. They never overlap β regardless of which libraries you pick.
- Imports cross boundaries only through barrels. Reaching into another module's internals is forbidden; you import from
@/modules/{feature}and nothing deeper. - Code is promoted, not pre-placed. It starts as local as possible and moves outward only when a second consumer appears.
Everything below is the mechanical application of these five ideas. None of it is tied to a specific library β pick your stack in Sections 4 and 6.
1. Directory layout
The shape is identical across frameworks; only the routing layer on top differs (see Section 7).
src/
βββ app/ or routes/ or navigation/ β framework routing layer (thin β see Β§7)
βββ modules/ β feature modules (the heart of the app)
β βββ {feature}/
β βββ index.ts β PUBLIC BARREL β the only cross-module entry point
β βββ README.md β what this module owns, its routes, its data deps
β βββ components/ β components reused by 2+ pages IN THIS MODULE
β βββ pages/ β page/screen directories (one per route)
β β βββ {page}/
β β βββ {page}.tsx β the page/screen component
β β βββ {page}.styles.ts β ALL styling for this page
β β βββ index.ts β re-exports the page component
β β βββ components/ β components used ONLY by this page
β β βββ hooks/ β hooks used ONLY by this page
β β βββ constants/
β β βββ README.md β route, params, permissions, data deps
β βββ hooks/ β data hooks (query/mutation) + module hooks
β βββ stores/ β UI/client state store(s) β never server data
β βββ services/ β data-access (API calls) for this feature
β βββ utils/ β pure module utilities (co-located *.test.ts)
β βββ constants/
β βββ types/ β module request/response + view-model types
βββ shared/ β cross-module building blocks
βββ components/ β components used by 2+ MODULES
βββ hooks/ β cross-cutting hooks
βββ api-client/ β one typed client; the only place that talks to the network
βββ store/ β root store wiring (if your state lib needs one β see Β§4)
βββ utils/ β formatters, cn()/clsx, helpers
βββ constants/
βββ types/
Every folder that can be empty at scaffold time keeps a .gitkeep so the structure is visible from day one.
2. Feature modules
A module is a vertical slice of the product (e.g. auth, billing, dashboard, settings). It contains everything that feature needs and exposes a deliberately small surface.
β¦
Pertanyaan umum
Apakah saya harus menggunakan library React tertentu?
Tidak, pengorganisasian ini bisa digunakan dengan library state atau styling apa pun yang Anda pilih untuk proyek React atau React Native.
Apa itu 'modul'?
Modul seperti kotak yang mengelompokkan semua bagian yang terkait dengan fitur aplikasi tertentu, misalnya 'autentikasi' atau 'pembayaran'.
Mengapa halaman dibuat sebagai folder, bukan file?
Membuat halaman sebagai folder sejak awal memudahkan Anda menambahkan file lain (seperti komponen atau style khusus halaman) tanpa perlu mengubah struktur di kemudian hari.
Detail
Deskripsi asli dari pembuat
A portable, framework-agnostic architecture style for any React or React Native frontend. Organizes apps into feature modules with page/screen directories, a strict server-state vs UI-state split, barrel-only cross-module imports, co-located styles, and clear component-promotion rules.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #4662
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.