init-session.ps1 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Initialize planning files for a new session
  2. # Usage: .\init-session.ps1 [project-name]
  3. param(
  4. [string]$ProjectName = "project"
  5. )
  6. $DATE = Get-Date -Format "yyyy-MM-dd"
  7. Write-Host "Initializing planning files for: $ProjectName"
  8. # Create task_plan.md if it doesn't exist
  9. if (-not (Test-Path "task_plan.md")) {
  10. @"
  11. # Task Plan: [Brief Description]
  12. ## Goal
  13. [One sentence describing the end state]
  14. ## Current Phase
  15. Phase 1
  16. ## Phases
  17. ### Phase 1: Requirements & Discovery
  18. - [ ] Understand user intent
  19. - [ ] Identify constraints
  20. - [ ] Document in findings.md
  21. - **Status:** in_progress
  22. ### Phase 2: Planning & Structure
  23. - [ ] Define approach
  24. - [ ] Create project structure
  25. - **Status:** pending
  26. ### Phase 3: Implementation
  27. - [ ] Execute the plan
  28. - [ ] Write to files before executing
  29. - **Status:** pending
  30. ### Phase 4: Testing & Verification
  31. - [ ] Verify requirements met
  32. - [ ] Document test results
  33. - **Status:** pending
  34. ### Phase 5: Delivery
  35. - [ ] Review outputs
  36. - [ ] Deliver to user
  37. - **Status:** pending
  38. ## Decisions Made
  39. | Decision | Rationale |
  40. |----------|-----------|
  41. ## Errors Encountered
  42. | Error | Resolution |
  43. |-------|------------|
  44. "@ | Out-File -FilePath "task_plan.md" -Encoding UTF8
  45. Write-Host "Created task_plan.md"
  46. } else {
  47. Write-Host "task_plan.md already exists, skipping"
  48. }
  49. # Create findings.md if it doesn't exist
  50. if (-not (Test-Path "findings.md")) {
  51. @"
  52. # Findings & Decisions
  53. ## Requirements
  54. -
  55. ## Research Findings
  56. -
  57. ## Technical Decisions
  58. | Decision | Rationale |
  59. |----------|-----------|
  60. ## Issues Encountered
  61. | Issue | Resolution |
  62. |-------|------------|
  63. ## Resources
  64. -
  65. "@ | Out-File -FilePath "findings.md" -Encoding UTF8
  66. Write-Host "Created findings.md"
  67. } else {
  68. Write-Host "findings.md already exists, skipping"
  69. }
  70. # Create progress.md if it doesn't exist
  71. if (-not (Test-Path "progress.md")) {
  72. @"
  73. # Progress Log
  74. ## Session: $DATE
  75. ### Current Status
  76. - **Phase:** 1 - Requirements & Discovery
  77. - **Started:** $DATE
  78. ### Actions Taken
  79. -
  80. ### Test Results
  81. | Test | Expected | Actual | Status |
  82. |------|----------|--------|--------|
  83. ### Errors
  84. | Error | Resolution |
  85. |-------|------------|
  86. "@ | Out-File -FilePath "progress.md" -Encoding UTF8
  87. Write-Host "Created progress.md"
  88. } else {
  89. Write-Host "progress.md already exists, skipping"
  90. }
  91. Write-Host ""
  92. Write-Host "Planning files initialized!"
  93. Write-Host "Files: task_plan.md, findings.md, progress.md"