---
name: ibgib-create-app
description: The Master Coordinator skill for scaffolding complete ibgib applications. Prompts for topology archetype (Full-Stack, Client-Only SPA, Browser Extension, or Server-Only) and workspace context, then orchestrates client and server sub-skills.
---

# Skill: ibgib-create-app (Master Coordinator)

## What This Skill Does

This is the **Master Coordinator Skill** for scaffolding applications in the `ibgib` ecosystem. It evaluates the desired application topology and orchestrates the appropriate sub-skills to produce a buildable, type-safe, and consistent application.

For complete architectural background, refer to:
*   **The App Guide**: [`docs/IBGIB_CREATING_APPS_GUIDE.md`](../../../docs/IBGIB_CREATING_APPS_GUIDE.md)
*   **The Client Guide**: [`docs/IBGIB_CLIENT_APPS_GUIDE.md`](../../../docs/IBGIB_CLIENT_APPS_GUIDE.md)
*   **The Server Guide**: [`docs/IBGIB_SERVER_APPS_GUIDE.md`](../../../docs/IBGIB_SERVER_APPS_GUIDE.md)

---

## Topology Archetypes

Before scaffolding, confirm the target topology with the developer:

1.  **`fullstack`** (e.g. `space-gib` style):
    *   SPA Client (`src/client`) + Node `serve-gib` Server (`src/server`) + Shared Types (`src/common`).
    *   Containerized via Docker Compose & Traefik.
    *   *Sub-skills used*: `ibgib-create-client-app` + `ibgib-create-server-app`.
2.  **`client-only-spa`**:
    *   Standalone in-browser SPA utilizing IndexedDB space and syncing to a remote ibgib Hub.
    *   *Sub-skills used*: `ibgib-create-client-app`.
3.  **`browser-extension`** (e.g. `blank-gib` style):
    *   Manifest v3 extension with background worker and popup UI.
    *   *Sub-skills used*: `ibgib-create-client-app`.
4.  **`server-only`**:
    *   Dedicated Space & Identity Hub or custom API service.
    *   *Sub-skills used*: `ibgib-create-server-app`.

---

## Workspace Context

Confirm the target workspace mode:
*   **`monorepo`** (Default): App is created within the `apps/` directory of this monorepo or a downstream monorepo clone. Uses monorepo workspace links (`@ibgib/*: "*"`) and extends `../../tsconfig.base.json`.
*   **`standalone`**: App is an independent single-package repository consuming published npm packages.

---

## Coordinated Sub-Skills

*   **`ibgib-create-client-app`**: Coordinates client core bootstrap, app witness, UI shell, components, and Keystone identity wiring.
    *   $\hookrightarrow$ `ibgib-create-client-app-core`
    *   $\hookrightarrow$ `ibgib-create-client-app-witness`
    *   $\hookrightarrow$ `ibgib-create-client-shell`
    *   $\hookrightarrow$ `ibgib-create-client-identity`
    *   $\hookrightarrow$ `ibgib-create-component`
*   **`ibgib-create-server-app`**: Scaffolds the Node `serve-gib` backend runner, `tsconfig.server.json`, `Dockerfile`, and `docker-compose.yml`.

---

## Master Scaffolding Workflow

1.  **Gather Tokens**: Confirm application names, paths, ports, and generate UUIDs using:
    ```bash
    node .agents/skills/ibgib-create-client-app-core/generate-id.js
    ```
2.  **Scaffold Client**: If archetype is `fullstack`, `client-only-spa`, or `browser-extension`, invoke **`ibgib-create-client-app`**.
3.  **Scaffold Server**: If archetype is `fullstack` or `server-only`, invoke **`ibgib-create-server-app`**.
4.  **Wire Build Pipeline**:
    *   For monorepo apps: Add `build-[app-name].mts` in `build/src/concrete-build/` and add npm scripts to root `package.json`.
    *   For standalone apps: Verify local `package.json` build and watch scripts.
