Frontend Discipline (stack-agnostic)
Trigger phrases: "in the frontend", "frontend code", "frontend'de", "screen size", "component", "page", "the UI", "UI component", "UI bug", "state management", "interface"
Web, mobile (native iOS/Android, Flutter, React Native, .NET MAUI, KMP) or desktop — shared principles.
The stack-specific "how" (native bridge, router choice, etc.) lives in the relevant project skill; this skill applies to all of them.
Client stack — resolve it before the first line, in this order; stop at the first answer
There is no default client stack, and none is suggested: the user chooses. Model discipline, not a gate.
The request says it. "Add a Flutter screen" is an answer. Use it; record it if ## Stack was empty.
CLAUDE.md ## Stack → Client: says it. A filled line is a decision: follow it.
The repo says it — manifests at the root and one level down (app/, mobile/, web/, client/, apps/*):
| Manifest |
Client |
package.json |
web (framework from its dependencies); React Native/Expo if it depends on react-native or expo |
pubspec.yaml |
Flutter |
*.xcodeproj / Package.swift |
native iOS (Swift / SwiftUI) |
build.gradle(.kts) with the Android plugin |
native Android (Kotlin / Compose); KMP if it applies kotlin("multiplatform") |
*.csproj with <UseMaui> |
.NET MAUI |
Still open (a new project) → ask, once. A few questions at most (which platforms · which client stack), the
options listed plainly — no option marked recommended and no "Decide for me": the stack is the user's call.
This is the one decision where the discipline's "give a clear recommendation" does NOT apply: state each option's
trade-off and stop there. That Crewforth ships layers for two stacks (frontend-rn-expo, frontend-flutter) is
not a reason to favour either (measured: the first version of this step still got "React Native + Expo (recommended)", because of it).
No one to ask (headless) → write the questions as text and stop; do not start client code on a guessed stack.
Record it in the Client: line of CLAUDE.md ## Stack, plus an ADR (adr skill). Never ask twice — a
recorded client stack changes only when the user asks. Then apply this skill on that stack; an RN/Expo project
also applies frontend-rn-expo, a Flutter project frontend-flutter.
Architecture
- Presentation / logic separation: component/view is pure and thin; business logic lives in the hook/composable/service layer.
- Reusability: repeated UI is factored out; the prop contract is clear and typed.
- Folder: feature-based (
features/<name>/) — view, logic, and test together.
State & data
- Local state first (
useState/signal); if global is needed, the project's choice (store/context) — nothing imposed.
- Data fetching: cache + error + loading states are considered; race/abort are handled.
State-complete UI (design it from the start)
Every data-bound view covers four states: loading · empty · error · full.
Don't code only the "full" case; empty/error/loading are part of the experience.
i18n & accessibility (default, not decoration)
- User-visible text comes from the language file (project languages); no hard-coded strings (
i18n-integrity).
- Meaningful labels/roles, sufficient contrast, keyboard/screen-reader access, appropriate touch/click target.
Visual & UX quality
This skill covers structure; the visual/UX design layer — hierarchy, spacing rhythm, typographic scale, a
restrained color system, and polished states — lives in frontend-design. Apply it when the work is about how the
interface looks and feels, not just how it's wired.
Responsive & performance
- Works across the target screen/device matrix (responsive/adaptive).
- Unnecessary renders (memo/callback), bundle size, lazy loading, virtualization for long lists.
Verify at runtime (contract)
Prove a change works by observing the running UI, structured — not by interpreting a screenshot. Have components
emit data-verify-* state attributes, register verifiable units with fixtures + invariants (≥1 adversarial probe
each), expose window.__verify, and adopt the PASS/FAIL/BLOCKED/SKIP taxonomy (when in doubt, FAIL). Then drive
the browser to check it. The full convention: references/verify-contract.md.
DoD (this skill's contribution)
/simplify; no dead styles/unused props.
- The four states are covered;
i18n-integrity clean; accessibility passes the baseline matrix.
crew-review-agent clean.
Constraints
- Surgical change; follow existing conventions, do not impose a stack/preference.
- Do not present data the platform does not provide as if it existed; do not promise a capability that isn't there.
- §4 applies: no AI trace or vendor template name in code/comments/strings.
1---2name: frontend-33description: |4 Stack-agnostic frontend discipline (web · mobile · desktop): component structure, state, data fetching,5 loading/empty/error states, i18n, accessibility, performance. crew-frontend-expert applies it on every stack.6metadata:7 source: https://skillmd.com/skills/byerlikaya/frontend-38---910# Frontend Discipline (stack-agnostic)1112<!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->13Trigger phrases: "in the frontend", "frontend code", "frontend'de", "screen size", "component", "page", "the UI", "UI component", "UI bug", "state management", "interface"1415Web, mobile (native iOS/Android, Flutter, React Native, .NET MAUI, KMP) or desktop — shared principles.16The stack-specific "how" (native bridge, router choice, etc.) lives in the relevant project skill; this skill applies to all of them.1718## Client stack — resolve it before the first line, in this order; stop at the first answer19There is no default client stack, and none is suggested: the user chooses. **Model discipline, not a gate.**201. **The request says it.** "Add a Flutter screen" is an answer. Use it; record it if `## Stack` was empty.212. **`CLAUDE.md ## Stack` → `Client:` says it.** A filled line is a decision: follow it.223. **The repo says it** — manifests at the root and one level down (`app/`, `mobile/`, `web/`, `client/`, `apps/*`):2324 | Manifest | Client |25 |:--|:--|26 | `package.json` | web (framework from its dependencies); React Native/Expo if it depends on `react-native` or `expo` |27 | `pubspec.yaml` | Flutter |28 | `*.xcodeproj` / `Package.swift` | native iOS (Swift / SwiftUI) |29 | `build.gradle(.kts)` with the Android plugin | native Android (Kotlin / Compose); KMP if it applies `kotlin("multiplatform")` |30 | `*.csproj` with `<UseMaui>` | .NET MAUI |314. **Still open (a new project) → ask, once.** A few questions at most (which platforms · which client stack), the32 options listed plainly — **no option marked recommended and no "Decide for me"**: the stack is the user's call.33 This is the one decision where the discipline's "give a clear recommendation" does NOT apply: state each option's34 trade-off and stop there. That Crewforth ships layers for two stacks (`frontend-rn-expo`, `frontend-flutter`) is35 not a reason to favour either (measured: the first version of this step still got "React Native + Expo (recommended)", because of it).36 No one to ask (headless) → write the questions as text and stop; do not start client code on a guessed stack.3738**Record it** in the `Client:` line of `CLAUDE.md ## Stack`, plus an ADR (`adr` skill). **Never ask twice** — a39recorded client stack changes only when the user asks. Then apply this skill on that stack; an RN/Expo project40also applies `frontend-rn-expo`, a Flutter project `frontend-flutter`.4142## Architecture43- **Presentation / logic separation:** component/view is pure and thin; business logic lives in the hook/composable/service layer.44- **Reusability:** repeated UI is factored out; the prop contract is clear and typed.45- **Folder:** feature-based (`features/<name>/`) — view, logic, and test together.4647## State & data48- **Local state first** (`useState`/signal); if global is needed, the project's choice (store/context) — nothing imposed.49- **Data fetching:** cache + error + loading states are considered; race/abort are handled.5051## State-complete UI (design it from the start)52Every data-bound view covers **four states**: **loading · empty · error · full**.53Don't code only the "full" case; empty/error/loading are part of the experience.5455## i18n & accessibility (default, not decoration)56- User-visible text comes from the language file (project languages); no hard-coded strings (`i18n-integrity`).57- Meaningful labels/roles, sufficient contrast, keyboard/screen-reader access, appropriate touch/click target.5859## Visual & UX quality60This skill covers *structure*; the **visual/UX design layer** — hierarchy, spacing rhythm, typographic scale, a61restrained color system, and polished states — lives in **`frontend-design`**. Apply it when the work is about how the62interface *looks and feels*, not just how it's wired.6364## Responsive & performance65- Works across the target screen/device matrix (responsive/adaptive).66- Unnecessary renders (memo/callback), bundle size, lazy loading, virtualization for long lists.6768## Verify at runtime (contract)69Prove a change works by **observing the running UI**, structured — not by interpreting a screenshot. Have components70emit `data-verify-*` state attributes, register verifiable units with fixtures + invariants (≥1 adversarial `probe`71each), expose `window.__verify`, and adopt the `PASS/FAIL/BLOCKED/SKIP` taxonomy (when in doubt, FAIL). Then drive72the browser to check it. The full convention: **`references/verify-contract.md`**.7374## DoD (this skill's contribution)75- `/simplify`; no dead styles/unused props.76- The four states are covered; `i18n-integrity` clean; accessibility passes the baseline matrix.77- `crew-review-agent` clean.7879## Constraints80- Surgical change; follow existing conventions, do not impose a stack/preference.81- Do not present data the platform does not provide as if it existed; do not promise a capability that isn't there.82- §4 applies: no AI trace or vendor template name in code/comments/strings.