Skip to content

refactor(skills): remove unused embedded asset helpers#100

Merged
BlackHole1 merged 1 commit into
mainfrom
remove-unless-code-2
Apr 23, 2026
Merged

refactor(skills): remove unused embedded asset helpers#100
BlackHole1 merged 1 commit into
mainfrom
remove-unless-code-2

Conversation

@BlackHole1
Copy link
Copy Markdown
Member

The embedded asset source directory and agent-name helpers no longer
add value now that callers use the bundled registry data directly.
Removing them keeps the skills asset API smaller and leaves tests
focused on the remaining public behavior.

The embedded asset source directory and agent-name helpers no longer
add value now that callers use the bundled registry data directly.
Removing them keeps the skills asset API smaller and leaves tests
focused on the remaining public behavior.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Summary by CodeRabbit

  • Refactor
    • Simplified internal bundled skills utilities by removing unused helper functions, streamlining the codebase while maintaining core functionality for accessing bundled skill files.

Walkthrough

This change removes two exported utility functions (getBundledSkillAgentNames and getBundledSkillSourceDirectory) from the embedded-assets module. The corresponding test file is updated to eliminate dependencies on these functions, instead directly constructing the expected source directory path within assertions. The public API function getBundledSkillFiles() remains unchanged and continues to work with its default agent parameter.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format and clearly describes the main change: removing unused helper functions from the embedded assets module.
Description check ✅ Passed The description is directly related to the changeset, explaining why the helper functions were removed and what benefits this brings.
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.

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

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch remove-unless-code-2

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

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
src/application/commands/skills/embedded-assets.test.ts (1)

72-80: Use node:path helpers instead of hardcoded / in test path construction.

Line 72 currently assumes POSIX separators in the constructed path. Prefer join() and then normalize for the assertion.

Suggested diff
+import { join } from "node:path";
 import { describe, expect, test } from "bun:test";
@@
-                const sourceDirectory = `contrib/skills/${agentName}/${skillName}`;
+                const sourceDirectory = normalizePathForAssertion(
+                    join("contrib", "skills", agentName, skillName),
+                );
                 const skillFiles = getBundledSkillFiles(skillName, agentName);
@@
-                            `/${sourceDirectory}/`,
+                            `/${sourceDirectory}/`,

As per coding guidelines, "Never assume POSIX path separators in code, tests, snapshots, or assertions; use node:path helpers (join(), resolve(), relative()) for path construction".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/application/commands/skills/embedded-assets.test.ts` around lines 72 -
80, The test assumes POSIX separators by checking
normalizePathForAssertion(file.sourcePath).includes(`/${sourceDirectory}/`);
change this to build the expected segment using node:path helpers: import join
from 'node:path' (or path.join) and compute expectedSegment =
normalizePathForAssertion(join(sourceDirectory, '')); then assert
includes(expectedSegment) so the check uses OS-correct separators; update the
assertion that follows getBundledSkillFiles and reference variables
sourceDirectory, agentName, skillName and the helper normalizePathForAssertion
to locate the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/application/commands/skills/embedded-assets.test.ts`:
- Around line 72-80: The test assumes POSIX separators by checking
normalizePathForAssertion(file.sourcePath).includes(`/${sourceDirectory}/`);
change this to build the expected segment using node:path helpers: import join
from 'node:path' (or path.join) and compute expectedSegment =
normalizePathForAssertion(join(sourceDirectory, '')); then assert
includes(expectedSegment) so the check uses OS-correct separators; update the
assertion that follows getBundledSkillFiles and reference variables
sourceDirectory, agentName, skillName and the helper normalizePathForAssertion
to locate the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1123dee9-e6d6-405d-9341-c1653971f164

📥 Commits

Reviewing files that changed from the base of the PR and between 0ae1693 and c3c15f7.

📒 Files selected for processing (2)
  • src/application/commands/skills/embedded-assets.test.ts
  • src/application/commands/skills/embedded-assets.ts
💤 Files with no reviewable changes (1)
  • src/application/commands/skills/embedded-assets.ts

@BlackHole1 BlackHole1 merged commit 4b5a219 into main Apr 23, 2026
5 checks passed
@BlackHole1 BlackHole1 deleted the remove-unless-code-2 branch April 23, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant