Skip to content

Commit 129a477

Browse files
committed
refactor(workspace): remove specifications template creation logic
The specifications template creation has been moved to validation.ts where it's only created when template.specification is true. This change simplifies the workspace initialization process and centralizes template creation logic.
1 parent bf67594 commit 129a477

2 files changed

Lines changed: 3 additions & 16 deletions

File tree

src/runtime/services/workspace/fs-utils.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@ export function slugify(value: unknown): string {
5050
.replace(/(^-|-$)/g, '');
5151
}
5252

53-
export async function ensureSpecificationsTemplate(inputsDir: string): Promise<void> {
54-
const specPath = path.join(inputsDir, 'specifications.md');
55-
try {
56-
await readFile(specPath, 'utf8');
57-
return; // exists, do not overwrite
58-
} catch (error) {
59-
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;
60-
}
61-
62-
const template = `# Project Specifications\n\n- Describe goals, constraints, and context.\n- Link any relevant docs or tickets.\n- This file is created by workspace bootstrap and can be safely edited.\n`;
63-
await writeFile(specPath, template, 'utf8');
64-
}
65-
6653
export async function mirrorAgentsToJson(
6754
agentsDir: string,
6855
agents: AgentDefinition[],

src/runtime/services/workspace/init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as path from 'node:path';
22

33
import { CLI_ROOT_CANDIDATES, debugLog, loadAgents } from './discovery.js';
4-
import { ensureDir, ensureSpecificationsTemplate, mirrorAgentsToJson } from './fs-utils.js';
4+
import { ensureDir, mirrorAgentsToJson } from './fs-utils.js';
55
import { getImportRoots } from '../../../shared/imports/index.js';
66

77
export type WorkspaceStructureOptions = {
@@ -48,8 +48,8 @@ export async function ensureWorkspaceStructure(options?: WorkspaceStructureOptio
4848
ensureDir(logsDir)
4949
]);
5050

51-
// Ensure specifications template exists (do not overwrite if present)
52-
await ensureSpecificationsTemplate(inputsDir);
51+
// Note: specifications.md is only created when template.specification === true
52+
// See validateSpecification() in validation.ts
5353
}
5454

5555
/**

0 commit comments

Comments
 (0)