{
"feature_name": "analysis-persistence",
"description": "Make analyze_project_for_planning tool automatically save analysis results to a file, completing the workflow pattern where context.json and plan.json are saved but analysis.json is not.",
"goal": "Create workflow consistency and enable analysis result reusability by persisting the output of analyze_project_for_planning to a timestamped file in coderef/analysis-cache/",
"requirements": [
"Auto-save analysis results to coderef/analysis-cache/analysis-{timestamp}.json",
"Return file path in response metadata (_metadata.saved_to)",
"Use timestamp format: YYYYMMDD-HHMMSS",
"Create analysis-cache directory if it doesn't exist",
"Include generated_at timestamp in metadata",
"Maintain backwards compatibility - still return analysis data in response",
"File must contain valid JSON with all analysis results",
"No breaking changes to existing tool behavior"
],
"out_of_scope": [
"Feature-specific analysis files (coderef/working/{feature}/analysis.json) - future enhancement",
"Analysis cleanup/rotation - future enhancement",
"Custom output_path parameter - future enhancement",
"Separate save_analysis tool - using auto-save pattern instead",
"Update create_plan to save analysis - keeping concerns separated"
],
"constraints": [
"Must not break existing workflows that use analyze_project_for_planning",
"File operations must handle permission errors gracefully",
"Must follow existing error response patterns (ErrorResponse factory)",
"Must use existing logging patterns (logger from logger_config)",
"Must maintain performance (<100ms overhead for file save)",
"Path must be relative to project root in metadata",
"Must work on Windows and Unix file systems",
"Must use UTF-8 encoding for JSON files"
]
}