diff --git a/openspec/config.yaml b/openspec/config.yaml new file mode 100644 index 00000000..83ed3395 --- /dev/null +++ b/openspec/config.yaml @@ -0,0 +1,24 @@ +schema: spec-driven + +context: | + Tech stack: TypeScript, Node.js (≥20.19.0), ESM modules + Package manager: pnpm + CLI framework: Commander.js + + Cross-platform requirements: + - This tool runs on macOS, Linux, AND Windows + - Always use path.join() or path.resolve() for file paths - never hardcode slashes + - Never assume forward-slash path separators + - Tests must use path.join() for expected path values, not hardcoded strings + - Consider case sensitivity differences in file systems + +rules: + specs: + - Include scenarios for Windows path handling when dealing with file paths + - Requirements involving paths must specify cross-platform behavior + tasks: + - Add Windows CI verification as a task when changes involve file paths + - Include cross-platform testing considerations + design: + - Document any platform-specific behavior or limitations + - Prefer Node.js path module over string manipulation for paths diff --git a/test/core/artifact-graph/resolver.test.ts b/test/core/artifact-graph/resolver.test.ts index 320aa427..8c5f19f2 100644 --- a/test/core/artifact-graph/resolver.test.ts +++ b/test/core/artifact-graph/resolver.test.ts @@ -335,12 +335,12 @@ version: [[[invalid yaml it('should return correct path', () => { const projectRoot = '/path/to/project'; const schemasDir = getProjectSchemasDir(projectRoot); - expect(schemasDir).toBe('/path/to/project/openspec/schemas'); + expect(schemasDir).toBe(path.join('/path/to/project', 'openspec', 'schemas')); }); it('should work with relative-looking paths', () => { const schemasDir = getProjectSchemasDir('./my-project'); - expect(schemasDir).toBe('my-project/openspec/schemas'); + expect(schemasDir).toBe(path.join('my-project', 'openspec', 'schemas')); }); });