super-dev 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. super_dev/__init__.py +11 -0
  2. super_dev/analyzer/__init__.py +34 -0
  3. super_dev/analyzer/analyzer.py +440 -0
  4. super_dev/analyzer/detectors.py +511 -0
  5. super_dev/analyzer/models.py +285 -0
  6. super_dev/cli.py +3257 -0
  7. super_dev/config/__init__.py +11 -0
  8. super_dev/config/frontend.py +557 -0
  9. super_dev/config/manager.py +281 -0
  10. super_dev/creators/__init__.py +26 -0
  11. super_dev/creators/creator.py +134 -0
  12. super_dev/creators/document_generator.py +2473 -0
  13. super_dev/creators/frontend_builder.py +371 -0
  14. super_dev/creators/implementation_builder.py +789 -0
  15. super_dev/creators/prompt_generator.py +289 -0
  16. super_dev/creators/requirement_parser.py +354 -0
  17. super_dev/creators/spec_builder.py +195 -0
  18. super_dev/deployers/__init__.py +20 -0
  19. super_dev/deployers/cicd.py +1269 -0
  20. super_dev/deployers/delivery.py +229 -0
  21. super_dev/deployers/migration.py +1032 -0
  22. super_dev/design/__init__.py +74 -0
  23. super_dev/design/aesthetics.py +530 -0
  24. super_dev/design/charts.py +396 -0
  25. super_dev/design/codegen.py +379 -0
  26. super_dev/design/engine.py +528 -0
  27. super_dev/design/generator.py +395 -0
  28. super_dev/design/landing.py +422 -0
  29. super_dev/design/tech_stack.py +524 -0
  30. super_dev/design/tokens.py +269 -0
  31. super_dev/design/ux_guide.py +391 -0
  32. super_dev/exceptions.py +119 -0
  33. super_dev/experts/__init__.py +19 -0
  34. super_dev/experts/service.py +161 -0
  35. super_dev/integrations/__init__.py +7 -0
  36. super_dev/integrations/manager.py +264 -0
  37. super_dev/orchestrator/__init__.py +12 -0
  38. super_dev/orchestrator/engine.py +958 -0
  39. super_dev/orchestrator/experts.py +423 -0
  40. super_dev/orchestrator/knowledge.py +352 -0
  41. super_dev/orchestrator/quality.py +356 -0
  42. super_dev/reviewers/__init__.py +17 -0
  43. super_dev/reviewers/code_review.py +471 -0
  44. super_dev/reviewers/quality_gate.py +964 -0
  45. super_dev/reviewers/redteam.py +881 -0
  46. super_dev/skills/__init__.py +7 -0
  47. super_dev/skills/manager.py +307 -0
  48. super_dev/specs/__init__.py +44 -0
  49. super_dev/specs/generator.py +264 -0
  50. super_dev/specs/manager.py +428 -0
  51. super_dev/specs/models.py +348 -0
  52. super_dev/specs/validator.py +415 -0
  53. super_dev/utils/__init__.py +11 -0
  54. super_dev/utils/logger.py +133 -0
  55. super_dev/web/api.py +1402 -0
  56. super_dev-2.0.0.dist-info/METADATA +252 -0
  57. super_dev-2.0.0.dist-info/RECORD +61 -0
  58. super_dev-2.0.0.dist-info/WHEEL +5 -0
  59. super_dev-2.0.0.dist-info/entry_points.txt +2 -0
  60. super_dev-2.0.0.dist-info/licenses/LICENSE +21 -0
  61. super_dev-2.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,371 @@
1
+ """
2
+ 前端骨架生成器 - 先交付可演示前端
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ import json
8
+ from pathlib import Path
9
+
10
+
11
+ class FrontendScaffoldBuilder:
12
+ """生成可直接打开的前端骨架页面"""
13
+
14
+ def __init__(
15
+ self,
16
+ project_dir: Path,
17
+ name: str,
18
+ description: str,
19
+ frontend: str = "react",
20
+ ):
21
+ self.project_dir = Path(project_dir).resolve()
22
+ self.name = name
23
+ self.description = description
24
+ self.frontend = frontend
25
+
26
+ def generate(
27
+ self,
28
+ requirements: list[dict],
29
+ phases: list[dict],
30
+ docs: dict,
31
+ ) -> dict:
32
+ """写入前端骨架文件并返回路径"""
33
+ output_dir = self.project_dir / "output" / "frontend"
34
+ output_dir.mkdir(parents=True, exist_ok=True)
35
+
36
+ html_path = output_dir / "index.html"
37
+ css_path = output_dir / "styles.css"
38
+ js_path = output_dir / "app.js"
39
+
40
+ html_path.write_text(self._build_html(), encoding="utf-8")
41
+ css_path.write_text(self._build_css(), encoding="utf-8")
42
+ js_path.write_text(self._build_js(requirements, phases, docs), encoding="utf-8")
43
+
44
+ return {
45
+ "html": str(html_path),
46
+ "css": str(css_path),
47
+ "js": str(js_path),
48
+ }
49
+
50
+ def _build_html(self) -> str:
51
+ return f"""<!doctype html>
52
+ <html lang="zh-CN">
53
+ <head>
54
+ <meta charset="UTF-8" />
55
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
56
+ <title>{self.name} · Frontend Blueprint</title>
57
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
58
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
59
+ <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Sora:wght@400;600;700&display=swap" rel="stylesheet" />
60
+ <link rel="stylesheet" href="./styles.css" />
61
+ </head>
62
+ <body>
63
+ <div class="bg-layer"></div>
64
+ <main class="shell">
65
+ <header class="hero">
66
+ <p class="eyebrow">Super Dev Frontend First Delivery</p>
67
+ <h1>{self.name}</h1>
68
+ <p class="summary">{self.description}</p>
69
+ <div class="meta">
70
+ <span>Framework: {self.frontend}</span>
71
+ <span>Mode: 需求文档驱动</span>
72
+ <span>Status: Ready</span>
73
+ </div>
74
+ </header>
75
+
76
+ <section class="card doc-hub">
77
+ <div class="section-head">
78
+ <h2>核心文档</h2>
79
+ <p>先完成文档,再以文档驱动实现。</p>
80
+ </div>
81
+ <div id="doc-links" class="doc-grid"></div>
82
+ </section>
83
+
84
+ <section class="card split">
85
+ <div>
86
+ <div class="section-head">
87
+ <h2>需求模块</h2>
88
+ <p>按需求生成页面和能力模块。</p>
89
+ </div>
90
+ <div id="requirements" class="chips"></div>
91
+ </div>
92
+ <div>
93
+ <div class="section-head">
94
+ <h2>执行路线</h2>
95
+ <p>从 0-1 到 1-N+1 的阶段推进。</p>
96
+ </div>
97
+ <ol id="timeline" class="timeline"></ol>
98
+ </div>
99
+ </section>
100
+
101
+ <section class="card">
102
+ <div class="section-head">
103
+ <h2>交付清单</h2>
104
+ <p>前端先行,随后进入系统化交付。</p>
105
+ </div>
106
+ <ul class="delivery-list">
107
+ <li>阶段 1: PRD / 架构 / UIUX 文档</li>
108
+ <li>阶段 2: 前端骨架与核心页面</li>
109
+ <li>阶段 3: 后端与数据库能力</li>
110
+ <li>阶段 4: 联调、测试、质量门禁</li>
111
+ <li>阶段 5: 发布、监控与迭代</li>
112
+ </ul>
113
+ </section>
114
+ </main>
115
+ <script src="./app.js"></script>
116
+ </body>
117
+ </html>
118
+ """
119
+
120
+ def _build_css(self) -> str:
121
+ return """
122
+ :root {
123
+ --bg-0: #f5f8ff;
124
+ --bg-1: #fff8f1;
125
+ --surface: rgba(255, 255, 255, 0.86);
126
+ --stroke: rgba(29, 42, 62, 0.12);
127
+ --text: #172133;
128
+ --muted: #51627a;
129
+ --primary: #0f7cfa;
130
+ --accent: #f65f22;
131
+ --radius: 18px;
132
+ --shadow: 0 18px 40px rgba(13, 33, 57, 0.09);
133
+ }
134
+
135
+ * {
136
+ box-sizing: border-box;
137
+ }
138
+
139
+ html,
140
+ body {
141
+ margin: 0;
142
+ padding: 0;
143
+ color: var(--text);
144
+ font-family: "Manrope", system-ui, sans-serif;
145
+ background: linear-gradient(130deg, var(--bg-0), var(--bg-1));
146
+ }
147
+
148
+ .bg-layer {
149
+ position: fixed;
150
+ inset: 0;
151
+ pointer-events: none;
152
+ background-image: radial-gradient(circle at 8% 10%, rgba(15, 124, 250, 0.2), transparent 35%),
153
+ radial-gradient(circle at 85% 12%, rgba(246, 95, 34, 0.2), transparent 28%),
154
+ radial-gradient(circle at 50% 100%, rgba(19, 173, 120, 0.12), transparent 34%);
155
+ }
156
+
157
+ .shell {
158
+ max-width: 1120px;
159
+ margin: 0 auto;
160
+ padding: 40px 20px 64px;
161
+ position: relative;
162
+ z-index: 1;
163
+ }
164
+
165
+ .hero {
166
+ padding: 28px 28px 26px;
167
+ border: 1px solid var(--stroke);
168
+ border-radius: var(--radius);
169
+ background: var(--surface);
170
+ box-shadow: var(--shadow);
171
+ backdrop-filter: blur(6px);
172
+ }
173
+
174
+ .eyebrow {
175
+ margin: 0;
176
+ color: var(--primary);
177
+ font-weight: 700;
178
+ letter-spacing: 0.08em;
179
+ text-transform: uppercase;
180
+ font-size: 12px;
181
+ }
182
+
183
+ .hero h1 {
184
+ margin: 10px 0 8px;
185
+ font-family: "Sora", sans-serif;
186
+ font-size: clamp(28px, 4vw, 48px);
187
+ }
188
+
189
+ .summary {
190
+ margin: 0 0 14px;
191
+ color: var(--muted);
192
+ }
193
+
194
+ .meta {
195
+ display: flex;
196
+ gap: 10px;
197
+ flex-wrap: wrap;
198
+ }
199
+
200
+ .meta span {
201
+ border-radius: 999px;
202
+ padding: 8px 12px;
203
+ background: rgba(15, 124, 250, 0.08);
204
+ color: #12438a;
205
+ font-size: 13px;
206
+ font-weight: 700;
207
+ }
208
+
209
+ .card {
210
+ margin-top: 18px;
211
+ border: 1px solid var(--stroke);
212
+ border-radius: var(--radius);
213
+ background: var(--surface);
214
+ box-shadow: var(--shadow);
215
+ padding: 22px;
216
+ }
217
+
218
+ .section-head h2 {
219
+ margin: 0;
220
+ font-size: 22px;
221
+ font-family: "Sora", sans-serif;
222
+ }
223
+
224
+ .section-head p {
225
+ margin: 6px 0 16px;
226
+ color: var(--muted);
227
+ }
228
+
229
+ .doc-grid {
230
+ display: grid;
231
+ gap: 12px;
232
+ grid-template-columns: repeat(3, minmax(0, 1fr));
233
+ }
234
+
235
+ .doc-item {
236
+ display: block;
237
+ text-decoration: none;
238
+ color: inherit;
239
+ border: 1px solid rgba(23, 33, 51, 0.1);
240
+ border-radius: 14px;
241
+ padding: 14px;
242
+ transition: transform 0.16s ease, box-shadow 0.16s ease;
243
+ background: #ffffff;
244
+ }
245
+
246
+ .doc-item:hover {
247
+ transform: translateY(-2px);
248
+ box-shadow: 0 8px 20px rgba(16, 34, 61, 0.12);
249
+ }
250
+
251
+ .doc-item b {
252
+ display: block;
253
+ margin-bottom: 8px;
254
+ }
255
+
256
+ .split {
257
+ display: grid;
258
+ grid-template-columns: repeat(2, minmax(0, 1fr));
259
+ gap: 20px;
260
+ }
261
+
262
+ .chips {
263
+ display: flex;
264
+ gap: 8px;
265
+ flex-wrap: wrap;
266
+ }
267
+
268
+ .chip {
269
+ border-radius: 999px;
270
+ padding: 7px 12px;
271
+ font-size: 13px;
272
+ background: rgba(246, 95, 34, 0.1);
273
+ color: #8a3719;
274
+ border: 1px solid rgba(246, 95, 34, 0.14);
275
+ }
276
+
277
+ .timeline {
278
+ margin: 0;
279
+ padding-left: 18px;
280
+ display: grid;
281
+ gap: 10px;
282
+ }
283
+
284
+ .timeline li {
285
+ padding-left: 4px;
286
+ }
287
+
288
+ .timeline b {
289
+ display: block;
290
+ }
291
+
292
+ .timeline p {
293
+ margin: 4px 0 0;
294
+ color: var(--muted);
295
+ font-size: 14px;
296
+ }
297
+
298
+ .delivery-list {
299
+ margin: 0;
300
+ padding-left: 18px;
301
+ display: grid;
302
+ gap: 8px;
303
+ }
304
+
305
+ @media (max-width: 860px) {
306
+ .doc-grid {
307
+ grid-template-columns: 1fr;
308
+ }
309
+
310
+ .split {
311
+ grid-template-columns: 1fr;
312
+ }
313
+ }
314
+ """
315
+
316
+ def _build_js(self, requirements: list[dict], phases: list[dict], docs: dict) -> str:
317
+ payload = {
318
+ "requirements": requirements,
319
+ "phases": phases,
320
+ "docs": docs,
321
+ }
322
+ payload_str = json.dumps(payload, ensure_ascii=False, indent=2)
323
+ return f"""const DATA = {payload_str};
324
+
325
+ const docContainer = document.getElementById("doc-links");
326
+ const reqContainer = document.getElementById("requirements");
327
+ const timelineContainer = document.getElementById("timeline");
328
+
329
+ const docList = [
330
+ {{ title: "PRD 文档", desc: "产品目标、需求边界、验收标准", path: DATA.docs.prd }},
331
+ {{ title: "架构文档", desc: "模块划分、接口契约、部署策略", path: DATA.docs.architecture }},
332
+ {{ title: "UI/UX 文档", desc: "视觉系统、交互规则、页面结构", path: DATA.docs.uiux }},
333
+ {{ title: "执行路线图", desc: "0-1 与 1-N+1 的分阶段推进", path: DATA.docs.plan }},
334
+ {{ title: "前端蓝图", desc: "前端模块拆分与先行交付策略", path: DATA.docs.frontend_blueprint }},
335
+ ];
336
+
337
+ for (const doc of docList) {{
338
+ if (!doc.path) continue;
339
+ const link = document.createElement("a");
340
+ link.className = "doc-item";
341
+ link.href = relativePath(doc.path);
342
+ link.target = "_blank";
343
+ link.rel = "noreferrer";
344
+ link.innerHTML = `<b>${{doc.title}}</b><span>${{doc.desc}}</span>`;
345
+ docContainer.appendChild(link);
346
+ }}
347
+
348
+ for (const req of DATA.requirements) {{
349
+ const chip = document.createElement("span");
350
+ chip.className = "chip";
351
+ chip.textContent = `${{req.spec_name}} · ${{req.req_name}}`;
352
+ reqContainer.appendChild(chip);
353
+ }}
354
+
355
+ for (const phase of DATA.phases) {{
356
+ const li = document.createElement("li");
357
+ li.innerHTML = `<b>${{phase.title}}</b><p>${{phase.objective}}</p>`;
358
+ timelineContainer.appendChild(li);
359
+ }}
360
+
361
+ function relativePath(path) {{
362
+ if (!path) return "#";
363
+ const normalized = String(path).replace(/\\\\/g, "/");
364
+ const marker = "/output/";
365
+ const index = normalized.lastIndexOf(marker);
366
+ if (index >= 0) {{
367
+ return ".." + normalized.slice(index + marker.length - 1);
368
+ }}
369
+ return "#";
370
+ }}
371
+ """