131 lines
4.2 KiB
PowerShell
131 lines
4.2 KiB
PowerShell
# cleanup-repo.ps1
|
|
# Removes stale, superseded, and AI-process artifacts from the repo root
|
|
# Run from: C:\dev\nt8-sdk
|
|
|
|
Set-Location "C:\dev\nt8-sdk"
|
|
|
|
$filesToDelete = @(
|
|
# Archon planning docs (tool was never used)
|
|
"archon_task_mapping.md",
|
|
"archon_update_plan.md",
|
|
|
|
# AI team/agent process docs (internal scaffolding, no ongoing value)
|
|
"ai_agent_tasks.md",
|
|
"ai_success_metrics.md",
|
|
"AI_DEVELOPMENT_GUIDELINES.md",
|
|
"AI_TEAM_SETUP_DOCUMENTATION.md",
|
|
"ai_workflow_templates.md",
|
|
|
|
# Phase A/B/C planning docs (all phases complete, superseded by PROJECT_HANDOVER)
|
|
"PHASE_A_READY_FOR_KILOCODE.md",
|
|
"PHASE_A_SPECIFICATION.md",
|
|
"PHASE_B_SPECIFICATION.md",
|
|
"PHASE_C_SPECIFICATION.md",
|
|
"PHASES_ABC_COMPLETION_REPORT.md",
|
|
|
|
# Old TASK- files superseded by TASK_ files (better versions exist)
|
|
"TASK-01-kill-switch.md",
|
|
"TASK-02-circuit-breaker.md",
|
|
"TASK-03-trailing-stop.md",
|
|
"TASK-04-log-level.md",
|
|
"TASK-05-session-holidays.md",
|
|
|
|
# Fix specs already applied to codebase
|
|
"COMPILE_FIX_SPECIFICATION.md",
|
|
"DROPDOWN_FIX_SPECIFICATION.md",
|
|
"STRATEGY_DROPDOWN_COMPLETE_FIX.md",
|
|
|
|
# One-time historical docs
|
|
"NET_FRAMEWORK_CONVERSION.md",
|
|
"FIX_GIT_AUTH.md",
|
|
"GIT_COMMIT_INSTRUCTIONS.md",
|
|
|
|
# Superseded implementation docs
|
|
"implementation_guide.md",
|
|
"implementation_guide_summary.md",
|
|
"implementation_attention_points.md",
|
|
"OMS_IMPLEMENTATION_START.md",
|
|
"nt8_sdk_phase0_completion.md",
|
|
"NT8_INTEGRATION_COMPLETE_SPECS.md",
|
|
"nt8_integration_guidelines.md",
|
|
"POST_INTEGRATION_ROADMAP.md",
|
|
|
|
# Superseded project planning (PROJECT_HANDOVER.md is canonical now)
|
|
"project_plan.md",
|
|
"project_summary.md",
|
|
"architecture_summary.md",
|
|
"development_workflow.md",
|
|
|
|
# Kilocode setup (already done, no ongoing value)
|
|
"KILOCODE_SETUP_COMPLETE.md",
|
|
"setup-kilocode-files.ps1",
|
|
|
|
# Utility scripts (one-time use)
|
|
"commit-now.ps1",
|
|
"cleanup-repo.ps1" # self-delete at end
|
|
)
|
|
|
|
$dirsToDelete = @(
|
|
"plans", # single stale analysis report
|
|
"Specs" # original spec packages, all implemented
|
|
)
|
|
|
|
Write-Host "`n=== NT8-SDK Repository Cleanup ===" -ForegroundColor Cyan
|
|
Write-Host "Removing stale and superseded files...`n"
|
|
|
|
$deleted = 0
|
|
$notFound = 0
|
|
|
|
foreach ($file in $filesToDelete) {
|
|
$path = Join-Path (Get-Location) $file
|
|
if (Test-Path $path) {
|
|
Remove-Item $path -Force
|
|
Write-Host " DELETED: $file" -ForegroundColor Green
|
|
$deleted++
|
|
} else {
|
|
Write-Host " SKIP (not found): $file" -ForegroundColor DarkGray
|
|
$notFound++
|
|
}
|
|
}
|
|
|
|
foreach ($dir in $dirsToDelete) {
|
|
$path = Join-Path (Get-Location) $dir
|
|
if (Test-Path $path) {
|
|
Remove-Item $path -Recurse -Force
|
|
Write-Host " DELETED DIR: $dir\" -ForegroundColor Green
|
|
$deleted++
|
|
} else {
|
|
Write-Host " SKIP DIR (not found): $dir\" -ForegroundColor DarkGray
|
|
$notFound++
|
|
}
|
|
}
|
|
|
|
Write-Host "`n=== Staging changes ===" -ForegroundColor Cyan
|
|
git add -A
|
|
|
|
Write-Host "`n=== Committing ===" -ForegroundColor Cyan
|
|
git commit -m "chore: repo housekeeping - remove stale and superseded files
|
|
|
|
Removed categories:
|
|
- Archon planning docs (tool never used)
|
|
- AI team/agent scaffolding docs
|
|
- Phase A/B/C specs (complete, superseded by PROJECT_HANDOVER)
|
|
- Old TASK-0x files (superseded by TASK_0x versions)
|
|
- Applied fix specs (COMPILE, DROPDOWN, STRATEGY_DROPDOWN)
|
|
- One-time historical docs (NET_FRAMEWORK_CONVERSION, FIX_GIT_AUTH)
|
|
- Superseded implementation guides and planning docs
|
|
- plans/ and Specs/ directories (all implemented)
|
|
|
|
Kept:
|
|
- All active TASK_0x work items (TASK_01/02/03 execution wiring)
|
|
- PROJECT_HANDOVER, NEXT_STEPS_RECOMMENDED, GAP_ANALYSIS
|
|
- Phase3/4/5 Implementation Guides
|
|
- KILOCODE_RUNBOOK, OPTIMIZATION_GUIDE
|
|
- All spec files for pending work (RTH, CONFIG_EXPORT, DIAGNOSTIC_LOGGING)
|
|
- src/, tests/, docs/, deployment/, rules/, .kilocode/ unchanged"
|
|
|
|
Write-Host "`nDeleted: $deleted items" -ForegroundColor Green
|
|
Write-Host "Skipped: $notFound items (already gone)" -ForegroundColor DarkGray
|
|
Write-Host "`n=== Done! Current root files: ===" -ForegroundColor Cyan
|
|
Get-ChildItem -File | Where-Object { $_.Name -notlike ".*" } | Select-Object Name | Format-Table -HideTableHeaders
|