@tyyyho/treg 0.1.25 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,70 +1,151 @@
1
1
  # @tyyyho/treg
2
2
 
3
- Treg (Regulatory T Cell) injects an "immune system" into existing repositories.
4
- It keeps code quality and consistency stable during fast human-AI collaboration by enforcing a clean, maintainable, and extensible engineering baseline.
3
+ [![npm
4
+ version](https://img.shields.io/npm/v/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
5
+ [![npm
6
+ downloads](https://img.shields.io/npm/dm/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
7
+ [![License](https://img.shields.io/npm/l/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
8
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)
5
9
 
6
- Scope:
10
+ ## Overview
7
11
 
8
- - lint
9
- - format
10
- - TypeScript
11
- - test
12
- - husky
13
- - AI skill guidance
12
+ **treg** is a CLI tool that injects an **engineering immune system** into your project.
14
13
 
15
- Quick start:
14
+ When humans and AI collaborate and iterate rapidly, repositories often
15
+ accumulate inconsistent tooling, style drift, and fragile workflows.\
16
+ `treg` helps maintain balance by establishing a clean and consistent
17
+ development baseline.
18
+
19
+ It focuses only on **infrastructure setup**, not application logic.
20
+
21
+ ---
22
+
23
+ ## Features
24
+
25
+ `treg` can configure:
26
+
27
+ - **TypeScript**
28
+ - **ESLint**
29
+ - **Prettier / Oxfmt**
30
+ - **Jest / Vitest**
31
+ - **Husky git hooks**
32
+ - **AI skill guidance**
33
+
34
+ These guardrails help maintain long‑term code health during fast
35
+ iteration.
36
+
37
+ ---
38
+
39
+ ## Quick Start
40
+
41
+ Initialize a project interactively:
16
42
 
17
43
  ```bash
18
44
  npx @tyyyho/treg init
19
45
  ```
20
46
 
21
- Commands:
47
+ Preview changes:
48
+
49
+ ```bash
50
+ npx @tyyyho/treg init --dry-run
51
+ ```
22
52
 
23
- - `init`
24
- - `add`
25
- - `list`
53
+ ---
26
54
 
27
- `init` interactive questions:
55
+ ## Commands
28
56
 
29
- 1. package manager (`pnpm|npm|yarn|bun`)
30
- 2. features (default: `all`)
31
- 3. test runner (if `test` is selected, supports `skip`)
32
- 4. formatter (if `format` is selected)
33
- 5. ai tools (`Claude|Codex|Gemini`, multi-select, if AI skill guidance is selected)
57
+ Command Description
34
58
 
35
- `add` examples:
59
+ ---
60
+
61
+ `init` Initialize project with interactive setup
62
+ `add` Add selected features
63
+ `list` Show supported frameworks and tools
64
+
65
+ ---
66
+
67
+ ## Common Usage
68
+
69
+ Add lint and format:
36
70
 
37
71
  ```bash
38
72
  npx @tyyyho/treg add --features lint,format
73
+ ```
74
+
75
+ Add format with `oxfmt`:
76
+
77
+ ```bash
39
78
  npx @tyyyho/treg add --features format --formatter oxfmt
79
+ ```
80
+
81
+ Add test with `vitest`:
82
+
83
+ ```bash
40
84
  npx @tyyyho/treg add --features test --test-runner vitest
41
85
  ```
42
86
 
43
- Options:
87
+ ---
44
88
 
45
- `init`:
89
+ ## Defaults
46
90
 
47
- ```text
48
- --dry-run
49
- --help
50
- ```
91
+ Framework detection order:
92
+
93
+ nuxt -> next -> react -> vue -> svelte -> node
94
+
95
+ Default test runner:
96
+
97
+ - `vue` / `nuxt`: `vitest`
98
+ - others: `jest`
99
+
100
+ Default formatter:
101
+
102
+ prettier
103
+
104
+ ---
105
+
106
+ ## AI Skills
107
+
108
+ `treg` can update AI guidance files for development tools.
109
+
110
+ Tool File
51
111
 
52
- `add`:
53
-
54
- ```text
55
- --framework <node|react|next|vue|svelte|nuxt>
56
- --features <lint,format,typescript,test,husky>
57
- --dir <path>
58
- --formatter <prettier|oxfmt>
59
- --test-runner <jest|vitest>
60
- --force
61
- --dry-run
62
- --skip-husky-install
63
- --help
112
+ ---
113
+
114
+ Claude `CLAUDE.md`
115
+ Codex `AGENTS.md`
116
+ Gemini `GEMINI.md`
117
+
118
+ Behavior:
119
+
120
+ - only selected tools are updated
121
+ - missing files are created automatically
122
+ - updates occur in the repository root
123
+
124
+ ---
125
+
126
+ ## Philosophy
127
+
128
+ `treg` is intentionally minimal.
129
+
130
+ It does not generate application architecture.\
131
+ It focuses only on establishing the engineering infrastructure that
132
+ keeps repositories healthy during rapid development.
133
+
134
+ ---
135
+
136
+ ## Release
137
+
138
+ ```bash
139
+ npm run release -- patch
64
140
  ```
65
141
 
66
- Defaults:
142
+ Supported targets:
67
143
 
68
- - framework detect order: `nuxt -> next -> react -> vue -> svelte -> node`
69
- - test runner: `vue/nuxt = vitest`, others = `jest`
70
- - formatter: `prettier`
144
+ patch
145
+ minor
146
+ major
147
+ prepatch
148
+ preminor
149
+ premajor
150
+ prerelease
151
+ x.y.z
package/README.npm.md CHANGED
@@ -1,70 +1,151 @@
1
1
  # @tyyyho/treg
2
2
 
3
- Treg (Regulatory T Cell) injects an "immune system" into existing repositories.
4
- It keeps code quality and consistency stable during fast human-AI collaboration by enforcing a clean, maintainable, and extensible engineering baseline.
3
+ [![npm
4
+ version](https://img.shields.io/npm/v/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
5
+ [![npm
6
+ downloads](https://img.shields.io/npm/dm/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
7
+ [![License](https://img.shields.io/npm/l/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
8
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)
5
9
 
6
- Scope:
10
+ ## Overview
7
11
 
8
- - lint
9
- - format
10
- - TypeScript
11
- - test
12
- - husky
13
- - AI skill guidance
12
+ **treg** is a CLI tool that injects an **engineering immune system** into your project.
14
13
 
15
- Quick start:
14
+ When humans and AI collaborate and iterate rapidly, repositories often
15
+ accumulate inconsistent tooling, style drift, and fragile workflows.\
16
+ `treg` helps maintain balance by establishing a clean and consistent
17
+ development baseline.
18
+
19
+ It focuses only on **infrastructure setup**, not application logic.
20
+
21
+ ---
22
+
23
+ ## Features
24
+
25
+ `treg` can configure:
26
+
27
+ - **TypeScript**
28
+ - **ESLint**
29
+ - **Prettier / Oxfmt**
30
+ - **Jest / Vitest**
31
+ - **Husky git hooks**
32
+ - **AI skill guidance**
33
+
34
+ These guardrails help maintain long‑term code health during fast
35
+ iteration.
36
+
37
+ ---
38
+
39
+ ## Quick Start
40
+
41
+ Initialize a project interactively:
16
42
 
17
43
  ```bash
18
44
  npx @tyyyho/treg init
19
45
  ```
20
46
 
21
- Commands:
47
+ Preview changes:
48
+
49
+ ```bash
50
+ npx @tyyyho/treg init --dry-run
51
+ ```
22
52
 
23
- - `init`
24
- - `add`
25
- - `list`
53
+ ---
26
54
 
27
- `init` interactive questions:
55
+ ## Commands
28
56
 
29
- 1. package manager (`pnpm|npm|yarn|bun`)
30
- 2. features (default: `all`)
31
- 3. test runner (if `test` is selected, supports `skip`)
32
- 4. formatter (if `format` is selected)
33
- 5. ai tools (`Claude|Codex|Gemini`, multi-select, if AI skill guidance is selected)
57
+ Command Description
34
58
 
35
- `add` examples:
59
+ ---
60
+
61
+ `init` Initialize project with interactive setup
62
+ `add` Add selected features
63
+ `list` Show supported frameworks and tools
64
+
65
+ ---
66
+
67
+ ## Common Usage
68
+
69
+ Add lint and format:
36
70
 
37
71
  ```bash
38
72
  npx @tyyyho/treg add --features lint,format
73
+ ```
74
+
75
+ Add format with `oxfmt`:
76
+
77
+ ```bash
39
78
  npx @tyyyho/treg add --features format --formatter oxfmt
79
+ ```
80
+
81
+ Add test with `vitest`:
82
+
83
+ ```bash
40
84
  npx @tyyyho/treg add --features test --test-runner vitest
41
85
  ```
42
86
 
43
- Options:
87
+ ---
44
88
 
45
- `init`:
89
+ ## Defaults
46
90
 
47
- ```text
48
- --dry-run
49
- --help
50
- ```
91
+ Framework detection order:
92
+
93
+ nuxt -> next -> react -> vue -> svelte -> node
94
+
95
+ Default test runner:
96
+
97
+ - `vue` / `nuxt`: `vitest`
98
+ - others: `jest`
99
+
100
+ Default formatter:
101
+
102
+ prettier
103
+
104
+ ---
105
+
106
+ ## AI Skills
107
+
108
+ `treg` can update AI guidance files for development tools.
109
+
110
+ Tool File
51
111
 
52
- `add`:
53
-
54
- ```text
55
- --framework <node|react|next|vue|svelte|nuxt>
56
- --features <lint,format,typescript,test,husky>
57
- --dir <path>
58
- --formatter <prettier|oxfmt>
59
- --test-runner <jest|vitest>
60
- --force
61
- --dry-run
62
- --skip-husky-install
63
- --help
112
+ ---
113
+
114
+ Claude `CLAUDE.md`
115
+ Codex `AGENTS.md`
116
+ Gemini `GEMINI.md`
117
+
118
+ Behavior:
119
+
120
+ - only selected tools are updated
121
+ - missing files are created automatically
122
+ - updates occur in the repository root
123
+
124
+ ---
125
+
126
+ ## Philosophy
127
+
128
+ `treg` is intentionally minimal.
129
+
130
+ It does not generate application architecture.\
131
+ It focuses only on establishing the engineering infrastructure that
132
+ keeps repositories healthy during rapid development.
133
+
134
+ ---
135
+
136
+ ## Release
137
+
138
+ ```bash
139
+ npm run release -- patch
64
140
  ```
65
141
 
66
- Defaults:
142
+ Supported targets:
67
143
 
68
- - framework detect order: `nuxt -> next -> react -> vue -> svelte -> node`
69
- - test runner: `vue/nuxt = vitest`, others = `jest`
70
- - formatter: `prettier`
144
+ patch
145
+ minor
146
+ major
147
+ prepatch
148
+ preminor
149
+ premajor
150
+ prerelease
151
+ x.y.z
package/README.zh-hant.md CHANGED
@@ -1,59 +1,131 @@
1
+ <div align="center">
2
+
3
+ <img src="https://capsule-render.vercel.app/api?type=waving&color=0:0F172A,30:1D4ED8,70:7C3AED,100:22C55E&height=260&section=header&text=treg&fontSize=72&fontColor=ffffff&animation=fadeIn&fontAlignY=38&desc=Inject%20an%20immune%20system%20into%20your%20codebase&descSize=20&descAlignY=58" width="100%" />
4
+
1
5
  # @tyyyho/treg(繁體中文)
2
6
 
3
- [![npm version](https://img.shields.io/npm/v/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
4
- [![License](https://img.shields.io/npm/l/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
5
- [![npm downloads](https://img.shields.io/npm/dm/%40tyyyho%2Ftreg)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
6
- ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)
7
+ [![npm version](https://img.shields.io/npm/v/%40tyyyho%2Ftreg?style=for-the-badge)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
8
+ [![License](https://img.shields.io/npm/l/%40tyyyho%2Ftreg?style=for-the-badge)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
9
+ [![npm downloads](https://img.shields.io/npm/dm/%40tyyyho%2Ftreg?style=for-the-badge)](https://www.npmjs.com/package/%40tyyyho%2Ftreg)
10
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?style=for-the-badge&logo=typescript&logoColor=white)
11
+ ![CLI](https://img.shields.io/badge/CLI-Interactive-111827?style=for-the-badge&logo=gnubash&logoColor=white)
7
12
 
8
13
  [English README](./README.md)
9
14
 
10
- Treg(Regulatory T Cell)是一個為專案注入「免疫系統」的 CLI 工具。
11
- 當人與 AI 協作並快速迭代時,程式碼容易失去秩序與一致性;`treg` 的角色就像生物中的 T 細胞,負責維持系統平衡、抑制混亂,確保專案在快速迭代中仍然保持乾淨、可維護與可擴展。
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 概覽
20
+
21
+ **treg**
22
+
23
+ 它是一個為專案注入「免疫系統」的 CLI 工具。
24
+ 當開發者與 AI 高速協作時,程式碼庫很容易出現規範不一致、規則重複、流程脆弱等問題。
25
+ `treg` 的角色就像調節型 T 細胞:協助恢復平衡、抑制可避免的混亂,讓專案維持 **乾淨、可維護、可擴展**。
26
+
27
+ `treg` 不產生產品商業邏輯,而是專注於建立可長期保持穩定的工程基線。
28
+
29
+ > **先規範開發流程,才不會被流程反過來牽制。**
30
+
31
+ ---
32
+
33
+ ## 為什麼需要 treg
34
+
35
+ 在 AI 輔助開發時代,專案速度可以很快。
36
+ 但速度若缺少約束,通常會留下看不見的技術債:
37
+
38
+ - 風格漂移
39
+ - 工具鏈不一致
40
+ - commit 衛生不足
41
+ - 測試覆蓋缺漏
42
+ - AI 使用規則不清
43
+
44
+ `treg` 透過一次初始化流程,把一致的工程基線套用到既有 repository。
12
45
 
13
- 透過一次性的初始化,`treg` 會為既有專案建立一套穩定的工程基線,例如 TypeScript、ESLint、Prettier、Husky 以及規範化設定,讓開發流程具備基本的「免疫防護」,避免錯誤與風格混亂在專案中持續累積。
14
- 它只處理基礎設施設定:
46
+ ---
15
47
 
16
- - lint
17
- - format
18
- - TypeScript
19
- - test
20
- - husky
21
- - AI skill 指引
48
+ ## treg 會建立什麼
49
+
50
+ `treg` 可配置:
51
+
52
+ - **TypeScript**
53
+ - **Linting**(ESLint)
54
+ - **Formatting**(Prettier 或 Oxfmt)
55
+ - **Testing**(Jest 或 Vitest)
56
+ - **Git hooks**(Husky)
57
+ - **AI skill guidance**(支援的 AI 工具說明)
58
+
59
+ 這能穩定專案品質,同時不強制你採用特定產品架構。
60
+
61
+ ---
22
62
 
23
63
  ## 快速開始
24
64
 
65
+ 互動式初始化:
66
+
25
67
  ```bash
26
68
  npx @tyyyho/treg init
27
69
  ```
28
70
 
29
- ## 指令總覽
71
+ 只預覽變更:
72
+
73
+ ```bash
74
+ npx @tyyyho/treg init --dry-run
75
+ ```
76
+
77
+ 為既有專案補上指定功能:
78
+
79
+ ```bash
80
+ npx @tyyyho/treg add --features lint,format
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 指令
86
+
87
+ | Command | 說明 |
88
+ | ------- | ----------------------------------------------------- |
89
+ | `init` | 以互動流程初始化專案基線 |
90
+ | `add` | 為既有專案加入指定功能 |
91
+ | `list` | 列出支援的 framework、feature、formatter、test runner |
92
+
93
+ ---
94
+
95
+ ## init 互動流程
96
+
97
+ 執行 `init` 時,`treg` 會依序詢問:
30
98
 
31
- - `init`:初始化功能。
32
- - `add`:只為既有專案加入指定功能。
33
- - `list`:列出支援的 framework/feature/formatter/test runner。
99
+ 1. **Package manager**
100
+ `pnpm | npm | yarn | bun`
34
101
 
35
- ## Init 互動流程
102
+ 2. **Features**(可複選,預設全選)
103
+ - lint
104
+ - format
105
+ - TypeScript
106
+ - test
107
+ - husky
108
+ - AI skill guidance
36
109
 
37
- 執行 `init` 後,`treg` 會依序詢問:
110
+ 3. **Test runner**(僅在選到 `test` 時詢問)
111
+ - `jest`
112
+ - `vitest`
113
+ - `skip`
38
114
 
39
- 1. 套件管理器(`pnpm|npm|yarn|bun`)
40
- 2. 要加入的功能(可複選,預設全勾)
41
- 3. 測試工具(僅在選到 `test` 時詢問,支援 `skip`)
42
- 4. Formatter(僅在選到 `format` 時詢問)
43
- 5. AI 工具(`Claude|Codex|Gemini` 可複選,僅在選到 AI skill guidance 時詢問)
115
+ 4. **Formatter**(僅在選到 `format` 時詢問)
116
+ - `prettier`
117
+ - `oxfmt`
44
118
 
45
- 預設勾選功能:
119
+ 5. **AI tools**(僅在選到 AI skill guidance 時詢問)
120
+ - Claude
121
+ - Codex
122
+ - Gemini
46
123
 
47
- - lint
48
- - format
49
- - TypeScript
50
- - test
51
- - husky
52
- - AI skill guidance
124
+ ---
53
125
 
54
126
  ## 常見用法
55
127
 
56
- 初始化:
128
+ 初始化專案:
57
129
 
58
130
  ```bash
59
131
  npx @tyyyho/treg init
@@ -83,16 +155,18 @@ test 使用 `vitest`:
83
155
  npx @tyyyho/treg add --features test --test-runner vitest
84
156
  ```
85
157
 
158
+ ---
159
+
86
160
  ## CLI 參數
87
161
 
88
- `init` 可用參數:
162
+ ### `init`
89
163
 
90
164
  ```text
91
165
  --dry-run
92
166
  --help
93
167
  ```
94
168
 
95
- `add` 可用參數:
169
+ ### `add`
96
170
 
97
171
  ```text
98
172
  --framework <node|react|next|vue|svelte|nuxt>
@@ -106,30 +180,59 @@ npx @tyyyho/treg add --features test --test-runner vitest
106
180
  --help
107
181
  ```
108
182
 
183
+ ---
184
+
109
185
  ## 預設行為
110
186
 
111
- framework 偵測順序:
187
+ ### Framework 偵測
188
+
189
+ 偵測順序:
112
190
 
113
- `nuxt -> next -> react -> vue -> svelte -> node`
191
+ ```text
192
+ nuxt -> next -> react -> vue -> svelte -> node
193
+ ```
114
194
 
115
- 測試工具預設:
195
+ ### Test Runner
116
196
 
117
197
  - `vue` / `nuxt`:`vitest`
118
198
  - 其他:`jest`
119
199
 
120
- formatter 預設:
200
+ ### Formatter
121
201
 
122
202
  - `prettier`
123
203
 
204
+ ---
205
+
124
206
  ## AI Skills 行為
125
207
 
126
- - 只會更新選擇的 AI 工具對應檔案:
127
- - `Claude -> CLAUDE.md`
128
- - `Codex -> AGENTS.md`
129
- - `Gemini -> GEMINI.md`
130
- - 若檔案已存在會直接更新。
131
- - 選擇的 AI 工具對應檔案不存在時,會先自動建立再注入說明。
132
- - 每個啟用功能的 skill 檔只會建立一次。
208
+ `treg` 可更新所選 AI 工具的說明文件:
209
+
210
+ | Tool | File |
211
+ | ------ | ----------- |
212
+ | Claude | `CLAUDE.md` |
213
+ | Codex | `AGENTS.md` |
214
+ | Gemini | `GEMINI.md` |
215
+
216
+ 行為規則:
217
+
218
+ - 只更新你選擇的工具
219
+ - 缺少的對應文件會自動建立
220
+ - 更新發生在 repository root
221
+ - 每個啟用 feature 的 skill 檔只會生成一次
222
+
223
+ ---
224
+
225
+ ## 核心理念
226
+
227
+ `treg` 的設計刻意保持單一職責。
228
+
229
+ 它 **不** 是完整專案產生器。
230
+ 它 **不** 取代團隊判斷。
231
+ 它 **不** 強制產品架構。
232
+
233
+ 它的目標是建立工程免疫層,避免快速迭代持續侵蝕程式碼品質。
234
+
235
+ ---
133
236
 
134
237
  ## 發布
135
238
 
@@ -139,11 +242,21 @@ npm run release -- patch
139
242
 
140
243
  支援目標:
141
244
 
142
- - `patch`
143
- - `minor`
144
- - `major`
145
- - `prepatch`
146
- - `preminor`
147
- - `premajor`
148
- - `prerelease`
149
- - 指定版本(`x.y.z`)
245
+ ```text
246
+ patch
247
+ minor
248
+ major
249
+ prepatch
250
+ preminor
251
+ premajor
252
+ prerelease
253
+ x.y.z
254
+ ```
255
+
256
+ ---
257
+
258
+ <div align="center">
259
+ <sub>Built to regulate chaotic iteration and protect long-term codebase health.</sub>
260
+ <br />
261
+ <img src="https://capsule-render.vercel.app/api?type=waving&color=0:22C55E,40:06B6D4,75:3B82F6,100:7C3AED&height=120&section=footer" width="100%" />
262
+ </div>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tyyyho/treg",
3
- "version": "0.1.25",
4
- "description": "Treg (Regulatory T Cell) is a CLI tool that injects an engineering \"immune system\" into existing projects.",
3
+ "version": "1.0.0",
4
+ "description": "Treg is a CLI tool that injects an engineering immune system into existing projects.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",