Skip to content
cccskills
FreePublished on GitHub

spa-orchestrator

Orchestrates Single-Page Application (SPA) architecture, integrating frontend state management with API-driven backends / Mengorkestrasi arsitektur Single-Page Application (SPA), mengintegrasikan state management frontend dengan backend berbasis API.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md13.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Single-Page Application (SPA) Orchestrator (2026 Edition)

English | Bahasa Indonesia


<a name="english"></a>

English

Orchestration & Integration

Connects and orchestrates with relevant domain skills:

  • modern-web-guidance: HTML5/CSS standards, modern browser APIs, and accessibility guidelines.
  • senior-frontend: Primary UI craftsmanship, React 19 component trees, and Vite setups.
  • design-system-architect: Headless primitives and unified design tokens for SPA interfaces.
  • modern-css-native-expert: Native CSS anchor positioning, View Transitions, and container queries.
  • tailwind-expert: Tailwind CSS v4 design tokens and responsive utility classes.
  • state-management-expert: Client-side state separation (Zustand/Jotai) from server state.
  • tanstack-query-expert: Data caching, optimistic updates, and declarative async state.
  • ui-ux-pro-max: Dashboard composition, data table layouts, and navigation feedback.
  • visual-ui-auditor: Multimodal vision auditing of rendered SPA routes and dialogs.
  • anti-slop: Anti-slop frontend architecture, eliminating broken stubs and excessive loading spinners.
  • MANDATORY: Execute senior-frontend FIRST for all HTML/CSS and client-side JS tasks to ensure modern web standards.

Description

Structured orchestration guide for building modern Single-Page Applications (SPAs). Coordinates frontend architecture (TanStack Router, React 19, TanStack Query v5) with decoupled API backends (Hono RPC, tRPC). Covers state management strategy, routing patterns, API layer design, build tooling (Vite + TanStack Start), and deployment strategies.

Trigger Conditions

  • Building a highly interactive dashboard, admin panel, or data-heavy web application as a SPA.
  • Choosing between SPA vs SSR vs MPA for a new project.
  • Setting up client-side routing with TanStack Router (type-safe routes, loaders).
  • Structuring state management: server state (TanStack Query) vs client state (Zustand/Jotai).
  • Building a decoupled frontend that communicates with a separate backend via Hono RPC or tRPC.
  • Deploying a SPA to Cloudflare Pages, Vercel, or a CDN.

SPA vs SSR vs MPA — Decision Guide

Choose SPA when:
✅ Highly interactive app (dashboard, editor, admin panel)
✅ Rich client-side state that persists across navigation
✅ Auth-gated app (SEO is not a primary concern)
✅ Already have a separate backend API

Choose SSR (Next.js) when:
✅ SEO is critical (marketing pages, public content)
✅ Fast initial page load for unauthenticated users
✅ Mixed app: some public pages + some gated app pages

Choose MPA (Astro, Django, Laravel) when:
✅ Mostly static content, minimal interactivity
✅ SEO is the primary concern
✅ Small team that wants to avoid JS complexity
  → see mpa-orchestrator skill

Recommended SPA Stack (2026)

LayerToolWhy
BuildVite 6 / TanStack StartInstant HMR, ES modules, fast builds
RoutingTanStack RouterFully type-safe routes, search params, loaders
Server StateTanStack Query v5Data fetching, caching, mutations
Client StateZustand / JotaiLightweight, no boilerplate
API LayerHono RPC / tRPCEnd-to-end type-safe, no codegen
FormsReact Hook Form + ZodPerformant, type-safe validation
StylingTailwind CSS v4Utility-first, zero-runtime
Componentsshadcn/ui + Base UIHeadless, accessible, customizable
AnimationsGSAPComplex, timeline-based, scroll-driven

TanStack Router — File-Based Type-Safe Routing

src/routes/
  __root.tsx          # Root layout (providers, nav)
  index.tsx           # / — landing/home
  _auth.tsx           # Auth guard layout
  _auth/
    dashboard.tsx     # /dashboard (auth required)
    settings/
      index.tsx       # /settings
      profile.tsx     # /settings/profile
  _public.tsx         # Public layout
  _public/
    login.tsx         # /login
// src/routes/__root.tsx
import { createRootRouteWithContext, Outlet } from '@tanstack/react-router';
import type { QueryClient } from '@tanstack/react-query';

interface RouterContext {
  queryClient: QueryClient;
  auth: { user: User | null; isAuthenticated: boolean };
}

export const Route = createRootRouteWithContext<RouterContext>()({
  component: () => (
    <div>
      <Navbar />
      <Outlet />
    </div>
  ),
});
// src/routes/_auth/dashboard.tsx — protected route with data preloading
import { createFileRoute, redirect } from '@tanstack/react-router';
import { workspacesQueryOptions } from '@/queries/workspaces';

export const Route = createFileRoute('/_auth/dashboard')({
  // Runs before render — redirect if not authenticated
  beforeLoad: ({ context }) => {
    if (!context.auth.isAuthenticated) {
      throw redirect({ to: '/login' });
    }
  },
  // Prefetch data in loader — no loading state on initial render
  loader: ({ context: { queryClient } }) =>
    queryClient.ensureQueryData(workspacesQueryOptions()),
  component: DashboardPage,
});

function DashboardPage() {
  // Data is already available — no loading state
  const { data: workspaces } = useSuspenseQuery(workspacesQueryOptions());
  return <WorkspaceList workspaces={workspaces} />;
}

State Management Architecture

State Layers:
┌─────────────────────────────────────┐
│  Server State (TanStack Query v5)   │  ← API data, cached, auto-refetch
│  workspaces, users, projects, etc.  │
├─────────────────────────────────────┤
│  Client State (Zustand)             │  ← UI state, sidebar open, theme
│  modals, filters, UI preferences    │
├─────────────────────────────────────┤
│  Form State (React Hook Form)       │  ← Active form inputs, validation
│  Scoped to individual forms         │
├─────────────────────────────────────┤
│  URL State (TanStack Router)        │  ← Shareable page state
│  search params, active tab, page #  │
└─────────────────────────────────────┘
// URL State — persist filter state in URL (shareable)
import { createFileRoute, useNavigate } from '@tanstack/react-router';
import { z } from 'zod';

const searchSchema = z.object({
  page: z.number().int().positive().default(1).catch(1),
  search: z.string().default('').catch(''),
  status: z.enum(['all', 'active', 'archived']).default('all').catch('all'),
});

export const Route = createFileRoute('/_auth/projects')({
  validateSearch: searchSchema,
  component: ProjectsPage,
});

function ProjectsPage() {
  const { page, search, status } = Route.useSearch();
  const navigate = useNavigate({ from: Route.fullPath });

  const setSearch = (q: string) =>
    navigate({ search: (prev) => ({ ...prev, search: q, page: 1 }) });

  return (
    <div>
      <SearchInput value={search} onChange={setSearch} />
      <ProjectList page={page} search={search} status={status} />
    </div>
  );
}

Hono RPC — Decoupled Type-Safe API

// apps/api/src/index.ts — backend Hono app
import { Hono } from 'hono';
import { zValidator } from '@hono/zod-validator';

const workspacesRoute = new Hono()
  .get('/', async (c) => {
    const user = c.get('user');
    const workspaces = await db.workspace.findMany({
      where: { members: { some: { userId: user.id } } },
    });
    return c.json(workspaces);
  })
  .post('/', zValidator('json', CreateWorkspaceSchema), async (c) => {
    const data = c.req.valid('json');
    const workspace = await db.workspace.create({ data });
    return c.json(workspace, 201);
  });

const app = new Hono()
  .use('*', authMiddleware)
  .route('/workspaces', workspacesRoute);

export type AppType = typeof app;
export default app;
// apps/web/src/lib/api.ts — type-safe client
import { hc } from 'hono/client';
import type { AppType } from '@myapp/api';

export const api = hc<AppType>(import.meta.env.VITE_API_URL);

// TanStack Query integration
export const workspacesQueryOptions = () =>
  queryOptions({
    queryKey: ['workspaces'],
    queryFn: async () => {
      const res = await api.workspaces.$get();
      return res.json(); // Fully typed!
    },
    staleTime: 5 * 60 * 1000,
  });

Build & Deployment

// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';

export default defineConfig({
  plugins: [
    TanStackRouterVite(), // Auto-generates route tree
    react(),
  ],
  build: {
    rollupOptions: {
      output: {
        manualChunks: {
          'vendor-react': ['react', 'react-dom'],
          'vendor-query': ['@tanstack/react-query'],
          'vendor-router': ['@tanstack/react-router'],
        },
      },
    },
  },
});

Deployment target: Cloudflare Pages or Vercel for CDN-served static SPA. Backend API deployed separately to Railway/Fly.io.


<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Integrasi Orkestrasi

Terhubung dan mengorkestrasi skill domain yang relevan:

  • modern-web-guidance: Standar HTML5/CSS, API browser modern, dan pedoman aksesibilitas.
  • senior-frontend: Keahlian utama UI, pohon komponen React 19, dan setup Vite.
  • design-system-architect: Primitif headless dan token desain terpadu untuk antarmuka SPA.
  • modern-css-native-expert: CSS anchor positioning native, View Transitions, dan container queries.
  • tailwind-expert: Token desain Tailwind CSS v4 dan kelas utilitas responsif.
  • state-management-expert: Pemisahan state client-side (Zustand/Jotai) dari server state.
  • tanstack-query-expert: Caching data, update optimistik, dan state asinkron deklaratif.
  • ui-ux-pro-max: Komposisi dashboard, layout tabel data, dan feedback navigasi.
  • visual-ui-auditor: Audit visual multimodal untuk rute dan dialog SPA yang dirender.
  • anti-slop: Arsitektur frontend anti-slop, mengeliminasi stub rusak dan spinner loading berlebih.
  • MANDATORY: Eksekusi senior-frontend PERTAMA KALI untuk semua tugas HTML/CSS dan JS sisi klien guna memastikan standar web modern.

Deskripsi

Panduan orkestrasi terstruktur untuk membangun Single-Page Application (SPA) modern. Mengkoordinasikan arsitektur frontend (TanStack Router, React 19, TanStack Query v5) dengan backend API terpisah (Hono RPC, tRPC). Mencakup strategi state management, pola routing, desain API layer, build tooling (Vite + TanStack Start), dan strategi deployment.

Kondisi Pemicu

  • Membangun dashboard yang sangat interaktif, panel admin, atau aplikasi web berat data sebagai SPA.
  • Memilih antara SPA vs SSR vs MPA untuk proyek baru.
  • Menyiapkan client-side routing dengan TanStack Router (rute type-safe, loader).
  • Menyusun state management: server state (TanStack Query) vs client state (Zustand/Jotai).
  • Membangun frontend terpisah yang berkomunikasi dengan backend terpisah via Hono RPC atau tRPC.
  • Men-deploy SPA ke Cloudflare Pages, Vercel, atau CDN.

SPA vs SSR vs MPA — Panduan Keputusan

Pilih SPA saat: aplikasi sangat interaktif (dashboard, editor, panel admin), state sisi klien yang kaya, aplikasi yang dibatasi auth (SEO bukan perhatian utama).

Pilih SSR (Next.js) saat: SEO sangat penting, load halaman awal yang cepat untuk pengguna yang tidak terautentikasi, aplikasi campuran.

Pilih MPA (Astro, Django, Laravel) saat: konten sebagian besar statis, SEO adalah perhatian utama — lihat skill mpa-orchestrator.

Stack SPA yang Direkomendasikan (2026)

Vite 6 untuk build, TanStack Router untuk routing type-safe, TanStack Query v5 untuk server state, Zustand untuk client state, Hono RPC untuk API layer type-safe, React Hook Form + Zod untuk form, Tailwind CSS v4 untuk styling, dan GSAP untuk animasi kompleks.

TanStack Router — Routing File-Based Type-Safe

Atur rute dalam direktori src/routes/ dengan layout bersarang. Gunakan createFileRoute dengan beforeLoad untuk guard autentikasi, loader untuk prefetch data, dan validateSearch untuk URL state yang dapat dibagikan.

Arsitektur State Management

Empat lapisan state yang saling melengkapi: Server State (TanStack Query), Client State (Zustand), Form State (React Hook Form), dan URL State (TanStack Router search params).

Hono RPC — API Type-Safe Terpisah

Ekspor AppType dari backend Hono dan gunakan hc<AppType>() di frontend untuk panggilan API yang fully typed tanpa codegen.

Build & Deployment

Gunakan plugin TanStackRouterVite untuk auto-generate route tree. Konfigurasi manualChunks untuk code splitting yang optimal. Deploy SPA ke Cloudflare Pages atau Vercel; backend API ke Railway/Fly.io secara terpisah.


📄 Standard Pages Mandate (CRITICAL)

MANDATORY: Whenever you are building a new application, landing page, or website, you MUST automatically create the following standard pages:

  1. About Page (/about)
  2. Profile Page (/profile)
  3. Contact Page (/contact)
  4. Terms of Reference / Terms of Service (/terms)
  5. Privacy Policy (/privacy-policy)

These pages must be generated with standard boilerplate content that can later be customized to fit the specific application. Do not wait for the user to ask for them; they are a strict requirement for all web projects. / WAJIB: Otomatis buatkan halaman standar (About, Profile, Contact, Terms, Privacy Policy) pada setiap pembuatan aplikasi/website baru dengan konten boilerplate yang bisa disesuaikan nanti.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug112Updated Oct 22, 2026

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Fast (Composer 2.5, Grok 4.7/4.6) to Medium (Gemini 4 Argon, GPT-5.6 Sol, Claude Opus 5.5) and High (Claude Sonnet 5.5, Claude Fable 5.1, Muse Wonder) / Panduan ahli untuk kaskade dan routing model cerdas.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug112Updated Oct 22, 2026

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug112Updated Oct 22, 2026

Master guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan utama komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug112Updated Oct 22, 2026

Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug112Updated Oct 22, 2026

Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.

The English summary is being prepared. Showing the original description.

roedyrustam/vibes-plug112Updated Oct 22, 2026

See all skills by roedyrustam

Report a problem with this skill