---
name: backlog-init
description: Initialize BACKLOG/ structure in the current project
---

Initialize the BACKLOG/ directory structure for ticket tracking.

## Steps

1. **Check** if `BACKLOG/` already exists. If it does, inform the user and stop.

2. **Create the directory structure:**
   ```
   BACKLOG/
   ├── BUGS/{PENDING,DONE}/
   ├── FEATURES/{PENDING,DONE}/
   ├── IMPROVEMENTS/{PENDING,DONE}/
   └── _templates/
   ```

3. **Create `BACKLOG/_templates/ticket.md`** — copy from `~/.claude/templates/backlog/ticket.md` if it exists, otherwise create it with this content:

   ```markdown
   # [TYPE]-XXX: Titre court

   **Type:** Bug | Feature | Improvement
   **Statut:** A faire | En cours | Bloque | Fait
   **Priorite:** Critique | Haute | Moyenne | Basse
   **Complexite:** XS | S | M | L | XL
   **Tags:** [libres, separes par virgule]
   **Depends on:** none
   **Blocked by:** —
   **Date creation:** YYYY-MM-DD

   ---

   ## Description
   [Description claire]

   ## Fichiers concernes
   - `path/to/file`

   ## Criteres d'acceptation
   - [ ] Critere 1

   ## Tests de validation
   - [ ] Test 1
   ```

4. **Create `BACKLOG/INDEX.md`** with just the header (it will be fully generated by `/backlog-status`):

   ```markdown
   # BACKLOG — [project basename]

   _Run `/backlog-status` to populate this file._
   ```

5. **Display** the created structure to confirm.
