---
name: glab-issue-from-ai-note
description: >
  Create followup GitLab issues from the Open questions of an ai-note file
  (`docs/ai-notes/<...>.md`), delegating each ticket to /glab-issue-create. Interactive
  selection in local mode, all of them in CI. Use when the user says /glab-issue-from-ai-note,
  'crée les followups depuis cette ai-note', 'génère les tickets de cette ai-note',
  'transforme les questions ouvertes en tickets', 'crée les issues depuis la note IA',
  'formalise les open questions', 'create followups from this ai-note',
  'turn the open questions into issues', 'spawn tickets from this ai-note',
  'file the followups from the note', or wants to formalize the open questions left by
  /code-implement. Distinct from /glab-issue-create, which creates one issue from arbitrary
  context — this one reads an ai-note and fans out its open questions into followup tickets.
argument-hint: "<path-to-ai-note.md> [--filter 🔴|🟡] [--epic <iid>]"
allowed-tools:
  - Bash
  - Read
---

## Required tools

- `glab`

Run `pysae-ai-tools tools require glab` before starting.

## How it works

The command below **only parses** the ai-note — it never creates issues. Every
follow-up is created by delegating to **`/glab-issue-create`**, so each ticket
goes through the standard pipeline (weight, mandatory `type::*`, board column
`workflow::Refinement`, template). Never create the issue inline (`glab issue
create`, `glab api … POST .../issues`).

## Steps

1. Read `<path>` to make sure it is an ai-note file (frontmatter + `## Open questions` section).
2. **Parse** the follow-ups (no creation happens here):
   ```bash
   pysae-ai-tools glab issue-from-ai-note <path-to-ai-note.md> [--filter 🔴,🟡] [--project pysae/api] [--epic <iid>]
   ```
   It prints JSON: `{ "project", "label": "agent::followup", "epic_iid", "followups": [ { "title", "description", "priority" } ] }`.
3. **Select** which follow-ups to create. In local mode, confirm each one with the user (default: all). In CI mode (`$CI` set), take all of them (no prompts).
4. For **each** selected follow-up, **delegate to `/glab-issue-create`** — pass its `title` and `description` as the issue content, the `project`, and tell it to add the `agent::followup` label (plus the `--epic` IID when set). `/glab-issue-create` resolves type/weight/board column/assignee and creates the ticket properly. Collect each created IID. **Do not** create the issue any other way.
5. After creation, re-open the source ai-note file and prefix each converted question with `[✓ #<created_iid>]` so it is skipped on a re-run.

$ARGUMENTS
