@chongyan/autospec 1.0.1
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/LICENSE +21 -0
- package/README.en.md +472 -0
- package/README.md +476 -0
- package/bin/autospec.js +3 -0
- package/knowledge/README.md +144 -0
- package/knowledge/checklists/code.md +182 -0
- package/knowledge/checklists/design.md +196 -0
- package/knowledge/checklists/release.md +70 -0
- package/knowledge/checklists/requirement.md +169 -0
- package/knowledge/checklists/test.md +46 -0
- package/knowledge/config/README.en.md +44 -0
- package/knowledge/config/README.md +44 -0
- package/knowledge/config/role-composition.yaml +98 -0
- package/knowledge/config/role-extensions.yaml +140 -0
- package/knowledge/config/skill-compositions.yaml +142 -0
- package/knowledge/config/team-stage.yaml +95 -0
- package/knowledge/config/team-tasks.yaml +139 -0
- package/knowledge/config/team-triggers.yaml +198 -0
- package/knowledge/config/validation-patterns.yaml +137 -0
- package/knowledge/domain/README.md +115 -0
- package/knowledge/domain/flows/README.md +194 -0
- package/knowledge/domain/glossary.md +143 -0
- package/knowledge/domain/rules.md +138 -0
- package/knowledge/environment/README.en.md +36 -0
- package/knowledge/environment/README.md +87 -0
- package/knowledge/environment/component-knowledge.md +316 -0
- package/knowledge/environment/detection-patterns.yaml +502 -0
- package/knowledge/environment/middleware-knowledge.md +237 -0
- package/knowledge/environment/template-registry.md +321 -0
- package/knowledge/guides/domain-driven-design.md +345 -0
- package/knowledge/guides/knowledge-management.md +369 -0
- package/knowledge/guides/requirement-engineering.md +329 -0
- package/knowledge/guides/stages/ai-effect-evaluator.md +93 -0
- package/knowledge/guides/stages/code-implementer.md +205 -0
- package/knowledge/guides/stages/code-reviewer.md +111 -0
- package/knowledge/guides/stages/consistency-checker.md +177 -0
- package/knowledge/guides/stages/design-planner.md +401 -0
- package/knowledge/guides/stages/design-reviewer.md +83 -0
- package/knowledge/guides/stages/integration-test-runner.md +105 -0
- package/knowledge/guides/stages/release-checker.md +205 -0
- package/knowledge/guides/stages/requirement-analyzer.md +195 -0
- package/knowledge/guides/stages/requirement-reviewer.md +83 -0
- package/knowledge/guides/stages/security-reviewer.md +89 -0
- package/knowledge/guides/stages/test-context-analyzer.md +250 -0
- package/knowledge/guides/stages/test-generator.md +241 -0
- package/knowledge/guides/stages/test-planner.md +183 -0
- package/knowledge/guides/stages/test-reviewer.md +76 -0
- package/knowledge/guides/stages/unit-test-runner.md +83 -0
- package/knowledge/guides/support/ai-agent-analyzer.md +362 -0
- package/knowledge/guides/support/ai-anomaly-analyzer.md +213 -0
- package/knowledge/guides/support/ai-artifact-evaluator.md +192 -0
- package/knowledge/guides/support/ai-capability-analyzer.md +193 -0
- package/knowledge/guides/support/ai-component-analyzer.md +169 -0
- package/knowledge/guides/support/ai-data-validator.md +276 -0
- package/knowledge/guides/support/ai-evaluation-planner.md +374 -0
- package/knowledge/guides/support/ai-path-evaluator.md +274 -0
- package/knowledge/guides/support/ai-pipeline-evaluator.md +219 -0
- package/knowledge/guides/support/ai-rag-analyzer.md +339 -0
- package/knowledge/guides/support/ai-task-assessor.md +418 -0
- package/knowledge/guides/support/ai-test-diagnostics.md +133 -0
- package/knowledge/guides/support/complexity-assessor.md +268 -0
- package/knowledge/guides/support/component-discovery.md +183 -0
- package/knowledge/guides/support/environment-scanner.md +207 -0
- package/knowledge/guides/support/environment-validator.md +207 -0
- package/knowledge/guides/support/knowledge-generator.md +234 -0
- package/knowledge/guides/support/methodology-extractor.md +55 -0
- package/knowledge/guides/support/pipeline-protocol.md +438 -0
- package/knowledge/guides/support/practice-logger.md +359 -0
- package/knowledge/guides/support/scope-inference.md +174 -0
- package/knowledge/guides/support/skill-distiller.md +91 -0
- package/knowledge/guides/support/skill-updater.md +45 -0
- package/knowledge/guides/support/skill-validator.md +72 -0
- package/knowledge/guides/support/team-orchestrator.md +323 -0
- package/knowledge/guides/support/tech-stack-analyzer.md +139 -0
- package/knowledge/guides/support/test-runner.md +254 -0
- package/knowledge/guides/system-design.md +352 -0
- package/knowledge/organization/ai-native-team.md +318 -0
- package/knowledge/organization/team-metrics.md +228 -0
- package/knowledge/principles/constitution.md +134 -0
- package/knowledge/principles/core-principles.md +368 -0
- package/knowledge/principles/design-philosophy.md +877 -0
- package/knowledge/principles/evolution.md +553 -0
- package/knowledge/process/01-requirement.md +113 -0
- package/knowledge/process/02-design.md +123 -0
- package/knowledge/process/03-implementation.md +90 -0
- package/knowledge/process/04-review.md +80 -0
- package/knowledge/process/05-testing.md +90 -0
- package/knowledge/process/06-delivery.md +88 -0
- package/knowledge/process/README.en.md +38 -0
- package/knowledge/process/README.md +48 -0
- package/knowledge/process/ai-sdlc.md +475 -0
- package/knowledge/process/overview.md +319 -0
- package/knowledge/standards/code-review.md +876 -0
- package/knowledge/standards/coding-style.md +940 -0
- package/knowledge/standards/data-consistency.md +1085 -0
- package/knowledge/standards/document-versioning.md +210 -0
- package/knowledge/standards/risk-detection.md +186 -0
- package/knowledge/templates/ai-evaluation.md +150 -0
- package/knowledge/templates/api-design.md +117 -0
- package/knowledge/templates/database-design.md +132 -0
- package/knowledge/templates/domain-driven-design.md +321 -0
- package/knowledge/templates/product-proposal.md +201 -0
- package/knowledge/templates/system-design.md +227 -0
- package/knowledge/templates/task-breakdown.md +107 -0
- package/knowledge/templates/test-case.md +170 -0
- package/package.json +53 -0
- package/plugins/.claude-plugin/plugin.json +134 -0
- package/plugins/agents/roles/ai-engineer.md +129 -0
- package/plugins/agents/roles/backend-engineer.md +165 -0
- package/plugins/agents/roles/ceo.md +94 -0
- package/plugins/agents/roles/data-engineer.md +135 -0
- package/plugins/agents/roles/devops-engineer.md +181 -0
- package/plugins/agents/roles/frontend-engineer.md +129 -0
- package/plugins/agents/roles/product-owner.md +98 -0
- package/plugins/agents/roles/quality-engineer.md +129 -0
- package/plugins/agents/roles/security-engineer.md +180 -0
- package/plugins/agents/roles/tech-lead.md +97 -0
- package/plugins/agents/support/blind-comparator.md +88 -0
- package/plugins/agents/support/consistency-checker.md +103 -0
- package/plugins/agents/support/failure-diagnostician.md +141 -0
- package/plugins/agents/support/independent-reviewer.md +80 -0
- package/plugins/agents/support/safety-auditor.md +121 -0
- package/plugins/agents/support/skill-benchmarker.md +86 -0
- package/plugins/agents/support/skill-forger.md +105 -0
- package/plugins/agents/support/stage-gate-evaluator.md +121 -0
- package/plugins/agents/support/test-coverage-reviewer.md +73 -0
- package/plugins/benchmarks/templates/README.md +44 -0
- package/plugins/benchmarks/templates/commands/explore-template.yaml +48 -0
- package/plugins/benchmarks/templates/pipeline/agile-template.yaml +84 -0
- package/plugins/benchmarks/templates/pipeline/waterfall-template.yaml +106 -0
- package/plugins/benchmarks/templates/skills/requirement-analyzer-template.yaml +48 -0
- package/plugins/commands/README.en.md +96 -0
- package/plugins/commands/README.md +96 -0
- package/plugins/commands/apply.md +191 -0
- package/plugins/commands/archive.md +76 -0
- package/plugins/commands/env-export.md +79 -0
- package/plugins/commands/env-sync.md +640 -0
- package/plugins/commands/env-template.md +223 -0
- package/plugins/commands/env-update.md +264 -0
- package/plugins/commands/env-validate.md +176 -0
- package/plugins/commands/env.md +79 -0
- package/plugins/commands/explore.md +76 -0
- package/plugins/commands/field-evolve.md +536 -0
- package/plugins/commands/memory.md +249 -0
- package/plugins/commands/project-evolve.md +821 -0
- package/plugins/commands/propose.md +93 -0
- package/plugins/commands/review.md +140 -0
- package/plugins/commands/run.md +224 -0
- package/plugins/commands/status.md +62 -0
- package/plugins/commands/validate.md +108 -0
- package/plugins/hooks/README.en.md +56 -0
- package/plugins/hooks/README.md +56 -0
- package/plugins/hooks/ai-project-guard.js +329 -0
- package/plugins/hooks/artifact-evaluation-hook.js +237 -0
- package/plugins/hooks/constitution-guard.js +211 -0
- package/plugins/hooks/environment-autocommit.js +264 -0
- package/plugins/hooks/environment-manager.js +778 -0
- package/plugins/hooks/execution-tracker.js +354 -0
- package/plugins/hooks/frozen-zone-guard.js +140 -0
- package/plugins/hooks/layer1-validator.js +423 -0
- package/plugins/hooks/lib/artifact-evaluator.js +414 -0
- package/plugins/hooks/lib/benchmarks/change-detector.js +390 -0
- package/plugins/hooks/lib/benchmarks/evaluator.js +605 -0
- package/plugins/hooks/lib/benchmarks/integration-example.js +169 -0
- package/plugins/hooks/lib/data-and-ai-detector.js +275 -0
- package/plugins/hooks/lib/detection-pattern-loader.js +865 -0
- package/plugins/hooks/lib/directory-discovery.js +395 -0
- package/plugins/hooks/lib/environment-config-loader.js +341 -0
- package/plugins/hooks/lib/environment-detector.js +553 -0
- package/plugins/hooks/lib/environment-evolver.js +564 -0
- package/plugins/hooks/lib/environment-registry.js +813 -0
- package/plugins/hooks/lib/execution-path.js +427 -0
- package/plugins/hooks/lib/hook-error-recorder.js +245 -0
- package/plugins/hooks/lib/hook-logger.js +538 -0
- package/plugins/hooks/lib/hook-runner.js +97 -0
- package/plugins/hooks/lib/hook-runner.sh +44 -0
- package/plugins/hooks/lib/hook-state-manager.js +480 -0
- package/plugins/hooks/lib/memory-extractor.js +377 -0
- package/plugins/hooks/lib/memory-manager.js +673 -0
- package/plugins/hooks/lib/metrics-analyzer.js +489 -0
- package/plugins/hooks/lib/project-evolution/auto-fixer.js +511 -0
- package/plugins/hooks/lib/project-evolution/memory-manager.js +346 -0
- package/plugins/hooks/lib/project-evolution/pattern-detector.js +476 -0
- package/plugins/hooks/lib/project-evolution/semantic-indexer.js +480 -0
- package/plugins/hooks/lib/project-structure-detector.js +326 -0
- package/plugins/hooks/lib/rollback-tracker.js +346 -0
- package/plugins/hooks/lib/source-code-scanner.js +596 -0
- package/plugins/hooks/lib/technology-stack-detector.js +374 -0
- package/plugins/hooks/lib/test-failure-analyzer.js +375 -0
- package/plugins/hooks/lib/test-failure-fixer.js +268 -0
- package/plugins/hooks/lib/trace-context.js +277 -0
- package/plugins/hooks/lib/validation-patterns.js +415 -0
- package/plugins/hooks/memory-sync.js +171 -0
- package/plugins/hooks/pipeline-observer.js +413 -0
- package/plugins/hooks/scope-sentinel.js +204 -0
- package/plugins/hooks/trace-initialization.js +169 -0
- package/plugins/memory/templates/code-quality.yaml +149 -0
- package/plugins/memory/templates/multi-system.yaml +155 -0
- package/plugins/memory/templates/team-habits.yaml +119 -0
- package/plugins/memory/templates/testing.yaml +121 -0
- package/plugins/skills/README.en.md +47 -0
- package/plugins/skills/README.md +104 -0
- package/plugins/skills/benchmark-executor/README.md +93 -0
- package/plugins/skills/benchmark-executor/SKILL.md +647 -0
- package/plugins/skills/benchmark-generator/SKILL.md +349 -0
- package/plugins/skills/delivery-stage/SKILL.md +203 -0
- package/plugins/skills/design-stage/SKILL.md +216 -0
- package/plugins/skills/evolution-process/SKILL.md +291 -0
- package/plugins/skills/exploration-phase/SKILL.md +133 -0
- package/plugins/skills/implementation-stage/SKILL.md +179 -0
- package/plugins/skills/layer1-validation/SKILL.md +79 -0
- package/plugins/skills/pending-dashboard/SKILL.md +109 -0
- package/plugins/skills/project-evolution/SKILL.md +847 -0
- package/plugins/skills/requirement-stage/SKILL.md +183 -0
- package/plugins/skills/skill-forge/SKILL.md +223 -0
- package/plugins/skills/skill-forge/references/description-guide.md +92 -0
- package/plugins/skills/skill-forge/references/quality-rubric.md +104 -0
- package/plugins/skills/skill-forge/references/skill-template.md +106 -0
- package/plugins/skills/startup-guard/SKILL.md +38 -0
- package/plugins/skills/testing-stage/SKILL.md +195 -0
- package/scripts/cli/global-init.js +288 -0
- package/scripts/cli/global.js +324 -0
- package/scripts/cli/index.js +55 -0
- package/scripts/cli/init.js +382 -0
- package/scripts/cli/list.js +69 -0
- package/scripts/cli/org.js +340 -0
- package/scripts/cli/update.js +44 -0
- package/scripts/config/commands.config.js +145 -0
- package/scripts/config/hooks.config.js +197 -0
- package/scripts/evolution/evolution-router.js +273 -0
- package/scripts/evolution/evolution-signal-collector.js +307 -0
- package/scripts/evolution/knowledge-loader.js +346 -0
- package/scripts/evolution/marketplace.js +317 -0
- package/scripts/evolution/version-manager.js +371 -0
- package/scripts/install/agents.js +106 -0
- package/scripts/install/commands.js +133 -0
- package/scripts/install/constants.js +424 -0
- package/scripts/install/hook-logger.js +536 -0
- package/scripts/install/hooks.js +110 -0
- package/scripts/install/index.js +39 -0
- package/scripts/install/skills.js +95 -0
- package/scripts/postinstall.js +25 -0
- package/scripts/state.js +376 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# 业务术语表
|
|
2
|
+
|
|
3
|
+
> 统一业务概念定义,消除沟通歧义。
|
|
4
|
+
|
|
5
|
+
## 使用说明
|
|
6
|
+
|
|
7
|
+
1. 每个术语包含:术语名、英文缩写、定义、相关术语、来源
|
|
8
|
+
2. 需求分析阶段自动从需求文档提取候选术语
|
|
9
|
+
3. 术语定义冲突时,以本文档为准
|
|
10
|
+
|
|
11
|
+
## 术语列表
|
|
12
|
+
|
|
13
|
+
| 术语 | 缩写 | 定义 | 相关术语 | 来源 |
|
|
14
|
+
|-----|------|------|---------|------|
|
|
15
|
+
| | | | | |
|
|
16
|
+
|
|
17
|
+
> 空表格,由各项目自行填充
|
|
18
|
+
|
|
19
|
+
## 自动提取规则
|
|
20
|
+
|
|
21
|
+
从需求文档中识别候选术语:
|
|
22
|
+
|
|
23
|
+
| 提取条件 | 说明 |
|
|
24
|
+
|---------|------|
|
|
25
|
+
| 高频词 | 出现次数 > 3 |
|
|
26
|
+
| 首字母缩写 | 如 API、SDK、CRUD |
|
|
27
|
+
| 专用名词 | 如"XX系统"、"XX模块" |
|
|
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
|
+
### 领域模型术语(DDD增强)
|
|
69
|
+
|
|
70
|
+
领域驱动设计核心概念,用于复杂业务建模。
|
|
71
|
+
|
|
72
|
+
| 术语 | 缩写 | 定义 | 适用上下文 | 来源 |
|
|
73
|
+
|-----|------|------|-----------|------|
|
|
74
|
+
| 聚合 Aggregate | AGG | 一致性边界内的对象集合,包含实体和值对象 | 设计阶段 | DDD |
|
|
75
|
+
| 聚合根 Aggregate Root | AR | 聚合的唯一入口实体,负责维护聚合内部一致性 | 设计阶段 | DDD |
|
|
76
|
+
| 实体 Entity | - | 有唯一标识的领域对象,具有生命周期和可变状态 | 设计阶段 | DDD |
|
|
77
|
+
| 值对象 Value Object | VO | 无唯一标识、不可变的对象,通过属性值判断相等性 | 设计阶段 | DDD |
|
|
78
|
+
| 领域事件 Domain Event | DE | 领域中发生的业务事实,用于聚合间通信 | 设计阶段 | DDD |
|
|
79
|
+
| 领域服务 Domain Service | DS | 不属于任何实体或值对象的无状态领域操作 | 设计阶段 | DDD |
|
|
80
|
+
| 仓储 Repository | - | 聚合的持久化抽象,提供集合语义的查询和保存 | 设计阶段 | DDD |
|
|
81
|
+
| 工厂 Factory | - | 封装复杂对象创建逻辑,解耦创建与使用 | 设计阶段 | DDD |
|
|
82
|
+
|
|
83
|
+
### 限界上下文术语(DDD增强)
|
|
84
|
+
|
|
85
|
+
限界上下文是语言一致性边界,每个上下文有独立的统一语言。
|
|
86
|
+
|
|
87
|
+
| 术语 | 缩写 | 定义 | 所属上下文 | 来源 |
|
|
88
|
+
|-----|------|------|-----------|------|
|
|
89
|
+
| 限界上下文 Bounded Context | BC | 语言一致性边界,边界内术语含义统一 | 战略设计 | DDD |
|
|
90
|
+
| 上下文映射 Context Map | CM | 描述限界上下文之间关系的图示 | 战略设计 | DDD |
|
|
91
|
+
| 核心域 Core Domain | - | 业务核心竞争力,必须自研重点投入 | 战略设计 | DDD |
|
|
92
|
+
| 支撑域 Supporting Domain | - | 支撑核心业务的能力,可外包 | 战略设计 | DDD |
|
|
93
|
+
| 通用域 Generic Domain | - | 通用能力,可用现成方案 | 战略设计 | DDD |
|
|
94
|
+
| 防腐层 Anticorruption Layer | ACL | 隔离外部模型的适配层,保护内部模型纯净 | 上下文集成 | DDD |
|
|
95
|
+
|
|
96
|
+
| 术语 | 缩写 | 定义 | 相关术语 | 来源 |
|
|
97
|
+
|-----|------|------|---------|------|
|
|
98
|
+
| | | | | |
|
|
99
|
+
|
|
100
|
+
### 业务动作
|
|
101
|
+
|
|
102
|
+
业务操作的行为,如:下单、支付、发货...
|
|
103
|
+
|
|
104
|
+
| 术语 | 缩写 | 定义 | 相关术语 | 来源 |
|
|
105
|
+
|-----|------|------|---------|------|
|
|
106
|
+
| | | | | |
|
|
107
|
+
|
|
108
|
+
### 业务状态
|
|
109
|
+
|
|
110
|
+
业务对象的状态,如:待支付、已支付、已取消...
|
|
111
|
+
|
|
112
|
+
| 术语 | 缩写 | 定义 | 相关术语 | 来源 |
|
|
113
|
+
|-----|------|------|---------|------|
|
|
114
|
+
| | | | | |
|
|
115
|
+
|
|
116
|
+
### 业务规则
|
|
117
|
+
|
|
118
|
+
业务约束条件,如:限额、时效、条件...
|
|
119
|
+
|
|
120
|
+
| 术语 | 缩写 | 定义 | 相关术语 | 来源 |
|
|
121
|
+
|-----|------|------|---------|------|
|
|
122
|
+
| | | | | |
|
|
123
|
+
|
|
124
|
+
## 术语冲突处理
|
|
125
|
+
|
|
126
|
+
当发现术语定义冲突时:
|
|
127
|
+
|
|
128
|
+
1. **记录冲突**:在需求分析阶段标记
|
|
129
|
+
2. **澄清确认**:与业务方确认准确定义
|
|
130
|
+
3. **更新文档**:更新本文档,标注变更历史
|
|
131
|
+
4. **通知相关方**:通知设计、开发、测试团队
|
|
132
|
+
|
|
133
|
+
## 版本历史
|
|
134
|
+
|
|
135
|
+
| 版本 | 日期 | 修改人 | 修改说明 |
|
|
136
|
+
|-----|------|--------|---------|
|
|
137
|
+
| v1.0 | YYYY-MM-DD | | 初始版本 |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
**维护者**: 项目团队
|
|
142
|
+
**进化分区**: 自由区
|
|
143
|
+
**关联文档**: `knowledge/domain/rules.md`
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# 业务规则库
|
|
2
|
+
|
|
3
|
+
> 规则ID化,便于追溯和校验。
|
|
4
|
+
|
|
5
|
+
## 规则格式
|
|
6
|
+
|
|
7
|
+
每个业务规则包含:
|
|
8
|
+
|
|
9
|
+
| 字段 | 说明 | 必填 |
|
|
10
|
+
|------|------|------|
|
|
11
|
+
| 规则ID | BR-{NN} 格式,便于追溯 | ✅ |
|
|
12
|
+
| 规则名称 | 简短描述 | ✅ |
|
|
13
|
+
| 规则描述 | 详细说明规则内容 | ✅ |
|
|
14
|
+
| 适用场景 | 何时需要遵守此规则 | ✅ |
|
|
15
|
+
| 校验方式 | 如何检验是否遵守 | ✅ |
|
|
16
|
+
| 来源 | 需求文档章节/业务方确认 | ❌ |
|
|
17
|
+
| 优先级 | P0/P1/P2 | ❌ |
|
|
18
|
+
|
|
19
|
+
## 规则列表
|
|
20
|
+
|
|
21
|
+
> 空表格,由各项目自行填充
|
|
22
|
+
|
|
23
|
+
| 规则ID | 规则名称 | 规则描述 | 适用场景 | 校验方式 | 来源 | 优先级 |
|
|
24
|
+
|--------|---------|---------|---------|---------|------|--------|
|
|
25
|
+
| | | | | | | |
|
|
26
|
+
|
|
27
|
+
## 规则分类
|
|
28
|
+
|
|
29
|
+
### 数据校验规则
|
|
30
|
+
|
|
31
|
+
数据有效性约束,如:格式、范围、必填...
|
|
32
|
+
|
|
33
|
+
| 规则ID | 规则名称 | 规则描述 | 适用场景 | 校验方式 |
|
|
34
|
+
|--------|---------|---------|---------|---------|
|
|
35
|
+
| | | | | |
|
|
36
|
+
|
|
37
|
+
### 业务逻辑规则
|
|
38
|
+
|
|
39
|
+
业务流程约束,如:状态流转、条件判断...
|
|
40
|
+
|
|
41
|
+
| 规则ID | 规则名称 | 规则描述 | 适用场景 | 校验方式 |
|
|
42
|
+
|--------|---------|---------|---------|---------|
|
|
43
|
+
| | | | | |
|
|
44
|
+
|
|
45
|
+
### 安全合规规则
|
|
46
|
+
|
|
47
|
+
安全与合规约束,如:权限、审计、脱敏...
|
|
48
|
+
|
|
49
|
+
| 规则ID | 规则名称 | 规则描述 | 适用场景 | 校验方式 |
|
|
50
|
+
|--------|---------|---------|---------|---------|
|
|
51
|
+
| | | | | |
|
|
52
|
+
|
|
53
|
+
### 性能约束规则
|
|
54
|
+
|
|
55
|
+
性能相关约束,如:响应时间、并发量...
|
|
56
|
+
|
|
57
|
+
| 规则ID | 规则名称 | 规则描述 | 适用场景 | 校验方式 |
|
|
58
|
+
|--------|---------|---------|---------|---------|
|
|
59
|
+
| | | | | |
|
|
60
|
+
|
|
61
|
+
### 领域模型规则(DDD增强)
|
|
62
|
+
|
|
63
|
+
领域驱动设计相关规则,适用于复杂业务系统建模。
|
|
64
|
+
|
|
65
|
+
| 规则ID | 规则名称 | 规则描述 | 适用场景 | 校验方式 | 来源 |
|
|
66
|
+
|--------|---------|---------|---------|---------|------|
|
|
67
|
+
| DDD-01 | 聚合边界一致性 | 聚合内部必须保证强一致性,单个聚合=单个事务 | 聚合设计 | 代码审查 | DDD |
|
|
68
|
+
| DDD-02 | 聚合根唯一入口 | 外部只能通过聚合根访问聚合内部,不可直接操作内部实体 | 代码实现 | 代码审查 | DDD |
|
|
69
|
+
| DDD-03 | 跨聚合ID引用 | 聚合之间只能通过ID引用,不能直接持有其他聚合对象引用 | 代码实现 | 代码审查 | DDD |
|
|
70
|
+
| DDD-04 | 领域事件幂等 | 事件处理必须幂等,同一事件多次处理结果相同 | 事件处理 | 测试验证 | DDD |
|
|
71
|
+
| DDD-05 | 统一语言一致性 | 代码命名必须与业务术语一致,消除沟通歧义 | 全流程 | 术语表对照 | DDD |
|
|
72
|
+
| DDD-06 | 聚合大小控制 | 聚合应保持小规模,避免并发冲突和性能问题 | 聚合设计 | 设计评审 | DDD |
|
|
73
|
+
| DDD-07 | 仓储查询限制 | 仓储只按聚合根ID查询,不暴露复杂查询能力 | 仓储设计 | 接口审查 | DDD |
|
|
74
|
+
| DDD-08 | 领域服务无状态 | 领域服务必须无状态,不持有聚合实例 | 服务设计 | 代码审查 | DDD |
|
|
75
|
+
| DDD-09 | 事件命名规范 | 领域事件命名使用过去时,如OrderCreated、PaymentCompleted | 事件定义 | 命名检查 | DDD |
|
|
76
|
+
| DDD-10 | 值对象不可变 | 值对象必须不可变,修改应返回新实例 | 值对象设计 | 代码审查 | DDD |
|
|
77
|
+
|
|
78
|
+
## 使用方式
|
|
79
|
+
|
|
80
|
+
### 需求分析阶段
|
|
81
|
+
|
|
82
|
+
1. 从需求文档提取业务规则
|
|
83
|
+
2. 分配规则ID(BR-01, BR-02...)
|
|
84
|
+
3. 填写规则详情
|
|
85
|
+
4. 标注来源和优先级
|
|
86
|
+
|
|
87
|
+
### 方案设计阶段
|
|
88
|
+
|
|
89
|
+
1. 设计方案时明确如何满足每条规则
|
|
90
|
+
2. 在设计文档中引用规则ID
|
|
91
|
+
3. 记录规则满足方式
|
|
92
|
+
|
|
93
|
+
### 代码审查阶段
|
|
94
|
+
|
|
95
|
+
1. 检查代码是否遵循业务规则
|
|
96
|
+
2. 对照规则ID逐项验证
|
|
97
|
+
3. 记录未遵循的规则
|
|
98
|
+
|
|
99
|
+
### 测试用例阶段
|
|
100
|
+
|
|
101
|
+
1. 为每条规则设计测试场景
|
|
102
|
+
2. 正向用例:规则满足场景
|
|
103
|
+
3. 反向用例:规则违反场景
|
|
104
|
+
|
|
105
|
+
## 规则校验方式
|
|
106
|
+
|
|
107
|
+
| 校验方式 | 说明 | 示例 |
|
|
108
|
+
|---------|------|------|
|
|
109
|
+
| 代码检查 | 静态分析代码逻辑 | Lint规则、类型检查 |
|
|
110
|
+
| 测试用例 | 编写测试验证规则 | 单元测试、集成测试 |
|
|
111
|
+
| 数据校验 | 运行时数据检查 | 数据库约束、接口校验 |
|
|
112
|
+
| 人工审查 | 需要人工判断 | 代码Review、业务验收 |
|
|
113
|
+
|
|
114
|
+
## 规则变更流程
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
识别变更需求 → 评估影响范围 → 更新规则定义 → 通知相关方 → 更新代码/测试
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 变更类型
|
|
121
|
+
|
|
122
|
+
| 类型 | 说明 | 审批要求 |
|
|
123
|
+
|------|------|---------|
|
|
124
|
+
| 新增规则 | 新增业务约束 | 无需审批,记录即可 |
|
|
125
|
+
| 修改规则 | 修改规则内容 | 需评估影响范围 |
|
|
126
|
+
| 废弃规则 | 规则不再适用 | 需确认无依赖后废弃 |
|
|
127
|
+
|
|
128
|
+
## 版本历史
|
|
129
|
+
|
|
130
|
+
| 版本 | 日期 | 修改人 | 修改说明 |
|
|
131
|
+
|-----|------|--------|---------|
|
|
132
|
+
| v1.0 | YYYY-MM-DD | | 初始版本 |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
**维护者**: 项目团队
|
|
137
|
+
**进化分区**: 受控区
|
|
138
|
+
**关联文档**: `knowledge/domain/glossary.md`, `knowledge/domain/flows/README.md`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Environment Integration Protocol
|
|
2
|
+
|
|
3
|
+
This directory contains AutoSpec's environment integration protocol for stable, secure, and efficient integration with different organizations' middleware, components, and custom frameworks.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
environment/
|
|
9
|
+
├── overview.md # Detailed environment integration protocol
|
|
10
|
+
├── templates.md # Knowledge template definitions
|
|
11
|
+
└── detection-patterns.yaml # Detection pattern configuration
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Core Features
|
|
15
|
+
|
|
16
|
+
### Auto Detection
|
|
17
|
+
|
|
18
|
+
`autospec init` automatically scans project code to identify:
|
|
19
|
+
|
|
20
|
+
- **Middleware usage**: MySQL, Redis, Kafka, MongoDB, Elasticsearch, RabbitMQ, PostgreSQL
|
|
21
|
+
- **Tech stack**: Java/Spring, Node.js/Express, Python/Django, etc.
|
|
22
|
+
- **Project structure**: backend/, frontend/, ai/, data/ subsystems
|
|
23
|
+
|
|
24
|
+
### Knowledge Management
|
|
25
|
+
|
|
26
|
+
- **Minimal format**: Only `name` + `envVars` needed, AI auto-completes details
|
|
27
|
+
- **Detailed format**: Complete best practices, anti-patterns, code templates
|
|
28
|
+
- **Organization import**: Import organizational knowledge from Git/npm
|
|
29
|
+
|
|
30
|
+
### Auto Activation
|
|
31
|
+
|
|
32
|
+
Detected knowledge is automatically registered and activated, with context injected in subsequent flows.
|
|
33
|
+
|
|
34
|
+
## Detailed Documentation
|
|
35
|
+
|
|
36
|
+
For complete environment integration protocol documentation, see [overview.md](overview.md).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# 环境衔接协议
|
|
2
|
+
|
|
3
|
+
> 让 AutoSpec 能够快捷地与不同组织的中间件、组件、自定义框架、集成环境等稳定安全高效衔接。
|
|
4
|
+
|
|
5
|
+
## 核心概念
|
|
6
|
+
|
|
7
|
+
### 三层知识体系
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Layer 1: Environment Knowledge(环境知识)
|
|
11
|
+
├── 中间件知识:MySQL 配置、Redis 连接池、Kafka 消费者组
|
|
12
|
+
├── 基础设施知识:K8s 部署、CI/CD 流水线、监控告警
|
|
13
|
+
└── 环境变量:开发/测试/预发/生产环境差异化配置
|
|
14
|
+
|
|
15
|
+
Layer 2: Component Knowledge(组件知识)
|
|
16
|
+
├── 组织组件库:认证组件、支付网关、消息推送
|
|
17
|
+
├── 最佳实践:错误处理模式、日志规范、性能调优
|
|
18
|
+
└── 领域模型:通用领域对象、业务规则、数据字典
|
|
19
|
+
|
|
20
|
+
Layer 3: Integration Knowledge(集成知识)
|
|
21
|
+
├── CI/CD 对接:GitLab CI、Jenkins、GitHub Actions
|
|
22
|
+
├── 测试知识:测试策略、Mock 方案、环境隔离(自进化)
|
|
23
|
+
└── 部署环境:发布审批、灰度策略、回滚机制
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 进化分区
|
|
27
|
+
|
|
28
|
+
| 知识类型 | 进化分区 | 变更方式 |
|
|
29
|
+
|---------|---------|---------|
|
|
30
|
+
| 环境知识 | 受控区 | 人工定义 + 自动验证 |
|
|
31
|
+
| 组件知识 | 自由区 | 自动进化 + validator 验证 |
|
|
32
|
+
| 集成知识 | 受控区 | 人工定义 + 自动执行 |
|
|
33
|
+
| 测试知识 | 受控区 | skill-distiller 自动学习 + 人工审批 |
|
|
34
|
+
|
|
35
|
+
## 目录结构
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
.autospec/environment/
|
|
39
|
+
├── env-knowledge/ # 环境知识
|
|
40
|
+
│ ├── middleware/ # 中间件配置(mysql.yaml, redis.yaml)
|
|
41
|
+
│ ├── infrastructure/ # 基础设施(k8s.yaml, monitoring.yaml)
|
|
42
|
+
│ └── env-variables/ # 环境变量模板
|
|
43
|
+
│
|
|
44
|
+
├── component-lib/ # 组件知识库
|
|
45
|
+
│ ├── components/ # 组织组件库(auth/, payment/)
|
|
46
|
+
│ ├── best-practices/ # 最佳实践
|
|
47
|
+
│ └── domain-models/ # 领域模型
|
|
48
|
+
│
|
|
49
|
+
├── integration/ # 集成知识
|
|
50
|
+
│ ├── ci-cd/ # CI/CD 配置
|
|
51
|
+
│ ├── testing/ # 测试知识(自进化)
|
|
52
|
+
│ │ └── overview.md # 集成测试概述
|
|
53
|
+
│ └── deployment/ # 部署配置
|
|
54
|
+
│
|
|
55
|
+
├── detection-patterns.yaml # 自定义检测模式(可选)
|
|
56
|
+
└── registry.json # 知识注册表
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 知识模板
|
|
60
|
+
|
|
61
|
+
- [中间件知识模板](./middleware-knowledge.md) - 中间件配置和最佳实践
|
|
62
|
+
- [组件知识模板](./component-knowledge.md) - 组件定义和使用示例
|
|
63
|
+
|
|
64
|
+
## CLI 命令
|
|
65
|
+
|
|
66
|
+
| 命令 | 说明 |
|
|
67
|
+
|------|------|
|
|
68
|
+
| `autospec env` | 显示当前环境配置状态 |
|
|
69
|
+
| `autospec env:validate` | 验证环境知识配置 |
|
|
70
|
+
| `autospec env:sync` | 从代码同步环境知识并自动激活 |
|
|
71
|
+
| `autospec env:import [source]` | 导入组织知识库(支持 Git/npm/本地) |
|
|
72
|
+
| `autospec env:export <dir>` | 导出当前项目知识库 |
|
|
73
|
+
| `autospec component` | 列出可用的组织组件 |
|
|
74
|
+
| `autospec component:add <name>` | 添加组件知识 |
|
|
75
|
+
|
|
76
|
+
## 自动检测机制
|
|
77
|
+
|
|
78
|
+
`autospec init` 会自动扫描项目代码,检测:
|
|
79
|
+
|
|
80
|
+
1. **技术栈检测**:识别 Node.js、Python、Java、Go 等项目
|
|
81
|
+
2. **中间件检测**:识别 MySQL、Redis、Kafka、MongoDB 等使用
|
|
82
|
+
3. **组件检测**:识别组织自定义组件的使用
|
|
83
|
+
|
|
84
|
+
检测到后会自动:
|
|
85
|
+
- 生成环境知识配置
|
|
86
|
+
- 注册到 registry.json
|
|
87
|
+
- 激活知识(后续流程自动注入上下文)
|