Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

grey-haven-ontological-documentation灰色天堂本体论文档

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

1

周安装

12

GitHub Stars

24

下载量

97
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:grey-haven-ontological-documentation(灰色天堂本体论文档)
来源仓库:https://github.com/greyhaven-ai/claude-code-config
仓库路径:skills/grey-haven-ontological-documentation
安装命令:
npx skills add https://github.com/greyhaven-ai/claude-code-config --skill grey-haven-ontological-documentation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/greyhaven-ai/claude-code-config --skill grey-haven-ontological-documentation

简介

用于辅助文档、README 和 Markdown 内容的整理与改写。

  • 适合提炼结构、补齐章节、统一术语或检查链接有效性。
  • 使用时需保留项目已有事实和路径,避免写成确定结论。
  • 涉及对外文案时应控制语气,避免过度营销或夸大能力。
  • 可结合项目实际内容进行结构化重组和语言优化。grey-haven-ontological-documentation 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Grey Haven Ontological Documentation

Create comprehensive ontological documentation that captures fundamental concepts, relationships, and classification systems within Grey Haven codebases and systems.

When to Use This Skill

Use this skill when you need to:

  • Document the conceptual structure and domain model of Grey Haven applications
  • Extract and organize business concepts from TanStack Start or FastAPI codebases
  • Create visual representations of multi-tenant system architectures
  • Build semantic maps of entities, services, and their tenant-isolated interactions
  • Design or document domain models for new Grey Haven features
  • Analyze and communicate complex architectures to stakeholders
  • Create knowledge graphs for Grey Haven development teams
  • Onboard new developers to Grey Haven project structure

Core Capabilities

1. Concept Extraction from Grey Haven Codebases

TanStack Start (Frontend) Extraction:

  • Drizzle schema tables and relationships
  • React components and their hierarchies
  • TanStack Router route structure
  • Better-auth session and user models
  • Server functions and their dependencies
  • Multi-tenant data patterns (tenant_id isolation)

FastAPI (Backend) Extraction:

  • SQLModel entities and relationships
  • Repository pattern implementations
  • Service layer business logic
  • API endpoint hierarchies
  • Multi-tenant repository filters
  • Pydantic schemas and validation models

2. Grey Haven Architecture Patterns

Identify and Document:

  • Multi-Tenant Patterns: tenant_id isolation, RLS roles (admin/authenticated/anon)
  • Repository Pattern: BaseRepository with automatic tenant filtering
  • Service Layer: Business logic separation from endpoints
  • Database Conventions: snake_case fields, UUID primary keys, timestamps
  • Authentication: Better-auth integration with session management
  • Deployment: Cloudflare Workers architecture

3. Visual Documentation Formats

Mermaid Diagrams (for README files):

erDiagram
    USER ||--o{ ORGANIZATION : belongs_to
    USER {
        uuid id PK
        string email_address UK
        uuid tenant_id FK
        timestamp created_at
    }
    ORGANIZATION ||--o{ TEAM : contains
    ORGANIZATION {
        uuid id PK
        string name
        uuid tenant_id FK
        timestamp created_at
    }

System Architecture:

graph TB
    Client[TanStack Start Client]
    Server[Server Functions]
    Auth[Better-auth]
    DB[(PostgreSQL + RLS)]

    Client -->|Authenticated Requests| Server
    Client -->|Auth Flow| Auth
    Server -->|Query with tenant_id| DB
    Auth -->|Session Validation| DB

4. Domain Model Documentation Template

## Entity: User

### Definition
Represents an authenticated user in the Grey Haven system with multi-tenant isolation.

### Database Schema
- **Table**: users (snake_case)
- **Primary Key**: id (UUID)
- **Tenant Isolation**: tenant_id (UUID, indexed)
- **Unique Constraints**: email_address per tenant
- **Timestamps**: created_at, updated_at (automatic)

### Relationships
- **Belongs To**: Organization (via tenant_id)
- **Has Many**: Sessions (Better-auth)
- **Has Many**: TeamMemberships

### Business Rules
- Email must be unique within tenant
- Cannot access data from other tenants
- Session expires after 30 days of inactivity
- RLS enforces tenant_id filtering at database level

### TypeScript Type

interface User { id: string; emailAddress: string; tenantId: string; createdAt: Date; updatedAt: Date; }


### Python Model

class User(SQLModel, table=True): __tablename__ = "users" id: UUID = Field(default_factory=uuid4, primary_key=True) email_address: str = Field(unique=True, index=True) tenant_id: UUID = Field(foreign_key="organizations.id", index=True) created_at: datetime = Field(default_factory=datetime.utcnow) updated_at: datetime = Field(default_factory=datetime.utcnow)

Workflow

Step 1: Discovery and Extraction

For TanStack Start Projects:

  1. Analyze Drizzle schema files in src/lib/server/schema/
  2. Map React component structure in src/lib/components/
  3. Document TanStack Router routes in src/routes/
  4. Extract server functions from src/lib/server/functions/
  5. Identify tenant isolation patterns

For FastAPI Projects:

  1. Analyze SQLModel models in app/db/models/
  2. Map repository pattern in app/db/repositories/
  3. Document service layer in app/services/
  4. Extract API routes from app/routers/
  5. Identify BaseRepository tenant filtering

Step 2: Ontology Construction

Categorize by Grey Haven Patterns:

  1. Core Entities (tables with tenant_id)

- User, Organization, Team, etc. - Always include tenant_id - UUID primary keys - snake_case field names

  1. Service Boundaries

- Repository layer (data access) - Service layer (business logic) - Router layer (API endpoints) - Clear separation of concerns

  1. Relationships and Dependencies

- Foreign key relationships - Repository dependencies - Service composition - API endpoint groupings

  1. Multi-Tenant Patterns

- RLS role usage (admin/authenticated/anon) - tenant_id filtering in repositories - Session-based tenant resolution - Cross-tenant access prevention

Step 3: Documentation Creation

Use Grey Haven Documentation Standards:

  1. Entity Documentation

- Definition and purpose - Database schema with exact field names - Relationships to other entities - Business rules and constraints - TypeScript and Python representations

  1. Service Documentation

- Service responsibilities - Repository dependencies - Business logic patterns - Multi-tenant considerations

  1. API Documentation

- Endpoint hierarchies - Request/response schemas - Authentication requirements - Tenant isolation verification

Step 4: Visualization

Create Diagrams For:

  1. Database ERD - All tables with relationships and tenant_id fields
  2. Service Dependencies - Repository → Service → Router layers
  3. Authentication Flow - Better-auth integration with multi-tenant context
  4. Deployment Architecture - Cloudflare Workers, Neon PostgreSQL, Redis
  5. Data Flow - Client → Server Functions → Repository → Database (with RLS)

Common Use Cases

Use Case 1: New Developer Onboarding

*"I need to understand how Grey Haven's multi-tenant architecture works."*

Approach:

  1. Extract all entities with tenant_id fields
  2. Document BaseRepository tenant filtering pattern
  3. Create ERD showing tenant_id relationships
  4. Explain RLS roles and session-based tenant resolution
  5. Show data flow with tenant isolation

Use Case 2: Feature Design Documentation

*"Document the domain model for the new billing feature before implementation."*

Approach:

  1. Design entity schema following Grey Haven conventions
  2. Plan repository and service layer structure
  3. Document API endpoints with tenant isolation
  4. Create Mermaid diagrams for the feature
  5. Validate multi-tenant patterns

Use Case 3: Architecture Review

*"Analyze the current codebase to identify inconsistencies in multi-tenant patterns."*

Approach:

  1. Extract all repositories and check tenant_id filtering
  2. Review entities for proper tenant_id indexing
  3. Audit RLS role usage across the application
  4. Identify missing tenant isolation
  5. Generate compliance report

Use Case 4: Legacy Code Analysis

*"Understand the original domain model before refactoring the user management system."*

Approach:

  1. Extract current User entity and relationships
  2. Map all services depending on User
  3. Document authentication flow with Better-auth
  4. Identify refactoring boundaries
  5. Create before/after architecture diagrams

Grey Haven Specific Patterns

Multi-Tenant Entity Pattern

// Drizzle Schema (TanStack Start)
export const usersTable = pgTable("users", {
  id: uuid("id").primaryKey().defaultRandom(),
  emailAddress: text("email_address").unique().notNull(),
  tenantId: uuid("tenant_id").references(() => organizationsTable.id).notNull(),
  createdAt: timestamp("created_at").defaultNow().notNull(),
  updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
# SQLModel (FastAPI)
class User(SQLModel, table=True):
    __tablename__ = "users"

    id: UUID = Field(default_factory=uuid4, primary_key=True)
    email_address: str = Field(unique=True, index=True)
    tenant_id: UUID = Field(foreign_key="organizations.id", index=True)
    created_at: datetime = Field(default_factory=datetime.utcnow)
    updated_at: datetime = Field(default_factory=datetime.utcnow)

Repository Pattern with Tenant Isolation

# BaseRepository with automatic tenant filtering
class BaseRepository(Generic[T]):
    def __init__(self, session: AsyncSession, model: type[T]):
        self.session = session
        self.model = model

    async def get_by_id(self, id: UUID, tenant_id: UUID) -> Optional[T]:
        """Automatic tenant isolation."""
        result = await self.session.execute(
            select(self.model)
            .where(self.model.id == id)
            .where(self.model.tenant_id == tenant_id)  # Always filter
        )
        return result.scalar_one_or_none()

RLS Role Pattern

// Database connections with RLS roles
const adminDb = drizzle(process.env.DATABASE_URL_ADMIN);      // Full access
const authenticatedDb = drizzle(process.env.DATABASE_URL_AUTHENTICATED); // Tenant-scoped
const anonDb = drizzle(process.env.DATABASE_URL_ANON);        // Public only

Documentation Output Structure

Directory Organization

documentation/
├── architecture/
│   ├── system-overview.md
│   ├── multi-tenant-architecture.md
│   └── deployment-architecture.md
├── domain-model/
│   ├── entities/
│   │   ├── user.md
│   │   ├── organization.md
│   │   └── team.md
│   ├── relationships.md
│   └── business-rules.md
├── diagrams/
│   ├── database-erd.mmd
│   ├── service-dependencies.mmd
│   ├── auth-flow.mmd
│   └── deployment.mmd
└── ontology.json

Ontology JSON Structure

{
  "version": "1.0.0",
  "system": "Grey Haven Application",
  "architecture": "Multi-tenant TanStack Start + FastAPI",
  "entities": [
    {
      "name": "User",
      "table": "users",
      "primaryKey": "id",
      "tenantKey": "tenant_id",
      "fields": [...],
      "relationships": [...],
      "businessRules": [...]
    }
  ],
  "services": [...],
  "patterns": {
    "multiTenant": true,
    "rls": true,
    "repositoryPattern": true
  }
}

When to Apply This Skill

Use ontological documentation when:

  • Onboarding new developers to Grey Haven projects
  • Designing new features with domain modeling
  • Documenting multi-tenant architecture
  • Analyzing legacy code before refactoring
  • Creating architecture presentations for stakeholders
  • Building knowledge bases for Grey Haven teams
  • Ensuring consistency across TanStack Start and FastAPI implementations
  • Auditing multi-tenant isolation patterns
  • Planning database migrations or schema changes

Integration with Other Grey Haven Skills

Works Best With:

  • grey-haven-database-conventions - Ensure proper schema design
  • grey-haven-project-structure - Understand codebase organization
  • grey-haven-authentication-patterns - Document Better-auth integration
  • grey-haven-data-modeling - Design Drizzle and SQLModel schemas
  • grey-haven-api-design-standards - Document API hierarchies

Critical Reminders

  1. Always document tenant_id - Every entity must show tenant isolation
  2. Follow naming conventions - snake_case for database, camelCase for TypeScript
  3. Include both TypeScript and Python - Grey Haven uses both stacks
  4. Show RLS roles - Document admin/authenticated/anon usage
  5. Repository pattern is required - All data access goes through repositories
  6. UUID primary keys - Never use auto-increment integers
  7. Timestamps are automatic - created_at and updated_at
  8. Multi-tenant first - Every design considers tenant isolation
  9. Visual diagrams required - Mermaid for all architecture documentation
  10. Cross-reference skills - Link to relevant Grey Haven skills

Template References

These patterns are from Grey Haven's actual templates:

  • Frontend: cvi-template (TanStack Start + React 19 + Drizzle)
  • Backend: cvi-backend-template (FastAPI + SQLModel + Repository Pattern)
  • Multi-tenant: Neon PostgreSQL with RLS

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.79%
按下载量换算33

Claude

29.88%
按下载量换算29

Cursor

19.1%
按下载量换算19

Gemini CLI

9.33%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills