| name | practice-hub-docs-search |
| description | Search Practice Hub documentation for architecture, API reference, database schema, integrations, and implementation patterns. Triggers when user asks about multi-tenancy, authentication, tRPC routers, database, Better Auth, pricing calculator, Client Hub, Proposal Hub, Admin Panel, Client Portal, design system, integrations (LEM Verify, Gemini AI, DocuSeal, S3), or implementation patterns. |
| allowed-tools | Read, Grep, Glob |
Practice Hub Documentation Search Skill
Purpose: Provide comprehensive, context-aware documentation search for Practice Hub development tasks.
Trigger Patterns: This skill automatically activates when the user asks about:
- Multi-tenancy architecture (tenant isolation, dual isolation with tenantId + clientId)
- Authentication systems (Better Auth dual system, staff vs client portal)
- tRPC API design (creating routers, protected procedures, context)
- Database schema (tables, views, indexes, migrations)
- Integrations (LEM Verify KYC, Google Gemini AI, DocuSeal e-signature, S3 storage, Xero)
- Practice Hub modules (Client Hub, Proposal Hub, Admin Panel, Client Portal)
- Pricing calculator (28 services, 138+ rules, service components)
- Design system (glass-card patterns, shadcn/ui components)
- Implementation patterns and coding standards
How This Skill Works
- Code Index Lookup - Fast function/type signature lookups with file:line references
- Concept Search - Finds all relevant docs across 6 domains (Architecture, API, Guides, Operations, Stories, QA)
- Context Assembly - Returns comprehensive context for implementation tasks
Available Searches
By Query Type
Architecture Questions:
- "How does multi-tenancy work?"
- "What's the authentication architecture?"
- "Show me the complete tRPC design"
- "How is the database structured?"
API Reference:
- "What's the signature for getAuthContext?"
- "Show me the clients router"
- "How do I create a protected procedure?"
- "What's in the proposals router?"
Implementation Guidance:
- "I'm implementing a new tRPC router"
- "How do I add a new table?"
- "I need to implement client portal authentication"
- "Show me pricing calculator patterns"
Integration Questions:
- "How does LEM Verify integration work?"
- "Show me the Gemini AI document extraction"
- "How do I use DocuSeal for e-signatures?"
- "What's the S3 storage pattern?"
By Concept
The skill indexes 10+ core concepts:
- Multi-Tenancy - Dual-level isolation (tenantId + clientId), schema patterns, query examples
- Authentication - Better Auth dual system, staff vs client portal, session management
- tRPC API Design - Protected procedures, context creation, router patterns, query/mutation examples
- Database Schema - 50+ tables, 14 views, 5 performance indexes, migration patterns
- Integrations - LEM Verify (KYC), Google Gemini (AI), DocuSeal (e-signature), S3 (storage), Xero (accounting)
- Client Hub - CRM module, client management, contacts, directors, PSCs, services
- Proposal Hub - Pricing calculator, proposal generation, lead management, analytics
- Admin Panel - User management, KYC review queue, portal link management
- Client Portal - External client access, onboarding flow, dual isolation patterns
- Design System - Glass-card patterns, shadcn/ui components, module styling, layout backgrounds
Documentation Domains
This skill searches across 6 documentation domains:
- Architecture (
docs/architecture/) - System design, patterns, technical architecture - API Reference (
docs/reference/) - tRPC routers, database schema, configuration - Guides (
docs/guides/) - Integration setup, how-to guides - Operations (
docs/operations/) - Deployment, monitoring, backup/recovery - Stories (
docs/stories/) - User stories, feature specifications - QA (
docs/qa/) - QA assessments, test plans, quality gates
Code Index
The skill maintains a searchable index of:
- Functions - All exported functions with JSDoc documentation
- Types - TypeScript interfaces, types, schemas
- Components - React components with props documentation
- Routers - tRPC router definitions with procedure signatures
Each entry includes:
- File path and line number
- Function signature with parameters
- Description from JSDoc/comments
- Usage examples (when available)
Usage Examples
Example 1: Function Signature Lookup
Query: "What's the signature for getAuthContext?"
Returns:
Function: getAuthContext
Location: lib/auth.ts:125
Signature: async function getAuthContext(): Promise<AuthContext | null>
Description: Retrieves authenticated user's session with tenant context
Returns: AuthContext with userId, tenantId, role, email
Example: const authContext = await getAuthContext();
Example 2: Concept Search
Query: "Show me the complete multi-tenancy system"
Returns:
- Architecture doc:
docs/architecture/multi-tenancy.md - API reference:
docs/reference/database/schema.md(schema patterns) - Code examples:
lib/auth.ts(getAuthContext),app/server/context.ts(tRPC context) - Patterns: Query examples, dual isolation patterns
Example 3: Implementation Context
Query: "I'm implementing a new tRPC router"
Returns:
- Architecture:
docs/architecture/api-design.md(router patterns) - Reference:
docs/reference/api/routers.md(existing routers) - Code examples:
app/server/routers/clients.ts(sample router) - Patterns: Protected procedures, context usage, error handling
Integration with Practice Hub Workflow
This skill is designed to work seamlessly with Practice Hub's development workflow:
- Respects CLAUDE.md rules - Always checks critical development rules before providing guidance
- Context-aware suggestions - Knows about Practice Hub's tech stack (Next.js 15, Better Auth, tRPC, PostgreSQL)
- Brownfield-aware - References actual implementation patterns, not idealized examples
- Quality gate enforcement - Reminds about design system constraints, no-migration policy, error tracking policy
Skill Behavior
When Activated:
- Reads relevant documentation files from
docs/ - Searches code index for matching functions/types
- Assembles comprehensive context with file:line references
- Returns structured response with sections: Architecture, API, Patterns, Examples
What This Skill Does NOT Do:
- Does not write code (only provides documentation and context)
- Does not modify files (read-only skill)
- Does not execute commands (documentation search only)
Maintenance
Auto-regeneration: The code index and TypeScript API docs are automatically regenerated on every git commit via pre-commit hook.
Manual regeneration:
pnpm docs:generate:all
Update frequency: Documentation should be updated whenever:
- New functions/types are added with JSDoc
- Documentation files are created/updated in
docs/ - New concepts/features are added to the system
Related Skills
- practice-hub-testing - Generate router tests, validate multi-tenant isolation
- practice-hub-debugging - Find/remove console.log statements, track TODOs
- practice-hub-database-ops - Validate schema, check seed consistency, safe database reset
- brand-guidelines - Enforce Practice Hub design standards
- artifacts-builder - Build UI components following Practice Hub design system
Skill Version: 1.0.0 Last Updated: 2025-10-26 Maintained By: Development Team