specops 0.2.5 → 0.3.2
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/.opencode/agent/specops-codebase-mapper.md +764 -0
- package/.opencode/agent/specops-debugger.md +1246 -0
- package/.opencode/agent/specops-executor.md +475 -0
- package/.opencode/agent/specops-integration-checker.md +443 -0
- package/.opencode/agent/specops-phase-researcher.md +547 -0
- package/.opencode/agent/specops-plan-checker.md +690 -0
- package/.opencode/agent/specops-planner.md +581 -0
- package/.opencode/agent/specops-project-researcher.md +354 -0
- package/.opencode/agent/specops-research-synthesizer.md +242 -0
- package/.opencode/agent/specops-roadmapper.md +642 -0
- package/.opencode/agent/specops-work-verifier.md +573 -0
- package/.opencode/references/checkpoints.md +776 -0
- package/.opencode/references/continuation-format.md +249 -0
- package/.opencode/references/decimal-phase-calculation.md +65 -0
- package/.opencode/references/git-integration.md +248 -0
- package/.opencode/references/git-planning-commit.md +38 -0
- package/.opencode/references/model-profile-resolution.md +34 -0
- package/.opencode/references/model-profiles.md +92 -0
- package/.opencode/references/phase-argument-parsing.md +61 -0
- package/.opencode/references/planning-config.md +196 -0
- package/.opencode/references/questioning.md +145 -0
- package/.opencode/references/tdd.md +263 -0
- package/.opencode/references/ui-brand.md +160 -0
- package/.opencode/references/verification-patterns.md +612 -0
- package/.opencode/templates/DEBUG.md +164 -0
- package/.opencode/templates/UAT.md +180 -0
- package/.opencode/templates/VALIDATION.md +76 -0
- package/.opencode/templates/codebase/architecture.md +255 -0
- package/.opencode/templates/codebase/concerns.md +310 -0
- package/.opencode/templates/codebase/conventions.md +307 -0
- package/.opencode/templates/codebase/integrations.md +280 -0
- package/.opencode/templates/codebase/stack.md +186 -0
- package/.opencode/templates/codebase/structure.md +285 -0
- package/.opencode/templates/codebase/testing.md +480 -0
- package/.opencode/templates/context.md +221 -0
- package/.opencode/templates/continue-here.md +78 -0
- package/.opencode/templates/debug-subagent-prompt.md +91 -0
- package/.opencode/templates/discovery.md +147 -0
- package/.opencode/templates/milestone-archive.md +123 -0
- package/.opencode/templates/milestone.md +115 -0
- package/.opencode/templates/phase-prompt.md +333 -0
- package/.opencode/templates/planner-subagent-prompt.md +117 -0
- package/.opencode/templates/project.md +184 -0
- package/.opencode/templates/requirements.md +130 -0
- package/.opencode/templates/research-project/ARCHITECTURE.md +204 -0
- package/.opencode/templates/research-project/FEATURES.md +147 -0
- package/.opencode/templates/research-project/PITFALLS.md +200 -0
- package/.opencode/templates/research-project/STACK.md +120 -0
- package/.opencode/templates/research-project/SUMMARY.md +170 -0
- package/.opencode/templates/research.md +278 -0
- package/.opencode/templates/retrospective.md +54 -0
- package/.opencode/templates/roadmap.md +202 -0
- package/.opencode/templates/state.md +176 -0
- package/.opencode/templates/summary-complex.md +59 -0
- package/.opencode/templates/summary-minimal.md +41 -0
- package/.opencode/templates/summary-standard.md +48 -0
- package/.opencode/templates/summary.md +248 -0
- package/.opencode/templates/user-setup.md +311 -0
- package/.opencode/templates/verification-report.md +322 -0
- package/.opencode/workflows/add-phase.md +111 -0
- package/.opencode/workflows/add-tests.md +350 -0
- package/.opencode/workflows/add-todo.md +157 -0
- package/.opencode/workflows/audit-milestone.md +297 -0
- package/.opencode/workflows/check-todos.md +176 -0
- package/.opencode/workflows/cleanup.md +152 -0
- package/.opencode/workflows/complete-milestone.md +763 -0
- package/.opencode/workflows/diagnose-issues.md +219 -0
- package/.opencode/workflows/discovery-phase.md +288 -0
- package/.opencode/workflows/discuss-phase.md +542 -0
- package/.opencode/workflows/execute-phase.md +449 -0
- package/.opencode/workflows/execute-plan.md +447 -0
- package/.opencode/workflows/health.md +156 -0
- package/.opencode/workflows/help.md +489 -0
- package/.opencode/workflows/insert-phase.md +129 -0
- package/.opencode/workflows/list-phase-assumptions.md +178 -0
- package/.opencode/workflows/map-codebase.md +315 -0
- package/.opencode/workflows/new-milestone.md +382 -0
- package/.opencode/workflows/new-project.md +1116 -0
- package/.opencode/workflows/pause-work.md +122 -0
- package/.opencode/workflows/plan-milestone-gaps.md +274 -0
- package/.opencode/workflows/plan-phase.md +569 -0
- package/.opencode/workflows/progress.md +381 -0
- package/.opencode/workflows/quick.md +453 -0
- package/.opencode/workflows/remove-phase.md +154 -0
- package/.opencode/workflows/research-phase.md +73 -0
- package/.opencode/workflows/resume-project.md +304 -0
- package/.opencode/workflows/set-profile.md +80 -0
- package/.opencode/workflows/settings.md +213 -0
- package/.opencode/workflows/transition.md +544 -0
- package/.opencode/workflows/update.md +219 -0
- package/.opencode/workflows/verify-phase.md +242 -0
- package/.opencode/workflows/verify-work.md +569 -0
- package/commands/specops/add-phase.md +43 -0
- package/commands/specops/add-tests.md +41 -0
- package/commands/specops/add-todo.md +47 -0
- package/commands/specops/audit-milestone.md +36 -0
- package/commands/specops/check-todos.md +45 -0
- package/commands/specops/cleanup.md +18 -0
- package/commands/specops/complete-milestone.md +136 -0
- package/commands/specops/debug.md +167 -0
- package/commands/specops/discuss-phase.md +83 -0
- package/commands/specops/execute-phase.md +41 -0
- package/commands/specops/health.md +22 -0
- package/commands/specops/help.md +22 -0
- package/commands/specops/insert-phase.md +32 -0
- package/commands/specops/join-discord.md +18 -0
- package/commands/specops/list-phase-assumptions.md +46 -0
- package/commands/specops/map-codebase.md +71 -0
- package/commands/specops/new-milestone.md +44 -0
- package/commands/specops/new-project.md +42 -0
- package/commands/specops/pause-work.md +38 -0
- package/commands/specops/plan-milestone-gaps.md +34 -0
- package/commands/specops/plan-phase.md +45 -0
- package/commands/specops/progress.md +24 -0
- package/commands/specops/quick.md +41 -0
- package/commands/specops/reapply-patches.md +111 -0
- package/commands/specops/remove-phase.md +31 -0
- package/commands/specops/research-phase.md +189 -0
- package/commands/specops/resume-work.md +40 -0
- package/commands/specops/set-profile.md +34 -0
- package/commands/specops/settings.md +36 -0
- package/commands/specops/update.md +37 -0
- package/commands/specops/verify-work.md +38 -0
- package/dist/__integration__/fixtures/generator.d.ts +4 -0
- package/dist/__integration__/fixtures/generator.js +1 -0
- package/dist/__integration__/mocks/server.d.ts +7 -0
- package/dist/__integration__/mocks/server.js +1 -0
- package/dist/__integration__/setup.d.ts +6 -0
- package/dist/__integration__/setup.js +1 -0
- package/dist/acceptance/lazyDetector.js +1 -1
- package/dist/acceptance/reporter.js +1 -1
- package/dist/acceptance/runner.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/promptTemplate.js +1 -1
- package/dist/context/techContextLoader.js +1 -1
- package/dist/engine.d.ts +1 -0
- package/dist/engine.js +1 -1
- package/dist/evolution/distiller.js +1 -1
- package/dist/evolution/index.js +1 -1
- package/dist/evolution/memoryGraph.js +1 -1
- package/dist/evolution/selector.js +1 -1
- package/dist/evolution/signals.js +1 -1
- package/dist/evolution/solidify.js +1 -1
- package/dist/evolution/store.js +1 -1
- package/dist/evolution/types.js +1 -1
- package/dist/init.d.ts +4 -3
- package/dist/init.js +1 -1
- package/dist/machines/agentMachine.js +1 -1
- package/dist/machines/supervisorMachine.js +1 -1
- package/dist/persistence/schema.js +1 -1
- package/dist/persistence/stateFile.js +1 -1
- package/dist/plugin-engine.js +1 -1
- package/dist/plugin.js +1 -1
- package/dist/requirement-analysis/analyzers/repository-parser.d.ts +121 -0
- package/dist/requirement-analysis/analyzers/repository-parser.js +1 -0
- package/dist/requirement-analysis/generators/prd-generator.d.ts +90 -0
- package/dist/requirement-analysis/generators/prd-generator.js +1 -0
- package/dist/requirement-analysis/integrations/v1-integration.d.ts +73 -0
- package/dist/requirement-analysis/integrations/v1-integration.js +1 -0
- package/dist/requirement-analysis/tools/analyze-requirements.js +1 -0
- package/dist/requirement-analysis/types/analysis-result.d.ts +326 -0
- package/dist/requirement-analysis/types/analysis-result.js +1 -0
- package/dist/requirement-analysis/types/feature-mapping.d.ts +294 -0
- package/dist/requirement-analysis/types/feature-mapping.js +1 -0
- package/dist/requirement-analysis/types/index.d.ts +171 -0
- package/dist/requirement-analysis/types/index.js +1 -0
- package/dist/requirement-analysis/types/tech-stack.d.ts +213 -0
- package/dist/requirement-analysis/types/tech-stack.js +1 -0
- package/dist/requirement-analysis/utils/error-handler.d.ts +112 -0
- package/dist/requirement-analysis/utils/error-handler.js +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js +1 -1
- package/dist/utils/id.js +1 -1
- package/package.json +4 -2
- package/skills/competitor-search/SKILL.md +169 -0
- package/skills/demand-analysis/SKILL.md +307 -0
- package/skills/feature-search/SKILL.md +182 -0
- package/skills/requirement-analysis/README.md +464 -0
- package/skills/requirement-analysis/SKILL.md +224 -0
- package/skills/requirement-analysis/templates/feature-mapping-template.json +210 -0
- package/skills/requirement-analysis/templates/prd-template.md +104 -0
- package/skills/tech-selection/SKILL.md +198 -0
- package/dist/__e2e__/01-state-engine.e2e.test.d.ts +0 -10
- package/dist/__e2e__/01-state-engine.e2e.test.js +0 -1
- package/dist/acceptance/lazyDetector.test.d.ts +0 -1
- package/dist/acceptance/lazyDetector.test.js +0 -1
- package/dist/acceptance/reporter.test.d.ts +0 -1
- package/dist/acceptance/reporter.test.js +0 -1
- package/dist/acceptance/runner.test.d.ts +0 -1
- package/dist/acceptance/runner.test.js +0 -1
- package/dist/context/promptTemplate.test.d.ts +0 -1
- package/dist/context/promptTemplate.test.js +0 -1
- package/dist/context/techContextLoader.test.d.ts +0 -1
- package/dist/context/techContextLoader.test.js +0 -1
- package/dist/machines/agentMachine.test.d.ts +0 -1
- package/dist/machines/agentMachine.test.js +0 -1
- package/dist/machines/supervisorMachine.test.d.ts +0 -1
- package/dist/machines/supervisorMachine.test.js +0 -1
- package/dist/persistence/stateFile.test.d.ts +0 -1
- package/dist/persistence/stateFile.test.js +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 功能代码映射核心接口
|
|
3
|
+
* 基于 Oracle 架构设计的需求分析数据模型
|
|
4
|
+
*/
|
|
5
|
+
export interface FeatureCodeMapping {
|
|
6
|
+
/** 映射版本号 */
|
|
7
|
+
version: string;
|
|
8
|
+
/** 生成时间戳 */
|
|
9
|
+
generatedAt: string;
|
|
10
|
+
/** 代码库信息 */
|
|
11
|
+
repository: RepositoryInfo;
|
|
12
|
+
/** 功能映射列表 */
|
|
13
|
+
features: FeatureMap[];
|
|
14
|
+
/** 代码结构映射 */
|
|
15
|
+
codeStructure: CodeStructureMap;
|
|
16
|
+
/** 依赖关系图 */
|
|
17
|
+
dependencies: DependencyGraph;
|
|
18
|
+
/** 实现建议 */
|
|
19
|
+
recommendations: ImplementationRecommendation[];
|
|
20
|
+
}
|
|
21
|
+
export interface FeatureMap {
|
|
22
|
+
/** 功能ID,格式:SC-001, SC-002... */
|
|
23
|
+
id: string;
|
|
24
|
+
/** 功能名称 */
|
|
25
|
+
name: string;
|
|
26
|
+
/** 功能描述 */
|
|
27
|
+
description: string;
|
|
28
|
+
/** 优先级 */
|
|
29
|
+
priority: "high" | "medium" | "low";
|
|
30
|
+
/** 复杂度评估 */
|
|
31
|
+
complexity: "low" | "medium" | "high";
|
|
32
|
+
/** 代码映射信息 */
|
|
33
|
+
codeMapping: CodeMapping;
|
|
34
|
+
/** 实现计划 */
|
|
35
|
+
implementation: ImplementationPlan;
|
|
36
|
+
}
|
|
37
|
+
export interface RepositoryInfo {
|
|
38
|
+
/** 代码库名称 */
|
|
39
|
+
name: string;
|
|
40
|
+
/** 代码库路径 */
|
|
41
|
+
path: string;
|
|
42
|
+
/** Git 远程地址 */
|
|
43
|
+
remoteUrl?: string;
|
|
44
|
+
/** 主分支名称 */
|
|
45
|
+
mainBranch: string;
|
|
46
|
+
/** 最后提交哈希 */
|
|
47
|
+
lastCommit: string;
|
|
48
|
+
/** 代码库统计信息 */
|
|
49
|
+
stats: RepositoryStats;
|
|
50
|
+
}
|
|
51
|
+
export interface RepositoryStats {
|
|
52
|
+
/** 总文件数 */
|
|
53
|
+
totalFiles: number;
|
|
54
|
+
/** 总代码行数 */
|
|
55
|
+
totalLines: number;
|
|
56
|
+
/** 语言分布 */
|
|
57
|
+
languageDistribution: Record<string, number>;
|
|
58
|
+
/** 目录数量 */
|
|
59
|
+
directoryCount: number;
|
|
60
|
+
/** 最后修改时间 */
|
|
61
|
+
lastModified: string;
|
|
62
|
+
}
|
|
63
|
+
export interface CodeMapping {
|
|
64
|
+
/** 相关文件路径列表 */
|
|
65
|
+
relatedFiles: string[];
|
|
66
|
+
/** 核心组件列表 */
|
|
67
|
+
coreComponents: ComponentInfo[];
|
|
68
|
+
/** API 端点列表 */
|
|
69
|
+
apiEndpoints: ApiEndpoint[];
|
|
70
|
+
/** 数据模型列表 */
|
|
71
|
+
dataModels: DataModel[];
|
|
72
|
+
/** 配置文件列表 */
|
|
73
|
+
configFiles: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface ComponentInfo {
|
|
76
|
+
/** 组件名称 */
|
|
77
|
+
name: string;
|
|
78
|
+
/** 组件类型 */
|
|
79
|
+
type: "component" | "service" | "utility" | "hook" | "store";
|
|
80
|
+
/** 文件路径 */
|
|
81
|
+
filePath: string;
|
|
82
|
+
/** 组件描述 */
|
|
83
|
+
description: string;
|
|
84
|
+
/** 依赖的其他组件 */
|
|
85
|
+
dependencies: string[];
|
|
86
|
+
/** 导出的接口 */
|
|
87
|
+
exports: string[];
|
|
88
|
+
}
|
|
89
|
+
export interface ApiEndpoint {
|
|
90
|
+
/** 端点路径 */
|
|
91
|
+
path: string;
|
|
92
|
+
/** HTTP 方法 */
|
|
93
|
+
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
94
|
+
/** 端点描述 */
|
|
95
|
+
description: string;
|
|
96
|
+
/** 请求参数 */
|
|
97
|
+
parameters: ParameterInfo[];
|
|
98
|
+
/** 响应格式 */
|
|
99
|
+
response: ResponseInfo;
|
|
100
|
+
/** 实现文件路径 */
|
|
101
|
+
implementationFile: string;
|
|
102
|
+
}
|
|
103
|
+
export interface ParameterInfo {
|
|
104
|
+
/** 参数名称 */
|
|
105
|
+
name: string;
|
|
106
|
+
/** 参数类型 */
|
|
107
|
+
type: string;
|
|
108
|
+
/** 是否必需 */
|
|
109
|
+
required: boolean;
|
|
110
|
+
/** 参数描述 */
|
|
111
|
+
description: string;
|
|
112
|
+
/** 默认值 */
|
|
113
|
+
defaultValue?: any;
|
|
114
|
+
}
|
|
115
|
+
export interface ResponseInfo {
|
|
116
|
+
/** 响应类型 */
|
|
117
|
+
type: string;
|
|
118
|
+
/** 响应描述 */
|
|
119
|
+
description: string;
|
|
120
|
+
/** 示例数据 */
|
|
121
|
+
example?: any;
|
|
122
|
+
}
|
|
123
|
+
export interface DataModel {
|
|
124
|
+
/** 模型名称 */
|
|
125
|
+
name: string;
|
|
126
|
+
/** 模型类型 */
|
|
127
|
+
type: "interface" | "type" | "class" | "enum";
|
|
128
|
+
/** 定义文件路径 */
|
|
129
|
+
filePath: string;
|
|
130
|
+
/** 字段列表 */
|
|
131
|
+
fields: FieldInfo[];
|
|
132
|
+
/** 模型描述 */
|
|
133
|
+
description: string;
|
|
134
|
+
}
|
|
135
|
+
export interface FieldInfo {
|
|
136
|
+
/** 字段名称 */
|
|
137
|
+
name: string;
|
|
138
|
+
/** 字段类型 */
|
|
139
|
+
type: string;
|
|
140
|
+
/** 是否可选 */
|
|
141
|
+
optional: boolean;
|
|
142
|
+
/** 字段描述 */
|
|
143
|
+
description: string;
|
|
144
|
+
}
|
|
145
|
+
export interface ImplementationPlan {
|
|
146
|
+
/** 实现步骤 */
|
|
147
|
+
steps: ImplementationStep[];
|
|
148
|
+
/** 预估工作量(小时) */
|
|
149
|
+
estimatedHours: number;
|
|
150
|
+
/** 技术风险评估 */
|
|
151
|
+
risks: RiskAssessment[];
|
|
152
|
+
/** 依赖的其他功能 */
|
|
153
|
+
dependencies: string[];
|
|
154
|
+
/** 验收标准 */
|
|
155
|
+
acceptanceCriteria: string[];
|
|
156
|
+
}
|
|
157
|
+
export interface ImplementationStep {
|
|
158
|
+
/** 步骤序号 */
|
|
159
|
+
order: number;
|
|
160
|
+
/** 步骤描述 */
|
|
161
|
+
description: string;
|
|
162
|
+
/** 涉及的文件 */
|
|
163
|
+
files: string[];
|
|
164
|
+
/** 预估时间(小时) */
|
|
165
|
+
estimatedHours: number;
|
|
166
|
+
/** 步骤类型 */
|
|
167
|
+
type: "create" | "modify" | "delete" | "test" | "deploy";
|
|
168
|
+
}
|
|
169
|
+
export interface RiskAssessment {
|
|
170
|
+
/** 风险描述 */
|
|
171
|
+
description: string;
|
|
172
|
+
/** 风险等级 */
|
|
173
|
+
level: "low" | "medium" | "high" | "critical";
|
|
174
|
+
/** 影响范围 */
|
|
175
|
+
impact: string;
|
|
176
|
+
/** 缓解措施 */
|
|
177
|
+
mitigation: string;
|
|
178
|
+
}
|
|
179
|
+
export interface CodeStructureMap {
|
|
180
|
+
/** 目录结构 */
|
|
181
|
+
directories: DirectoryNode[];
|
|
182
|
+
/** 架构模式 */
|
|
183
|
+
architecturePattern: string;
|
|
184
|
+
/** 代码组织方式 */
|
|
185
|
+
organizationStyle: "feature-based" | "layer-based" | "domain-based" | "mixed";
|
|
186
|
+
/** 关键路径分析 */
|
|
187
|
+
criticalPaths: CriticalPath[];
|
|
188
|
+
}
|
|
189
|
+
export interface DirectoryNode {
|
|
190
|
+
/** 目录名称 */
|
|
191
|
+
name: string;
|
|
192
|
+
/** 目录路径 */
|
|
193
|
+
path: string;
|
|
194
|
+
/** 目录类型 */
|
|
195
|
+
type: "source" | "test" | "config" | "docs" | "assets" | "build";
|
|
196
|
+
/** 子目录 */
|
|
197
|
+
children: DirectoryNode[];
|
|
198
|
+
/** 文件列表 */
|
|
199
|
+
files: FileNode[];
|
|
200
|
+
/** 目录描述 */
|
|
201
|
+
description: string;
|
|
202
|
+
}
|
|
203
|
+
export interface FileNode {
|
|
204
|
+
/** 文件名称 */
|
|
205
|
+
name: string;
|
|
206
|
+
/** 文件路径 */
|
|
207
|
+
path: string;
|
|
208
|
+
/** 文件类型 */
|
|
209
|
+
type: string;
|
|
210
|
+
/** 文件大小(字节) */
|
|
211
|
+
size: number;
|
|
212
|
+
/** 最后修改时间 */
|
|
213
|
+
lastModified: string;
|
|
214
|
+
/** 文件重要性 */
|
|
215
|
+
importance: "critical" | "important" | "normal" | "low";
|
|
216
|
+
}
|
|
217
|
+
export interface CriticalPath {
|
|
218
|
+
/** 路径名称 */
|
|
219
|
+
name: string;
|
|
220
|
+
/** 路径描述 */
|
|
221
|
+
description: string;
|
|
222
|
+
/** 涉及的文件 */
|
|
223
|
+
files: string[];
|
|
224
|
+
/** 路径重要性 */
|
|
225
|
+
importance: "critical" | "high" | "medium" | "low";
|
|
226
|
+
}
|
|
227
|
+
export interface DependencyGraph {
|
|
228
|
+
/** 依赖节点列表 */
|
|
229
|
+
nodes: DependencyNode[];
|
|
230
|
+
/** 依赖边列表 */
|
|
231
|
+
edges: DependencyEdge[];
|
|
232
|
+
/** 循环依赖检测 */
|
|
233
|
+
circularDependencies: CircularDependency[];
|
|
234
|
+
/** 依赖层级 */
|
|
235
|
+
levels: DependencyLevel[];
|
|
236
|
+
}
|
|
237
|
+
export interface DependencyNode {
|
|
238
|
+
/** 节点ID */
|
|
239
|
+
id: string;
|
|
240
|
+
/** 节点名称 */
|
|
241
|
+
name: string;
|
|
242
|
+
/** 节点类型 */
|
|
243
|
+
type: "feature" | "component" | "service" | "external";
|
|
244
|
+
/** 节点描述 */
|
|
245
|
+
description: string;
|
|
246
|
+
/** 节点重要性 */
|
|
247
|
+
importance: "critical" | "high" | "medium" | "low";
|
|
248
|
+
}
|
|
249
|
+
export interface DependencyEdge {
|
|
250
|
+
/** 源节点ID */
|
|
251
|
+
from: string;
|
|
252
|
+
/** 目标节点ID */
|
|
253
|
+
to: string;
|
|
254
|
+
/** 依赖类型 */
|
|
255
|
+
type: "required" | "optional" | "weak";
|
|
256
|
+
/** 依赖描述 */
|
|
257
|
+
description: string;
|
|
258
|
+
}
|
|
259
|
+
export interface CircularDependency {
|
|
260
|
+
/** 循环路径 */
|
|
261
|
+
path: string[];
|
|
262
|
+
/** 严重程度 */
|
|
263
|
+
severity: "error" | "warning" | "info";
|
|
264
|
+
/** 建议解决方案 */
|
|
265
|
+
suggestion: string;
|
|
266
|
+
}
|
|
267
|
+
export interface DependencyLevel {
|
|
268
|
+
/** 层级编号 */
|
|
269
|
+
level: number;
|
|
270
|
+
/** 该层级的节点 */
|
|
271
|
+
nodes: string[];
|
|
272
|
+
/** 层级描述 */
|
|
273
|
+
description: string;
|
|
274
|
+
}
|
|
275
|
+
export interface ImplementationRecommendation {
|
|
276
|
+
/** 建议ID */
|
|
277
|
+
id: string;
|
|
278
|
+
/** 建议标题 */
|
|
279
|
+
title: string;
|
|
280
|
+
/** 建议描述 */
|
|
281
|
+
description: string;
|
|
282
|
+
/** 建议类型 */
|
|
283
|
+
type: "architecture" | "performance" | "security" | "maintainability" | "testing";
|
|
284
|
+
/** 优先级 */
|
|
285
|
+
priority: "high" | "medium" | "low";
|
|
286
|
+
/** 影响范围 */
|
|
287
|
+
impact: string[];
|
|
288
|
+
/** 实施成本 */
|
|
289
|
+
cost: "low" | "medium" | "high";
|
|
290
|
+
/** 预期收益 */
|
|
291
|
+
benefit: string;
|
|
292
|
+
/** 实施步骤 */
|
|
293
|
+
implementationSteps: string[];
|
|
294
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 需求分析模块类型定义入口
|
|
3
|
+
* 基于 Oracle 架构设计的核心数据模型
|
|
4
|
+
*/
|
|
5
|
+
export type { FeatureCodeMapping, FeatureMap, RepositoryInfo, RepositoryStats, CodeMapping, ComponentInfo, ApiEndpoint, ParameterInfo, ResponseInfo, DataModel, FieldInfo, ImplementationPlan, ImplementationStep, RiskAssessment, CodeStructureMap, DirectoryNode, FileNode, CriticalPath, DependencyGraph, DependencyNode, DependencyEdge, CircularDependency, DependencyLevel, ImplementationRecommendation } from './feature-mapping.js';
|
|
6
|
+
export type { TechStackDetection, DetectedTechnology, TechnologyType, DetectionSource, UsageLevel, TechStackCategories, VersionInfo, ConfigAnalysis, ConfigFile, EnvironmentConfig, BuildConfiguration, OptimizationConfig, DeploymentConfiguration, DetectionStats, TechStackRecommendation, ImpactAssessment } from './tech-stack.js';
|
|
7
|
+
export type { RequirementAnalysisResult as FullRequirementAnalysisResult, ProjectInfo, ProjectType, ProjectScale, CodebaseStats, LanguageStats, FileTypeStats, DirectoryStats, ComplexityMetrics, ProjectMetadata, PRDGenerationResult, PRDSection, PRDSectionType, TemplateInfo, GenerationStats, GenerationError, QualityMetrics, QualityDimensions, QualityThresholds, ImprovementSuggestion, AnalysisStats, PhaseDuration, MemoryUsage, AnalysisConfig } from './analysis-result.js';
|
|
8
|
+
export interface AnalysisOptions {
|
|
9
|
+
/** 包含代码分析 */
|
|
10
|
+
includeCodeAnalysis?: boolean;
|
|
11
|
+
/** 包含技术栈分析 */
|
|
12
|
+
includeTechStack?: boolean;
|
|
13
|
+
/** 包含功能映射 */
|
|
14
|
+
includeFeatureMapping?: boolean;
|
|
15
|
+
/** 生成PRD */
|
|
16
|
+
generatePRD?: boolean;
|
|
17
|
+
/** 输出格式 */
|
|
18
|
+
outputFormat?: 'markdown' | 'json' | 'html';
|
|
19
|
+
/** 分析深度 */
|
|
20
|
+
depth?: 'shallow' | 'medium' | 'deep';
|
|
21
|
+
/** 超时设置(秒) */
|
|
22
|
+
timeout?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface TechStackAnalysis {
|
|
25
|
+
/** 检测到的技术 */
|
|
26
|
+
detected: Array<{
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
confidence: number;
|
|
31
|
+
}>;
|
|
32
|
+
/** 兼容性分析 */
|
|
33
|
+
compatibility: {
|
|
34
|
+
score: number;
|
|
35
|
+
issues: string[];
|
|
36
|
+
conflicts?: string[];
|
|
37
|
+
suggestions?: string[];
|
|
38
|
+
};
|
|
39
|
+
/** 推荐建议 */
|
|
40
|
+
recommendations: Array<{
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
priority: number;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface FeatureMappingResult {
|
|
47
|
+
/** 用户故事 */
|
|
48
|
+
userStories: Array<{
|
|
49
|
+
id: string;
|
|
50
|
+
asA: string;
|
|
51
|
+
iWant: string;
|
|
52
|
+
soThat: string;
|
|
53
|
+
priority: number;
|
|
54
|
+
}>;
|
|
55
|
+
/** 功能特性 */
|
|
56
|
+
features: Array<{
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
priority?: number;
|
|
61
|
+
complexity?: number;
|
|
62
|
+
estimatedHours?: number;
|
|
63
|
+
category?: string;
|
|
64
|
+
userStories?: string[];
|
|
65
|
+
acceptanceCriteria?: string[];
|
|
66
|
+
}>;
|
|
67
|
+
/** 依赖关系 */
|
|
68
|
+
dependencies: Array<{
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
type: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** 汇总信息 */
|
|
74
|
+
summary?: {
|
|
75
|
+
totalFeatures: number;
|
|
76
|
+
totalEstimatedHours: number;
|
|
77
|
+
complexityDistribution: Record<number, number>;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export interface PRDResult {
|
|
81
|
+
/** PRD内容 */
|
|
82
|
+
content: string;
|
|
83
|
+
/** 章节列表 */
|
|
84
|
+
sections: Array<{
|
|
85
|
+
id: string;
|
|
86
|
+
title: string;
|
|
87
|
+
content: string;
|
|
88
|
+
order: number;
|
|
89
|
+
}>;
|
|
90
|
+
/** 质量评分 */
|
|
91
|
+
qualityScore: {
|
|
92
|
+
overall: number;
|
|
93
|
+
completeness?: number;
|
|
94
|
+
clarity?: number;
|
|
95
|
+
feasibility?: number;
|
|
96
|
+
dimensions?: Record<string, number>;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface QualityScore {
|
|
100
|
+
/** 总体评分 */
|
|
101
|
+
overall: number;
|
|
102
|
+
/** 各维度评分 */
|
|
103
|
+
dimensions: {
|
|
104
|
+
featureCompleteness: number;
|
|
105
|
+
technicalFeasibility: number;
|
|
106
|
+
requirementClarity: number;
|
|
107
|
+
complexityReasonableness: number;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export interface RequirementAnalysisResult {
|
|
111
|
+
/** 项目信息 */
|
|
112
|
+
projectInfo: {
|
|
113
|
+
name: string;
|
|
114
|
+
type: string;
|
|
115
|
+
description: string;
|
|
116
|
+
repository?: string;
|
|
117
|
+
};
|
|
118
|
+
/** 代码库统计 */
|
|
119
|
+
codebaseStats: {
|
|
120
|
+
totalFiles: number;
|
|
121
|
+
totalLines: number;
|
|
122
|
+
languages: Record<string, number>;
|
|
123
|
+
frameworks: string[];
|
|
124
|
+
dependencies: Record<string, string>;
|
|
125
|
+
};
|
|
126
|
+
/** PRD结果 */
|
|
127
|
+
prdResult: {
|
|
128
|
+
sections: Array<{
|
|
129
|
+
id: string;
|
|
130
|
+
title: string;
|
|
131
|
+
content: string;
|
|
132
|
+
order: number;
|
|
133
|
+
}>;
|
|
134
|
+
qualityScore: {
|
|
135
|
+
completeness: number;
|
|
136
|
+
clarity: number;
|
|
137
|
+
feasibility: number;
|
|
138
|
+
overall: number;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
/** 功能映射 */
|
|
142
|
+
featureMapping: {
|
|
143
|
+
userStories: Array<{
|
|
144
|
+
id: string;
|
|
145
|
+
asA: string;
|
|
146
|
+
iWant: string;
|
|
147
|
+
soThat: string;
|
|
148
|
+
priority: number;
|
|
149
|
+
}>;
|
|
150
|
+
features: Array<{
|
|
151
|
+
id: string;
|
|
152
|
+
name: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
priority?: number;
|
|
155
|
+
complexity?: number;
|
|
156
|
+
estimatedHours?: number;
|
|
157
|
+
category?: string;
|
|
158
|
+
userStories?: string[];
|
|
159
|
+
acceptanceCriteria?: string[];
|
|
160
|
+
}>;
|
|
161
|
+
dependencies: Array<{
|
|
162
|
+
from: string;
|
|
163
|
+
to: string;
|
|
164
|
+
type: string;
|
|
165
|
+
}>;
|
|
166
|
+
};
|
|
167
|
+
/** 技术栈分析 */
|
|
168
|
+
techStackAnalysis: TechStackAnalysis;
|
|
169
|
+
/** 分析选项 */
|
|
170
|
+
analysisOptions: AnalysisOptions;
|
|
171
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 技术栈检测接口
|
|
3
|
+
* 基于 Oracle 架构设计的技术栈分析数据模型
|
|
4
|
+
*/
|
|
5
|
+
export interface TechStackDetection {
|
|
6
|
+
/** 检测版本号 */
|
|
7
|
+
version: string;
|
|
8
|
+
/** 检测时间戳 */
|
|
9
|
+
detectedAt: string;
|
|
10
|
+
/** 项目路径 */
|
|
11
|
+
projectPath: string;
|
|
12
|
+
/** 检测到的技术栈 */
|
|
13
|
+
detectedStack: DetectedTechnology[];
|
|
14
|
+
/** 技术栈分类 */
|
|
15
|
+
categories: TechStackCategories;
|
|
16
|
+
/** 版本信息 */
|
|
17
|
+
versions: VersionInfo[];
|
|
18
|
+
/** 配置文件分析 */
|
|
19
|
+
configAnalysis: ConfigAnalysis;
|
|
20
|
+
/** 检测统计 */
|
|
21
|
+
detectionStats: DetectionStats;
|
|
22
|
+
}
|
|
23
|
+
export interface DetectedTechnology {
|
|
24
|
+
/** 技术名称 */
|
|
25
|
+
name: string;
|
|
26
|
+
/** 技术类型 */
|
|
27
|
+
type: TechnologyType;
|
|
28
|
+
/** 版本号 */
|
|
29
|
+
version?: string;
|
|
30
|
+
/** 检测置信度 (0-1) */
|
|
31
|
+
confidence: number;
|
|
32
|
+
/** 检测来源 */
|
|
33
|
+
detectionSource: DetectionSource;
|
|
34
|
+
/** 使用程度 */
|
|
35
|
+
usage: UsageLevel;
|
|
36
|
+
/** 相关文件 */
|
|
37
|
+
relatedFiles: string[];
|
|
38
|
+
/** 技术描述 */
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
export type TechnologyType = "frontend-framework" | "backend-framework" | "database" | "orm" | "build-tool" | "bundler" | "testing-framework" | "linting-tool" | "deployment-tool" | "monitoring-tool" | "language" | "runtime" | "library" | "utility" | "ui-library" | "state-management" | "routing" | "styling" | "authentication" | "api-client" | "validation" | "documentation" | "ci-cd" | "containerization" | "cloud-service" | "other";
|
|
42
|
+
export interface DetectionSource {
|
|
43
|
+
/** 检测方法 */
|
|
44
|
+
method: "package-json" | "import-analysis" | "config-file" | "file-extension" | "content-analysis";
|
|
45
|
+
/** 源文件路径 */
|
|
46
|
+
sourceFile: string;
|
|
47
|
+
/** 检测的具体内容 */
|
|
48
|
+
evidence: string;
|
|
49
|
+
/** 检测时间 */
|
|
50
|
+
detectedAt: string;
|
|
51
|
+
}
|
|
52
|
+
export type UsageLevel = "primary" | "secondary" | "development" | "minimal" | "deprecated";
|
|
53
|
+
export interface TechStackCategories {
|
|
54
|
+
/** 前端技术栈 */
|
|
55
|
+
frontend: DetectedTechnology[];
|
|
56
|
+
/** 后端技术栈 */
|
|
57
|
+
backend: DetectedTechnology[];
|
|
58
|
+
/** 数据库技术 */
|
|
59
|
+
database: DetectedTechnology[];
|
|
60
|
+
/** 开发工具 */
|
|
61
|
+
devTools: DetectedTechnology[];
|
|
62
|
+
/** 部署工具 */
|
|
63
|
+
deployment: DetectedTechnology[];
|
|
64
|
+
/** 测试工具 */
|
|
65
|
+
testing: DetectedTechnology[];
|
|
66
|
+
/** 其他工具 */
|
|
67
|
+
others: DetectedTechnology[];
|
|
68
|
+
}
|
|
69
|
+
export interface VersionInfo {
|
|
70
|
+
/** 技术名称 */
|
|
71
|
+
technology: string;
|
|
72
|
+
/** 当前版本 */
|
|
73
|
+
currentVersion: string;
|
|
74
|
+
/** 最新版本 */
|
|
75
|
+
latestVersion?: string;
|
|
76
|
+
/** 版本状态 */
|
|
77
|
+
status: "latest" | "outdated" | "deprecated" | "unknown";
|
|
78
|
+
/** 更新建议 */
|
|
79
|
+
updateRecommendation?: string;
|
|
80
|
+
/** 破坏性变更风险 */
|
|
81
|
+
breakingChangeRisk: "low" | "medium" | "high";
|
|
82
|
+
}
|
|
83
|
+
export interface ConfigAnalysis {
|
|
84
|
+
/** 配置文件列表 */
|
|
85
|
+
configFiles: ConfigFile[];
|
|
86
|
+
/** 环境配置 */
|
|
87
|
+
environments: EnvironmentConfig[];
|
|
88
|
+
/** 构建配置 */
|
|
89
|
+
buildConfig: BuildConfiguration;
|
|
90
|
+
/** 部署配置 */
|
|
91
|
+
deploymentConfig?: DeploymentConfiguration;
|
|
92
|
+
}
|
|
93
|
+
export interface ConfigFile {
|
|
94
|
+
/** 文件路径 */
|
|
95
|
+
path: string;
|
|
96
|
+
/** 文件类型 */
|
|
97
|
+
type: "package" | "build" | "test" | "lint" | "env" | "deployment" | "other";
|
|
98
|
+
/** 文件格式 */
|
|
99
|
+
format: "json" | "yaml" | "toml" | "ini" | "js" | "ts" | "other";
|
|
100
|
+
/** 配置内容摘要 */
|
|
101
|
+
summary: string;
|
|
102
|
+
/** 重要配置项 */
|
|
103
|
+
keySettings: Record<string, any>;
|
|
104
|
+
}
|
|
105
|
+
export interface EnvironmentConfig {
|
|
106
|
+
/** 环境名称 */
|
|
107
|
+
name: string;
|
|
108
|
+
/** 环境类型 */
|
|
109
|
+
type: "development" | "staging" | "production" | "test";
|
|
110
|
+
/** 环境变量 */
|
|
111
|
+
variables: Record<string, string>;
|
|
112
|
+
/** 配置文件 */
|
|
113
|
+
configFiles: string[];
|
|
114
|
+
}
|
|
115
|
+
export interface BuildConfiguration {
|
|
116
|
+
/** 构建工具 */
|
|
117
|
+
tool: string;
|
|
118
|
+
/** 构建脚本 */
|
|
119
|
+
scripts: Record<string, string>;
|
|
120
|
+
/** 输入目录 */
|
|
121
|
+
inputDir: string;
|
|
122
|
+
/** 输出目录 */
|
|
123
|
+
outputDir: string;
|
|
124
|
+
/** 构建目标 */
|
|
125
|
+
targets: string[];
|
|
126
|
+
/** 优化配置 */
|
|
127
|
+
optimization: OptimizationConfig;
|
|
128
|
+
}
|
|
129
|
+
export interface OptimizationConfig {
|
|
130
|
+
/** 代码分割 */
|
|
131
|
+
codeSplitting: boolean;
|
|
132
|
+
/** 树摇优化 */
|
|
133
|
+
treeShaking: boolean;
|
|
134
|
+
/** 代码压缩 */
|
|
135
|
+
minification: boolean;
|
|
136
|
+
/** 资源压缩 */
|
|
137
|
+
compression: boolean;
|
|
138
|
+
/** 其他优化选项 */
|
|
139
|
+
others: string[];
|
|
140
|
+
}
|
|
141
|
+
export interface DeploymentConfiguration {
|
|
142
|
+
/** 部署平台 */
|
|
143
|
+
platform: string;
|
|
144
|
+
/** 部署类型 */
|
|
145
|
+
type: "static" | "server" | "serverless" | "container" | "hybrid";
|
|
146
|
+
/** 部署脚本 */
|
|
147
|
+
scripts: Record<string, string>;
|
|
148
|
+
/** 环境配置 */
|
|
149
|
+
environments: string[];
|
|
150
|
+
/** 部署配置文件 */
|
|
151
|
+
configFiles: string[];
|
|
152
|
+
}
|
|
153
|
+
export interface DetectionStats {
|
|
154
|
+
/** 总检测数量 */
|
|
155
|
+
totalDetected: number;
|
|
156
|
+
/** 各类型数量统计 */
|
|
157
|
+
byType: Record<TechnologyType, number>;
|
|
158
|
+
/** 各使用级别数量 */
|
|
159
|
+
byUsage: Record<UsageLevel, number>;
|
|
160
|
+
/** 各置信度区间数量 */
|
|
161
|
+
byConfidence: {
|
|
162
|
+
high: number;
|
|
163
|
+
medium: number;
|
|
164
|
+
low: number;
|
|
165
|
+
};
|
|
166
|
+
/** 检测耗时(毫秒) */
|
|
167
|
+
detectionTime: number;
|
|
168
|
+
/** 检测覆盖率 */
|
|
169
|
+
coverage: {
|
|
170
|
+
/** 扫描文件数 */
|
|
171
|
+
scannedFiles: number;
|
|
172
|
+
/** 总文件数 */
|
|
173
|
+
totalFiles: number;
|
|
174
|
+
/** 覆盖百分比 */
|
|
175
|
+
percentage: number;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
export interface TechStackRecommendation {
|
|
179
|
+
/** 建议ID */
|
|
180
|
+
id: string;
|
|
181
|
+
/** 建议类型 */
|
|
182
|
+
type: "upgrade" | "replace" | "add" | "remove" | "configure";
|
|
183
|
+
/** 目标技术 */
|
|
184
|
+
targetTechnology: string;
|
|
185
|
+
/** 当前技术(如果适用) */
|
|
186
|
+
currentTechnology?: string;
|
|
187
|
+
/** 建议原因 */
|
|
188
|
+
reason: string;
|
|
189
|
+
/** 优先级 */
|
|
190
|
+
priority: "high" | "medium" | "low";
|
|
191
|
+
/** 影响评估 */
|
|
192
|
+
impact: ImpactAssessment;
|
|
193
|
+
/** 实施步骤 */
|
|
194
|
+
implementationSteps: string[];
|
|
195
|
+
/** 预估成本 */
|
|
196
|
+
estimatedCost: "low" | "medium" | "high";
|
|
197
|
+
/** 预期收益 */
|
|
198
|
+
expectedBenefit: string[];
|
|
199
|
+
}
|
|
200
|
+
export interface ImpactAssessment {
|
|
201
|
+
/** 破坏性变更风险 */
|
|
202
|
+
breakingChangeRisk: "low" | "medium" | "high";
|
|
203
|
+
/** 影响的模块 */
|
|
204
|
+
affectedModules: string[];
|
|
205
|
+
/** 需要更新的文件 */
|
|
206
|
+
filesToUpdate: string[];
|
|
207
|
+
/** 学习成本 */
|
|
208
|
+
learningCurve: "easy" | "medium" | "hard";
|
|
209
|
+
/** 社区支持 */
|
|
210
|
+
communitySupport: "excellent" | "good" | "fair" | "poor";
|
|
211
|
+
/** 迁移复杂度 */
|
|
212
|
+
migrationComplexity: "simple" | "moderate" | "complex";
|
|
213
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|