Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Structured planning workflow that uses files to track tasks, decisions, and project progress.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/set-active-plan.ps1
1# planning-with-files: set or display the active plan pointer (PowerShell).2#3# Usage:4# .\set-active-plan.ps1 <plan_id> — pin .planning\.active_plan to plan_id5# .\set-active-plan.ps1 — print the current active plan (if any)67param(8[string]$PlanId = ""9)1011$PlanRoot = Join-Path (Get-Location) ".planning"12$ActiveFile = Join-Path $PlanRoot ".active_plan"1314if ($PlanId -eq "") {15if (Test-Path $ActiveFile) {16$current = (Get-Content $ActiveFile -Raw -Encoding UTF8).Trim()17$planDir = Join-Path $PlanRoot $current18if ($current -ne "" -and (Test-Path $planDir)) {19Write-Output "Active plan: $current"20Write-Output "Path: $planDir"21} elseif ($current -ne "") {22Write-Output "Active plan pointer: $current (directory not found — stale pointer)"23} else {24Write-Output "No active plan set."25}26} else {27Write-Output "No active plan set."28}29exit 030}3132$PlanDir = Join-Path $PlanRoot $PlanId3334if (-not (Test-Path $PlanDir)) {35Write-Error "Error: plan directory not found: $PlanDir"36Write-Error "Run: init-session.sh `"$PlanId`" to create it, or check .planning\ for available plans."37exit 138}3940if (-not (Test-Path $PlanRoot)) {41New-Item -ItemType Directory -Path $PlanRoot -Force | Out-Null42}4344Set-Content -Path $ActiveFile -Value $PlanId -Encoding UTF8 -NoNewline4546Write-Output "Active plan set to: $PlanId"47Write-Output "Path: $PlanDir"48Write-Output ""49Write-Output "To pin this terminal session only:"50Write-Output "`$env:PLAN_ID = '$PlanId'"51