[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78945MDBV5GMRWF4E7F0X7C":3,"skill-same:01M78945MDBV5GMRWF4E7F0X7C":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M78945MDBV5GMRWF4E7F0X7C","jira-issue-resolver",null,"End-to-end JIRA issue resolution workflow. Trigger for intents such as \"resolve JIRA XXXX-nn\", \"fix XXXX-nn\", \"handle XXXX-nn\", or a jira.ismisv.com\u002Fbrowse\u002F URL. It runs the full loop of finding the DAG root, creating an isolated Git worktree, producing and self-checking a brief change plan, attaching the plan, coding, testing and application black-box verification, reviewing code, committing, integrating into the main branch with rebase and fast-forward, and writing back to JIRA. One run handles only one issue. If a story has no subtasks, split it first and implement only the first subtask; if all subtasks of a parent are complete, use the parent closeout shortcut.","missdeer\u002Fskills","missdeer","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1459866?v=4","01M7892TZTCWDZH4XBQC4KR0GM","Fan Yang","01M7892V0M861938TBK4QAZDC4",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fjira-issue-resolver\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: jira-issue-resolver\ndescription: End-to-end JIRA issue resolution workflow. Trigger for intents such as \"resolve JIRA XXXX-nn\", \"fix XXXX-nn\", \"handle XXXX-nn\", or a jira.ismisv.com\u002Fbrowse\u002F URL. It runs the full loop of finding the DAG root, creating an isolated Git worktree, producing and self-checking a brief change plan, attaching the plan, coding, testing and application black-box verification, reviewing code, committing, integrating into the main branch with rebase and fast-forward, and writing back to JIRA. One run handles only one issue. If a story has no subtasks, split it first and implement only the first subtask; if all subtasks of a parent are complete, use the parent closeout shortcut.\nmetadata:\n  version: \"1.6.0\"\n---\n\n# jira-issue-resolver\n\nGuide the agent through a fixed process to resolve one JIRA issue: from parsing the issue key to writing the final commit id back to JIRA. **Every phase has a hard gate; do not enter the next phase unless the current one passes.**\n\n## Language Contract (Hard Gate)\n\n- Write all agent-authored natural-language content persisted to JIRA in Chinese. This includes issue summaries and descriptions, comments, link comments, free-text custom fields, and the contents of text documents uploaded as attachments, including change plans.\n- Keep machine-controlled values unchanged: issue keys, usernames, status and transition names, issue-type names, link types, labels, branch names, commit hashes, filenames, paths, code identifiers, JQL, JSON keys, and API field names. Do not translate quoted source material unless it is being rewritten as new JIRA prose.\n- Use English for every other agent-authored natural-language artifact and interaction, including reasoning, prompts, reviewer instructions and findings, progress updates, questions, user-facing reports, local notes not uploaded to JIRA, code comments, documentation, and Git commit messages.\n- Before every JIRA write, inspect the complete payload and translate all agent-authored prose to Chinese. Before emitting any non-JIRA content, ensure it is in English. If a payload mixes prose with machine values, translate only the prose.\n\n## Trigger Scenarios\n\n- \"resolve JIRA issue SHELFECOMM-14\"\n- \"fix https:\u002F\u002Fjira.ismisv.com\u002Fbrowse\u002FSHELFECOMM-14\"\n- \"handle SHELFECOMM-14\" \u002F \"help me fix XXXX-nn\"\n- The user pastes `https:\u002F\u002Fjira.ismisv.com\u002Fbrowse\u002F\u003CKEY>-\u003CN>` and clearly asks for it to be handled\n\nStart this workflow only when an issue key can be parsed (shape: `PROJECT-123`). If the user is only asking a read-only question such as \"what is XXXX-nn about\" or \"who owns this ticket\", call the `\u002Fjira` skill for a point query and **do not** enter this workflow.\n\n## Key Invariants (Stop If Violated)\n\n1. **One run handles only one issue**: follow blocks \u002F depends on \u002F subtask links to find the most upstream root node, and handle only that node. After finding the root, do not go back and handle other nodes, and do not merge multiple issues into one run. If the root is Story-scope (Story type, or Task \u002F Epic type whose scope spans ≥3 loosely coupled deliverables or ≥800-line diff) and has no existing subtasks \u002F linked implementation tasks, follow step 4.5: split into subtasks in JIRA **before** writing a subtask-scoped plan, then **implement only the first subtask** in this run (code + test + review + commit + JIRA writeback), then stop. Leave the remaining subtasks and the parent closeout for later user-triggered runs.\n2. **Finalize the plan before writing code**: regardless of whether the plan comes from plan mode or normal conversation, complete the step 4 self-check (or adopt an existing approved plan under step 3) before editing product code.\n3. **Code changes must include matching tests**: after product code is written, add or modify corresponding tests. Changing product code without tests means the phase is incomplete.\n   **Application black-box verification is required before code review**: run the changed web, desktop, or mobile application and verify the affected behavior against the issue's acceptance criteria using step 7.5. Automated tests alone do not satisfy this gate. If verification fails or cannot be performed, stop before `\u002Fmulti-agent-review-code` and report the blocker.\n4. **Do not commit until `\u002Fmulti-agent-review-code` converges**: as long as reviewers raise new issues in the `\u002Fmulti-agent-review-code` loop, keep fixing and reviewing until a full round returns with no new issues. Reintroduced old issues also count as new issues.\n5. **Write back only the final integrated commit**: after step 9.5 succeeds, obtain the commit id from `git -C \"$REPO_ROOT\" log -1 --format=%H` on the main branch. Rebase can change commit ids; do not write a pre-rebase hash or claim completion before fast-forward integration succeeds.\n6. **The plan file must be attached to JIRA**: do not paste it into the body. Upload it as an attachment through the `\u002Fjira` skill's attachment interface.\nInvariants 7-9 constrain three independent axes — **depth** (how far down), **breadth** (how far out), **granularity** (how many pieces). A plan can satisfy one and violate another, so check all three.\n\n7. **Depth and length — produce only a brief change plan**: the plan is a terse list of intended changes, not a design document or detailed solution. The plan must omit implementation detail, extended rationale, alternatives, architecture walkthroughs, and exhaustive flows.\n8. **Breadth — scope is defined by the JIRA issue, and only by it**: the plan answers exactly what `TARGET`'s description and acceptance criteria ask, nothing more. Content that does not trace back to a line in the issue is out of scope by default and must be removed — including hypothetical edge cases, speculative failure modes, and peripheral concerns. This binds plan authoring and self-checking equally: the default answer to \"should we also cover X?\" is **no** unless X is required to satisfy the stated acceptance criteria, and out-of-scope reviewer requests are discarded regardless of severity label. Work subtract-first — when a self-check leaves the plan longer than it started, justify it in one sentence or revert the growth.\n9. **Granularity — restraint on splitting**: creating linked tasks under a story or subtasks under a task is a heavy operation that forces multiple runs and delays delivery. Carefully evaluate necessity, never split over minor issues, and when in doubt do not split (see step 4.5).\n10. **Isolate all repository writes**: before creating or modifying any repository files, including local plans, create a dedicated worktree under `$REPO_ROOT\u002F.worktree\u002F` as described in step 2.75. Perform implementation, tests, application verification, and review fixes there. After review converges, commit in that worktree, rebase onto the main branch, fast-forward the main branch, and only then write the final commit id to JIRA. Remove this worktree only after integration and all JIRA writes succeed. The parent closeout shortcut needs no worktree.\n\n## Steps\n\n### 1. Parse The Issue Key And Fetch Details\n\nExtract the issue key from the user's input. For URLs, take the segment after `\u002Fbrowse\u002F`.\n\nCall the `\u002Fjira` skill:\n- Fetch issue details (summary \u002F description \u002F status \u002F issue type \u002F assignee \u002F issuelinks \u002F subtasks).\n- Pay special attention to `issuelinks` (blocks \u002F is blocked by \u002F relates to \u002F depends on), `subtasks`, and `parent`.\n\nIf the issue is already Closed \u002F Resolved \u002F Done, tell the user it is already closed, include the status and a summary of recent comments, and **do not** continue.\n\n### 2. Follow The DAG To Find The Root And Lock The Target\n\nBuild a directed dependency graph:\n- If this issue has `is blocked by` \u002F `depends on` links to other issues, those issues are \"upstream\".\n- If this issue is a subtask of a parent, the parent is not upstream (the parent is usually a tracker, not a blocker); however, if the parent explicitly requires another subtask first, follow the subtask order.\n- `relates to` is not a hard dependency and **does not** enter the DAG.\n\nRecurse: fetch details for each upstream issue and check whether it is blocked by other issues. **Only traverse open \u002F in-progress nodes**; treat Resolved \u002F Closed upstream issues as satisfied and skip them.\n\nAmong the remaining open nodes, find nodes with **in-degree 0** (no still-open upstream dependencies). If there are multiple, choose the one on the user's requested chain that is closest to the key the user provided. **This is the issue handled in this run**, recorded as `TARGET`.\n\nTell the user: \"The issue X you provided depends on Y (and Y depends on Z, which is the open root) -> this run will only handle Z and then stop; X requires another run later.\" If `TARGET` is the user-provided key, explicitly say \"There are no unfinished upstream dependencies, so I will handle it directly.\"\n\n### 2.5 Parent Closeout Shortcut (Short-Circuit Later Steps When Applicable)\n\n**Trigger conditions (all must be true)**:\n- `TARGET` is a parent-type issue (Story, or a Task containing subtasks), meaning it has at least one subtask or at least one `is blocked by` \u002F `depends on` link to another issue, and those downstream issues are its \"implementation subtasks\" rather than unrelated dependencies.\n- All of those subtasks \u002F linked tasks are Resolved \u002F Closed \u002F Done.\n- `TARGET` itself is still open (not Resolved \u002F Closed \u002F Done).\n- **Status-only completion rule**: for parent closeout, a subtask's Jira status is the sole authority on whether that subtask is complete. Do not inspect or reinterpret its description, acceptance details, comments, attachments, tests, commits, or other internal evidence to challenge a Resolved \u002F Closed \u002F Done status. Internal completion belongs to the subtask workflow and must not be re-audited from the parent.\n- **Convention**: parent tasks should not contain independent implementation work. All deliverable work belongs to subtasks. Stop only when the parent explicitly contains work that is not assigned to any subtask at all; do not infer unfinished parent work by re-evaluating the internals of a completed subtask.\n\nWhen the conditions are met, close out as follows (**skip steps 2.75-9.5 and go directly to this section's writeback**):\n\n1. Use the `\u002Fjira` skill to summarize every subtask's key, status, and commit short hash recorded in each subtask's comments. Reading comments here is only for summary extraction and must not affect the completion decision; if a hash is unavailable, record it as unavailable and continue.\n2. Add a comment to `TARGET`: list all subtask keys, commit short hashes, and delivery notes; conclude in one sentence that all subtasks are complete and the parent is being closed out.\n3. **Transition status**: based on the transitions currently available on `TARGET`, move it to the appropriate next status (usually \"In Review\" or \"Resolved\", depending on the team workflow and the parent's role); ask the user if unsure.\n4. Go directly to step 11 for closeout and end this run. **Do not** trigger plan, code, test, review, or commit.\n\nIf the conditions are not met, continue to step 2.75.\n\n### 2.75 Create An Isolated Worktree Before Any Repository File Writes\n\nResolve `REPO_ROOT` to the repository's primary checkout and `MAIN_BRANCH` to its actual main development branch (for example `main` or `master`), using repository instructions and Git refs rather than assuming the current branch is the main branch. Inspect `git worktree list --porcelain` and the primary checkout's status. Preserve unrelated changes; if the destination checkout is dirty, stop before integration until those changes are handled separately.\n\nCreate a new branch and worktree from `MAIN_BRANCH`, for example:\n\n```bash\nWORK_BRANCH=\"jira-$TARGET\"\nWORKTREE_DIR=\"$REPO_ROOT\u002F.worktree\u002F$WORK_BRANCH\"\ngit -C \"$REPO_ROOT\" worktree add -b \"$WORK_BRANCH\" \"$WORKTREE_DIR\" \"$MAIN_BRANCH\"\nVALIDATED_BASE=$(git -C \"$WORKTREE_DIR\" rev-parse HEAD)\n```\n\n- Ensure `.worktree\u002F` is ignored before creation. If it is not already ignored, add `\u002F.worktree\u002F` to the common repository's local `info\u002Fexclude`; do not modify a tracked `.gitignore` for this workflow setup.\n- If the branch or path already exists, use a unique prefix while keeping the issue key as the name suffix (for example `jira-2-SHELFECOMM-14`); do not overwrite an existing worktree or branch.\n- Set `project_root_dir` to `WORKTREE_DIR` and run all subsequent repository edits and commands there, including plan files, builds, tests, application launches, and `\u002Fcommit`. Give every Herdr reviewer the absolute worktree path and `MAIN_BRANCH` as the diff base so it reviews this worktree's changes.\n- If step 4.5 later relocks `TARGET` to a new subtask, keep this isolated worktree and implement only that subtask; use the final `TARGET` in the commit and JIRA writeback.\n- Read-only investigation may precede creation. No repository file writes may precede it, and product code still requires a finalized plan.\n\nContinue to step 3 only after worktree creation succeeds.\n\n### 3. Produce A Brief Change Plan\n\n**First evaluate scope for step 4.5 splitting.** If `TARGET` matches the step 4.5 trigger, jump there before writing this plan.\n\n**Then check whether the issue already ships with a plan.** Inspect the description and plan-shaped attachments through `\u002Fjira`. Extract only the brief change decisions; do not reproduce a detailed design.\n\n- **Approved and sufficient**: condense it to the format below, skip steps 4 and 5, write the local copy, and continue to step 6.\n- **Incomplete or unapproved**: retain only relevant decisions, fill only acceptance-blocking gaps, and continue to step 4.\n- **In doubt**: ask the user in one sentence \"the issue already has document X attached, treat it as the final plan or run review again?\" and follow the user's decision.\n\nWrite the plan directly after enough read-only investigation to understand the ticket. Keep private analysis as detailed as needed; keep the emitted plan extremely short.\n\nWrite the plan content in Chinese because it will be uploaded to JIRA. Keep self-check findings and user-facing plan status in English.\n\n**Required format**:\n- **3–7 flat bullets and normally no more than 15 non-empty lines**, including headings.\n- State only: the outcome\u002Fscope, the concrete change points, and how acceptance will be verified.\n- Add a risk, assumption, technology choice, or open decision only when it can block or materially redirect the change.\n- One sentence per bullet. No paragraphs, nested lists, background, ticket restatement, rationale history, alternatives, component inventories, exhaustive flows, or boilerplate sections.\n- Do not include files, symbols, schemas, endpoints, payloads, commands, test cases, pseudocode, or other implementation detail.\n- Delete every bullet that does not trace directly to the JIRA description or acceptance criteria.\n\nComplexity may justify more investigation, never a longer emitted plan. Exceed the line budget only when omitting a distinct acceptance requirement would make the plan incorrect; state that exception in one line.\n\n### 4. Self-Check The Brief Change Plan\n\nCheck the plan directly against `TARGET`'s description and acceptance criteria:\n\n- Correct only contradictions, wrong direction, or missing requirements that would materially mislead implementation.\n- Remove untraceable scope, implementation detail, speculative scenarios, and unnecessary content while staying within the step 3 budget.\n- Finalize the plan once no actionable gaps remain, then continue to step 5.\n\n### 4.5 Split A Story-Scope Root Into Subtasks\n\n**Trigger conditions (all must be true)**:\n- `TARGET.subtasks` is empty, AND there are no `is blocked by` \u002F `depends on` links to other tasks (meaning step 2 has determined it is an open root with no subtasks and no downstream tasks), AND\n- One of:\n  - `TARGET.issuetype` is \"Story\" or an equivalent story type, OR\n  - `TARGET.issuetype` is \"Task\" \u002F \"任务\" \u002F \"Epic\" but its **scope is Story-equivalent**: the description spans ≥3 loosely coupled deliverables (e.g. multiple tabs, multiple new fact tables, multiple independent modules), or the expected diff is ≥800 lines \u002F touches ≥6 files (rough estimate from the plan or from analogous prior tickets in the same project). If unsure, ask the user in one sentence \"this task looks Story-scope — split into subtasks first, or handle in one commit?\" and follow their decision.\n\nIf the conditions are not met, skip this step and continue directly to step 5.\n\n**Restraint principle**: subtask creation adds JIRA overhead, forces multiple runs, and delays delivery. Split only when the work genuinely cannot land as one coherent commit. If a Story-scope root can be delivered in a single reviewable commit with clear structure (even ~800–1200 lines), prefer to keep it whole. When in doubt, ask the user in one sentence — do not default to split. Also keep the decomposition itself minimal: prefer the smallest number of subtasks that carve the work along real functional boundaries (usually 2–4), never split for symmetry or \"one per file\" reasons.\n\n**Split happens BEFORE the subtask-scoped brief change plan is written**, not after. When the conditions are met, the flow is:\n\n1. **Skip the step 3 plan for now** — write a brief decomposition plan using the same format and budget, plus one bullet per proposed subtask. Hard ceiling: 20 non-empty lines. Include only the outcome, functional slices, dependency order, and acceptance point for each slice.\n2. Self-check the decomposition plan under step 4.\n3. Once the decomposition plan is finalized, use the `\u002Fjira` skill to create that number of subtasks under the `TARGET` project (issuetype is usually \"Task\" \u002F \"Sub-task\", depending on project configuration; ask the user if unsure), and make each new task a subtask of `TARGET` or link it back to `TARGET` with `is blocked by`. For each subtask, write the summary and description in Chinese: describe the delivered functional slice in the summary and copy its relevant Chinese bullet into the description.\n4. Record the generated subtask key list as `SUBTASKS = [key1, key2, ...]`, ordered by dependency \u002F implementation order.\n5. Add a comment to `TARGET` (the story \u002F task): list all `SUBTASKS` and explain that they should be executed in order, one per run; this run will implement `SUBTASKS[0]` first, and the remaining subtasks should be handled by triggering this skill again later.\n6. Attach the decomposition plan to `TARGET` once for future linking.\n\n**Relock TARGET and write the subtask-1 plan**: after splitting, set `TARGET` to `SUBTASKS[0]`. Write and self-check a fresh brief change plan under steps 3–4 for this subtask only.\n\nAll \"TARGET\" references after this section (step 5 attachment, code, tests, review, commit, writeback) apply to this one subtask.\n\nDo not write back status to the story \u002F parent task itself during this run. When the next run handles `SUBTASKS[1]`, the parent remains in the \"split and waiting to be consumed one by one\" state. After all subtasks are complete, if the user triggers this skill again with the parent key, step 2's DAG will determine there are no open upstream dependencies, and step 2.5 will detect that it is a \"parent whose subtasks are all complete\" -> use the **parent closeout shortcut** to close it, without running the code workflow again.\n\n### 5. Attach The Finalized Plan To JIRA\n\n- Write the final plan to `${project_root_dir}\u002Ftmp\u002Fjira-plan-\u003CTARGET>.md` (`TARGET` is the currently locked issue: in non-split scenarios it is the original root issue; in split scenarios it is `SUBTASKS[0]`).\n- Use the `\u002Fjira` skill to upload the file to the `TARGET` issue as an **attachment**.\n- Also add a comment to the issue briefly saying that the final plan has been attached and implementation is starting, so related people can track it.\n- In split scenarios, also upload the full plan file as an attachment to the **story itself** (the subtask copy is a subset; the story holds the full version for future linking).\n\n### 6. Write Product Code\n\nImplement the current `TARGET`'s finalized outcome and acceptance scope. Decide all code-level details only now; do not retrofit them into the finalized plan. Follow the six CLAUDE.md rules (especially Rule 2, minimal changes, and Rule 3, read before writing).\n\n**If step 4.5 splitting happened**: the current `TARGET = SUBTASKS[0]`, and code changes must cover only its acceptance scope. Do not modify files \u002F modules for other subtasks ahead of time, and do not include \"while I was here\" changes in this commit; doing so breaks the traceability where each JIRA subtask maps to one commit.\n\n### 7. Write \u002F Update Tests (Hard Gate)\n\n- New feature -> add tests covering the golden path plus at least one edge case.\n- Bug fix -> add a test that reproduces the bug (run it failing first, then make it pass).\n- Existing behavior change -> update affected test assertions, and bind assertions to \"why\" (business rule), not the current return value (aligned with CLAUDE.md Rule 5).\n- Run tests and confirm they are all green; explain any skipped tests. Silent skips are not allowed.\n\n### 7.5 Application Black-Box Verification (Hard Gate Before Code Review)\n\nRun the changed application and verify the affected workflow against `TARGET`'s expected behavior and acceptance criteria from outside the implementation:\n\n- **Web**: start the application and use `curl` for HTTP-observable behavior or browser CDP for browser interactions and rendered behavior. Verify the running application's responses or UI, not just its internal tests.\n- **Desktop**: build and launch the app in a usable desktop environment; operate its UI and observe the result.\n- **Mobile**: build and launch the app on a device or simulator; operate its UI and observe the result. For iOS, prioritize deployment to a physical iPhone and use Device Hub or iPhone Mirroring to operate and observe the running app. If a physical device is unavailable, record why and use a simulator.\n\nInclude the relevant failure path for a bug fix. Record the environment, actions, observed outcome, and pass\u002Ffail result; unit\u002Fintegration tests, code inspection, and a successful build are not substitutes.\n\nFix mismatches and repeat steps 7 and 7.5 until the behavior matches expectations. If the app cannot be run or its behavior cannot be observed, state the concrete blocker and stop this run before step 8; do not claim verification or proceed to code review. Changes made during review that affect the verified behavior must pass this gate again before the next review round.\n\n### 8. `\u002Fmulti-agent-review-code` Multi-Agent Ship-Readiness Loop\n\n**Do not skip this.** Call `\u002Fmulti-agent-review-code`. That skill sends review prompts through Herdr to the existing adjacent Codex and Antigravity sessions; do not launch a separate command-line or headless Codex process.\n\n- Pass every reviewer the same restraint standard: return actionable findings only, one sentence each with severity and location; omit praise, summaries, category boilerplate, detailed remediation plans, nits, speculative concerns, and round narration. A clean review returns `no actionable findings`. Brevity changes presentation, not review coverage.\n- Aggregate by deduplicating findings and listing only issues that require a change. Do not expose discarded findings unless one blocks convergence.\n- As long as there are new issues (even regressions introduced by the previous fix) -> fix -> run `\u002Fmulti-agent-review-code` again.\n- Continue until a full reviewer round raises no new issues.\n- During the loop, you may use `\u002Faudit` \u002F `\u002Fcodex` \u002F `\u002Fagy` for focused consultation as appropriate; `\u002Fcodex` and `\u002Fagy` use their existing adjacent Herdr sessions.\n\n### 9. `\u002Fcommit` In The Worktree\n\nAfter `\u002Fmulti-agent-review-code` converges, call the `\u002Fcommit` skill from `WORKTREE_DIR` to commit only the current `TARGET`'s changes. Include the JIRA key in the commit message (for example `(TARGET-KEY)`) for traceability. Keep local plan and build artifacts out of the commit unless they are part of the approved deliverable.\n\nThis commit is the input to rebase, not yet the final id for JIRA. Continue to step 9.5; do not write the commit id back yet.\n\n### 9.5 Rebase And Fast-Forward Into The Main Branch (Hard Gate)\n\nIntegration belongs to this workflow, outside the `\u002Fcommit` skill:\n\n1. Require a clean implementation worktree and a clean destination checkout, and ensure the primary checkout is on `MAIN_BRANCH` (switch only when clean). Compare its current tip with `VALIDATED_BASE`, initially recorded at worktree creation.\n2. Rebase the work branch onto the current local main branch:\n\n   ```bash\n   git -C \"$WORKTREE_DIR\" rebase \"$MAIN_BRANCH\"\n   ```\n\n   Resolve conflicts only within `TARGET`'s scope. If the base changed since validation or conflicts required edits, rerun the affected tests, step 7.5 application verification, and step 8 review against the rebased result before integration. Commit any review fixes in the worktree via step 9 and repeat as needed. After these gates pass, update `VALIDATED_BASE` to the main branch tip used by this rebase. Do not integrate while rebase, verification, or review is incomplete.\n3. Fast-forward the primary checkout:\n\n   ```bash\n   git -C \"$REPO_ROOT\" merge --ff-only \"$WORK_BRANCH\"\n   ```\n\n   If the main branch advanced and fast-forward fails, rebase onto its new tip and repeat the required verification and review before retrying. Do not use a merge commit, force-update the main branch, or reset away unrelated work. Stop and report any unresolved blocker; do not report the issue as delivered.\n4. Confirm the main branch tip equals the work branch tip and the destination checkout is clean. Obtain the final commit id from the main checkout:\n\n   ```bash\n   git -C \"$REPO_ROOT\" log -1 --format=%H\n   ```\n\nRecord the full hash and its first 12 characters for step 10. No additional commit is needed after fast-forward, and this workflow does not push automatically.\n\n### 10. Write Back To JIRA: Status + Change Notes + Commit Id\n\nOnly after step 9.5 succeeds, use the `\u002Fjira` skill on the current round's `TARGET` (in split scenarios this is `SUBTASKS[0]`; otherwise it is the original root issue):\n\n1. **Add a comment** containing:\n   - Summary of this change (what was done and which files \u002F modules were affected)\n   - Test status (tests added \u002F modified and run results)\n   - For application changes, the black-box environment, observed behavior, and verification result (including why an iOS simulator was used instead of a physical device)\n   - Final Git commit id on the main branch after rebase and fast-forward (full hash + short hash)\n   - Main branch name (`git -C \"$REPO_ROOT\" rev-parse --abbrev-ref HEAD`) and confirmation that fast-forward integration succeeded\n   - Write all explanatory prose in this comment in Chinese; preserve file names, module names, hashes, and the branch name verbatim.\n2. **Transition status**: based on the issue's current status and available transitions, move it to the appropriate next status (usually \"In Review\" or \"Resolved\", depending on the team workflow). First list available transitions with `\u002Fjira`, then pick the transition that best matches \"code complete, awaiting acceptance\"; ask the user if unsure.\n\nDo **not** write back status to the story itself during this run.\n\n### 10.5 Remove The Worktree After Successful Completion\n\nOnly after step 9.5 integration and all step 10 JIRA writes succeed, confirm that the worktree has no uncommitted changes and its branch tip is contained in `MAIN_BRANCH`. Stop any application or build processes started in it, switch the agent's working directory to `REPO_ROOT`, and remove the worktree:\n\n```bash\ngit -C \"$REPO_ROOT\" worktree remove \"$WORKTREE_DIR\"\n```\n\nConfirm that the path no longer exists and `git worktree list --porcelain` no longer lists it. Keep the branch; deleting the worktree does not require deleting its branch. If an earlier gate failed, preserve the worktree for recovery. If removal fails or uncommitted changes remain, do not force removal; report the remaining path and blocker instead of claiming cleanup succeeded. The step 2.5 parent closeout shortcut skips this step.\n\n### 11. Closeout\n\nTell the user:\n- Which `TARGET` was handled (if different from the user-provided key, state that again).\n- Final commit id on the main branch, successful rebase and fast-forward integration, and the new JIRA status (if the step 2.5 parent closeout shortcut was used, explain that there were no code changes and only the closeout status changed from X to Y).\n- For implementation runs, confirm that the worktree was removed, or report its remaining path and cleanup blocker.\n- Split scenario: additionally tell the user that story `\u003Ckey>` has been split into `SUBTASKS = [...]`, this run implemented `SUBTASKS[0]`, the next trigger of this skill will automatically pick `SUBTASKS[1]` (by step 2's DAG decision), and after all subtasks are complete, triggering this skill once more with the story key will use step 2.5 to close the story.\n- Step 2.5 closeout shortcut scenario: explicitly tell the user that parent `\u003Ckey>` was closed out based on all subtasks being complete, and this run produced no code changes \u002F commit.\n- If there are still unhandled downstream issues (the ones skipped in step 2), tell the user: \"To continue, trigger this skill again for \u003Cnext key>.\"\n\n**This skill ends here. Do not automatically continue to the next unhandled root issue or next subtask.**\n\n## Anti-Patterns (Avoid)\n\n- Do not start coding immediately after receiving an issue. Without checking the DAG first, you may discover later that fixing an upstream issue would have resolved it.\n- Do not implement before finalizing the brief change plan under steps 3–4.\n- Do not turn the brief change plan or any review into a design document. Emit only decisions and actionable gaps; implementation detail belongs to implementation.\n- Do not paste the plan into a JIRA comment instead of an attachment. Long body text harms traceability; use an attachment.\n- Do not change product code without tests. Passing tests does not prove the feature is correct, and future regressions will have no guardrail.\n- Do not enter code review for web, desktop, or mobile changes based only on tests or a successful build; the running app's affected behavior must pass black-box verification first.\n- Do not cherry-pick easy reviewer issues from `\u002Fmulti-agent-review-code` while skipping harder ones. Fix every actionable issue before the next round.\n- Do not edit repository files in the original checkout or create local plans before the dedicated `.worktree\u002F` worktree exists.\n- Do not invent a commit id, reuse an old one, or write a pre-rebase hash to JIRA. Fetch it live from the main checkout only after successful fast-forward integration in step 9.5.\n- Do not handle multiple issues or keep walking the DAG in one run. This skill handles one root node per run and stops after it is done.\n- Do not continue the workflow for an already Closed issue. Step 1 should stop it.\n- Do not skip splitting when a Story or a Story-scope Task \u002F Epic has no subtasks and then implement 500+ lines after plan finalization. That violates step 4.5; overly large granularity makes review and regression risk impossible to contain. Type == \"Task\" is NOT a get-out-of-splitting card — scope is what matters.\n- Do not implement `SUBTASKS[0]`, `SUBTASKS[1]`, ... in one run after splitting. That violates the \"one run handles only one issue\" invariant; each run implements one subtask, and the rest wait for later triggers.\n- Do not casually transition the story to Resolved during the same run after splitting. Story status writeback is reserved for the later run where all subtasks are complete and step 2.5 uses the parent closeout shortcut.\n- Do not run the normal plan->code->review workflow when the user provides a parent whose subtasks are all complete. That violates step 2.5; parent tasks should not have independent implementation work, so only summary writeback and status transition are needed.\n- Do not force the step 2.5 shortcut when the parent has explicit work that is not assigned to any subtask. Stop, identify the unassigned parent work, and ask the user to add or assign a subtask first.\n- Do not block parent closeout by re-auditing the internal details of a Resolved \u002F Closed \u002F Done subtask. Its Jira status is authoritative for the parent workflow, even when its comments or attachments contain caveats, stale notes, or incomplete evidence.\n- Do not bundle multiple subtasks into one commit. Each JIRA subtask needs its own commit id for traceability, and mixed commits are hard to split later.\n- Do not trigger step 4.5 splitting for a root that already has subtasks \u002F linked implementation tasks. Step 4.5 only applies to orphan roots (Story or Story-scope Task) with no subtasks and no downstream tasks; if subtasks already exist, use step 2's DAG logic and handle one open subtask.\n- Do not blindly rewrite a plan when the issue description \u002F attachments already contain a sufficient approved plan. Condense and adopt it as described in step 3.\n- Self-check any plan you author or substantively edit under step 4; the step 3 shortcut applies only when adopting an existing sufficient approved plan.\n- Do not create linked tasks or subtasks casually. Splitting is a heavy operation and must be justified by real inability to deliver as one commit; do not diverge into subtask creation over minor issues, and prefer keeping work whole when in doubt.\n- Do not let plans or reviews grow with hypothetical edge cases, speculative failure modes, peripheral concerns, or detailed remedies.\n- Do not treat reviewer consensus as proof that a finding is in scope. Multiple reviewers can be out of scope simultaneously; discard and move on rather than looping to appease them.\n- Do not accept an out-of-scope reviewer request in condensed form as a compromise. Partial adoption is still scope divergence; only the user can pull something back into scope.\n- Do not resolve self-check findings by growing the plan when tightening or removing content suffices, and do not add template sections.\n- Do not write narrative plans or review reports. Use terse bullets and omit everything that does not change the next action.\n","# jira-issue-resolver\n\nGuide the agent through a fixed process to resolve one JIRA issue: from parsing the issue key to writing the final commit id back to JIRA. **Every phase has a hard gate; do not enter the next phase unless the current one passes.**\n\n## Language Contract (Hard Gate)\n\n- Write all agent-authored natural-language content persisted to JIRA in Chinese. This includes issue summaries and descriptions, comments, link comments, free-text custom fields, and the contents of text documents uploaded as attachments, including change plans.\n- Keep machine-controlled values unchanged: issue keys, usernames, status and transition names, issue-type names, link types, labels, branch names, commit hashes, filenames, paths, code identifiers, JQL, JSON keys, and API field names. Do not translate quoted source material unless it is being rewritten as new JIRA prose.\n- Use English for every other agent-authored natural-language artifact and interaction, including reasoning, prompts, reviewer instructions and findings, progress updates, questions, user-facing reports, local notes not uploaded to JIRA, code comments, documentation, and Git commit messages.\n- Before every JIRA write, inspect the complete payload and translate all agent-authored prose to Chinese. Before emitting any non-JIRA content, ensure it is in English. If a payload mixes prose with machine values, translate only the prose.\n\n## Trigger Scenarios\n\n- \"resolve JIRA issue SHELFECOMM-14\"\n- \"fix https:\u002F\u002Fjira.ismisv.com\u002Fbrowse\u002FSHELFECOMM-14\"\n- \"handle SHELFECOMM-14\" \u002F \"help me fix XXXX-nn\"\n- The user pastes `https:\u002F\u002Fjira.ismisv.com\u002Fbrowse\u002F\u003CKEY>-\u003CN>` and clearly asks for it to be handled\n\nStart this workflow only when an issue key can be parsed (shape: `PROJECT-123`). If the user is only asking a read-only question such as \"what is XXXX-nn about\" or \"who owns this ticket\", call the `\u002Fjira` skill for a point query and **do not** enter this workflow.\n\n## Key Invariants (Stop If Violated)\n\n1. **One run handles only one issue**: follow blocks \u002F depends on \u002F subtask links to find the most upstream root node, and handle only that node. After finding the root, do not go back and handle other nodes, and do not merge multiple issues into one run. If the root is Story-scope (Story type, or Task \u002F Epic type whose scope spans ≥3 loosely coupled deliverables or ≥800-line diff) and has no existing subtasks \u002F linked implementation tasks, follow step 4.5: split into subtasks in JIRA **before** writing a subtask-scoped plan, then **implement only the first subtask** in this run (code + test + review + commit + JIRA writeback), then stop. Leave the remaining subtasks and the parent closeout for later user-triggered runs.\n2. **Finalize the plan before writing code**: regardless of whether the plan comes from plan mode or normal conversation, complete the step 4 self-check (or adopt an existing approved plan under step 3) before editing product code.\n3. **Code changes must include matching tests**: after product code is written, add or modify corresponding tests. Changing product code without tests means the phase is incomplete.\n   **Application black-box verification is required before code review**: run the changed web, desktop, or mobile application and verify the affected behavior against the issue's acceptance criteria using step 7.5. Automated tests alone do not satisfy this gate. If verification fails or cannot be performed, stop before `\u002Fmulti-agent-review-code` and report the blocker.\n4. **Do not commit until `\u002Fmulti-agent-review-code` converges**: as long as reviewers raise new issues in the `\u002Fmulti-agent-review-code` loop, keep fixing and reviewing until a full round returns with no new issues. Reintroduced old issues also count as new issues.\n5. **Write back only the final integrated commit**: after step 9.5 succeeds, obtain the commit id from `git -C \"$REPO_ROOT\" log -1 --format=%H` on the main branch. Rebase can change commit ids; do not write a pre-rebase hash or claim completion before fast-forward integration succeeds.\n6. **The plan file must be attached to JIRA**: do not paste it into the body. Upload it as an attachment through the `\u002Fjira` skill's attachment interface.\nInvariants 7-9 constrain three independent axes — **depth** (how far down), **breadth** (how far out), **granularity** (how many pieces). A plan can satisfy one and violate another, so check all three.\n\n7. **Depth and length — produce only a brief change plan**: the plan is a terse list of intended changes, not a design document or detailed solution. The plan must omit implementation detail, extended rationale, alternatives, architecture walkthroughs, and exhaustive flows.\n8. **Breadth — scope is defined by the JIRA issue, and only by it**: the plan answers exactly what `TARGET`'s description and acceptance criteria ask, nothing more. Content that does not trace back to a line in the issue is out of scope by default and must be removed — including hypothetical edge cases, speculative failure modes, and peripheral concerns. This binds plan authoring and self-checking equally: the default answer to \"should we also cover X?\" is **no** unless X is required to satisfy the stated acceptance criteria, and out-of-scope reviewer requests are discarded regardless of severity label. Work subtract-first — when a self-check leaves the plan longer than it started, justify it in one sentence or revert the growth.\n9. **Granularity — restraint on splitting**: creating linked tasks under a story or subtasks under a task is a heavy operation that forces multiple runs and delays delivery. Carefully evaluate necessity, never split over minor issues, and when in doubt do not split (see step 4.5).\n10. **Isolate all repository writes**: before creating or modifying any repository files, including local plans, create a dedicated worktree under `$REPO_ROOT\u002F.worktree\u002F` as described in step 2.75. Perform implementation, tests, application verification, and review fixes there. After review converges, commit in that worktree, rebase onto the main branch, fast-forward the main branch, and only then write the final commit id to JIRA. Remove this worktree only after integration and all JIRA writes succeed. The parent closeout shortcut needs no worktree.\n\n## Steps\n\n### 1. Parse The Issue Key And Fetch Details\n\nExtract the issue key from the user's input. For URLs, take the segment after `\u002Fbrowse\u002F`.\n\nCall the `\u002Fjira` skill:\n- Fetch issue details (summary \u002F description \u002F status \u002F issue type \u002F assignee \u002F issuelinks \u002F subtasks).\n- Pay special attention to `issuelinks` (blocks \u002F is blocked by \u002F relates to \u002F depends on), `subtasks`, and `parent`.\n\nIf the issue is already Closed \u002F Resolved \u002F Done, tell the user it is already closed, include the status and a summary of recent comments, and **do not** continue.\n\n### 2. Follow The DAG To Find The Root And Lock The Target\n\nBuild a directed dependency graph:\n- If this issue has `is blocked by` \u002F `depends on` links to other issues, those issues are \"upstream\".\n- If this issue is a subtask of a parent, the parent is not upstream (the parent is usually a tracker, not a blocker); however, if the parent explicitly requires another subtask first, follow the subtask order.\n- `relates to` is not a hard dependency and **does not** enter the DAG.\n\nRecurse: fetch details for each upstream issue and check whether it is blocked by other issues. **Only traverse open \u002F in-progress nodes**; treat Resolved \u002F Closed upstream issues as satisfied and skip them.\n\nAmong the remaining open nodes, find nodes with **in-degree 0** (no still-open upstream dependencies). If there are multiple, choose the one on the user's requested chain that is closest to the key the user provided. **This is the issue handled in this run**, recorded as `TARGET`.\n\nTell the user: \"The issue X you provided depends on Y (and Y depends on Z, which is the open root) -> this run will only handle Z and then stop; X requires another run later.\" If `TARGET` is the user-provided key, explicitly say \"There are no unfinished upstream dependencies, so I will handle it directly.\"\n\n### 2.5 Parent Closeout Shortcut (Short-Circuit Later Steps When Applicable)\n\n**Trigger conditions (all must be true)**:\n- `TARGET` is a parent-type issue (Story, or a Task containing subtasks), meaning it has at least one subtask or at least one `is blocked by` \u002F `depends on` link to another issue, and those downstream issues are its \"implementation subtasks\" rather than unrelated dependencies.\n- All of those subtasks \u002F linked tasks are Resolved \u002F Closed \u002F Done.\n- `TARGET` itself is still open (not Resolved \u002F Closed \u002F Done).\n- **Status-only completion rule**: for parent closeout, a subtask's Jira status is the sole authority on whether that subtask is complete. Do not inspect or reinterpret its description, acceptance details, comments, attachments, tests, commits, or other internal evidence to challenge a Resolved \u002F Closed \u002F Done status. Internal completion belongs to the subtask workflow and must not be re-audited from the parent.\n- **Convention**: parent tasks should not contain independent implementation work. All deliverable work belongs to subtasks. Stop only when the parent explicitly contains work that is not assigned to any subtask at all; do not infer unfinished parent work by re-evaluating the internals of a completed subtask.\n\nWhen the conditions are met, close out as follows (**skip steps 2.75-9.5 and go directly to this section's writeback**):\n\n1. Use the `\u002Fjira` skill to summarize every subtask's key, status, and commit short hash recorded in each subtask's comments. Reading comments here is only for summary extraction and must not affect the completion decision; if a hash is unavailable, record it as unavailable and continue.\n2. Add a comment to `TARGET`: list all subtask keys, commit short hashes, and delivery notes; conclude in one sentence that all subtasks are complete and the parent is being closed out.\n3. **Transition status**: based on the transitions currently available on `TARGET`, move it to the appropriate next status (usually \"In Review\" or \"Resolved\", depending on the team workflow and the parent's role); ask the user if unsure.\n4. Go directly to step 11 for closeout and end this run. **Do not** trigger plan, code, test, review, or commit.\n\nIf the conditions are not met, continue to step 2.75.\n\n### 2.75 Create An Isolated Worktree Before Any Repository File Writes\n\nResolve `REPO_ROOT` to the repository's primary checkout and `MAIN_BRANCH` to its actual main development branch (for example `main` or `master`), using repository instructions and Git refs rather than assuming the current branch is the main branch. Inspect `git worktree list --porcelain` and the primary checkout's status. Preserve unrelated changes; if the destination checkout is dirty, stop before integration until those changes are handled separately.\n\nCreate a new branch and worktree from `MAIN_BRANCH`, for example:\n\n```bash\nWORK_BRANCH=\"jira-$TARGET\"\nWORKTREE_DIR=\"$REPO_ROOT\u002F.worktree\u002F$WORK_BRANCH\"\ngit -C \"$REPO_ROOT\" worktree add -b \"$WORK_BRANCH\" \"$WORKTREE_DIR\" \"$MAIN_BRANCH\"\nVALIDATED_BASE=$(git -C \"$WORKTREE_DIR\" rev-parse HEAD)\n```\n\n- Ensure `.worktree\u002F` is ignored before creation. If it is not already ignored, add `\u002F.worktree\u002F` to the common repository's local `info\u002Fexclude`; do not modify a tracked `.gitignore` for this workflow setup.\n- If the branch or path already exists, use a unique prefix while keeping the issue key as the name suffix (for example `jira-2-SHELFECOMM-14`); do not overwrite an existing worktree or branch.\n- Set `project_root_dir` to `WORKTREE_DIR` and run all subsequent repository edits and commands there, including plan files, builds, tests, application launches, and `\u002Fcommit`. Give every Herdr reviewer the absolute worktree path and `MAIN_BRANCH` as the diff base so it reviews this worktree's changes.\n- If step 4.5 later relocks `TARGET` to a new subtask, keep this isolated worktree and implement only that subtask; use the final `TARGET` in the commit and JIRA writeback.\n- Read-only investigation may precede creation. No repository file writes may precede it, and product code still requires a finalized plan.\n\nContinue to step 3 only after worktree creation succeeds.\n\n### 3. Produce A Brief Change Plan\n\n**First evaluate scope for step 4.5 splitting.** If `TARGET` matches the step 4.5 trigger, jump there before writing this plan.\n\n**Then check whether the issue already ships with a plan.** Inspect the description and plan-shaped attachments through `\u002Fjira`. Extract only the brief change decisions; do not reproduce a detailed design.\n\n- **Approved and sufficient**: condense it to the format below, skip steps 4 and 5, write the local copy, and continue to step 6.\n- **Incomplete or unapproved**: retain only relevant decisions, fill only acceptance-blocking gaps, and continue to step 4.\n- **In doubt**: ask the user in one sentence \"the issue already has document X attached, treat it as the final plan or run review again?\" and follow the user's decision.\n\nWrite the plan directly after enough read-only investigation to understand the ticket. Keep private analysis as detailed as needed; keep the emitted plan extremely short.\n\nWrite the plan content in Chinese because it will be uploaded to JIRA. Keep self-check findings and user-facing plan status in English.\n\n**Required format**:\n- **3–7 flat bullets and normally no more than 15 non-empty lines**, including headings.\n- State only: the outcome\u002Fscope, the concrete change points, and how acceptance will be verified.\n- Add a risk, assumption, technology choice, or open decision only when it can block or materially redirect the change.\n- One sentence per bullet. No paragraphs, nested lists, background, ticket restatement, rationale history, alternatives, component inventories, exhaustive flows, or boilerplate sections.\n- Do not include files, symbols, schemas, endpoints, payloads, commands, test cases, pseudocode, or other implementation detail.\n- Delete every bullet that does not trace directly to the JIRA description or acceptance criteria.\n\nComplexity may justify more investigation, never a longer emitted plan. Exceed the line budget only when omitting a distinct acceptance requirement would make the plan incorrect; state that exception in one line.\n\n### 4. Self-Check The Brief Change Plan\n\nCheck the plan directly against `TARGET`'s description and acceptance criteria:\n\n- Correct only contradictions, wrong direction, or missing requirements that would materially mislead implementation.\n- Remove untraceable scope, implementation detail, speculative scenarios, and unnecessary content while staying within the step 3 budget.\n- Finalize the plan once no actionable gaps remain, then continue to step 5.\n\n### 4.5 Split A Story-Scope Root Into Subtasks\n\n**Trigger conditions (all must be true)**:\n- `TARGET.subtasks` is empty, AND there are no `is blocked by` \u002F `depends on` links to other tasks (meaning step 2 has determined it is an open root with no subtasks and no downstream tasks), AND\n- One of:\n  - `TARGET.issuetype` is \"Story\" or an equivalent story type, OR\n  - `TARGET.issuetype` is \"Task\" \u002F \"任务\" \u002F \"Epic\" but its **scope is Story-equivalent**: the description spans ≥3 loosely coupled deliverables (e.g. multiple tabs, multiple new fact tables, multiple independent modules), or the expected diff is ≥800 lines \u002F touches ≥6 files (rough estimate from the plan or from analogous prior tickets in the same project). If unsure, ask the user in one sentence \"this task looks Story-scope — split into subtasks first, or handle in one commit?\" and follow their decision.\n\nIf the conditions are not met, skip this step and continue directly to step 5.\n\n**Restraint principle**: subtask creation adds JIRA overhead, forces multiple runs, and delays delivery. Split only when the work genuinely cannot land as one coherent commit. If a Story-scope root can be delivered in a single reviewable commit with clear structure (even ~800–1200 lines), prefer to keep it whole. When in doubt, ask the user in one sentence — do not default to split. Also keep the decomposition itself minimal: prefer the smallest number of subtasks that carve the work along real functional boundaries (usually 2–4), never split for symmetry or \"one per file\" reasons.\n\n**Split happens BEFORE the subtask-scoped brief change plan is written**, not after. When the conditions are met, the flow is:\n\n1. **Skip the step 3 plan for now** — write a brief decomposition plan using the same format and budget, plus one bullet per proposed subtask. Hard ceiling: 20 non-empty lines. Include only the outcome, functional slices, dependency order, and acceptance point for each slice.\n2. Self-check the decomposition plan under step 4.\n3. Once the decomposition plan is finalized, use the `\u002Fjira` skill to create that number of subtasks under the `TARGET` project (issuetype is usually \"Task\" \u002F \"Sub-task\", depending on project configuration; ask the user if unsure), and make each new task a subtask of `TARGET` or link it back to `TARGET` with `is blocked by`. For each subtask, write the summary and description in Chinese: describe the delivered functional slice in the summary and copy its relevant Chinese bullet into the description.\n4. Record the generated subtask key list as `SUBTASKS = [key1, key2, ...]`, ordered by dependency \u002F implementation order.\n5. Add a comment to `TARGET` (the story \u002F task): list all `SUBTASKS` and explain that they should be executed in order, one per run; this run will implement `SUBTASKS[0]` first, and the remaining subtasks should be handled by triggering this skill again later.\n6. Attach the decomposition plan to `TARGET` once for future linking.\n\n**Relock TARGET and write the subtask-1 plan**: after splitting, set `TARGET` to `SUBTASKS[0]`. Write and self-check a fresh brief change plan under steps 3–4 for this subtask only.\n\nAll \"TARGET\" references after this section (step 5 attachment, code, tests, review, commit, writeback) apply to this one subtask.\n\nDo not write back status to the story \u002F parent task itself during this run. When the next run handles `SUBTASKS[1]`, the parent remains in the \"split and waiting to be consumed one by one\" state. After all subtasks are complete, if the user triggers this skill again with the parent key, step 2's DAG will determine there are no open upstream dependencies, and step 2.5 will detect that it is a \"parent whose subtasks are all complete\" -> use the **parent closeout shortcut** to close it, without running the code workflow again.\n\n### 5. Attach The Finalized Plan To JIRA\n\n- Write the final plan to `${project_root_dir}\u002Ftmp\u002Fjira-plan-\u003CTARGET>.md` (`TARGET` is the currently locked issue: in non-split scenarios it is the original root issue; in split scenarios it is `SUBTASKS[0]`).\n- Use the `\u002Fjira` skill to upload the file to the `TARGET` issue as an **attachment**.\n- Also add a comment to the issue briefly saying that the final plan has been attached and implementation is starting, so related people can track it.\n- In split scenarios, also upload the full plan file as an attachment to the **story itself** (the subtask copy is a subset; the story holds the full version for future linking).\n\n### 6. Write Product Code\n\nImplement the current `TARGET`'s finalized outcome and acceptance scope. Decide all code-level details only now; do not retrofit them into the finalized plan. Follow the six CLAUDE.md rules (especially Rule 2, minimal changes, and Rule 3, read before writing).\n\n**If step 4.5 splitting happened**: the current `TARGET = SUBTASKS[0]`, and code changes must cover only its acceptance scope. Do not modify files \u002F modules for other subtasks ahead of time, and do not include \"while I was here\" changes in this commit; doing so breaks the traceability where each JIRA subtask maps to one commit.\n\n### 7. Write \u002F Update Tests (Hard Gate)\n\n- New feature -> add tests covering the golden path plus at least one edge case.\n- Bug fix -> add a test that reproduces the bug (run it failing first, then make it pass).\n- Existing behavior change -> update affected test assertions, and bind assertions to \"why\" (business rule), not the current return value (aligned with CLAUDE.md Rule 5).\n- Run tests and confirm they are all green; explain any skipped tests. Silent skips are not allowed.\n\n### 7.5 Application Black-Box Verification (Hard Gate Before Code Review)\n\nRun the changed application and verify the affected workflow against `TARGET`'s expected behavior and acceptance criteria from outside the implementation:\n\n- **Web**: start the application and use `curl` for HTTP-observable behavior or browser CDP for browser interactions and rendered behavior. Verify the running application's responses or UI, not just its internal tests.\n- **Desktop**: build and launch the app in a usable desktop environment; operate its UI and observe the result.\n- **Mobile**: build and launch the app on a device or simulator; operate its UI and observe the result. For iOS, prioritize deployment to a physical iPhone and use Device Hub or iPhone Mirroring to operate and observe the running app. If a physical device is unavailable, record why and use a simulator.\n\nInclude the relevant failure path for a bug fix. Record the environment, actions, observed outcome, and pass\u002Ffail result; unit\u002Fintegration tests, code inspection, and a successful build are not substitutes.\n\nFix mismatches and repeat steps 7 and 7.5 until the behavior matches expectations. If the app cannot be run or its behavior cannot be observed, state the concrete blocker and stop this run before step 8; do not claim verification or proceed to code review. Changes made during review that affect the verified behavior must pass this gate again before the next review round.\n\n### 8. `\u002Fmulti-agent-review-code` Multi-Agent Ship-Readiness Loop\n\n**Do not skip this.** Call `\u002Fmulti-agent-review-code`. That skill sends review prompts through Herdr to the existing adjacent Codex and Antigravity sessions; do not launch a separate command-line or headless Codex process.\n\n- Pass every reviewer the same restraint standard: return actionable findings only, one sentence each with severity and location; omit praise, summaries, category boilerplate, detailed remediation plans, nits, speculative concerns, and round narration. A clean review returns `no actionable findings`. Brevity changes presentation, not review coverage.\n- Aggregate by deduplicating findings and listing only issues that require a change. Do not expose discarded findings unless one blocks convergence.\n- As long as there are new issues (even regressions introduced by the previous fix) -> fix -> run `\u002Fmulti-agent-review-code` again.\n- Continue until a full reviewer round raises no new issues.\n- During the loop, you may use `\u002Faudit` \u002F `\u002Fcodex` \u002F `\u002Fagy` for focused consultation as appropriate; `\u002Fcodex` and `\u002Fagy` use their existing adjacent Herdr sessions.\n\n### 9. `\u002Fcommit` In The Worktree\n\nAfter `\u002Fmulti-agent-review-code` converges, call the `\u002Fcommit` skill from `WORKTREE_DIR` to commit only the current `TARGET`'s changes. Include the JIRA key in the commit message (for example `(TARGET-KEY)`) for traceability. Keep local plan and build artifacts out of the commit unless they are part of the approved deliverable.\n\nThis commit is the input to rebase, not yet the final id for JIRA. Continue to step 9.5; do not write the commit id back yet.\n\n### 9.5 Rebase And Fast-Forward Into The Main Branch (Hard Gate)\n\nIntegration belongs to this workflow, outside the `\u002Fcommit` skill:\n\n1. Require a clean implementation worktree and a clean destination checkout, and ensure the primary checkout is on `MAIN_BRANCH` (switch only when clean). Compare its current tip with `VALIDATED_BASE`, initially recorded at worktree creation.\n2. Rebase the work branch onto the current local main branch:\n\n   ```bash\n   git -C \"$WORKTREE_DIR\" rebase \"$MAIN_BRANCH\"\n   ```\n\n   Resolve conflicts only within `TARGET`'s scope. If the base changed since validation or conflicts required edits, rerun the affected tests, step 7.5 application verification, and step 8 review against the rebased result before integration. Commit any review fixes in the worktree via step 9 and repeat as needed. After these gates pass, update `VALIDATED_BASE` to the main branch tip used by this rebase. Do not integrate while rebase, verification, or review is incomplete.\n3. Fast-forward the primary checkout:\n\n   ```bash\n   git -C \"$REPO_ROOT\" merge --ff-only \"$WORK_BRANCH\"\n   ```\n\n   If the main branch advanced and fast-forward fails, rebase onto its new tip and repeat the required verification and review before retrying. Do not use a merge commit, force-update the main branch, or reset away unrelated work. Stop and report any unresolved blocker; do not report the issue as delivered.\n4. Confirm the main branch tip equals the work branch tip and the destination checkout is clean. Obtain the final commit id from the main checkout:\n\n   ```bash\n   git -C \"$REPO_ROOT\" log -1 --format=%H\n   ```\n\nRecord the full hash and its first 12 characters for step 10. No additional commit is needed after fast-forward, and this workflow does not push automatically.\n\n### 10. Write Back To JIRA: Status + Change Notes + Commit Id\n\nOnly after step 9.5 succeeds, use the `\u002Fjira` skill on the current round's `TARGET` (in split scenarios this is `SUBTASKS[0]`; otherwise it is the original root issue):\n\n1. **Add a comment** containing:\n   - Summary of this change (what was done and which files \u002F modules were affected)\n   - Test status (tests added \u002F modified and run results)\n   - For application changes, the black-box environment, observed behavior, and verification result (including why an iOS simulator was used instead of a physical device)\n   - Final Git commit id on the main branch after rebase and fast-forward (full hash + short hash)\n   - Main branch name (`git -C \"$REPO_ROOT\" rev-parse --abbrev-ref HEAD`) and confirmation that fast-forward integration succeeded\n   - Write all explanatory prose in this comment in Chinese; preserve file names, module names, hashes, and the branch name verbatim.\n2. **Transition status**: based on the issue's current status and available transitions, move it to the appropriate next status (usually \"In Review\" or \"Resolved\", depending on the team workflow). First list available transitions with `\u002Fjira`, then pick the transition that best matches \"code complete, awaiting acceptance\"; ask the user if unsure.\n\nDo **not** write back status to the story itself during this run.\n\n### 10.5 Remove The Worktree After Successful Completion\n\nOnly after step 9.5 integration and all step 10 JIRA writes succeed, confirm that the worktree has no uncommitted changes and its branch tip is contained in `MAIN_BRANCH`. Stop any application or build processes started in it, switch the agent's working directory to `REPO_ROOT`, and remove the worktree:\n\n```bash\ngit -C \"$REPO_ROOT\" worktree remove \"$WORKTREE_DIR\"\n```\n\nConfirm that the path no longer exists and `git worktree list --porcelain` no longer lists it. Keep the branch; deleting the worktree does not require deleting its branch. If an earlier gate failed, preserve the worktree for recovery. If removal fails or uncommitted changes remain, do not force removal; report the remaining path and blocker instead of claiming cleanup succeeded. The step 2.5 parent closeout shortcut skips this step.\n\n### 11. Closeout\n\nTell the user:\n- Which `TARGET` was handled (if different from the user-provided key, state that again).\n- Final commit id on the main branch, successful rebase and fast-forward integration, and the new JIRA status (if the step 2.5 parent closeout shortcut was used, explain that there were no code changes and only the closeout status changed from X to Y).\n- For implementation runs, confirm that the worktree was removed, or report its remaining path and cleanup blocker.\n- Split scenario: additionally tell the user that story `\u003Ckey>` has been split into `SUBTASKS = [...]`, this run implemented `SUBTASKS[0]`, the next trigger of this skill will automatically pick `SUBTASKS[1]` (by step 2's DAG decision), and after all subtasks are complete, triggering this skill once more with the story key will use step 2.5 to close the story.\n- Step 2.5 closeout shortcut scenario: explicitly tell the user that parent `\u003Ckey>` was closed out based on all subtasks being complete, and this run produced no code changes \u002F commit.\n- If there are still unhandled downstream issues (the ones skipped in step 2), tell the user: \"To continue, trigger this skill again for \u003Cnext key>.\"\n\n**This skill ends here. Do not automatically continue to the next unhandled root issue or next subtask.**\n\n## Anti-Patterns (Avoid)\n\n- Do not start coding immediately after receiving an issue. Without checking the DAG first, you may discover later that fixing an upstream issue would have resolved it.\n- Do not implement before finalizing the brief change plan under steps 3–4.\n- Do not turn the brief change plan or any review into a design document. Emit only decisions and actionable gaps; implementation detail belongs to implementation.\n- Do not paste the plan into a JIRA comment instead of an attachment. Long body text harms traceability; use an attachment.\n- Do not change product code without tests. Passing tests does not prove the feature is correct, and future regressions will have no guardrail.\n- Do not enter code review for web, desktop, or mobile changes based only on tests or a successful build; the running app's affected behavior must pass black-box verification first.\n- Do not cherry-pick easy reviewer issues from `\u002Fmulti-agent-review-code` while skipping harder ones. Fix every actionable issue before the next round.\n- Do not edit repository files in the original checkout or create local plans before the dedicated `.worktree\u002F` worktree exists.\n- Do not invent a commit id, reuse an old one, or write a pre-rebase hash to JIRA. Fetch it live from the main checkout only after successful fast-forward integration in step 9.5.\n- Do not handle multiple issues or keep walking the DAG in one run. This skill handles one root node per run and stops after it is done.\n- Do not continue the workflow for an already Closed issue. Step 1 should stop it.\n- Do not skip splitting when a Story or a Story-scope Task \u002F Epic has no subtasks and then implement 500+ lines after plan finalization. That violates step 4.5; overly large granularity makes review and regression risk impossible to contain. Type == \"Task\" is NOT a get-out-of-splitting card — scope is what matters.\n- Do not implement `SUBTASKS[0]`, `SUBTASKS[1]`, ... in one run after splitting. That violates the \"one run handles only one issue\" invariant; each run implements one subtask, and the rest wait for later triggers.\n- Do not casually transition the story to Resolved during the same run after splitting. Story status writeback is reserved for the later run where all subtasks are complete and step 2.5 uses the parent closeout shortcut.\n- Do not run the normal plan->code->review workflow when the user provides a parent whose subtasks are all complete. That violates step 2.5; parent tasks should not have independent implementation work, so only summary writeback and status transition are needed.\n- Do not force the step 2.5 shortcut when the parent has explicit work that is not assigned to any subtask. Stop, identify the unassigned parent work, and ask the user to add or assign a subtask first.\n- Do not block parent closeout by re-auditing the internal details of a Resolved \u002F Closed \u002F Done subtask. Its Jira status is authoritative for the parent workflow, even when its comments or attachments contain caveats, stale notes, or incomplete evidence.\n- Do not bundle multiple subtasks into one commit. Each JIRA subtask needs its own commit id for traceability, and mixed commits are hard to split later.\n- Do not trigger step 4.5 splitting for a root that already has subtasks \u002F linked implementation tasks. Step 4.5 only applies to orphan roots (Story or Story-scope Task) with no subtasks and no downstream tasks; if subtasks already exist, use step 2's DAG logic and handle one open subtask.\n- Do not blindly rewrite a plan when the issue description \u002F attachments already contain a sufficient approved plan. Condense and adopt it as described in step 3.\n- Self-check any plan you author or substantively edit under step 4; the step 3 shortcut applies only when adopting an existing sufficient approved plan.\n- Do not create linked tasks or subtasks casually. Splitting is a heavy operation and must be justified by real inability to deliver as one commit; do not diverge into subtask creation over minor issues, and prefer keeping work whole when in doubt.\n- Do not let plans or reviews grow with hypothetical edge cases, speculative failure modes, peripheral concerns, or detailed remedies.\n- Do not treat reviewer consensus as proof that a finding is in scope. Multiple reviewers can be out of scope simultaneously; discard and move on rather than looping to appease them.\n- Do not accept an out-of-scope reviewer request in condensed form as a compromise. Partial adoption is still scope divergence; only the user can pull something back into scope.\n- Do not resolve self-check findings by growing the plan when tightening or removing content suffices, and do not add template sections.\n- Do not write narrative plans or review reports. Use terse bullets and omit everything that does not change the next action.\n",{"name":5,"metadata":24,"description":7},{"version":25},"1.6.0","master","a478051490103b418a3a053bc8fb6a5904633503","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills","https:\u002F\u002Fgithub.com\u002Fmissdeer","https:\u002F\u002Fismisv.com","2026-11-14 16:38:10",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add missdeer\u002Fskills --skill jira-issue-resolver",{"tool":38,"command":39},"bunx","bunx skills add missdeer\u002Fskills --skill jira-issue-resolver",{"tool":41,"command":42},"pnpm","pnpm dlx skills add missdeer\u002Fskills --skill jira-issue-resolver","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fjira-issue-resolver\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7DZ7FTA2WG56YHSYER06JZ1","plantuml","Render PlantUML diagrams through the self-hosted https:\u002F\u002Fplantuml.yii.li server and open the encoded URL in the default browser. Use whenever the user asks to draw, render, or update a PlantUML diagram or sequence diagram. Never download the rendered image — build the encoded URL and open it instead.","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fplantuml\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7894ZTB0D58D6T4G793RNMR","pkg-go-dev","Query Go package and module documentation from pkg.go.dev's official v1beta REST API. ALWAYS prefer this skill over `go doc`, `go list -m -versions`, `go list -m`, or scraping pkg.go.dev HTML when the target is a published module on pkg.go.dev (`go doc` is only correct for code in the local working tree or local module cache). Use when the user asks to look up a Go package's docs, synopsis, exported symbols, available versions, latest version, imports, importers, vulnerabilities\u002FCVEs, or to search pkg.go.dev. Triggers on requests like \"find the latest version of X\", \"what versions of github.com\u002F... exist\", \"show the symbols in package Y\", \"show docs \u002F godoc \u002F godoc.org \u002F pkg.go.dev for Z\", \"search Go packages for Z\", \"what vulnerabilities affect module M\", \"who imports package P\". Covers all of github.com\u002F*, golang.org\u002Fx\u002F*, standard library, and any other module indexed by pkg.go.dev.","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fpkg-go-dev\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7894SNCFMH5QCMKRGS7SRFG","multi-agent-review-plan","Review a high-level plan before implementation by sending prompts through the herdr skill to existing Codex and Antigravity sessions in adjacent panes. Use when the user or an authorized workflow requests multi-agent plan review; assess technology choices, architecture, and business rules, not code details.","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fmulti-agent-review-plan\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7894MSC0ASJE08SC3F5K4BM","multi-agent-review-code","Review a code diff by sending prompts through the herdr skill to existing Codex and Antigravity sessions in adjacent panes, and fix confirmed in-scope findings. Use when the user or an authorized workflow requests a heavyweight review-and-fix loop; ordinary one-pass reviews use audit.","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fmulti-agent-review-code\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7894EA0WJ7PA9WAHQMY3NJ9","jira","Read\u002Fwrite JIRA issues on https:\u002F\u002Fjira.ismisv.com via REST API v2 only. Use ONLY for direct issue CRUD: get an issue by key (SHELFECOMM-1, FOO-123), JQL search, read\u002Fadd comments, list\u002Fapply transitions, create a ticket, (re)assign, link\u002Funlink issues, or list\u002Fupload\u002Fdownload\u002Fdelete attachments. Do NOT use for end-to-end issue resolution workflows (planning, coding, reviewing, committing) — that is the `jira-issue-resolver` skill's job; do NOT use for non-JIRA ticketing (GitHub Issues, Lark Task); do NOT scrape HTML pages or invent endpoints. Authenticates with Basic Auth from `jira-auth.json` (gitignored).","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fjira\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M78942HMP4NTD5KEP9E2RGYA","devicehub-operator","在 macOS 上通过 AppleScript 辅助功能操作 Xcode Device Hub，定位设备控件、切换 iPhone Duo 形态、操作模拟器内 App 并截取内外屏证据。用户要求操作 Device Hub、验证模拟器 UI、展开或折叠 Duo，或排查相关自动化权限时使用。适用于已构建或已安装 App 的运行验证，不负责实现折叠屏适配或发布 App。","https:\u002F\u002Fgithub.com\u002Fmissdeer\u002Fskills\u002Fblob\u002Fmaster\u002Fdevicehub-operator\u002FSKILL.md",[],[]]