---
name: youtrack-create-task
description: >
  Create one or more tasks (subtasks) in YouTrack under a parent User Story. Manual only —
  invoke with /youtrack-create-task.
disable-model-invocation: true
---

# YouTrack Create Task Skill

## Overview

This skill creates structured Task-type issues in YouTrack for the CWB project, linking them
as subtasks to a parent User Story, enriching them with descriptions, links, and metadata.

**All task titles and content must be written in Russian.**

## Required MCP Tools

- `mcp_youtrack_create_issue` — creates the issue
- `mcp_youtrack_get_issue_fields_schema` — get valid field values (sprint names, types, etc.)
- `mcp_youtrack_manage_issue_tags` — add tags after creation (may be disabled; inform user if unavailable)

## Workflow

### Step 1 — Gather input

Collect from the user (or derive from conversation context):

- **Parent issue ID** (e.g. `CWB-3558`) — required
- **List of tasks** with titles and descriptions — required
- **Figma link** — optional, include in description if provided
- **Knowledge base / ТЗ link** — optional, include in description if provided
- **Sprint** — ask the user; default to Unscheduled if not specified
- **Tags** — default to `Frontend` for frontend tasks
- **Priority** — default to `Medium` if not specified
- **Assignee** — optional

### Step 2 — Get valid field values

Before creating issues, call `mcp_youtrack_get_issue_fields_schema` with `projectKey: "CWB"` to get:

- Valid sprint names for the `Sprints` field
- Valid `Type` values (use `"Task"`)
- Valid `State` values (default: `"To Do"`)
- Valid `Priority` values

### Step 3 — Create each issue

Call `mcp_youtrack_create_issue` for each task with:

```json
{
  "project": "CWB",
  "summary": "<название задачи на русском>",
  "description": "<описание на русском (см. шаблон ниже)>",
  "parentIssue": "<parent issue ID, e.g. CWB-3558>",
  "customFields": {
    "Type": "Task",
    "Priority": "Medium"
  }
}
```

> **Note:** The `Sprints` field cannot be set at creation time via this API — set it manually
> in YouTrack UI after creation, or skip if "Unscheduled" is the default.

Run all `create_issue` calls **in parallel** if creating multiple tasks at once.

### Step 4 — Add tags

After creation, call `mcp_youtrack_manage_issue_tags` for each created issue:

```
issueId: <created issue ID>
operation: "add"
tag: "Frontend"
```

If the tool is disabled (error: "currently disabled by the user"), inform the user and provide
a list of issue IDs so they can add tags manually.

### Step 5 — Report results

Return a summary with:

- Links to all created issues
- Any fields that couldn't be set automatically (sprints, tags if disabled)
- Instructions for anything the user needs to do manually

---

## Description Template (Russian)

Use this structure for task descriptions:

```markdown
## Ссылки:

- ТЗ: <ссылка на knowledge base статью>
- Макеты: <ссылка на Figma>

## Описание

<Краткое описание задачи и её цели>

## Что делать:

<Пронумерованный или маркированный список конкретных шагов>

### Под-пункт (если нужно)

<Детализация>

## Зависимость:

Требует завершения: <название другой задачи> (если есть)
```

Omit sections that are not applicable (e.g. no "Зависимость" if the task is independent,
no "Ссылки" if no links were provided).

---

## Key Rules

- **Language:** Task `summary` and `description` must always be in **Russian**
- **Type:** Always `"Task"`, never `"User Story"` or `"Bug"`
- **Parent:** Always link via `parentIssue` to the provided User Story ID
- **Tags:** Default tag is `Frontend`; add via `manage_issue_tags` after creation
- **Links:** Always include ТЗ and Figma links in the description if the user provides them
- **Parallel creation:** Create all tasks simultaneously, not sequentially
- **Sprint:** The API does not reliably support sprint assignment at creation — note this to user

---

## Example

**User input:**

> создай в youtrack задачи для CWB-3558. ТЗ: https://citronus.youtrack.cloud/articles/CWB-A-539. Макеты: https://www.figma.com/design/abc123. Задачи: 1) Детект платформы 2) Баннер установки

**What to do:**

1. Call `get_issue_fields_schema` for project `CWB`
2. Create 2 issues in parallel with `parentIssue: "CWB-3558"`, `Type: "Task"`, Russian descriptions including both ТЗ and Figma links
3. Add `Frontend` tag to both via `manage_issue_tags`
4. Return 2 issue links

---

## Troubleshooting

| Problem                         | Solution                                                                            |
| ------------------------------- | ----------------------------------------------------------------------------------- |
| `manage_issue_tags` is disabled | Inform user with list of issue IDs to tag manually                                  |
| Sprint field fails to set       | Note to user; set manually in YouTrack UI                                           |
| `create_issue` fails            | Check `get_issue_fields_schema` for valid field values; retry with corrected fields |
