@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,502 @@
|
|
|
1
|
+
# AutoSpec 检测规则配置
|
|
2
|
+
# 用于技术栈、框架、AI组件的自动检测
|
|
3
|
+
|
|
4
|
+
# ============================================================
|
|
5
|
+
# 构建文件规则
|
|
6
|
+
# ============================================================
|
|
7
|
+
buildFiles:
|
|
8
|
+
package.json:
|
|
9
|
+
buildTool: npm/yarn/pnpm
|
|
10
|
+
lang: javascript
|
|
11
|
+
parser: packageJson
|
|
12
|
+
|
|
13
|
+
pom.xml:
|
|
14
|
+
buildTool: maven
|
|
15
|
+
lang: java
|
|
16
|
+
parser: pomXml
|
|
17
|
+
|
|
18
|
+
build.gradle:
|
|
19
|
+
buildTool: gradle
|
|
20
|
+
lang: java
|
|
21
|
+
parser: buildGradle
|
|
22
|
+
|
|
23
|
+
build.gradle.kts:
|
|
24
|
+
buildTool: gradle
|
|
25
|
+
lang: kotlin
|
|
26
|
+
parser: buildGradleKts
|
|
27
|
+
|
|
28
|
+
go.mod:
|
|
29
|
+
buildTool: go-modules
|
|
30
|
+
lang: go
|
|
31
|
+
parser: goMod
|
|
32
|
+
|
|
33
|
+
Cargo.toml:
|
|
34
|
+
buildTool: cargo
|
|
35
|
+
lang: rust
|
|
36
|
+
parser: cargoToml
|
|
37
|
+
|
|
38
|
+
pyproject.toml:
|
|
39
|
+
buildTool: poetry/pdm
|
|
40
|
+
lang: python
|
|
41
|
+
parser: pyprojectToml
|
|
42
|
+
|
|
43
|
+
requirements.txt:
|
|
44
|
+
buildTool: pip
|
|
45
|
+
lang: python
|
|
46
|
+
parser: requirements
|
|
47
|
+
|
|
48
|
+
setup.py:
|
|
49
|
+
buildTool: setuptools
|
|
50
|
+
lang: python
|
|
51
|
+
parser: setupPy
|
|
52
|
+
|
|
53
|
+
dbt_project.yml:
|
|
54
|
+
buildTool: dbt
|
|
55
|
+
lang: sql
|
|
56
|
+
parser: dbtProject
|
|
57
|
+
|
|
58
|
+
pubspec.yaml:
|
|
59
|
+
buildTool: flutter
|
|
60
|
+
lang: dart
|
|
61
|
+
parser: pubspec
|
|
62
|
+
|
|
63
|
+
composer.json:
|
|
64
|
+
buildTool: composer
|
|
65
|
+
lang: php
|
|
66
|
+
parser: composer
|
|
67
|
+
|
|
68
|
+
Gemfile:
|
|
69
|
+
buildTool: bundler
|
|
70
|
+
lang: ruby
|
|
71
|
+
parser: gemfile
|
|
72
|
+
|
|
73
|
+
# ============================================================
|
|
74
|
+
# 框架识别规则
|
|
75
|
+
# ============================================================
|
|
76
|
+
frameworks:
|
|
77
|
+
# JavaScript/TypeScript 框架
|
|
78
|
+
javascript:
|
|
79
|
+
- deps: [react-native]
|
|
80
|
+
framework: React Native
|
|
81
|
+
type: mobile
|
|
82
|
+
|
|
83
|
+
- deps: [next]
|
|
84
|
+
framework: Next.js
|
|
85
|
+
type: frontend
|
|
86
|
+
|
|
87
|
+
- deps: [nuxt]
|
|
88
|
+
framework: Nuxt.js
|
|
89
|
+
type: frontend
|
|
90
|
+
|
|
91
|
+
- deps: [vue]
|
|
92
|
+
framework: Vue
|
|
93
|
+
type: frontend
|
|
94
|
+
|
|
95
|
+
- deps: [react]
|
|
96
|
+
framework: React
|
|
97
|
+
type: frontend
|
|
98
|
+
|
|
99
|
+
- deps: [angular, "@angular/core"]
|
|
100
|
+
framework: Angular
|
|
101
|
+
type: frontend
|
|
102
|
+
|
|
103
|
+
- deps: [svelte]
|
|
104
|
+
framework: Svelte
|
|
105
|
+
type: frontend
|
|
106
|
+
|
|
107
|
+
- deps: [sveltekit]
|
|
108
|
+
framework: SvelteKit
|
|
109
|
+
type: frontend
|
|
110
|
+
|
|
111
|
+
- deps: [astro]
|
|
112
|
+
framework: Astro
|
|
113
|
+
type: frontend
|
|
114
|
+
|
|
115
|
+
- deps: [remix]
|
|
116
|
+
framework: Remix
|
|
117
|
+
type: frontend
|
|
118
|
+
|
|
119
|
+
- deps: [express]
|
|
120
|
+
framework: Express
|
|
121
|
+
type: backend
|
|
122
|
+
|
|
123
|
+
- deps: [nestjs, "@nestjs/core"]
|
|
124
|
+
framework: NestJS
|
|
125
|
+
type: backend
|
|
126
|
+
|
|
127
|
+
- deps: [fastify]
|
|
128
|
+
framework: Fastify
|
|
129
|
+
type: backend
|
|
130
|
+
|
|
131
|
+
- deps: [koa]
|
|
132
|
+
framework: Koa
|
|
133
|
+
type: backend
|
|
134
|
+
|
|
135
|
+
- deps: [hono]
|
|
136
|
+
framework: Hono
|
|
137
|
+
type: backend
|
|
138
|
+
|
|
139
|
+
- deps: [hapi]
|
|
140
|
+
framework: Hapi
|
|
141
|
+
type: backend
|
|
142
|
+
|
|
143
|
+
- deps: [openai]
|
|
144
|
+
framework: OpenAI
|
|
145
|
+
type: llm
|
|
146
|
+
|
|
147
|
+
- deps: [anthropic, "@anthropic-ai/sdk"]
|
|
148
|
+
framework: Anthropic
|
|
149
|
+
type: llm
|
|
150
|
+
|
|
151
|
+
- deps: [langchain, "@langchain/core"]
|
|
152
|
+
framework: LangChain
|
|
153
|
+
type: llm
|
|
154
|
+
|
|
155
|
+
- deps: [llamaindex]
|
|
156
|
+
framework: LlamaIndex
|
|
157
|
+
type: llm
|
|
158
|
+
|
|
159
|
+
- deps: [electron]
|
|
160
|
+
framework: Electron
|
|
161
|
+
type: desktop
|
|
162
|
+
|
|
163
|
+
# Python 框架
|
|
164
|
+
python:
|
|
165
|
+
- deps: [django]
|
|
166
|
+
framework: Django
|
|
167
|
+
type: backend
|
|
168
|
+
|
|
169
|
+
- deps: [fastapi]
|
|
170
|
+
framework: FastAPI
|
|
171
|
+
type: backend
|
|
172
|
+
|
|
173
|
+
- deps: [flask]
|
|
174
|
+
framework: Flask
|
|
175
|
+
type: backend
|
|
176
|
+
|
|
177
|
+
- deps: [starlette]
|
|
178
|
+
framework: Starlette
|
|
179
|
+
type: backend
|
|
180
|
+
|
|
181
|
+
- deps: [tornado]
|
|
182
|
+
framework: Tornado
|
|
183
|
+
type: backend
|
|
184
|
+
|
|
185
|
+
- deps: [sanic]
|
|
186
|
+
framework: Sanic
|
|
187
|
+
type: backend
|
|
188
|
+
|
|
189
|
+
- deps: [torch]
|
|
190
|
+
framework: PyTorch
|
|
191
|
+
type: ai
|
|
192
|
+
|
|
193
|
+
- deps: [tensorflow]
|
|
194
|
+
framework: TensorFlow
|
|
195
|
+
type: ai
|
|
196
|
+
|
|
197
|
+
- deps: [transformers]
|
|
198
|
+
framework: Transformers
|
|
199
|
+
type: ai
|
|
200
|
+
|
|
201
|
+
- deps: [langchain]
|
|
202
|
+
framework: LangChain
|
|
203
|
+
type: llm
|
|
204
|
+
|
|
205
|
+
- deps: [llamaindex]
|
|
206
|
+
framework: LlamaIndex
|
|
207
|
+
type: llm
|
|
208
|
+
|
|
209
|
+
- deps: [openai]
|
|
210
|
+
framework: OpenAI
|
|
211
|
+
type: llm
|
|
212
|
+
|
|
213
|
+
- deps: [anthropic]
|
|
214
|
+
framework: Anthropic
|
|
215
|
+
type: llm
|
|
216
|
+
|
|
217
|
+
- deps: [crewai]
|
|
218
|
+
framework: CrewAI
|
|
219
|
+
type: agent
|
|
220
|
+
|
|
221
|
+
- deps: [autogen]
|
|
222
|
+
framework: AutoGen
|
|
223
|
+
type: agent
|
|
224
|
+
|
|
225
|
+
- deps: [semantic-kernel]
|
|
226
|
+
framework: Semantic Kernel
|
|
227
|
+
type: agent
|
|
228
|
+
|
|
229
|
+
- deps: [dbt]
|
|
230
|
+
framework: DBT
|
|
231
|
+
type: data
|
|
232
|
+
|
|
233
|
+
- deps: [airflow]
|
|
234
|
+
framework: Airflow
|
|
235
|
+
type: data
|
|
236
|
+
|
|
237
|
+
- deps: [prefect]
|
|
238
|
+
framework: Prefect
|
|
239
|
+
type: data
|
|
240
|
+
|
|
241
|
+
- deps: [dagster]
|
|
242
|
+
framework: Dagster
|
|
243
|
+
type: data
|
|
244
|
+
|
|
245
|
+
- deps: [pyspark]
|
|
246
|
+
framework: PySpark
|
|
247
|
+
type: data
|
|
248
|
+
|
|
249
|
+
- deps: [dask]
|
|
250
|
+
framework: Dask
|
|
251
|
+
type: data
|
|
252
|
+
|
|
253
|
+
- deps: [faiss]
|
|
254
|
+
framework: FAISS
|
|
255
|
+
type: vector-store
|
|
256
|
+
|
|
257
|
+
- deps: [chromadb]
|
|
258
|
+
framework: ChromaDB
|
|
259
|
+
type: vector-store
|
|
260
|
+
|
|
261
|
+
- deps: [pinecone]
|
|
262
|
+
framework: Pinecone
|
|
263
|
+
type: vector-store
|
|
264
|
+
|
|
265
|
+
- deps: [weaviate]
|
|
266
|
+
framework: Weaviate
|
|
267
|
+
type: vector-store
|
|
268
|
+
|
|
269
|
+
- deps: [qdrant]
|
|
270
|
+
framework: Qdrant
|
|
271
|
+
type: vector-store
|
|
272
|
+
|
|
273
|
+
- deps: [mlflow]
|
|
274
|
+
framework: MLflow
|
|
275
|
+
type: mlops
|
|
276
|
+
|
|
277
|
+
- deps: [wandb]
|
|
278
|
+
framework: Weights & Biases
|
|
279
|
+
type: mlops
|
|
280
|
+
|
|
281
|
+
# Java 框架
|
|
282
|
+
java:
|
|
283
|
+
- deps: [spring-boot, org.springframework.boot]
|
|
284
|
+
framework: Spring Boot
|
|
285
|
+
type: backend
|
|
286
|
+
|
|
287
|
+
- deps: [spring-cloud]
|
|
288
|
+
framework: Spring Cloud
|
|
289
|
+
type: backend
|
|
290
|
+
|
|
291
|
+
- deps: [dubbo]
|
|
292
|
+
framework: Dubbo
|
|
293
|
+
type: backend
|
|
294
|
+
|
|
295
|
+
- deps: [quarkus]
|
|
296
|
+
framework: Quarkus
|
|
297
|
+
type: backend
|
|
298
|
+
|
|
299
|
+
- deps: [micronaut]
|
|
300
|
+
framework: Micronaut
|
|
301
|
+
type: backend
|
|
302
|
+
|
|
303
|
+
- deps: [vertx]
|
|
304
|
+
framework: Vert.x
|
|
305
|
+
type: backend
|
|
306
|
+
|
|
307
|
+
# Go 框架
|
|
308
|
+
go:
|
|
309
|
+
- deps: [gin-gonic]
|
|
310
|
+
framework: Gin
|
|
311
|
+
type: backend
|
|
312
|
+
|
|
313
|
+
- deps: [echo]
|
|
314
|
+
framework: Echo
|
|
315
|
+
type: backend
|
|
316
|
+
|
|
317
|
+
- deps: [fiber]
|
|
318
|
+
framework: Fiber
|
|
319
|
+
type: backend
|
|
320
|
+
|
|
321
|
+
- deps: [chi]
|
|
322
|
+
framework: Chi
|
|
323
|
+
type: backend
|
|
324
|
+
|
|
325
|
+
# Rust 框架
|
|
326
|
+
rust:
|
|
327
|
+
- deps: [actix]
|
|
328
|
+
framework: Actix
|
|
329
|
+
type: backend
|
|
330
|
+
|
|
331
|
+
- deps: [rocket]
|
|
332
|
+
framework: Rocket
|
|
333
|
+
type: backend
|
|
334
|
+
|
|
335
|
+
- deps: [warp]
|
|
336
|
+
framework: Warp
|
|
337
|
+
type: backend
|
|
338
|
+
|
|
339
|
+
- deps: [axum]
|
|
340
|
+
framework: Axum
|
|
341
|
+
type: backend
|
|
342
|
+
|
|
343
|
+
# ============================================================
|
|
344
|
+
# 数据开发组件检测规则
|
|
345
|
+
# ============================================================
|
|
346
|
+
dataComponents:
|
|
347
|
+
dataWarehouse:
|
|
348
|
+
label: 数据仓库
|
|
349
|
+
buildFiles: [dbt_project.yml]
|
|
350
|
+
directories: [models, marts, staging, seeds, snapshots]
|
|
351
|
+
filePatterns: ["*.sql", schema.yml, sources.yml]
|
|
352
|
+
type: data-warehouse
|
|
353
|
+
needsEvaluation: false
|
|
354
|
+
|
|
355
|
+
etlPipeline:
|
|
356
|
+
label: ETL管道
|
|
357
|
+
directories: [dags, pipelines, jobs, etl, workflows]
|
|
358
|
+
filePatterns: ["*dag*.py", "*pipeline*.py", "*etl*.py", "*job*.py"]
|
|
359
|
+
dependencies: [airflow, prefect, dagster, luigi, celery]
|
|
360
|
+
type: etl-pipeline
|
|
361
|
+
needsEvaluation: false
|
|
362
|
+
|
|
363
|
+
dataProcessing:
|
|
364
|
+
label: 数据处理
|
|
365
|
+
directories: [spark, processing, transform, scripts]
|
|
366
|
+
dependencies: [pyspark, dask, polars, duckdb, ray]
|
|
367
|
+
type: data-processing
|
|
368
|
+
needsEvaluation: false
|
|
369
|
+
|
|
370
|
+
dataQuality:
|
|
371
|
+
label: 数据质量
|
|
372
|
+
directories: [tests, data_tests, quality, expectations]
|
|
373
|
+
filePatterns: ["*test*.sql", "*quality*.py", great_expectations]
|
|
374
|
+
dependencies: [great_expectations, soda, dbt]
|
|
375
|
+
type: data-quality
|
|
376
|
+
needsEvaluation: false
|
|
377
|
+
|
|
378
|
+
# ============================================================
|
|
379
|
+
# AI 开发组件检测规则
|
|
380
|
+
# ============================================================
|
|
381
|
+
aiComponents:
|
|
382
|
+
modelTraining:
|
|
383
|
+
label: 模型训练
|
|
384
|
+
directories: [training, train, experiments, notebooks, models]
|
|
385
|
+
filePatterns: ["*train*.py", "*experiment*.py", "*.ipynb", train.sh]
|
|
386
|
+
dependencies: [torch, tensorflow, jax, keras, transformers, accelerate, deepspeed]
|
|
387
|
+
type: model-training
|
|
388
|
+
needsEvaluation: true
|
|
389
|
+
|
|
390
|
+
inferenceService:
|
|
391
|
+
label: 推理服务
|
|
392
|
+
directories: [inference, serving, api, endpoints]
|
|
393
|
+
filePatterns: ["*inference*.py", "*serve*.py", "*api*.py", serve.py]
|
|
394
|
+
dependencies: [fastapi, flask, uvicorn, tgi, vllm, triton, torchserve]
|
|
395
|
+
type: inference-service
|
|
396
|
+
needsEvaluation: true
|
|
397
|
+
|
|
398
|
+
llmApplication:
|
|
399
|
+
label: LLM应用
|
|
400
|
+
dependencies: [langchain, llamaindex, openai, anthropic, litellm, guidance, outlines]
|
|
401
|
+
type: llm-application
|
|
402
|
+
needsEvaluation: true
|
|
403
|
+
|
|
404
|
+
agentFramework:
|
|
405
|
+
label: Agent框架
|
|
406
|
+
dependencies: [langchain, crewai, autogen, metagpt, semantic-kernel, agents]
|
|
407
|
+
filePatterns: ["*agent*.py", "*agents*.py"]
|
|
408
|
+
type: agent-framework
|
|
409
|
+
needsEvaluation: true
|
|
410
|
+
|
|
411
|
+
vectorStore:
|
|
412
|
+
label: 向量存储
|
|
413
|
+
dependencies: [faiss, pinecone, weaviate, chromadb, qdrant, milvus, pgvector, lancedb]
|
|
414
|
+
type: vector-store
|
|
415
|
+
needsEvaluation: false
|
|
416
|
+
|
|
417
|
+
evaluation:
|
|
418
|
+
label: 评测框架
|
|
419
|
+
directories: [evaluation, eval, benchmarks, tests]
|
|
420
|
+
filePatterns: ["*eval*.py", "*benchmark*.py", "*metrics*.py"]
|
|
421
|
+
dependencies: [pytest, wandb, mlflow, evaluate, rouge, bert_score, sacrebleu]
|
|
422
|
+
type: evaluation
|
|
423
|
+
needsEvaluation: false
|
|
424
|
+
|
|
425
|
+
featureEngineering:
|
|
426
|
+
label: 特征工程
|
|
427
|
+
directories: [features, feature_store, feast]
|
|
428
|
+
dependencies: [feast, featuretools, fts]
|
|
429
|
+
type: feature-engineering
|
|
430
|
+
needsEvaluation: false
|
|
431
|
+
|
|
432
|
+
ragApplication:
|
|
433
|
+
label: RAG应用
|
|
434
|
+
requiresBoth: [vectorStore, llmApplication]
|
|
435
|
+
type: rag-application
|
|
436
|
+
needsEvaluation: true
|
|
437
|
+
|
|
438
|
+
# ============================================================
|
|
439
|
+
# 项目类型推断规则
|
|
440
|
+
# ============================================================
|
|
441
|
+
projectTypes:
|
|
442
|
+
monorepo:
|
|
443
|
+
indicators: [packages, apps, workspaces]
|
|
444
|
+
configFile: pnpm-workspace.yaml
|
|
445
|
+
|
|
446
|
+
microservices:
|
|
447
|
+
indicators: [services, backend, api]
|
|
448
|
+
minModules: 2
|
|
449
|
+
|
|
450
|
+
singleApp:
|
|
451
|
+
indicators: [src, lib, app]
|
|
452
|
+
excludeIndicators: [packages, services]
|
|
453
|
+
|
|
454
|
+
# ============================================================
|
|
455
|
+
# 入口文件模式
|
|
456
|
+
# ============================================================
|
|
457
|
+
entryPoints:
|
|
458
|
+
python: [main.py, app.py, manage.py, run.py, server.py, wsgi.py, asgi.py]
|
|
459
|
+
javascript: [index.js, app.js, server.js, main.js, index.ts, main.ts]
|
|
460
|
+
java: ["src/main/java/**/Application.java", "src/main/java/**/*Application.java"]
|
|
461
|
+
go: [main.go, "cmd/main.go", "cmd/server/main.go"]
|
|
462
|
+
rust: ["src/main.rs"]
|
|
463
|
+
ruby: [app.rb, config.ru]
|
|
464
|
+
|
|
465
|
+
# ============================================================
|
|
466
|
+
# 忽略目录(用于扫描)
|
|
467
|
+
# ============================================================
|
|
468
|
+
ignoreDirectories:
|
|
469
|
+
- node_modules
|
|
470
|
+
- ".git"
|
|
471
|
+
- ".svn"
|
|
472
|
+
- ".hg"
|
|
473
|
+
- dist
|
|
474
|
+
- build
|
|
475
|
+
- out
|
|
476
|
+
- target
|
|
477
|
+
- __pycache__
|
|
478
|
+
- ".pytest_cache"
|
|
479
|
+
- ".mypy_cache"
|
|
480
|
+
- venv
|
|
481
|
+
- env
|
|
482
|
+
- ".venv"
|
|
483
|
+
- ".env"
|
|
484
|
+
- ".idea"
|
|
485
|
+
- ".vscode"
|
|
486
|
+
- ".claude"
|
|
487
|
+
- ".autospec"
|
|
488
|
+
- data
|
|
489
|
+
- logs
|
|
490
|
+
- cache
|
|
491
|
+
- tmp
|
|
492
|
+
- temp
|
|
493
|
+
|
|
494
|
+
# ============================================================
|
|
495
|
+
# 源码目录模式
|
|
496
|
+
# ============================================================
|
|
497
|
+
sourceDirectories:
|
|
498
|
+
backend: [backend, server, api, service, services]
|
|
499
|
+
frontend: [frontend, web, client, ui]
|
|
500
|
+
mobile: [mobile, app]
|
|
501
|
+
data: [data, warehouse, datalake]
|
|
502
|
+
ai: [ml, ai, model, rag, agents]
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# 中间件知识模板
|
|
2
|
+
|
|
3
|
+
> 本模板定义中间件知识的标准格式。供 env-sync 生成知识文件时参考。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 文件位置
|
|
8
|
+
|
|
9
|
+
`.autospec/environment/env-knowledge/middleware/{name}.md`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 基本信息
|
|
14
|
+
|
|
15
|
+
| 字段 | 必填 | 说明 |
|
|
16
|
+
|------|------|------|
|
|
17
|
+
| 名称 | 是 | 中间件名称,如 mysql、redis |
|
|
18
|
+
| 类型 | 是 | 参见类型枚举 |
|
|
19
|
+
| 默认端口 | 否 | 默认端口号 |
|
|
20
|
+
| 知识版本 | 是 | 格式 v1.0 |
|
|
21
|
+
| 维护者 | 否 | 维护团队或个人 |
|
|
22
|
+
|
|
23
|
+
### 类型枚举
|
|
24
|
+
|
|
25
|
+
| 类型 | 说明 |
|
|
26
|
+
|------|------|
|
|
27
|
+
| relational-database | 关系型数据库 |
|
|
28
|
+
| document-database | 文档数据库 |
|
|
29
|
+
| cache | 缓存 |
|
|
30
|
+
| message-queue | 消息队列 |
|
|
31
|
+
| search-engine | 搜索引擎 |
|
|
32
|
+
| vector-store | 向量存储 |
|
|
33
|
+
| object-storage | 对象存储 |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 环境变量
|
|
38
|
+
|
|
39
|
+
### 必需变量
|
|
40
|
+
|
|
41
|
+
| 变量名 | 说明 | 示例 |
|
|
42
|
+
|--------|------|------|
|
|
43
|
+
| {NAME}_HOST | 主机地址 | db.example.com |
|
|
44
|
+
| {NAME}_DATABASE | 数据库名称 | myapp_db |
|
|
45
|
+
| {NAME}_USER | 用户名 | app_user |
|
|
46
|
+
| {NAME}_PASSWORD | 密码 | - |
|
|
47
|
+
|
|
48
|
+
### 可选变量
|
|
49
|
+
|
|
50
|
+
| 变量名 | 默认值 | 说明 |
|
|
51
|
+
|--------|--------|------|
|
|
52
|
+
| {NAME}_PORT | 默认端口 | 端口号 |
|
|
53
|
+
| {NAME}_POOL_SIZE | 10 | 连接池大小 |
|
|
54
|
+
| {NAME}_TIMEOUT | 5000 | 超时时间(ms) |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 连接代码模板
|
|
59
|
+
|
|
60
|
+
按语言分节,提供连接代码示例。
|
|
61
|
+
|
|
62
|
+
### Node.js
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
// 连接代码示例
|
|
66
|
+
const client = new Client({
|
|
67
|
+
host: process.env.{NAME}_HOST,
|
|
68
|
+
port: process.env.{NAME}_PORT || {默认端口},
|
|
69
|
+
database: process.env.{NAME}_DATABASE,
|
|
70
|
+
user: process.env.{NAME}_USER,
|
|
71
|
+
password: process.env.{NAME}_PASSWORD,
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Python
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# 连接代码示例
|
|
79
|
+
import os
|
|
80
|
+
client = Client(
|
|
81
|
+
host=os.environ['{NAME}_HOST'],
|
|
82
|
+
port=int(os.environ.get('{NAME}_PORT', {默认端口})),
|
|
83
|
+
database=os.environ['{NAME}_DATABASE'],
|
|
84
|
+
user=os.environ['{NAME}_USER'],
|
|
85
|
+
password=os.environ['{NAME}_PASSWORD'],
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Java
|
|
90
|
+
|
|
91
|
+
```java
|
|
92
|
+
// 连接代码示例
|
|
93
|
+
Client client = Client.builder()
|
|
94
|
+
.host(System.getenv("{NAME}_HOST"))
|
|
95
|
+
.port(Integer.parseInt(System.getenv().getOrDefault("{NAME}_PORT", "{默认端口}")))
|
|
96
|
+
.database(System.getenv("{NAME}_DATABASE"))
|
|
97
|
+
.user(System.getenv("{NAME}_USER"))
|
|
98
|
+
.password(System.getenv("{NAME}_PASSWORD"))
|
|
99
|
+
.build();
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 最佳实践
|
|
105
|
+
|
|
106
|
+
1. 使用连接池管理连接,避免每次请求创建新连接
|
|
107
|
+
2. 设置合理的超时时间,避免连接泄漏
|
|
108
|
+
3. 敏感信息使用环境变量,不要硬编码
|
|
109
|
+
4. 实现重试机制,处理临时网络故障
|
|
110
|
+
5. 记录连接日志,便于问题排查
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 反模式清单
|
|
115
|
+
|
|
116
|
+
| 反模式 | 风险 | 替代方案 |
|
|
117
|
+
|--------|------|----------|
|
|
118
|
+
| 直接拼接SQL字符串 | SQL注入风险 | 使用参数化查询 |
|
|
119
|
+
| 在代码中硬编码密码 | 安全风险 | 使用环境变量或密钥管理服务 |
|
|
120
|
+
| 不设置超时时间 | 连接泄漏 | 设置合理的连接和查询超时 |
|
|
121
|
+
| 每次请求创建新连接 | 性能问题 | 使用连接池 |
|
|
122
|
+
| 忽略错误处理 | 系统不稳定 | 实现完善的错误处理和重试机制 |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 健康检查
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# 健康检查命令示例
|
|
130
|
+
{CLI_TOOL} ping -h ${NAME}_HOST -u ${NAME}_USER -p${NAME}_PASSWORD
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 示例:MySQL 中间件知识
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
# MySQL 中间件知识
|
|
139
|
+
|
|
140
|
+
## 基本信息
|
|
141
|
+
|
|
142
|
+
| 字段 | 值 |
|
|
143
|
+
|------|-----|
|
|
144
|
+
| 名称 | mysql |
|
|
145
|
+
| 类型 | relational-database |
|
|
146
|
+
| 默认端口 | 3306 |
|
|
147
|
+
| 知识版本 | v1.0 |
|
|
148
|
+
|
|
149
|
+
## 环境变量
|
|
150
|
+
|
|
151
|
+
### 必需变量
|
|
152
|
+
|
|
153
|
+
| 变量名 | 说明 | 示例 |
|
|
154
|
+
|--------|------|------|
|
|
155
|
+
| MYSQL_HOST | 数据库主机地址 | db.example.com |
|
|
156
|
+
| MYSQL_DATABASE | 数据库名称 | myapp_db |
|
|
157
|
+
| MYSQL_USER | 用户名 | app_user |
|
|
158
|
+
| MYSQL_PASSWORD | 密码 | - |
|
|
159
|
+
|
|
160
|
+
### 可选变量
|
|
161
|
+
|
|
162
|
+
| 变量名 | 默认值 | 说明 |
|
|
163
|
+
|--------|--------|------|
|
|
164
|
+
| MYSQL_PORT | 3306 | 数据库端口 |
|
|
165
|
+
| MYSQL_POOL_SIZE | 10 | 连接池大小 |
|
|
166
|
+
|
|
167
|
+
## 连接代码模板
|
|
168
|
+
|
|
169
|
+
### Node.js
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
const mysql = require('mysql2/promise');
|
|
173
|
+
const pool = mysql.createPool({
|
|
174
|
+
host: process.env.MYSQL_HOST,
|
|
175
|
+
port: process.env.MYSQL_PORT || 3306,
|
|
176
|
+
database: process.env.MYSQL_DATABASE,
|
|
177
|
+
user: process.env.MYSQL_USER,
|
|
178
|
+
password: process.env.MYSQL_PASSWORD,
|
|
179
|
+
waitForConnections: true,
|
|
180
|
+
connectionLimit: parseInt(process.env.MYSQL_POOL_SIZE || '10')
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Python
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
import pymysql
|
|
188
|
+
from dbutils.pooled_db import PooledDB
|
|
189
|
+
|
|
190
|
+
pool = PooledDB(
|
|
191
|
+
creator=pymysql,
|
|
192
|
+
host=os.environ['MYSQL_HOST'],
|
|
193
|
+
port=int(os.environ.get('MYSQL_PORT', 3306)),
|
|
194
|
+
database=os.environ['MYSQL_DATABASE'],
|
|
195
|
+
user=os.environ['MYSQL_USER'],
|
|
196
|
+
password=os.environ['MYSQL_PASSWORD'],
|
|
197
|
+
maxconnections=int(os.environ.get('MYSQL_POOL_SIZE', '10'))
|
|
198
|
+
)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 最佳实践
|
|
202
|
+
|
|
203
|
+
1. 使用连接池,不要在每次请求时创建新连接
|
|
204
|
+
2. 设置合理的超时时间,避免连接泄漏
|
|
205
|
+
3. 敏感信息使用环境变量,不要硬编码
|
|
206
|
+
|
|
207
|
+
## 反模式清单
|
|
208
|
+
|
|
209
|
+
| 反模式 | 风险 | 替代方案 |
|
|
210
|
+
|--------|------|----------|
|
|
211
|
+
| 直接拼接SQL字符串 | SQL注入风险 | 使用参数化查询 |
|
|
212
|
+
| 在代码中硬编码密码 | 安全风险 | 使用环境变量 |
|
|
213
|
+
|
|
214
|
+
## 健康检查
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
mysqladmin ping -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD}
|
|
218
|
+
```
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 自检清单
|
|
224
|
+
|
|
225
|
+
生成中间件知识文件后,检查以下项目:
|
|
226
|
+
|
|
227
|
+
- [ ] 基本信息章节完整,包含名称、类型、知识版本
|
|
228
|
+
- [ ] 环境变量章节包含必需变量和可选变量表格
|
|
229
|
+
- [ ] 连接代码模板包含项目使用的主要语言
|
|
230
|
+
- [ ] 最佳实践列表不为空
|
|
231
|
+
- [ ] 反模式清单包含风险和替代方案
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
**维护者**: AutoSpec 团队
|
|
236
|
+
**进化分区**: 🟡 受控区
|
|
237
|
+
**关联文档**: `knowledge/environment/template-registry.md`
|