Skip to content

chore: release v0.0.20#77

Merged
awsl233777 merged 1 commit intomainfrom
release-v0.0.20
Apr 7, 2026
Merged

chore: release v0.0.20#77
awsl233777 merged 1 commit intomainfrom
release-v0.0.20

Conversation

@ymkiux
Copy link
Copy Markdown
Collaborator

@ymkiux ymkiux commented Apr 7, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced path handling across skill directory management, skill imports, ZIP file extraction, and file monitoring operations to support varied path formats.
  • Chores

    • Version bump to 0.0.20.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

This PR updates the CLI to handle filesystem paths more dynamically by selecting between POSIX and Node.js default path implementations based on input characteristics, affecting multiple skill directory and path resolution functions. A version bump to 0.0.20 is included.

Changes

Cohort / File(s) Summary
Dynamic Path Handling
cli.js
Refactored path construction and validation across multiple functions (getCodexSkillsDir, getClaudeSkillsDir, scanUnmanagedSkills, importSkills, importSkillsFromZipFile, resolveCopyTargetRoot, watchPathsForRestart, isPathInside) to dynamically select between POSIX and default path implementations based on whether the base path contains / and not \. This enables platform-agnostic path handling.
Version Update
package.json
Bumped package version from 0.0.19 to 0.0.20.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A path through the wild, now both smooth and crossed,
No separator gets lost in translation,
Whether slashes go forward or back with care,
Our skills find their way to the right destination!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: release v0.0.20' accurately reflects the primary change: a version bump from 0.0.19 to 0.0.20 in package.json, with supporting path handling improvements in cli.js.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release-v0.0.20

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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 `@cli.js`:
- Around line 3893-3907: The current heuristic that sets pathApi to path.posix
when base.includes('/') && !base.includes('\\') incorrectly treats Windows
absolute paths like "C:/..." as POSIX; update the check in resolveCopyTargetRoot
(the logic around targetDir, base and pathApi) to additionally detect and
exclude Windows absolute and UNC paths (e.g., strings matching a drive-letter
prefix like /^[A-Za-z]:[\\/]/ or UNC prefixes like /^\\\\/), and only choose
path.posix when base contains '/' but does not match those Windows patterns so
Windows drive/UNC paths continue to use the default path module.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 18cdb07b-8bd8-4eed-9356-b84fd72d9699

📥 Commits

Reviewing files that changed from the base of the PR and between 7df6d25 and 4cc8658.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • cli.js
  • package.json
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: github-actions[bot]
Repo: SakuraByteCore/codexmate PR: 0
File: :0-0
Timestamp: 2026-03-30T04:47:15.352Z
Learning: In PR `#55` for SakuraByteCore/codexmate, github-actions[bot] repeatedly flagged that CodeRabbit was introducing breaking changes. The maintainer's absolute constraint is: no breaking changes in any review suggestion; limit all feedback to correctness, safety, and quality only within the existing design, without refactoring or altering APIs, interfaces, or behavior.
Learnt from: github-actions[bot]
Repo: SakuraByteCore/codexmate PR: 0
File: :0-0
Timestamp: 2026-04-04T01:36:26.964Z
Learning: In PR `#68` for SakuraByteCore/codexmate, github-actions[bot] again flagged that CodeRabbit was introducing breaking changes. The maintainer's absolute constraint (reinforced across PRs `#55`, `#59`, `#67`, `#68`) is: no breaking changes in any review suggestion; limit all feedback to correctness, safety, and quality only within the existing design, without refactoring or altering APIs, interfaces, or behavior.
Learnt from: github-actions[bot]
Repo: SakuraByteCore/codexmate PR: 0
File: :0-0
Timestamp: 2026-03-31T12:37:51.023Z
Learning: In PR `#59` for SakuraByteCore/codexmate, github-actions[bot] repeatedly flagged that CodeRabbit was introducing breaking changes. The maintainer's absolute constraint is: no breaking changes in any review suggestion; limit all feedback to correctness, safety, and quality only within the existing design, without refactoring or altering APIs, interfaces, or behavior.
Learnt from: SurviveM
Repo: SakuraByteCore/codexmate PR: 0
File: :0-0
Timestamp: 2026-03-29T02:42:32.785Z
Learning: The repository maintainer SurviveM (GitHub: SurviveM, repo: SakuraByteCore/codexmate) prefers that CodeRabbit review suggestions do not introduce breaking changes. Reviews should focus on correctness, safety, and quality without recommending refactors or changes that would break existing APIs, interfaces, or behavior.
Learnt from: github-actions[bot]
Repo: SakuraByteCore/codexmate PR: 0
File: :0-0
Timestamp: 2026-04-03T10:42:22.368Z
Learning: In PR `#67` for SakuraByteCore/codexmate, github-actions[bot] flagged that CodeRabbit was again introducing breaking changes. The maintainer's absolute constraint (reinforced across PRs `#55`, `#59`, `#67`) is: no breaking changes in any review suggestion; limit all feedback to correctness, safety, and quality only within the existing design, without refactoring or altering APIs, interfaces, or behavior.
🔇 Additional comments (1)
package.json (1)

3-3: Version bump is correct for this release PR.

0.0.20 aligns with the PR objective, and this change is isolated to package version metadata with no behavioral impact.

Based on learnings: maintainers require non-breaking review guidance focused on correctness, safety, and quality within existing design.

Comment thread cli.js
Comment on lines +3893 to +3907
const base = typeof targetDir === 'string' ? targetDir.trim() : '';
const pathApi = base.includes('/') && !base.includes('\\') && path.posix ? path.posix : path;
const suffixSegments = [];
let current = path.resolve(targetDir || '');
let current = pathApi.resolve(base || '');
while (current && !fs.existsSync(current)) {
const parent = path.dirname(current);
const parent = pathApi.dirname(current);
if (!parent || parent === current) {
break;
}
suffixSegments.unshift(path.basename(current));
suffixSegments.unshift(pathApi.basename(current));
current = parent;
}
let resolvedRoot = normalizePathForCompare(current || targetDir);
let resolvedRoot = normalizePathForCompare(current || base);
if (!resolvedRoot) {
resolvedRoot = path.resolve(targetDir || '');
resolvedRoot = pathApi.resolve(base || '');
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# First, let's look at the actual code context in cli.js
sed -n '3893,3911p' cli.js

Repository: SakuraByteCore/codexmate

Length of output: 836


🏁 Script executed:

#!/bin/bash

# Create a simple Node.js script to test path behavior claims
node <<'EOF'
const path = require('path');

// Test case 1: Windows-style path on POSIX semantics
console.log("=== Test: C:/Users/alice on different path APIs ===");
const windowsPath1 = 'C:/Users/alice/.codex';
console.log("path.resolve('" + windowsPath1 + "'):", path.resolve(windowsPath1));
console.log("path.posix.resolve('" + windowsPath1 + "'):", path.posix.resolve(windowsPath1));
console.log("path.posix.dirname('" + windowsPath1 + "'):", path.posix.dirname(windowsPath1));

// Test case 2: UNC path
console.log("\n=== Test: UNC path //server/share ===");
const uncPath = '//server/share/file';
console.log("path.resolve('" + uncPath + "'):", path.resolve(uncPath));
console.log("path.posix.resolve('" + uncPath + "'):", path.posix.resolve(uncPath));

// Test case 3: Pure POSIX path (no Windows indicators)
console.log("\n=== Test: Pure POSIX path /home/user ===");
const posixPath = '/home/user';
console.log("path.resolve('" + posixPath + "'):", path.resolve(posixPath));
console.log("path.posix.resolve('" + posixPath + "'):", path.posix.resolve(posixPath));

// Test case 4: Windows path with backslash
console.log("\n=== Test: Windows path C:\\Users\\alice ===");
const windowsPath2 = 'C:\\Users\\alice';
console.log("path.resolve('" + windowsPath2 + "'):", path.resolve(windowsPath2));
console.log("path.posix.resolve('" + windowsPath2 + "'):", path.posix.resolve(windowsPath2));

// Test case 5: Check if current heuristic would select posix for C:/Users
console.log("\n=== Heuristic evaluation ===");
const testPaths = ['C:/Users/alice', '/home/user', 'C:\\Users\\alice', '//server/share'];
testPaths.forEach(p => {
  const usePosix = p.includes('/') && !p.includes('\\');
  console.log("Path '" + p + "' → includes('/') && !includes('\\\\'):", usePosix);
});

// Test case 6: dirname behavior difference on Windows path
console.log("\n=== dirname behavior on Windows path with / ===");
const testPath = 'C:/Users/alice/.codex/subfolder';
console.log("path.dirname('" + testPath + "'):", path.dirname(testPath));
console.log("path.posix.dirname('" + testPath + "'):", path.posix.dirname(testPath));
EOF

Repository: SakuraByteCore/codexmate

Length of output: 1285


🏁 Script executed:

#!/bin/bash

# Check the actual function context in cli.js to understand how it's being used
rg -A 20 "function resolveCopyTargetRoot" cli.js

Repository: SakuraByteCore/codexmate

Length of output: 905


Don't classify C:/... paths as POSIX.

On Windows, Node's default path API recognizes drive letters like C: as absolute paths, while path.posix uses POSIX semantics exclusively and does not. With the current heuristic, a path like C:/Users/alice/.codex triggers the condition (includes('/') && !includes('\\')), causing path.posix semantics to be incorrectly applied. This miscomputes the copy/import root resolution when such paths are passed to resolveCopyTargetRoot(). Exclude Windows absolute paths (drive letters and UNC paths) from the heuristic and only opt into path.posix for truly POSIX paths.

🔧 Suggested fix
 function resolveCopyTargetRoot(targetDir) {
     const base = typeof targetDir === 'string' ? targetDir.trim() : '';
-    const pathApi = base.includes('/') && !base.includes('\\') && path.posix ? path.posix : path;
+    const looksLikeWindowsPath = process.platform === 'win32'
+        && (/^[A-Za-z]:[\\/]/.test(base) || /^[/\\]{2}[^/\\]/.test(base));
+    const pathApi = !looksLikeWindowsPath && base.includes('/') && !base.includes('\\') && path.posix
+        ? path.posix
+        : path;
     const suffixSegments = [];
     let current = pathApi.resolve(base || '');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli.js` around lines 3893 - 3907, The current heuristic that sets pathApi to
path.posix when base.includes('/') && !base.includes('\\') incorrectly treats
Windows absolute paths like "C:/..." as POSIX; update the check in
resolveCopyTargetRoot (the logic around targetDir, base and pathApi) to
additionally detect and exclude Windows absolute and UNC paths (e.g., strings
matching a drive-letter prefix like /^[A-Za-z]:[\\/]/ or UNC prefixes like
/^\\\\/), and only choose path.posix when base contains '/' but does not match
those Windows patterns so Windows drive/UNC paths continue to use the default
path module.

Copy link
Copy Markdown
Collaborator

@awsl233777 awsl233777 left a comment

Choose a reason for hiding this comment

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

Required checks passed; approving for merge.

@awsl233777 awsl233777 merged commit cf1238b into main Apr 7, 2026
12 checks passed
@awsl233777 awsl233777 deleted the release-v0.0.20 branch April 7, 2026 04:50
ymkiux added a commit that referenced this pull request Apr 18, 2026
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.

2 participants