feat(gateway): project bootstrap — docs structure + default agent
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

ProjectBootstrapService now creates docs/, docs/plans/, docs/reports/
in the workspace after init/clone, and inserts a default agent config
scoped to the new project.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-16 21:07:42 -05:00
parent dedfa0d9ac
commit 3bd15287d7
2 changed files with 17 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ export class ProjectBootstrapService {
ownerType,
});
// 2. Create workspace directory
// 2. Create workspace directory (includes docs structure)
const workspacePath = await this.workspace.create(
{
id: project.id,
@@ -56,6 +56,17 @@ export class ProjectBootstrapService {
params.repoUrl,
);
// 3. Create default agent config for the project
await this.brain.agents.create({
name: 'default',
provider: '',
model: '',
projectId: project.id,
ownerId: params.userId,
isSystem: false,
status: 'active',
});
this.logger.log(`Project ${project.id} bootstrapped at ${workspacePath}`);
return { projectId: project.id, workspacePath };

View File

@@ -64,6 +64,11 @@ export class WorkspaceService {
this.logger.log(`Initialized git workspace at ${workspacePath}`);
}
// Create standard docs structure
await fs.mkdir(path.join(workspacePath, 'docs', 'plans'), { recursive: true });
await fs.mkdir(path.join(workspacePath, 'docs', 'reports'), { recursive: true });
this.logger.log(`Created docs structure at ${workspacePath}`);
return workspacePath;
}