feat: Workspace page enhancements - git ops, Gitea auto-create, compact stories

- Add workspace.html with project cards, Ralph status, git info
- Backend: git diff/commit/push endpoints, project delete with confirmation
- Push auto-creates Gitea repo (romfast org) when no remote configured
- GITEA_TOKEN read from dashboard/.env file
- Compact collapsible user stories (emoji row + expand on click)
- Action buttons: Diff (with count badge), Commit, Push, README, Delete
- Fix openPrd/openReadme to use hash navigation for files.html
- Add .gitignore template to ralph.sh for new projects
- Unify branches: merge main into master, delete main

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Echo
2026-02-09 12:21:13 +00:00
parent e47f2179ea
commit e92284645c
10 changed files with 1771 additions and 117 deletions

124
AGENTS.md
View File

@@ -32,118 +32,24 @@ When I receive errors, bugs, or new feature requests:
1. **Planning → Opus**: Architecture, strategy, design decisions
2. **Execution → Sonnet**: Implementation, coding, debugging, testing
## Proiecte/Features Workflow (MANDATORY)
## Proiecte/Features Workflow
**Scop:** Propun și creez programe/proiecte în cod care îl ajută pe Marius (80/20), inspirate din Discovery (YouTube, articole, bloguri).
**Scop:** Propun proiecte 80/20 in evening-report, implementez cu Ralph in night-execute.
**Tools:** tools/ralph_prd_generator.py, tools/ralph_workflow.py
**Workspace:** ~/workspace/ | **Tracking:** memory/approved-tasks.md
**Model strategy:** Opus (planning/PRD) → Sonnet (implementare Ralph)
### Criterii Propuneri (80/20 STRICT)
- Impact mare pentru Marius → apoi pentru clienți
- Proiecte de "joacă" pentru el mai întâi (să vadă cum îl ajută)
- Din ce îl interesează (USER.md)
- Inspirat din conținut procesat (memory/kb/youtube/, articole/, insights/)
- **NU orice** - doar cu valoare concretă
### Context Proiecte Prioritare
- **roa2web** (gitea.romfast.ro/romfast/roa2web) - rapoarte, interfata web, notificari ERP ROA
- Rapoarte ROA noi → feature in roa2web (NU proiect separat)
- **Chatbot Maria** (Flowise, LXC 104) - documentatie, raspunsuri clienti
- Imbunatatiri chatbot → documentatie + configurare Flowise
- **Proiecte independente** → ~/workspace/ cu Ralph autonom
### Workflow Complet
**1. SEARA (20:00) - evening-report:**
- Propun 1-2 proiecte NOI (P1, P2)
- Propun 2-3 features pentru proiecte EXISTENTE (F1, F2, F3)
- Format: context, impact, efort, stack simplu
- Marius aprobă: "P pentru P1,P2" sau "F pentru F1,F3"
**2. NOAPTE (23:00, 03:00) - night-execute:**
**A. Planning cu OPUS (eu, Echo) - pe moltbot:**
```python
from tools.ralph_prd_generator import create_prd_and_json
from tools.ralph_workflow import run_ralph
import subprocess
# Pentru fiecare proiect aprobat
prd_file, prd_json = create_prd_and_json(
project_name="project-name", # kebab-case
description="Descriere completă cu Features:\n- Feature 1\n- Feature 2",
workspace_dir=Path.home() / "workspace"
)
# Git init + push
project_dir = prd_json.parent.parent.parent
subprocess.run(["git", "init"], cwd=project_dir)
subprocess.run(["git", "add", "."], cwd=project_dir)
subprocess.run(["git", "commit", "-m", "Initial commit with PRD"], cwd=project_dir)
subprocess.run(["git", "remote", "add", "origin", f"https://gitea.romfast.ro/romfast/PROJECT"], cwd=project_dir)
subprocess.run(["git", "push", "-u", "origin", "main"], cwd=project_dir)
# Lansează Ralph
run_ralph(prd_json, max_iterations=20, background=True)
# Marchează [x] în approved-tasks.md
```
**B. Implementare cu Ralph (Sonnet) - automat în background:**
- ralph.sh rulează autonom:
1. Selectează story (priority minimă, passes=false)
2. Rulează Claude Code (Sonnet) pentru implementare
3. Quality checks: typecheck, lint, test
4. Git commit dacă OK → passes: true
5. Update progress.txt cu learnings
6. Repetă până complete sau max 20 iterații
- Git push automat
**3. DIMINEAȚĂ (08:30) - morning-report:**
```python
from tools.ralph_workflow import check_status
from pathlib import Path
status = check_status(Path.home() / "workspace" / "PROJECT-NAME")
# Raportez: stories complete/incomplete, learnings, link gitea
```
- Status per story: ✅ complet / 🔄 în progres / ⚠️ blocat
- Learnings din progress.txt
- Link gitea: `https://gitea.romfast.ro/romfast/PROJECT-NAME`
### Mașină Development
**moltbot (LXC 110) - LOCAL:**
- User: moltbot
- Workspace: `~/workspace/`
- Claude Code: `~/.local/bin/claude` (v2.1.37)
- Ralph tools:
- `~/clawd/tools/ralph_prd_generator.py` - Generează PRD și prd.json (Python)
- `~/clawd/tools/ralph_workflow.py` - Wrapper (lansare Ralph)
- `~/clawd/skills/ralph/templates/` - ralph.sh, prompt.md (copiate în proiecte)
- Templates copiate automat în fiecare proiect
### Model Strategy (OBLIGATORIU)
- **Opus** → Planning, PRD, stories (eu, Echo în night-execute)
- **Sonnet** → Coding, debugging, implementare (Ralph loop)
### Structură Proiect
```
/workspace/PROJECT-NAME/
├── tasks/
│ └── prd-PROJECT-NAME.md # PRD generat de /prd skill
├── scripts/
│ └── ralph/
│ ├── prd.json # Stories pentru Ralph
│ ├── progress.txt # Learnings per iterație
│ └── ralph.sh # Loop autonom
├── src/ # Cod implementat de Ralph
└── .git/ # Git repo → gitea
```
### Tracking
- `memory/approved-tasks.md` - include proiecte (P1, P2) și features (F1, F2)
- Secțiuni: "Noaptea asta" + "Nopțile următoare"
- Format: `[ ] P1 - Nume Proiect: descriere scurtă`
### Exemple Domenii
- Automatizări pentru ROA (scripturile lui Marius)
- Unelte productivitate (task tracking, reminder-uri)
- Mini-tools pentru clienți (rapoarte, validări)
- Experimente NLP/coaching (exerciții interactive)
- Tracking sănătate (dureri, pauze respirație)
### Surse Inspiratie
- Intrebari frecvente clienti (validari ANAF D406/D394, facturare valuta, taxare inversa)
- Note din memory/kb/ (youtube, insights, articole)
- Probleme repetitive ale lui Marius
## Memory