| name | spaceos-frontend-arch-planner |
| description | SpaceOS frontend architecture planning skill. Multi-review pipeline that produces a versioned, implementation-ready frontend architecture document through structured review passes (frontend â security â backend/BFF), culminating in a Claude Codeâready implementation plan with Definition of Done, performance budgets, and component inventory.
ACTIVATE when the user asks for frontend/portal/UI architecture planning: "Portal tervezĂ©s", "frontend architektĂșra", "UI tervdokumentum", "portal shell tervezĂ©s", "world navigation tervezĂ©s", "frontend implementĂĄciĂłs terv", "UI/UX architektĂșra", "portal world architecture", "BFF route tervezĂ©s", "frontend sprint terv".
Do NOT activate for ad-hoc frontend questions â only for the full multi-review pipeline that produces a shippable implementation document.
|
SpaceOS Frontend Architecture Planner
Frontend-specifikus multi-review pipeline. A backend spaceos-arch-planner pĂĄrja.
Ugyanaz a struktĂșra Ă©s minĆsĂ©gi gate rendszer, frontend review lencsĂ©kkel.
1. Mikor hasznĂĄld
IGEN:
- Ăj frontend modul / world / page-csoport tervezĂ©se
- Portal shell / routing / navigation architektĂșra
- BFF (Backend-for-Frontend) route tervezés az Orchestrator-ban
- Design-to-code mapping (Claude Design â React implementĂĄciĂł)
NEM:
- Egyedi komponens kĂ©rdĂ©s â vĂĄlaszolj közvetlenĂŒl
- Backend-only modul â
spaceos-arch-planner
- Styling / CSS kĂ©rdĂ©s â
senior-frontend skill
2. Pre-loaded SpaceOS Frontend context
Stack (frozen)
| Réteg | Stack | Ståtusz |
|---|
| L4 Portal | React 18, TypeScript 5, Vite 5, Turborepo | DEPLOYED |
| L4 UI | Tailwind CSS 3, @spaceos/ui, @spaceos/brand-tokens | DEPLOYED |
| L4 State | Zustand (auth, brand) + TanStack Query (server state) | DEPLOYED |
| L4 Auth | Keycloak PKCE, ES256 JWT, role-based | DEPLOYED |
| L4 i18n | @spaceos/i18n, hostname-based locale (HU/EN) | DEPLOYED |
| L3 BFF | Orchestrator Express /bff/* proxy | DEPLOYED |
| L4 Test | Vitest (unit) + Playwright (E2E) + MSW (mock) | SCAFFOLD |
Frontend frozen decisions
- Frontend NEVER computes measurements (Data â Rules â Geometry axiom)
- Frontend NEVER calls Kernel directly â always through Orchestrator BFF
- JWT
brand_skin read from Orchestrator response body â never decoded client-side
- Zustand
persist middleware MUST NOT persist sensitive auth state to localStorage
- Lazy-loaded module routes require
<Suspense> + <ErrorBoundary> wrappers
- OpenAPI codegen from committed snapshot â never runtime schema discovery
enabledModules tenant configuration drives sidebar/route visibility
Monorepo structure (Turborepo)
spaceos-fe/
âââ apps/
â âââ joinerytech/ â main portal app (portal.joinerytech.hu)
â âââ src/
â â âââ App.tsx
â â âââ worlds/ â world-based routing (production, sales, design, etc.)
â â âââ pages/ â shared/legacy pages
â â âââ components/ â app-specific components
â â âââ stores/ â Zustand stores (authStore, brandStore)
â âââ vite.config.ts
âââ packages/
â âââ @spaceos/domain/ â TypeScript interfaces
â âââ @spaceos/api-client/ â BFF client (OpenAPI codegen)
â âââ @spaceos/ui/ â Shared components (FsmBadge, HashDisplay, PagedTable)
â âââ @spaceos/brand-tokens/ â Brand skin system (JoineryTech default, Doorstar override)
â âââ @spaceos/i18n/ â Hostname-based locale detection
â âââ @spaceos/joinery-ui/ â Trade-specific joinery components
âââ turbo.json
Existing UI components (@spaceos/ui)
FsmBadge · HashDisplay · PagedTable · TradeTypeBadge · JsonIntentEditor
BFF routes (existing)
| Route | Backend | StĂĄtusz |
|---|
/bff/api/* | Kernel :5000 | DEPLOYED |
/bff/joinery/* | Joinery :5002 | DEPLOYED |
/bff/cutting/* | Cutting :5005 | DEPLOYED |
3. The pipeline â 3 review lenses
Phase 0 â Context load
ââ Read: latest Codebase_Status, design bundle (if Claude Design output), existing portal v4 docs
Phase 1 â v1 Draft
ââ Route map · Component tree · State architecture · BFF surface · i18n keys
Output: {document}_v1.md
Phase 2 â Frontend review
đ Load: references/sub-senior-frontend.md
ââ Findings â v2 delta table
Focus: component decomposition, code splitting, state management,
performance budget, a11y, responsive breakpoints, bundle size
Output: {document}_v2.md
Phase 3 â Security review
đ Load: references/sub-senior-security.md
ââ Findings â v3 delta table
Focus: auth flow, token handling, CORS, XSS, CSP, role-based rendering,
enabledModules trust boundary, Shop Floor PIN isolation
Output: {document}_v3.md
Phase 4 â Backend/BFF review
đ Load: references/sub-senior-backend-bff.md
ââ Findings â v4 delta table
Focus: BFF route design, OpenAPI codegen, aggregation endpoints,
error handling, retry/timeout, cache strategy
Output: {document}_v4.md
Phase 5 â Final document assembly
ââ Cumulative Finding Summary · DoD · Sprint plan · Component inventory
Note: database-designer Ă©s database-schema-designer lencsĂ©k NEM szerepelnek â frontend tervezĂ©snĂ©l nincs Ășj DB schema.
4. Document structure (every version)
# {Project} â {Feature Name}
## Frontend Architecture
> VerziĂł: vN â {date}
> StĂĄtusz: {DRAFT | REVIEW | IMPLEMENTĂCIĂRA KĂSZ}
> Prereq: {backend modules that must be DEPLOYED}
> Design forrĂĄs: {Claude Design bundle link, ha van}
> KumulĂĄlt review: {lens list} â vN
---
## 1. KumulĂĄlt Finding ĂsszesĂtĆ (v1 â vN)
## 2. Route architektĂșra
### Route map (React Router v6)
### Code splitting stratégia
### enabledModules â route visibility
## 3. Komponens architektĂșra
### Komponens fa (tree diagram)
### Ăj komponensek listĂĄja (shared vs. app-specific)
### MeglĂ©vĆ @spaceos/ui komponensek ĂșjrahasznĂĄlata
## 4. State management
### Zustand store-ok (Ășj / bĆvĂtett)
### TanStack Query hook-ok (query key stratégia)
### Server state vs. client state szétvålasztås
## 5. BFF API surface
### Ăj Orchestrator proxy route-ok
### AggregĂĄlĂł endpoint-ok (ha kellenek)
### OpenAPI codegen bĆvĂtĂ©s
### Error handling + retry stratégia
## 6. i18n & Brand
### Ăj fordĂtĂĄsi kulcsok (HU/EN)
### Brand token bĆvĂtĂ©s (ha kell)
## 7. Responsive & Accessibility
### Breakpoint stratégia (desktop / tablet / mobile)
### a11y követelmények (WCAG 2.1 AA minimum)
### Touch target minimumok (48px)
## 8. Test stratégia
### Vitest unit tesztek (komponens + hook)
### Playwright E2E szcenĂĄriĂłk
### MSW mock handler-ek
## 9. Definition of Done
### Frontend gates
### BFF gates
### Test gates
### Performance gates
### ĂsszesĂtett
## 10. Sprint terv (Claude Code implementĂĄciĂł)
### Végrehajtåsi sorrend (track-ek)
### Agent utasĂtĂĄs
### Kockåzatok és mitigåciók
## 11. Mi jön utåna (roadmap)
5. Finding format
Ugyanaz mint a backend planner:
| ID | SĂșly | TerĂŒlet | ProblĂ©ma | vN javĂtĂĄs |
|---|
| FE-01 | đ | Route | ... | ... |
| SEC-FE-01 | đŽ | Auth | ... | ... |
| BFF-01 | đĄ | API | ... | ... |
Prefixek:
FE-NN â Frontend review findings
SEC-FE-NN â Security review findings (frontend-specifikus)
BFF-NN â Backend/BFF review findings
Severity: đŽ CRITICAL · đ HIGH · đĄ MEDIUM · đą LOW
6. Frontend-specifikus DoD gates
Append to every DoD ĂsszesĂtett section:
### Frontend gates
- [ ] Minden lazy-loaded world `<Suspense>` + `<ErrorBoundary>` wrapper-ben
- [ ] `enabledModules` ellenĆrzĂ©s: nem-engedĂ©lyezett world route â redirect Home
- [ ] Minden form input label-lel + aria attribĂștummal
- [ ] Responsive: 3 breakpoint tesztelve (desktop 1280px, tablet 768px, mobile 375px)
- [ ] Touch target minimum 48px minden interaktĂv elemen
- [ ] Sötét/vilågos sidebar konzisztens brand token-ökkel
### BFF gates
- [ ] Minden Ășj BFF route: auth middleware + tenant isolation
- [ ] OpenAPI snapshot frissĂtve + codegen lefuttatva
- [ ] Error response format konzisztens (Result<T> pattern)
- [ ] Timeout: 10s default, 30s aggregĂĄlĂł endpoint-okra
### Test gates
- [ ] MeglĂ©vĆ {N} FE teszt zöld (Vitest + Playwright)
- [ ] Ăj Vitest unit tesztek: >= {N} db
- [ ] Ăj Playwright E2E flow-k: >= {N} db
- [ ] MSW handler minden Ășj BFF route-hoz
### Performance gates
- [ ] Lighthouse Performance >= 90 (desktop)
- [ ] Lighthouse Accessibility >= 95
- [ ] Bundle size: app entry < 200KB gzip
- [ ] Lazy-loaded world chunk: < 80KB gzip per world
- [ ] First Contentful Paint < 1.5s (desktop, prod build)
- [ ] No layout shift (CLS < 0.1)
7. Component inventory format
Minden v1 draft-ban kötelezĆ:
### Ăj komponensek
| Komponens | Csomag | TĂpus | Props | LeĂrĂĄs |
|-----------|--------|-------|-------|--------|
| `WorldCard` | app | Presentational | `world, accent, badge, onClick` | Home screen vilĂĄg kĂĄrtya |
| `WorldShell` | app | Layout | `world, screen, children` | VilĂĄg shell sidebar + topbar |
| `Sparkline` | @spaceos/ui | Shared | `data, color, width, height` | Mini trend chart |
### MeglĂ©vĆ komponensek ĂșjrahasznĂĄlata
| MeglĂ©vĆ | Hol hasznĂĄljuk | MĂłdosĂtĂĄs kell? |
|---------|---------------|-----------------|
| `FsmBadge` | GyĂĄrtĂĄs â vĂ©grehajtĂĄs stĂĄtusz | Nem |
| `PagedTable` | Rendelések, Készlet lista | Nem |
| `HashDisplay` | BeĂĄllĂtĂĄsok â NaplĂł | Nem |
8. Design-to-code mapping section
Ha Claude Design bundle elĂ©rhetĆ:
### Design â Code mapping
| Design fåjl | React komponens | Csomag | Megjegyzés |
|-------------|----------------|--------|------------|
| `page-home.jsx` | `HomeScreen.tsx` | app | World kĂĄrtya grid |
| `page-shopfloor.jsx` | `ShopFloorWorld.tsx` | app | Teljes kĂ©pernyĆ, dark mode |
| `ui.jsx â StatusPill` | `StatusPill.tsx` | @spaceos/ui | Merge FsmBadge-dzsel? |
| `data-worlds.js` | `worldConfig.ts` | @spaceos/domain | enabledModules mapping |
9. Sub-skill betöltĂ©si utasĂtĂĄsok
| Review fĂĄzis | BetöltendĆ fĂĄjl | Mikor |
|---|
| v2 â Frontend review | references/sub-senior-frontend.md | v1 draft kĂ©sz |
| v3 â Security review | references/sub-senior-security.md | v2 lezĂĄrva |
| v4 â BFF review | references/sub-senior-backend-bff.md | v3 lezĂĄrva |
Betöltési instrukció:
Olvasd el a [fåjlnév] tartalmåt.
Alkalmazd a frontend / security / BFF analitikai keretrendszert a tervdokumentumra.
Minden findinget a SpaceOS finding formĂĄtumban dokumentĂĄlj: [ID] · [sĂșly] · [terĂŒlet] · [problĂ©ma] · [javĂtĂĄs]
10. Naming convention
SpaceOS_{FeatureName}_Frontend_Architecture_v{N}.md
Examples:
SpaceOS_Portal_World_Architecture_v1.md
SpaceOS_ShopFloor_Terminal_Frontend_v1.md
SpaceOS_DesignEditor_Frontend_v1.md
11. Workflow
- User kéri a frontend tervezést (pl. "Portal world architecture tervezés")
- Load: latest Codebase_Status, design bundle, existing portal v4 docs
- Ha van nyitott döntĂ©s â tĂĄblĂĄzatban kĂ©rd be (D-01, D-02, ... egy mondatos vĂĄlasz)
- Run pipeline: v1 draft â frontend review â security review â BFF review â final
- "ImplementĂĄciĂłs terv" kĂ©rĂ©sre â Section 10 (Claude Code sprint plan) kitöltĂ©se
- Output:
.md fĂĄjl a naming convention szerint
SpaceOS Frontend Architecture Planner · v1.0 · 2026-04-29