---
name: gw-init
description: Inizializza workspace NDA-safe per nuovo prospect HE/EIC/MSCA. Crea struttura cartelle + state.json + symlinks reference + .gitignore.
---

# /gw-init — Initialize prospect workspace

## Uso

```bash
/gw-init {prospect-slug} {call-id} [--brief PATH] [--force]
```

## Esempio

```bash
/gw-init policlinico-roma HORIZON-CL4-2025-DIGITAL-EMERGING-01 --brief ~/Desktop/brief.md
```

## Parametri

| Parametro | Tipo | Default | Descrizione |
|-----------|------|---------|-------------|
| `prospect-slug` | string (required) | — | Slug URL-safe: `[a-z0-9-]+` |
| `call-id` | string (required) | — | ID call EU: pattern `HORIZON-*`, `EIC-*`, `MSCA-*` |
| `--brief PATH` | string (optional) | — | Path al brief cliente da copiare in `proposta/brief-cliente.md` |
| `--force` | flag (optional) | false | Ricrea workspace se già esistente (DISTRUTTIVO) |
| `--workspace-root PATH` | string (optional) | `~/grant-projects` | Root workspace utente |
| `--prospect-name "..."` | string (optional) | slug | Nome leggibile prospect |
| `--prospect-type TYPE` | string (optional) | `research-center` | Tipo: university / research-center / enterprise / public-administration / sme / other |
| `--prospect-country XX` | string (optional) | `IT` | ISO 3166-1 alpha-2 country |

## Output

Crea `~/grant-projects/{prospect-slug}/{call-id}/` con:
- `proposta/`, `references/`, `reviews/`, `output/figures/`
- `state.json` (validato Zod, tipologia `EU_grant_HE`)
- Symlinks reference HE WP cluster 4 + few-shot ORE (6 symlinks)
- `.gitignore` (`*` + `!.gitignore` — NDA-safe, nessun dato cliente in git)

## Validazione

- **slug**: deve matchare `^[a-z0-9-]+$` — exit 1 se invalido (PRIMA di toccare il filesystem)
- **call-id**: warning su stderr se non matcha `^(HORIZON|EIC|MSCA)-` ma procede best-effort (V0.1 lax)
- **--force**: richiesto se il workspace già esiste — senza flag, exit 1 con suggerimento

## Errori

| Exit code | Causa |
|-----------|-------|
| 0 | Successo |
| 1 | slug invalido / workspace esiste senza --force / brief non trovato |
| 2 | Errore interno imprevisto |

## Implementation

La skill invoca `npx tsx scripts/gw-workspace.ts init "$@"` dal plugin root.

```bash
# Esecuzione diretta
npx tsx scripts/gw-workspace.ts init policlinico-roma HORIZON-CL4-2025-DIGITAL-EMERGING-01

# Con brief
npx tsx scripts/gw-workspace.ts init policlinico-roma HORIZON-CL4-2025-DIGITAL-EMERGING-01 \
  --brief ~/Desktop/brief.md

# --force su workspace esistente
npx tsx scripts/gw-workspace.ts init policlinico-roma HORIZON-CL4-2025-DIGITAL-EMERGING-01 --force
```

## Privacy note

Il `.gitignore` generato (`*\n!.gitignore`) garantisce che il workspace non finisca mai
accidentalmente in un repo git del cliente. Conforme a MAI5/MAI6 e policy NDA.
