Agent skill
grey-haven-code-style
Apply Grey Haven Studio's TypeScript/React and Python/FastAPI coding standards from production templates. Use when writing code, reviewing PRs, fixing linting errors, formatting files, or when the user mentions 'code standards', 'Grey Haven style', 'linting', 'Prettier', 'ESLint', 'Ruff', 'formatting rules', or 'coding conventions'. Includes exact Prettier/ESLint/Ruff configs, naming conventions, project structure, and multi-tenant database patterns.
Install this agent skill to your Project
npx add-skill https://github.com/greyhaven-ai/claude-code-config/tree/main/grey-haven-plugins/developer-experience/skills/code-style
SKILL.md
Grey Haven Code Style Standards
Actual coding standards from Grey Haven Studio production templates.
Follow these exactly when working on Grey Haven codebases. This skill provides navigation to detailed examples, reference configs, and templates.
Supporting Documentation
- EXAMPLES.md - Copy-paste code examples for TypeScript and Python
- REFERENCE.md - Complete config files and detailed rule explanations
- templates/ - Ready-to-use starter files
- checklists/ - Code review checklists
Quick Reference
TypeScript/React (Frontend)
Based on cvi-template - TanStack Start + React 19
Key Settings:
- Line width: 90 characters
- Tab width: 2 spaces
- Quotes: Double quotes
- Semicolons: Required
- Trailing commas: Always
- ESLint: Pragmatic (allows
any, unused vars) - Path alias:
~/maps to./src/*
Naming Conventions:
- Variables/Functions:
camelCase(getUserData,isAuthenticated) - Components:
PascalCase(UserProfile,AuthProvider) - Constants:
UPPER_SNAKE_CASE(API_BASE_URL,MAX_RETRIES) - Types/Interfaces:
PascalCase(User,AuthConfig) - Database fields:
snake_case(user_id,created_at,tenant_id) ⚠️ CRITICAL
Project Structure:
src/
├── routes/ # File-based routing (TanStack Router)
├── lib/
│ ├── components/ # UI components (grouped by feature)
│ ├── server/ # Server functions and DB schema
│ ├── config/ # Environment validation
│ ├── hooks/ # Custom React hooks (use-* naming)
│ ├── utils/ # Utility functions
│ └── types/ # TypeScript definitions
└── public/ # Static assets
Python/FastAPI (Backend)
Based on cvi-backend-template - FastAPI + SQLModel
Key Settings:
- Line length: 130 characters
- Indent: 4 spaces
- Type hints: Required on all functions
- Auto-fix: Ruff fixes issues automatically
Naming Conventions:
- Functions/Variables:
snake_case(get_user_data,is_authenticated) - Classes:
PascalCase(UserRepository,AuthService) - Constants:
UPPER_SNAKE_CASE(API_BASE_URL,MAX_RETRIES) - Database fields:
snake_case(user_id,created_at,tenant_id) ⚠️ CRITICAL - Boolean fields: Prefix with
is_orhas_(is_active,has_access)
Project Structure:
app/
├── config/ # Application settings
├── db/
│ ├── models/ # SQLModel entities
│ └── repositories/ # Repository pattern (tenant isolation)
├── routers/ # FastAPI endpoints
├── services/ # Business logic
├── schemas/ # Pydantic models (API contracts)
└── utils/ # Utilities
Database Field Convention (CRITICAL)
ALWAYS use snake_case for database column names - this is non-negotiable in Grey Haven projects.
✅ Correct:
// TypeScript - Drizzle schema
export const users = pgTable("users", {
id: uuid("id").primaryKey(),
created_at: timestamp("created_at").defaultNow(),
tenant_id: uuid("tenant_id").notNull(),
email_address: text("email_address").notNull(),
is_active: boolean("is_active").default(true),
});
# Python - SQLModel
class User(SQLModel, table=True):
id: UUID = Field(default_factory=uuid4, primary_key=True)
created_at: datetime = Field(default_factory=datetime.utcnow)
tenant_id: UUID = Field(foreign_key="tenants.id", index=True)
email_address: str = Field(unique=True, index=True)
is_active: bool = Field(default=True)
❌ Wrong:
// DON'T use camelCase in database schemas
export const users = pgTable("users", {
id: uuid("id"),
createdAt: timestamp("createdAt"), // WRONG!
tenantId: uuid("tenantId"), // WRONG!
emailAddress: text("emailAddress"), // WRONG!
});
See EXAMPLES.md for complete examples.
Multi-Tenant Architecture
Every database table must include tenant isolation:
- Field name:
tenant_id(snake_case in DB) ortenantId(camelCase in TypeScript code) - Type: UUID foreign key to tenants table
- Index: Always indexed for query performance
- RLS: Use Row Level Security policies for tenant isolation
- Repository pattern: All queries filter by
tenant_id
See EXAMPLES.md for implementation patterns.
Virtual Environment (Python Projects)
⚠️ ALWAYS activate virtual environment before running Python commands:
source .venv/bin/activate
Required for:
- Running tests (
pytest) - Running pre-commit hooks
- Using task commands (
task test,task format) - Any Python script execution
When to Apply This Skill
Use this skill when:
- ✅ Writing new TypeScript/React or Python/FastAPI code
- ✅ Reviewing code in pull requests
- ✅ Fixing linting or formatting errors
- ✅ Setting up new projects from templates
- ✅ Configuring Prettier, ESLint, or Ruff
- ✅ Creating database schemas
- ✅ Implementing multi-tenant features
- ✅ User mentions: "code standards", "linting rules", "Grey Haven style", "formatting"
Template References
These standards come from actual Grey Haven production templates:
- Frontend:
cvi-template(TanStack Start + React 19 + Drizzle) - Backend:
cvi-backend-template(FastAPI + SQLModel + PostgreSQL)
When in doubt, reference these templates for patterns and configurations.
Critical Reminders
- Line lengths: TypeScript=90, Python=130 (NOT 80/88)
- Database fields: ALWAYS
snake_case(both TypeScript and Python schemas) anytype: ALLOWED in Grey Haven TypeScript (pragmatic approach)- Double quotes: TypeScript uses double quotes (
singleQuote: false) - Type hints: REQUIRED in Python (
disallow_untyped_defs: true) - Virtual env: MUST activate before Python commands
- Multi-tenant: Every table has
tenant_id/tenantId - Path aliases: Use
~/for TypeScript imports fromsrc/ - Trailing commas: ALWAYS in TypeScript (
trailingComma: "all") - Pre-commit hooks: Run before every commit (both projects)
Next Steps
- Need examples? See EXAMPLES.md for copy-paste code
- Need configs? See REFERENCE.md for complete config files
- Need templates? See templates/ for starter files
- Reviewing code? Use checklists/ for systematic reviews
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
grey-haven-prompt-engineering
Master 26 documented prompt engineering principles for crafting effective LLM prompts with 400%+ quality improvement. Includes templates, anti-patterns, and quality checklists for technical, learning, creative, and research tasks. Use when writing prompts for LLMs, improving AI response quality, training on prompting, designing agent instructions, or when user mentions 'prompt engineering', 'better prompts', 'LLM quality', 'prompt templates', 'AI prompts', 'prompt principles', or 'prompt optimization'.
grey-haven-tool-design
Design effective MCP tools and Claude Code integrations using the consolidation principle. Fewer, better-designed tools dramatically improve agent success rates. Use when creating MCP servers, designing tool interfaces, optimizing tool sets, or when user mentions 'tool design', 'MCP', 'fewer tools', 'tool consolidation', 'tool architecture', or 'tool optimization'.
grey-haven-documentation-alignment
6-phase verification system ensuring code matches documentation with automated alignment scoring (signature, type, behavior, error, example checks). Reduces onboarding friction 40%. Use when verifying code-docs alignment, onboarding developers, after code changes, pre-release documentation checks, or when user mentions 'docs out of sync', 'documentation verification', 'code-docs alignment', 'docs accuracy', 'documentation drift', or 'verify documentation'.
grey-haven-tdd-orchestration
Master TDD orchestration with multi-agent coordination, strict red-green-refactor enforcement, automated test generation, coverage tracking, and >90% coverage quality gates. Supports Claude Teams for parallel TDD workflows with plan approval gates, or falls back to sequential subagent coordination. Coordinates tdd-python, tdd-typescript, and test-generator agents. Use when implementing features with TDD workflow, coordinating multiple TDD agents, enforcing test-first development, orchestrating TDD teams, or when user mentions 'TDD workflow', 'test-first', 'TDD orchestration', 'multi-agent TDD', 'test coverage', or 'red-green-refactor'.
grey-haven-performance-optimization
Comprehensive performance analysis and optimization for algorithms (O(n²)→O(n)), databases (N+1 queries, indexes), React (memoization, virtual lists), bundles (code splitting), API caching, and memory leaks. 85%+ improvement rate. Use when application is slow, response times exceed SLA, high CPU/memory usage, performance budgets needed, or when user mentions 'performance', 'slow', 'optimization', 'bottleneck', 'speed up', 'latency', 'memory leak', or 'performance tuning'.
grey-haven-llm-project-development
Build LLM-powered applications and pipelines using proven methodology - task-model fit analysis, pipeline architecture, structured outputs, file-based state, and cost estimation. Use when building AI features, data processing pipelines, agents, or any LLM-integrated system. Inspired by Karpathy's methodology and production case studies.
Didn't find tool you were looking for?