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>
7.5 KiB
Implement Feature from YouTrack
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 withnpx prettier --check .)
This workflow implements the given ticket and all of its subtasks, while
respecting blocked by dependencies. Tasks that live in other projects
(NCS, NCI, or any project other than NCWF) are never edited here — they
are collected and reported at the end with a ready-to-run prompt.
Step 1 — Fetch Ticket + Build Task Tree
- Call
mcp__youtrack__get_issuewith ID$ARGUMENTS. - Extract and display: summary, description, acceptance criteria, Priority, Subsystem, and the issue links.
- From the links, build the task tree:
- Subtasks = issues linked as
subtask of/parent for(children of$ARGUMENTS). Recurse: fetch each subtask withget_issueand collect its subtasks too. - Blocked-by = for every task in the tree, record issues linked as
is blocked by.
- Subtasks = issues linked as
- Classify each task by project (the prefix before the dash in the issue ID):
- In-project =
NCWF. - Out-of-project =
NCS,NCI, or any other prefix. These are never implemented here.
- In-project =
- Display the full tree: root, subtasks (nested), and for each its blockers + project tag.
Step 2 — Resolve Implementation Order
- Filter to in-project (
NCWF), not-yet-resolved tasks only (root + subtasks). Out-of-project tasks are excluded from implementation. - Topologically sort by
blocked by: a task is only implementable once all its in-project blockers are resolved. - A task is blocked (cannot start) if any blocker is:
- an in-project task that is not yet resolved in this run, or
- an out-of-project task (
NCS/NCI/etc.) — these can't be resolved here.
- Produce two lists:
- Implementable order —
NCWFtasks, dependency-sorted. - Blocked tasks — with the blocker(s) that stop them.
- Implementable order —
- Report both lists to the user. Wait for acknowledgement before continuing.
Step 3 — Create Worktree
Derive branch name from the root ticket $ARGUMENTS:
typefrom YouTrack issue type:feature/task→feat,refactor→refactor,bug→fix, elsechorescopefrom affected area (kebab-case, omit if unclear)descriptionfrom ticket summary: lowercase, kebab-case, max 40 chars, drop articles
Branch format: <type>/<ticket-id>-<description>
Example: feat/NCWF-456-add-board-theme-selector
Call EnterWorktree with that branch name.
All subsequent file work happens inside this worktree. All implementable
tasks (root + subtasks) are implemented on this one branch.
Step 4 — Understand Requirements (read-only)
- Run
npm run build— confirm baseline is green. - Run
npm test -- --watch=false --browsers=ChromeHeadless— confirm baseline is green. - For the root + each implementable subtask, spawn
cavecrew-investigatorwith: that task's description + acceptance criteria → locate affected files undersrc/app/, relevant components/services/models, routes, integration touch-points. - If anything is ambiguous (scope unclear, acceptance criteria missing, design decisions needed), use
AskUserQuestiontool to ask — max 4 questions at once. - Report plan to user: per task — what will be added/changed, which files, which areas. No file writes yet. Wait for acknowledgement before continuing.
Step 5 — Implement (per task, in dependency order)
For each task in the implementable order from Step 2, do the following before moving to the next:
- Implement task (use the
general-purposeagent for non-trivial multi-file changes; inline edits for small ones). - Run
npm run build— must be green. - Run
npm test -- --watch=false --browsers=ChromeHeadless— must be green (add new specs for new behaviour; do not modify existing specs unless requirements changed). - Run
npx prettier --write .— blocking, foreground only. Wait for completion before continuing. - Run
npx prettier --check .— blocking, foreground only (neverrun_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 the next task until build, tests and format check all pass.
If any step fails, iterate until all pass. Once a task is fully green it counts as resolved for the purpose of unblocking later tasks — re-check Step 2's blocked list: any task whose blockers are now all resolved becomes implementable.
Step 6 — Review
Spawn cavecrew-reviewer on the full diff (covering all implemented tasks).
Display findings grouped by severity.
Step 6b — Apply Review Findings
If the review produced any findings (any severity):
- Implement all agreed fixes.
- Run
npm run build— must be green. - Run
npm test -- --watch=false --browsers=ChromeHeadless— must be green. - Run
npx prettier --write .thennpx prettier --check .— blocking, foreground only. Wait for exit code 0. - Re-spawn
cavecrew-revieweron the updated diff to confirm all findings are resolved.
Repeat until review is clean or user explicitly accepts remaining findings.
Step 7 — Confirm + Push
Show summary: root ticket, implemented subtasks, branch, files changed, review findings.
Use AskUserQuestion tool to ask for explicit approval before pushing. Include any open questions about commit message scope or body if unclear.
On approval, commit following Conventional Commits:
<type>(<scope>): <short description, imperative, ≤50 chars>
<optional body: what changed and why, wrap at 72 chars>
Closes $ARGUMENTS
<also list Closes <ID> for each implemented subtask>
https://knockoutwhist.youtrack.cloud/issue/$ARGUMENTS
type: same as branch type (feat,refactor,chore, etc.)scope: affected area (ui,components,services,models,core,routing,pages,styles)- Subject: imperative mood, no period, lowercase
- Footer
Closes <ID>for the root and every resolved subtask, plus the root ticket URL.
Push branch to remote.
Step 8 — Comment on Tickets
After successful push, call mcp__youtrack__add_issue_comment on $ARGUMENTS and on each implemented subtask with:
Branch `<branch-name>` pushed.
<one-sentence summary of what was added and why>
Files changed:
- <file1>
- <file2>
Step 9 — Cleanup
Call ExitWorktree with discard_changes: true to delete the worktree.
(Branch was pushed in step 7 — commits are safe on remote; discard_changes: true bypasses the local-ahead guard.)
Step 10 — Report Blocked + Cross-Project Tasks
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:
- <ID> [<PROJECT>]: <summary>
Prompt: /implement-feature <ID>
Where Prompt is a short, copy-pasteable instruction to implement that task in
its own project — e.g. the ticket ID plus a one-line description of what the
other project needs to do so this project's blocked tasks can proceed.
End with: branch pushed, tickets commented, worktree deleted, plus the counts of implemented / blocked / cross-project tasks.