1 command onboarding#145
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
43fbb24 to
f887eed
Compare
f887eed to
6f88d14
Compare
6f88d14 to
abd183d
Compare
abd183d to
0ac7881
Compare
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Detects which AI coding tools (Claude Code, Cursor, Copilot, Cline, Windsurf, etc.) are installed on the user's machine so the onboarding flow can offer to configure each one. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fetches the latest skill bundles from the public ably/agent-skills GitHub repo (tarball + tar/gunzip extraction), and parses each SKILL.md frontmatter to expose the skill name and description for display in the onboarding UI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d6967d2 to
da3111a
Compare
skills-installer copies downloaded skill bundles into the per-tool directories under the user's home (e.g. ~/.cursor/skills, ~/.codeium/windsurf/skills). claude-plugin-installer wires Claude Code to use the official Claude Plugin protocol instead, so skills auto-update from the upstream repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
da3111a to
38726e8
Compare
User-facing 'ably skills install' downloads the latest skills from the upstream repo and installs them into every detected AI coding tool's directory. 'ably skills uninstall' removes them. Skills always overwrite on install to stay in sync with upstream. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Interactive onboarding that authenticates the user (if needed) and multi-selects the AI coding tools detected on their machine to install Agent Skills into. Ends with a brief intro to the CLI. Restricts init/skills* from web CLI mode (filesystem operations) and from interactive mode (one-time setup). Updates the post-install welcome message to point at 'ably init' as the entry point. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…in uninstall Make uninstall symmetric with install: - Remove only subdirectories matching the `ably-` naming convention rather than wiping the shared IDE skills root (e.g. `~/.claude/skills`), which would also delete third-party skills installed alongside Ably's. - When the `claude` CLI is detected, run `claude plugin uninstall` for each Ably plugin and `claude plugin marketplace remove` so plugin- installed targets are actually removed instead of silently leaving them registered. - Drop the parent IDE skills directory only when it ends up empty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38726e8 to
b6a3df0
Compare
WalkthroughThis PR introduces a one-command onboarding flow ( Changes
Review Notes
|
WalkthroughThis PR introduces a one-command onboarding flow ( Changes
Review Notes
|
There was a problem hiding this comment.
Review: 1-command onboarding (ably init + ably skills install/uninstall)
This PR adds a nice onboarding flow. The service layer is well-structured (clean separation of concerns, proper cleanup in finally, good error-type enums). The command logic, flag architecture, and test setup are solid. Four things need attention:
1. Bug — isAlreadyAuthenticated() ignores ABLY_API_KEY and ABLY_TOKEN
src/commands/init.ts lines 177–180:
private isAlreadyAuthenticated(): boolean {
if (process.env.ABLY_ACCESS_TOKEN) return true;
return Boolean(this.configManager.getAccessToken());
}This only checks ABLY_ACCESS_TOKEN and stored access token. It misses ABLY_API_KEY and ABLY_TOKEN — the most common auth methods in scripts and CI. A user with ABLY_API_KEY in their shell always sees the login prompt during ably init, even though they are already authenticated. The base command handles all three env vars correctly (base-command.ts line 459).
Fix:
private isAlreadyAuthenticated(): boolean {
if (process.env.ABLY_ACCESS_TOKEN) return true;
if (process.env.ABLY_API_KEY) return true;
if (process.env.ABLY_TOKEN) return true;
return Boolean(this.configManager.getAccessToken());
}2. Bug — Imports after a const declaration in uninstall.ts
src/commands/skills/uninstall.ts lines 15–22:
import { BaseFlags } from "../../types/cli.js";
// Ably skills follow the `ably-` naming convention...
const ABLY_SKILL_PREFIX = "ably-";
import { formatHeading, formatResource } from "../../utils/output.js";
import { promptForConfirmation } from "../../utils/prompt-confirmation.js";Two import statements appear after a const. Static imports are hoisted so there is no runtime crash, but this violates the import/first lint rule and is clearly accidental ordering. Move ABLY_SKILL_PREFIX to after all imports.
3. Architectural — JSON result does not follow domain key nesting convention
src/commands/skills/install.ts lines 172–183; src/commands/skills/uninstall.ts lines 86–91 and 136.
Project convention (CLAUDE.md): "All domain data must be nested under a domain key — never spread raw data fields at the top level alongside envelope fields." The envelope owns type, command, success. Everything else must sit under one named key.
Current install output spreads skills, installed, pluginInstalled as direct siblings of the envelope fields. Current uninstall output does the same with removed and plugin. This makes it impossible for agents and scripts to reliably distinguish envelope metadata from domain data.
Fix: wrap under a single domain key, e.g. { installation: { skills, installed: allResults, pluginInstalled } }. Update the early-return JSON paths and the test assertions (record.installed etc.) to match.
4. Missing coverage — uninstallClaudePlugin has no unit tests
test/unit/services/claude-plugin-installer.test.ts imports and exercises only installClaudePlugin. The uninstall function has distinct logic: different status states (not-installed, uninstalled, partial, error), a separate "not-installed" message detector, a per-plugin uninstall loop, and marketplace removal with its own error path. None of this is covered.
Overall: Architecture is sound. Issues 1 and 2 are functional bugs; 3 is a JSON contract consistency problem that affects agent and script consumers; 4 is a coverage gap for new production code.
Adds coverage for the previously-untested onboarding surfaces: the Claude Code plugin install outcomes (success/error fallback/partial) in skills:install, the auto-detect branch with and without tools, the interactive prompt branches in init (no tools, empty selection, cancellation, picked targets), the unauth delegation to accounts:login, and direct unit tests for uninstallClaudePlugin (uninstalled/not-installed/partial/error, marketplace-removal failure, isNotInstalledMessage variants). Adds __TEST_MOCKS__ hooks to tool-detector, claude-plugin-installer, and init's runAuth/promptForTargets to enable deterministic testing without a real claude CLI, host AI editors, or OAuth/network. Follows the existing MockConfigManager pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Wrap skills:install JSON output under `installation` and skills:uninstall output under `uninstallation`, per the envelope nesting convention in CLAUDE.md. Update test assertions to read through the new structure. - Rename init's `isAlreadyAuthenticated()` to `hasControlApiAccess()` and document why data-plane env vars (ABLY_API_KEY / ABLY_TOKEN) don't count here — only Control API access (OAuth token) lets `accounts:login` be skipped. - Move stray `ABLY_SKILL_PREFIX` const below the import block in skills/uninstall.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Adds one-command onboarding so developers can go from zero to AI-assisted Ably development in a single step.
ably init— runsably login(if needed) and installs Ably Agent Skills into detected AI coding tools (Claude Code, Cursor, etc.). Auto-detects installed editors, prompts to confirm, and prints next-steps when done.ably skills install/ably skills uninstall— manage Ably Agent Skills independently ofinit. Supports--targetfor explicit editor selection, plugin-based install for Claude Code, and--jsonfor scripting.skills-downloader(fetches the published skills bundle),skills-installer(writes per-editor skill files),claude-plugin-installer(Claude Code plugin path), andtool-detector(auto-detects supported editors).Intent
Today, getting Ably-aware AI assistance requires manually finding, downloading, and wiring skills into each editor. This PR collapses that into
ably initso the CLI itself bootstraps the AI workflow — making Ably's first-run experience match the "AI-native" story we want to tell.Test plan
init,skills install/uninstall, and all new servicesably initon a fresh machine with Claude Code installedably init --target cursorandably skills uninstallround-tripably init --jsonproduces valid envelope output🤖 Generated with Claude Code