Project Snapshot Script
Generate project snapshots to enhance AI development assistance
This utility script helps accelerate development with AI by creating comprehensive snapshots of your codebase. The script generates two reference files that can be fed to any LLM (like ChatGPT, Claude, or Gemini) to provide context about your project structure and code.
How to use
This script is also very helpful if using projects in chatgpt.
Usage:
- Upload your project-structure.txt and project-code.txt files to chatgpt projects.
- Ask chatgpt to analyze your project structure or implement new features.
- The Chatgpt will have comprehensive context about your codebase now.
What It Does
The script creates two files:
project-structure.txt
- A hierarchical view of your project's files and directoriesproject-code.txt
- The complete code of your project with file paths as headers
The Script
How to run
Add to .gitignore (Optional)
Add these files to .gitignore
so it will ot get pushed to github. Even windsurf and cursor will not track these files.
Be cautious about uploading sensitive code to external AI services. Consider excluding sensitive files like API keys, credentials, or proprietary algorithms by adding them to the exclude lists.
Customization
You can customize the script by modifying the config
object:
- excludeList: Files and directories to exclude from both outputs
- structureExcludeList: Additional exclusions for the structure file only
- codeExcludeList: Additional exclusions for the code file only
- excludeExtensions: File types to exclude (typically binary files)
Benefits
- Faster Development: AI can understand your codebase more quickly
- Consistent Code Generation: AI-generated code follows your existing patterns
- Better Integration: New features fit seamlessly into your architecture
- Time Savings: Reduce the need to explain your project structure repeatedly