agentleFS
Ardiyanto24Ardiyanto24/modular-monolith-code-guide/.cursor/rules/frontend-nextjs-atomic-design.mdc

modular-monolith-code-guide / rules

Cursor rule0 starsChanged 2 months agoMITView on GitHub

Struktur Next.js App Router dan Atomic Design (atoms/molecules/organisms/templates) untuk frontend

The file

We split this frontend-nextjs-atomic-design.mdc into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Import lewat path alias ke file .tsx di dalam folder komponennya (@/components/atoms/Button/Button), bukan folder tanpa nama file.

    line 18

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
frontend-nextjs-atomic-design.mdc
---
description: Struktur Next.js App Router dan Atomic Design (atoms/molecules/organisms/templates) untuk frontend
globs: ["frontend/**/*.tsx","frontend/**/*.ts","**/*.module.css","**/app/**/page.tsx","**/components/**/*"]
alwaysApply: false
---

# Frontend Next.js + Atomic Design

Panduan lengkap: [`../../references/FRONTEND_GUIDE.md`](../../references/FRONTEND_GUIDE.md) — baca file itu sebelum membuat halaman/komponen baru.

Ringkasan aturan yang wajib dipatuhi:

- `page.tsx` **hanya** fetch data lalu memanggil `<{RouteName}Template />` — dilarang berisi JSX section langsung.
- **1 Route = 1 Template**, wajib ada di `components/templates/{RouteName}Template/{RouteName}Template.tsx`.
- Setiap "section" halaman = 1 komponen Organism di `components/organisms/{route-name}/{RouteName}{SectionName}/`, nama route sama persis dengan folder route-nya.
- Semua molecule baru default ke `molecules/shared/`, kecuali punya business logic yang eksplisit terikat ke satu halaman.
- **Setiap komponen (Atom/Molecule/Organism/Template) wajib punya folder sendiri** + file `.module.css` pasangan dengan nama identik — kecuali komponen ikon murni tanpa styling (dicatat eksplisit).
- Import lewat path alias ke file `.tsx` di dalam folder komponennya (`@/components/atoms/Button/Button`), bukan folder tanpa nama file.
- Server Components secara default, `'use client'` sedekat mungkin ke leaf component (pola client islands) — hindari `*PageClient.tsx`.
- **Search-before-create**: cek `organisms/shared/` dan `molecules/shared/` dulu sebelum bikin komponen baru; jangan buat varian (`*V2`, `*New`) kalau komponen serupa sudah ada.
- Sebelum melaporkan halaman baru "selesai", jalankan checklist di §9 `FRONTEND_GUIDE.md`.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.