Skip to content

llm: Add resolving-sdk-updates skill#6650

Open
SaintPatrck wants to merge 4 commits intomainfrom
llm/add-resolving-sdk-updates-skill
Open

llm: Add resolving-sdk-updates skill#6650
SaintPatrck wants to merge 4 commits intomainfrom
llm/add-resolving-sdk-updates-skill

Conversation

@SaintPatrck
Copy link
Contributor

@SaintPatrck SaintPatrck commented Mar 12, 2026

🎟️ Tracking

Internal tooling — no Jira ticket.
Used to resolve breaking changes in #6615

📔 Objective

Adds a new Claude Code skill (resolving-sdk-updates) that teaches Claude to diagnose and resolve build failures from Bitwarden SDK (com.bitwarden:sdk-android) version updates.

The skill provides a five-phase workflow:

  1. Identify — extract SDK version diff and parse PR body for sdk-internal PR references and Jira tickets
  2. Diagnose — categorize compiler errors (exhaustive when, removed API, renamed type, new required parameter, new error type)
  3. Investigate — read sdk-internal PR diffs to understand the author's intent behind breaking changes
  4. Fix — apply appropriate patterns from the bundled reference guide, then grep for non-compiler-caught usages
  5. Assess — classify changes as compile-only vs feature-requiring and trace Jira tickets for follow-up work

Preprocessed context injection:

  • Skill automatically runs git branch, git diff, and gh run list on load to detect current branch, SDK version delta, and CI failures
  • Proactive behavior skips to Phase 2 when CI failures are detected

Allowed-tools (least-privilege):

  • Read-only git: git branch --show-current, git diff *
  • Read-only GitHub CLI: gh run list *, gh run view *, gh pr view *, gh pr diff *
  • No write/destructive operations permitted

Files added:

  • .claude/skills/resolving-sdk-updates/SKILL.md — main skill instructions with preprocessed context and allowed-tools frontmatter
  • .claude/skills/resolving-sdk-updates/references/common-fix-patterns.md — error category to fix strategy quick-reference

Teaches Claude to diagnose and resolve build failures from Bitwarden SDK
(com.bitwarden:sdk-android) version updates with a five-phase workflow:
identify, diagnose, investigate, fix, and assess behavioral impact.
@github-actions github-actions bot added the t:llm Change Type - LLM related change (e.g. CLAUDE.md files) label Mar 12, 2026
@SaintPatrck SaintPatrck added the ai-review Request a Claude code review label Mar 12, 2026
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.09%. Comparing base (d9f8c3d) to head (8630094).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6650      +/-   ##
==========================================
- Coverage   85.80%   85.09%   -0.71%     
==========================================
  Files         848      934      +86     
  Lines       58851    59649     +798     
  Branches     8351     8415      +64     
==========================================
+ Hits        50497    50761     +264     
- Misses       5455     5955     +500     
- Partials     2899     2933      +34     
Flag Coverage Δ
app-data 17.45% <ø> (+0.24%) ⬆️
app-ui-auth-tools 21.01% <ø> (-0.03%) ⬇️
app-ui-platform 15.76% <ø> (+0.25%) ⬆️
app-ui-vault 26.51% <ø> (-0.03%) ⬇️
authenticator 6.62% <ø> (-0.04%) ⬇️
lib-core-network-bridge 4.26% <ø> (-0.04%) ⬇️
lib-data-ui 0.95% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claude
Copy link
Contributor

claude bot commented Mar 12, 2026

Claude finished @SaintPatrck's task in 2m 18s —— View job


I'll analyze this and get back to you.

@claude
Copy link
Contributor

claude bot commented Mar 12, 2026

Code Review Summary

PR: llm: Add resolving-sdk-updates skill
Risk: None (LLM documentation only -- no runtime code changes)

Overview

This PR adds a well-structured Claude Code skill for diagnosing and resolving build failures caused by Bitwarden SDK version updates. The five-phase workflow (identify, diagnose, investigate, fix, assess) is thorough and the reference material in common-fix-patterns.md covers the common error categories well.

Strengths:

  • The CRITICAL emphasis on reading sdk-internal PR diffs before applying fixes is an important guardrail against incomplete compile-only fixes
  • Graceful degradation for Jira integration when the Atlassian MCP plugin is unavailable
  • Phase 4 step 2 (grep for non-exhaustive when statements) catches an important class of issues the compiler misses
  • Good cross-references to existing skills (build-test-verify, reviewing-changes, implementing-android-code)

Findings

Severity File Description
SUGGESTED SKILL.md:2 Missing version field in frontmatter -- every other skill in the repo includes one (e.g., version: 0.1.0). Adding it would maintain consistency.
SUGGESTED Both files (SKILL.md:205, common-fix-patterns.md:195) Missing trailing newline at end of file. The git diff shows No newline at end of file for both.

No critical, important, or correctness issues found.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Logo
Checkmarx One – Scan Summary & Detailse5b5ac55-30e7-4820-8701-f5e13c836e4d


Fixed Issues (1) Great job! The following issues were fixed in this Pull Request
Severity Issue Source File / Package
MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt: 487

@SaintPatrck
Copy link
Contributor Author

@claude version is not an officially documented frontmatter property for Skills. existing ones are using it incorrectly. There are newlines. Your diff may be hiding the whitespace.

@SaintPatrck SaintPatrck marked this pull request as ready for review March 12, 2026 19:14
@SaintPatrck SaintPatrck requested a review from a team as a code owner March 12, 2026 19:15
@claude
Copy link
Contributor

claude bot commented Mar 12, 2026

Code Review Summary

PR: llm: Add resolving-sdk-updates skill
Risk: None (LLM documentation only -- no runtime code changes)

Overview

This PR adds a well-structured Claude Code skill for diagnosing and resolving build failures caused by Bitwarden SDK version updates. The five-phase workflow (identify, diagnose, investigate, fix, assess) is thorough and the reference material in common-fix-patterns.md covers the common error categories well.

Strengths:

  • The CRITICAL emphasis on reading sdk-internal PR diffs before applying fixes is an important guardrail against incomplete compile-only fixes
  • Graceful degradation for Jira integration when the Atlassian MCP plugin is unavailable
  • Phase 4 step 2 (grep for non-exhaustive when statements) catches an important class of issues the compiler misses
  • Good cross-references to existing skills (build-test-verify, reviewing-changes, implementing-android-code)
  • The preprocessed context injection (second commit) provides immediate situational awareness when the skill loads, reducing manual setup steps

Re-review (commit 90b8806)

Reviewed the incremental changes adding preprocessed context injection. The three shell commands are safe and appropriate, and the updated Proactive Behavior / Phase 1 sections correctly reference the preprocessed data. No issues found.

Findings

No actionable findings. Both previously suggested items were addressed by the author.

Result: Approved -- clean PR with no critical, important, or correctness issues.

@SaintPatrck SaintPatrck requested review from a team and david-livefront March 12, 2026 19:15
@SaintPatrck SaintPatrck enabled auto-merge March 13, 2026 17:53
- Replace $(git branch --show-current) with hardcoded sdlc/sdk-update
  branch name to avoid $() command substitution blocked by permission checks
- Add allowed-tools frontmatter for git and gh commands used in
  preprocessed context
@claude
Copy link
Contributor

claude bot commented Mar 16, 2026

Code Review Summary

Overall Assessment: APPROVE

Re-reviewed incremental commit b31c448 (Fix skill preprocessing: remove command substitution and add allowed-tools). The two changes are sound:

Code Review Details
  1. allowed-tools frontmatter (SKILL.md line 12): Correctly restricts the skill to read-only git and gh commands matching the preprocessed context commands. Least-privilege approach.
  2. Hardcoded branch name (SKILL.md line 32): Replacing dynamic branch detection with sdlc/sdk-update is a pragmatic workaround for command substitution being blocked in preprocessing. The branch name matches the documented convention (line 24), and the separate "Current branch" preprocessed line still dynamically detects the actual branch.
  3. The removed fallback echo is fine -- empty output from the CI check is handled correctly by the Proactive Behavior section.

No actionable findings.


CRITICAL: Before applying any fix, always read the `sdk-internal` PR diff to understand the author's intent. A compile fix alone may be insufficient if the SDK change introduces new behavior that requires a dedicated code path.

## Current State (preprocessed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 We can cut most of these setup steps if we assume this runs when sdlc-sdk-update.yml fails, SDK Update PR description will have the changelog as a list of sdk-internal PRs and we have the build run failure logs / know which run failed. We can then focus tokens and runtime on (1) preliminary diagnose based on common errors and if that isn't enough, (2) analysing the PRs in the changelog and how they may have influenced the build failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to assume that this is run only when the update fails. Since we mock the SDK behavior in tests there's a real risk of behavior changes in the SDK going unnoticed even when our tests pass. The sdk update workflow only catches breaking code changes so, imo, it's important that the SDK pull requests are always reviewed. Just like a Human contributor/maintainer is expected to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, side note: the !<command> syntax I'm using below doesn't have a significant impact on token usage. The preceding ! indicates the <command> is executed as a raw bash command and the result is injected into the content. My understanding is it's not executed by the LLM so there's not overhead of invoking tools and parsing responses. More about ! in the Advanced Patterns docs.

Co-authored-by: Álison Fernandes <vvolkgang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:llm Change Type - LLM related change (e.g. CLAUDE.md files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants