Logo vun Frontend Module Standards

Frontend Module Standards

OrganisatiounBeléift
siteboon
frontend-module-standards

Enforce this repository's React and TypeScript frontend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing frontend code under `src/`, including feature modules, components, hooks, contexts, shared UI, API access, state, utilities, and frontend tests. Do not apply these rules to backend code under `server/` or non-frontend scaffolding.

Iwwersiicht

Editeursiteboon
Repositoryclaudecodeui
Skill-Nummfrontend-module-standards
Stären
14.3K
Forks
2.1K
Matgeliwwert Fichieren
1
LizenzAGPL-3.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum siteboon op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Frontend Module Standards an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/siteboon/claudecodeui/tree/main/.agents/skills/frontend-module-standards
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/siteboon/claudecodeui.git /tmp/claudecodeui
mkdir -p .claude/skills
cp -r /tmp/claudecodeui/.agents/skills/frontend-module-standards .claude/skills/frontend-module-standards
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Frontend Module Standards an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Frontend Module Standards automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Frontend Module Standards net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Frontend Module Standards

Apply these rules only to frontend code under src/. Preserve the requested task scope: make touched and newly generated frontend code compliant without performing an unrelated repository-wide migration.

Inspect before editing

  1. Identify the owning feature module and its existing barrel, components, hooks, contexts, utilities, state, API usage, and tests.
  2. Search for existing shared types, utilities, constants, UI components, hooks, and contexts before adding a new definition.
  3. Search for every consumer before moving a definition or changing a module's public exports.
  4. Distinguish application-source imports from package imports before applying the @ alias rules.

Use source-root imports

  • Treat @ as the alias for src.
  • Use @/... imports whenever the import target is frontend application code inside src, including imports within the same feature module.
  • Do not use relative paths such as ../, ../../, or ./ for application-source imports.
  • Continue using bare package specifiers for external dependencies, such as react or react-router-dom.
  • Use import type for every type-only import.

Organize feature modules

  • Place every frontend feature in src/modules/<feature>/.
  • Use .ts for non-JSX files and .tsx for files containing JSX. Do not add JavaScript feature-module files.
  • Give every feature module an index.ts barrel that exposes only its required public API.
  • Import another feature module only through that module's index.ts. Never deep-import another module's components, hooks, contexts, modals, utilities, or other implementation details.
  • Keep module-private implementation details out of the barrel.
  • Do not create view/ directories inside feature modules.
  • Keep module-owned UI components within the owning module, either at its root or in clearly named component-specific directories.

A feature module may contain only the directories it needs:

text
src/modules/<feature>/
|-- index.ts
|-- FeatureComponent.tsx
|-- hooks/
|-- context/
|-- modals/
|-- utils/
`-- tests/

Design exports deliberately

  • Export components and other public symbols at their declarations. This does not apply to re-exports from index.ts barrels.
  • Do not export speculative helpers, unused symbols, or module-private implementation details.
  • For every exported component, add a brief comment at its definition naming the consuming module or modules and explaining why they use it.
  • Update an exported component's consumer comment whenever its consumers change.
  • Use clear, specific names for functions, variables, components, and hooks.
  • Add a concise comment wherever intent, ordering, invariants, or edge cases would otherwise be unclear.

Example:

tsx
/** Used by the chat and plugins modules to display the active provider. */
export function ProviderBadge() {
  // ...
}

Use types, not interfaces

  • Do not introduce TypeScript interface declarations in frontend code. Use type aliases instead, including for component props, context values, state shapes, and API data.
  • When the requested work directly touches an existing interface, convert it to a type when doing so remains within scope.
  • Use export type when exporting a type.
  • Use import type when importing a type.
  • Use type-only barrel exports such as export type { Session }.

Place types by usage

  • Define a type directly in its sole owning component or implementation file when only that file uses it.
  • When two or more files use the same type, place it in src/shared/types.ts.
  • Do not create module-local types.ts files.
  • Do not duplicate a shared type to avoid importing it.
  • Add a brief comment to every type in src/shared/types.ts explaining what it represents and how it should be used.

Place utilities by usage

  • Define a utility directly in its sole owning component or implementation file when only that file uses it.
  • When two or more files use the same utility, place it in src/shared/utils.ts.
  • Do not create a module-level utils.ts file or duplicate a shared utility to avoid importing it.
  • Add a brief comment to every utility in src/shared/utils.ts explaining what it does and how it should be used.
  • A large module-private utility may be placed in src/modules/<feature>/utils/ when keeping it in its sole consumer would make that file impractical to maintain.
  • Give large module-private utility files descriptive names, such as mobileTerminalSelection.ts; do not name them utils.ts.
  • Keep a large utility module-private unless it acquires consumers in other modules. If it becomes shared across multiple modules, move it to src/shared/utils.ts.

Place constants by usage

  • Define a constant directly in its sole owning component or implementation file when only that file uses it.
  • When two or more files use the same constant, place it in src/shared/constants.ts.
  • Do not create module-local constants.ts files or duplicate shared constants.
  • Name true constants using UPPER_SNAKE_CASE.
  • Treat a value as a constant only when it is fixed independently of runtime evaluation.
  • A runtime-derived value such as platform detection is a variable or utility, even if it was previously given an uppercase name. Place it according to the utility rules.
  • Add a brief comment to every constant in src/shared/constants.ts explaining what it represents and how it should be used.

Organize shared definitions

Within src/shared/types.ts, src/shared/utils.ts, and src/shared/constants.ts:

  • Keep related definitions adjacent.
  • Introduce each related group with //----------------- DESCRIPTION OF GROUP ------------.
  • Separate unrelated groups with // ---------------------------.
  • Document each definition individually, even when it belongs to a documented group.
  • Avoid unrelated catch-all groups.

Place hooks by ownership

  • Put a hook used only by one feature module in src/modules/<feature>/hooks/.
  • Put a hook used by multiple feature modules in src/shared/hooks/.
  • Do not move a module-private hook into shared code merely because multiple components within the same module use it.
  • Search for an existing equivalent hook before adding a new one.

Place contexts by ownership

  • Put a context primarily owned by one feature in src/modules/<feature>/context/. For example, the auth module owns AuthContext.
  • Put a context without a clear feature owner in src/shared/context/. For example, ThemeContext affects the application broadly.
  • Ownership, not the number of consumers alone, determines context placement.

Place shared UI by usage

  • Keep a UI component inside its owning feature module when it is used only by that module.
  • Move a UI component to src/shared/ui/ only when two or more different feature modules use it.
  • Multiple consumers within the same feature module do not make a component globally shared.
  • Do not place shared UI under src/shared/view/ui/ or create view/ directories as an organizational layer.
  • Export only shared UI components that have real consumers.

Centralize frontend API access

  • Place frontend API endpoint definitions and shared request helpers in src/shared/api.ts.
  • Do not scatter endpoint paths or duplicate API request logic across feature components.
  • Feature modules may call the public API helpers but should not redefine their endpoint details.
  • Keep API transport concerns out of presentational UI components when practical.

Document state deliberately

Treat React state, reducer state, context state, and external-store state as frontend state for these rules.

  • Add a brief comment immediately above every newly introduced state declaration explaining why the state is essential and how it is used.
  • Describe its purpose rather than merely restating its variable name.
  • Do not introduce state that can be derived reliably from existing props or state.
  • If the task requires temporarily retaining state that appears redundant or questionable, mark it with // ! Possibly unnecessary - <brief reason>.
  • Do not add known-redundant state merely to annotate it.

Organize modals

  • When a feature module contains multiple modals, place them in src/modules/<feature>/modals/.
  • When a feature module contains only one modal, keep it directly in the module.
  • Keep a modal in src/shared/ui/ only when it is a genuinely reusable UI primitive used by multiple different modules.

Test within the owner

  • Put feature-module tests in src/modules/<feature>/tests/.
  • Put tests for shared frontend code in src/shared/tests/.
  • Add or update focused tests for changed hooks, utilities, API behavior, state transitions, and component behavior when applicable.
  • Do not place feature-specific tests in the shared test directory.

Verify the result

Before finishing:

  1. Confirm every application-source import uses @/... and external packages still use bare package specifiers.
  2. Confirm all cross-module imports go through the owning module's index.ts.
  3. Confirm module barrels contain only necessary, documented public exports.
  4. Confirm frontend code introduces no interfaces and uses export type and import type correctly.
  5. Confirm types, utilities, constants, hooks, contexts, UI components, modals, and tests follow their ownership and usage rules.
  6. Confirm shared types, utilities, and constants use the required comments and grouping separators.
  7. Confirm every newly introduced state declaration explains why it exists or is marked as possibly unnecessary.
  8. Run the narrow relevant frontend tests, followed by npm run test:client, npm run build:client, npm run typecheck, and npm run lint when the task scope and environment permit.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Frontend Module Standards?

Enforce this repository's React and TypeScript frontend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing frontend code under `src/`, including feature modules, components, hooks, contexts, shared UI, API access, state, utilities, and frontend tests. Do not apply these rules to backend code under `server/` or non-frontend scaffolding.

Firwat Frontend Module Standards op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Frontend Module Standards besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Frontend Module Standards an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/siteboon/claudecodeui/tree/main/.agents/skills/frontend-module-standards an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Frontend Module Standards benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Frontend Module Standards benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Frontend Module Standards domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Frontend Module Standards gratis?

Jo. De Skill gëtt vum siteboon ënner der Lizenz AGPL-3.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇