Skip to content

fix(skills): use kiro-cli agent mapping and support --copy installs#349

Merged
subsy merged 4 commits intosubsy:mainfrom
medhatgalal:codex/fix-kiro-cli-skills-copy-mode
Mar 13, 2026
Merged

fix(skills): use kiro-cli agent mapping and support --copy installs#349
subsy merged 4 commits intosubsy:mainfrom
medhatgalal:codex/fix-kiro-cli-skills-copy-mode

Conversation

@medhatgalal
Copy link
Contributor

@medhatgalal medhatgalal commented Mar 4, 2026

Summary

  • map ralph-tui kiro agent to add-skill/skills agent id kiro-cli
  • add --copy passthrough to ralph-tui skills install so users can avoid symlink-based installs
  • document kiro and --copy usage in README + installation docs

Root cause

add-skill/skills now validates Kiro as kiro-cli (not kiro). The previous mapping caused invalid-agent failures for ralph-tui skills install --agent kiro.

Changes

  • src/setup/skill-installer.ts
    • AGENT_ID_MAP.kiro -> kiro-cli
    • add optional copy flag support in add-skill args builder
  • src/commands/skills.ts
    • parse --copy
    • pass --copy to add-skill
    • help text and install status messaging updates
  • tests updated for mapping + copy mode
  • docs updated to include Kiro and copy-mode examples

Verification

  • isolated temp-home smoke check:
    • -a kiro fails as invalid agent
    • -a kiro-cli succeeds
  • tests passed:
    • src/setup/skill-installer.test.ts
    • src/commands/skills.test.ts (with extended timeout due agent detection)
    • src/commands/skills-install.test.ts
    • tests/plugins/kiro-agent.test.ts
  • bun run typecheck passed
  • bun run build passed

Compatibility

  • keeps user-facing ralph agent id as kiro; only add-skill adapter mapping changed
  • --copy is opt-in and non-breaking

Summary by CodeRabbit

  • New Features

    • Added a --copy flag to skills install (install status now indicates copy vs symlink).
    • Added support for installing to the Kiro agent via --agent kiro.
  • Documentation

    • Updated README and installation docs with concrete usage examples and --copy guidance.
  • Tests

    • Added tests covering --copy parsing/propagation, help output, and Kiro-agent install behaviour.

@vercel
Copy link

vercel bot commented Mar 4, 2026

@medhatgalal is attempting to deploy a commit to the plgeek Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ed560d7e-711c-4d16-a055-01e56cbaa47e

📥 Commits

Reviewing files that changed from the base of the PR and between 223b26a and 6fff56d.

📒 Files selected for processing (1)
  • src/setup/skill-installer.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/setup/skill-installer.ts

Walkthrough

Adds a --copy install mode, maps agent id kirokiro-cli, and propagates the copy flag through CLI parsing, add-skill argument construction, tests, and README/website examples.

Changes

Cohort / File(s) Summary
Documentation
README.md, website/content/docs/getting-started/installation.mdx
Added examples showing --agent kiro usage and the new --copy install mode; added bunx add-skill example targeting kiro-cli.
CLI command logic & tests
src/commands/skills.ts, src/commands/skills.test.ts, src/commands/skills-install.test.ts
Added --copy parsing (parseInstallArgs returns copy), propagated copy into buildAddSkillArgs, updated help/output to show copy vs symlink mode, and added tests covering argument propagation and spawn invocations.
Skill installer core & tests
src/setup/skill-installer.ts, src/setup/skill-installer.test.ts
Updated AGENT_ID_MAP to map kirokiro-cli; extended AddSkillInstallOptions with optional copy?: boolean; buildAddSkillInstallArgs appends --copy when requested and tests validate mapping and flag emission.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and accurately summarises the two primary changes: fixing the kiro agent mapping to use kiro-cli and adding support for --copy installs.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.35%. Comparing base (5daa6ef) to head (6fff56d).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/commands/skills.ts 61.53% 5 Missing ⚠️
src/setup/skill-installer.ts 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #349   +/-   ##
=======================================
  Coverage   47.34%   47.35%           
=======================================
  Files         111      111           
  Lines       36430    36446   +16     
=======================================
+ Hits        17248    17258   +10     
- Misses      19182    19188    +6     
Files with missing lines Coverage Δ
src/setup/skill-installer.ts 73.93% <66.66%> (-0.39%) ⬇️
src/commands/skills.ts 65.93% <61.53%> (-0.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
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

🧹 Nitpick comments (1)
src/commands/skills.ts (1)

410-413: Avoid suggesting --copy when 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4477972 and 76a3de9.

📒 Files selected for processing (7)
  • README.md
  • src/commands/skills-install.test.ts
  • src/commands/skills.test.ts
  • src/commands/skills.ts
  • src/setup/skill-installer.test.ts
  • src/setup/skill-installer.ts
  • website/content/docs/getting-started/installation.mdx

Copy link
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.

🧹 Nitpick comments (2)
src/commands/skills-install.test.ts (2)

210-218: Check the -a payload, not just token presence.

This currently proves that kiro-cli appears 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 --copy hint is emitted on console.error in 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

📥 Commits

Reviewing files that changed from the base of the PR and between 76a3de9 and 4a59963.

📒 Files selected for processing (3)
  • src/commands/skills-install.test.ts
  • src/commands/skills.ts
  • website/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

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ralph-tui Ready Ready Preview, Comment Mar 13, 2026 4:46pm

Request Review

@subsy
Copy link
Owner

subsy commented Mar 13, 2026

Thanks @medhatgalal this is solid

@subsy subsy merged commit fcea670 into subsy:main Mar 13, 2026
9 checks passed
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