Skip to content

Commit eebffc6

Browse files
committed
update sitemap structure: add messages
1 parent d4a1d1e commit eebffc6

File tree

1 file changed

+40
-2
lines changed
  • backend/src/build-system/handlers/ux/sitemap-structure

1 file changed

+40
-2
lines changed

backend/src/build-system/handlers/ux/sitemap-structure/index.ts

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ModelProvider } from 'src/common/model-provider';
44
import { prompts } from './prompt';
55
import { Logger } from '@nestjs/common';
66
import { removeCodeBlockFences } from 'src/build-system/utils/strings';
7+
import { MessageInterface } from 'src/common/model-provider/types';
78

89
// UXSMS: UX Sitemap Structure
910
export class UXSitemapStructureHandler implements BuildHandler<string> {
@@ -27,13 +28,50 @@ export class UXSitemapStructureHandler implements BuildHandler<string> {
2728

2829
const prompt = prompts.generateUXSiteMapStructrePrompt(
2930
projectName,
30-
sitemapDoc,
3131
'web', // TODO: Change platform dynamically if necessary
3232
);
3333

34+
const messages: MessageInterface[] = [
35+
{
36+
role: 'system',
37+
content: prompt,
38+
},
39+
{
40+
role: 'user',
41+
content: `
42+
Here is the UX Sitemap Documentation (SMD):
43+
44+
${sitemapDoc}
45+
46+
Please generate the Full UX Sitemap Structre now, focusing on MVP features but ensuring each page has enough detail to be functional.`,
47+
},
48+
{
49+
role: 'user',
50+
content: `Check if you covered all major pages, user flows, and any global components mentioned in the SMD.
51+
If anything is missing, please add it now. Also, expand on how each <global_comp> is used across pages.`,
52+
},
53+
{
54+
role: 'user',
55+
content: `Please add more detail about the Core Components within each <page_gen>.
56+
Specifically:
57+
- Provide a descriptive name for each Core Component (e.g., “C1.1. SearchBar”).
58+
- List possible states (Default, Hover, etc.) and typical user interactions (click, scroll, etc.).
59+
- Clarify how these components support user goals and why they exist on that page.`,
60+
},
61+
{
62+
role: 'user',
63+
content: `
64+
Finally, please ensure each page includes at least one user flow under "Page-Specific User Flows",
65+
illustrating step-by-step how a user accomplishes a key goal on that page.
66+
If the SMD mentions additional flows, add them here.
67+
Confirm any login or access restrictions, too.
68+
`,
69+
},
70+
];
71+
3472
const uxStructureContent = await context.model.chatSync({
3573
model: 'gpt-4o-mini',
36-
messages: [{ content: prompt, role: 'system' }],
74+
messages,
3775
});
3876

3977
return {

0 commit comments

Comments
 (0)