Skip to main content

Repo Map

The Shokunin Platform is organized as a monorepo. This page is a reference map to help contributors find where to make changes.

Top-Level Structure

v0-shokunin-ai-platform/
├── app/                    # Next.js App Router pages and layouts
├── apps/                   # Micro-frontend applications
│   └── mfe-docs/           # This docs site (Mintlify v4)
├── components/             # Shared React components
│   ├── beads/              # Beads task tracking UI views
│   ├── marketing/          # Public marketing page components
│   ├── platform/           # Platform shell (sidebar, topbar)
│   └── ui/                 # Shadcn UI primitives (auto-generated)
├── domains/                # Domain repositories and hooks
│   ├── beads/              # Beads issue data access
│   ├── dashboard/          # Dashboard data access
│   ├── project/            # Project data access
│   └── workshop/           # Workshop and agent data access
├── hooks/                  # Global React hooks
├── infrastructure/         # Local backend infrastructure configs
│   ├── beads-api/          # Beads HTTP API (Go)
│   └── beads-backend/      # Dolt SQL Server config
├── lib/                    # Utility functions and shared logic
├── packages/               # Internal shared packages
│   ├── shokunin-ai/        # AI provider adapter
│   ├── shokunin-auth/      # Authentication adapter
│   ├── shokunin-cms/       # CMS adapter (BaseHub)
│   ├── shokunin-collaboration/ # Real-time collaboration (Liveblocks)
│   ├── shokunin-feature-flags/ # Feature flag provider
│   ├── shokunin-flow/      # Flow canvas / visual workflow
│   ├── shokunin-types/     # Shared TypeScript types
│   └── shokunin-ui/        # Extended design system components
├── plugins/                # OpenCode agent plugins
│   ├── agent/              # Shokunin agent plugin (@horizon-ai-dev/shokunin)
│   └── observability/      # Observability plugin (planned)
├── tasks/                  # PRDs and planning documents
└── terraform/              # GCP infrastructure as code

Directory Reference

app/

Next.js 15 App Router. Route groups organize the application:
PathDescription
app/(auth)/Authentication pages (sign in, sign up)
app/(platform)/Authenticated platform routes — requires login
app/(platform)/dashboard/User dashboard
app/(platform)/projects/Project listing and management
app/(platform)/workshops/Workshop workspace (the primary work surface)
app/(platform)/docs/Documentation route — embeds this Mintlify site
app/(platform)/profile/User profile settings
app/(platform)/admin/Administrative controls
app/(platform)/knowledge/Knowledge library
app/api/Next.js API route handlers
app/globals.cssTailwind CSS v4 theme variables and design tokens
app/layout.tsxRoot layout with providers
Key entry point: /docs route is at app/(platform)/docs/page.tsx.

components/

Reusable React components organized by concern:
SubdirectoryDescription
components/ui/Shadcn UI primitives — do not edit directly. Use bunx shadcn@latest add to add/update.
components/platform/Platform shell: sidebar-nav.tsx, topbar.tsx, collaboration-shell.tsx
components/beads/Beads task tracking views: kanban board, list view, dependency graph, detail sheet
components/marketing/Public marketing components: landing-page.tsx, landing-header.tsx, landing-footer.tsx
components/auth-wrapper.tsxClient-side auth context provider wrapper (required in root layout)
components/ai-panel.tsxAI chat panel component
components/comment-thread.tsxInline comment thread component
components/theme-provider.tsxTheme context provider
Key entry point: Platform navigation is in components/platform/sidebar-nav.tsx.

domains/

Domain-driven data access layer. Each domain encapsulates Firestore read/write logic for a specific business entity. This separates business logic from UI components.
DomainContentsDescription
domains/workshop/repositories/, hooks/Workshop and agent session data access
domains/project/repositories/Project CRUD operations
domains/beads/repositories/, hooks/Beads issues and dependency graph data
domains/dashboard/hooks/, index.ts, types.tsDashboard aggregation hooks
Pattern: Each domain exports custom hooks (e.g., useWorkshop, useAgents) that consume repositories and manage React state. Hooks receive tenantId and projectId from a parent context.

hooks/

Global custom React hooks shared across the app (not tied to a specific domain):
FileDescription
hooks/use-mobile.tsResponsive breakpoint detection
hooks/use-toast.tsToast notification hook (Sonner)

lib/

Utility functions and shared logic:
File / DirectoryDescription
lib/utils.tscn() utility for Tailwind class merging — use in every component
lib/env.tsType-safe environment variable access
lib/beads-db.tsBeads local database access utilities
lib/beads-filters.tsBeads issue filtering logic
lib/beads-dagre-layout.tsDAG layout algorithm for Beads dependency graph
lib/beads-issue-type.tsBeads issue type helpers
lib/firestore/Firestore client initialization, migrations, seed data
lib/federation/Module federation: remote-registry.ts, error boundary, fallback
lib/mock-data/Mock data for development and testing

packages/

Internal shared packages. These are TypeScript modules used across the monorepo.
PackageDescription
packages/shokunin-ai/AI provider adapter — wraps AI APIs with a unified interface. Contains adapters/, hooks.ts, provider.tsx, types.ts
packages/shokunin-auth/Authentication adapter — wraps Firebase Auth. Contains adapters/, provider.tsx, types.ts
packages/shokunin-cms/CMS adapter — wraps BaseHub. Contains adapters/, image.ts, provider.tsx, pump.tsx, types.ts
packages/shokunin-collaboration/Real-time collaboration adapter — wraps Liveblocks. Contains adapters/, provider.tsx, room-id.ts, types.ts
packages/shokunin-feature-flags/Feature flag provider with static mock adapter. Defines all platform feature flags (including docs-site, ai-chat, collaboration).
packages/shokunin-flow/Visual flow canvas built on React Flow. Contains agent canvas, workflow nodes/edges, collaboration cursors
packages/shokunin-types/Shared TypeScript type definitions used across the monorepo
packages/shokunin-ui/Extended design system beyond Shadcn: s-button.tsx, s-card.tsx, notification-bell.tsx, loading-spinner.tsx, logo.tsx, etc.

plugins/

OpenCode agent plugins that extend the AI coding agent’s capabilities:
PluginDescription
plugins/agent/Shokunin agent plugin (@horizon-ai-dev/shokunin) — the primary agent plugin. Contains specialized agents, commands, tools, and bundled skills for AI-assisted development workflows. Published to npm.
plugins/observability/Observability plugin — planned
Key entry point: plugins/agent/README.md explains how to install and use the Shokunin agent plugin.

apps/

Micro-frontend applications:
AppDescription
apps/mfe-docs/This Mintlify v4 documentation site. Config: docs.json. Content: MDX pages organized by nav section.

infrastructure/

Local backend service configurations (see also docker-compose.yml at the root):
DirectoryDescription
infrastructure/beads-backend/Dockerfile and config for the local Dolt SQL Server (Beads data backend)
infrastructure/beads-api/Dockerfile and config for the Beads HTTP API
infrastructure/opencode-web/Dockerfile for the OpenCode web interface (currently commented out in docker-compose)

terraform/

GCP infrastructure as code. Provisions all cloud resources for the Shokunin Platform:
  • GCP project, networking, Cloud Run services
  • Firestore database, Firebase config
  • Cloud Storage buckets, IAM roles
See terraform/README.md for the conceptual infrastructure diagram and GCP component list.

tasks/

Product Requirements Documents (PRDs) and planning files. Source of truth for feature planning:
FileDescription
tasks/prd-platform-documentation.mdThis documentation epic PRD
tasks/prd-workshop-agents-workflow.mdWorkshop + agent workflow planning
tasks/prd-shokunin-agent-service.mdShokunin agent service planning
tasks/prd-auth-identity-access.mdAuth and identity access planning
tasks/prd-audit-logging.mdAudit logging planning
tasks/prd-admin-tenant-ops.mdAdmin tenant operations planning

Key Entry Points

What you want to changeWhere to look
Platform navigation (sidebar)components/platform/sidebar-nav.tsx
/docs route and embed logicapp/(platform)/docs/page.tsx
Feature flagspackages/shokunin-feature-flags/index.tsx
Authentication flowpackages/shokunin-auth/, components/auth-wrapper.tsx
Design tokens / Tailwind themeapp/globals.css (@theme inline block)
Firestore data accessdomains/<domain>/repositories/
AI agent pluginplugins/agent/src/
Documentation contentapps/mfe-docs/
Infrastructure (GCP)terraform/
Local dev infrastructureinfrastructure/, docker-compose.yml

Naming Conventions

TypeConventionExample
Fileskebab-case.tsxuser-profile.tsx, sidebar-nav.tsx
ComponentsPascalCaseUserProfile, SidebarNav
Functions/variablescamelCasefetchUserData, isLoading
Hooksuse prefixuseWorkshop, useAuth
ConstantsUPPER_SNAKE_CASEMAX_AGENTS, API_BASE_URL
Props interfacesPascalCase + Props suffixButtonProps, WorkshopCardProps
Domain repositoriesPascalCase + Repository suffixWorkshopRepository