@torus-engineering/tas-kit 1.5.1 → 1.7.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.
Files changed (113) hide show
  1. package/.claude/agents/README.md +83 -0
  2. package/.claude/agents/architect.md +53 -0
  3. package/.claude/agents/aws-reviewer.md +71 -0
  4. package/.claude/agents/build-resolver.md +59 -0
  5. package/.claude/agents/code-architect.md +62 -0
  6. package/.claude/agents/code-explorer.md +63 -0
  7. package/.claude/agents/code-simplifier.md +53 -0
  8. package/.claude/agents/comment-analyzer.md +59 -0
  9. package/.claude/agents/conversation-analyzer.md +57 -0
  10. package/.claude/agents/csharp-reviewer.md +62 -0
  11. package/.claude/agents/database-reviewer.md +73 -0
  12. package/.claude/agents/doc-updater.md +66 -0
  13. package/.claude/agents/docs-lookup.md +55 -0
  14. package/.claude/agents/e2e-runner.md +61 -0
  15. package/.claude/agents/harness-optimizer.md +62 -0
  16. package/.claude/agents/loop-operator.md +56 -0
  17. package/.claude/agents/performance-optimizer.md +78 -0
  18. package/.claude/agents/planner.md +82 -0
  19. package/.claude/agents/pr-test-analyzer.md +68 -0
  20. package/.claude/agents/python-reviewer.md +67 -0
  21. package/.claude/agents/pytorch-build-resolver.md +76 -0
  22. package/.claude/agents/refactor-cleaner.md +70 -0
  23. package/.claude/agents/security-reviewer.md +79 -0
  24. package/.claude/agents/seo-specialist.md +75 -0
  25. package/.claude/agents/silent-failure-hunter.md +69 -0
  26. package/.claude/agents/tdd-guide.md +84 -0
  27. package/.claude/agents/type-design-analyzer.md +75 -0
  28. package/.claude/agents/typescript-reviewer.md +65 -0
  29. package/.claude/commands/ado-create.md +2 -1
  30. package/.claude/commands/ado-delete.md +3 -2
  31. package/.claude/commands/ado-get.md +2 -1
  32. package/.claude/commands/ado-status.md +2 -1
  33. package/.claude/commands/ado-update.md +2 -1
  34. package/.claude/commands/tas-adr.md +13 -12
  35. package/.claude/commands/tas-bug.md +97 -50
  36. package/.claude/commands/tas-design.md +3 -1
  37. package/.claude/commands/tas-dev.md +115 -0
  38. package/.claude/commands/tas-epic.md +4 -2
  39. package/.claude/commands/tas-feature.md +5 -3
  40. package/.claude/commands/tas-fix.md +47 -0
  41. package/.claude/commands/tas-plan.md +184 -0
  42. package/.claude/commands/tas-prd.md +3 -1
  43. package/.claude/commands/tas-review.md +104 -0
  44. package/.claude/commands/tas-sad.md +3 -1
  45. package/.claude/commands/tas-security.md +80 -0
  46. package/.claude/commands/tas-spec.md +50 -0
  47. package/.claude/commands/tas-story.md +77 -40
  48. package/.claude/commands/tas-verify.md +8 -0
  49. package/.claude/hooks/code-quality.js +127 -0
  50. package/.claude/hooks/session-end.js +116 -0
  51. package/.claude/rules/.gitkeep +0 -0
  52. package/.claude/rules/common/agents.md +65 -0
  53. package/.claude/rules/common/code-review.md +124 -0
  54. package/.claude/rules/common/coding-style.md +90 -0
  55. package/.claude/rules/common/development-workflow.md +44 -0
  56. package/.claude/rules/common/git-workflow.md +24 -0
  57. package/.claude/rules/common/hooks.md +30 -0
  58. package/.claude/rules/common/patterns.md +31 -0
  59. package/.claude/rules/common/performance.md +55 -0
  60. package/.claude/rules/common/post-review-agent.md +39 -0
  61. package/.claude/rules/common/project-status.md +80 -0
  62. package/.claude/rules/common/security.md +29 -0
  63. package/.claude/rules/common/stack-detection.md +29 -0
  64. package/.claude/rules/common/testing.md +57 -0
  65. package/.claude/rules/csharp/coding-style.md +72 -0
  66. package/.claude/rules/csharp/hooks.md +25 -0
  67. package/.claude/rules/csharp/patterns.md +50 -0
  68. package/.claude/rules/csharp/security.md +58 -0
  69. package/.claude/rules/csharp/testing.md +46 -0
  70. package/.claude/rules/python/coding-style.md +42 -0
  71. package/.claude/rules/python/hooks.md +19 -0
  72. package/.claude/rules/python/patterns.md +39 -0
  73. package/.claude/rules/python/security.md +30 -0
  74. package/.claude/rules/python/testing.md +38 -0
  75. package/.claude/rules/typescript/coding-style.md +199 -0
  76. package/.claude/rules/typescript/hooks.md +22 -0
  77. package/.claude/rules/typescript/patterns.md +52 -0
  78. package/.claude/rules/typescript/security.md +28 -0
  79. package/.claude/rules/typescript/testing.md +18 -0
  80. package/.claude/rules/web/coding-style.md +96 -0
  81. package/.claude/rules/web/design-quality.md +63 -0
  82. package/.claude/rules/web/hooks.md +120 -0
  83. package/.claude/rules/web/patterns.md +79 -0
  84. package/.claude/rules/web/performance.md +64 -0
  85. package/.claude/rules/web/security.md +57 -0
  86. package/.claude/rules/web/testing.md +55 -0
  87. package/.claude/settings.json +37 -0
  88. package/.claude/settings.local.json +38 -0
  89. package/.claude/skills/ado-integration/SKILL.md +44 -1
  90. package/.claude/skills/agent-harness-construction/SKILL.md +77 -0
  91. package/.claude/skills/agent-introspection-debugging/SKILL.md +157 -0
  92. package/.claude/skills/ai-regression-testing/SKILL.md +364 -0
  93. package/.claude/skills/api-design/SKILL.md +528 -0
  94. package/.claude/skills/architecture-decision-records/SKILL.md +184 -0
  95. package/.claude/skills/backend-patterns/SKILL.md +602 -0
  96. package/.claude/skills/benchmark/SKILL.md +98 -0
  97. package/.claude/skills/browser-qa/SKILL.md +92 -0
  98. package/.claude/skills/canary-watch/SKILL.md +104 -0
  99. package/.claude/skills/tas-conventions/SKILL.md +51 -3
  100. package/.claude/skills/tas-implementation-complete/SKILL.md +97 -0
  101. package/.claude/skills/tas-tdd/SKILL.md +72 -16
  102. package/.tas/README.md +29 -24
  103. package/.tas/tas-example.yaml +2 -1
  104. package/.tas/templates/SAD.md +221 -11
  105. package/.tas/templates/Story.md +18 -18
  106. package/CLAUDE-Example.md +1 -1
  107. package/README.md +20 -5
  108. package/bin/cli.js +13 -6
  109. package/lib/install.js +68 -6
  110. package/package.json +2 -2
  111. package/.claude/commands/tas-dev-story.md +0 -61
  112. package/.claude/commands/tas-review-code.md +0 -42
  113. package/.claude/commands/tas-security-check.md +0 -30
@@ -7,58 +7,268 @@
7
7
  ---
8
8
 
9
9
  ## 1. Executive Summary
10
+
11
+ <!-- MANDATORY. Viết cho người đọc không có technical background.
12
+ Bắt buộc:
13
+ - 1.1 Purpose: Tại sao SAD này tồn tại, vấn đề gì cần giải quyết
14
+ - 1.2 Scope: Hệ thống nào, ranh giới nào được/không được cover
15
+ - 1.3 Key Objectives: 3-5 mục tiêu kiến trúc cụ thể, đo lường được
16
+ Format: Prose ngắn, tối đa 1 trang tổng cộng -->
17
+
10
18
  ### 1.1 Purpose
11
19
  ### 1.2 Scope
12
20
  ### 1.3 Key Objectives
13
21
 
22
+ ---
23
+
14
24
  ## 2. Architecture Vision
25
+
26
+ <!-- MANDATORY.
27
+ Bắt buộc:
28
+ - 2.1 Vision Statement: 1-2 câu mô tả "kiến trúc này hướng tới điều gì"
29
+ - 2.2 Architecture Principles: 4-8 nguyên tắc dẫn dắt quyết định thiết kế
30
+ (vd: Stateless services, API-first, Defense in depth, Fail fast)
31
+ - 2.3 Constraints & Assumptions: Ràng buộc kỹ thuật/tổ chức, giả định đang được chấp nhận
32
+ Format: Bullet list cho principles và constraints -->
33
+
15
34
  ### 2.1 Vision Statement
16
35
  ### 2.2 Architecture Principles
17
36
  ### 2.3 Constraints & Assumptions
18
37
 
38
+ ---
39
+
19
40
  ## 3. Business Requirements
41
+
42
+ <!-- MANDATORY.
43
+ Bắt buộc:
44
+ - 3.1 Business Problem: Mô tả bài toán kinh doanh cần giải quyết
45
+ - 3.2 Stakeholders: Bảng stakeholder (role, concerns, influence)
46
+ - 3.3 Functional Requirements: Danh sách FR-xxx, mỗi item có ID để trace
47
+ - 3.4 Non-Functional Requirements: Danh sách NFR với metric cụ thể
48
+ (vd: Latency P99 < 300ms, Availability 99.9%, RPS 5000)
49
+ Nên có: Priority (Must/Should/Could) cho mỗi requirement
50
+ Format: Table hoặc numbered list với ID (FR-001, NFR-001) -->
51
+
20
52
  ### 3.1 Business Problem
21
53
  ### 3.2 Stakeholders
22
54
  ### 3.3 Functional Requirements
23
55
  ### 3.4 Non-Functional Requirements
24
56
 
57
+ ---
58
+
25
59
  ## 4. Technology Baseline
60
+
61
+ <!-- MANDATORY.
62
+ Bắt buộc:
63
+ - 4.1 Current State: Hệ thống hiện tại (nếu là greenfield thì ghi rõ)
64
+ - 4.2 Technology Stack: Bảng layer → technology → version → rationale
65
+ (Frontend / Backend / Database / Infrastructure / Messaging / Monitoring)
66
+ - 4.3 Dependencies: External services, third-party APIs, shared platforms
67
+ Nên có: Diagram current-state nếu là migration/modernization
68
+ Format: Table cho Technology Stack -->
69
+
26
70
  ### 4.1 Current State
27
71
  ### 4.2 Technology Stack
28
72
  ### 4.3 Dependencies
29
73
 
74
+ ---
75
+
30
76
  ## 5. System Context (C4 Level 1)
31
- <!-- Dùng Mermaid flow diagram, :::mermaid wrapper, không dùng () -->
32
77
 
33
- ## 6. Logical View (C4 Level 2 - Container)
34
- <!-- Dùng Mermaid flow diagram -->
78
+ <!-- MANDATORY. Trả lời: "Hệ thống này nằm ở đâu trong hệ sinh thái?"
79
+ Bắt buộc:
80
+ - Mermaid flowchart: hệ thống ở giữa, xung quanh là users và external systems
81
+ - Chú thích mỗi external system: tên, vai trò, protocol giao tiếp
82
+ Không cần: chi tiết nội bộ của hệ thống (để C4 Level 2)
83
+ Format: Mermaid flowchart (dùng :::mermaid wrapper, không dùng () trong node label)
84
+
85
+ Ví dụ:
86
+ :::mermaid
87
+ flowchart TD
88
+ U[fa:fa-user End User] -- |HTTPS| SYS[Your System]
89
+ SYS -- |REST| EXT1[Payment Gateway]
90
+ SYS -- |SMTP| EXT2[Email Service]
91
+ ADMIN[fa:fa-user Admin] -- |HTTPS| SYS
92
+ ::: -->
93
+
94
+ ---
95
+
96
+ ## 6. Logical View (C4 Level 2 — Container)
97
+
98
+ <!-- MANDATORY. Trả lời: "Hệ thống gồm những container nào?"
99
+ Bắt buộc:
100
+ - Mermaid flowchart: tất cả containers (web app, API, DB, cache, queue, ...)
101
+ - Mỗi container: tên, technology, vai trò chính
102
+ - Luồng tương tác giữa containers với protocol/label
103
+ Nên có: Phân nhóm theo bounded context nếu hệ thống lớn
104
+ Format: Mermaid flowchart với subgraph để nhóm theo domain
105
+
106
+ Ví dụ node: WebApp["Web App\n(Next.js / Vercel)"] -->
107
+
108
+ ---
35
109
 
36
110
  ## 7. Component View (C4 Level 3)
37
- <!-- Dùng Mermaid flow diagram -->
111
+
112
+ <!-- CONDITIONAL — Bắt buộc nếu hệ thống có độ phức tạp cao hoặc team mới.
113
+ Trả lời: "Bên trong mỗi container có components nào?"
114
+ Hướng dẫn:
115
+ - Mỗi container phức tạp → một subsection riêng (7.1, 7.2, ...)
116
+ - Container đơn giản (chỉ proxy, static file, thin wrapper) → bỏ qua
117
+ - Không cần drill vào mọi container — chỉ những container có internal logic đáng kể
118
+ Mỗi subsection bắt buộc:
119
+ - Mermaid flowchart liệt kê components bên trong container đó
120
+ - Mỗi component: tên, trách nhiệm chính, interface exposed
121
+ - Dependency direction giữa components (tránh circular)
122
+ Format: Mermaid flowchart với subgraph bao ngoài (tên container), nodes là components
123
+
124
+ Ví dụ:
125
+ :::mermaid
126
+ flowchart TD
127
+ subgraph API["API Service (NestJS)"]
128
+ Router[Route Handler] -- AuthMW[Auth Middleware]
129
+ AuthMW -- Controller[Order Controller]
130
+ Controller -- Service[Order Service]
131
+ Service -- Repo[Order Repository]
132
+ Service -- Queue[Queue Publisher]
133
+ end
134
+ ::: -->
135
+
136
+ ### 7.1 [Container Name]
137
+
138
+ <!-- Bắt buộc: Mermaid component diagram như hướng dẫn trên.
139
+ Nên có: Mô tả ngắn vai trò của container này trước diagram. -->
140
+
141
+ ### 7.2 [Container Name]
142
+
143
+ <!-- Thêm subsection cho mỗi container phức tạp. Xóa subsection này nếu không cần. -->
144
+
145
+ ---
38
146
 
39
147
  ## 8. Data Architecture & ERD
40
- <!-- Dùng Mermaid erDiagram -->
148
+
149
+ <!-- MANDATORY nếu hệ thống có persistence layer.
150
+ Bắt buộc:
151
+ - ERD: entities, attributes (chỉ key fields), relationships với cardinality
152
+ - Data flow overview: data đi từ đâu đến đâu, transform ở đâu
153
+ Nên có:
154
+ - Data classification: PII / Sensitive / Internal / Public cho mỗi entity
155
+ - Retention policy nếu có compliance requirement
156
+ - Sharding/partitioning strategy nếu data scale lớn
157
+ Format: Mermaid erDiagram cho ERD -->
158
+
159
+ ---
41
160
 
42
161
  ## 9. Integration & Data Flow
43
- <!-- Dùng Mermaid sequenceDiagram -->
162
+
163
+ <!-- MANDATORY nếu hệ thống tích hợp với external services hoặc có async flows.
164
+ Bắt buộc:
165
+ - Sequence diagram cho mỗi critical flow (auth, payment, order, ...)
166
+ - Async flows: queue/event-driven patterns phải được diagram rõ
167
+ Nên có: Error/retry flows cho critical paths
168
+ Format: Mermaid sequenceDiagram, một diagram per flow -->
169
+
170
+ ### 9.1 API Design Principles
171
+
172
+ <!-- MANDATORY nếu hệ thống expose API (internal hoặc external).
173
+ Bắt buộc:
174
+ - API Style: REST / GraphQL / gRPC / Event-driven — và lý do chọn
175
+ - Versioning strategy: URL path (/v1/) vs header vs query param
176
+ - Authentication scheme: Bearer JWT / API Key / OAuth2 / mTLS
177
+ - Standard error format: HTTP status codes, error body structure
178
+ Nên có:
179
+ - Rate limiting approach (per-user, per-IP, tiered)
180
+ - Pagination convention (cursor vs offset)
181
+ - Idempotency handling cho mutating operations
182
+ Không đưa vào đây: endpoint list, request/response schema chi tiết
183
+ → Những thứ đó thuộc API Contract document riêng (viết khi implement)
184
+ Format: Bullet list hoặc table ngắn gọn -->
185
+
186
+ ---
44
187
 
45
188
  ## 10. Security Architecture
46
189
 
47
- ## 11. Deployment View
48
- <!-- Dùng Mermaid flow diagram -->
190
+ <!-- MANDATORY. Đây là architectural concern, không phải implementation detail.
191
+ Bắt buộc:
192
+ - Threat Model: attack surfaces, trust boundaries, top threats (dùng STRIDE nếu cần)
193
+ - Identity & Auth Flow: AuthN/AuthZ mechanism, token lifecycle, privilege escalation path
194
+ - Data Classification: PII / Sensitive / Internal / Public — handling rules per class
195
+ - Network Security Zones: public / DMZ / private / data tier và rules giữa các zones
196
+ - Encryption: at-rest (algorithm, key management) và in-transit (TLS version, cert strategy)
197
+ Nên có:
198
+ - Secrets management approach (Vault, AWS SSM, env vars strategy)
199
+ - Audit logging scope: what events must be logged, retention
200
+ - Compliance requirements: GDPR, PCI-DSS, SOC2, ... nếu applicable
201
+ Format:
202
+ - Threat model: table (Threat | Vector | Mitigation)
203
+ - Auth flow: Mermaid sequenceDiagram
204
+ - Network zones: Mermaid flowchart với subgraph per zone -->
205
+
206
+ ---
207
+
208
+ ## 11. NFR Strategies
209
+
210
+ <!-- MANDATORY. Mỗi NFR-xxx trong Section 3.4 phải có strategy tương ứng ở đây (reference bằng ID).
211
+ Bắt buộc — cover các categories sau nếu có NFR liên quan:
212
+ - Performance: caching strategy (L1/L2/CDN), DB indexing, query optimization approach
213
+ - Scalability: horizontal vs vertical, stateless design, queue-based decoupling
214
+ - Availability: redundancy model (Active-Active/Active-Passive), failover mechanism, SLA target
215
+ - Resilience: circuit breaker, retry with backoff, bulkhead, timeout policy
216
+ - Observability: structured logging, distributed tracing, metrics & alerting thresholds
217
+ Nên có:
218
+ - Capacity planning baseline: expected load, growth projection, scale trigger points
219
+ - DR strategy: RPO/RTO targets, backup frequency, restore procedure overview
220
+ Format: Table với cột NFR ID để trace ngược về Section 3.4
221
+ | NFR ID | Category | Target | Strategy | Notes |
222
+ |--------|----------|--------|----------|-------|
223
+ | NFR-001 | Latency | P99 < 300ms | Redis cache L2, read replicas | Cache TTL 5m |
224
+ | NFR-002 | Availability | 99.9% | Active-Active, 2 AZs | Health check interval 10s | -->
225
+
226
+ ---
49
227
 
50
- ## 12. Non-Functional Requirements
228
+ ## 12. Deployment Topology
229
+
230
+ <!-- MANDATORY. Trả lời: "Các components chạy ở đâu trong infrastructure?"
231
+ Bắt buộc:
232
+ - Infrastructure diagram: regions, AZs, VPC/subnets, load balancers, entry points
233
+ - Component-to-infrastructure mapping: service X → ECS Fargate, DB → RDS Multi-AZ, ...
234
+ - Traffic entry points: CDN → ALB → API Gateway → Service flow
235
+ - Environment matrix: dev / staging / prod — sự khác nhau về scale, config, isolation
236
+ Nên có:
237
+ - Network topology: public subnet / private subnet / data subnet và routing rules
238
+ - CI/CD pipeline overview: build → test → deploy flow và approval gates
239
+ - Container orchestration config nếu dùng K8s/ECS (namespace, resource limits)
240
+ Format:
241
+ - Mermaid flowchart với subgraph per environment tier hoặc per network zone
242
+ - Environment matrix: table (Component | Dev | Staging | Prod) -->
243
+
244
+ ---
51
245
 
52
246
  ## 13. Architectural Decisions
247
+
248
+ <!-- MANDATORY. Ghi lại mọi quyết định kiến trúc quan trọng và lý do.
249
+ Bắt buộc: Mỗi ADR entry gồm Decision, Status, Date, Rationale
250
+ Nên có: Alternatives considered và tại sao không chọn
251
+ Format: Table — thêm row mỗi khi có quyết định mới
252
+ Status values: Proposed | Accepted | Deprecated | Superseded -->
253
+
53
254
  | ID | Decision | Status | Date | Rationale |
54
255
  |----|----------|--------|------|-----------|
55
256
 
257
+ ---
258
+
56
259
  ## 14. Risks & Mitigation
57
- | Risk | Impact | Probability | Mitigation |
58
- |------|--------|-------------|------------|
260
+
261
+ <!-- MANDATORY.
262
+ Bắt buộc: Risk, Impact (H/M/L), Probability (H/M/L), Mitigation action
263
+ Nên có: Owner và review date cho mỗi risk
264
+ Format: Table, sắp xếp theo Impact × Probability giảm dần -->
265
+
266
+ | Risk | Impact | Probability | Mitigation | Owner |
267
+ |------|--------|-------------|------------|-------|
59
268
 
60
269
  ---
61
270
 
62
271
  ## Changelog
272
+
63
273
  | Date | Version | Changes | Author |
64
274
  |------|---------|---------|--------|
@@ -7,6 +7,8 @@ ado_assigned_to:
7
7
  ado_created:
8
8
  last_ado_sync:
9
9
  parent_ado_id:
10
+ plan_status: pending
11
+ plan_date:
10
12
  ---
11
13
  # Story-{NNN}: {Title}
12
14
 
@@ -20,25 +22,20 @@ parent_ado_id:
20
22
  As a {role}, I want {goal}, so that {benefit}.
21
23
 
22
24
  ---
23
- ## Context from PRD (nếu có)
24
- *(Chỉ thêm section này khi Story business requirements đặc biệt cần lưu ý)*
25
+ ## Business Requirements (nếu có)
26
+ *(Yêu cầu nghiệp vụ đặc biệt, business rules, constraints từ stakeholders chỉ thêm khi cần)*
25
27
 
26
28
  ---
27
- ## Context from SAD/ADR (nếu có)
28
- *(Chỉ thêm section này khi Story architecture decisions, patterns, hoặc constraints cần tuân thủ)*
29
-
30
- - **Relevant Components:** {components liên quan}
31
- - **Patterns to follow:** {patterns từ SAD/ADR}
32
- - **Constraints:** {nếu có}
29
+ ## Design Notes (nếu có)
30
+ *(UI/UX specs, mockup links, design decisions, flow diagrams chỉ thêm khi cần)*
33
31
 
34
32
  ---
35
- ## Prerequisites from Feature (nếu có)
36
- *(Chỉ thêm section này khi Storydependency từ Stories khác hoặc prerequisites)*
33
+ ## Prerequisites (nếu có)
34
+ *(Dependencies từ Stories khác hoặc điều kiện phải trước chỉ thêm khi cần)*
37
35
 
38
36
  ---
39
- ## Implementation Context
40
-
41
37
  ## Acceptance Criteria
38
+
42
39
  ### AC-1: {title}
43
40
  - **Given** {precondition}
44
41
  - **When** {action}
@@ -49,13 +46,9 @@ As a {role}, I want {goal}, so that {benefit}.
49
46
  - **When** {action}
50
47
  - **Then** {expected result}
51
48
 
52
- ## Technical Notes
53
- - **Files to modify:** {list}
54
- - **Patterns:** {reference to SAD/ADR}
55
- - **Database changes:** {if any}
56
-
49
+ ---
57
50
  ## Unit Test Cases
58
- SE implement trong code. PE thiết kế happy path + edge cases + negative cases khi tạo Story.
51
+ *(PE thiết kế happy path + edge cases + negative cases. SE implement trong code.)*
59
52
 
60
53
  ### Happy Path
61
54
  | ID | Description | Input | Expected Output |
@@ -75,7 +68,14 @@ SE implement trong code. PE thiết kế happy path + edge cases + negative case
75
68
  ### Dependencies to Mock
76
69
  - {external API, database state, third-party service...}
77
70
 
71
+ ---
72
+ <!-- ═══════════════════════════════════════════════════════════════════
73
+ TECHNICAL PLAN — generated by /tas-plan, do not edit manually
74
+ ═══════════════════════════════════════════════════════════════════ -->
75
+
76
+ ---
78
77
  ## Definition of Done
78
+ - [ ] Technical plan completed (`/tas-plan`)
79
79
  - [ ] Code implemented
80
80
  - [ ] Unit tests pass
81
81
  - [ ] Code review passed
package/CLAUDE-Example.md CHANGED
@@ -41,7 +41,7 @@ This project uses Torus-Agentic-SDLC (TAS) kit.
41
41
  ## Commands
42
42
  Type /tas-status to see current project state.
43
43
  Type /tas-[artifact] to create or update artifacts (prd, sad, adr, epic, feature, story, design).
44
- Type /tas-dev-story to implement a story.
44
+ Type /tas-dev to implement a story.
45
45
  Type /tas-verify to verify a Feature on Staging (Phase 2).
46
46
  Type /tas-review-code, /tas-brainstorm, /tas-bug, /tas-security-check for dev workflows.
47
47
 
package/README.md CHANGED
@@ -19,9 +19,9 @@ npx @torus-engineering/tas-kit install --yes # skip confirmation prompts
19
19
 
20
20
  ```
21
21
  .claude/
22
- commands/ 20 slash commands (/tas-*, /ado-*)
22
+ commands/ 22 slash commands (/tas-*, /ado-*)
23
23
  skills/ 3 auto-invoked skills
24
- agents/ 2 specialized subagents
24
+ agents/ 29 specialized subagents
25
25
  .tas/
26
26
  templates/ Markdown templates (PRD, SAD, ADR, Epic, Feature, Story...)
27
27
  checklists/ Code review, story done, security checklists
@@ -49,11 +49,14 @@ tas.yaml Flow configuration template (edit this for your project)
49
49
  | `/tas-epic` | Create/update Epic |
50
50
  | `/tas-feature` | Create/update Feature |
51
51
  | `/tas-story` | Create/update Story |
52
- | `/tas-dev-story` | Implement a story (agentic) |
53
- | `/tas-review-code` | Code review with checklist |
52
+ | `/tas-spec` | Lightweight spec (solo / prototype) |
53
+ | `/tas-plan` | Plan technical implementation |
54
+ | `/tas-dev` | Implement a story (agentic) |
55
+ | `/tas-fix` | Quick fix without full story flow |
56
+ | `/tas-review` | Code review with checklist |
54
57
  | `/tas-brainstorm` | Brainstorm solutions |
55
58
  | `/tas-bug` | Create bug report |
56
- | `/tas-security-check` | Security review |
59
+ | `/tas-security` | Security review |
57
60
  | `/tas-verify` | Verify feature on staging |
58
61
  | `/ado-*` | Azure DevOps integration |
59
62
 
@@ -62,6 +65,18 @@ tas.yaml Flow configuration template (edit this for your project)
62
65
  - Node.js 18+
63
66
  - [Claude Code](https://claude.ai/code)
64
67
 
68
+ ## Publishing to npm
69
+
70
+ ```bash
71
+ # Bump version (patch / minor / major)
72
+ npm version patch
73
+
74
+ # Publish to npm registry
75
+ npm publish --access=public --auth-type=web
76
+ ```
77
+
78
+ `--auth-type=web` mở trình duyệt để xác thực nếu chưa login. Chạy `npm whoami` để kiểm tra đang đăng nhập với account nào trước khi publish.
79
+
65
80
  ## Documentation
66
81
 
67
82
  See `.tas/README.md` after install for full kit documentation.
package/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { install } from '../lib/install.js';
2
+ import { install, update } from '../lib/install.js';
3
3
 
4
4
  const args = process.argv.slice(2);
5
5
  const command = args[0];
@@ -9,7 +9,12 @@ function printHelp() {
9
9
  tas-kit — Torus Agentic SDLC Kit installer
10
10
 
11
11
  Usage:
12
- npx @torus-engineering/tas-kit install [options]
12
+ npx @torus-engineering/tas-kit <command> [options]
13
+
14
+ Commands:
15
+ install Copy TAS Kit files into a project (first-time setup)
16
+ update Overwrite .claude/ and .tas/ with the latest kit version
17
+ (preserves CLAUDE.md, tas.yaml, .env.example)
13
18
 
14
19
  Options:
15
20
  --directory <path> Target directory (default: current working directory)
@@ -19,7 +24,8 @@ Options:
19
24
  Examples:
20
25
  npx @torus-engineering/tas-kit install
21
26
  npx @torus-engineering/tas-kit install --directory /path/to/my-project
22
- npx @torus-engineering/tas-kit install --yes
27
+ npx @torus-engineering/tas-kit update
28
+ npx @torus-engineering/tas-kit update --yes
23
29
  `.trim());
24
30
  }
25
31
 
@@ -28,7 +34,7 @@ if (!command || command === '--help' || command === '-h') {
28
34
  process.exit(0);
29
35
  }
30
36
 
31
- if (command !== 'install') {
37
+ if (command !== 'install' && command !== 'update') {
32
38
  console.error(`Unknown command: "${command}"\n`);
33
39
  printHelp();
34
40
  process.exit(1);
@@ -43,7 +49,8 @@ for (let i = 1; i < args.length; i++) {
43
49
  }
44
50
  }
45
51
 
46
- install(opts).catch((err) => {
47
- console.error('\nInstall failed:', err.message);
52
+ const runner = command === 'update' ? update : install;
53
+ runner(opts).catch((err) => {
54
+ console.error(`\n${command === 'update' ? 'Update' : 'Install'} failed:`, err.message);
48
55
  process.exit(1);
49
56
  });
package/lib/install.js CHANGED
@@ -23,6 +23,63 @@ async function copyDir(src, dest) {
23
23
  await fs.cp(src, dest, { recursive: true });
24
24
  }
25
25
 
26
+ export async function update({ directory, yes }) {
27
+ const target = path.resolve(directory);
28
+
29
+ // Must already have .claude/ or .tas/ — otherwise suggest install
30
+ const claudeExists = await exists(path.join(target, '.claude'));
31
+ const tasExists = await exists(path.join(target, '.tas'));
32
+ if (!claudeExists && !tasExists) {
33
+ console.error(` ERROR: No TAS Kit found in: ${target}`);
34
+ console.error(` Run "install" first to set up TAS Kit.`);
35
+ process.exit(1);
36
+ }
37
+
38
+ console.log(`\nUpdating TAS Kit in: ${target}\n`);
39
+
40
+ if (!yes) {
41
+ console.warn(` This will overwrite .claude/ and .tas/ with the latest kit files.`);
42
+ console.warn(` Your CLAUDE.md, tas.yaml, and .env.example will NOT be touched.\n`);
43
+ const ok = await confirm('Continue?');
44
+ if (!ok) {
45
+ console.log('Update cancelled.');
46
+ process.exit(0);
47
+ }
48
+ console.log();
49
+ }
50
+
51
+ // Overwrite .claude/
52
+ await copyDir(
53
+ path.join(PACKAGE_DIR, '.claude'),
54
+ path.join(target, '.claude')
55
+ );
56
+ console.log(' [ok] .claude/ (updated)');
57
+
58
+ // Overwrite .tas/
59
+ await copyDir(
60
+ path.join(PACKAGE_DIR, '.tas'),
61
+ path.join(target, '.tas')
62
+ );
63
+ console.log(' [ok] .tas/ (updated)');
64
+
65
+ // Set executable bit on tas-ado.py (Unix/macOS)
66
+ if (process.platform !== 'win32') {
67
+ const adoPy = path.join(target, '.tas', 'tools', 'tas-ado.py');
68
+ if (await exists(adoPy)) {
69
+ await fs.chmod(adoPy, 0o755);
70
+ }
71
+ }
72
+
73
+ console.log(` [--] CLAUDE.md, tas.yaml, .env.example — not touched`);
74
+
75
+ console.log(`
76
+ TAS Kit updated successfully!
77
+
78
+ If this version added new settings or templates, check the changelog
79
+ and manually merge changes into your CLAUDE.md and tas.yaml if needed.
80
+ `);
81
+ }
82
+
26
83
  export async function install({ directory, yes }) {
27
84
  const target = path.resolve(directory);
28
85
 
@@ -73,12 +130,17 @@ export async function install({ directory, yes }) {
73
130
  console.log(' [--] CLAUDE.md already exists, skipped');
74
131
  }
75
132
 
76
- // Copy .env.example
77
- await fs.copyFile(
78
- path.join(PACKAGE_DIR, '.env.example'),
79
- path.join(target, '.env.example')
80
- );
81
- console.log(' [ok] .env.example');
133
+ // Copy .env.example (only if absent)
134
+ const envExampleTarget = path.join(target, '.env.example');
135
+ if (!(await exists(envExampleTarget))) {
136
+ await fs.copyFile(
137
+ path.join(PACKAGE_DIR, '.env.example'),
138
+ envExampleTarget
139
+ );
140
+ console.log(' [ok] .env.example');
141
+ } else {
142
+ console.log(' [--] .env.example already exists, skipped');
143
+ }
82
144
 
83
145
  // Copy tas-example.yaml as tas.yaml (only if absent)
84
146
  const tasYamlTarget = path.join(target, 'tas.yaml');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@torus-engineering/tas-kit",
3
- "version": "1.5.1",
4
- "description": "Torus Agentic SDLC Kit — Claude Code commands, skills and workflows for modern AI-assisted SDLC",
3
+ "version": "1.7.0",
4
+ "description": "Torus Agentic SDLC Kit — Collection of commands, skills, rules, hooks, agents and workflows for modern AI-First SDLC",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "tas-kit": "bin/cli.js"
@@ -1,61 +0,0 @@
1
- # /tas-dev-story $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Implement một User Story.
5
-
6
- ## QUAN TRỌNG - Quy tắc đọc file
7
- - CHỈ đọc DUY NHẤT Story file. Không đọc thêm bất kỳ file nào khác.
8
- - KHÔNG đọc PRD, SAD, ADR, Design-Spec.
9
- - KHÔNG list thư mục, KHÔNG quét project structure.
10
- - KHÔNG đọc .tas/checklists/story-done.md ở bước đầu (chỉ đọc ở bước cuối).
11
- - Nếu cần tra cứu thêm, PHẢI hỏi user xác nhận trước khi đọc bất kỳ file nào.
12
-
13
- ## Hành động
14
- 1. $ARGUMENTS là Story ID hoặc file path. Nếu không có, quét docs/epics/**/Story-*.md tìm stories có status Committed.
15
- 2. Đọc Story file.
16
- 3. **Phân tích kiến trúc:**
17
- - Kiểm tra vấn đề kỹ thuật đã được mô tả trong SAD/ADR chưa (qua section Context from SAD/ADR trong Story)
18
- - Nếu có và không thay đổi kiến trúc → Chuyển sang implement, mô tả giải pháp thi công (API, DB, FE component, config...)
19
- - Nếu chưa có hoặc là thay đổi kiến trúc lớn → **TẠO ADR mới**:
20
- - Command: `/tas-adr "{Tiêu đề quyết định kiến trúc}"`
21
- - Template: `.tas/templates/ADR.md`
22
- - Điền đầy đủ: Context, Decision, Rationale, Alternatives, Consequences
23
- - Trong section Consequences, thêm subsection **SAD Updates** liệt kê các thay đổi cần cập nhật vào SAD
24
- 4. Bắt đầu implement dựa trên nội dung Story và ADR (nếu đã tạo).
25
-
26
- ## Workflow
27
- ### Nếu use_tdd = true trong root/tas.yaml:
28
- a. Viết test cases TRƯỚC (Red phase)
29
- - Unit tests theo acceptance criteria trong Story
30
- - Chạy tests, xác nhận FAIL
31
- b. Implement code (Green phase)
32
- - Viết code tối thiểu để pass tests
33
- c. Refactor
34
- - Clean up code
35
- - Đảm bảo tests vẫn pass
36
-
37
- ### Nếu use_tdd = false:
38
- a. Implement code theo acceptance criteria trong Story
39
- b. Viết unit tests cover các cases
40
- c. Chạy tests, fix nếu fail
41
-
42
- ## Sau khi code xong
43
- 3. Đọc .tas/checklists/story-done.md, verify từng mục, sau đó tick vào section ## Definition of Done trong file Story:
44
- - `- [x] Code implemented` nếu đã implement xong
45
- - `- [x] Unit tests pass` nếu tests đã chạy pass
46
- - `- [x] No regression` nếu toàn bộ test suite pass
47
- - `- [x] Documentation updated (if needed)` nếu đã cập nhật
48
- - `- [ ] Code review passed` — KHÔNG tick, để sau khi chạy /tas-review-code
49
- - `- [ ] Acceptance criteria verified` — KHÔNG tick, để PE verify
50
- 4. Tạo commit message theo conventions trong CLAUDE.md
51
- 5. Nhắc user: chạy /tas-review-code để review và tự test lại ở local trước khi chuyển status
52
-
53
- ## Nguyên tắc
54
- - KHÔNG implement ngoài scope của Story
55
- - Mỗi public method PHẢI có XML doc comment
56
- - **Khi nào cần tạo ADR:**
57
- - Thay đổi kiến trúc ảnh hưởng nhiều components
58
- - Thêm mới design pattern hoặc framework
59
- - Đổi data flow hoặc integration pattern
60
- - Quyết định trade-off kỹ thuật quan trọng
61
- - Thay đổi đã ảnh hưởng đến SAD
@@ -1,42 +0,0 @@
1
- # /tas-review-code $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Review code thay đổi gần nhất hoặc một file/PR cụ thể.
5
-
6
- ## Hành động
7
- 1. Cần context từ root/tas.yaml và .tas/checklists/code-review.md
8
- 2. $ARGUMENTS có thể là: file path, hoặc để trống (review git diff)
9
- 3. Nếu $ARGUMENTS trống: lấy git diff của staged changes hoặc last commit
10
- 4. Review theo checklist:
11
- - Naming conventions
12
- - Architecture alignment (so với SAD)
13
- - Error handling
14
- - Security concerns
15
- - Test coverage
16
- - Performance implications
17
- 5. Output: danh sách findings phân loại theo severity (Critical/Major/Minor/Info)
18
-
19
- ## Sau khi review
20
- 6. Nếu có findings Critical/Major: liệt kê rõ, yêu cầu human fix trước khi tiếp tục.
21
- 7. Khi human xác nhận đã fix hết tất cả issues:
22
- - Tick `- [x] Code review passed` trong section ## Definition of Done của file Story
23
- 8. Hỏi: "Bạn đã tự test lại ở local chưa? Nếu OK, có muốn chuyển ticket sang Deploy Test không?"
24
- 9. Nếu human xác nhận Yes, cập nhật file Story:
25
- a. Dòng **Status:** trong header → Deploy Test
26
- b. Cập nhật Technical notes nếu có thay đổi phát sinh trong quá trình review
27
- c. Thêm dòng vào section Changelog trong Story: ngày, "Code review passed, moved to Deploy Test"
28
- 10. Cập nhật Story trên ADO:
29
- - Chạy /ado-update story <ado-id> --status "Deploy Test" để push nội dung mới nhất và đổi state
30
- 11. Cập nhật file Feature cha:
31
- a. Dòng **Status:** trong header → In Progress
32
- b. Cột Status của Story trong bảng ## User Stories → Deploy Test
33
- c. Thêm dòng Changelog trong Feature: ngày, "Story <id> moved to Deploy Test"
34
- 12. Cập nhật Feature trên ADO:
35
- - Chạy /ado-update feature <feature-ado-id> --status "In Progress" để push nội dung mới nhất và đổi state
36
- 13. Cập nhật root/project-status.yaml: Story → Deploy Test, Feature → In Progress
37
-
38
- ## Nguyên tắc
39
- - Review khách quan, chỉ ra cụ thể dòng code và lý do
40
- - Đề xuất fix cụ thể, không chỉ nói "code xấu"
41
- - Check xem code có vi phạm ADR nào không
42
- - KHÔNG tự động chuyển status mà không có xác nhận của human