Skip to content

Commit 2691da4

Browse files
authored
Merge pull request #5 from Octane0411/fix/support-new-openspec
fix: support new OpenSpec OPSX detection via config.yaml
2 parents 694f5fe + eb8068c commit 2691da4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-plugin-openspec",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "An OpenCode plugin that integrates OpenSpec, providing a dedicated agent for planning and specifying software architecture.",
55
"type": "module",
66
"main": "dist/index.js",

src/utils/detection.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { join } from "node:path";
44

55
/**
66
* Checks if the current workspace is an OpenSpec project.
7-
*
7+
*
88
* Detection logic:
9-
* 1. Checks for `openspec/AGENTS.md` (Primary indicator)
10-
* 2. Checks for `AGENTS.md` in root (Secondary indicator)
9+
* 1. Checks for `openspec/config.yaml` (Primary indicator - new OPSX format)
10+
* 2. Checks for `openspec/AGENTS.md` (Fallback - legacy format)
1111
*/
1212
export async function isOpenSpecProject(ctx: PluginInput): Promise<boolean> {
13-
const openspecAgentsPath = join(ctx.directory, "openspec", "AGENTS.md");
13+
const openspecDir = join(ctx.directory, "openspec");
14+
const configYamlPath = join(openspecDir, "config.yaml");
15+
const agentsMdPath = join(openspecDir, "AGENTS.md");
1416

15-
return existsSync(openspecAgentsPath);
17+
return existsSync(configYamlPath) || existsSync(agentsMdPath);
1618
}

0 commit comments

Comments
 (0)