diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 00000000..5cb26a7d --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Pre-commit hook mirroring the fast static checks from CI +# (.github/workflows/static_check.yml) so commits don't reach CI with +# formatting, spelling, or type errors. +# +# `yarn build` is intentionally NOT run here: it recompiles the git +# submodules and takes minutes, which is too slow for a commit hook. +# CI still runs the full build. +# +# Bypass in an emergency with: git commit --no-verify + +set -e + +echo "pre-commit: running static checks (format, spellcheck, typecheck)..." + +yarn format:check +yarn spellcheck +yarn typecheck + +echo "pre-commit: all static checks passed." diff --git a/docs/ai-skill.mdx b/docs/ai-skill.mdx new file mode 100644 index 00000000..b71a7eb4 --- /dev/null +++ b/docs/ai-skill.mdx @@ -0,0 +1,48 @@ +--- +sidebar_position: 1 +title: Build Fishjam apps with AI +sidebar_label: Build with AI +description: "The Fishjam Skill gives your AI coding assistant up-to-date, correct guidance for building Fishjam apps: right SDK, real APIs, secure auth." +slug: /ai-skill +--- + +# Build Fishjam apps with AI + +The **Fishjam Skill** gives any skills-compatible coding assistant accurate, always-current Fishjam expertise. With it installed, your assistant generates code that uses the right SDK, real API names, and secure auth patterns from the first prompt. + +## What it covers + +The skill is one entry in Software Mansion's `skills` plugin, and it spans the whole Fishjam stack — backend, web, and mobile: + +- **Platform fundamentals** — rooms, peers, tracks, the two-tier auth model, notifications, and the REST API. +- **Server SDKs (Node & Python)** — including AI voice agents and the Gemini Live integration. +- **React web client** — the `@fishjam-cloud/react-client` hooks and providers. +- **React Native / Expo client** — permissions, foreground service, CallKit, screen share, and Picture-in-Picture. + +## Install + +Install the skill into Claude Code (recommended) or any skills-compatible assistant: + +```bash +npx skills add software-mansion-labs/skills +``` + +## How it activates + +No command needed. The skill auto-loads whenever you mention Fishjam or a Fishjam SDK/API in your prompts, like `@fishjam-cloud/react-client`, `FishjamClient`, or `managementToken`. + +## Why it helps + +The skill turns your assistant into a Fishjam specialist: + +- **Always current** — it tracks the latest SDKs and APIs, so your assistant builds on today's Fishjam instead of stale examples. +- **Secure by default** — authentication and tokens follow the patterns we recommend for production, from the first line of code. +- **Full-stack in one place** — backend, web, and mobile share the same guidance, so features connect cleanly end to end. + +:::tip +The skill follows the latest Fishjam release, so your assistant always works against current SDKs and APIs. +::: + +## Links + +- Source and installation details: [software-mansion-labs/skills](https://github.com/software-mansion-labs/skills) (MIT). diff --git a/docs/index.mdx b/docs/index.mdx index a9a27d35..84c284af 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -3,6 +3,7 @@ sidebar_position: 0 --- import QuickNavigation from "@site/src/components/QuickNavigation"; +import SkillCallout from "@site/src/components/SkillCallout"; import { items } from "@site/src/content/cardItems"; import { useVersionedLink } from "@site/src/hooks/useVersionedLink"; @@ -18,6 +19,8 @@ To get started, check out one of our guides or browse the examples below: + + ## Tutorials
/dev/null || true +fi + printf "Synchronising submodules... " git submodule sync --recursive >>/dev/null git submodule update --init --recursive >>/dev/null diff --git a/src/components/SkillCallout/index.module.css b/src/components/SkillCallout/index.module.css new file mode 100644 index 00000000..17b8b36f --- /dev/null +++ b/src/components/SkillCallout/index.module.css @@ -0,0 +1,128 @@ +.callout { + display: flex; + flex-direction: column; + gap: 1.25rem; + margin: 2.5rem 0; + padding: 1.75rem 2rem; + border-radius: calc(var(--ifm-global-radius) * 1.5); + background: linear-gradient(135deg, #fcf4e4 0%, #fdeae4 100%); + border: 1px solid #f2d7cf; +} + +.body { + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.eyebrow { + margin: 0; + font-size: 0.78rem; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--ifm-color-primary); +} + +.heading { + margin: 0; + font-size: 1.4rem; + font-weight: 700; + line-height: 1.2; + color: #221f1c; +} + +.subcopy { + margin: 0; + max-width: 54ch; + font-size: 0.98rem; + line-height: 1.55; + color: #5b544d; +} + +.actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.85rem 1.5rem; +} + +.command { + display: inline-flex; + align-items: center; + gap: 0.65rem; + max-width: 100%; + padding: 0.55rem 0.55rem 0.55rem 0.9rem; + background: #221f1c; + border-radius: 8px; + box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%); +} + +.prompt { + color: var(--ifm-color-primary); + font-family: var(--ifm-font-family-monospace); + font-weight: 700; + user-select: none; +} + +.commandText { + min-width: 0; + overflow-x: auto; + padding: 0; + border: none; + background: transparent; + color: #f4f1ea; + font-family: var(--ifm-font-family-monospace); + font-size: 0.86rem; + white-space: nowrap; +} + +.copyButton { + flex-shrink: 0; + min-width: 4.25rem; + padding: 0.35rem 0.7rem; + border: none; + border-radius: 6px; + background: rgb(255 255 255 / 10%); + color: #f4f1ea; + font-family: var(--ifm-font-family-base); + font-size: 0.8rem; + font-weight: 600; + cursor: pointer; + transition: + background var(--ifm-transition-fast) ease, + color var(--ifm-transition-fast) ease; +} + +.copyButton:hover { + background: var(--ifm-color-primary); + color: #fff; +} + +.learnMore { + font-size: 0.95rem; + font-weight: 700; + color: var(--ifm-color-primary); +} + +.learnMore:hover { + text-decoration: underline; +} + +@media (max-width: 600px) { + .callout { + padding: 1.5rem 1.25rem; + } + + .heading { + font-size: 1.25rem; + } + + .command { + width: 100%; + } + + .commandText { + flex: 1; + } +} diff --git a/src/components/SkillCallout/index.tsx b/src/components/SkillCallout/index.tsx new file mode 100644 index 00000000..6253792d --- /dev/null +++ b/src/components/SkillCallout/index.tsx @@ -0,0 +1,57 @@ +import React, { useState } from "react"; +import Link from "@docusaurus/Link"; +import { useVersionedLink } from "@site/src/hooks/useVersionedLink"; +import styles from "./index.module.css"; + +const INSTALL_COMMAND = "npx skills add software-mansion-labs/skills"; + +export default function SkillCallout() { + const skillHref = useVersionedLink("ai-skill"); + const [copied, setCopied] = useState(false); + + const copy = () => { + if (!navigator?.clipboard) return; + navigator.clipboard + .writeText(INSTALL_COMMAND) + .then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }) + .catch(() => {}); + }; + + return ( + + ); +} diff --git a/versioned_docs/version-0.28.0/ai-skill.mdx b/versioned_docs/version-0.28.0/ai-skill.mdx new file mode 100644 index 00000000..b71a7eb4 --- /dev/null +++ b/versioned_docs/version-0.28.0/ai-skill.mdx @@ -0,0 +1,48 @@ +--- +sidebar_position: 1 +title: Build Fishjam apps with AI +sidebar_label: Build with AI +description: "The Fishjam Skill gives your AI coding assistant up-to-date, correct guidance for building Fishjam apps: right SDK, real APIs, secure auth." +slug: /ai-skill +--- + +# Build Fishjam apps with AI + +The **Fishjam Skill** gives any skills-compatible coding assistant accurate, always-current Fishjam expertise. With it installed, your assistant generates code that uses the right SDK, real API names, and secure auth patterns from the first prompt. + +## What it covers + +The skill is one entry in Software Mansion's `skills` plugin, and it spans the whole Fishjam stack — backend, web, and mobile: + +- **Platform fundamentals** — rooms, peers, tracks, the two-tier auth model, notifications, and the REST API. +- **Server SDKs (Node & Python)** — including AI voice agents and the Gemini Live integration. +- **React web client** — the `@fishjam-cloud/react-client` hooks and providers. +- **React Native / Expo client** — permissions, foreground service, CallKit, screen share, and Picture-in-Picture. + +## Install + +Install the skill into Claude Code (recommended) or any skills-compatible assistant: + +```bash +npx skills add software-mansion-labs/skills +``` + +## How it activates + +No command needed. The skill auto-loads whenever you mention Fishjam or a Fishjam SDK/API in your prompts, like `@fishjam-cloud/react-client`, `FishjamClient`, or `managementToken`. + +## Why it helps + +The skill turns your assistant into a Fishjam specialist: + +- **Always current** — it tracks the latest SDKs and APIs, so your assistant builds on today's Fishjam instead of stale examples. +- **Secure by default** — authentication and tokens follow the patterns we recommend for production, from the first line of code. +- **Full-stack in one place** — backend, web, and mobile share the same guidance, so features connect cleanly end to end. + +:::tip +The skill follows the latest Fishjam release, so your assistant always works against current SDKs and APIs. +::: + +## Links + +- Source and installation details: [software-mansion-labs/skills](https://github.com/software-mansion-labs/skills) (MIT). diff --git a/versioned_docs/version-0.28.0/index.mdx b/versioned_docs/version-0.28.0/index.mdx index a9a27d35..84c284af 100644 --- a/versioned_docs/version-0.28.0/index.mdx +++ b/versioned_docs/version-0.28.0/index.mdx @@ -3,6 +3,7 @@ sidebar_position: 0 --- import QuickNavigation from "@site/src/components/QuickNavigation"; +import SkillCallout from "@site/src/components/SkillCallout"; import { items } from "@site/src/content/cardItems"; import { useVersionedLink } from "@site/src/hooks/useVersionedLink"; @@ -18,6 +19,8 @@ To get started, check out one of our guides or browse the examples below: + + ## Tutorials