Phase 6: UI Integration

SkillAI & models

Skill for implementing UI and integrating with APIs. Covers frontend-backend integration and state management.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Phase 6: UI Integration skill

What this skill tells your AI

The instructions your AI receives, as published by ww-w-ai/bkit-gemini in skills/phase-6-ui-integration/SKILL.md and read by ahel’s review.

Connect your frontend to the backend

Key Tasks

1. API Client Setup

// lib/api/client.ts
const API_BASE = process.env.NEXT_PUBLIC_API_URL;

export async function fetchAPI<T>(
  endpoint: string,
  options?: RequestInit
): Promise<T> {
  const res = await fetch(`${API_BASE}${endpoint}`, {
    headers: {
      'Content-Type': 'application/json',
      ...options?.headers,
    },
    ...options,
  });

  if (!res.ok) {
    throw new Error(`API Error: ${res.status}`);
  }

  return res.json();
}

2. Data Fetching

// Server Component
async function UserList() {
  const users = await fetchAPI<User[]>('/api/users');

  return (
    <ul>
      {users.map(user => (
        <li key={user.id}>{user.name}</li>
      ))}
    </ul>
  );
}

3. Form Handling

// Client Component with Server Action
'use client';

export function LoginForm() {
  const [pending, startTransition] = useTransition();

  async function handleSubmit(formData: FormData) {
    startTransition(async () => {
      await loginAction(formData);
    });
  }

  return (
    <form action={handleSubmit}>
      <input name="email" type="email" required />
      <input name="password" type="password" required />
      <button disabled={pending}>
        {pending ? 'Loading...' : 'Login'}
      </button>
    </form>
  );
}

4. State Management

  • Server State: React Query / SWR
  • Client State: Zustand / Jotai
  • Form State: React Hook Form

Integration Checklist

  • API client configured
  • Authentication flow working
  • Error boundaries added
  • Loading states implemented
  • Optimistic updates where needed

Next Phase

After completion: /phase-7-seo-security (Dynamic/Enterprise) or /phase-9-deployment (Starter)

Signals

GitHub stars
65
Forks
16
Last commit
May 2026
Advanced
Catalog kind
skill
Gateway key
phase-6-ui-integration
Source
github.com/ww-w-ai/bkit-gemini