Skip to content

Switch to using npx skills to install skills#10097

Merged
joehan merged 3 commits intomainfrom
jh-use-npx-skills
Mar 16, 2026
Merged

Switch to using npx skills to install skills#10097
joehan merged 3 commits intomainfrom
jh-use-npx-skills

Conversation

@joehan
Copy link
Member

@joehan joehan commented Mar 13, 2026

Description

Like it says on the tin - this pushes the work of staying up to date with AGYs changes off of our plate, and gets these installs counted on skills.sh

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the Antigravity skill installation process within the Firebase Studio migration logic. By transitioning from manual GitHub API interactions to leveraging the npx skills command, the change offloads the responsibility of managing skill updates and ensures that skill installations are properly tracked. This streamlines maintenance and aligns the installation process with the skills.sh ecosystem.

Highlights

  • Skill Installation Method: Switched the method for installing Antigravity skills from direct GitHub API calls to using the npx skills command-line tool.
  • Code Simplification: Removed the custom downloadGitHubDir utility function and related GitHub API fetching logic, simplifying the codebase.
  • Test Updates: Modified unit tests to reflect the new npx skills command execution, including stubbing spawnSync and asserting its correct invocation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/firebase_studio/migrate.spec.ts
    • Added a stub for child_process.spawnSync in beforeEach to mock external command execution.
    • Removed existing fetchStub mocks that simulated GitHub API responses for skill directories.
    • Removed the stub for child_process.execSync as it's no longer relevant to the new installation method.
    • Added an assertion to verify that npx skills add is called with the correct arguments.
  • src/firebase_studio/migrate.ts
    • Imported spawnSync from the child_process module.
    • Deleted the downloadGitHubDir asynchronous function, which was responsible for recursively fetching directories from GitHub.
    • Replaced the logic for fetching and downloading skills via GitHub API with a call to spawnSync to execute npx skills add.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the skill installation process in the Firebase Studio migration to use npx skills add instead of directly downloading files from GitHub. The changes are logical and simplify the implementation. I've added a few suggestions to improve error handling, test coverage for failure cases, and code structure in the tests, in line with the repository's best practices.


beforeEach(() => {
sandbox.stub(fs, "stat").resolves({ isDirectory: () => true } as any);
const cp = require("child_process");
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The child_process module is required multiple times within this test file. To improve code clarity and avoid redundancy, consider declaring a variable for the module at the top of the describe block and initializing it once in the beforeEach function. This would make it accessible to all tests within this suite.

For example:

describe("migrate", () => {
  let cp: typeof import("child_process");
  // ...
  beforeEach(() => {
    cp = require("child_process");
    // ...
  });
  // ...
});

beforeEach(() => {
sandbox.stub(fs, "stat").resolves({ isDirectory: () => true } as any);
const cp = require("child_process");
sandbox.stub(cp, "spawnSync").returns({ status: 0 });
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This stub only covers the success case for spawnSync. The implementation in migrate.ts handles failures where spawnSync returns a non-zero status or an error object. To comply with the repository's style guide (line 46), which requires testing error cases, please add tests for these failure scenarios. For instance, you could test that a warning is logged when spawnSync is stubbed to return { status: 1 }.

References
  1. Test error cases and edge conditions, not just the "happy path." (link)

Comment on lines +264 to 266
if (result.status !== 0) {
throw new Error(`npx skills add exited with code ${result.status}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To align with the error handling strategy in this repository and the style guide (line 30), please throw a FirebaseError instead of a generic Error. This ensures consistent error reporting.

Suggested change
if (result.status !== 0) {
throw new Error(`npx skills add exited with code ${result.status}`);
}
if (result.status !== 0) {
throw new FirebaseError(`npx skills add exited with code ${result.status}`);
}
References
  1. Throw FirebaseError (src/error.ts) for expected, user-facing errors. If the error is due to a violation of a precondition (e.g. something that is null but should never be), specify a non-zero exit code. (link)

@christhompsongoogle christhompsongoogle self-requested a review March 13, 2026 20:35
@joehan joehan merged commit 2e1db46 into main Mar 16, 2026
26 checks passed
@joehan joehan deleted the jh-use-npx-skills branch March 16, 2026 18:07
andrewbrook pushed a commit that referenced this pull request Mar 25, 2026
* Switch to using npx skills to install skills

* format + cleanup
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.

3 participants