init-session.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #!/bin/bash
  2. # Initialize planning files for a new session
  3. # Usage: ./init-session.sh [project-name]
  4. set -e
  5. PROJECT_NAME="${1:-project}"
  6. DATE=$(date +%Y-%m-%d)
  7. echo "Initializing planning files for: $PROJECT_NAME"
  8. # Create task_plan.md if it doesn't exist
  9. if [ ! -f "task_plan.md" ]; then
  10. cat > task_plan.md << 'EOF'
  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. EOF
  45. echo "Created task_plan.md"
  46. else
  47. echo "task_plan.md already exists, skipping"
  48. fi
  49. # Create findings.md if it doesn't exist
  50. if [ ! -f "findings.md" ]; then
  51. cat > findings.md << 'EOF'
  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. EOF
  66. echo "Created findings.md"
  67. else
  68. echo "findings.md already exists, skipping"
  69. fi
  70. # Create progress.md if it doesn't exist
  71. if [ ! -f "progress.md" ]; then
  72. cat > progress.md << EOF
  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. EOF
  87. echo "Created progress.md"
  88. else
  89. echo "progress.md already exists, skipping"
  90. fi
  91. echo ""
  92. echo "Planning files initialized!"
  93. echo "Files: task_plan.md, findings.md, progress.md"