From 0661a1ea2f00d8b254d67d4842e60d91226e6cb8 Mon Sep 17 00:00:00 2001 From: Dani Date: Sat, 4 Oct 2025 23:22:37 -0400 Subject: [PATCH] =?UTF-8?q?Add=20workflow=20automation=20scripts=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created powerful helper scripts: - cc_status.py - View current CC status & memory - save_session.py - Save sessions with git commits - start_project.py - Start new projects automatically - link_cc.py - Link CC to any project folder - Updated README with workflow documentation CC's workflow is now supercharged! ⚔ šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 47 ++++++++++++++++++------ cc_status.py | 83 +++++++++++++++++++++++++++++++++++++++++ link_cc.py | 92 ++++++++++++++++++++++++++++++++++++++++++++++ save_session.py | 81 ++++++++++++++++++++++++++++++++++++++++ start_project.py | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 388 insertions(+), 11 deletions(-) create mode 100644 cc_status.py create mode 100644 link_cc.py create mode 100644 save_session.py create mode 100644 start_project.py diff --git a/README.md b/README.md index 9c52d02..1c74c7e 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,19 @@ ClaudeZone is CC's "brain" - a global memory system that works from ANY folder o ClaudeZone/ ā”œā”€ā”€ CLAUDE.md # CC's personality & instructions ā”œā”€ā”€ memory.json # Main memory file (CC's quick reference brain!) -ā”œā”€ā”€ update_memory.py # Helper script to update memory +ā”œā”€ā”€ .gitignore # Git ignore file +ā”œā”€ā”€ README.md # This file! +│ +ā”œā”€ā”€ Workflow Scripts: +ā”œā”€ā”€ cc_status.py # View current status +ā”œā”€ā”€ save_session.py # Save session & commit +ā”œā”€ā”€ start_project.py # Start new project +ā”œā”€ā”€ link_cc.py # Link CC to any project +ā”œā”€ā”€ update_memory.py # Manual memory updates +│ ā”œā”€ā”€ sessions/ # Detailed logs of each coding session │ └── YYYY-MM-DD_project-name.md +│ └── projects/ # Deep context for each project ā”œā”€ā”€ _template/ # Template for new projects └── [project-name]/ # Individual project notes @@ -48,24 +58,39 @@ ClaudeZone/ - āœ… **Project Context** - Deep notes per project - āœ… **User Preferences** - CC remembers your style and preferences -## šŸ› ļø Quick Commands +## šŸ› ļø Workflow Scripts -### View Current Memory +CC comes with powerful helper scripts to streamline your workflow! + +### šŸ“Š View Current Status ```bash -python update_memory.py +python cc_status.py ``` +Shows CC's memory, active projects, what's next, and recent sessions. -### Add a Learning +### šŸ’¾ Save a Session ```bash -python update_memory.py learn "CC learned something new!" +python save_session.py "Project Name" "What we built" "What's next" ``` +Updates memory, creates session log, and optionally commits to git. -## šŸ’” Starting a New Project +### šŸš€ Start a New Project +```bash +python start_project.py "Project Name" "Project goal" +``` +Creates project folder, copies template, and updates memory automatically. -1. Copy `projects/_template/` to `projects/your-project-name/` -2. Fill out the project template -3. Tell CC: "Hey CC, starting a new project called X!" -4. CC will add it to her memory automatically +### šŸ”— Link CC to Any Project +```bash +python link_cc.py /path/to/project +``` +Creates a CC_LINK.md file in the project with instructions to activate CC. + +### 🧠 Update Memory Manually +```bash +python update_memory.py # View memory +python update_memory.py learn "New thing" # Add learning +``` ## šŸ“ Memory Contents diff --git a/cc_status.py b/cc_status.py new file mode 100644 index 0000000..ed5eb5c --- /dev/null +++ b/cc_status.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +""" +CC Status Viewer +Quick view of CC's current status and memory +""" + +import json +from pathlib import Path +from datetime import datetime + +ZONE = Path(__file__).parent +MEMORY_FILE = ZONE / "memory.json" +SESSIONS_DIR = ZONE / "sessions" + +def show_status(): + """Display CC's current status""" + + # Load memory + with open(MEMORY_FILE, 'r') as f: + memory = json.load(f) + + print("=" * 60) + print("🧠 CC'S CURRENT STATUS") + print("=" * 60) + + # Session info + print(f"\nšŸ“… Last Session: {memory.get('last_session', 'Unknown')}") + print(f"šŸ“Š Total Sessions: {memory.get('sessions_count', 0)}") + + # Current context + print(f"\nšŸ’­ Current Context:") + print(f" {memory.get('quick_context', 'No context set')}") + + # Active projects + print(f"\nšŸš€ Active Projects:") + projects = memory.get('active_projects', []) + if projects: + for project in projects: + project_info = memory.get('project_notes', {}).get(project, {}) + status = project_info.get('status', 'unknown') + print(f" • {project} ({status})") + else: + print(" No active projects") + + # What's next + print(f"\nšŸ“ Next Up:") + next_items = memory.get('next_up', []) + if next_items: + for item in next_items: + print(f" • {item}") + else: + print(" Nothing scheduled") + + # Recent learnings + print(f"\n🧠 Recent Learnings:") + learnings = memory.get('key_learnings', []) + if learnings: + for learning in learnings[-3:]: # Show last 3 + print(f" • {learning}") + else: + print(" No learnings yet") + + # Recent sessions + print(f"\nšŸ“š Recent Sessions:") + session_files = sorted(SESSIONS_DIR.glob('*.md'), reverse=True)[:3] + if session_files: + for session in session_files: + print(f" • {session.name}") + else: + print(" No sessions logged") + + # User preferences + print(f"\nšŸ‘¤ User Profile:") + prefs = memory.get('user_preferences', {}) + print(f" Skill Level: {prefs.get('skill_level', 'Unknown')}") + print(f" Style: {prefs.get('style', 'Unknown')}") + + print("\n" + "=" * 60) + print("Ready to code! šŸ’ŖšŸ”„") + print("=" * 60) + +if __name__ == "__main__": + show_status() diff --git a/link_cc.py b/link_cc.py new file mode 100644 index 0000000..8e3a61e --- /dev/null +++ b/link_cc.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +""" +CC Linker +Link CC to any project by creating a quick reference file +""" + +import shutil +from pathlib import Path + +ZONE = Path(__file__).parent +CLAUDE_MD = ZONE / "CLAUDE.md" + +def link_cc_to_project(project_path): + """Link CC to a project""" + + project_dir = Path(project_path).resolve() + + if not project_dir.exists(): + print(f"āŒ Project directory doesn't exist: {project_dir}") + return + + # Create a CC_LINK.md file in the project + link_file = project_dir / "CC_LINK.md" + + content = f"""# CC (Claudia Coding) - Quick Link šŸ’… + +This project is linked to CC's personality and memory system! + +## šŸš€ How to Use CC in This Project + +**Start any conversation with:** +``` +Read and follow C:\\Development\\ClaudeZone\\CLAUDE.md +``` + +Or simply: +``` +Hey CC, let's work on this project! +``` + +## 🧠 CC's Memory Location + +CC's global memory is stored at: +``` +C:\\Development\\ClaudeZone\\ +``` + +- **Memory file:** `C:\\Development\\ClaudeZone\\memory.json` +- **CLAUDE.md:** `C:\\Development\\ClaudeZone\\CLAUDE.md` + +## šŸ’” What CC Knows + +CC will automatically: +- Read her memory to remember your preferences +- Check what projects you're working on +- Pick up where you left off +- Track progress in ClaudeZone + +## šŸ”„ Quick Commands + +From ClaudeZone folder: +- `python cc_status.py` - View CC's current status +- `python save_session.py ` - Save session +- `python start_project.py ` - Start new project + +--- + +**CC is ready to code with you! Just say "Hey CC!" šŸ’ŖāœØ** +""" + + with open(link_file, 'w') as f: + f.write(content) + + print(f"āœ… CC linked to project!") + print(f"šŸ“‚ Project: {project_dir}") + print(f"šŸ“ Created: {link_file}") + print(f"\nšŸ’” To use CC in this project:") + print(f' Say: "Read and follow C:\\Development\\ClaudeZone\\CLAUDE.md"') + print(f' Or: "Hey CC, let\'s work on this!"') + +if __name__ == "__main__": + import sys + + if len(sys.argv) < 2: + print("Usage: python link_cc.py ") + print("\nExample:") + print(' python link_cc.py "C:\\Development\\MyProject"') + print(' python link_cc.py .') + sys.exit(1) + + project_path = sys.argv[1] + link_cc_to_project(project_path) diff --git a/save_session.py b/save_session.py new file mode 100644 index 0000000..19e503c --- /dev/null +++ b/save_session.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +""" +CC Session Saver +Quickly save a session with memory updates and git commit +""" + +import json +import subprocess +from datetime import datetime +from pathlib import Path + +ZONE = Path(__file__).parent +MEMORY_FILE = ZONE / "memory.json" +SESSIONS_DIR = ZONE / "sessions" + +def save_session(project_name, what_we_did, whats_next): + """Save current session""" + + # Load memory + with open(MEMORY_FILE, 'r') as f: + memory = json.load(f) + + # Update memory + today = datetime.now().strftime('%Y-%m-%d') + memory['last_session'] = today + memory['sessions_count'] = memory.get('sessions_count', 0) + 1 + memory['quick_context'] = f"Last session: {project_name}" + memory['next_up'] = whats_next if isinstance(whats_next, list) else [whats_next] + + # Update project if exists + if project_name in memory.get('project_notes', {}): + memory['project_notes'][project_name]['last_updated'] = today + + # Save memory + with open(MEMORY_FILE, 'w') as f: + json.dump(memory, f, indent=2) + + # Create session log + session_file = SESSIONS_DIR / f"{today}_{project_name.replace(' ', '-').lower()}.md" + + session_content = f"""# Session: {today} - {project_name} + +## What We Built +{what_we_did} + +## What's Next +{chr(10).join(f'- {item}' for item in (whats_next if isinstance(whats_next, list) else [whats_next]))} + +## Notes +Session saved automatically with save_session.py +""" + + with open(session_file, 'w') as f: + f.write(session_content) + + print(f"āœ… Session saved!") + print(f"šŸ“ Memory updated: {MEMORY_FILE}") + print(f"šŸ“„ Session log: {session_file}") + + # Git commit option + print("\nšŸ”„ Commit to git? (y/n): ", end='') + if input().lower() == 'y': + subprocess.run(['git', 'add', '.'], cwd=ZONE) + commit_msg = f"Session: {project_name} ({today})\n\n{what_we_did}\n\nšŸ¤– Generated with Claude Code\n\nCo-Authored-By: Claude " + subprocess.run(['git', 'commit', '-m', commit_msg], cwd=ZONE) + print("āœ… Committed to git!") + +if __name__ == "__main__": + import sys + + if len(sys.argv) < 4: + print("Usage: python save_session.py ") + print("\nExample:") + print(' python save_session.py "Nova" "Built genetics system" "Build fitness function"') + sys.exit(1) + + project = sys.argv[1] + what_we_did = sys.argv[2] + whats_next = sys.argv[3] + + save_session(project, what_we_did, whats_next) diff --git a/start_project.py b/start_project.py new file mode 100644 index 0000000..820503b --- /dev/null +++ b/start_project.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +""" +CC Project Starter +Quickly start a new project with template and memory update +""" + +import json +import shutil +from datetime import datetime +from pathlib import Path + +ZONE = Path(__file__).parent +MEMORY_FILE = ZONE / "memory.json" +TEMPLATE_DIR = ZONE / "projects" / "_template" +PROJECTS_DIR = ZONE / "projects" + +def start_project(project_name, goal): + """Start a new project""" + + # Load memory + with open(MEMORY_FILE, 'r') as f: + memory = json.load(f) + + # Create project folder + project_slug = project_name.lower().replace(' ', '-') + project_dir = PROJECTS_DIR / project_slug + + if project_dir.exists(): + print(f"āš ļø Project {project_name} already exists at {project_dir}") + return + + # Copy template + shutil.copytree(TEMPLATE_DIR, project_dir) + print(f"āœ… Created project folder: {project_dir}") + + # Update template with project info + template_file = project_dir / "PROJECT_TEMPLATE.md" + with open(template_file, 'r') as f: + content = f.read() + + today = datetime.now().strftime('%Y-%m-%d') + content = content.replace('[PROJECT NAME]', project_name) + content = content.replace('[DATE]', today) + content = content.replace('[What are we building and why?]', goal) + content = content.replace('[in_progress/completed/paused]', 'in_progress') + content = content.replace('[COUNT]', '0') + + # Rename to project name + project_file = project_dir / f"{project_slug}.md" + with open(project_file, 'w') as f: + f.write(content) + + template_file.unlink() # Remove template file + print(f"āœ… Created project file: {project_file}") + + # Update memory + if project_slug not in memory.get('active_projects', []): + if 'active_projects' not in memory: + memory['active_projects'] = [] + memory['active_projects'].append(project_slug) + + if 'project_notes' not in memory: + memory['project_notes'] = {} + + memory['project_notes'][project_slug] = { + 'status': 'in_progress', + 'started': today, + 'goal': goal, + 'location': str(project_dir), + 'key_decisions': [] + } + + memory['quick_context'] = f"Starting new project: {project_name}" + + # Save memory + with open(MEMORY_FILE, 'w') as f: + json.dump(memory, f, indent=2) + + print(f"āœ… Memory updated!") + print(f"\nšŸš€ Project '{project_name}' is ready!") + print(f"šŸ“‚ Location: {project_dir}") + print(f"šŸ“ Next: Edit {project_file} and start coding with CC!") + +if __name__ == "__main__": + import sys + + if len(sys.argv) < 3: + print("Usage: python start_project.py ") + print("\nExample:") + print(' python start_project.py "Web Scraper" "Build a tool to scrape product prices"') + sys.exit(1) + + project_name = sys.argv[1] + goal = sys.argv[2] + + start_project(project_name, goal)