fix(skills): use kiro-cli agent mapping and support --copy installs#349
Conversation
|
@medhatgalal is attempting to deploy a commit to the plgeek Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a --copy install mode, maps agent id Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as "skills CLI"
participant Installer as "skill-installer\n(buildAddSkillInstallArgs)"
participant AddSkill as "bunx add-skill\n(external process)"
User->>CLI: run "skills install ralph-tui --agent kiro [--copy]"
CLI->>Installer: parseInstallArgs(...) -> options{agentId: "kiro", copy: true/false}
CLI->>Installer: buildAddSkillInstallArgs(options)
Installer-->>CLI: args["add-skill","subsy/ralph-tui","-a","kiro-cli",...,"--copy"?]
CLI->>AddSkill: spawn bunx with constructed args
AddSkill-->>CLI: exit / error (e.g., eloopOnly failure)
alt eloopOnly failure and copy == false
CLI->>User: suggest rerun with "--copy"
else success or copy==true
CLI->>User: print install status (mode: copy/symlink)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #349 +/- ##
=======================================
Coverage 47.34% 47.35%
=======================================
Files 111 111
Lines 36430 36446 +16
=======================================
+ Hits 17248 17258 +10
- Misses 19182 19188 +6
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/commands/skills.ts (1)
410-413: Avoid suggesting--copywhen copy mode is already active.Line 412 can produce redundant advice if the current invocation already included
--copy. Consider gating that hint behind!options.copy.Suggested patch
if (result.installed) { console.log(`${GREEN}✓${RESET} ${BOLD}Installed ${result.skillCount} skill${result.skillCount !== 1 ? 's' : ''} to ${result.agentCount} agent${result.agentCount !== 1 ? 's' : ''}${RESET}`); if (result.agents.length > 0) { console.log(` ${DIM}Agents: ${result.agents.join(', ')}${RESET}`); } if (result.eloopOnly) { console.log(` ${DIM}(Some agents share skill directories via symlinks — skills already accessible)${RESET}`); - console.log(` ${DIM}(If you need physical files instead, rerun with: ralph-tui skills install --copy)${RESET}`); + if (!options.copy) { + console.log(` ${DIM}(If you need physical files instead, rerun with: ralph-tui skills install --copy)${RESET}`); + } } } else if (exitCode !== 0) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/skills.ts` around lines 410 - 413, The hint about rerunning with "--copy" should only be shown when copy mode isn't already active: wrap the second console.log that references rerun with "ralph-tui skills install --copy" behind a check of the CLI options (e.g., if (!options.copy)) so that when result.eloopOnly is true you always show the symlink notice but only show the "--copy" suggestion when options.copy is false; update the block around result.eloopOnly accordingly to reference the existing options variable used in this command handler.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@website/content/docs/getting-started/installation.mdx`:
- Around line 214-215: The page shows example commands adding "ralph-tui skills
install --agent kiro" but the "Supported Agents" tables still omit Kiro; update
each "Supported Agents" table/section on the page to include a row/entry for
Kiro (matching the format used for other agents like droid/kiro), ensuring the
agent name, short description and any capability flags mirror the style used for
entries such as "droid" so the examples and tables remain consistent.
---
Nitpick comments:
In `@src/commands/skills.ts`:
- Around line 410-413: The hint about rerunning with "--copy" should only be
shown when copy mode isn't already active: wrap the second console.log that
references rerun with "ralph-tui skills install --copy" behind a check of the
CLI options (e.g., if (!options.copy)) so that when result.eloopOnly is true you
always show the symlink notice but only show the "--copy" suggestion when
options.copy is false; update the block around result.eloopOnly accordingly to
reference the existing options variable used in this command handler.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bdbdc4cb-d0d4-436c-8ea9-66e59b725915
📒 Files selected for processing (7)
README.mdsrc/commands/skills-install.test.tssrc/commands/skills.test.tssrc/commands/skills.tssrc/setup/skill-installer.test.tssrc/setup/skill-installer.tswebsite/content/docs/getting-started/installation.mdx
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/commands/skills-install.test.ts (2)
210-218: Check the-apayload, not just token presence.This currently proves that
kiro-cliappears somewhere in argv, but not that it is the value passed after-a.Proposed tightening
- expect(mockSpawnArgs[0].args).toContain('-a'); - expect(mockSpawnArgs[0].args).toContain('kiro-cli'); + const agentFlagIndex = mockSpawnArgs[0].args.indexOf('-a'); + expect(agentFlagIndex).toBeGreaterThanOrEqual(0); + expect(mockSpawnArgs[0].args[agentFlagIndex + 1]).toBe('kiro-cli'); + expect(mockSpawnArgs[0].args).not.toContain('kiro');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/skills-install.test.ts` around lines 210 - 218, The test currently only asserts that 'kiro-cli' appears somewhere in argv; instead verify that 'kiro-cli' is the value passed directly after the '-a' flag. In the test for executeSkillsCommand(['install', '--agent', 'kiro']), locate the index of '-a' in mockSpawnArgs[0].args (or equivalent argv array), assert that index is >= 0, and then assert mockSpawnArgs[0].args[index + 1] === 'kiro-cli' so the payload for '-a' is validated (use the existing mockSpawnArgs and executeSkillsCommand references).
130-140: Assert the suppressed hint across both console streams.This only checks
console.log. If the duplicate--copyhint is emitted onconsole.errorin the failure path, the test still passes.Proposed tightening
- const allOutput = consoleSpy.mock.calls.map((c: unknown[]) => c[0]).join('\n'); + const logOutput = consoleSpy.mock.calls.map((c: unknown[]) => c[0]).join('\n'); + const errorOutput = consoleErrorSpy.mock.calls.map((c: unknown[]) => c[0]).join('\n'); + const allOutput = `${logOutput}\n${errorOutput}`; expect(allOutput).toContain('symlinks'); expect(allOutput).not.toContain('ralph-tui skills install --copy');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/skills-install.test.ts` around lines 130 - 140, The test "does not suggest --copy again when copy mode is already active" currently only verifies the suppressed hint from one console stream; update it to assert the hint is absent across both console streams by ensuring both console.log and console.error are spied and their outputs checked. Specifically, in this test (and where consoleSpy is set up) add a spy for console.error (e.g., jest.spyOn(console, 'error')) or adjust the existing spy to capture both, then build combined output from both spies (or from consoleSpy.mock.calls if it now captures both) and assert the suppressed hint 'ralph-tui skills install --copy' is not present in any captured output after calling executeSkillsCommand(['install', '--copy']). Ensure you reference the test name and executeSkillsCommand to locate where to change the spying/assertion logic.
🤖 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/commands/skills-install.test.ts`:
- Around line 210-218: The test currently only asserts that 'kiro-cli' appears
somewhere in argv; instead verify that 'kiro-cli' is the value passed directly
after the '-a' flag. In the test for executeSkillsCommand(['install', '--agent',
'kiro']), locate the index of '-a' in mockSpawnArgs[0].args (or equivalent argv
array), assert that index is >= 0, and then assert mockSpawnArgs[0].args[index +
1] === 'kiro-cli' so the payload for '-a' is validated (use the existing
mockSpawnArgs and executeSkillsCommand references).
- Around line 130-140: The test "does not suggest --copy again when copy mode is
already active" currently only verifies the suppressed hint from one console
stream; update it to assert the hint is absent across both console streams by
ensuring both console.log and console.error are spied and their outputs checked.
Specifically, in this test (and where consoleSpy is set up) add a spy for
console.error (e.g., jest.spyOn(console, 'error')) or adjust the existing spy to
capture both, then build combined output from both spies (or from
consoleSpy.mock.calls if it now captures both) and assert the suppressed hint
'ralph-tui skills install --copy' is not present in any captured output after
calling executeSkillsCommand(['install', '--copy']). Ensure you reference the
test name and executeSkillsCommand to locate where to change the
spying/assertion logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 53d39bb8-ac1b-4080-aa77-bb5b4b73ffee
📒 Files selected for processing (3)
src/commands/skills-install.test.tssrc/commands/skills.tswebsite/content/docs/getting-started/installation.mdx
✅ Files skipped from review due to trivial changes (1)
- website/content/docs/getting-started/installation.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/commands/skills.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks @medhatgalal this is solid |
Summary
kiroagent to add-skill/skills agent idkiro-cli--copypassthrough toralph-tui skills installso users can avoid symlink-based installskiroand--copyusage in README + installation docsRoot cause
add-skill/skillsnow validates Kiro askiro-cli(notkiro). The previous mapping caused invalid-agent failures forralph-tui skills install --agent kiro.Changes
src/setup/skill-installer.tsAGENT_ID_MAP.kiro->kiro-clicopyflag support in add-skill args buildersrc/commands/skills.ts--copy--copyto add-skillVerification
-a kirofails as invalid agent-a kiro-clisucceedssrc/setup/skill-installer.test.tssrc/commands/skills.test.ts(with extended timeout due agent detection)src/commands/skills-install.test.tstests/plugins/kiro-agent.test.tsbun run typecheckpassedbun run buildpassedCompatibility
kiro; only add-skill adapter mapping changed--copyis opt-in and non-breakingSummary by CodeRabbit
New Features
--copyflag to skills install (install status now indicates copy vs symlink).--agent kiro.Documentation
--copyguidance.Tests
--copyparsing/propagation, help output, and Kiro-agent install behaviour.