Basic guide for organising project data

Basic guide for organising project data

Ongoing, suggestions welcome.

Related project:
https://www.ilovephilosophy.com/t/box-in-a-box/84705/11
(WARNING: SWEARING)


Create local folder structure (without example files):

project_zeus/
│
├── AI
│   ├── hardware_resources.txt
│   ├── initial_prompt.txt
│   └── project_prompt.txt
│
├── docs
│   ├── Project Zeus.doc
│   ├── Project Zeus.pdf
│   ├── Cost Estimate.xls
│   └── Standard Spiel for Dim Corporate Types v2.2.docx
│
├── images
│   ├── haha_you_fanny.jpg
│   └── grok_initial_prompt_response.png
│
├── mess
│   └── mess.txt
│
└── project
    │
    ├── logic
    │   ├── file_v1.0
    │   ├── file_v11.4
    │   └── file_v4.0
    │
    ├── outline
    │   ├── file_v1.0
    │   ├── file_v11.4
    │   └── file_v4.0
    │
    ├── phase1
    │   ├── file_v1.0
    │   ├── file_v11.4
    │   └── file_v4.0
    │
    ├── phase2
    │   ├── file_v1.0
    │   ├── file_v11.4
    │   └── file_v4.0
    │
    └── phase3
        ├── file_v1.0
        ├── file_v11.4
        └── file_v4.0


Descriptions:

project_zeus

Top level folder for this project.

AI

For AI prompts and useful generated output.

docs

For formatted documents somehow related to the project.

images

For images somehow related to the project and screen captures.

mess

Can also be called tmp or temp or whatever you like, bet mine gets messy.. :roll_eyes:, but a mess is better than nothing when grabbing stuff.

I use mess.txt as a filename index.

:thought_balloon: Further folders can be added as needed, but I wouldn’t get carried away. Try to keep them simple and relevant. For example, you might want to also have a media, or ready folder in the project root folder, or something like that.

project

This is your actual project (story so far) folder. Approved (at the time) stuff only in here. You can use any data format you like, but for written stuff I pretty much always just write plain ASCII text documents, there is no heavy reliance on specific software to view the data. But regardless of formatting, everything must be versioned.

You may need other folders than logic and outline depending on the project, I just find those work well for most stuff I do.

The phase.. folders should have subfolders relevant to that phase. For example:

├── phase1
│   ├── 1_prepare_environment
│   ├── 2_test_components
│   ├── 3_full_testing
│   └── ideas


Versioning:

Versioning should be applied to everything inside the project folder, right in the filename. I just use <filename>_v1.4, _v2.0.. and so forth, it’s ridiculously easy to keep track of visually, and I can see that it’s versioning from the v, but as long as you understand your own versioning method, you can use whatever you want.

The easiest possible route to versioning is to just have it follow the current phase of the project. E.g. 3.4 for phase 3, 4th step, but this is not always suitable, it depends..

You can upgrade your versioning system to more detail mid project without (any?) ill effects, as long as you are just adding more detail, i.e. v7.47 - phase 7, 4th step, 7th revision.

Tacking on versions to your files in the project folder soon becomes automatic, and you will easily spot when it’s not there. All good habits.

Versioning checker
niall@desktop ~/W/project_zeus/project> nano validate_v1.0
#!/bin/bash

echo
echo "Unversioned files:"
echo "------------------"
find . -type f ! -name '*v[0-9]*.[0-9]*'
echo
echo "Done."
chmod +x validate_v1.0
niall@desktop ~/W/p/project> ./validate_v1.0

Unversioned files:
------------------
./logic/no_decimal_place_v1.txt
./phase1/ideas/unversioned_file.txt
./phase2/improperly_versioned2.2

Done.

Searching:

Finding stuff

In the same folder:

niall@desktop ~/W/project_zeus/images> find *haha*
haha_you_fanny.jpg

niall@desktop ~/W/project_zeus/images> find *grok*
grok_initial_prompt_response.png

niall@desktop ~/W/project_zeus/images> find *response*
different_response.png
grok_initial_prompt_response.png

niall@desktop ~/W/project_zeus/images>

I pretty much manually rename everything project related that I grab for this reason.


You can do it this way..

Finding all relevant project stuff (from the command line):

niall@desktop ~/W/project_zeus> find . -name "*grok*"
./images/grok_initial_prompt_response.png

niall@desktop ~/W/project_zeus> find . -name "*testing*"
./project/phase1/3_full_testing

niall@desktop ~/W/project_zeus> find . -name "*fanny*"
./images/haha_you_fanny.jpg

niall@desktop ~/W/project_zeus> find . -name "*Corporate*"
./docs/Standard Spiel For Dim Corporate Types.docx

niall@desktop ~/W/project_zeus> find . -name "*v4.0*"
./project/phase3/file_v4.0
./project/logic/file_v4.0
./project/outline/file_v4.0

niall@desktop ~/W/project_zeus> find . -name "*11.4*"
./project/phase3/file_v11.4
./project/logic/file_v11.4
./project/phase2/file_v11.4
./project/outline/file_v11.4

niall@desktop ~/W/project_zeus> find . -name "*png*"
./images/different_response.png
./images/grok_initial_prompt_response.png

niall@desktop ~/W/project_zeus>

Or (in root project folder):

echo 'find . -name "*$1*"' > search
chmod +x search
niall@desktop ~/W/project_zeus> ./search fanny
./images/haha_you_fanny.jpg

niall@desktop ~/W/project_zeus> ./search v1
./project/phase3/file_v11.4
./project/phase3/file_v1.0
./project/logic/file_v11.4
./project/logic/file_v1.0
./project/phase2/file_v11.4
./project/phase2/file_v1.0
./project/outline/file_v11.4
./project/outline/file_v1.0

niall@desktop ~/W/project_zeus> ./search "Standard Spiel"
./docs/Standard Spiel For Dim Corporate Types.docx

niall@desktop ~/W/project_zeus> ./search ok
./images/grok_initial_prompt_response.png

niall@desktop ~/W/project_zeus> ./search file
./project/phase3/file_v11.4
./project/phase3/file_v1.0
./project/phase3/file_v4.0
./project/logic/file_v11.4
./project/logic/file_v1.0
./project/logic/file_v4.0
./project/phase2/file_v11.4
./project/phase2/file_v1.0
./project/outline/file_v11.4
./project/outline/file_v1.0
./project/outline/file_v4.0

niall@desktop ~/W/project_zeus> ./search .docx
./docs/Standard Spiel For Dim Corporate Types.docx

niall@desktop ~/W/project_zeus> ./search prompt
./images/grok_initial_prompt_response.png
./AI/project_prompt.txt
./AI/initial_prompt.txt

niall@desktop ~/W/project_zeus> ./search 3_
./project/phase1/3_full_testing

niall@desktop ~/W/project_zeus> ./search prep
./project/phase1/1_prepare_environment

Backups:

Easy backup

Backing up to server (create this file in your own “projects” folder):

niall@desktop ~/projects> nano backup
#!/bin/bash

backup_destination="niall@server:/home/niall/projects"
rsync -azP $1 $backup_destination
echo "Done."
niall@desktop ~/projects> chmod +x backup

Then:

niall@desktop ~/projects> ls
backup*  project_persephone/  project_zeus/ 

niall@desktop ~/projects> ./backup project_zeus

sending incremental file list
project_zeus/
project_zeus/AI/
project_zeus/AI/output/
project_zeus/AI/prompts/
project_zeus/AI/prompts/initial_prompt.txt
              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=9/18)
project_zeus/AI/prompts/project_prompt.txt
              0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=8/18)
project_zeus/docs/
project_zeus/docs/MS/
project_zeus/docs/PDF/
project_zeus/images/
project_zeus/mess/
project_zeus/mess/mess.txt
              0 100%    0.00kB/s    0:00:00 (xfr#3, to-chk=5/18)
project_zeus/project/
project_zeus/project/logic/
project_zeus/project/outline/
project_zeus/project/phase1/
project_zeus/project/phase2/
project_zeus/project/phase3/
Done.

Files now on server:

niall@desktop ~/projects> ssh niall@server tree ~/projects
 
/home/niall/projects
└── project_zeus
    ├── AI
    │   ├── output
    │   └── prompts
    │       ├── initial_prompt.txt
    │       └── project_prompt.txt
    ├── docs
    │   ├── MS
    │   └── PDF
    ├── images
    ├── mess
    │   └── mess.txt
    └── project
        ├── logic
        ├── outline
        ├── phase1
        ├── phase2
        └── phase3

16 directories, 3 files

niall@desktop ~/projects> 

If everything is up to date:

niall@desktop ~/projects> ./backup project_zeus
 
sending incremental file list
Done.

But if something has changed:

niall@desktop ~/projects> ./backup project_zeus
 
sending incremental file list
project_zeus/AI/prompts/
project_zeus/AI/prompts/initial_prompt.txt
             20 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=9/18)
Done.

niall@desktop ~/projects>
  BYTES   %      SPEED      TIME      FILE #    CHECK
  ---------------------------------------------------
  20      100%   0.00kB/s   0:00:00   (xfr#1,   to-chk=9/18)

Questions:

:thought_balloon: Why do all this manually? Why not automate it all?

Your project is your bonsai tree, grow it with care. Manually creating the basic structure for your project will remind you of what’s involved and create strong roots. If you can get this right, then the project will almost develop itself. The small amount of discipline required simplifies everything.

:thought_balloon: Wait, what if I want to rename my project?

Do the following:

niall@desktop ~/projects> ls
backup*  project_persephone/  project_zeus/

To copy the existing to a new name:

niall@desktop ~/projects> cp -r project_zeus/ project_cronos/

Or to rename without making a copy:

niall@desktop ~/projects> mv project_zeus/ project_cronos/

Then:

niall@desktop ~/projects> ls
backup*  project_cronos/  project_persephone/  /project_zeus

Just leave everything named “project_zeus” or “Project Zeus” inside your project as it is. You will know it now needs revision if there is not a “project_cronos” or “Project Cronos” equivalent file present. If you now successfully backup project_zeus, you can remove it from your projects folder if so desired.

Backup after rename
niall@desktop ~/projects> ./backup project_cronos 
sending incremental file list
created directory /home/niall/projects/project_cronos
./
AI/
AI/output/
AI/prompts/
AI/prompts/initial_prompt.txt
             20 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=9/18)
AI/prompts/project_prompt.txt
              0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=8/18)
docs/
docs/MS/
docs/PDF/
images/
mess/
mess/mess.txt
              0 100%    0.00kB/s    0:00:00 (xfr#3, to-chk=5/18)
project/
project/logic/
project/outline/
project/phase1/
project/phase2/
project/phase3/

sent 721 bytes  received 194 bytes  261.43 bytes/sec
total size is 20  speedup is 0.02
Done.

If you’re happy with my structure..

Automation

Shortcuts for UNIX (Linux, Mac, BSD, etc):

mkdir -p project_zeus/{AI/{prompts,output},docs/{PDF,MS},images,mess,project/{logic,outline,phase1,phase2,phase3}}
touch project_zeus/mess/mess.txt && touch project_zeus/AI/prompts/initial_prompt.txt && touch project_zeus/AI/prompts/project_prompt.txt
niall@desktop ~/tmp> tree
.
└── project_zeus
    ├── AI
    │   ├── output
    │   └── prompts
    │       ├── initial_prompt.txt
    │       └── project_prompt.txt
    ├── docs
    │   ├── MS
    │   └── PDF
    ├── images
    ├── mess
    │   └── mess.txt
    └── project
        ├── logic
        ├── outline
        ├── phase1
        ├── phase2
        └── phase3

16 directories, 3 files
niall@desktop ~/tmp>  

Mess list:

echo 'ls -1 . > mess.txt && echo "Done."' > project_zeus/mess/mess
chmod +x project_zeus/mess/mess
niall@desktop ~/t/p/mess> ./mess
Done.

niall@desktop ~/t/p/mess> cat mess.txt
mess
mess.txt

niall@desktop ~/t/p/mess>

Shortcuts for Windows:

Install WSL | Microsoft Learn


:thought_balloon: Needs full script..


This guide is, of course, not suitable for every project, but should suffice for less complex ones.

Suggestions welcome.

Full script for auto creation.

In your main “projects” folder (bonsai can be whatever you want):

nano bonsai
#!/bin/bash

# bonsai - Plant your project with care
# A simple project structure generator

set -e

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

print_status() {
    echo -e "${GREEN}==>${NC} $1"
}

print_warning() {
    echo -e "${YELLOW}Warning:${NC} $1"
}

print_error() {
    echo -e "${RED}Error:${NC} $1"
}

print_info() {
    echo -e "${BLUE}-->${NC} $1"
}

show_help() {
    cat << EOF
Usage: ./bonsai <project-name>

Example:
    ./bonsai project_zeus

Options:
    -h, --help    Show this help message
EOF
}

# Parse arguments
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    show_help
    exit 0
fi

PROJECT_NAME="$1"

if [ -z "$PROJECT_NAME" ]; then
    print_error "No project name provided"
    show_help
    exit 1
fi

# Check if project directory exists
if [ -d "$PROJECT_NAME" ]; then
    print_error "Directory already exists: $PROJECT_NAME"
    exit 1
fi

# Ask about helper scripts
echo
echo "Would you like to include the helper scripts? (search, backup, mess list, validator) [y/N] "
read -r include_scripts

# Show what will be done
echo
print_info "The following actions will be performed:"
echo "  - Create directory: ./$PROJECT_NAME"
echo "  - Create subdirectories: AI, docs, images, mess, project/{logic,outline,phase1,phase2,phase3}"
echo "  - Create initial files: mess.txt, initial_prompt.txt, project_prompt.txt"

if [[ "$include_scripts" =~ ^[Yy]$ ]]; then
    echo "  - Add helper scripts:"
    echo "      ./$PROJECT_NAME/search"
    echo "      ./$PROJECT_NAME/mess/mess"
    echo "      ./$PROJECT_NAME/project/validate_v1.0"
    if [ -f "backup" ]; then
        echo "      ./backup (already exists - will be skipped)"
    else
        echo "      ./backup"
    fi
fi

echo
echo "Proceed? [y/N] "
read -r confirm

if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
    print_status "Cancelled."
    exit 0
fi

# Create structure
print_status "Creating folder structure..."
mkdir -p "$PROJECT_NAME"/{AI,docs,images,mess,project/{logic,outline,phase1,phase2,phase3}}

# Create initial files
touch "$PROJECT_NAME/mess/mess.txt"
touch "$PROJECT_NAME/AI/initial_prompt.txt"
touch "$PROJECT_NAME/AI/project_prompt.txt"

# Add helper scripts if requested
if [[ "$include_scripts" =~ ^[Yy]$ ]]; then
    print_status "Adding helper scripts..."
    
    # search script in project root
    cat > "$PROJECT_NAME/search" << 'EOF'
#!/bin/bash
# Usage: ./search <pattern>

if [ $# -eq 0 ]; then
    echo "Usage: ./search <pattern>"
    exit 1
fi

find . -name "*$1*" 2>/dev/null
EOF
    chmod +x "$PROJECT_NAME/search"
    print_info "Created $PROJECT_NAME/search"
    
    # mess list script
    cat > "$PROJECT_NAME/mess/mess" << 'EOF'
#!/bin/bash
# List current directory contents
ls -1 . > mess.txt
echo "Done."
EOF
    chmod +x "$PROJECT_NAME/mess/mess"
    print_info "Created $PROJECT_NAME/mess/mess"
    
    # validation script in project folder
    cat > "$PROJECT_NAME/project/validate_v1.0" << 'EOF'
#!/bin/bash

echo
echo "Unversioned files:"
echo "------------------"
find . -type f ! -name '*v[0-9]*.[0-9]*'
echo
echo "Done."
EOF
    chmod +x "$PROJECT_NAME/project/validate_v1.0"
    print_info "Created $PROJECT_NAME/project/validate_v1.0"
    
    # backup script in parent directory (same level as bonsai)
    if [ -f "backup" ]; then
        print_warning "backup script already exists, skipping..."
    else
        cat > "backup" << 'EOF'
#!/bin/bash
# Bonsai backup script - edit the destination before using
# Usage: ./backup <project-folder>

# Check if the project folder was specified:
if [ $# -eq 0 ]; then
    echo "Usage: ./backup <project-folder>"
    echo "Example: ./backup project_projectable"
    exit 1
fi

# The full string prepared for rsync:
PROJECT="$1"
DEST="niall@server:/home/niall/projects/"  # e.g., user@server:/home/user/projects/
TARGET="$DEST$PROJECT"

# Check if project folder exists:
if [ ! -d "$PROJECT" ]; then
    echo "Project folder not found: $PROJECT"
    exit 1
fi

# Check if destination has been set:
if [ -z "$DEST" ]; then
    echo "Please edit this script and set DEST first"
    exit 1
fi

# Confirm the operation:
echo
echo "Backing up to: $TARGET"
echo
echo "Confirm?"

read -r confirm
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
    echo "Cancelled."
    exit 0
fi

# Perform the operation using rsync.
rsync -azP "$PROJECT" "$TARGET"
echo "Done."
EOF
        chmod +x "backup"
        print_info "Created ./backup"
        print_warning "Don't forget to edit ./backup and set DEST if needed"
    fi
fi

print_status "Done. Project created at ./$PROJECT_NAME"

if [[ "$include_scripts" =~ ^[Yy]$ ]]; then
    echo
    echo "Helper scripts available:"
    echo "  ./$PROJECT_NAME/search                - Find files"
    echo "  ./$PROJECT_NAME/mess/mess             - Update mess list"
    echo "  ./$PROJECT_NAME/project/validate_v1.0 - Check versioning"
    echo "  ./backup                              - Backup (configure first)"
fi

exit 0

Then:

chmod +x bonsai

To run:

./bonsai project_name

To backup: Alter the DEST in the script, e.g. DEST="niall@server:/home/niall/projects/"

nano backup
./backup project_name

Suggestions welcome.

Syntax highlighting - #3 by niallm12