with one click
fix-issue
// Autonomously fix a YouTrack issue end-to-end: from ticket pickup through code fix, tests, PR creation, CI validation, and reviewer assignment.
// Autonomously fix a YouTrack issue end-to-end: from ticket pickup through code fix, tests, PR creation, CI validation, and reviewer assignment.
Guides commit message writing for the kotlinx-rpc project. Use this skill whenever committing code, writing commit messages, or when the user asks about commit conventions. Also use it when reviewing PRs for commit message quality. Triggers on: /commit, "commit", "commit message", "git commit", writing changelogs from commits.
Modify, build, publish, and verify the Kotlin/Native shim artifacts (gRPC shim and protobuf shim) in native-deps/shims/. Use this skill whenever the user wants to change shim C/C++ source code, update shim headers or .def files, bump a shim upstream version, add or remove archives from the overlap excludes list, patch KLIB metadata, update the annotation module, run shim fixture tests, publish shim artifacts locally, or debug any native shim build failure. Also trigger when the user mentions "shim", "cinterop", "native interop", "grpc shim", "protobuf shim", "KLIB patcher", "overlap archives", "native-deps", "Bazel shim build", or "shim verification".
Query and analyze kotlinx-rpc build scans, test results, and failure patterns from the Develocity server (ge.jetbrains.com) using MCP tools. Use this skill whenever the user wants to look at build scans, investigate CI failures across builds, check build cache hit rates, analyze flaky tests, find recurring failure patterns, or query build performance history. Also trigger when the user mentions "Develocity", "build scan", "GE", "ge.jetbrains.com", "build cache stats", "flaky tests", "failure groups", or asks about build trends, test stability, or CI health. Trigger even if the user doesn't say "Develocity" explicitly -- if they want to look at historical build data, cross-build test analysis, or failure aggregation, this is the right skill. Do NOT use this skill for running local Gradle builds -- use `running_gradle_builds` or `running_gradle_tests` instead. Do NOT use this skill for TeamCity build triggering or queue management -- use `use-teamcity`.
File YouTrack issues for the kotlinx-rpc project (KRPC). Use this skill whenever the user wants to create a bug report, feature request, task, or any issue in YouTrack for kotlinx-rpc. Also use it when the user mentions filing a ticket, reporting a bug, creating a task, logging an issue, or tracking work in YouTrack — even if they don't say "YouTrack" explicitly but the context is clearly about issue tracking for this project. Covers choosing the right issue type, scope, priority, tags, and writing well-structured descriptions that match the team's conventions.
Determine which LOCAL verification checks to run for kotlinx-rpc changes and execute them on the developer's machine. TeamCity builds and GitHub Actions workflows are out of scope -- this skill covers only what can and should be run locally before pushing. Use this skill whenever changes are made to the codebase and you need to verify correctness before committing or opening a PR. Also use it when the user asks to "run checks", "verify changes", "run verifications", "what checks do I need", "validate my changes", "pre-PR checks", or "local checks". Trigger proactively after completing any code modification task -- even if the user doesn't explicitly ask, suggest which verifications are relevant based on what changed.
Update kotlinx-rpc documentation — version bumps, content edits, Writerside topics, KDoc, README, skills, and internal workflows. Use this skill whenever the user wants to bump the Kotlin version in docs, bump the library version, update the changelog, edit documentation topics, add a migration guide, update the version switcher, fix version references, write or update KDoc on public APIs, update the README, update Claude skills, or modify CLAUDE.md. Also trigger when the user mentions "update docs", "doc version", "release docs", "Writerside", "v.list", "changelog", "KDoc", "Dokka", "README", "skill", "CLAUDE.md", or wants to sync documentation with a new release.
| name | fix-issue |
| description | Autonomously fix a YouTrack issue end-to-end: from ticket pickup through code fix, tests, PR creation, CI validation, and reviewer assignment. |
| disable-model-invocation | true |
Complete lifecycle of fixing a KRPC YouTrack issue: pickup → analysis → code → tests → PR → CI → reviewer assignment. Full autonomy is a hard requirement — no user approval between phases. Communicate progress at natural milestones.
This workflow uses dedicated agent credentials, not the user's personal tokens.
These overrides take precedence over defaults in use-youtrack and use-teamcity skills.
youtrack-agent MCP server (not youtrack). For REST
fallback, use $YOUTRACK_AGENT_TOKEN (not $YOUTRACK_TOKEN).teamcity auth status/login. Prefix every command
with TEAMCITY_TOKEN=$TEAMCITY_AGENT_TOKEN.gh-bot wrapper — see next section.gh — always through the gh-bot wrapperEvery gh invocation in this skill MUST go through:
.claude/skills/fix-issue/scripts/gh-bot.sh <gh args...>
gh-bot generates a fresh App installation token on every call and execs gh
with that token set inline. It is a drop-in replacement for gh.
You MUST NEVER call gh directly.
Examples:
.claude/skills/fix-issue/scripts/gh-bot.sh pr create --draft ...
.claude/skills/fix-issue/scripts/gh-bot.sh pr ready 123
.claude/skills/fix-issue/scripts/gh-bot.sh api /repos/Kotlin/kotlinx-rpc/issues/42/comments ...
Before any work — including reading the issue — run the pre-flight script. It checks connectivity AND identity for all three services, verifying tokens belong to the AI Agent accounts, not the user's personal credentials. If any check fails → stop and report. Do not proceed.
.claude/skills/fix-issue/scripts/preflight-check.sh
Exit code 0 = all passed. Non-zero = at least one check failed; read output for which service and why, never proceed with a failed check.
If a service becomes unreachable mid-workflow:
$YOUTRACK_AGENT_TOKEN is the only permitted fallbackgh-bot fails → stop and report (no fallback)Never silently skip a step. Never invent data. Stop, report what failed and at which phase, wait for instructions.
When this skill says "invoke superpowers:X", use the Skill tool — don't just
think through the ideas yourself. Autonomous mode tends to skip skill
invocations, which defeats the discipline (TDD red-green, structured debugging,
code-review formatting) those skills encode.
Detailed guidance for specific situations and phases:
references/investigation-tips.md — Phase A.3 analysis patterns: prior-issue search (mandatory) and the search_dependency_sources FULL_TEXT workaround.references/develocity-tips.md — READ BEFORE any mcp__develocity__* call. Default truncation (100 items, 500-char strings) will bite you; the tips file has the parameter shapes that actually work.references/audit-style-scoping.md — Scope discipline for "Audit X" / "Review Y" tickets.references/reproducer-verification.md — Before/after verification protocol when the issue includes an external reproducer.references/verification-special-cases.md — Mandatory extra verifications for conformance known_failures.txt and compiler-plugin changes (Phase C.2).references/code-review-agents.md — Reviewer menu and prompting guide for Phase C.3.references/ship-workflow.md — Phase D steps: commits, PR creation, CI polling, finalization, YouTrack update.references/ci-polling.md — How to run the TC + GitHub Actions poll scripts as background bash in Phase D.3.references/addressing-pr-comments.md — Multi-turn workflow for handling PR feedback after the PR is up.references/filing-follow-up-issues.md — Drop-in replacement for file-youtrack-issue when creating YT issues mid-workflow.references/youtrack-attachments.md — REST recipe for attaching files to YT issues when the MCP server can't.Required: A YouTrack issue ID (e.g., KRPC-540).
Alternative: User asks to scan for issues. Search UFG Claude-tagged issues:
project: KRPC tag: {UFG Claude} State: Open sort by: Priority asc, created asc
project: KRPC tag: {UFG Claude} State: Submitted sort by: Priority asc, created asc
Prioritize Open over Submitted, higher priority first. Take the top one.
Four phases (A–D), each with exit conditions. If the approach changes significantly mid-phase, loop back — reset the branch cleanly (see Error Recovery), re-run verifications, update PR/comment descriptions with new approach.
Read the issue via youtrack-agent MCP. Then do all four — none are optional:
AI Agent [Kxrpc] (look up the login once, cache it).In progress.get_issue_fields_schema for the KRPC project — the sprint/planning
period field enumerates all periods. The last non-checkmarked
[Kxrpc] Planning Period is typically active. Planning periods are custom
fields, not tags.github-issue tag. If present,
note the GH issue number now; you'll need it in Phase D for the commit
message and PR body (Fixes #NNN).Create the worktree before exploring code so all analysis runs against the
latest origin/main, not whatever the original repo has checked out.
git fetch origin main
git worktree add -b <branch-name> /tmp/krpc-<issue-id> origin/main
Branch naming: fix/KRPC-<N> (bugs), feat/KRPC-<N> (features),
task/KRPC-<N> (tasks).
Create local.properties in the worktree — Gradle requires it:
sed "s|<User>|$(whoami)|g" .claude/skills/fix-issue/assets/local.properties.template \
> /tmp/krpc-<issue-id>/local.properties
When using Gradle skills, always use the worktree root as projectRoot —
even for included builds (compiler-plugin/, gradle-plugin/, protoc-gen/,
dokka-plugin/). The Gradle MCP rejects included build subdirectories because
they have no Gradle wrapper. Address included build tasks from the root using
the composite prefix: :protoc-gen:common:test,
:compiler-plugin:compiler-plugin-backend:build, :dokka-plugin:build.
All subsequent operations — exploration, builds, tests — use the worktree path.
Read the issue body, all comments, and all linked issues — they often contain critical context, reproductions, or scope changes missing from the description. Understand what's broken/missing, which modules are involved, the type (bug/feature/task), and linked issues.
For situational guidance (similar-issues search, dependency-source gotcha, Develocity usage, audit-style scope traps, bug-vs-usability-problem classification), consult the References section above.
If the ticket's literal ## Task steps are disproportionate to the likely value
of the finding (e.g., "trigger N CI builds to bisect" when static analysis will
identify the answer in minutes), propose a scoped alternative in the triage
comment and issue-body update — those artifacts are your scope-change contract.
Don't grind through expensive prescribed steps when cheaper investigation
suffices; don't silently skip them either.
For bugs, you must invoke superpowers:systematic-debugging before posting the triage
comment: reproduce, trace data flow backward to where incorrect state
originates, form a specific hypothesis ("Field X is null because deserialize()
silently drops the payload when..."), and have your reproducer confirm it.
The comment is proof analysis happened. One of:
assets/yt-reproducer-comment.md.Append your analysis using assets/yt-issue-update.md. Re-read the template
before writing — do not reconstruct from memory. Fill in affected modules and
root cause. Problem analysis only — no fix or solution. Reproducers go in the
triage comment, not the body.
Exit condition: triage comment posted, issue body updated, related issues linked.
Entry: Phase A complete. git fetch origin main and rebase before pushing any
commits.
Skip formal tests for: docs-only, trivial/obvious fixes, or when existing tests already cover the scenario.
Even when formal tests are skipped, every new capability must be demonstrated end-to-end before you can claim it works. If you add a native binary, a script, a code generator, a new build task, or any other executable artifact — you must actually run it and show it produces the expected output. "It compiled" or "the file exists" is not verification. The build/infra exemption from formal tests does NOT exempt you from proving the thing works. If you can't demonstrate it works, you can't move on.
Examples:
When the issue includes an external reproducer (a separate project, repo, or
code sample), end-to-end verification against that reproducer is mandatory —
follow references/reproducer-verification.md. The before/after verification
matrix posted to YT is the primary evidence artifact for the fix.
When needed (new test or modification of existing):
<module>:compileTestKotlin or equivalent). A broken build dependency or
missing task wiring blocks all test compilation — surface that before writing
tests.superpowers:test-driven-development. Run via running_gradle_tests
and verify a valid RED state — the test must compile and run, then fail on
the assertion. A compilation error or setup crash is not a valid RED.After the fix is applied (B.2), re-run to confirm GREEN. If it still fails, the fix is incomplete — do not move on.
Features always use the Complex path regardless of size — they involve design decisions (API surface, naming, extensibility, integration) that benefit from brainstorming and a reviewed plan.
Standard (obvious approach, no design decisions, non-feature): brief inline bullets, start coding.
Complex (all features, OR bugs/tasks that are architectural, multi-module, public API, or have unclear tradeoffs):
superpowers:brainstorming to surface approaches and tradeoffs.Follow project conventions. Keep changes minimal and focused — don't refactor surrounding code. After fixing, run B.1 tests + related module tests.
Exit condition: all tests pass (new + existing module tests).
Use update-doc skill conventions. Evaluate:
If no doc changes are needed, state why explicitly before moving on (e.g., "No docs changes — internal implementation only, no public API affected"). Do not silently skip.
Always use the run-local-verifications skill. Before running any check,
reason about whether your change actually falls within its scope — don't run
mechanically (JPMS is irrelevant for native-only code; ABI check is irrelevant
for internal-only logic). Never run Gradle builds in parallel against the same
worktree — builds share state and corrupt each other.
For special-case verifications (conformance known_failures.txt changes, any
compiler-plugin change), see references/verification-special-cases.md. These
are mandatory extras that cannot be skipped when they apply.
Generated code: if verifications produce updated generated files (ABI dumps, WKT, conformance code, platform table), do not hand-edit them — commit the regenerated output as-is. They go into a separate commit (Phase D).
All relevant checks must pass before proceeding to C.3.
Spawn at least 2 independent review agents in parallel on the full diff.
See references/code-review-agents.md for the reviewer menu and prompting
guide.
Invoke superpowers:requesting-code-review to structure the request (capture
git range, give each reviewer structured context).
When reviews come back, invoke superpowers:receiving-code-review and handle
feedback in priority order:
After applying error/warning fixes, re-run B.1 tests to confirm no regressions.
Exit condition: all local verifications pass, all review errors fixed, tests re-confirmed.
Follow references/ship-workflow.md for commit, PR, CI, finalization, and
YouTrack update steps.
Exit condition: PR is not draft, reviewer assigned, CI green, YT issue set to "Fixed in Branch", completion verification passed.
When asked to address PR comments / feedback after the PR is up, follow
references/addressing-pr-comments.md. The reference covers reading comments,
implementing fixes, resolving conversations vs. reactions, updating checkbox
comments, and re-requesting review. "Address the feedback" means all of
these, not just the code fixes.
If you discover related bugs, latent risks, or follow-up work during any phase,
file them immediately rather than losing context. Read
references/filing-follow-up-issues.md first — it replaces
file-youtrack-issue for this workflow and encodes the required field shapes.
teamcity run log <id> --failed, fix
and push.git reset --soft to the last clean commit, recommit
with the new approach, run a clean build (clean task), update PR/comment
descriptions, re-run Phase C from scratch.Service outages follow the No Silent Fallback policy above.
Stop and report instead of grinding when:
When escalating, include: what you tried, what you learned, where the worktree is, and a specific question/decision for the user to unblock you.
Brief status at each milestone: