Skip to content

CONSOLE-5194: Audit and fix Claude Code skills for accuracy#16316

Open
sg00dwin wants to merge 5 commits intoopenshift:mainfrom
sg00dwin:CONSOLE-5194-AI-Tooling-Review
Open

CONSOLE-5194: Audit and fix Claude Code skills for accuracy#16316
sg00dwin wants to merge 5 commits intoopenshift:mainfrom
sg00dwin:CONSOLE-5194-AI-Tooling-Review

Conversation

@sg00dwin
Copy link
Copy Markdown
Member

@sg00dwin sg00dwin commented Apr 22, 2026

Analysis:
AI coding skills in .claude/skills/ accumulate stale references over time — deprecated tool names, incorrect file paths, outdated config file references — with no automated way to detect the drift.

Note: Assigning review of skill-specific changes to the associated creator of each skill.
/assign @cajieh to review .claude/skills/gen-rtl-test/SKILL.md
/assign @Leo6Leo to review .claude/skills/pre-push-review/SKILL.md
/assign @logonoff to review .claude/skills/update-package/SKILL.md
/assign @jhadvig to review claude/skills/skill-audit/SKILL.md


Description:

  • Fixed stale references across existing skills:
    • gen-rtl-test: Corrected @console/test-utils import path to @console/shared/src/test-utils/unit-test-utils; updated Rule 14 to recommend userEvent over fireEvent (no longer blocked by Jest version)
    • pre-push-review: Replaced 6 references to deprecated TodoWrite with TaskCreate/TaskUpdate; corrected .claude/CLAUDE.md references to AGENTS.md
    • update-package: Replaced TodoWrite reference with TaskCreate/TaskUpdate
  • Added new skill-audit skill (/skill-audit) that detects:
    • Broken file path references
    • Invalid @console/* import paths
    • Missing yarn/npm script references
    • Missing shell script references
    • Deprecated or unrecognized Claude Code tool names (validates against canonical tool list)
    • Cross-references skill names in CLAUDE.md/AGENTS.md/STYLEGUIDE.md/TESTING.md/settings.json against actual .claude/skills/ directories (bidirectional: config→skills and skills→config)

Test cases:

  • Run /skill-audit and verify it produces a report with no false positives
  • Run /skill-audit gen-rtl-test and verify single-skill mode works
  • Run /gen-rtl-test on a component and verify the corrected import path appears in generated tests
  • Run /pre-push-review and verify it uses TaskCreate/TaskUpdate (not TodoWrite)

Summary by CodeRabbit

  • New Features

    • Added a new audit skill to validate Claude Code skills for stale references, broken paths, and deprecated tool names.
  • Documentation

    • Updated testing guidelines to prefer userEvent over fireEvent for simulating user interactions while noting fireEvent remains acceptable for simple synchronous cases.
    • Updated workflow tracking documentation to use new task management tools.
    • Updated project context source references in guidance materials.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 22, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 22, 2026

@sg00dwin: This pull request references CONSOLE-5194 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis:
AI coding skills in .claude/skills/ accumulate stale references over time — deprecated tool names, incorrect file paths, outdated config file references — with no automated way to detect the drift.

Note: Assigning review of skill-specific changes to the associated creator of each skill.
/assign @cajieh to review .claude/skills/gen-rtl-test/SKILL.md
/assign @Leo6Leo to review .claude/skills/pre-push-review/SKILL.md
/assign @logonoff to review .claude/skills/update-package/SKILL.md
/assign @jhadvig to review claude/skills/skill-audit/SKILL.md


Description:

  • Fixed stale references across existing skills:
  • gen-rtl-test: Corrected @console/test-utils import path to @console/shared/src/test-utils/unit-test-utils; updated Rule 14 to recommend userEvent over fireEvent (no longer blocked by Jest version)
  • pre-push-review: Replaced 6 references to deprecated TodoWrite with TaskCreate/TaskUpdate; corrected .claude/CLAUDE.md references to AGENTS.md
  • update-package: Replaced TodoWrite reference with TaskCreate/TaskUpdate
  • Added new skill-audit skill (/skill-audit) that detects:
  • Broken file path references
  • Invalid @console/* import paths
  • Missing yarn/npm script references
  • Missing shell script references
  • Deprecated or unrecognized Claude Code tool names (validates against canonical tool list)
  • Cross-references skill names in CLAUDE.md/AGENTS.md/STYLEGUIDE.md/TESTING.md/settings.json against actual .claude/skills/ directories (bidirectional: config→skills and skills→config)

Test cases:

  • Run /skill-audit and verify it produces a report with no false positives
  • Run /skill-audit gen-rtl-test and verify single-skill mode works
  • Run /gen-rtl-test on a component and verify the corrected import path appears in generated tests
  • Run /pre-push-review and verify it uses TaskCreate/TaskUpdate (not TodoWrite)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

This pull request updates Claude Code skill documentation across the .claude/skills/ directory. Changes include: refactoring testing guidance in gen-rtl-test/SKILL.md to prefer userEvent over fireEvent and updating import paths; synchronizing project context references in pre-push-review/SKILL.md from .claude/CLAUDE.md to AGENTS.md; introducing a new skill-audit/SKILL.md skill that validates skill documentation for broken paths, stale references, and deprecated tool names; and updating workflow tracking mechanisms in pre-push-review/SKILL.md and update-package/SKILL.md from TodoWrite to TaskCreate/TaskUpdate.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: auditing and fixing Claude Code skills for accuracy, directly reflecting the PR's focus on detecting and resolving stale references.
Description check ✅ Passed The description provides solid analysis, root cause (stale references in skills), detailed solution breakdown per skill, explicit test cases with checkboxes, and targeted reviewer assignments. However, it lacks sections for screenshots and browser conformance as specified in the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only markdown documentation files; no Ginkgo test patterns detected. Check not applicable to markdown content.
Test Structure And Quality ✅ Passed This PR contains only markdown documentation updates to Claude Code skill definitions under .claude/skills/. No Ginkgo test files, test code, or Go test implementations are present in the modified files.
Microshift Test Compatibility ✅ Passed PR contains only markdown documentation files in .claude/skills/ directory with no Ginkgo test patterns detected.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR contains only documentation changes to Claude Code skill definition markdown files; no Ginkgo e2e tests or Go test files are being modified, making SNO compatibility check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only Markdown documentation updates (SKILL.md) with no Kubernetes manifests, operator code, or controllers modified, making the topology-aware scheduling check inapplicable.
Ote Binary Stdout Contract ✅ Passed OTE Binary Stdout Contract check does not apply to markdown documentation files defining Claude Code skills, which cannot execute code or write to stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR contains no Ginkgo e2e tests or Go test files; changes are exclusively documentation updates to Claude Code skill definition files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/skill-audit/SKILL.md:
- Line 81: The fenced code block that opens before the "## Skill Audit Report"
example lacks a language tag (triggering MD040); update the opening fence for
that example to include a language identifier (e.g., change the opening "```" to
"```markdown") so the block is correctly recognized by markdown-lint and docs
pipelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 43404fdc-d47e-4a9b-a7db-218a67b993d3

📥 Commits

Reviewing files that changed from the base of the PR and between 233c92c and 4f19328.

📒 Files selected for processing (4)
  • .claude/skills/gen-rtl-test/SKILL.md
  • .claude/skills/pre-push-review/SKILL.md
  • .claude/skills/skill-audit/SKILL.md
  • .claude/skills/update-package/SKILL.md
📜 Review details
🧰 Additional context used
🪛 markdownlint-cli2 (0.22.0)
.claude/skills/skill-audit/SKILL.md

[warning] 81-81: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔀 Multi-repo context openshift/console-operator

[::openshift/console-operator::] .claude/commands/ci-prep.md: line 96 — contains guidance "Use the TodoWrite tool to track progress..." (TodoWrite referenced).
[::openshift/console-operator::] CLAUDE.md: line 7 — references AGENTS.md.
[::openshift/console-operator::] vendor/github.com/openshift/api/.coderabbit.yaml: lines 27,49-50 — references AGENTS.md and CLAUDE.md.

Notes: this repository has no .claude/skills directory and no matches for @console/test-utils or @console/shared test-utils imports.

🔇 Additional comments (4)
.claude/skills/pre-push-review/SKILL.md (1)

134-134: Good consistency update on context + workflow tooling.

Switching project guidance to AGENTS.md and standardizing progress tracking on TaskCreate/TaskUpdate is coherent across the file and reduces stale-tool drift.

Also applies to: 159-159, 320-323, 373-374, 454-454, 476-476, 492-492

.claude/skills/update-package/SKILL.md (1)

73-73: Nice alignment with current Claude task APIs.

Using TaskCreate/TaskUpdate here keeps package-update workflow tracking consistent with other skills and avoids deprecated tool names.

.claude/skills/gen-rtl-test/SKILL.md (2)

512-512: Rule 14 update is a solid improvement.

Preferring userEvent while still allowing fireEvent for simple synchronous cases is the right balance for realism and maintainability in generated tests.

Also applies to: 556-575, 578-587


196-196: No action needed — the import alias is properly configured.

The alias @console/shared/* is explicitly mapped in frontend/tsconfig.json (line 22) to ./packages/console-shared/*, which correctly resolves @console/shared/src/test-utils/unit-test-utils to the existing file at frontend/packages/console-shared/src/test-utils/unit-test-utils.tsx. Generated tests placed in the frontend/ directory will inherit this configuration and resolve the import without issues.


Output a summary grouped by skill:

```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a language tag to the fenced report example.

Line 81 opens a fenced code block without a language specifier, which triggers MD040 and can break markdown-lint gating in strict docs pipelines.

Suggested fix
-```
+```markdown
 ## Skill Audit Report
 ...
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.0)</summary>

[warning] 81-81: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @.claude/skills/skill-audit/SKILL.md at line 81, The fenced code block that
opens before the "## Skill Audit Report" example lacks a language tag
(triggering MD040); update the opening fence for that example to include a
language identifier (e.g., change the opening "" to "markdown") so the
block is correctly recognized by markdown-lint and docs pipelines.


</details>

<!-- fingerprinting:phantom:triton:hawk:9f1da3fc-354b-4584-a9cc-ba88b5182442 -->

<!-- This is an auto-generated comment by CodeRabbit -->

Copy link
Copy Markdown
Member

@logonoff logonoff Apr 22, 2026

Choose a reason for hiding this comment

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

LGTM (but I did not write the skill :)

@sg00dwin sg00dwin force-pushed the CONSOLE-5194-AI-Tooling-Review branch from 4f19328 to 58c6de6 Compare April 22, 2026 18:07
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sg00dwin
Once this PR has been reviewed and has the lgtm label, please ask for approval from jhadvig. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

@sg00dwin: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM for this section

// Simulate clicking
fireEvent.click(button);
expect(screen.getByText(/success/i)).toBeVisible();
}, 30000); // userEvent.type is slow — extend timeout for tests with significant typing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be better to remove , 30000) and show proper async handling instead? Rather than mask timing issues with extended timeouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants