@dtt_siye/atool 1.2.1 → 1.3.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 (78) hide show
  1. package/VERSION +1 -1
  2. package/hooks/session-start +9 -12
  3. package/lib/export-analysis.sh +100 -0
  4. package/lib/install-kiro.sh +11 -6
  5. package/lib/knowledge-graph.sh +7 -2
  6. package/package.json +1 -1
  7. package/skills/doc-standards-enforcer/SKILL.md +200 -220
  8. package/skills/doc-standards-enforcer/examples/valid-document-example.md +5 -5
  9. package/skills/doc-standards-enforcer/references/101-standards-summary.md +17 -17
  10. package/skills/project-analyze/SKILL.md +138 -124
  11. package/skills/project-analyze/phases/{phase0-discovery.md → archive/phase0-discovery.md} +6 -2
  12. package/skills/project-analyze/phases/{phase1-inventory.md → archive/phase1-inventory.md} +10 -0
  13. package/skills/project-analyze/phases/{phase2-deep-analysis.md → archive/phase2-deep-analysis.md} +20 -0
  14. package/skills/project-analyze/phases/{phase3-knowledge-graph.md → archive/phase3-knowledge-graph.md} +31 -0
  15. package/skills/project-analyze/phases/{phase3a-multi-dimensional.md → archive/phase3a-multi-dimensional.md} +13 -0
  16. package/skills/project-analyze/phases/{phase5-synthesis.md → archive/phase5-synthesis.md} +20 -0
  17. package/skills/project-analyze/phases/phase1-setup.md +182 -0
  18. package/skills/project-analyze/phases/phase2-understand.md +108 -0
  19. package/skills/project-analyze/phases/phase3-graph.md +77 -0
  20. package/skills/project-analyze/phases/phase4-synthesize.md +260 -0
  21. package/skills/project-analyze/phases/phase5-export.md +161 -0
  22. package/skills/project-analyze/prompts/{deep-analysis-agent.md → archive/deep-analysis-agent.md} +14 -1
  23. package/skills/project-analyze/prompts/understand-agent.md +407 -0
  24. package/skills/requirements-writer/README.md +1 -1
  25. package/skills/requirements-writer/SKILL.md +378 -284
  26. package/skills/requirements-writer/examples/prd-outline-example.md +5 -5
  27. package/skills/requirements-writer/templates/module-prd-template.md +15 -15
  28. package/skills/requirements-writer/templates/prd-outline-template.md +3 -3
  29. package/skills/requirements-writer/templates/user-story-template.md +23 -23
  30. package/skills/software-architecture/SKILL.md +248 -17
  31. package/templates/CLAUDE.md.android +17 -0
  32. package/templates/CLAUDE.md.devops +17 -0
  33. package/templates/CLAUDE.md.generic +17 -0
  34. package/templates/CLAUDE.md.go +17 -0
  35. package/templates/CLAUDE.md.harmony +17 -0
  36. package/templates/CLAUDE.md.java +17 -0
  37. package/templates/CLAUDE.md.mobile-flutter +17 -0
  38. package/templates/CLAUDE.md.mobile-react-native +17 -0
  39. package/templates/CLAUDE.md.mobile-swift +17 -0
  40. package/templates/CLAUDE.md.python +17 -0
  41. package/templates/CLAUDE.md.rust +17 -0
  42. package/templates/CLAUDE.md.rust-tauri +17 -0
  43. package/templates/CLAUDE.md.web +17 -0
  44. package/templates/cursor-rules.android.mdc +17 -0
  45. package/templates/cursor-rules.devops.mdc +17 -0
  46. package/templates/cursor-rules.generic.mdc +17 -0
  47. package/templates/cursor-rules.go.mdc +17 -0
  48. package/templates/cursor-rules.harmony.mdc +17 -0
  49. package/templates/cursor-rules.java.mdc +17 -0
  50. package/templates/cursor-rules.mobile-flutter.mdc +17 -0
  51. package/templates/cursor-rules.mobile-react-native.mdc +17 -0
  52. package/templates/cursor-rules.mobile-swift.mdc +17 -0
  53. package/templates/cursor-rules.python.mdc +17 -0
  54. package/templates/cursor-rules.rust-tauri.mdc +17 -0
  55. package/templates/cursor-rules.rust.mdc +17 -0
  56. package/templates/cursor-rules.web.mdc +17 -0
  57. package/templates/kiro-steering.android.md +6 -0
  58. package/templates/kiro-steering.devops.md +6 -0
  59. package/templates/kiro-steering.generic.md +6 -0
  60. package/templates/kiro-steering.go.md +6 -0
  61. package/templates/kiro-steering.harmony.md +6 -0
  62. package/templates/kiro-steering.java.md +6 -0
  63. package/templates/kiro-steering.mobile-flutter.md +6 -0
  64. package/templates/kiro-steering.mobile-react-native.md +6 -0
  65. package/templates/kiro-steering.mobile-swift.md +6 -0
  66. package/templates/kiro-steering.python.md +6 -0
  67. package/templates/kiro-steering.rust-tauri.md +6 -0
  68. package/templates/kiro-steering.rust.md +6 -0
  69. package/templates/kiro-steering.web.md +6 -0
  70. package/templates/shared/hard-rules.md +21 -0
  71. /package/skills/project-analyze/phases/{phase0.5-prescan.md → archive/phase0.5-prescan.md} +0 -0
  72. /package/skills/project-analyze/phases/{phase2a-l4-analysis.md → archive/phase2a-l4-analysis.md} +0 -0
  73. /package/skills/project-analyze/phases/{phase2b-l5-analysis.md → archive/phase2b-l5-analysis.md} +0 -0
  74. /package/skills/project-analyze/phases/{phase4-code-quality.md → archive/phase4-code-quality.md} +0 -0
  75. /package/skills/project-analyze/phases/{phase6-validation.md → archive/phase6-validation.md} +0 -0
  76. /package/skills/project-analyze/prompts/{code-review-agent.md → archive/code-review-agent.md} +0 -0
  77. /package/skills/project-analyze/prompts/{inventory-agent.md → archive/inventory-agent.md} +0 -0
  78. /package/skills/project-analyze/prompts/{l4-analysis-agent.md → archive/l4-analysis-agent.md} +0 -0
@@ -5,8 +5,8 @@ status: draft
5
5
  owner: PM
6
6
  last_updated: 2026-01-09
7
7
  related_docs:
8
- - docs/100-standards/102-requirements-standards.md
9
- - docs/200-product/201-project-brief.md
8
+ - docs/100-governance/102-requirements-standards.md
9
+ - docs/200-business/201-project-brief.md
10
10
  ---
11
11
 
12
12
  ## Purpose
@@ -206,9 +206,9 @@ Writing Order:
206
206
 
207
207
  ## References
208
208
 
209
- - Project Brief: `docs/200-product/201-project-brief.md`
210
- - Requirements Standards: `docs/100-standards/102-requirements-standards.md`
211
- - Documentation Standards: `docs/100-standards/101-documentation-standards.md`
209
+ - Project Brief: `docs/200-business/201-project-brief.md`
210
+ - Requirements Standards: `docs/100-governance/102-requirements-standards.md`
211
+ - Documentation Standards: `docs/100-governance/101-documentation-standards.md`
212
212
 
213
213
  ## Version History
214
214
 
@@ -6,8 +6,8 @@ owner: PM
6
6
  last_updated: YYYY-MM-DD
7
7
  related_docs:
8
8
  - docs/300-requirements/30x-prd-outline.md
9
- - docs/200-product/201-project-brief.md
10
- - docs/100-standards/102-requirements-standards.md
9
+ - docs/200-business/201-project-brief.md
10
+ - docs/100-governance/102-requirements-standards.md
11
11
  ---
12
12
 
13
13
  ## Purpose
@@ -196,7 +196,7 @@ All NFRs must be **quantifiable and testable**.
196
196
  - **Condition**: <Under what conditions>
197
197
  - **Measurement**: <How to measure>
198
198
  - **Verification**: <Test method>
199
- - **Reference**: `docs/600-architecture/6xx-security-view.md`
199
+ - **Reference**: `docs/400-architecture/4xx-security-view.md`
200
200
 
201
201
  ### NFR-<MODULE>-005: Audit
202
202
 
@@ -205,7 +205,7 @@ All NFRs must be **quantifiable and testable**.
205
205
  - **Condition**: <Under what conditions>
206
206
  - **Measurement**: <How to measure>
207
207
  - **Verification**: <Test method>
208
- - **Reference**: `docs/600-architecture/6xx-security-view.md`
208
+ - **Reference**: `docs/400-architecture/4xx-security-view.md`
209
209
 
210
210
  ### NFR-<MODULE>-006: Data Quality
211
211
 
@@ -214,7 +214,7 @@ All NFRs must be **quantifiable and testable**.
214
214
  - **Condition**: <Under what conditions>
215
215
  - **Measurement**: <How to measure>
216
216
  - **Verification**: <Test method>
217
- - **Reference**: `docs/500-data/502-data-dictionary.md`
217
+ - **Reference**: `docs/600-data/502-data-dictionary.md`
218
218
 
219
219
  ### NFR-<MODULE>-007: Compatibility
220
220
 
@@ -261,7 +261,7 @@ All NFRs must be **quantifiable and testable**.
261
261
  - **Color Contrast**: <Requirements>
262
262
  - **Font Sizing**: <Requirements>
263
263
 
264
- **Design Reference**: `docs/400-design/4xx-ux-design.md`
264
+ **Design Reference**: `docs/500-design/4xx-ux-design.md`
265
265
 
266
266
  ## Data Requirements
267
267
 
@@ -270,11 +270,11 @@ All NFRs must be **quantifiable and testable**.
270
270
  <List key data entities this module uses/produces>
271
271
 
272
272
  - **<Entity 1>**: <Description>
273
- - **Reference**: `docs/500-data/502-data-dictionary.md`
273
+ - **Reference**: `docs/600-data/502-data-dictionary.md`
274
274
  - **Operations**: <Read/Write/Update/Delete>
275
275
 
276
276
  - **<Entity 2>**: <Description>
277
- - **Reference**: `docs/500-data/502-data-dictionary.md`
277
+ - **Reference**: `docs/600-data/502-data-dictionary.md`
278
278
  - **Operations**: <Read/Write/Update/Delete>
279
279
 
280
280
  ### Data Validations
@@ -340,20 +340,20 @@ Instead use:
340
340
  ## References
341
341
 
342
342
  ### Product Documents
343
- - Project Brief: `docs/200-product/201-project-brief.md`
343
+ - Project Brief: `docs/200-business/201-project-brief.md`
344
344
  - Requirements Outline: `docs/300-requirements/30x-prd-outline.md`
345
345
 
346
346
  ### Design Documents
347
- - UX Design: `docs/400-design/4xx-ux-design.md`
348
- - Functional Spec: `docs/400-design/4xx-functional-spec.md`
347
+ - UX Design: `docs/500-design/4xx-ux-design.md`
348
+ - Functional Spec: `docs/500-design/4xx-functional-spec.md`
349
349
 
350
350
  ### Data Documents
351
- - Data Dictionary: `docs/500-data/502-data-dictionary.md`
352
- - ERD: `docs/500-data/501-entity-relationship.md`
351
+ - Data Dictionary: `docs/600-data/502-data-dictionary.md`
352
+ - ERD: `docs/600-data/501-entity-relationship.md`
353
353
 
354
354
  ### Architecture Documents
355
- - Security View: `docs/600-architecture/6xx-security-view.md`
356
- - API Specification: `docs/700-engineering/701-api-reference.md`
355
+ - Security View: `docs/400-architecture/4xx-security-view.md`
356
+ - API Specification: `docs/800-engineering/701-api-reference.md`
357
357
 
358
358
  ## Version History
359
359
 
@@ -174,9 +174,9 @@ For each module, create User Stories in: `docs/300-requirements/330-user-stories
174
174
 
175
175
  ## References
176
176
 
177
- - Project Brief: `docs/200-product/201-project-brief.md`
178
- - Requirements Standards: `docs/100-standards/102-requirements-standards.md`
179
- - Documentation Standards: `docs/100-standards/101-documentation-standards.md`
177
+ - Project Brief: `docs/200-business/201-project-brief.md`
178
+ - Requirements Standards: `docs/100-governance/102-requirements-standards.md`
179
+ - Documentation Standards: `docs/100-governance/101-documentation-standards.md`
180
180
 
181
181
  ## Version History
182
182
 
@@ -6,7 +6,7 @@ owner: PM
6
6
  last_updated: YYYY-MM-DD
7
7
  related_docs:
8
8
  - docs/300-requirements/31x-prd-<module>.md
9
- - docs/400-design/4xx-functional-spec.md
9
+ - docs/500-design/4xx-functional-spec.md
10
10
  us_id: US-IA-XXXX
11
11
  module: <MODULE>
12
12
  priority: P0|P1|P2
@@ -241,8 +241,8 @@ so that **I can quickly identify what changed between versions and validate that
241
241
  - **Expected Result**: <What confirms it works>
242
242
 
243
243
  **Data References**:
244
- - **Entity**: `<docs/500-data/502-data-dictionary.md>` (<field descriptions>)
245
- - **API**: `<docs/700-engineering/701-api-reference.md>` (<endpoint details>)
244
+ - **Entity**: `<docs/600-data/502-data-dictionary.md>` (<field descriptions>)
245
+ - **API**: `<docs/800-engineering/701-api-reference.md>` (<endpoint details>)
246
246
 
247
247
  #### FR-<MODULE>-<SEQ>: <Additional Requirement>
248
248
 
@@ -417,7 +417,7 @@ so that **I can quickly identify what changed between versions and validate that
417
417
 
418
418
  ### Design Reference
419
419
 
420
- **Detailed UI/UX Specifications**: `docs/400-design/4xx-ux-design.md`
420
+ **Detailed UI/UX Specifications**: `docs/500-design/4xx-ux-design.md`
421
421
 
422
422
  ---
423
423
 
@@ -438,7 +438,7 @@ so that **I can quickly identify what changed between versions and validate that
438
438
  - **Type**: <Data type>
439
439
  - **Required**: <Yes/No>
440
440
  - **Validation**: <Rules>
441
- - **Reference**: `docs/500-data/502-data-dictionary.md` (<field definition>)
441
+ - **Reference**: `docs/600-data/502-data-dictionary.md` (<field definition>)
442
442
 
443
443
  - **Attribute 2**: <Name>
444
444
  - <Same structure>
@@ -480,7 +480,7 @@ so that **I can quickly identify what changed between versions and validate that
480
480
 
481
481
  ### Data Dictionary References
482
482
 
483
- **Primary Data Dictionary**: `docs/500-data/502-data-dictionary.md`
483
+ **Primary Data Dictionary**: `docs/600-data/502-data-dictionary.md`
484
484
 
485
485
  **Relevant Sections**:
486
486
  - <Section 1>: <Description>
@@ -645,7 +645,7 @@ so that **I can quickly identify what changed between versions and validate that
645
645
 
646
646
  ### Security Reference
647
647
 
648
- **Security Architecture**: `docs/600-architecture/6xx-security-view.md`
648
+ **Security Architecture**: `docs/400-architecture/4xx-security-view.md`
649
649
 
650
650
  ---
651
651
 
@@ -847,7 +847,7 @@ This user story is "done" when:
847
847
  - **Error Codes**: <What errors we handle>
848
848
  - **Retry Logic**: <How we retry failures>
849
849
 
850
- **Reference**: `docs/700-engineering/701-api-reference.md`
850
+ **Reference**: `docs/800-engineering/701-api-reference.md`
851
851
 
852
852
  ### Data Migration
853
853
 
@@ -1042,28 +1042,28 @@ This user story is "done" when:
1042
1042
  - **Requirements Outline**: `docs/300-requirements/30x-prd-outline.md`
1043
1043
 
1044
1044
  ### Design Documents
1045
- - **Functional Specification**: `docs/400-design/4xx-functional-spec.md`
1046
- - **UX Design**: `docs/400-design/4xx-ux-design.md`
1047
- - **User Flows**: `docs/400-design/4xx-user-flows.md`
1045
+ - **Functional Specification**: `docs/500-design/4xx-functional-spec.md`
1046
+ - **UX Design**: `docs/500-design/4xx-ux-design.md`
1047
+ - **User Flows**: `docs/500-design/4xx-user-flows.md`
1048
1048
 
1049
1049
  ### Data Documents
1050
- - **Data Dictionary**: `docs/500-data/502-data-dictionary.md`
1051
- - **Entity Relationship Diagram**: `docs/500-data/501-entity-relationship.md`
1052
- - **Metrics Definition**: `docs/500-data/503-metrics-definition.md`
1050
+ - **Data Dictionary**: `docs/600-data/502-data-dictionary.md`
1051
+ - **Entity Relationship Diagram**: `docs/600-data/501-entity-relationship.md`
1052
+ - **Metrics Definition**: `docs/600-data/503-metrics-definition.md`
1053
1053
 
1054
1054
  ### Architecture Documents
1055
- - **Security Architecture**: `docs/600-architecture/6xx-security-view.md`
1056
- - **Integration Architecture**: `docs/600-architecture/6xx-integration.md`
1057
- - **API Architecture**: `docs/600-architecture/6xx-api-design.md`
1055
+ - **Security Architecture**: `docs/400-architecture/4xx-security-view.md`
1056
+ - **Integration Architecture**: `docs/400-architecture/4xx-integration.md`
1057
+ - **API Architecture**: `docs/400-architecture/4xx-api-design.md`
1058
1058
 
1059
1059
  ### Engineering Documents
1060
- - **API Reference**: `docs/700-engineering/701-api-reference.md`
1061
- - **Data Models**: `docs/700-engineering/702-data-models.md`
1060
+ - **API Reference**: `docs/800-engineering/701-api-reference.md`
1061
+ - **Data Models**: `docs/800-engineering/702-data-models.md`
1062
1062
 
1063
1063
  ### Standards
1064
- - **Requirements Standards**: `docs/100-standards/102-requirements-standards.md`
1065
- - **Documentation Standards**: `docs/100-standards/101-documentation-standards.md`
1066
- - **Engineering Standards**: `docs/100-standards/106-engineering-standards.md`
1064
+ - **Requirements Standards**: `docs/100-governance/102-requirements-standards.md`
1065
+ - **Documentation Standards**: `docs/100-governance/101-documentation-standards.md`
1066
+ - **Engineering Standards**: `docs/100-governance/106-engineering-standards.md`
1067
1067
 
1068
1068
  ---
1069
1069
 
@@ -1103,7 +1103,7 @@ Before considering this User Story complete, verify:
1103
1103
  - [ ] All 10 sections are complete
1104
1104
  - [ ] Each section meets minimum word count
1105
1105
  - [ ] All acceptance criteria are objectively verifiable
1106
- - [ ] All data references link to `docs/500-data/`
1106
+ - [ ] All data references link to `docs/600-data/`
1107
1107
  - [ ] All security/audit requirements are specified
1108
1108
  - [ ] RBAC and data scope are defined
1109
1109
  - [ ] All edge cases are covered
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: software-architecture
3
3
  description: Use when designing, reviewing, or scaffolding system architecture — covers architecture style selection, high-concurrency/HA design, DDD, clean architecture, microservice boundaries, and deployment strategy.
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  category: architecture
6
6
  ---
7
7
 
@@ -185,25 +185,241 @@ WAF / CDN / ingress / LB → API gateway → service registry/discovery → conf
185
185
 
186
186
  ## Output Format
187
187
 
188
- ### A. Architecture Summary
189
- - Business context and dominant technical drivers
190
- - Recommended architecture style
191
- - Why this complexity level is right for now
188
+ ### 概述
192
189
 
193
- ### B. Component Design
194
- Key components and their responsibilities.
190
+ 架构设计产出 6 个交付物(A-F)+ ADR 模板。每个交付物有明确的模板结构和必填字段。
195
191
 
196
- ### C. Data and Interaction Design
197
- Sync vs async boundaries, API boundaries, data ownership, consistency approach, cache strategy.
192
+ 如果文档写入 `docs/400-architecture/`,需遵循 `doc-standards-enforcer` frontmatter 规范。
198
193
 
199
- ### D. Deployment and Operations
200
- Environment layout, scaling model, CI/CD, observability, rollback.
194
+ ---
195
+
196
+ ### A. Architecture Summary(架构摘要)
197
+
198
+ ```markdown
199
+ # {Project Name} Architecture Summary
200
+
201
+ ## 1. Business Context
202
+ - 业务目标(1-2 句)
203
+ - 目标用户和规模(用户数/并发量/数据量)
204
+ - 核心业务流程(Mermaid flowchart)
205
+
206
+ ## 2. Dominant Technical Drivers
207
+ | 驱动因素 | 优先级 | 当前状态 | 目标状态 |
208
+ |---------|--------|---------|---------|
209
+ | 高并发 | P0 | 100 QPS | 10K QPS |
210
+ | 高可用 | P0 | 99% | 99.9% |
211
+ | 安全 | P1 | 基础认证 | OAuth2 + RBAC |
212
+
213
+ ## 3. Architecture Style Decision
214
+ - 推荐风格:{Monolith / Distributed / Microservices / Serverless}
215
+ - 选择理由(为什么更简单的方案不够用)
216
+ - 对比表:
217
+ | 方案 | 优势 | 劣势 | 适用条件 | 选择 |
218
+ |------|------|------|---------|------|
219
+
220
+ ## 4. Architecture Overview Diagram
221
+ (Mermaid graph TB,展示所有核心组件和交互关系)
222
+ ```
223
+
224
+ ### B. Component Design(组件设计)
225
+
226
+ ```markdown
227
+ # Component Design
228
+
229
+ ## 组件清单
230
+ | 组件 | 职责 | 技术选型 | 部署方式 | 依赖组件 | SLA |
231
+ |------|------|---------|---------|---------|-----|
232
+ | API Gateway | 路由+限流+认证 | Kong/Nginx | K8s Pod | Auth Service | 99.9% |
233
+ | User Service | 用户生命周期 | Spring Boot | K8s Pod | DB, Cache | 99.9% |
234
+
235
+ ## 分层架构
236
+ | 层 | 职责 | 包含组件 | 通信协议 |
237
+ |---|------|---------|---------|
238
+ | 接入层 | 路由、认证、限流 | Gateway, LB | HTTPS |
239
+ | 应用层 | 业务编排 | Services | gRPC/REST |
240
+ | 领域层 | 核心业务逻辑 | Domain Models | In-process |
241
+ | 数据层 | 持久化 | DB, Cache, MQ | TCP |
242
+
243
+ ## 每个核心组件详细设计
244
+ 对每个组件:
245
+ - 职责边界(做什么 / 不做什么)
246
+ - 接口定义(暴露的 API 摘要)
247
+ - 数据归属(拥有哪些实体)
248
+ - 扩展策略(水平/垂直,触发条件)
249
+ - 容错机制(降级/熔断/重试策略)
250
+ ```
251
+
252
+ ### C. Data and Interaction Design(数据与交互设计)
253
+
254
+ ```markdown
255
+ # Data and Interaction Design
256
+
257
+ ## 1. 数据归属矩阵
258
+ | 数据实体 | 归属服务 | 读取方 | 写入方 | 一致性要求 |
259
+ |---------|---------|--------|--------|-----------|
260
+ | User | User Service | Order, Payment | User Service | 强一致 |
261
+ | Order | Order Service | Payment, Report | Order Service | 最终一致 |
262
+
263
+ ## 2. 同步/异步通信边界
264
+ | 源 | 目标 | 方式 | 协议 | 超时 | 重试 | 降级策略 |
265
+ |---|------|------|------|------|------|---------|
266
+ | Gateway → UserSvc | 同步 | REST | 3s | 2次 | 返回缓存 |
267
+ | OrderSvc → PaymentSvc | 异步 | MQ(RabbitMQ) | - | 3次+DLQ | 人工补偿 |
268
+
269
+ ## 3. API 契约摘要
270
+ | API | Method | Path | 请求方 | 提供方 | 关键参数 |
271
+ |-----|--------|------|--------|--------|---------|
272
+
273
+ ## 4. 缓存策略
274
+ | 缓存对象 | 缓存层 | TTL | 失效策略 | 一致性风险 |
275
+ |---------|--------|-----|---------|-----------|
276
+
277
+ ## 5. 数据一致性方案
278
+ 对跨服务的数据操作:
279
+ | 场景 | 涉及服务 | 一致性策略 | 补偿机制 |
280
+ |------|---------|-----------|---------|
281
+ | 下单支付 | Order+Payment | Saga | 退款补偿 |
282
+ ```
283
+
284
+ ### D. Deployment and Operations(部署与运维)
285
+
286
+ ```markdown
287
+ # Deployment and Operations
288
+
289
+ ## 1. 部署拓扑
290
+ (Mermaid graph,展示环境布局)
291
+
292
+ ## 2. 环境配置矩阵
293
+ | 环境 | 用途 | 实例数 | 数据库 | 缓存 | 配置来源 |
294
+ |------|------|--------|--------|------|---------|
295
+ | dev | 开发 | 1 | SQLite/H2 | 本地 | .env |
296
+ | staging | 预发布 | 2 | MySQL | Redis | ConfigCenter |
297
+ | production | 生产 | 3+ | MySQL(主从) | Redis(集群) | ConfigCenter |
298
+
299
+ ## 3. CI/CD 流程
300
+ (Mermaid flowchart:代码提交 → 构建 → 测试 → 镜像 → 部署 → 健康检查)
301
+
302
+ ## 4. 可观测性
303
+ | 维度 | 工具 | 关键指标 | 告警阈值 |
304
+ |------|------|---------|---------|
305
+ | Metrics | Prometheus | API 延迟 P99 | > 500ms |
306
+ | Logging | ELK/Loki | 错误率 | > 1% |
307
+ | Tracing | Jaeger | 链路完整性 | 采样率 > 10% |
308
+
309
+ ## 5. 回滚策略
310
+ | 场景 | 回滚方式 | RTO | 数据处理 |
311
+ |------|---------|-----|---------|
312
+ | 代码缺陷 | 回退到上一版本 | < 5min | 无需处理 |
313
+ | 数据迁移失败 | 执行回滚脚本 | < 30min | 备份恢复 |
314
+
315
+ ## 6. 扩缩容规则
316
+ | 服务 | 指标 | 扩容阈值 | 缩容阈值 | 最大/最小实例 |
317
+ |------|------|---------|---------|-------------|
318
+ ```
319
+
320
+ ### E. Risk and Trade-offs(风险与权衡)
321
+
322
+ ```markdown
323
+ # Risk and Trade-offs
324
+
325
+ ## 风险登记册
326
+ | ID | 风险描述 | 概率 | 影响 | 缓解措施 | 负责人 | 状态 |
327
+ |----|---------|------|------|---------|--------|------|
328
+ | R001 | 第三方支付接口不稳定 | 高 | 高 | 多通道+降级 | Arch | Open |
329
+
330
+ ## 架构权衡
331
+ | 决策 | 获得 | 付出 | 接受理由 |
332
+ |------|------|------|---------|
333
+ | 引入 MQ 异步 | 解耦+削峰 | 运维复杂度+最终一致 | 峰值流量 10x |
334
+ ```
335
+
336
+ ### F. Evolution Roadmap(演进路线图)
337
+
338
+ ```markdown
339
+ # Evolution Roadmap
340
+
341
+ | 阶段 | 时间范围 | 目标 | 关键动作 | 验证标准 |
342
+ |------|---------|------|---------|---------|
343
+ | Phase 1 | 1-2周 | 快速修复 | 解耦循环依赖、统一日志 | 循环依赖 = 0 |
344
+ | Phase 2 | 2-4周 | 中期重构 | 抽取共享服务、引入缓存 | P99 < 200ms |
345
+ | Phase 3 | 1-3月 | 架构升级 | 服务拆分、K8s 部署 | 可独立部署 |
346
+
347
+ 每个 Phase 包含:
348
+ - 目标(解决什么问题)
349
+ - 涉及模块/服务
350
+ - 风险评估
351
+ - 回退方案
352
+ - 验证标准(可度量)
353
+ ```
354
+
355
+ ---
356
+
357
+ ### G. ADR Template(架构决策记录 — 新增)
358
+
359
+ 每个重要架构决策生成一份 ADR:
360
+
361
+ ```markdown
362
+ # ADR-{SEQ}: {Decision Title}
363
+
364
+ ## Status
365
+ Proposed | Accepted | Deprecated | Superseded by ADR-{N}
366
+
367
+ ## Context
368
+ - 背景:什么业务/技术问题触发了这个决策?
369
+ - 约束:有什么限制(团队能力/时间/预算/合规)?
370
+ - 当前状态:现在是怎么做的?为什么不够用?
371
+
372
+ ## Decision
373
+ 我们决定 {具体决策}。
374
+
375
+ ## Options Considered
376
+ | 选项 | 优势 | 劣势 | 评估 |
377
+ |------|------|------|------|
378
+ | 选项 A(选中)| ... | ... | ✅ 最佳 |
379
+ | 选项 B | ... | ... | ❌ 不满足 NFR |
380
+ | 选项 C | ... | ... | ❌ 团队不熟悉 |
381
+
382
+ ## Consequences
383
+ ### 正面
384
+ - ...
385
+
386
+ ### 负面
387
+ - ...
388
+
389
+ ### 风险
390
+ - ...
201
391
 
202
- ### E. Risk and Trade-offs
203
- What this architecture solves and what complexity it introduces.
392
+ ## NFR Impact
393
+ | NFR | 影响 | 缓解措施 |
394
+ |-----|------|---------|
395
+ | NFR-SYS-001 性能 | P99 可能增加 50ms | 引入缓存层 |
204
396
 
205
- ### F. Evolution Roadmap
206
- Phased stages — e.g., Phase 1: modular monolith → Phase 2: extract hot/high-change services → Phase 3: platform governance and observability hardening.
397
+ ## Related
398
+ - 相关 ADR:ADR-{N}
399
+ - 相关 PRD:PRD-{MOD}-{SEQ}(来自 requirements-writer)
400
+ - 相关模块:{module list}
401
+ ```
402
+
403
+ ---
404
+
405
+ ### NFR 统一编号体系
406
+
407
+ 与 requirements-writer 的 NFR 编号对齐:
408
+
409
+ ```
410
+ NFR-{SCOPE}-{SEQ}
411
+
412
+ SCOPE 可选值:
413
+ SYS — 系统级(跨所有模块)
414
+ {MOD} — 模块级(如 USER, ORDER)
415
+
416
+ 示例:
417
+ NFR-SYS-001: 系统整体 API P99 延迟 < 500ms
418
+ NFR-SYS-002: 系统可用性 > 99.9%
419
+ NFR-USER-001: 用户注册 API 响应 < 200ms
420
+ ```
421
+
422
+ architecture 中定义的系统级 NFR(NFR-SYS-*)是 requirements-writer 模块级 NFR(NFR-{MOD}-*)的上游约束。模块级 NFR 不得超过系统级 NFR 的范围。
207
423
 
208
424
  ---
209
425
 
@@ -230,7 +446,7 @@ This skill orchestrates architecture; stack-specific skills govern implementatio
230
446
 
231
447
  | Workflow | When to Use | How |
232
448
  |----------|-------------|-----|
233
- | **project-analyze** | Analyzing an existing project's architecture | Run `/project-analyze` (v5.0 五维分析框架) first to generate knowledge graph and module inventory, then use that data to inform architecture review |
449
+ | **project-analyze** | Analyzing an existing project's architecture | Run `/project-analyze` (v5.1 五维分析框架) first to generate knowledge graph and module inventory, then use that data to inform architecture review |
234
450
  | **code-review** | Architecture compliance validation | code-review Dimension 5 validates architecture compliance; for major violations, follow up with this skill for deeper review |
235
451
  | **doc-standards-enforcer** | Producing architecture documentation (ADRs, HLD/LLD) | After producing architecture deliverables, validate documentation format with `doc-standards-enforcer` |
236
452
  | **doc-coauthoring** | Co-authoring technical specs or design documents | Use `doc-coauthoring` workflow for collaborative document creation; this skill provides technical content accuracy |
@@ -240,7 +456,7 @@ This skill orchestrates architecture; stack-specific skills govern implementatio
240
456
 
241
457
  For existing projects requiring architecture assessment:
242
458
 
243
- 1. Run `/project-analyze` (v5.0 五维分析框架) to generate knowledge graph
459
+ 1. Run `/project-analyze` (v5.1 五维分析框架) to generate knowledge graph
244
460
  2. Review the generated architecture diagrams and module dependency graph
245
461
  3. Use this skill's Review Checklist against the analysis results
246
462
  4. Produce ADR or architecture improvement plan
@@ -276,3 +492,18 @@ Do **not**:
276
492
  **Safety and correctness:** Duplicate prevention and idempotency addressed? Rate limits, degradation, and fallback paths defined? Consistency trade-offs explained?
277
493
 
278
494
  **Evolution:** Design supports incremental evolution? Phased roadmap instead of "final architecture" thinking?
495
+
496
+ ---
497
+
498
+ ## Skill 协作
499
+
500
+ | 协作 Skill | 触发条件 | 交互方式 |
501
+ |-----------|---------|---------|
502
+ | **project-analyze** | 需要分析现有项目架构 | 先运行 `/project-analyze` 生成知识图谱,再用数据驱动架构评审 |
503
+ | **code-review** | 架构合规性验证 | code-review Dimension 5 验证架构合规;重大违规时建议运行本 skill 深度评审 |
504
+ | **doc-standards-enforcer** | 产出架构文档(ADR、HLD/LLD) | 架构交付物完成后,用 `doc-standards-enforcer` 验证文档格式 |
505
+ | **doc-coauthoring** | 协作撰写技术规格或设计文档 | 本 skill 提供技术内容准确性,`doc-coauthoring` 管理协作流程 |
506
+ | **project-query** | 需要查询架构分析详细数据(层违反、耦合度等) | 建议运行 |
507
+ | **requirements-writer** | Architecture NFR 需要传递到模块 PRD | 系统级 NFR(NFR-SYS-*)作为模块级 NFR 的上游约束 |
508
+ | **java-conventions** | Java/Spring 项目架构设计 | 加载栈级分层/命名/并发规范 |
509
+ | **web-conventions** | 前端项目架构设计 | 加载前端项目结构/组件规范 |
@@ -55,3 +55,20 @@ Android / Kotlin application
55
55
  # Check for dependency updates
56
56
  ./gradlew dependencyUpdates
57
57
  ```
58
+
59
+
60
+ ## aTool Hard Rules (Non-bypassable)
61
+
62
+ These rules apply regardless of which skills are invoked or which mode the IDE is in (Plan Mode, normal mode, etc.).
63
+
64
+ ### 1. Documentation Sync Gate
65
+ After modifying any source file, update affected documentation (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming the task done.
66
+ Gate: if docs are stale, the task is NOT done. Invoke /verification-before-completion before completion.
67
+
68
+ ### 2. Verification Gate
69
+ Before claiming any work complete: (a) run tests and verify they pass, (b) check doc freshness, (c) confirm no critical code quality issues.
70
+ If any check fails, the task is NOT done. No exceptions.
71
+
72
+ ### 3. Root Cause Before Fix
73
+ When fixing bugs: investigate and identify root cause BEFORE writing any fix code. Never guess-fix or try multiple changes simultaneously.
74
+ See /systematic-debugging for full methodology.
@@ -48,3 +48,20 @@ DevOps / Infrastructure (Docker / Kubernetes / Terraform / CI-CD)
48
48
  - Use secrets management (Vault, AWS Secrets Manager)
49
49
  - Least privilege principle
50
50
  - Rotate secrets regularly
51
+
52
+
53
+ ## aTool Hard Rules (Non-bypassable)
54
+
55
+ These rules apply regardless of which skills are invoked or which mode the IDE is in (Plan Mode, normal mode, etc.).
56
+
57
+ ### 1. Documentation Sync Gate
58
+ After modifying any source file, update affected documentation (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming the task done.
59
+ Gate: if docs are stale, the task is NOT done. Invoke /verification-before-completion before completion.
60
+
61
+ ### 2. Verification Gate
62
+ Before claiming any work complete: (a) run tests and verify they pass, (b) check doc freshness, (c) confirm no critical code quality issues.
63
+ If any check fails, the task is NOT done. No exceptions.
64
+
65
+ ### 3. Root Cause Before Fix
66
+ When fixing bugs: investigate and identify root cause BEFORE writing any fix code. Never guess-fix or try multiple changes simultaneously.
67
+ See /systematic-debugging for full methodology.
@@ -32,3 +32,20 @@ Generic project (no specific technology stack detected)
32
32
  - Run `./install.sh --project .` again after setting up your project
33
33
  - aTool can auto-detect your stack once you add config files (package.json, Cargo.toml, etc.)
34
34
  - Use `/atool-init` to re-run initialization after project setup
35
+
36
+
37
+ ## aTool Hard Rules (Non-bypassable)
38
+
39
+ These rules apply regardless of which skills are invoked or which mode the IDE is in (Plan Mode, normal mode, etc.).
40
+
41
+ ### 1. Documentation Sync Gate
42
+ After modifying any source file, update affected documentation (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming the task done.
43
+ Gate: if docs are stale, the task is NOT done. Invoke /verification-before-completion before completion.
44
+
45
+ ### 2. Verification Gate
46
+ Before claiming any work complete: (a) run tests and verify they pass, (b) check doc freshness, (c) confirm no critical code quality issues.
47
+ If any check fails, the task is NOT done. No exceptions.
48
+
49
+ ### 3. Root Cause Before Fix
50
+ When fixing bugs: investigate and identify root cause BEFORE writing any fix code. Never guess-fix or try multiple changes simultaneously.
51
+ See /systematic-debugging for full methodology.
@@ -65,3 +65,20 @@ gofmt -w .
65
65
  # Tidy dependencies
66
66
  go mod tidy
67
67
  ```
68
+
69
+
70
+ ## aTool Hard Rules (Non-bypassable)
71
+
72
+ These rules apply regardless of which skills are invoked or which mode the IDE is in (Plan Mode, normal mode, etc.).
73
+
74
+ ### 1. Documentation Sync Gate
75
+ After modifying any source file, update affected documentation (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming the task done.
76
+ Gate: if docs are stale, the task is NOT done. Invoke /verification-before-completion before completion.
77
+
78
+ ### 2. Verification Gate
79
+ Before claiming any work complete: (a) run tests and verify they pass, (b) check doc freshness, (c) confirm no critical code quality issues.
80
+ If any check fails, the task is NOT done. No exceptions.
81
+
82
+ ### 3. Root Cause Before Fix
83
+ When fixing bugs: investigate and identify root cause BEFORE writing any fix code. Never guess-fix or try multiple changes simultaneously.
84
+ See /systematic-debugging for full methodology.
@@ -52,3 +52,20 @@ hvigorw clean
52
52
  # Run tests
53
53
  hvigorw test
54
54
  ```
55
+
56
+
57
+ ## aTool Hard Rules (Non-bypassable)
58
+
59
+ These rules apply regardless of which skills are invoked or which mode the IDE is in (Plan Mode, normal mode, etc.).
60
+
61
+ ### 1. Documentation Sync Gate
62
+ After modifying any source file, update affected documentation (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming the task done.
63
+ Gate: if docs are stale, the task is NOT done. Invoke /verification-before-completion before completion.
64
+
65
+ ### 2. Verification Gate
66
+ Before claiming any work complete: (a) run tests and verify they pass, (b) check doc freshness, (c) confirm no critical code quality issues.
67
+ If any check fails, the task is NOT done. No exceptions.
68
+
69
+ ### 3. Root Cause Before Fix
70
+ When fixing bugs: investigate and identify root cause BEFORE writing any fix code. Never guess-fix or try multiple changes simultaneously.
71
+ See /systematic-debugging for full methodology.
@@ -54,3 +54,20 @@ Java / Spring Boot project
54
54
  # Check for dependency updates
55
55
  ./mvnw versions:display-dependency-updates
56
56
  ```
57
+
58
+
59
+ ## aTool Hard Rules (Non-bypassable)
60
+
61
+ These rules apply regardless of which skills are invoked or which mode the IDE is in (Plan Mode, normal mode, etc.).
62
+
63
+ ### 1. Documentation Sync Gate
64
+ After modifying any source file, update affected documentation (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming the task done.
65
+ Gate: if docs are stale, the task is NOT done. Invoke /verification-before-completion before completion.
66
+
67
+ ### 2. Verification Gate
68
+ Before claiming any work complete: (a) run tests and verify they pass, (b) check doc freshness, (c) confirm no critical code quality issues.
69
+ If any check fails, the task is NOT done. No exceptions.
70
+
71
+ ### 3. Root Cause Before Fix
72
+ When fixing bugs: investigate and identify root cause BEFORE writing any fix code. Never guess-fix or try multiple changes simultaneously.
73
+ See /systematic-debugging for full methodology.