Skip to content

Commit 0541f93

Browse files
authored
fix(onboard): add Windows PowerShell alternatives for shell commands (Fission-AI#638)
* fix(onboard): replace broken preflight check and add Windows compatibility 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 `openspec --version` to verify the CLI is installed. Also add Windows PowerShell alternatives for all platform-specific shell commands in the onboarding skill: - `2>&1 ||` → `; if ($LASTEXITCODE -ne 0) {}` - `2>/dev/null` → `2>$null` - `mkdir -p` → `New-Item -ItemType Directory -Force` * fix(onboard): address PR review feedback for PowerShell commands Use Get-Command for robust CLI detection instead of $LASTEXITCODE (which stays stale when a command isn't found), and use forward slashes in PowerShell paths for consistency with Unix commands.
1 parent be51bcb commit 0541f93

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

.changeset/fix-onboarding-preflight.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/core/templates/skill-templates.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -937,23 +937,19 @@ function getOnboardInstructions(): string {
937937
938938
## Preflight
939939
940-
Before starting, check if the OpenSpec CLI is installed and the project is initialized:
940+
Before starting, check if the OpenSpec CLI is installed:
941941
942942
\`\`\`bash
943+
# Unix/macOS
943944
openspec --version 2>&1 || echo "CLI_NOT_INSTALLED"
944-
\`\`\`
945-
946-
\`\`\`bash
947-
test -f openspec/config.yaml && echo "INITIALIZED" || echo "NOT_INITIALIZED"
945+
# Windows (PowerShell)
946+
# if (Get-Command openspec -ErrorAction SilentlyContinue) { openspec --version } else { echo "CLI_NOT_INSTALLED" }
948947
\`\`\`
949948
950949
**If CLI not installed:**
951950
> OpenSpec CLI is not installed. Install it first, then come back to \`/opsx:onboard\`.
952951
953-
**If not initialized:**
954-
> OpenSpec isn't set up in this project yet. Run \`openspec init\` first, then come back to \`/opsx:onboard\`.
955-
956-
Stop here if either check fails.
952+
Stop here if not installed.
957953
958954
---
959955
@@ -996,7 +992,10 @@ Scan the codebase for small improvement opportunities. Look for:
996992
997993
Also check recent git activity:
998994
\`\`\`bash
995+
# Unix/macOS
999996
git log --oneline -10 2>/dev/null || echo "No git history"
997+
# Windows (PowerShell)
998+
# git log --oneline -10 2>$null; if ($LASTEXITCODE -ne 0) { echo "No git history" }
1000999
\`\`\`
10011000
10021001
### Present Suggestions
@@ -1191,7 +1190,10 @@ For a small task like this, we might only need one spec file.
11911190
11921191
**DO:** Create the spec file:
11931192
\`\`\`bash
1193+
# Unix/macOS
11941194
mkdir -p openspec/changes/<name>/specs/<capability-name>
1195+
# Windows (PowerShell)
1196+
# New-Item -ItemType Directory -Force -Path "openspec/changes/<name>/specs/<capability-name>"
11951197
\`\`\`
11961198
11971199
Draft the spec content:

0 commit comments

Comments
 (0)