Files
NowChess-Frontend/.claude/commands/create-defect.md
T
Janis Eccarius a65d748f99 chore(claude): add YouTrack command suite
Port create-defect, create-story, estimate-issues, fix-defect,
implement-feature and split-story commands, adapted for the Angular
frontend (npm build/test, prettier gates, NCWF routing).
implement-feature now walks subtasks, respects blocked-by, and reports
cross-project (NCS/NCI) tasks. Ignore .claude/worktrees.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 14:33:07 +02:00

98 lines
2.8 KiB
Markdown

# Create Defect in YouTrack
Automated defect creation workflow. Topic/hint: `$ARGUMENTS`
This is the **NowChess-Frontend** repo (Angular 20 / TypeScript). Defects raised
here usually belong to project `NCWF`, but routing in Step 5 still applies.
## Step 1 — Gather Context
Use `AskUserQuestion` tool to ask the user (max 4 questions at once):
1. **Component** — Where does the bug occur? (e.g. a component, service, route/page, model, styling, API integration)
2. **What breaks** — What is the actual (broken) behavior?
3. **Expected** — What should happen instead?
4. **Reproducibility** — Is it always reproducible? Any known trigger conditions? (route, viewport, browser)
If `$ARGUMENTS` already answers some of these, skip those questions.
## Step 2 — Research (if needed)
If the bug involves component logic, a service, or routing:
- Search repo for relevant code (`Grep`/`Bash`) under `src/app/{components,services,models,core,pages}`.
- Check `.spec.ts` files for existing coverage of the broken area.
- Do NOT guess at root cause. Surface findings before drafting.
## Step 3 — Draft Defect
Compose the full defect report using this template:
```
Summary
[One-sentence description of what is broken.]
Steps to Reproduce
1. Step one
2. Step two
3. Step three
Expected Behavior
[What should happen.]
Actual Behavior
[What actually happens.]
Environment / Notes
[Any relevant context: route/URL, viewport, browser, console errors, API payloads — only if applicable.]
```
Rules:
- Steps must be minimal and reproducible.
- Expected vs actual: concrete and unambiguous.
- Omit "Environment / Notes" section if not relevant.
## Step 4 — Clarify
Show the draft to the user.
**Use `AskUserQuestion` tool to ask:**
- Are steps to reproduce complete and accurate?
- Severity: Blocker / Critical / Major / Minor / Trivial?
- Any related tickets or recent changes to link?
Incorporate feedback. Repeat until user approves.
## Step 5 — Determine Project
> **Project routing rules (always apply these):**
> - Frontend code (UI, UX, web app, components, services) → `NCWF`
> - Backend code (game engine, bots, API, services, coordinator) → `NCS`
> - Infrastructure (Kubernetes, pipelines, CI/CD, DB setup, cloud infra) → `NCI`
- Frontend / UI / UX → project: `NCWF` (default for this repo)
- Backend / coordinator / systems / bot / engine → project: `NCS`
- Kubernetes, pipelines, CI/CD, infrastructure → project: `NCI`
If ambiguous, ask the user.
## Step 6 — Create Issue
Call `mcp__youtrack__create_issue` with:
- `project`: determined in Step 5
- `summary`: concise title describing what is broken (≤72 chars, sentence case)
- `description`: full formatted defect report from Step 3 (Markdown)
- `type`: `Bug`
## Step 7 — Report
Display the created issue ID and URL.
Ask if a linked investigation or fix task is needed.