Skip to content

tylercore/Treg

Repository files navigation

@tylercore/treg

npm version License npm downloads TypeScript CLI

English | 繁體中文 | Español | 日本語


Overview

What is Treg?

Treg is a CLI tool that sets up code quality, tooling, and project standards for modern applications.

It injects an engineering immune system into your project.

When developers and AI collaborate under fast iteration, codebases tend to drift—leading to inconsistent tooling, duplicated rules, and fragile workflows.
Treg acts like a regulatory T cell: it restores balance, suppresses unnecessary chaos, and keeps your repository clean, maintainable, and extensible.

Instead of generating application logic, Treg focuses on the engineering baseline—configuring tools like ESLint, Prettier, and TypeScript to protect your project from long-term entropy.

Regulate the workflow before the workflow regulates you.


Why Treg

Modern projects can move fast, especially with AI-assisted coding.
But speed without constraints often creates invisible damage:

  • style drift
  • inconsistent tooling
  • weak commit hygiene
  • missing tests
  • unclear AI usage rules

Treg solves that by applying a consistent baseline to an existing repository with a single initialization flow.


What Treg Sets Up

Treg can configure:

  • TypeScript
  • Linting with ESLint
  • Formatting with Prettier or Oxfmt
  • Testing with Jest or Vitest
  • Git hooks with Husky
  • AI rules guidance for supported tools

This keeps the project stable without forcing application-level architecture decisions.


Quick Start

Initialize interactively:

npx @tylercore/treg init

Preview changes only:

npx @tylercore/treg init --dry-run

Add features to an existing project:

npx @tylercore/treg add --features lint,format

Commands

Command Description
init Initialize the project with an interactive setup flow
add Add selected features to an existing project
list Show supported frameworks, features, formatters, and test runners

Init Interactive Flow

During init, Treg asks for:

  1. Package manager
    pnpm | npm | yarn | bun

  2. Features (multi-select, selected by default)

    • lint
    • format
    • TypeScript
    • test
    • husky
    • AI rules guidance
  3. Test runner (only when test is selected)

    • jest
    • vitest
    • skip
  4. Formatter (only when format is selected)

    • prettier
    • oxfmt
  5. AI tools (only when AI rules guidance is selected)

    • Claude
    • Codex
    • Gemini

Common Usage

Initialize project:

npx @tylercore/treg init

Preview init plan only:

npx @tylercore/treg init --dry-run

Add only lint + format:

npx @tylercore/treg add --features lint,format

Add format using oxfmt:

npx @tylercore/treg add --features format --formatter oxfmt

Add test using vitest:

npx @tylercore/treg add --features test --test-runner vitest

CLI Options

init

--dry-run
--help

add

--framework <node|react|next|vue|svelte|nuxt>
--features <lint,format,typescript,test,husky>
--dir <path>
--formatter <prettier|oxfmt>
--test-runner <jest|vitest>
--force
--dry-run
--skip-husky-install
--help

Defaults

Framework Detection

Detection order:

nuxt -> next -> react -> vue -> svelte -> node

Test Runner

  • vue / nuxt: vitest
  • others: jest

Formatter

  • prettier

AI Rules Behavior

Treg can update AI guidance files for selected tools:

Tool File
Claude CLAUDE.md
Codex AGENTS.md
Gemini GEMINI.md

Behavior:

  • only selected tools are updated
  • selected docs are created automatically when missing
  • updates happen in the repository root
  • prompts are written directly inside each selected AI guidance document

Philosophy

Treg is intentionally narrow in scope.

It does not try to be a full project generator.
It does not replace team judgment.
It does not force product architecture.

It exists to establish the engineering immune layer that keeps rapid iteration from degrading the codebase over time.


Built to regulate chaotic iteration and protect long-term codebase health.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors