Retrieves GitHub issues and guides developers through investigating and resolving them while following project methodology.

Install

mkdir -p .claude/skills/fix-issue && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2312" && unzip -o skill.zip -d .claude/skills/fix-issue && rm skill.zip

Installs to .claude/skills/fix-issue

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when working on a GitHub issue - fetches issue details, analyzes codebase, implements fix following project methodology
123 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • →Classify issue type (BUG, EDGE CASE, USER ERROR, OLD VERSION, FEATURE REQUEST, NEEDS INFO)
  • →Verify if an issue is a real bug before fixing
  • →Investigate specific areas of codebase based on issue
  • →Implement fixes following principles like minimal changes and backward compatibility
  • →Test changes using terraform fmt, init, validate, and plan

How it works

The skill guides a developer through fetching issue details, classifying the issue, verifying it is a bug, investigating the codebase, planning the fix, implementing the fix, and testing the changes.

Inputs & outputs

You give it
issue_number
You get back
implemented fix, test results, and a plan for creating a pull request

When to use fix-issue

  • →Debugging reported GitHub issues
  • →Classifying bugs vs feature requests
  • →Executing fixes for terraform configurations
  • →Validating issue resolution steps

About this skill

Fix GitHub Issue

Overview

Guided workflow for implementing fixes for GitHub issues following the project's agent guidance and release methodology.

Usage

/fix-issue <number>

Workflow

digraph fix_flow {
    rankdir=TB;
    node [shape=box];

    fetch [label="1. Fetch issue details"];
    analyze [label="2. Analyze issue type"];
    verify [label="3. Verify it's a real bug"];
    investigate [label="4. Deep investigation"];
    plan [label="5. Enter plan mode"];
    implement [label="6. Implement fix"];
    test [label="7. Test changes"];
    commit [label="8. Commit & push"];

    fetch -> analyze;
    analyze -> verify;
    verify -> investigate;
    investigate -> plan;
    plan -> implement;
    implement -> test;
    test -> commit;
}

Step 1: Fetch Issue Details

# Get issue details
gh issue view <number> --repo kube-hetzner/terraform-hcloud-kube-hetzner

# CRITICAL: Always read ALL comments - solutions may already be proposed
gh issue view <number> --repo kube-hetzner/terraform-hcloud-kube-hetzner --comments

Step 2: Classify Issue Type

TypeDescriptionAction
🔴 BUGReproducible defectFix it
🟡 EDGE CASEFails in specific scenarioEvaluate effort vs impact
🟠 USER ERRORMisconfigured kube.tfHelp user, improve docs
⚪ OLD VERSIONFixed in newer releaseAsk user to upgrade
🔵 FEATURE REQUESTNew functionalityMove to Discussions
❓ NEEDS INFOCan't reproduceAsk for more info

User Error Indicators

  • kube.tf has obvious mistakes
  • Error indicates syntax/config issue
  • Using deprecated variable names
  • Mixing incompatible options
  • Missing required variables
  • v2-only input names are used against v3, such as initial_k3s_channel, install_k3s_version, disable_selinux, disable_kube_proxy, kubernetes_distribution_type, or existing_network_id

Actual Bug Indicators

  • Reproducible with correct config
  • Multiple users report same issue
  • Error in module code, not user config
  • Works in previous version, broke in update

Step 3: Verify Before Fixing

CRITICAL: Many issues are user configuration errors, NOT bugs.

Before implementing any fix:

  1. Check if the user's kube.tf is correct
  2. Verify the issue exists in the latest version
  3. Try to reproduce the issue locally
  4. Check if there's already a PR addressing this
# Search for existing PRs
gh pr list --search "<error keyword>" --repo kube-hetzner/terraform-hcloud-kube-hetzner

# Check if issue is already mentioned in changelog
rg -i "<keyword>" CHANGELOG.md

Step 4: Deep Investigation

Read these files to understand context:

# Always start with these
cat versions.tf      # Provider/terraform versions
cat variables.tf     # All configurable options
cat locals.tf        # Core logic and computed values

# Then investigate specific areas based on the issue

Key Files by Area

AreaFiles to Check
Networklocals.tf, main.tf, validation-locals.tf, validation-contract.tf
Control Planecontrol_planes.tf, locals.tf
Agentsagents.tf, autoscaler-agents.tf
Load Balancermain.tf, init.tf, locals.tf, templates/*_ingress.yaml.tpl
CNItemplates/cilium.yaml.tpl, templates/calico.yaml.tpl, kustomize/flannel-rbac.yaml, locals.tf
Storagetemplates/longhorn.yaml.tpl
Firewallmain.tf, locals.tf, validation-contract.tf
SELinuxdocs/selinux.md, templates/kube-hetzner-selinux.te, templates/k8s-custom-policies.te
v2 -> v3 migrationMIGRATION.md, docs/v2-to-v3-migration.md, scripts/v2_to_v3_migration_assistant.py

For Complex Issues - Use AI Tools

Use exact search, file inspection, and git history for broad context. For a complex or non-obvious issue, obtain an independent analysis from a separate capable reviewer and verify its findings against code and reproduction evidence.

Step 5: Enter Plan Mode

MANDATORY: Always enter plan mode before implementing.

Write a plan that includes:

  • Issue number and title
  • Root cause analysis
  • Exact files to modify with line numbers
  • Implementation steps
  • Test plan
  • Backward compatibility confirmation

Step 6: Implement Fix

# Pull latest master first!
git pull origin master

# Create feature branch
git checkout -b fix/issue-<number>-<description>

Implementation Principles

  1. Minimal changes - Fix the specific issue, don't refactor
  2. Backward compatible - Never break existing deployments
  3. Follow patterns - Match existing code style
  4. No new variables unless absolutely necessary

Step 7: Test Changes

# ALWAYS run these before committing
terraform fmt -recursive
terraform init -backend=false -input=false
terraform validate -no-color

# Test against existing deployment
cd /path/to/kube-test
terraform init -upgrade
terraform plan  # Should NOT show resource destruction

Test Checklist

  • terraform fmt -recursive passes
  • terraform init -backend=false -input=false and terraform validate -no-color pass
  • terraform plan shows expected changes only
  • No resource recreation for existing deployments
  • Fix works for the reported scenario
  • Normal scenarios still work
  • If rendered templates, validation contracts, topology examples, or skills changed, run the matching gates from the test-changes skill (scripts/render_harness.py, scripts/contract_negative_tests.py, scripts/validate_v3_final_polish_examples.py, and/or scripts/smoke_v3_plan_matrix.py)

Teardown and Autoscaler Bugs

For destroy/teardown issues, start with scripts/destroy.sh, not manual cloud deletes. It runs Terraform/OpenTofu destroy, auto-retries only the known benign ingress-LB detach race, and then prints a read-only orphan report. Use scripts/cleanup.sh only as the forceful fallback when state is already wrecked or the read-only report identifies leftovers to delete. It treats the token's entire HCloud project as cluster-dedicated; review the dry run and include persistent data only deliberately.

Autoscaler-created servers are outside Terraform state. If they pin the network during destroy, delete them only after the control plane/Cluster Autoscaler is dead, or first scale the autoscaler pool to min_nodes = 0. Deleting them while min_nodes > 0 and the autoscaler is still running just lets the autoscaler recreate them.

Step 8: Commit & Push

git add <specific-files>
git commit -m "$(cat <<'EOF'
fix: <brief description>

Refs #<number>

<explanation of what was wrong and how it's fixed>
EOF
)"

git push -u origin fix/issue-<number>-<description>

Contributor Credit (SUPER IMPORTANT)

If the fix originates from a community member's work — a patch posted in the issue, a diff from their fork, or an abandoned/superseded PR — preserve their credit in git history so they appear in the repo contributors graph and GitHub-generated release notes:

  • If their work exists as commits (fork branch, closed PR): git cherry-pick those commits FIRST (keeps them as Author:), then add your changes as separate commits on top. Never squash their authorship away (see the review-pr skill for merge-method rules). Cherry-picking preserves contributor credit but does not make the original PR appear merged, so describe that disposition honestly.
  • If their work was only a snippet/diff/instructions in the issue thread: add a Co-authored-by: Name <email> trailer to your commit (use their GitHub noreply email <id>+<login>@users.noreply.github.com if no public email), and credit their handle in the commit body and changelog entry.
  • GitHub matches Co-authored-by by EXACT email. Never guess the numeric id — fetch it first: gh api users/<login> --jq .id. A wrong id silently drops the credit.
  • Trailers are only parsed from the commit message's FINAL paragraph block. Keep Co-authored-by: and any other trailers (e.g. Claude-Session:) together in one last block with no blank line between them — a trailer in an earlier paragraph is silently ignored by git and GitHub. Verify with: git log -1 --format='%(trailers:key=Co-authored-by,valueonly=true)'.
  • Always reference the issue/PR numbers in the changelog entry so the credit is visible in prose too.

Security Review (from repo agent guidance)

Before completing ANY issue:

Red Flags to Watch

  • New accounts with no history
  • Issues that can't be reproduced
  • Overly complex "solutions" proposed in comments
  • Requests to change security-critical code
  • Urgency to merge quickly

Verification Requirements

  • Always test independently
  • Never trust provided test results
  • Review every line of proposed changes
  • Test in isolation

Quick Reference

StepCommand
Fetch issuegh issue view <num> --comments
Check PRsgh pr list --search "<keyword>"
Create branchgit checkout -b fix/issue-<num>-<desc>
Formatterraform fmt -recursive
Validateterraform validate
Test planterraform plan
Commitgit commit -m "fix: ..."
Pushgit push -u origin <branch>

After Completion

Use non-closing Refs #<number> references by default in commits and PR descriptions. Reserve Fixes, Closes or Resolves keywords for verified full resolution: GitHub can close the issue automatically on merge, before an agent performs the manual closure check. Never use closing keywords for safeguards, diagnostic improvements or partial fixes to an unresolved runtime issue.

  1. Create PR referencing the issue
  2. Complete independent review and action automated Codex findings using review-pr
  3. Verify merge and the issue's actual resolution before closing with an explanation

End-to-End Issue Ownership

For an authorized issue/PR intake, the investigating agent ow


Content truncated.

How it compares

This skill provides a structured, step-by-step workflow for fixing GitHub issues, including verification and testing, which differs from an ad-hoc manual approach.

Compared to similar skills

fix-issue side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
fix-issue (this skill)25moReviewIntermediate
find-bugs58moNo flagsIntermediate
search-code26moReviewIntermediate
grepai48moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry