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/resolve-plan-dir.ps1
1# planning-with-files: resolve active plan directory (PowerShell mirror).2#3# Resolution order matches scripts/resolve-plan-dir.sh:4# 1. $env:PLAN_ID -> .\.planning\$PLAN_ID\5# 2. .\.planning\.active_plan content6# 3. Newest .\.planning\<dir>\ by LastWriteTime7# 4. Empty (legacy fallback to .\task_plan.md handled by caller)89param(10[string]$PlanRoot = (Join-Path (Get-Location) ".planning")11)1213$activeFile = Join-Path $PlanRoot ".active_plan"1415if ($env:PLAN_ID) {16$candidate = Join-Path $PlanRoot $env:PLAN_ID17if (Test-Path $candidate -PathType Container) {18Write-Output $candidate19exit 020}21}2223if (Test-Path $activeFile) {24$planId = (Get-Content $activeFile -Raw).Trim()25if ($planId) {26$candidate = Join-Path $PlanRoot $planId27if (Test-Path $candidate -PathType Container) {28Write-Output $candidate29exit 030}31}32}3334if (Test-Path $PlanRoot -PathType Container) {35$latest = Get-ChildItem -Path $PlanRoot -Directory |36Where-Object { -not $_.Name.StartsWith('.') } |37Sort-Object LastWriteTime -Descending |38Select-Object -First 139if ($latest) {40Write-Output $latest.FullName41}42}4344exit 045