@design-ai/cli 4.55.0 → 4.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +39 -0
  3. package/README.ko.md +7 -7
  4. package/README.md +9 -9
  5. package/cli/lib/mcp-server.mjs +208 -10
  6. package/cli/lib/site-analysis.mjs +297 -0
  7. package/cli/lib/site-args.mjs +433 -0
  8. package/cli/lib/site-bundle-build.mjs +127 -0
  9. package/cli/lib/site-bundle-check.mjs +454 -0
  10. package/cli/lib/site-bundle-commands.mjs +95 -0
  11. package/cli/lib/site-bundle-compare.mjs +157 -0
  12. package/cli/lib/site-bundle-contract.mjs +79 -0
  13. package/cli/lib/site-bundle-files.mjs +87 -0
  14. package/cli/lib/site-bundle-handoff-runbook-actions.mjs +113 -0
  15. package/cli/lib/site-bundle-handoff-runbook-evidence-fields.mjs +164 -0
  16. package/cli/lib/site-bundle-handoff-runbook-evidence.mjs +334 -0
  17. package/cli/lib/site-bundle-handoff-runbook-format.mjs +31 -0
  18. package/cli/lib/site-bundle-handoff-runbook-stage-metadata.mjs +84 -0
  19. package/cli/lib/site-bundle-handoff-runbook.mjs +1331 -0
  20. package/cli/lib/site-bundle-handoff-summary.mjs +183 -0
  21. package/cli/lib/site-bundle-handoff.mjs +271 -0
  22. package/cli/lib/site-bundle-readme.mjs +98 -0
  23. package/cli/lib/site-bundle-repair-report.mjs +143 -0
  24. package/cli/lib/site-bundle-repair.mjs +68 -0
  25. package/cli/lib/site-content.mjs +399 -0
  26. package/cli/lib/site-evidence.mjs +35 -0
  27. package/cli/lib/site-mcp-commands.mjs +28 -0
  28. package/cli/lib/site-mcp-probes.mjs +159 -0
  29. package/cli/lib/site-mcp-readiness.mjs +157 -0
  30. package/cli/lib/site-mcp-report.mjs +324 -0
  31. package/cli/lib/site-next-actions.mjs +333 -0
  32. package/cli/lib/site-options.mjs +104 -0
  33. package/cli/lib/site-prompts.mjs +332 -0
  34. package/cli/lib/site-starter.mjs +153 -0
  35. package/cli/lib/site-strings.mjs +23 -0
  36. package/cli/lib/site-tasks.mjs +93 -0
  37. package/cli/lib/site-workflow-graph.mjs +309 -0
  38. package/cli/lib/site-workspace.mjs +492 -0
  39. package/cli/lib/site.mjs +108 -6617
  40. package/docs/DISTRIBUTION.ko.md +35 -6
  41. package/docs/DISTRIBUTION.md +35 -8
  42. package/docs/RELEASE-CHECKLIST.md +20 -3
  43. package/docs/ROADMAP.md +2179 -0
  44. package/docs/external-status.md +22 -7
  45. package/docs/integrations/design-ai-mcp-server.md +32 -0
  46. package/docs/integrations/vscode-walkthrough.ko.md +3 -3
  47. package/docs/integrations/vscode-walkthrough.md +3 -3
  48. package/docs/site-overrides/main.html +1 -1
  49. package/package.json +1 -1
  50. package/tools/audit/package-smoke.py +106 -0
  51. package/tools/audit/registry-smoke.py +378 -10
  52. package/tools/audit/smoke_assertions.py +83 -22
@@ -0,0 +1,143 @@
1
+ // Repair report orchestration for Website Improvement handoff bundles.
2
+
3
+ import path from "node:path";
4
+
5
+ import {
6
+ addIssue,
7
+ analyzeSiteWorkspace,
8
+ loadSiteWorkspaceInput,
9
+ statusFromIssues,
10
+ } from "./site-analysis.mjs";
11
+ import { buildSiteHandoffBundle } from "./site-bundle-build.mjs";
12
+ import { buildSiteBundleCheckReport } from "./site-bundle-check.mjs";
13
+ import {
14
+ formatBundleRepairGuidanceLines,
15
+ summarizeBundleRepairCheck,
16
+ } from "./site-bundle-repair.mjs";
17
+
18
+ function buildSiteBundleRepairReportFromChecks({
19
+ beforeReport,
20
+ afterReport = null,
21
+ written = null,
22
+ applied = false,
23
+ } = {}) {
24
+ const issues = [];
25
+ const repairGuidance = beforeReport.repairGuidance;
26
+
27
+ if (!repairGuidance.available) {
28
+ addIssue(issues, "fail", "bundle-repair-unavailable", repairGuidance.reason);
29
+ } else if (!applied) {
30
+ addIssue(issues, "pass", "bundle-repair-preview-ready", "Bundle repair preview is ready; run again with --yes to rewrite the handoff bundle directory");
31
+ } else if (!afterReport || afterReport.status !== "pass") {
32
+ addIssue(issues, "fail", "bundle-repair-verify-fail", "Bundle repair applied, but the repaired bundle did not pass bundle-check verification");
33
+ } else {
34
+ addIssue(issues, "pass", "bundle-repair-applied", "Bundle repair applied and the regenerated bundle passed local bundle-check verification");
35
+ }
36
+
37
+ const status = statusFromIssues(issues);
38
+ return {
39
+ directory: beforeReport.directory,
40
+ workspaceFile: path.join(beforeReport.directory, "website-workspace.tasks.json"),
41
+ dryRun: !applied,
42
+ applied,
43
+ valid: status !== "fail",
44
+ status,
45
+ repairGuidance,
46
+ before: summarizeBundleRepairCheck(beforeReport),
47
+ after: afterReport ? summarizeBundleRepairCheck(afterReport) : null,
48
+ written: written ? {
49
+ directory: written.directory,
50
+ files: written.files,
51
+ count: written.files.length,
52
+ } : null,
53
+ issues,
54
+ };
55
+ }
56
+
57
+ export function buildSiteBundleRepairPreview({
58
+ target,
59
+ cwd = process.cwd(),
60
+ } = {}) {
61
+ const beforeReport = buildSiteBundleCheckReport({ target, cwd });
62
+ return buildSiteBundleRepairReportFromChecks({ beforeReport });
63
+ }
64
+
65
+ export function buildSiteBundleRepairBundle({
66
+ target,
67
+ cwd = process.cwd(),
68
+ } = {}) {
69
+ const beforeReport = buildSiteBundleCheckReport({ target, cwd });
70
+ const preview = buildSiteBundleRepairReportFromChecks({ beforeReport });
71
+ if (!preview.repairGuidance.available) {
72
+ return {
73
+ preview,
74
+ beforeReport,
75
+ bundle: null,
76
+ };
77
+ }
78
+
79
+ const input = loadSiteWorkspaceInput({
80
+ target: preview.workspaceFile,
81
+ cwd,
82
+ });
83
+ const analyzed = analyzeSiteWorkspace(input.raw, { filePath: input.filePath });
84
+ const bundle = buildSiteHandoffBundle(analyzed.workspace, analyzed.summary);
85
+ return {
86
+ preview,
87
+ beforeReport,
88
+ bundle,
89
+ };
90
+ }
91
+
92
+ export function buildSiteBundleRepairAppliedReport({
93
+ beforeReport,
94
+ written,
95
+ cwd = process.cwd(),
96
+ } = {}) {
97
+ const afterReport = buildSiteBundleCheckReport({
98
+ target: beforeReport.directory,
99
+ cwd,
100
+ });
101
+ return buildSiteBundleRepairReportFromChecks({
102
+ beforeReport,
103
+ afterReport,
104
+ written,
105
+ applied: true,
106
+ });
107
+ }
108
+
109
+ export function formatSiteBundleRepairJson(report) {
110
+ return JSON.stringify(report, null, 2);
111
+ }
112
+
113
+ export function formatSiteBundleRepairHuman(report) {
114
+ const afterLines = report.after ? [
115
+ `After status: ${report.after.status}`,
116
+ `After generated drift files: ${report.after.generatedDriftFiles.length ? report.after.generatedDriftFiles.join(", ") : "none"}`,
117
+ `After bundle digest: ${report.after.checksumBundleDigest || "not recorded"}`,
118
+ ] : [
119
+ "After status: not applied",
120
+ ];
121
+ return [
122
+ `Website Improvement handoff bundle repair: ${report.directory}`,
123
+ "",
124
+ `Status: ${report.status}`,
125
+ `Dry run: ${report.dryRun ? "yes" : "no"}`,
126
+ `Applied: ${report.applied ? "yes" : "no"}`,
127
+ `Workspace: ${report.workspaceFile}`,
128
+ `Before status: ${report.before.status}`,
129
+ `Before generated drift files: ${report.before.generatedDriftFiles.length ? report.before.generatedDriftFiles.join(", ") : "none"}`,
130
+ `Before bundle digest: ${report.before.checksumBundleDigest || "not recorded"}`,
131
+ ...afterLines,
132
+ ...(report.written ? [
133
+ `Written directory: ${report.written.directory}`,
134
+ `Written files: ${report.written.count}`,
135
+ ] : []),
136
+ "",
137
+ "Repair guidance:",
138
+ ...formatBundleRepairGuidanceLines(report.repairGuidance),
139
+ "",
140
+ "Issues:",
141
+ ...report.issues.map((issue) => `- [${issue.level}] ${issue.id}: ${issue.message}`),
142
+ ].join("\n");
143
+ }
@@ -0,0 +1,68 @@
1
+ // Repair guidance helpers for Website Improvement handoff bundles.
2
+
3
+ import {
4
+ existsSync,
5
+ statSync,
6
+ } from "node:fs";
7
+ import path from "node:path";
8
+
9
+ import { shellQuote } from "./site-bundle-commands.mjs";
10
+
11
+ export function buildBundleRepairGuidance(directory, generatedContract) {
12
+ const workspacePath = path.join(directory, "website-workspace.tasks.json");
13
+ const reportBaseName = path.basename(directory);
14
+ const reportDirectory = path.dirname(directory);
15
+ const previewReportPath = path.join(reportDirectory, `${reportBaseName}-repair-preview.json`);
16
+ const appliedReportPath = path.join(reportDirectory, `${reportBaseName}-repair-applied.json`);
17
+ const hasWorkspace = existsSync(workspacePath) && statSync(workspacePath).isFile();
18
+ const available = Boolean(generatedContract.available && hasWorkspace);
19
+ return {
20
+ available,
21
+ reason: available
22
+ ? "Regenerate the bundle from its embedded website-workspace.tasks.json when generated contract drift is reported."
23
+ : "Repair guidance requires a readable website-workspace.tasks.json and generated contract analysis.",
24
+ command: available ? `design-ai site ${shellQuote(workspacePath)} --bundle --out ${shellQuote(directory)} --force` : "",
25
+ previewCommand: available ? `design-ai site ${shellQuote(directory)} --bundle-repair --json` : "",
26
+ applyCommand: available ? `design-ai site ${shellQuote(directory)} --bundle-repair --yes --json` : "",
27
+ previewReportCommand: available ? `design-ai site ${shellQuote(directory)} --bundle-repair --json --out ${shellQuote(previewReportPath)}` : "",
28
+ applyReportCommand: available ? `design-ai site ${shellQuote(directory)} --bundle-repair --yes --json --out ${shellQuote(appliedReportPath)}` : "",
29
+ verifyCommand: available ? `design-ai site ${shellQuote(directory)} --bundle-check --strict --json` : "",
30
+ mutates: available ? "handoff-bundle-directory-only" : "none",
31
+ targetRepoMutation: false,
32
+ externalCalls: false,
33
+ };
34
+ }
35
+
36
+ export function formatBundleRepairGuidanceLines(repairGuidance) {
37
+ if (!repairGuidance.available) {
38
+ return [
39
+ `- Available: no`,
40
+ `- Reason: ${repairGuidance.reason}`,
41
+ ];
42
+ }
43
+ return [
44
+ "- Available: yes",
45
+ `- Reason: ${repairGuidance.reason}`,
46
+ `- Regenerate: ${repairGuidance.command}`,
47
+ `- Preview repair: ${repairGuidance.previewCommand}`,
48
+ `- Apply repair: ${repairGuidance.applyCommand}`,
49
+ `- Preview report: ${repairGuidance.previewReportCommand}`,
50
+ `- Apply report: ${repairGuidance.applyReportCommand}`,
51
+ `- Verify: ${repairGuidance.verifyCommand}`,
52
+ `- Scope: ${repairGuidance.mutates}; target repo mutation ${repairGuidance.targetRepoMutation ? "yes" : "no"}; external calls ${repairGuidance.externalCalls ? "yes" : "no"}`,
53
+ ];
54
+ }
55
+
56
+ export function summarizeBundleRepairCheck(report) {
57
+ return {
58
+ status: report.status,
59
+ valid: report.valid,
60
+ checksumBundleDigest: report.summary.checksumBundleDigest || "",
61
+ checksumFailures: report.counts.checksumFailures,
62
+ generatedFailures: report.counts.generatedFailures,
63
+ verifiedGeneratedFiles: report.counts.verifiedGeneratedFiles,
64
+ expectedGeneratedFiles: report.counts.expectedGeneratedFiles,
65
+ generatedDriftFiles: [...report.generatedContract.driftFiles],
66
+ issueCount: report.issues.length,
67
+ };
68
+ }
@@ -0,0 +1,399 @@
1
+ // Static Website Improvement content catalogs shared by the site CLI helpers.
2
+
3
+ export const SITE_INTAKE_TEMPLATE_SECTIONS = [
4
+ "site-profile",
5
+ "priority-pages",
6
+ "primary-user-flows",
7
+ "brand-and-content-notes",
8
+ "mcp-readiness-notes",
9
+ "initial-audit-findings",
10
+ "first-bundle-commands",
11
+ "target-repo-verification-plan",
12
+ "stop-conditions",
13
+ ];
14
+
15
+ export const SITE_INTAKE_TEMPLATE_MARKDOWN = `# Company Website Intake Template
16
+
17
+ Fill this template before the first Website Improvement dogfood pass. Keep sensitive credentials, private tokens, production secrets, and customer data out of this document.
18
+
19
+ ## Site Profile
20
+
21
+ | Field | Value |
22
+ |---|---|
23
+ | Site name | |
24
+ | Live URL | |
25
+ | Target repo URL | |
26
+ | Target repo local path | |
27
+ | Figma URL | |
28
+ | Deploy provider | \`vercel\` / \`netlify\` / \`cloudflare\` / \`other\` / \`none\` |
29
+ | Sentry project | |
30
+ | CMS | \`sanity\` / \`contentful\` / \`wordpress\` / \`shopify\` / \`none\` / \`other\` |
31
+ | Database | \`supabase\` / \`neon\` / \`postgres\` / \`none\` / \`other\` |
32
+
33
+ ## Priority Pages
34
+
35
+ List 2-5 pages for the first pilot. Start with pages that affect conversion, trust, signup, inquiry, purchase, or onboarding.
36
+
37
+ | Priority | Path or URL | Why it matters |
38
+ |---:|---|---|
39
+ | 1 | \`/\` | |
40
+ | 2 | | |
41
+ | 3 | | |
42
+ | 4 | | |
43
+ | 5 | | |
44
+
45
+ ## Primary User Flows
46
+
47
+ | Priority | Flow | Success signal |
48
+ |---:|---|---|
49
+ | 1 | | |
50
+ | 2 | | |
51
+ | 3 | | |
52
+
53
+ ## Brand And Content Notes
54
+
55
+ | Area | Notes |
56
+ |---|---|
57
+ | Brand tone | |
58
+ | Typography constraints | |
59
+ | Color constraints | |
60
+ | Korean copy rules | |
61
+ | Legal or compliance copy | |
62
+ | Trust signals | |
63
+ | Competitors or references | |
64
+
65
+ ## MCP Readiness Notes
66
+
67
+ Mark each external system as \`required\`, \`optional\`, \`unused\`, or \`unavailable\`.
68
+
69
+ | System | Status | Evidence or fallback |
70
+ |---|---|---|
71
+ | GitHub | | |
72
+ | Figma | | |
73
+ | Browser / Playwright | | |
74
+ | Chrome DevTools | | |
75
+ | Deploy provider | | |
76
+ | Sentry | | |
77
+ | Database | | |
78
+ | CMS | | |
79
+ | Collaboration tool | | |
80
+ | Research tool | | |
81
+
82
+ ## Initial Audit Findings
83
+
84
+ Capture only findings that are grounded in inspection. Do not invent Lighthouse, axe, crawler, or analytics results unless those tools were actually run in the target repo or browser.
85
+
86
+ | Category | Finding | Evidence | Page |
87
+ |---|---|---|---|
88
+ | Visual design | | | |
89
+ | UX flow | | | |
90
+ | Responsive | | | |
91
+ | Accessibility | | | |
92
+ | Performance | | | |
93
+ | SEO | | | |
94
+ | Technical quality | | | |
95
+ | Runtime issues | | | |
96
+ | Content quality | | | |
97
+
98
+ ## First Bundle Commands
99
+
100
+ Replace placeholders and run from the \`design-ai\` repository.
101
+
102
+ \`\`\`bash
103
+ design-ai site --init \\
104
+ --name "<site name>" \\
105
+ --live-url <live-url> \\
106
+ --local-path <absolute-target-repo-path> \\
107
+ --page / \\
108
+ --page <priority-page-2> \\
109
+ --flow "<primary user flow>" \\
110
+ --next-actions \\
111
+ --out website-next-actions.md \\
112
+ --force
113
+ \`\`\`
114
+
115
+ \`\`\`bash
116
+ design-ai site --init \\
117
+ --name "<site name>" \\
118
+ --live-url <live-url> \\
119
+ --local-path <absolute-target-repo-path> \\
120
+ --page / \\
121
+ --page <priority-page-2> \\
122
+ --flow "<primary user flow>" \\
123
+ --bundle \\
124
+ --out website-handoff-bundle \\
125
+ --strict \\
126
+ --force
127
+ \`\`\`
128
+
129
+ \`\`\`bash
130
+ design-ai site website-handoff-bundle --bundle-check --strict --json --out website-bundle-check.json --force
131
+ design-ai site website-handoff-bundle --bundle-handoff --strict --out target-repo-handoff.md --force
132
+ \`\`\`
133
+
134
+ ## Target Repo Verification Plan
135
+
136
+ Fill this before implementation so the target-repo agent has a clear quality gate.
137
+
138
+ | Gate | Command or manual check | Required for pilot |
139
+ |---|---|---:|
140
+ | Install | | yes |
141
+ | Lint | | yes |
142
+ | Typecheck | | if available |
143
+ | Unit tests | | if available |
144
+ | Build | | yes |
145
+ | Browser smoke | | yes |
146
+ | Accessibility spot check | | yes |
147
+ | Deployment preview | | if available |
148
+
149
+ ## Stop Conditions
150
+
151
+ Stop before target-repo edits when any answer is unclear:
152
+
153
+ - Which repo and branch should be modified?
154
+ - Which single task should be implemented first?
155
+ - Which verification commands must pass?
156
+ - Which credentials or production systems are off limits?
157
+ - Where should implementation evidence be recorded after the target-repo pass?
158
+ `;
159
+
160
+ export const SITE_INTAKE_TEMPLATE_MARKDOWN_KO = `# 회사 웹사이트 Intake Template
161
+
162
+ 첫 Website Improvement dogfood 전에 이 template을 채웁니다. 민감한 credential, private token, production secret, 고객 데이터는 이 문서에 적지 않습니다.
163
+
164
+ ## Site Profile
165
+
166
+ | 항목 | 값 |
167
+ |---|---|
168
+ | 사이트 이름 | |
169
+ | Live URL | |
170
+ | 대상 repo URL | |
171
+ | 대상 repo local path | |
172
+ | Figma URL | |
173
+ | 배포 플랫폼 | \`vercel\` / \`netlify\` / \`cloudflare\` / \`other\` / \`none\` |
174
+ | Sentry 프로젝트 | |
175
+ | CMS | \`sanity\` / \`contentful\` / \`wordpress\` / \`shopify\` / \`none\` / \`other\` |
176
+ | Database | \`supabase\` / \`neon\` / \`postgres\` / \`none\` / \`other\` |
177
+
178
+ ## 우선순위 페이지
179
+
180
+ 첫 pilot에서는 2-5개 페이지를 고릅니다. 전환, 신뢰, 가입, 문의, 구매, 온보딩에 영향을 주는 페이지부터 시작합니다.
181
+
182
+ | 우선순위 | Path 또는 URL | 중요한 이유 |
183
+ |---:|---|---|
184
+ | 1 | \`/\` | |
185
+ | 2 | | |
186
+ | 3 | | |
187
+ | 4 | | |
188
+ | 5 | | |
189
+
190
+ ## 주요 사용자 흐름
191
+
192
+ | 우선순위 | Flow | 성공 신호 |
193
+ |---:|---|---|
194
+ | 1 | | |
195
+ | 2 | | |
196
+ | 3 | | |
197
+
198
+ ## Brand And Content Notes
199
+
200
+ | 영역 | 메모 |
201
+ |---|---|
202
+ | 브랜드 톤 | |
203
+ | 타이포그래피 제약 | |
204
+ | 컬러 제약 | |
205
+ | 한국어 카피 규칙 | |
206
+ | 법무 또는 compliance 문구 | |
207
+ | 신뢰 요소 | |
208
+ | 경쟁사 또는 레퍼런스 | |
209
+
210
+ ## MCP Readiness Notes
211
+
212
+ 각 외부 시스템을 \`required\`, \`optional\`, \`unused\`, \`unavailable\` 중 하나로 표시합니다.
213
+
214
+ | 시스템 | 상태 | 근거 또는 fallback |
215
+ |---|---|---|
216
+ | GitHub | | |
217
+ | Figma | | |
218
+ | Browser / Playwright | | |
219
+ | Chrome DevTools | | |
220
+ | 배포 플랫폼 | | |
221
+ | Sentry | | |
222
+ | Database | | |
223
+ | CMS | | |
224
+ | 협업 도구 | | |
225
+ | 리서치 도구 | | |
226
+
227
+ ## 초기 Audit Findings
228
+
229
+ 실제로 확인한 finding만 기록합니다. Lighthouse, axe, crawler, analytics를 실제로 실행하지 않았다면 해당 결과를 만들어 쓰지 않습니다.
230
+
231
+ | Category | Finding | Evidence | Page |
232
+ |---|---|---|---|
233
+ | Visual design | | | |
234
+ | UX flow | | | |
235
+ | Responsive | | | |
236
+ | Accessibility | | | |
237
+ | Performance | | | |
238
+ | SEO | | | |
239
+ | Technical quality | | | |
240
+ | Runtime issues | | | |
241
+ | Content quality | | | |
242
+
243
+ ## 첫 Bundle Commands
244
+
245
+ placeholder를 바꾼 뒤 \`design-ai\` repo에서 실행합니다.
246
+
247
+ \`\`\`bash
248
+ design-ai site --init \\
249
+ --name "<site name>" \\
250
+ --live-url <live-url> \\
251
+ --local-path <absolute-target-repo-path> \\
252
+ --page / \\
253
+ --page <priority-page-2> \\
254
+ --flow "<primary user flow>" \\
255
+ --next-actions \\
256
+ --out website-next-actions.md \\
257
+ --force
258
+ \`\`\`
259
+
260
+ \`\`\`bash
261
+ design-ai site --init \\
262
+ --name "<site name>" \\
263
+ --live-url <live-url> \\
264
+ --local-path <absolute-target-repo-path> \\
265
+ --page / \\
266
+ --page <priority-page-2> \\
267
+ --flow "<primary user flow>" \\
268
+ --bundle \\
269
+ --out website-handoff-bundle \\
270
+ --strict \\
271
+ --force
272
+ \`\`\`
273
+
274
+ \`\`\`bash
275
+ design-ai site website-handoff-bundle --bundle-check --strict --json --out website-bundle-check.json --force
276
+ design-ai site website-handoff-bundle --bundle-handoff --strict --out target-repo-handoff.md --force
277
+ \`\`\`
278
+
279
+ ## Target Repo Verification Plan
280
+
281
+ 구현 전에 채워서 target-repo agent가 명확한 quality gate를 갖게 합니다.
282
+
283
+ | Gate | 명령 또는 수동 확인 | Pilot 필수 |
284
+ |---|---|---:|
285
+ | Install | | 예 |
286
+ | Lint | | 예 |
287
+ | Typecheck | | 가능하면 |
288
+ | Unit tests | | 가능하면 |
289
+ | Build | | 예 |
290
+ | Browser smoke | | 예 |
291
+ | Accessibility spot check | | 예 |
292
+ | Deployment preview | | 가능하면 |
293
+
294
+ ## Stop Conditions
295
+
296
+ 아래 질문 중 하나라도 불명확하면 target repo 수정 전에 멈춥니다.
297
+
298
+ - 어떤 repo와 branch를 수정해야 하는가?
299
+ - 첫 번째로 구현할 single task는 무엇인가?
300
+ - 어떤 verification command가 반드시 통과해야 하는가?
301
+ - 어떤 credential 또는 production system이 off limits인가?
302
+ - target-repo pass 이후 implementation evidence를 어디에 기록해야 하는가?
303
+ `;
304
+
305
+ export const SITE_PROMPT_TEMPLATE_IDS = [
306
+ "codex-repo-intake",
307
+ "codex-implementation",
308
+ "codex-visual-qa",
309
+ "codex-deployment",
310
+ "claude-design-review",
311
+ "claude-competitor",
312
+ "claude-copy-ux",
313
+ "handoff-report",
314
+ ];
315
+
316
+ export const SITE_BUNDLE_FILES = [
317
+ "README.md",
318
+ "summary.json",
319
+ "website-workspace.tasks.json",
320
+ "mcp-check.json",
321
+ "mcp-probes.json",
322
+ "mcp-action-plan.md",
323
+ "website-handoff.md",
324
+ "website-prompts.md",
325
+ "codex-implementation.md",
326
+ ];
327
+
328
+ export const SITE_BUNDLE_CHECKSUM_FILES = SITE_BUNDLE_FILES.filter((filePath) => filePath !== "summary.json");
329
+
330
+ export const SITE_PROMPT_TEMPLATES = [
331
+ {
332
+ id: "codex-repo-intake",
333
+ label: "Codex repo intake",
334
+ agent: "codex",
335
+ output: "Repository inspection plan",
336
+ description: "Inspect the target website repo and return structure, likely touch points, risks, and verification commands.",
337
+ taskSelectable: false,
338
+ },
339
+ {
340
+ id: "codex-implementation",
341
+ label: "Codex implementation",
342
+ agent: "codex",
343
+ output: "Focused implementation prompt",
344
+ description: "Implement the selected website improvement task in the target repo with scoped verification.",
345
+ taskSelectable: true,
346
+ },
347
+ {
348
+ id: "codex-visual-qa",
349
+ label: "Codex visual QA",
350
+ agent: "codex",
351
+ output: "Browser/Playwright QA checklist",
352
+ description: "Verify priority pages across configured viewports for layout, focus, console, and asset issues.",
353
+ taskSelectable: false,
354
+ },
355
+ {
356
+ id: "codex-deployment",
357
+ label: "Codex deployment verification",
358
+ agent: "codex",
359
+ output: "Deployment verification prompt",
360
+ description: "Check preview or production deployment, logs, metadata, user flows, and remaining launch risks.",
361
+ taskSelectable: false,
362
+ },
363
+ {
364
+ id: "claude-design-review",
365
+ label: "Claude design review",
366
+ agent: "claude",
367
+ output: "Senior design critique",
368
+ description: "Review visual hierarchy, layout rhythm, typography, CTA clarity, responsive behavior, and accessibility concerns.",
369
+ taskSelectable: false,
370
+ },
371
+ {
372
+ id: "claude-competitor",
373
+ label: "Claude competitor research",
374
+ agent: "claude",
375
+ output: "Competitor opportunity map",
376
+ description: "Compare relevant peer sites for structure, conversion path, proof, pricing, tone, content, and SEO positioning.",
377
+ taskSelectable: false,
378
+ },
379
+ {
380
+ id: "claude-copy-ux",
381
+ label: "Claude copy/UX critique",
382
+ agent: "claude",
383
+ output: "Copy and UX improvement notes",
384
+ description: "Critique copy, information architecture, trust signals, CTA language, and conversion flow.",
385
+ taskSelectable: false,
386
+ },
387
+ {
388
+ id: "handoff-report",
389
+ label: "Final handoff report",
390
+ agent: "codex-or-claude",
391
+ output: "Final handoff report prompt",
392
+ description: "Generate a final report covering target site info, audit summary, recommendations, executed work, verification, risks, and next actions.",
393
+ taskSelectable: false,
394
+ },
395
+ ];
396
+
397
+ if (SITE_PROMPT_TEMPLATE_IDS.join("\n") !== SITE_PROMPT_TEMPLATES.map((template) => template.id).join("\n")) {
398
+ throw new Error("SITE_PROMPT_TEMPLATES must match SITE_PROMPT_TEMPLATE_IDS order");
399
+ }
@@ -0,0 +1,35 @@
1
+ // Implementation evidence helpers for Website Improvement workspaces.
2
+
3
+ import { normalizeStringArray } from "./site-strings.mjs";
4
+
5
+ export const IMPLEMENTATION_EVIDENCE_KEYS = ["executedWork", "verificationResults", "remainingRisks", "nextActions"];
6
+
7
+ export const DEFAULT_IMPLEMENTATION_RISKS = [
8
+ "MCP readiness gaps may limit verification depth.",
9
+ "Copy or brand changes may require stakeholder review.",
10
+ "Automated performance/accessibility tooling is outside this MVP unless run in the target repo.",
11
+ ];
12
+
13
+ function normalizeObject(value) {
14
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
15
+ }
16
+
17
+ export function normalizeImplementationEvidence(value) {
18
+ const source = normalizeObject(value);
19
+ return {
20
+ executedWork: normalizeStringArray(source.executedWork),
21
+ verificationResults: normalizeStringArray(source.verificationResults),
22
+ remainingRisks: normalizeStringArray(source.remainingRisks, DEFAULT_IMPLEMENTATION_RISKS),
23
+ nextActions: normalizeStringArray(source.nextActions),
24
+ };
25
+ }
26
+
27
+ export function countImplementationEvidence(value = {}) {
28
+ const source = normalizeObject(value);
29
+ return Object.fromEntries(IMPLEMENTATION_EVIDENCE_KEYS.map((key) => {
30
+ const items = source[key];
31
+ if (Array.isArray(items)) return [key, items.length];
32
+ if (Number.isInteger(items) && items >= 0) return [key, items];
33
+ return [key, 0];
34
+ }));
35
+ }
@@ -0,0 +1,28 @@
1
+ // Command helpers for Website Improvement MCP readiness flows.
2
+
3
+ export function siteMcpCommandTarget(filePath) {
4
+ return filePath === "stdin" ? "<workspace.json>" : filePath;
5
+ }
6
+
7
+ export function buildSiteMcpProbeCommandSet(commandTarget) {
8
+ return {
9
+ mcpCheckProbesHumanOut: `design-ai site ${commandTarget} --mcp-check --probes --out mcp-check-probes.txt`,
10
+ mcpCheckProbesJsonOut: `design-ai site ${commandTarget} --mcp-check --probes --json --out mcp-check-probes.json`,
11
+ mcpPlanProbesJson: `design-ai site ${commandTarget} --mcp-plan --probes --json`,
12
+ mcpPlanProbesJsonOut: `design-ai site ${commandTarget} --mcp-plan --probes --json --out mcp-action-plan-probes.json`,
13
+ };
14
+ }
15
+
16
+ export function buildSiteNextActionCommandSet(commandTarget) {
17
+ return {
18
+ summary: `design-ai site ${commandTarget} --json`,
19
+ mcpCheck: `design-ai site ${commandTarget} --mcp-check --strict --json`,
20
+ mcpPlan: `design-ai site ${commandTarget} --mcp-plan --out mcp-action-plan.md`,
21
+ mcpCheckProbes: `design-ai site ${commandTarget} --mcp-check --probes --json --out mcp-check-probes.json`,
22
+ mcpPlanProbes: `design-ai site ${commandTarget} --mcp-plan --probes --json --out mcp-action-plan-probes.json`,
23
+ tasks: `design-ai site ${commandTarget} --tasks --out website-workspace.tasks.json`,
24
+ implementationPrompt: `design-ai site ${commandTarget} --prompt codex-implementation --task 1 --out codex-implementation.md`,
25
+ handoffReport: `design-ai site ${commandTarget} --report --out website-handoff.md`,
26
+ handoffBundle: `design-ai site ${commandTarget} --bundle --out website-handoff-bundle`,
27
+ };
28
+ }