- {prd ? (
+
+ {/* Tab bar — only when at least one doc exists */}
+ {(prd || architecture) && (
+
+ {tabs.map(t => {
+ const isActive = activeTab === t.id;
+ return (
+
+ );
+ })}
+
+ )}
+
+ {/* Architecture tab */}
+ {activeTab === "architecture" && architecture && (
+
+ )}
+
+ {/* PRD tab */}
+ {activeTab === "prd" && prd ? (
/* ── Finalized PRD view ── */
@@ -138,7 +283,7 @@ export default function PRDPage() {
{prd}
- ) : (
+ ) : activeTab === "prd" ? (
/* ── Section progress view ── */
{/* Progress bar */}
diff --git a/app/api/projects/[projectId]/advisor/route.ts b/app/api/projects/[projectId]/advisor/route.ts
index 6b1e9ce..35710fa 100644
--- a/app/api/projects/[projectId]/advisor/route.ts
+++ b/app/api/projects/[projectId]/advisor/route.ts
@@ -46,6 +46,7 @@ async function buildKnowledgeContext(projectId: string, email: string): Promise<
const vision = (d.productVision as string) ?? (d.vision as string) ?? '';
const giteaRepo = (d.giteaRepo as string) ?? '';
const prd = (d.prd as string) ?? '';
+ const architecture = d.architecture as Record | null ?? null;
const apps = (d.apps as Array<{ name: string; domain?: string; coolifyServiceUuid?: string }>) ?? [];
const coolifyProjectUuid = (d.coolifyProjectUuid as string) ?? '';
const theiaUrl = (d.theiaWorkspaceUrl as string) ?? '';
@@ -73,6 +74,15 @@ Operating principles:
if (coolifyProjectUuid) lines.push(`Coolify project UUID: ${coolifyProjectUuid} — use coolify_list_applications to find its apps`);
if (theiaUrl) lines.push(`Theia IDE: ${theiaUrl}`);
+ // Architecture document
+ if (architecture) {
+ const archApps = (architecture.apps as Array<{ name: string; type: string; description: string }> ?? [])
+ .map(a => ` - ${a.name} (${a.type}): ${a.description}`).join('\n');
+ const archInfra = (architecture.infrastructure as Array<{ name: string; reason: string }> ?? [])
+ .map(i => ` - ${i.name}: ${i.reason}`).join('\n');
+ lines.push(`\n## Technical Architecture\nSummary: ${architecture.summary ?? ''}\n\nApps:\n${archApps}\n\nInfrastructure:\n${archInfra}`);
+ }
+
// PRD or discovery phases
if (prd) {
// Claude Sonnet has a 200k token context — pass the full PRD, no truncation needed