-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Adding now-sdk skills #1486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ShantanuPhadke
wants to merge
1
commit into
github:staged
Choose a base branch
from
ShantanuPhadke:scratch/now-sdk-skills
base: staged
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−0
Open
Adding now-sdk skills #1486
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| name: now-sdk-explain | ||
| description: Use whenever the user mentions fluent, ServiceNow, or the now-sdk, OR when the user prompts for edits within a fluent application (identified by a now.config.json at the project root). Fetches SDK documentation via now-sdk explain — covers API types, metadata conventions, skills, and project structure. Pass a topic to read it directly, or omit to browse available topics. | ||
| argument-hint: "[topic]" | ||
| --- | ||
|
|
||
|
|
||
| ## Usage | ||
|
|
||
| IMPORTANT: _Never_ open a full topic without first viewing the summary via the `--peek` option! This will prevent you from accidentally opening the wrong topic and wasting context space. | ||
|
|
||
| To show all available topics with their related tags: | ||
| ```bash | ||
| npx @servicenow/sdk explain --list --format=raw | ||
| ``` | ||
|
|
||
| To search for topics, showing the descriptions of all matches: | ||
| ```bash | ||
| npx @servicenow/sdk explain <topic> --list --peek --format=raw | ||
| ``` | ||
|
|
||
| To preview topics using the `--peek` option: | ||
| ```bash | ||
| npx @servicenow/sdk explain <topic> --peek --format=raw | ||
| ``` | ||
|
|
||
| Once you are certain you want to read the full topic, open it like this: | ||
| ```bash | ||
| npx @servicenow/sdk explain <topic> --format=raw | ||
| ``` | ||
|
|
||
| ## What to Search for | ||
|
|
||
| - **Metadata types** — `BusinessRule`, `Table`, `Acl`, `Flow`, `ScriptInclude`, `ClientScript` | ||
| - **Skills** — workflows like `build`, `transform`, `deploy`, `auth` | ||
| - **Conventions** — `naming`, `structure`, `scoping`, `file-layout` | ||
|
|
||
| ## Prerequisite knowledge and guidelines | ||
|
|
||
| - The first time this skill is invoked in a session, please familiarize yourself with general fluent development by reading everything under `npx @servicenow/sdk explain quickstart --list --format=raw`. | ||
| - Always use the `npx @servicenow/sdk` cli commands whenever possible to create, build, and deploy fluent projects. | ||
|
|
||
| ## For any task — always start here | ||
|
|
||
| - Start by searching for topics using `npx @servicenow/sdk explain <search-term> --list --format=raw`. | ||
| - Continue by reading the relevant topics, always using `npx @servicenow/sdk explain <topic> --peek --format=raw`, to preview the description before committing to read the full topic. | ||
| - Provided the description is relevant, continue to read the full topic using `npx @servicenow/sdk explain <topic> --format=raw`. | ||
| - Many items are spread out across multiple topics. As such, it is very important to read all relevant topics before making any changes. | ||
|
|
||
| ## If a now-sdk command fails | ||
|
|
||
| Invoke `/now-sdk-setup` if the error indicates an environment configuration problem: | ||
|
|
||
| - `@servicenow/sdk is not in this registry` — `@servicenow/sdk` is not installed | ||
| - Node.js version errors (e.g. `The engine "node" is incompatible`) | ||
|
|
||
| Do **not** invoke `/now-sdk-setup` for other errors — these are not environment problems and that skill will not help: | ||
|
|
||
| - `No documentation found for "<topic>"` — wrong topic name, try `--list` | ||
| - `No match for "<topic>"` — use a different search term | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This skill isn't really useful, agents are pretty efficient at checking versions of packages and it also embeds some practices that aren't ideal, such as forcing global install and not checking package.json, so I wouldn't include it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| name: now-sdk-setup | ||
| description: Configure the environment so now-sdk explain is usable. Run before now-sdk-explain if the command is not found or returns errors. | ||
| --- | ||
|
|
||
| ## Step 1: Check Node version | ||
|
|
||
| Run `node --version`. | ||
|
|
||
| Node 20 or higher is required. If the version is below 20, run: | ||
|
|
||
| ```bash | ||
| nvm install 20 | ||
| nvm use 20 | ||
| ``` | ||
|
|
||
| Then re-check `node --version` to confirm before continuing. If there is no node version found, or they don't have nvm, ask them to install node and nvm and then run the command again. | ||
|
|
||
| ## Step 2: Check @servicenow/sdk installation and version | ||
|
|
||
| Run `npx @servicenow/sdk --version` to check the installed version. | ||
|
|
||
| - If `@servicenow/sdk` is not found, install it using `npm install -g @servicenow/sdk@latest`. | ||
| - If the version is below **4.6.0**, update it using `npm install -g @servicenow/sdk@latest`. Version 4.6.0 is the minimum that supports the `explain` command via `npx`. | ||
| - If the version is 4.6.0 or higher, the SDK is ready. Proceed to the next step. | ||
|
|
||
| Verify by running `npx @servicenow/sdk explain quickstart --list --format=raw`. If it succeeds, setup is complete. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is calling it the
now-sdkgoing to be discoverable enough for users, or would/servicenow-sdk-explainbe better since then it's clear that it's related to ServiceNow?