fe-data-mock-state
Frontend Data Mock State
Use this skill when the task involves API integration, server-state design, module adapters, mock-driven delivery, or deciding where state should live.
Use This Skill When
- The frontend needs an API client strategy or query/mutation structure.
- The task involves TanStack Query, adapters, normalization, or transport-to-domain mapping.
- The feature should run independently with mocks before real backend integration.
- The team needs clearer boundaries between local state, URL state, server state, and global state.
Inputs To Confirm Up Front
- API maturity: stable, evolving, mock-first, or backend not ready.
- Required query and mutation flows.
- Which state should be local, URL-based, server-driven, or global.
- Whether optimistic updates or rollback behavior are needed.
- Whether locale affects API payloads, content variants, formatting rules, or translation-resource loading.
Execute Workflow
- Define data ownership.
- Separate transport models from domain models.
- Keep adapters close to the consuming module.
- Define server-state strategy.
- Use TanStack Query for query lifecycle, caching, invalidation, retries, and background refresh.
- Keep request construction and response parsing out of presentational components.
- Define mock strategy when needed.
- Use fixtures,
msw, or development-only adapters based on scope. - Keep the switch between mock and real implementations explicit and localized.
- Define state boundaries.
- Use local state for ephemeral UI interaction.
- Use URL state for shareable navigation context.
- Use global state only where cross-module ownership is real.
- Define locale-aware data boundaries when relevant.
- Decide whether locale affects fetched content, display formatting only, or both.
- Keep raw values transport-safe and perform locale-aware presentation formatting outside transport adapters unless the API contract explicitly depends on locale.
Core Guidance
Data ownership
- Separate transport models from domain models.
- Keep adapters close to the consuming module.
State boundaries
- Use local state for ephemeral UI interaction.
- Use URL state for shareable navigation context.
- Use global state only where cross-module ownership is real.
Internationalization-aware data handling
- Separate raw values from display formatting for dates, numbers, currency, percentages, and relative time.
- If APIs are locale-sensitive, make locale propagation explicit in request construction and cache ownership.
- Do not bury translation-key or locale-selection logic deep inside presentational components when it belongs to module or app-level state.
Review Checklist
- Transport models and domain models are separated.
- Query and mutation ownership is explicit.
- Mock contracts are close enough to real contracts to avoid churn.
- State ownership is appropriate across local, URL, server, and global scopes.
- Locale-sensitive data and formatting boundaries are explicit when i18n is required.
Output Requirements
- Data-fetching and mutation strategy.
- State management strategy.
- Mock strategy when backend integration is deferred.
- Adapter and contract-boundary notes.
- Internationalization data notes: locale-sensitive APIs, formatting ownership, and cache implications when relevant.
More from jiannx/agent-skills
nocobase-bugfix
Diagnose and fix NocoBase v2 bugs, especially flow, FlowModel, client-v2, and plugin client issues. Use for issue reproduction, root-cause analysis, targeted fixes, regression checks, or narrow v2 feature completion based on nearby v1 behavior. Default to v2-only changes unless the user explicitly asks for v1.
9nocobase-v2-flow-upgrade
Upgrade existing NocoBase v1 plugins to v2 FlowModel or field-model architecture with behavior parity. Use for migration planning, implementation, parity validation, and pitfalls around request payloads, settings ownership, i18n namespaces, roles persistence, flow variables, and editor integrations.
9fe-quality-operations
Prepare frontend projects for reliable delivery with testing, performance review, observability, release strategy, and production-readiness checks.
2fe-routing-permission
Design frontend navigation, route ownership, URL state, auth boundaries, and permission systems with explicit access rules and user-state handling.
2fe-design-implementation
Implement product-grade frontend UI from design artifacts with consistent interaction patterns, theme-driven styling, responsive behavior, and design verification.
2fe-product-development
Build product-grade frontend projects with implementation guidance optimized for React ecosystems. Covers bootstrap, architecture, design implementation, data flow, testing, observability, release strategy, and long-term maintainability.
2