Awesome Reviewers

Ensure all runtime and project configuration is explicit, type-safe, and machine-independent.

Motivation

Rules (actionable)

  1. Use a typed env accessor and parse values with defaults
    • Avoid raw process.env access across codebase. Use a shared helper (e.g. std-env or a thin wrapper) so values are typed and consistent.
    • Parse numeric/env values explicitly and provide sane defaults. Example: import { env } from ‘std-env’

    const preferredPort = env.PORT ? parseInt(env.PORT, 10) : 5173

  2. Put feature flags and experimental toggles in project config
    • Add an explicit experimental block to your project schema so flags are part of repository config and travel with the project/CI.
    • Prefer schema validation (Zod or equivalent) so configs are discoverable and validated at startup/build time. Example: export const LikeC4ExperimentalSchema = z.object({ dynamicViewBranches: z.boolean().optional().meta({ description: ‘…’ }) })

    export const LikeC4ProjectJsonConfigSchema = z.object({ // … experimental: LikeC4ExperimentalSchema.optional() })

  3. Normalize asset and file paths in generated/virtual modules
    • Disallow file:// URIs in model/config data. Convert them to repository-relative or project-root-relative paths.
    • When emitting imports in virtual modules for Vite, compute paths relative to the source file or use Vite’s filesystem prefix (/@fs) if appropriate. Test that ?inline requests resolve in dev and build.
    • Detect local images (e.g. startsWith(‘.’) or no protocol) and rewrite imports so Vite can resolve them: e.g. import Icon from './path/to/icon.svg?inline' or /@fs/path/to/icon.svg?inline after computing correct project-relative path.

Checks to run

Why this helps