react-frontend-standard
v0.7.1
Published
Reusable React frontend standard docs, templates, and local agent skill installer.
Maintainers
Readme
react-frontend-standard
Reusable structure, documentation, and agent skill for React frontend repositories.
Quick Start
Install a thin AGENTS.md router, project-local skill, and version manifest into another React project:
npx react-frontend-standard init .Install Codex / Claude Code session-start hooks as well:
npx react-frontend-standard init . --with-hooksSkip project-local skill installation:
npx react-frontend-standard init . --without-skillGenerate optional architecture and coding-pattern starter docs:
npx react-frontend-standard init . --with-docsInstall the skill into your user environment instead:
npx react-frontend-standard init . --with-user-skillFor local use inside this repository:
node ./bin/react-frontend-standard.jsThe wizard guides you through:
- target project path
- whether to install the skill
- whether the skill should be installed into the project or the user environment
- whether to install Codex and Claude Code SessionStart update hooks
- whether to generate optional architecture and coding-pattern docs
- how to handle existing files
If you prefer non-interactive usage, the CLI still supports:
node ./bin/react-frontend-standard.js init .
node ./bin/react-frontend-standard.js init . --with-hooks
node ./bin/react-frontend-standard.js init . --with-docs
node ./bin/react-frontend-standard.js init . --with-user-skill
node ./bin/react-frontend-standard.js init . --without-skill
node ./bin/react-frontend-standard.js init . --overwrite
node ./bin/react-frontend-standard.js check .
node ./bin/react-frontend-standard.js sync .After package installation, both react-frontend-standard and rfs are exposed as
CLI aliases.
Version Sync
init writes .react-frontend-standard/manifest.json into the target project.
That manifest records the installed package version, generated file hashes, skill
install mode, whether update hooks were installed, and whether optional docs were
installed.
Check whether a target project is behind the npm release:
npx -y react-frontend-standard@latest check .Refresh safely from the latest package:
npx -y react-frontend-standard@latest sync .sync refreshes the installed skill automatically. It updates generated hook files
and optional docs only when they still match the previously installed hash,
preserving local edits by reporting skip modified: <path>. Use --overwrite
only when the target project's local changes should be replaced.
When installed with --with-hooks, the target project receives:
.react-frontend-standard/hooks/session-start.mjs.codex/hooks.json.claude/settings.json
Those hooks call npx -y react-frontend-standard@latest sync . when Codex or
Claude Code sessions start, so downstream projects can keep the installed skill
and managed assets current without manual checks.
What This Repo Shape Is For
This directory packages the standards discussed in this project into a reusable skill-first bundle:
- thin route-entry
screens - feature-centered ownership
- shared generic
components - REST-friendly
<Feature>.api.ts -> <Feature>.service.ts -> hook -> component -> screenlayering - feature-root role files named as
<Feature>.<role>.ts - named exports for reusable modules, with default exports reserved for route-facing entries
- router-config projects such as React Router route to screens directly unless a thin route shell is needed
- optional, not default,
widgets
Structure
react-frontend-standard/
|-- README.md
|-- skills/
| `-- react-frontend-standard/
| |-- SKILL.md
| |-- agents/
| | `-- openai.yaml
| `-- references/
| |-- adoption-checklist.md
| |-- agents-snippet.md
| |-- architecture-template.md
| |-- coding-patterns-template.md
| |-- data-boundary-notes.md
| |-- document-sync-checklist.md
| |-- routing-framework-notes.md
| `-- testing-notes.md
|-- templates/
| |-- AGENTS.md
| |-- ARCHITECTURE.md
| `-- coding-patterns.md
|-- examples/
| |-- b2b-admin-example.md
| |-- b2c-domain-aligned-example.md
| `-- b2c-composition-heavy-example.md
`-- docs/
|-- decisions.md
`-- philosophy.mdHow To Use
New repository
- Run
npx react-frontend-standard init . --with-hooksso the project receives the local skill, thinAGENTS.mdrouter, manifest, and update hooks. - Define initial
featuresfrom backend domains or stable user use cases. - Add thin route-entry
screens. - In router-config projects such as React Router, point routes at screens directly unless a thin route shell is actually needed.
- Add
--with-docsonly when the project wants starterARCHITECTURE.mdanddocs/coding-patterns.mdscaffolds. - Record project-specific commands, routing setup, and exceptions in local docs.
Existing repository
- Inspect current route entrypoints and domain folders.
- Map code into
screens,features, and sharedcomponents. - Move raw transport logic into feature
<Feature>.api.ts,<Feature>.service.ts, and feature hooks where helpful. - Run
npx react-frontend-standard init . --with-hooksonce when no manifest exists. - Run
npx react-frontend-standard sync .to refresh the installed skill while preserving modified local docs. - Add
--with-docsonly when the project wants optional generated docs managed by this package.
Core Rules
screensare route-entry components only.pages,app,routes, and route modules are routing shells, not a parallel page-composition layer.- React Router-style route config should usually render
screensdirectly. featuresare the ownership center.- feature-root role files use
<Feature>.<role>.ts, not role-only names such asapi.ts,schema.ts,type.ts, ortypes.ts. componentsare shared generic UI primitives.- reusable modules use named exports; route files and screens may use default exports.
widgetsare optional and only introduced for repeated, meaningful, cross-feature UI blocks.
Source
This package was derived from the working standards used in the surrounding project and generalized for reuse.
