[PR #88] [MERGED] fix: check-complete.ps1 fails to parse on PowerShell #84

Closed
opened 2026-03-03 18:50:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OthmanAdi/planning-with-files/pull/88
Author: @raykuo998
Created: 2/27/2026
Status: Merged
Merged: 2/27/2026
Merged by: @OthmanAdi

Base: masterHead: fix/check-complete-ps1-parsing


📝 Commits (1)

  • 7cfa786 fix: check-complete.ps1 fails to parse on PowerShell due to special characters

📊 Changes

12 files changed (+84 additions, -84 deletions)

View changed files

📝 .adal/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .codebuddy/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .codex/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .continue/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .gemini/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .kiro/scripts/check-complete.ps1 (+7 -7)
📝 .mastracode/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .openclaw/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .opencode/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 .pi/skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)
📝 scripts/check-complete.ps1 (+7 -7)
📝 skills/planning-with-files/scripts/check-complete.ps1 (+7 -7)

📄 Description

Summary

  • check-complete.ps1 is completely non-functional on PowerShell due to special characters inside double-quoted strings
  • Three categories of parse errors: UTF-8 em-dash in comments, [ interpreted as array index, () interpreted as subexpressions
  • Replaced double-quoted Write-Host strings with single-quoted strings + concatenation, and em-dashes with ASCII --
  • Applied to all 12 tool variant copies (adal, codebuddy, codex, continue, gemini, kiro, mastracode, openclaw, opencode, pi, scripts, skills)

Errors before fix

At check-complete.ps1:9 char:33
+ if (-not (Test-Path $PlanFile)) {
+                                 ~
Missing closing '}' in statement block or type definition.
At check-complete.ps1:32 char:69
+ # Report status (always exit 0 — incomplete task is a normal state)
+                                                                     ~
Unexpected token ')' in expression or statement.
    + FullyQualifiedErrorId : MissingEndCurlyBrace
At check-complete.ps1:36 char:18
+     Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TO ...
+                  ~
Array index expression is missing or not valid.
    + FullyQualifiedErrorId : MissingArrayIndexExpression

Root cause

Character PowerShell interpretation Location
(U+2014 em-dash) Breaks parser mid-comment Line 3, 10, 32
[planning-with-files] Array index expression Lines 10, 34, 36, 38, 41
($COMPLETE/$TOTAL ...) Subexpression Lines 34, 36
phase(s) Subexpression Lines 38, 41

Fix

# Before (broken)
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."

# After (working)
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')

Test plan

Verified on Windows 11 with PowerShell 5.1:

  • In-progress plan: correct phase counts and status lines
  • All-complete plan: ALL PHASES COMPLETE (3/3)
  • No plan file: graceful message, exit 0
  • Inline [complete] format: fallback regex works
  • init-session.ps1 checked — no issues found

Closes #87

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OthmanAdi/planning-with-files/pull/88 **Author:** [@raykuo998](https://github.com/raykuo998) **Created:** 2/27/2026 **Status:** ✅ Merged **Merged:** 2/27/2026 **Merged by:** [@OthmanAdi](https://github.com/OthmanAdi) **Base:** `master` ← **Head:** `fix/check-complete-ps1-parsing` --- ### 📝 Commits (1) - [`7cfa786`](https://github.com/OthmanAdi/planning-with-files/commit/7cfa786e3592bc58cbbaac422ddfd3bfe53ac071) fix: check-complete.ps1 fails to parse on PowerShell due to special characters ### 📊 Changes **12 files changed** (+84 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `.adal/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.codebuddy/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.codex/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.continue/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.gemini/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.kiro/scripts/check-complete.ps1` (+7 -7) 📝 `.mastracode/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.openclaw/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.opencode/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `.pi/skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) 📝 `scripts/check-complete.ps1` (+7 -7) 📝 `skills/planning-with-files/scripts/check-complete.ps1` (+7 -7) </details> ### 📄 Description ## Summary - `check-complete.ps1` is completely non-functional on PowerShell due to special characters inside double-quoted strings - Three categories of parse errors: UTF-8 em-dash in comments, `[` interpreted as array index, `()` interpreted as subexpressions - Replaced double-quoted `Write-Host` strings with single-quoted strings + concatenation, and em-dashes with ASCII `--` - Applied to all 12 tool variant copies (adal, codebuddy, codex, continue, gemini, kiro, mastracode, openclaw, opencode, pi, scripts, skills) ## Errors before fix ``` At check-complete.ps1:9 char:33 + if (-not (Test-Path $PlanFile)) { + ~ Missing closing '}' in statement block or type definition. At check-complete.ps1:32 char:69 + # Report status (always exit 0 — incomplete task is a normal state) + ~ Unexpected token ')' in expression or statement. + FullyQualifiedErrorId : MissingEndCurlyBrace ``` ``` At check-complete.ps1:36 char:18 + Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TO ... + ~ Array index expression is missing or not valid. + FullyQualifiedErrorId : MissingArrayIndexExpression ``` ## Root cause | Character | PowerShell interpretation | Location | |-----------|--------------------------|----------| | `—` (U+2014 em-dash) | Breaks parser mid-comment | Line 3, 10, 32 | | `[planning-with-files]` | Array index expression | Lines 10, 34, 36, 38, 41 | | `($COMPLETE/$TOTAL ...)` | Subexpression | Lines 34, 36 | | `phase(s)` | Subexpression | Lines 38, 41 | ## Fix ```powershell # Before (broken) Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)" Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress." # After (working) Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')') Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.') ``` ## Test plan Verified on Windows 11 with PowerShell 5.1: - [x] In-progress plan: correct phase counts and status lines - [x] All-complete plan: `ALL PHASES COMPLETE (3/3)` - [x] No plan file: graceful message, exit 0 - [x] Inline `[complete]` format: fallback regex works - [x] `init-session.ps1` checked — no issues found Closes #87 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 18:50:29 +03:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/planning-with-files#84
No description provided.