Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions the-unit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# THE UNIT — Daily Project Alert

Personal productivity scanner that walks your local `The_Unit_Assembly/`
directory and lists every `.py` / `.txt` file in each "Hub" subfolder that is
still pending review and finalization.

## Layout

```
the-unit/
├── unit_alert.py # The scanner script
└── The_Unit_Assembly/ # Master folder; one subfolder per Hub
├── Hub_Lead_Generation/
├── Hub_CRM_Automation/
└── Hub_Content_Engine/
```

Drop pasted AI-generated code into the appropriate Hub as `.py` or `.txt`
files. Anything sitting in a Hub is treated as "waiting to be finished".

## Usage

```bash
# From repo root
python3 the-unit/unit_alert.py

# Or point at a Unit Assembly folder living elsewhere
python3 the-unit/unit_alert.py --dir /path/to/The_Unit_Assembly
```

The script prints a daily-dated banner, lists pending files per Hub, and ends
with a total count plus a one-action nudge ("pick ONE file today").

## Tip

Add it to your morning routine alongside `norcal-toolkit/daily_workflow.py` so
both pipelines (sales follow-ups and code finalization) get a daily ping.
Empty file.
Empty file.
Empty file.
83 changes: 83 additions & 0 deletions the-unit/unit_alert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env python3
"""
THE UNIT — Daily Project Alert
Scans your local Hub directories under ``The_Unit_Assembly`` and prints a
daily list of code files (.py / .txt) that are still pending review and
finalization.

Usage:
python3 unit_alert.py
python3 unit_alert.py --dir /custom/path/to/The_Unit_Assembly
"""
import argparse
import datetime
import os
import sys

DEFAULT_UNIT_DIRECTORY = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"The_Unit_Assembly",
)


def scan_projects(unit_directory: str) -> int:
"""Scan local Hub directories and print a daily alert of pending work.

Returns the total number of pending files found.
"""
today = datetime.date.today()
print("\n====================================================")
print(f" 🚨 THE UNIT: DAILY PROJECT ALERT for {today} 🚨")
print("====================================================\n")

if not os.path.exists(unit_directory):
print(f"Directory '{unit_directory}' not found.")
print("Please create it and add your 'Hub' folders to get started.")
return 0

hubs = sorted(
f.name for f in os.scandir(unit_directory) if f.is_dir()
)

if not hubs:
print("Your Unit directory is currently empty.")
print("Action: Run the AI Extraction Prompts and paste the code into your Hubs!")
return 0

total_files = 0

for hub in hubs:
hub_path = os.path.join(unit_directory, hub)
files = sorted(
f for f in os.listdir(hub_path)
if f.endswith(".py") or f.endswith(".txt")
)

print(f"📁 HUB: {hub.replace('_', ' ').upper()}")
if not files:
print(" - Empty (No pending tasks here)")
else:
for file in files:
print(f" 📄 {file} -> Status: Needs review and finalization")
total_files += 1
print("")

print(f"--- Summary: You have {total_files} pieces of code waiting to be finished. ---")
print("Pick ONE file today, share it with your Coding Partner, and let's complete it.")
return total_files


def main() -> int:
parser = argparse.ArgumentParser(description="THE UNIT — Daily Project Alert")
parser.add_argument(
"--dir",
default=DEFAULT_UNIT_DIRECTORY,
help=f"Path to The_Unit_Assembly directory (default: {DEFAULT_UNIT_DIRECTORY})",
)
args = parser.parse_args()
scan_projects(args.dir)
return 0


if __name__ == "__main__":
sys.exit(main())