# ANTIGRAVITY TERMINAL OPTIMIZATION PRD
**Version:** 1.0
**Date:** 2026-01-16
**Model:** Gemini Flash 2.0 via Ralph Wiggum Loop
**Location:** `/mnt/e/genesis-system/setup/` (and various)

---

## PROJECT METADATA

| Field | Value |
|-------|-------|
| Project | Antigravity Terminal & System Optimization |
| Location | `/mnt/e/genesis-system/` |
| Target | Antigravity IDE Terminal (PowerShell), System Maintenance |
| Execution | Gemini Flash 2.0 |
| Max Iterations | 30 per story |
| Total Stories | 5 |

---

## USER STORIES

### US-001: Research & Strategy Analysis
**Goal:** Analyze the current terminal environment and Antigravity setup to identify optimization opportunities.
**Acceptance Criteria:**
```
GIVEN the need for "full power production" capability
WHEN the agent analyzes standard devops/terminal patterns
THEN produce a comprehensive finding report detailing recommended aliases, tools, and config changes
```
**Files to Create:**
- `/mnt/e/genesis-system/plans/ANTIGRAVITY_OPTIMIZATION_FINDINGS.md`

**Dependencies:** None
**Technical Hints:**
- Research best practices for Windows Terminal + PowerShell 7+ for AI development
- Identify useful aliases (e.g., `ll` for `ls -l`, git shortcuts)
- Suggest environment variable optimizations (PYTHONPATH, PATH)
- Recommend cleanup policies for logs/archives

### US-002: PowerShell Optimization Suite
**Goal:** Create scripts to optimize the PowerShell profile and environment.
**Acceptance Criteria:**
```
GIVEN the findings from US-001
WHEN the profile scripts are generated
THEN they should include robust aliases, prompt configuration (if possible), and path fixes
```
**Files to Create:**
- `/mnt/e/genesis-system/setup/optimize_profile.ps1`
- `/mnt/e/genesis-system/setup/antigravity_profile_additions.ps1`

**Dependencies:** US-001
**Technical Hints:**
- `optimize_profile.ps1` should be a standalone script to BACKUP the existing profile and APPEND/CREATE the new configs.
- `antigravity_profile_additions.ps1` should contain the actual functions/aliases (e.g., `gs` -> `git status`, custom python runners).
- Add a function to quickly jump to `e:\genesis-system` (`cgs` - cd genesis system).

### US-003: System Cleanup Automation
**Goal:** Create a Python script to deeply clean the genesis system (temp files, logs, pycache).
**Acceptance Criteria:**
```
GIVEN the system accumulates clutter (logs, __pycache__, .tmp)
WHEN `cleanup_genesis.py` is executed
THEN it safely removes defined temporary artifacts without touching user data
```
**Files to Create:**
- `/mnt/e/genesis-system/maintenance/cleanup_genesis.py`

**Dependencies:** US-001
**Technical Hints:**
- Use `pathlib` for file operations.
- Target: `**/__pycache__`, `*.pyc`, `.pytest_cache`, `logs/*.log` (older than 7 days), `tmp/*`.
- Include a `--dry-run` mode for safety.
- Print clear summary of reclaimed space.

### US-004: Performance Tuning & Tools
**Goal:** Optimization scripts for tools (Git, Pip, etc.) and global settings.
**Acceptance Criteria:**
```
GIVEN tools like Git can be slow on large repos
WHEN `tune_productivity.ps1` is run
THEN it applies git config optimizations and checks tool availability
```
**Files to Create:**
- `/mnt/e/genesis-system/setup/tune_productivity.ps1`
- `/mnt/e/genesis-system/.gitignore_global_recommended`

**Dependencies:** US-001
**Technical Hints:**
- Git: `core.autocrlf`, `core.longpaths`, `credential.helper`.
- Pip: Ensure upgrade, check for `uv` or modern installers.
- Create a recommended global ignore file.

### US-005: Operational Verification
**Goal:** A "Green Light" verification script to prove full operational capability.
**Acceptance Criteria:**
```
GIVEN customizations are applied
WHEN `verify_genesis_health.py` is run
THEN it reports status of Python env, Tools (git, rg, fd), and Path accessibility
```
**Files to Create:**
- `/mnt/e/genesis-system/maintenance/verify_genesis_health.py`

**Dependencies:** US-001, US-002, US-003, US-004
**Technical Hints:**
- Check specific commands: `git --version`, `rg --version`, `fd --version`.
- Verify `PYTHONPATH` includes `e:\genesis-system`.
- Check write permissions in key dirs.
- Output a colorful "SYSTEM READY" or "SYSTEM DEGRADED" status.
