Skip to content

Commit be51bcb

Browse files
authored
fix(onboard): replace broken preflight check with direct config file test (Fission-AI#637)
The onboarding preflight used `openspec status --json` to detect if a project was initialized, but that command requires an existing change to succeed. After a fresh `openspec init` (no changes yet), it always failed — causing the onboarding to incorrectly tell users to run init again. Replace with two targeted checks: - `openspec --version` to verify the CLI is installed - `test -f openspec/config.yaml` to verify project initialization
1 parent 1d34e72 commit be51bcb

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openspec": patch
3+
---
4+
5+
Fix onboarding preflight check that incorrectly reported freshly initialized projects as not initialized. Replaced `openspec status --json` (which requires an existing change) with a direct `openspec/config.yaml` existence check. Also added an `openspec --version` check to verify the CLI is installed.

src/core/templates/skill-templates.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,16 +937,23 @@ function getOnboardInstructions(): string {
937937
938938
## Preflight
939939
940-
Before starting, check if OpenSpec is initialized:
940+
Before starting, check if the OpenSpec CLI is installed and the project is initialized:
941941
942942
\`\`\`bash
943-
openspec status --json 2>&1 || echo "NOT_INITIALIZED"
943+
openspec --version 2>&1 || echo "CLI_NOT_INSTALLED"
944944
\`\`\`
945945
946+
\`\`\`bash
947+
test -f openspec/config.yaml && echo "INITIALIZED" || echo "NOT_INITIALIZED"
948+
\`\`\`
949+
950+
**If CLI not installed:**
951+
> OpenSpec CLI is not installed. Install it first, then come back to \`/opsx:onboard\`.
952+
946953
**If not initialized:**
947954
> OpenSpec isn't set up in this project yet. Run \`openspec init\` first, then come back to \`/opsx:onboard\`.
948955
949-
Stop here if not initialized.
956+
Stop here if either check fails.
950957
951958
---
952959

0 commit comments

Comments
 (0)