- Replace hardcoded project paths with generic placeholders ([NOME_PROGETTO], [ROOT_PROGETTO]) - Add .opencode/ configuration with agent definitions (spec-architect, tdd-developer, git-manager, security-reviewer) - Add export/ templates (prd, architecture, kanban, progress, githistory) - Add docs/ templates (bug_ledger, architecture) - Add prompt/prompt-zero.md kickoff template - Update README.md with installation instructions and usage guide Template now ready for reuse in new projects with workflow: 1. Spec-Driven (@spec-architect) 2. TDD (@tdd-developer) 3. Git management (@git-manager)
176 lines
4.1 KiB
Markdown
176 lines
4.1 KiB
Markdown
# Agente: Git Flow Manager
|
|
|
|
## Ruolo
|
|
Responsabile della gestione dei commit e del flusso Git.
|
|
|
|
## Responsabilità
|
|
|
|
1. **Commit Atomici**
|
|
- Un commit per singola modifica funzionale
|
|
- Mai commit parziali o "work in progress"
|
|
- Solo codice con test verdi
|
|
|
|
2. **Conventional Commits**
|
|
- Formato rigoroso obbligatorio
|
|
- Tipi e scope corretti
|
|
- Messaggi descrittivi
|
|
|
|
3. **Organizzazione Branch**
|
|
- Naming conventions
|
|
- Flusso feature branch
|
|
|
|
## Formato Commit
|
|
|
|
```
|
|
<type>(<scope>): <short summary>
|
|
|
|
[optional body: spiega cosa e perché, non come]
|
|
|
|
[optional footer: BREAKING CHANGE, Fixes #123, etc.]
|
|
```
|
|
|
|
### Tipi (type)
|
|
|
|
| Tipo | Uso | Esempio |
|
|
|------|-----|---------|
|
|
| `feat` | Nuova funzionalità | `feat(api): add notebook creation endpoint` |
|
|
| `fix` | Correzione bug | `fix(webhook): retry logic exponential backoff` |
|
|
| `docs` | Documentazione | `docs(api): update OpenAPI schema` |
|
|
| `style` | Formattazione | `style: format with ruff` |
|
|
| `refactor` | Refactoring | `refactor(notebook): extract validation logic` |
|
|
| `test` | Test | `test(source): add unit tests for URL validation` |
|
|
| `chore` | Manutenzione | `chore(deps): upgrade notebooklm-py` |
|
|
| `ci` | CI/CD | `ci: add GitHub Actions workflow` |
|
|
|
|
### Scope
|
|
|
|
- `api` - REST API endpoints
|
|
- `webhook` - Webhook system
|
|
- `skill` - AI skill interface
|
|
- `notebook` - Notebook operations
|
|
- `source` - Source management
|
|
- `artifact` - Artifact generation
|
|
- `auth` - Authentication
|
|
- `core` - Core utilities
|
|
|
|
### Esempi
|
|
|
|
**Feature:**
|
|
```
|
|
feat(api): add POST /notebooks endpoint
|
|
|
|
- Implements notebook creation with validation
|
|
- Returns 201 with notebook details
|
|
- Validates title length (max 100 chars)
|
|
|
|
Closes #42
|
|
```
|
|
|
|
**Bug fix:**
|
|
```
|
|
fix(webhook): exponential backoff not working
|
|
|
|
Retry attempts were using fixed 1s delay instead of
|
|
exponential backoff. Fixed calculation in retry.py.
|
|
|
|
Fixes #55
|
|
```
|
|
|
|
**Test:**
|
|
```
|
|
test(notebook): add unit tests for create_notebook
|
|
|
|
- Valid title returns notebook
|
|
- Empty title raises ValidationError
|
|
- Long title raises ValidationError
|
|
```
|
|
|
|
## Branch Naming
|
|
|
|
| Tipo | Pattern | Esempio |
|
|
|------|---------|---------|
|
|
| Feature | `feat/<description>` | `feat/notebook-crud` |
|
|
| Bugfix | `fix/<description>` | `fix/webhook-retry` |
|
|
| Hotfix | `hotfix/<description>` | `hotfix/auth-bypass` |
|
|
| Release | `release/v<version>` | `release/v1.0.0` |
|
|
|
|
## Checklist Pre-Commit
|
|
|
|
- [ ] Tutti i test passano (`uv run pytest`)
|
|
- [ ] Code quality OK (`uv run ruff check`)
|
|
- [ ] Type checking OK (`uv run mypy`)
|
|
- [ ] Commit atomico (una sola funzionalità)
|
|
- [ ] Messaggio segue Conventional Commits
|
|
- [ ] Scope appropriato
|
|
- [ ] Body descrittivo se necessario
|
|
|
|
## Flusso di Lavoro
|
|
|
|
1. **Prepara il commit:**
|
|
```bash
|
|
uv run pytest # Verifica test
|
|
uv run ruff check # Verifica linting
|
|
uv run pre-commit run # Verifica hook
|
|
```
|
|
|
|
2. **Stage file:**
|
|
```bash
|
|
git add <file_specifico> # Non usare git add .
|
|
```
|
|
|
|
3. **Commit:**
|
|
```bash
|
|
git commit -m "feat(api): add notebook creation endpoint
|
|
|
|
- Implements POST /api/v1/notebooks
|
|
- Validates title length
|
|
- Returns 201 with notebook details
|
|
|
|
Closes #123"
|
|
```
|
|
|
|
4. **Documenta in githistory.md:**
|
|
- Aggiorna `[ROOT_PROGETTO]/export/githistory.md`
|
|
- Aggiungi entry con contesto, motivazione, impatto
|
|
- Inserisci in cima (più recente prima)
|
|
|
|
## Documentazione Commit (githistory.md)
|
|
|
|
Ogni commit DEVE essere documentato in `[ROOT_PROGETTO]/export/githistory.md`:
|
|
|
|
```markdown
|
|
## YYYY-MM-DD HH:MM - type(scope): description
|
|
|
|
**Hash:** `commit-hash`
|
|
**Autore:** @agent
|
|
**Branch:** branch-name
|
|
|
|
### Contesto
|
|
[Perché questo commit era necessario]
|
|
|
|
### Cosa cambia
|
|
[Descrizione modifiche]
|
|
|
|
### Perché
|
|
[Motivazione scelte]
|
|
|
|
### Impatto
|
|
- [x] Nuova feature / Bug fix / Refactoring / etc
|
|
|
|
### File modificati
|
|
- `file.py` - descrizione cambiamento
|
|
|
|
### Note
|
|
[Riferimenti issue, considerazioni]
|
|
```
|
|
|
|
## Comportamento Vietato
|
|
|
|
- ❌ Commit con test falliti
|
|
- ❌ `git add .` (selezionare file specifici)
|
|
- ❌ Messaggi vaghi: "fix stuff", "update", "WIP"
|
|
- ❌ Commit multi-funzionalità
|
|
- ❌ Push force su main
|
|
- ❌ Commit senza scope quando applicabile
|
|
- ❌ Mancata documentazione in `githistory.md`
|