feat: add Atlas PRD agent for product discovery

- src/prompts/atlas.ts — full Atlas system prompt (6-phase PM discovery flow)
- src/tools/prd.ts — finalize_prd tool that signals PRD completion
- src/agents/atlas.ts — Atlas agent config (Tier A, conversational)
- src/atlas.ts — atlasChat() multi-turn session handler
- server.ts — /atlas/chat, /atlas/sessions endpoints

Made-with: Cursor
This commit is contained in:
2026-03-01 15:56:26 -08:00
parent e29dccf745
commit e503e4312d
20 changed files with 756 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import './coolify';
import './agent';
import './memory';
import './skills';
import './prd';
export { ALL_TOOLS, executeTool, ToolDefinition } from './registry';
export { ToolContext, MemoryUpdate } from './context';
export { PROTECTED_GITEA_REPOS, PROTECTED_COOLIFY_PROJECT, PROTECTED_COOLIFY_APPS, assertGiteaWritable, assertCoolifyDeployable } from './security';

1
dist/tools/index.js vendored
View File

@@ -11,6 +11,7 @@ require("./coolify");
require("./agent");
require("./memory");
require("./skills");
require("./prd");
// Re-export the public API — identical surface to the old tools.ts
var registry_1 = require("./registry");
Object.defineProperty(exports, "ALL_TOOLS", { enumerable: true, get: function () { return registry_1.ALL_TOOLS; } });

2
dist/tools/prd.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/** Shared state — atlas.ts reads this after each turn to check if PRD was finalized. */
export declare const prdStore: Map<string, string>;

29
dist/tools/prd.js vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prdStore = void 0;
const registry_1 = require("./registry");
/** Shared state — atlas.ts reads this after each turn to check if PRD was finalized. */
exports.prdStore = new Map(); // sessionId → PRD markdown
(0, registry_1.registerTool)({
name: 'finalize_prd',
description: 'Call this when you have finished writing the complete PRD document. Pass the full PRD markdown as content. This saves the document and signals to the user that discovery is complete.',
parameters: {
type: 'object',
properties: {
content: {
type: 'string',
description: 'The complete PRD document in markdown format'
}
},
required: ['content']
},
async handler(args, ctx) {
// Store against workspaceRoot as a unique key (each project has its own workspace)
const sessionKey = ctx.workspaceRoot;
exports.prdStore.set(sessionKey, String(args.content));
return {
saved: true,
message: 'PRD saved. Let the user know their product requirements document is ready and the platform will now architect the technical solution.'
};
}
});