Skip to content

Commit 9d8445f

Browse files
committed
Merge branch 'master' of github.com:blalterman/SolarWindPy
2 parents ed8d695 + 0c654ee commit 9d8445f

18 files changed

Lines changed: 3808 additions & 11 deletions

.claude/compacted_state.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,25 @@
77

88
- **Pre-Compaction Context**: ~8,491 tokens (1,799 lines)
99
- **Target Compression**: medium (35% reduction)
10-
- **Target Tokens**: ~5,519 tokens
10+
- **Target Tokens**: ~5,567 tokens
1111
- **Strategy**: medium compression with prose focus
1212

1313
## Content Analysis
1414
- **Files Analyzed**: 9
1515
- **Content Breakdown**:
16-
- Code: 426 lines
17-
- Prose: 422 lines
16+
- Code: 429 lines
17+
- Prose: 425 lines
1818
- Tables: 0 lines
19-
- Lists: 393 lines
19+
- Lists: 395 lines
2020
- Headers: 222 lines
2121
- **Token Estimates**:
22-
- Line-based: 5,397
23-
- Character-based: 15,109
24-
- Word-based: 9,359
25-
- Content-weighted: 4,099
26-
- **Final estimate**: 8,491 tokens
22+
- Line-based: 5,424
23+
- Character-based: 15,265
24+
- Word-based: 9,449
25+
- Content-weighted: 4,123
26+
- **Final estimate**: 8,565 tokens
2727

2828
## Git State
29-
3029
### Current Branch: plan/pr-270-doc-validation-fixes
3130
### Last Commit: dbe38f3 - refactor: right-size documentation validation framework (blalterman, 35 seconds ago)
3231

@@ -134,7 +133,7 @@ conda info --envs # Check active environment
134133
- [ ] **Changes**: Review uncommitted changes
135134

136135
### 📊 Efficiency Metrics
137-
- **Context Reduction**: 35.0% (8,491 → 5,519 tokens)
136+
- **Context Reduction**: 35.0% (8,565 → 5,567 tokens)
138137
- **Estimated Session Extension**: 21 additional minutes of productive work
139138
- **Compaction Strategy**: medium compression focused on prose optimization
140139

.claude/hooks/plan-completion-manager.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import json
99
import shutil
10+
import re
1011
from pathlib import Path
1112
from datetime import datetime
1213
import subprocess
@@ -96,6 +97,81 @@ def move_plan_to_completed(plan_name: str, source_dir: Path, completed_dir: Path
9697
return False
9798

9899

100+
def generate_closeout_documentation(plan_name: str, plan_dir: Path) -> bool:
101+
"""
102+
Generate closeout documentation for a completed plan.
103+
104+
Args:
105+
plan_name: Name of the plan
106+
plan_dir: Path to the plan directory
107+
108+
Returns:
109+
True if closeout generation was successful
110+
"""
111+
try:
112+
# Read the overview file to extract metadata
113+
overview_file = plan_dir / "0-Overview.md"
114+
if not overview_file.exists():
115+
print(f"⚠️ No overview file found for {plan_name}")
116+
return False
117+
118+
with open(overview_file, 'r') as f:
119+
overview_content = f.read()
120+
121+
# Extract key metadata
122+
estimated_duration = extract_metadata(overview_content, "Estimated Duration")
123+
total_phases = extract_metadata(overview_content, "Total Phases")
124+
objective = extract_section(overview_content, "🎯 Objective")
125+
126+
# Load template
127+
template_file = Path('plans/closeout-template.md')
128+
if not template_file.exists():
129+
print(f"⚠️ Closeout template not found: {template_file}")
130+
return False
131+
132+
with open(template_file, 'r') as f:
133+
template_content = f.read()
134+
135+
# Replace template placeholders
136+
closeout_content = template_content.replace('[Plan Name]', plan_name)
137+
closeout_content = closeout_content.replace('[Plan Name from 0-Overview.md]', plan_name)
138+
closeout_content = closeout_content.replace('[YYYY-MM-DD]', datetime.now().strftime('%Y-%m-%d'))
139+
closeout_content = closeout_content.replace('[estimated hours]', estimated_duration or 'N/A')
140+
closeout_content = closeout_content.replace('[N]/[N]', f"{total_phases}/{total_phases}" if total_phases else 'N/A')
141+
closeout_content = closeout_content.replace('[feature/plan-name]', f'feature/{plan_name}')
142+
closeout_content = closeout_content.replace('[plan/plan-name]', f'plan/{plan_name}')
143+
closeout_content = closeout_content.replace('[plan-name]', plan_name)
144+
145+
if objective:
146+
closeout_content = closeout_content.replace('[Restate main objective from 0-Overview.md]', objective.strip())
147+
148+
# Create closeout file
149+
closeout_file = plan_dir / "9-Closeout.md"
150+
with open(closeout_file, 'w') as f:
151+
f.write(closeout_content)
152+
153+
print(f"✅ Generated closeout documentation: {closeout_file}")
154+
return True
155+
156+
except Exception as e:
157+
print(f"❌ Error generating closeout for {plan_name}: {e}")
158+
return False
159+
160+
161+
def extract_metadata(content: str, field: str) -> str:
162+
"""Extract metadata field from plan content."""
163+
pattern = rf"- \*\*{field}\*\*: (.+)"
164+
match = re.search(pattern, content)
165+
return match.group(1).strip() if match else ""
166+
167+
168+
def extract_section(content: str, header: str) -> str:
169+
"""Extract section content from plan."""
170+
pattern = rf"## {re.escape(header)}\n(.+?)(?=\n## |\n---|\Z)"
171+
match = re.search(pattern, content, re.DOTALL)
172+
return match.group(1).strip() if match else ""
173+
174+
99175
def preserve_plan_branches(plan_name: str) -> dict:
100176
"""
101177
Ensure plan branches are preserved and not deleted.
@@ -173,6 +249,11 @@ def scan_and_archive_completed_plans():
173249
if is_plan_completed(item):
174250
print(f"✅ Plan completed: {item.name}")
175251

252+
# Generate closeout documentation
253+
closeout_success = generate_closeout_documentation(item.name, item)
254+
if not closeout_success:
255+
print(f"⚠️ Proceeding with archival despite closeout generation issues")
256+
176257
# Preserve branches before moving
177258
branch_status = preserve_plan_branches(item.name)
178259
preserved_branches.append(branch_status)

plans/0-overview-template.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,113 @@ N. [N-Final-Phase.md](./N-Final-Phase.md)
3232
## 🧠 Context
3333
[Background information, motivation, and relevant links]
3434

35+
## 📈 Plan Propositions
36+
37+
### Risk Proposition
38+
**Technical Risks**:
39+
- [Breaking changes, compatibility issues, complexity factors]
40+
- [Dependencies on external libraries or APIs]
41+
- [Integration challenges with existing SolarWindPy components]
42+
43+
**Scientific Risks**:
44+
- [Physics validation requirements and validation complexity]
45+
- [Numerical stability concerns and edge case handling]
46+
- [Data integrity and scientific correctness verification needs]
47+
48+
**Operational Risks**:
49+
- [Maintenance burden and long-term support requirements]
50+
- [Documentation gaps and knowledge transfer challenges]
51+
- [Performance impact on existing workflows]
52+
53+
**Risk Mitigation Strategies**:
54+
- [Specific approaches to manage and minimize identified risks]
55+
- [Validation protocols and testing strategies]
56+
- [Rollback plans and contingency procedures]
57+
58+
### Value Proposition
59+
**Scientific Value**:
60+
- [Research enablement and new scientific capabilities unlocked]
61+
- [Reproducibility improvements and methodology advancements]
62+
- [Accuracy, precision, or efficiency gains for physics calculations]
63+
64+
**Developer Value**:
65+
- [Code quality improvements and maintainability benefits]
66+
- [Reusability patterns and framework enhancements]
67+
- [Development velocity improvements for future work]
68+
69+
**User Value**:
70+
- [Performance improvements and new features for end users]
71+
- [Documentation and usability enhancements]
72+
- [Workflow efficiency and productivity gains]
73+
74+
**ROI Timeline**:
75+
- [Immediate benefits (0-1 months)]
76+
- [Medium-term value (1-6 months)]
77+
- [Long-term strategic value (6+ months)]
78+
79+
### Cost Proposition
80+
**Development Time**:
81+
- [Estimated implementation hours with confidence intervals]
82+
- [Phase-by-phase time breakdown with uncertainty ranges]
83+
- [Complexity factors that may extend timeline]
84+
85+
**Review & Testing Time**:
86+
- [Quality assurance and peer review effort]
87+
- [Physics validation and scientific testing requirements]
88+
- [Integration testing and regression validation]
89+
90+
**Maintenance Cost**:
91+
- [Ongoing support and update requirements]
92+
- [Documentation maintenance and user support]
93+
- [Long-term compatibility and migration costs]
94+
95+
**Opportunity Cost**:
96+
- [Other high-value work deferred by this plan]
97+
- [Resource allocation trade-offs and priority decisions]
98+
- [Strategic alternatives not pursued]
99+
100+
### Token Proposition
101+
**Planning Tokens**:
102+
- [Estimated tokens for plan development and refinement]
103+
- [Cross-plan coordination and dependency analysis tokens]
104+
- [Research and design exploration token costs]
105+
106+
**Implementation Tokens**:
107+
- [Estimated tokens for code development and testing]
108+
- [Documentation and example development tokens]
109+
- [Debugging and refinement iteration costs]
110+
111+
**Future Token Savings**:
112+
- [Token reduction for similar future work through reusable patterns]
113+
- [Reduced planning overhead from documented approaches]
114+
- [Automated validation reducing manual checking tokens]
115+
116+
**Net Token ROI**:
117+
- [Break-even point for token investment]
118+
- [Long-term token efficiency improvements]
119+
- [Multiplicative benefits for subsequent related work]
120+
121+
### Usage Proposition
122+
**Target Users**:
123+
- [Primary user groups who will benefit from this change]
124+
- [Secondary beneficiaries and indirect value recipients]
125+
- [Specific researcher or developer personas addressed]
126+
127+
**Usage Frequency**:
128+
- [Daily, weekly, monthly usage patterns expected]
129+
- [Peak usage scenarios and seasonal variations]
130+
- [Growth trajectory and adoption timeline]
131+
132+
**Coverage Scope**:
133+
- [Percentage of SolarWindPy users/workflows affected]
134+
- [Geographic or institutional coverage considerations]
135+
- [Integration with existing research methodologies]
136+
137+
**Adoption Requirements**:
138+
- [Training and documentation needs for users]
139+
- [Migration procedures and transition support]
140+
- [Change management and communication strategy]
141+
35142
## 🔧 Technical Requirements
36143
[Frameworks, dependencies, versions, and constraints]
37144

0 commit comments

Comments
 (0)