kotlin/fix-issue
> tests, PR creation, CI validation, and reviewer assignment.
npx skills add https://github.com/Kotlin/kotlinx-rpc --skill fix-issue
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 RESTfallback, use $YOUTRACK_AGENT_TOKEN (not $YOUTRACK_TOKEN).
teamcity auth status/login. Prefix every commandwith 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.via 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.reproducible): comment explicitly stating why ("Reproducer not needed —
the bug is visible in any generated KDoc block; the issue description itself
serves as the reproduction").
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_testsand 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.risks, verification).
simpler alternatives, binary-compat risks, architectural patterns).
correctness, not permission.
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:
unfixed errors.
(document it).
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, fixand push.
or queue issues) is common and doesn't indicate a code problem. Only
investigate if it cancels again.
git reset --soft to the last clean commit, recommitwith 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:
explanations and you can't confidently pick.
retries — actual code changes that still fail).
describes; fix would span unrelated modules.
another team's decision.
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:
Take kotlin/fix-issue from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.