Skip to content
RHL AIDirectives

Directives

The foundational engineering laws governing RHL AI software architecture, type safety, and agent behaviors.

DIRECTIVE 01

Decoupled Intelligence Duality

Enforced by RHL CLI registry validation and skills catalog linter.

Separate LLM prompt artifacts from compiled runtime code.

We separate LLM behavioral prompt artifacts from compiled runtime code. Agent skills live in structured markdown schemas with declarative YAML frontmatter, while packages remain feather-light with 0 KB bundle overhead.

# skills/code-reviewer/SKILL.md
---
name: code-reviewer
description: Expert AI code reviewer for strict TypeScript.
version: 1.0.0
---
## Decision Framework
1. Blocking (Must Fix)
2. Non-Blocking (Should Fix)
3. Nitpick (Optional)
DIRECTIVE 02

Absolute Zero Any Type Safety

Enforced by CI typecheck with noImplicitAny and strict compiler flags.

Zero any tolerance across all packages, tools, and interfaces.

The usage of any is strictly banned across all repositories, packages, tools, and APIs. Unsafe casts, implicit anys, and loose records are blocked at compile time with strict TypeScript and zero-warning ESLint rules.

// Strictly forbidden:
function handleData(data: any): any { ... }

// Enforced alternative:
function handleData<T extends Record<string, unknown>>(
  data: T
): ValidatedPayload<T> { ... }
DIRECTIVE 03

Agent-Native Ergonomics

Enforced by standardized SKILL.md template guidelines and validation scripts.

Structured markdown formats designed for AI reasoning.

Prompts and operating directives are formatted for machine readability and cognitive clarity. Clear operating loops, negative constraints, and exact output contracts ensure autonomous coding agents deliver deterministic results.

## Operating Loop
1. Frame -> Target device, user journey, target metric
2. Measure -> RUM, CrUX, or reproducible traces
3. Localize -> Network, bundle, rendering, or interaction
4. Implement -> Smallest justified change
5. Verify -> Measure exact same metric under same conditions
DIRECTIVE 04

Modular Monorepo Cohesion

Enforced by pnpm workspaces and turborepo pipeline configurations.

Independent packages unified through Turborepo.

Every package in the @rhl-ai namespace functions as an independent, single-responsibility module with explicit boundaries. High-performance Turborepo caching guarantees instantaneous incremental builds.

pnpm-workspace.yaml:
packages:
  - 'packages/*'
  - 'apps/*'
  - 'projects/*'