@torus-engineering/tas-kit 1.9.0 → 1.10.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/.claude/commands/tas-security.md +7 -1
- package/.tas/README.md +334 -1588
- package/.tas/hooks/README.md +138 -0
- package/.tas/hooks/pre-commit +26 -0
- package/.tas/hooks/security-scan.js +599 -0
- package/.tas/tas-example.yaml +126 -109
- package/CLAUDE-Example.md +61 -58
- package/README.md +334 -82
- package/bin/cli.js +24 -7
- package/lib/install.js +161 -47
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,82 +1,334 @@
|
|
|
1
|
-
# TAS Kit
|
|
2
|
-
|
|
3
|
-
**Torus Agentic SDLC Kit** — Claude Code
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
# TAS Kit
|
|
2
|
+
|
|
3
|
+
**Torus Agentic SDLC Kit** — Bộ công cụ AI-assisted SDLC cho Claude Code, được thiết kế theo triết lý Spec-Driven Development và Context-Aware Architecture.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Mục đích
|
|
8
|
+
|
|
9
|
+
TAS Kit giúp các team phát triển phần mềm:
|
|
10
|
+
- **Chuẩn hóa quy trình SDLC** với các artifacts rõ ràng (PRD, SAD, ADR, Epic, Feature, Story)
|
|
11
|
+
- **Tối ưu hóa token usage** thông qua Context Layer — đầu tư ở phase thiết kế, tiết kiệm ở phase code
|
|
12
|
+
- **Hỗ trợ nhiều mô hình làm việc**: từ solo developer đến full team với các role PE/SE/DSE
|
|
13
|
+
- **Tự động hóa** với Hybrid và Autonomous agents hoạt động 24/7
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Triết lý thiết kế
|
|
18
|
+
|
|
19
|
+
### Spec-Driven Development
|
|
20
|
+
Tất cả code bắt đầu từ spec. Story.md là "context digest" đã hấp thụ toàn bộ thông tin từ PRD, SAD, ADR, Feature. Mỗi session implement chỉ cần đọc CLAUDE.md + Story.md — không cần load lại toàn bộ artifacts.
|
|
21
|
+
|
|
22
|
+
### Human-Led, AI-Powered
|
|
23
|
+
- **Con người chủ đạo**: Quyết định architecture, approve design, review code
|
|
24
|
+
- **AI hỗ trợ**: Tạo draft, implement theo spec, chạy tests, phát hiện bugs
|
|
25
|
+
|
|
26
|
+
### Dual Mode Operation
|
|
27
|
+
- **Hybrid Mode**: Developer và AI làm việc cùng nhau trong session
|
|
28
|
+
- **Autonomous Mode**: AI tự động develop 24/7, report kết quả khi xong
|
|
29
|
+
|
|
30
|
+
### Lightweight & Context-Aware
|
|
31
|
+
- Mỗi skill < 3KB, tổng kit < 50KB
|
|
32
|
+
- Context Layer: đầu tư token ở phase thiết kế để tiết kiệm gấp nhiều lần ở phase code
|
|
33
|
+
- Khi code: PHẢI bắt đầu session mới (không tận dụng session cũ đã load PRD/SAD vì sẽ phình Window Context)
|
|
34
|
+
|
|
35
|
+
### Role-Based & Template-Driven
|
|
36
|
+
- 3 role thực tế của Torus: PE (Product Engineer), SE (Software Engineer), DSE (DevOps Engineer)
|
|
37
|
+
- Templates riêng cho PRD, SAD, ADR, Epic, Feature, Story theo chuẩn Torus
|
|
38
|
+
- Flow configurable qua file `tas.yaml`
|
|
39
|
+
|
|
40
|
+
### Azure DevOps Compatible
|
|
41
|
+
- Output Markdown tương thích Azure DevOps Wiki
|
|
42
|
+
- Mermaid diagrams không dùng ký tự `()` (tránh conflict với ADO syntax)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## SDLC Workflow
|
|
47
|
+
|
|
48
|
+
:::mermaid
|
|
49
|
+
graph TD
|
|
50
|
+
subgraph Phase1["Phase 1: Discovery"]
|
|
51
|
+
PRD["/tas-prd"]
|
|
52
|
+
SAD["/tas-sad"]
|
|
53
|
+
ADR["/tas-adr"]
|
|
54
|
+
DESIGN["/tas-design"]
|
|
55
|
+
PRD -->|Product Engineer| PRD_ARTIFACT["PRD.md"]
|
|
56
|
+
PRD_ARTIFACT -->|Software Engineer| SAD
|
|
57
|
+
PRD_ARTIFACT -->|Software Engineer| ADR
|
|
58
|
+
SAD --> SAD_ARTIFACT["SAD.md"]
|
|
59
|
+
ADR --> ADR_ARTIFACT["ADR-XXX.md"]
|
|
60
|
+
PRD_ARTIFACT -->|Software Engineer| DESIGN
|
|
61
|
+
DESIGN --> DESIGN_ARTIFACT["design-spec.md"]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
subgraph Phase2["Phase 2: Planning"]
|
|
65
|
+
EPIC["/tas-epic"]
|
|
66
|
+
FEATURE["/tas-feature"]
|
|
67
|
+
STORY["/tas-story"]
|
|
68
|
+
FUNctest["/tas-functest"]
|
|
69
|
+
PRD_ARTIFACT -->|Software Engineer| EPIC
|
|
70
|
+
EPIC --> EPIC_ARTIFACT["Epic-XXX/"]
|
|
71
|
+
EPIC_ARTIFACT -->|Software Engineer| FEATURE
|
|
72
|
+
FEATURE --> FEATURE_ARTIFACT["Feature-XXX/"]
|
|
73
|
+
SAD_ARTIFACT --> FEATURE
|
|
74
|
+
DESIGN_ARTIFACT --> FEATURE
|
|
75
|
+
FEATURE_ARTIFACT -->|Software Engineer| STORY
|
|
76
|
+
STORY --> STORY_ARTIFACT["Story-XXX.md"]
|
|
77
|
+
FEATURE_ARTIFACT -->|Software Engineer| FUNctest
|
|
78
|
+
FUNctest --> FUNCTEST_ARTIFACT["Functional-Testing-Spec-FeatureXXX.md"]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
subgraph Phase3["Phase 3: Implementation"]
|
|
82
|
+
PLAN["/tas-plan"]
|
|
83
|
+
DEV["/tas-dev"]
|
|
84
|
+
FIX["/tas-fix"]
|
|
85
|
+
APItest["/tas-apitest"]
|
|
86
|
+
E2E["/tas-e2e"]
|
|
87
|
+
FUNCTEST_WEB["/tas-functest-web"]
|
|
88
|
+
FUNCTEST_MOBILE["/tas-functest-mobile"]
|
|
89
|
+
E2E_WEB["/tas-e2e-web"]
|
|
90
|
+
E2E_MOBILE["/tas-e2e-mobile"]
|
|
91
|
+
BUG["/tas-bug"]
|
|
92
|
+
REVIEW["/tas-review"]
|
|
93
|
+
STORY_ARTIFACT -->|Software Engineer| PLAN
|
|
94
|
+
PLAN --> PLAN_ARTIFACT["Plan.md"]
|
|
95
|
+
PLAN_ARTIFACT -->|AI Agent| DEV
|
|
96
|
+
DEV --> CODE["Source Code"]
|
|
97
|
+
CODE -->|Bug found| FIX
|
|
98
|
+
FIX --> CODE
|
|
99
|
+
CODE -->|Software Engineer| REVIEW
|
|
100
|
+
REVIEW --> REVIEW_ARTIFACT["Code Review Report"]
|
|
101
|
+
STORY_ARTIFACT -->|Software Engineer| APItest
|
|
102
|
+
APItest --> APITEST_ARTIFACT["API Testing Script"]
|
|
103
|
+
FUNCTEST_ARTIFACT -->|Product Engineer| E2E
|
|
104
|
+
E2E --> E2E_ARTIFACT["E2E Test Scenarios"]
|
|
105
|
+
FUNCTEST_ARTIFACT -->|Software Engineer| FUNCTEST_WEB
|
|
106
|
+
FUNCTEST_WEB --> FUNCTEST_WEB_ARTIFACT["Functional Test Web Script"]
|
|
107
|
+
FUNCTEST_ARTIFACT -->|Software Engineer| FUNCTEST_MOBILE
|
|
108
|
+
FUNCTEST_MOBILE --> FUNCTEST_MOBILE_ARTIFACT["Functional Test Mobile Script"]
|
|
109
|
+
FUNCTEST_ARTIFACT -->|Product Engineer| E2E_WEB
|
|
110
|
+
E2E_WEB --> E2E_WEB_ARTIFACT["E2E Web Test Script"]
|
|
111
|
+
FUNCTEST_ARTIFACT -->|Product Engineer| E2E_MOBILE
|
|
112
|
+
E2E_MOBILE --> E2E_MOBILE_ARTIFACT["E2E Mobile Test Script"]
|
|
113
|
+
CODE -->|Bug found| BUG
|
|
114
|
+
BUG --> BUG_ARTIFACT["Bug Report"]
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
subgraph Phase4["Phase 4: Quality & Deploy"]
|
|
118
|
+
SECURITY["/tas-security"]
|
|
119
|
+
PIPELINE["Pipeline / CLI"]
|
|
120
|
+
CODE -->|DevOps Engineer| SECURITY
|
|
121
|
+
SECURITY --> SECURITY_ARTIFACT["Security Report"]
|
|
122
|
+
APITEST_ARTIFACT -->|Product Engineer| PIPELINE
|
|
123
|
+
FUNCTEST_WEB_ARTIFACT --> PIPELINE
|
|
124
|
+
FUNCTEST_MOBILE_ARTIFACT --> PIPELINE
|
|
125
|
+
E2E_WEB_ARTIFACT --> PIPELINE
|
|
126
|
+
E2E_MOBILE_ARTIFACT --> PIPELINE
|
|
127
|
+
PIPELINE --> TEST_REPORT["Test Report"]
|
|
128
|
+
SECURITY_ARTIFACT -->|DevOps Engineer| DEPLOY["Production"]
|
|
129
|
+
TEST_REPORT --> DEPLOY
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
STATUS["/tas-status"] -.->|Track| PRD_ARTIFACT
|
|
133
|
+
STATUS -.->|Track| SAD_ARTIFACT
|
|
134
|
+
STATUS -.->|Track| STORY_ARTIFACT
|
|
135
|
+
STATUS -.->|Track| DEPLOY
|
|
136
|
+
|
|
137
|
+
style PRD_ARTIFACT fill:#e1f5ff
|
|
138
|
+
style SAD_ARTIFACT fill:#fff4e1
|
|
139
|
+
style DESIGN_ARTIFACT fill:#f3e5f5
|
|
140
|
+
style STORY_ARTIFACT fill:#e8f5e9
|
|
141
|
+
style CODE fill:#f3e5f5
|
|
142
|
+
style TEST_REPORT fill:#c8e6c9
|
|
143
|
+
style DEPLOY fill:#c8e6c9
|
|
144
|
+
:::
|
|
145
|
+
|
|
146
|
+
### Phase Summary
|
|
147
|
+
|
|
148
|
+
| Phase | Role | Commands | Artifacts |
|
|
149
|
+
|-------|------|----------|-----------|
|
|
150
|
+
| **Phase 1: Discovery** | PE, SE | `/tas-prd`, `/tas-sad`, `/tas-adr`, `/tas-design` | PRD.md, SAD.md, ADR-XXX.md, design-spec.md |
|
|
151
|
+
| **Phase 2: Planning** | SE | `/tas-epic`, `/tas-feature`, `/tas-story`, `/tas-functest` | Epic-XXX/, Feature-XXX/, Story-XXX.md, Functional-Testing-Spec-FeatureXXX.md |
|
|
152
|
+
| **Phase 3: Implementation** | PE, SE, AI | `/tas-plan`, `/tas-dev`, `/tas-fix`, `/tas-apitest`, `/tas-e2e`, `/tas-functest-web`, `/tas-functest-mobile`, `/tas-e2e-web`, `/tas-e2e-mobile`, `/tas-bug`, `/tas-review` | Plan.md, Source Code, API Testing Script, E2E Test Scenarios, Functional Test Scripts, Bug Report, Code Review Report |
|
|
153
|
+
| **Phase 4: Quality & Deploy** | PE, DSE | `/tas-security`, Pipeline/CLI | Security Report, Test Report, Production |
|
|
154
|
+
|
|
155
|
+
### Chi tiết từng Phase
|
|
156
|
+
|
|
157
|
+
#### Phase 1: Discovery
|
|
158
|
+
- **PE**: Tạo PRD với `/tas-prd`
|
|
159
|
+
- **SE**: Tạo SAD với `/tas-sad`, tạo ADR với `/tas-adr`, tạo design-spec với `/tas-design`
|
|
160
|
+
|
|
161
|
+
#### Phase 2: Planning
|
|
162
|
+
- **SE**: Breakdown Epic với `/tas-epic`, Feature với `/tas-feature`, Story với `/tas-story`
|
|
163
|
+
- **SE**: Tạo Functional Testing Spec với `/tas-functest`
|
|
164
|
+
|
|
165
|
+
#### Phase 3: Implementation
|
|
166
|
+
- **SE**: Tạo Plan với `/tas-plan`, Implement với `/tas-dev`, Fix bug với `/tas-fix`
|
|
167
|
+
- **SE**: Review code với `/tas-review`
|
|
168
|
+
- **SE**: Tạo API Testing Script với `/tas-apitest`
|
|
169
|
+
- **PE**: Tạo E2E Test Scenarios với `/tas-e2e`
|
|
170
|
+
- **SE**: Tạo Functional Test Scripts với `/tas-functest-web`, `/tas-functest-mobile`
|
|
171
|
+
- **PE**: Tạo E2E Test Scripts với `/tas-e2e-web`, `/tas-e2e-mobile`
|
|
172
|
+
- **PE**: Tạo Bug Report với `/tas-bug`
|
|
173
|
+
|
|
174
|
+
#### Phase 4: Quality & Deploy
|
|
175
|
+
- **DSE**: Security Review với `/tas-security`
|
|
176
|
+
- **PE**: Chạy Pipeline/CLI để execute Automation Tests
|
|
177
|
+
- **DSE**: Deploy lên Production
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Quick Start
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npx @torus-engineering/tas-kit install
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Options
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npx @torus-engineering/tas-kit install --directory /path/to/my-project
|
|
191
|
+
npx @torus-engineering/tas-kit install --yes # skip confirmation prompts
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Thiết lập quan trọng
|
|
197
|
+
|
|
198
|
+
### CLAUDE.md
|
|
199
|
+
|
|
200
|
+
File cấu hình quan trọng nhất — Claude đọc file này đầu tiên trong mọi session.
|
|
201
|
+
|
|
202
|
+
**Cấu trúc:**
|
|
203
|
+
```markdown
|
|
204
|
+
# Project Name
|
|
205
|
+
|
|
206
|
+
## Tech Stack
|
|
207
|
+
- Backend: .NET / Node.js / Python
|
|
208
|
+
- Frontend: React / Next.js
|
|
209
|
+
- Database: PostgreSQL / MySQL
|
|
210
|
+
- Infrastructure: AWS / Azure
|
|
211
|
+
|
|
212
|
+
## Conventions
|
|
213
|
+
- Coding standards
|
|
214
|
+
- Architecture patterns
|
|
215
|
+
- Testing requirements
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### tas.yaml
|
|
219
|
+
|
|
220
|
+
Điều khiển flow của TAS Kit theo từng dự án.
|
|
221
|
+
|
|
222
|
+
**Cấu trúc:**
|
|
223
|
+
```yaml
|
|
224
|
+
project:
|
|
225
|
+
name: "My Project"
|
|
226
|
+
team: "Team Name"
|
|
227
|
+
|
|
228
|
+
azure_devops:
|
|
229
|
+
enabled: true
|
|
230
|
+
organization: "org"
|
|
231
|
+
project: "project"
|
|
232
|
+
|
|
233
|
+
flow:
|
|
234
|
+
mode: "greenfield" # or "brownfield"
|
|
235
|
+
use_tdd: true
|
|
236
|
+
auto_review: true
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### project-status.yaml
|
|
240
|
+
|
|
241
|
+
Index tổng hợp trạng thái dự án — được cập nhật tự động sau mỗi thay đổi artifact.
|
|
242
|
+
|
|
243
|
+
**Cấu trúc:**
|
|
244
|
+
```yaml
|
|
245
|
+
last_updated: 2025-01-15
|
|
246
|
+
|
|
247
|
+
artifacts:
|
|
248
|
+
prd:
|
|
249
|
+
file: docs/prd.md
|
|
250
|
+
status: Approved
|
|
251
|
+
version: "1.0"
|
|
252
|
+
|
|
253
|
+
epics:
|
|
254
|
+
Epic-001:
|
|
255
|
+
status: Active
|
|
256
|
+
features:
|
|
257
|
+
Feature-001:
|
|
258
|
+
stories:
|
|
259
|
+
Story-001:
|
|
260
|
+
status: In Progress
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### .env
|
|
264
|
+
|
|
265
|
+
Environment variables cho Azure DevOps integration.
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
AZURE_DEVOPS_PAT=your_pat_here
|
|
269
|
+
AZURE_DEVOPS_ORG=your_org
|
|
270
|
+
AZURE_DEVOPS_PROJECT=your_project
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## What gets installed
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
.claude/
|
|
279
|
+
commands/ 22 slash commands (/tas-*, /ado-*)
|
|
280
|
+
skills/ 3 auto-invoked skills
|
|
281
|
+
agents/ 29 specialized subagents
|
|
282
|
+
.tas/
|
|
283
|
+
templates/ Markdown templates (PRD, SAD, ADR, Epic, Feature, Story...)
|
|
284
|
+
checklists/ Code review, story done, security checklists
|
|
285
|
+
tools/ ADO integration script (tas-ado.py)
|
|
286
|
+
CLAUDE.md Project context template (edit this for your project)
|
|
287
|
+
tas.yaml Flow configuration template (edit this for your project)
|
|
288
|
+
.env.example Environment variable template
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Commands Reference
|
|
294
|
+
|
|
295
|
+
| Command | Mô tả | Role |
|
|
296
|
+
|---------|-------|------|
|
|
297
|
+
| `/tas-init` | Khởi tạo TAS cho dự án mới | All |
|
|
298
|
+
| `/tas-status` | Hiển thị trạng thái hiện tại của dự án | All |
|
|
299
|
+
| `/tas-prd` | Tạo/cập nhật Product Requirements Document | PE |
|
|
300
|
+
| `/tas-sad` | Tạo/cập nhật Solution Architecture Document | SE |
|
|
301
|
+
| `/tas-adr` | Tạo Architecture Decision Record | SE |
|
|
302
|
+
| `/tas-design` | Tạo Design Specification | SE |
|
|
303
|
+
| `/tas-epic` | Tạo/cập nhật Epic | SE |
|
|
304
|
+
| `/tas-feature` | Tạo/cập nhật Feature | SE |
|
|
305
|
+
| `/tas-story` | Tạo/cập nhật Story | SE |
|
|
306
|
+
| `/tas-functest` | Tạo Functional Testing Specification | SE |
|
|
307
|
+
| `/tas-spec` | Lightweight spec (solo / prototype) | SE |
|
|
308
|
+
| `/tas-plan` | Lập kế hoạch kỹ thuật implementation | SE |
|
|
309
|
+
| `/tas-dev` | Implement story (agentic) | AI |
|
|
310
|
+
| `/tas-fix` | Quick fix không cần full story flow | SE |
|
|
311
|
+
| `/tas-apitest` | Tạo API Testing Script tự động | SE |
|
|
312
|
+
| `/tas-e2e` | Tạo E2E Test Scenarios | PE |
|
|
313
|
+
| `/tas-functest-web` | Tạo Functional Test Script cho Web | SE |
|
|
314
|
+
| `/tas-functest-mobile` | Tạo Functional Test Script cho Mobile | SE |
|
|
315
|
+
| `/tas-e2e-web` | Tạo E2E Test Script cho Web | PE |
|
|
316
|
+
| `/tas-e2e-mobile` | Tạo E2E Test Script cho Mobile | PE |
|
|
317
|
+
| `/tas-bug` | Tạo Bug Report | PE |
|
|
318
|
+
| `/tas-review` | Code Review với checklist | SE |
|
|
319
|
+
| `/tas-brainstorm` | Brainstorm giải pháp | All |
|
|
320
|
+
| `/tas-security` | Security Review | DSE |
|
|
321
|
+
| `/ado-*` | Azure DevOps integration | All |
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Requirements
|
|
326
|
+
|
|
327
|
+
- Node.js 18+
|
|
328
|
+
- [Claude Code](https://claude.ai/code)
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Documentation
|
|
333
|
+
|
|
334
|
+
Xem `.tas/README.md` sau khi install để có tài liệu chi tiết.
|
package/bin/cli.js
CHANGED
|
@@ -17,15 +17,20 @@ Commands:
|
|
|
17
17
|
(preserves CLAUDE.md, tas.yaml, .env.example)
|
|
18
18
|
|
|
19
19
|
Options:
|
|
20
|
-
--directory <path>
|
|
21
|
-
--yes, -y
|
|
22
|
-
--
|
|
20
|
+
--directory <path> Target directory (default: current working directory)
|
|
21
|
+
--yes, -y Skip confirmation prompts (uses native hook by default)
|
|
22
|
+
--security-hook <mode> Pre-commit hook mode: husky | native | none
|
|
23
|
+
Default: interactive prompt on install,
|
|
24
|
+
no-op on update unless specified.
|
|
25
|
+
--help, -h Show this help message
|
|
23
26
|
|
|
24
27
|
Examples:
|
|
25
28
|
npx @torus-engineering/tas-kit install
|
|
26
29
|
npx @torus-engineering/tas-kit install --directory /path/to/my-project
|
|
30
|
+
npx @torus-engineering/tas-kit install --yes --security-hook=husky
|
|
31
|
+
npx @torus-engineering/tas-kit install --security-hook=none
|
|
27
32
|
npx @torus-engineering/tas-kit update
|
|
28
|
-
npx @torus-engineering/tas-kit update --yes
|
|
33
|
+
npx @torus-engineering/tas-kit update --yes --security-hook=native
|
|
29
34
|
`.trim());
|
|
30
35
|
}
|
|
31
36
|
|
|
@@ -40,15 +45,27 @@ if (command !== 'install' && command !== 'update') {
|
|
|
40
45
|
process.exit(1);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
const opts = { directory: process.cwd(), yes: false };
|
|
48
|
+
const opts = { directory: process.cwd(), yes: false, securityHook: null };
|
|
49
|
+
|
|
44
50
|
for (let i = 1; i < args.length; i++) {
|
|
45
|
-
|
|
51
|
+
const a = args[i];
|
|
52
|
+
if ((a === '--directory' || a === '-d') && args[i + 1]) {
|
|
46
53
|
opts.directory = args[++i];
|
|
47
|
-
} else if (
|
|
54
|
+
} else if (a === '--yes' || a === '-y') {
|
|
48
55
|
opts.yes = true;
|
|
56
|
+
} else if (a.startsWith('--security-hook=')) {
|
|
57
|
+
opts.securityHook = a.slice('--security-hook='.length).toLowerCase();
|
|
58
|
+
} else if (a === '--security-hook' && args[i + 1]) {
|
|
59
|
+
opts.securityHook = args[++i].toLowerCase();
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
62
|
|
|
63
|
+
if (opts.securityHook && !['husky', 'native', 'none'].includes(opts.securityHook)) {
|
|
64
|
+
console.error(`Invalid --security-hook value: "${opts.securityHook}"`);
|
|
65
|
+
console.error(`Expected one of: husky, native, none`);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
52
69
|
const runner = command === 'update' ? update : install;
|
|
53
70
|
runner(opts).catch((err) => {
|
|
54
71
|
console.error(`\n${command === 'update' ? 'Update' : 'Install'} failed:`, err.message);
|