feat: NCWF-5/6/7/8/9 chess analysis page and engine integration
- NCWF-5: scaffold /analysis route with ChessBoard viewer and navigation - NCWF-6: FEN / PGN / Game-ID input form with depth selector - NCWF-7: extend GameApiService with analyzePosition(); add AnalysisService with game-wide annotation pipeline; proxy /api/analysis -> :8087 - NCWF-8: EvalTimelineComponent — SVG win-chance chart per ply - NCWF-9: AnnotatedMoveListComponent — quality labels (!! ! ?! ? ??) derived from win-chance delta Also fix pre-existing app.spec.ts failure (missing provideHttpClient). Apply project-wide prettier formatting pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ 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.
|
||||
@@ -56,6 +57,7 @@ Environment / Notes
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- Steps must be minimal and reproducible.
|
||||
- Expected vs actual: concrete and unambiguous.
|
||||
- Omit "Environment / Notes" section if not relevant.
|
||||
@@ -64,6 +66,7 @@ Rules:
|
||||
|
||||
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?
|
||||
@@ -73,6 +76,7 @@ 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`
|
||||
@@ -86,6 +90,7 @@ 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)
|
||||
|
||||
@@ -19,6 +19,7 @@ If `$ARGUMENTS` already answers some of these, skip those questions.
|
||||
## Step 2 — Research (if needed)
|
||||
|
||||
If the topic involves unfamiliar UI flows, component structure, or technical constraints:
|
||||
|
||||
- Search the repo for relevant code under `src/app/` (use `Grep`/`Bash`).
|
||||
- Use `WebSearch` if the topic involves Angular APIs, external standards or protocols.
|
||||
- Do NOT guess. Surface findings before drafting.
|
||||
@@ -53,6 +54,7 @@ Implementation Notes
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- User story line: plain English, present tense, from user's perspective.
|
||||
- Acceptance criteria: testable, unambiguous, one condition each.
|
||||
- Implementation notes: optional — only include if there are known constraints, related tickets, or design refs.
|
||||
@@ -61,6 +63,7 @@ Rules:
|
||||
|
||||
Show the draft to the user.
|
||||
**Use `AskUserQuestion` tool to ask:**
|
||||
|
||||
- Are the acceptance criteria complete and correct?
|
||||
- Any implementation constraints to add?
|
||||
- Priority (if known)?
|
||||
@@ -70,6 +73,7 @@ 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`
|
||||
@@ -83,6 +87,7 @@ If still ambiguous, ask the user.
|
||||
## Step 6 — Create Issue
|
||||
|
||||
Call `mcp__youtrack__create_issue` with:
|
||||
|
||||
- `project`: determined in Step 5
|
||||
- `summary`: concise title derived from the "I want to" clause (≤72 chars, sentence case)
|
||||
- `description`: full formatted story from Step 3 (Markdown)
|
||||
@@ -96,14 +101,14 @@ After creation, ask the user (use `AskUserQuestion` if interactive, otherwise in
|
||||
|
||||
Collect any issue IDs the user mentions. For each, determine the correct relation and call `mcp__youtrack__link_issues`:
|
||||
|
||||
| Situation | Relation to use |
|
||||
|-----------|----------------|
|
||||
| This story must be done before another | `blocks` |
|
||||
| Another story must be done before this | `is blocked by` |
|
||||
| Stories share domain or are related | `relates to` |
|
||||
| This is a child of an epic/story | `subtask of` |
|
||||
| This is a parent grouping subtasks | `parent for` |
|
||||
| This depends on another ticket's output | `depends on` |
|
||||
| Situation | Relation to use |
|
||||
| --------------------------------------- | --------------- |
|
||||
| This story must be done before another | `blocks` |
|
||||
| Another story must be done before this | `is blocked by` |
|
||||
| Stories share domain or are related | `relates to` |
|
||||
| This is a child of an epic/story | `subtask of` |
|
||||
| This is a parent grouping subtasks | `parent for` |
|
||||
| This depends on another ticket's output | `depends on` |
|
||||
|
||||
If the user mentions an issue in the story description or implementation notes (e.g. "see NCS-42", "after NCWF-12 is done"), auto-detect and suggest linking it — confirm before creating the link.
|
||||
|
||||
|
||||
@@ -7,10 +7,12 @@ This is the **NowChess-Frontend** repo. Sprint mode defaults to project `NCWF`.
|
||||
## Step 1 — Determine Scope
|
||||
|
||||
**Single-issue mode** (`$ARGUMENTS` set):
|
||||
|
||||
- Call `mcp__youtrack__get_issue` on `$ARGUMENTS`.
|
||||
- Proceed with that issue only.
|
||||
|
||||
**Sprint mode** (`$ARGUMENTS` empty):
|
||||
|
||||
- Call `mcp__youtrack__search_issues` with query `project: NCWF Sprints: {current sprint} #Unresolved`.
|
||||
- If query returns 0 results, use `AskUserQuestion` to ask for the sprint name, then retry with `project: NCWF Sprints: {name}`.
|
||||
- Collect all returned issues.
|
||||
@@ -18,6 +20,7 @@ This is the **NowChess-Frontend** repo. Sprint mode defaults to project `NCWF`.
|
||||
## Step 2 — Build Issue Tree
|
||||
|
||||
For each top-level issue from Step 1:
|
||||
|
||||
1. Fetch full details via `mcp__youtrack__get_issue`: summary, description, acceptance criteria, Type, existing `Zeitschätzung`, linked issues.
|
||||
2. Identify subtasks from links with relation `subtask of` (i.e. issues where the fetched issue is the parent).
|
||||
3. Recursively fetch subtasks until all leaves are known.
|
||||
@@ -29,17 +32,18 @@ For each top-level issue from Step 1:
|
||||
## Step 3 — Estimate Leaf Nodes
|
||||
|
||||
For each leaf node:
|
||||
|
||||
1. Read: summary, description, acceptance criteria, implementation notes.
|
||||
2. If scope is unclear, search codebase (`Grep`/`Bash`) under `src/app/` for related files to gauge complexity.
|
||||
3. Assign estimate using this scale:
|
||||
|
||||
| Size | Criteria | Estimate |
|
||||
|------|----------|----------|
|
||||
| Trivial | Style tweak, copy change, 1-file tweak | 30m |
|
||||
| Small | 1–3 files, single component/service, no unknowns | 1h–2h |
|
||||
| Medium | 3–6 files, new component + service wiring, some design | 3h–5h |
|
||||
| Large | 6+ files, cross-feature, non-trivial state/routing | 1d–2d |
|
||||
| XL | New feature area, major refactor, research spike | 3d–5d |
|
||||
| Size | Criteria | Estimate |
|
||||
| ------- | ------------------------------------------------------ | -------- |
|
||||
| Trivial | Style tweak, copy change, 1-file tweak | 30m |
|
||||
| Small | 1–3 files, single component/service, no unknowns | 1h–2h |
|
||||
| Medium | 3–6 files, new component + service wiring, some design | 3h–5h |
|
||||
| Large | 6+ files, cross-feature, non-trivial state/routing | 1d–2d |
|
||||
| XL | New feature area, major refactor, research spike | 3d–5d |
|
||||
|
||||
4. Record: estimate + one-line reasoning.
|
||||
5. Skip leaf if it already has `Zeitschätzung` set — note it as pre-estimated.
|
||||
@@ -49,6 +53,7 @@ For each leaf node:
|
||||
YouTrack auto-sums `Zeitschätzung` from subtasks up to parents — **do not write estimates to parent nodes**.
|
||||
|
||||
Compute display-only rolled-up totals:
|
||||
|
||||
- Parent total = sum of all descendant leaf estimates (including pre-estimated ones).
|
||||
- Flag any branch where some leaves are missing estimates (partial roll-up).
|
||||
|
||||
@@ -68,11 +73,13 @@ Epic NCWF-10: Board UI overhaul [4h 30m] ← rolled up
|
||||
Legend: `[X]` = display-only roll-up (not written). Plain = will be written to YouTrack.
|
||||
|
||||
If sprint mode, show grand total at bottom:
|
||||
|
||||
```
|
||||
Sprint total: Xd Yh Zm (N issues, M leaves to update)
|
||||
```
|
||||
|
||||
**Use `AskUserQuestion` tool:**
|
||||
|
||||
- Does the breakdown look right?
|
||||
- Any estimates to adjust before writing to YouTrack?
|
||||
|
||||
@@ -81,6 +88,7 @@ Incorporate all feedback before proceeding.
|
||||
## Step 6 — Write Estimates
|
||||
|
||||
On user approval, write estimates **only to leaf nodes** (bottom-up order):
|
||||
|
||||
- For each leaf with a new estimate, call `mcp__youtrack__update_issue` with field `Zeitschätzung` = approved estimate.
|
||||
- YouTrack period format: `"30m"`, `"1h 30m"`, `"1d"`, `"2d 4h"`.
|
||||
- Skip leaves already pre-estimated.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
Automated defect-fix workflow. Ticket ID: `$ARGUMENTS`
|
||||
|
||||
This is the **NowChess-Frontend** repo (Angular 20 / TypeScript). Gates:
|
||||
|
||||
- Build: `npm run build`
|
||||
- Test: `npm test -- --watch=false --browsers=ChromeHeadless`
|
||||
- Format: `npx prettier --write .` (check with `npx prettier --check .`)
|
||||
@@ -15,6 +16,7 @@ Extract and display: summary, description, steps to reproduce, Priority, Subsyst
|
||||
## Step 2 — Create Worktree
|
||||
|
||||
Derive branch name from ticket:
|
||||
|
||||
- `type` from YouTrack issue type: `bug` → `fix`, `feature`/`task` → `feat`, `refactor` → `refactor`, else `chore`
|
||||
- `scope` from affected area (kebab-case, omit if unclear)
|
||||
- `description` from ticket summary: lowercase, kebab-case, max 40 chars, drop articles
|
||||
@@ -42,6 +44,7 @@ After root cause confirmed, assess scope:
|
||||
**Complex** (3+ files, multiple concerns, or estimated > 1 hour): create subtasks before coding.
|
||||
|
||||
To create subtasks:
|
||||
|
||||
1. Break fix into discrete, independently-completable tasks (e.g. "Fix selection state in BoardComponent", "Add spec for flip behaviour", "Update GameService move stream").
|
||||
2. For each subtask call `mcp__youtrack__create_issue` with:
|
||||
- `project`: based on subtask content — do **not** inherit from parent. Frontend/UI → `NCWF`; backend code → `NCS`; Kubernetes/pipelines/CI-CD/infrastructure → `NCI`. If ambiguous, ask user.
|
||||
@@ -66,7 +69,7 @@ Then proceed to Step 4, implementing subtasks in order.
|
||||
5. Run `npx prettier --check .` — **blocking, foreground only** (never `run_in_background`). Wait for exit code 0. Must be green.
|
||||
- If it fails, fix all issues and re-run until exit code 0.
|
||||
- **Do NOT proceed to Step 5 until the build, tests and format check all pass.**
|
||||
If any step fails, iterate until all pass.
|
||||
If any step fails, iterate until all pass.
|
||||
|
||||
## Step 5 — Review
|
||||
|
||||
@@ -76,6 +79,7 @@ Display findings grouped by severity.
|
||||
## Step 5b — Apply Review Findings
|
||||
|
||||
If the review produced any findings (any severity):
|
||||
|
||||
1. Implement all agreed fixes.
|
||||
2. Run `npm run build` — must be green.
|
||||
3. Run `npm test -- --watch=false --browsers=ChromeHeadless` — must be green.
|
||||
@@ -125,12 +129,12 @@ Files changed:
|
||||
|
||||
After commenting, ask the user if `$ARGUMENTS` should be linked to any other issues not already linked:
|
||||
|
||||
| Situation | Relation |
|
||||
|-----------|---------|
|
||||
| This fix blocks another open ticket | `blocks` |
|
||||
| Another ticket must ship first | `is blocked by` |
|
||||
| Related defect or story | `relates to` |
|
||||
| Duplicate of another defect | `duplicates` |
|
||||
| Situation | Relation |
|
||||
| ----------------------------------- | --------------- |
|
||||
| This fix blocks another open ticket | `blocks` |
|
||||
| Another ticket must ship first | `is blocked by` |
|
||||
| Related defect or story | `relates to` |
|
||||
| Duplicate of another defect | `duplicates` |
|
||||
|
||||
Scan the ticket description and comments for any issue IDs that were mentioned but not yet linked. Suggest those automatically.
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ Automated feature-implementation workflow. Ticket ID: `$ARGUMENTS`
|
||||
|
||||
This is the **NowChess-Frontend** repo (Angular 20 / TypeScript). In-project =
|
||||
`NCWF`. Gates:
|
||||
|
||||
- Build: `npm run build`
|
||||
- Test: `npm test -- --watch=false --browsers=ChromeHeadless`
|
||||
- Format: `npx prettier --write .` (check with `npx prettier --check .`)
|
||||
@@ -40,6 +41,7 @@ are collected and reported at the end with a ready-to-run prompt.
|
||||
## Step 3 — Create Worktree
|
||||
|
||||
Derive branch name from the root ticket `$ARGUMENTS`:
|
||||
|
||||
- `type` from YouTrack issue type: `feature`/`task` → `feat`, `refactor` → `refactor`, `bug` → `fix`, else `chore`
|
||||
- `scope` from affected area (kebab-case, omit if unclear)
|
||||
- `description` from ticket summary: lowercase, kebab-case, max 40 chars, drop articles
|
||||
@@ -83,6 +85,7 @@ Display findings grouped by severity.
|
||||
## Step 6b — Apply Review Findings
|
||||
|
||||
If the review produced any findings (any severity):
|
||||
|
||||
1. Implement all agreed fixes.
|
||||
2. Run `npm run build` — must be green.
|
||||
3. Run `npm test -- --watch=false --browsers=ChromeHeadless` — must be green.
|
||||
@@ -139,10 +142,12 @@ Call `ExitWorktree` with `discard_changes: true` to delete the worktree.
|
||||
Final report to the user, in two sections:
|
||||
|
||||
### Blocked in-project tasks
|
||||
|
||||
List any `NCWF` tasks that could **not** be implemented, with the blocker(s)
|
||||
that stopped them. (These can be re-run with this command once blockers clear.)
|
||||
|
||||
### Cross-project tasks (NCS / NCI / other)
|
||||
|
||||
For every out-of-project task discovered in the tree (whether it was a subtask
|
||||
or a blocker), output one entry:
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ Extract and display: summary, description, acceptance criteria, implementation n
|
||||
## Step 2 — Research (if needed)
|
||||
|
||||
If the story involves unfamiliar UI flows or technical constraints:
|
||||
|
||||
- Search repo for relevant code under `src/app/` (`Grep`/`Bash`).
|
||||
- Use `WebSearch` for Angular APIs, external standards or protocols.
|
||||
- Do NOT guess. Surface findings before proposing splits.
|
||||
@@ -19,6 +20,7 @@ If the story involves unfamiliar UI flows or technical constraints:
|
||||
## Step 3 — Propose Split
|
||||
|
||||
Analyse the story and propose a set of subtasks. Rules:
|
||||
|
||||
- Each subtask = one unit of work, completable independently or in sequence.
|
||||
- No subtask should exceed ~2 days of work.
|
||||
- Name subtasks in imperative mood (e.g. "Add board theme service", "Render theme picker component").
|
||||
@@ -26,6 +28,7 @@ Analyse the story and propose a set of subtasks. Rules:
|
||||
|
||||
Show proposed subtask list to user (titles only) and ask:
|
||||
**Use `AskUserQuestion` tool:**
|
||||
|
||||
- Does the split look right?
|
||||
- Any subtasks to add, remove, or merge?
|
||||
- Should any subtask be assigned to a specific person?
|
||||
@@ -57,6 +60,7 @@ What must be true for this subtask to be considered complete:
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- Steps/Tasks: concrete, ordered where order matters.
|
||||
- Definition of Done: adjust per subtask — not all subtasks need the same criteria (e.g. a research spike has different DoD than an implementation task).
|
||||
- Keep description short — one paragraph max.
|
||||
@@ -74,6 +78,7 @@ If a subtask's project is ambiguous, ask the user before creating it.
|
||||
## Step 6 — Create Subtasks
|
||||
|
||||
For each subtask call `mcp__youtrack__create_issue` with:
|
||||
|
||||
- `project`: from Step 5
|
||||
- `summary`: subtask title (≤72 chars, sentence case)
|
||||
- `description`: full formatted description from Step 4 (Markdown)
|
||||
@@ -84,6 +89,7 @@ Then call `mcp__youtrack__link_issues` to link each created subtask to `$ARGUMEN
|
||||
## Step 6b — Inter-Subtask Links
|
||||
|
||||
If subtasks must be done in sequence (one depends on output of another), add ordering links:
|
||||
|
||||
- For each dependency pair call `mcp__youtrack__link_issues` with relation `is blocked by` (subtask B is blocked by subtask A).
|
||||
|
||||
Ask the user to confirm sequencing before adding these links:
|
||||
@@ -94,12 +100,12 @@ Ask the user to confirm sequencing before adding these links:
|
||||
|
||||
Scan `$ARGUMENTS` description and implementation notes for any referenced issue IDs not already linked. For each:
|
||||
|
||||
| Situation | Relation |
|
||||
|-----------|---------|
|
||||
| Parent story blocks another epic/story | `blocks` |
|
||||
| Situation | Relation |
|
||||
| ---------------------------------------- | --------------- |
|
||||
| Parent story blocks another epic/story | `blocks` |
|
||||
| Story depends on another epic completing | `is blocked by` |
|
||||
| Related story in same domain | `relates to` |
|
||||
| This story duplicates or supersedes | `duplicates` |
|
||||
| Related story in same domain | `relates to` |
|
||||
| This story duplicates or supersedes | `duplicates` |
|
||||
|
||||
Suggest links to the user and call `mcp__youtrack__link_issues` on confirmation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user