update-context.ps1 1.1 KB

1234567891011121314151617181920212223
  1. # update-context.ps1 — Claude Code integration: create/update CLAUDE.md
  2. #
  3. # Thin wrapper that delegates to the shared update-agent-context script.
  4. # Activated in Stage 7 when the shared script uses integration.json dispatch.
  5. #
  6. # Until then, this delegates to the shared script as a subprocess.
  7. $ErrorActionPreference = 'Stop'
  8. # Derive repo root from script location (walks up to find .specify/)
  9. $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
  10. $repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
  11. # If git did not return a repo root, or the git root does not contain .specify,
  12. # fall back to walking up from the script directory to find the initialized project root.
  13. if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
  14. $repoRoot = $scriptDir
  15. $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
  16. while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
  17. $repoRoot = Split-Path -Parent $repoRoot
  18. }
  19. }
  20. & "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType claude