vue-frontend-architecture

Enforces Vue 3 architecture rules for stores, async state unions, e2e tests, and i18n alignment.

4|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/NEETROF/cymbra --skill vue-frontend-architecture-neetrof
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vue-frontend-architecture
Source: https://github.com/NEETROF/cymbra/tree/main/.claude/skills/vue-frontend-architecture
Command: npx skills add https://github.com/NEETROF/cymbra --skill vue-frontend-architecture-neetrof

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Vue 3 front-ends often drift into inconsistent patterns: components calling APIs directly, scattered loading/error/data refs that allow impossible states, e2e tests that need a live backend, and locale files that silently fall out of sync. This Skill encodes the repo's architecture rules so every Vue screen, store, and test follows the same enforceable conventions. ## Core Features & Use Cases - API access layering: Components never call API or gRPC-web clients directly; only Pinia stores and composables do, behind an injectable seam (setClientsForTest) for unit testing with fakes. - Async state as a discriminated union: Every remote resource is one Async<T> value folded with ts-pattern's match(...).exhaustive(), making forgotten states compile errors instead of runtime bugs. - Backend-free e2e testing: A build-flag-gated fake-client seam lets Playwright run the real app with seeded data, forced locale, and assertions that raw error codes never leak into the DOM. - No translation drift: Back-office en.json/fr.json must mirror key-for-key (verified with a flatten-and-diff script), and the site enforces alignment at compile time via const en: typeof fr. - Use Case: When adding a new catalog search screen to the back-office, create the store with an Async<CatalogResult> union, fold it into a flat view-model in <script setup>, cover it with a store test using fake clients, and add a Playwright test that seeds data and asserts the localized heading. ## Quick Start Apply the Vue front-end architecture rules to review or create a new view, Pinia store, or Playwright e2e test in apps/back-office.

Frequently Asked Questions about vue-frontend-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure async state in a Vue 3 Pinia store?▼

Model each remote resource as one Async<T> discriminated union with idle, loading, success, and error statuses instead of separate loading/error/data refs. Fold promises into it with a run helper and render via match(...).exhaustive() so missing states become compile errors.

How to run Playwright e2e tests for a Vue app without a backend?▼

Install fake API clients from inside the page through a seam module that is dynamically imported behind a build-time env flag, so it is tree-shaken from production builds. Playwright seeds canned data and auth tokens with addInitScript before navigation.

Should Vue components call API clients directly?▼

No. Only Pinia stores or composables may call API or gRPC-web clients; views and components depend on stores and never import the client. Keep the client behind an injectable seam like setClientsForTest so stores stay unit-testable with fakes.

How do I keep vue-i18n locale files from drifting out of sync?▼

Require that any key added, renamed, or removed in one locale lands in every other locale in the same change. Verify by flattening and diffing the key sets of en.json and fr.json, or type secondary locales as typeof the source locale so the compiler enforces alignment.

Why does ts-pattern exhaustive matching fail inside Vue templates?▼

vue-tsc does not narrow discriminated unions reliably inside templates. Do the match in <script setup> to produce a flat view-model with always-defined fields, then bind those fields in the template.